Ignore:
Timestamp:
Mar 7, 2012 2:01:55 PM (12 years ago)
Author:
ldelgass
Message:

Move Vector3/4Array typdefs to the Vector3/4.h headers and remove TypeDefs?.h.
Also misc. cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/ContourLineFilter.h

    r2798 r2827  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef _CONTOURFILTER_H_
    3 #define _CONTOURFILTER_H_
     2#ifndef CONTOURLINEFILTER_H
     3#define CONTOURLINEFILTER_H
     4
     5#include <list>
     6
     7#include <R2/graphics/R2Geometry.h>
    48
    59#include "Vector3.h"
    610#include "Vector4.h"
    7 #include "TypeDefs.h"
    8 #include <R2/graphics/R2Geometry.h>
    9 #include <list>
    1011
    11 class ContourLineFilter {
    12 public :
    13     class ContourLine {
    14     public :
     12class ContourLineFilter
     13{
     14public:
     15    class ContourLine
     16    {
     17    public:
    1518        float _value;
    1619        std::list<Vector3> _points;
    17     public :
     20
    1821        ContourLine(float value);
    19        
    20     private :
    21         bool isValueWithIn(float v1, float v2) {
     22
     23        /**
     24         * @brief
     25         * @ret Returns the number of points
     26         */
     27        int createLine(int width, int height, Vector3 *vertices, bool top);
     28        int createLine(int width, int height, Vector4 *vertices, bool top);
     29
     30    private:
     31        bool isValueWithIn(float v1, float v2)
     32        {
    2233            return ((_value >= v1 && _value <= v2) ||
    2334                    (_value >= v2 && _value <= v1));
    2435        }
    25         void getContourPoint(int vertexIndex1, int vertexIndex2, Vector3* vertices, int width, bool top);
    26         void getContourPoint(int vertexIndex1, int vertexIndex2, Vector4* vertices, int width, bool top);
    27     public : 
    28         /**
    29          * @brief
    30          * @ret Returns the number of points
    31          */
    32         int createLine(int width, int height, Vector3* vertices, bool top);
    33         int createLine(int width, int height, Vector4* vertices, bool top);
     36        void getContourPoint(int vertexIndex1, int vertexIndex2, Vector3 *vertices, int width, bool top);
     37        void getContourPoint(int vertexIndex1, int vertexIndex2, Vector4 *vertices, int width, bool top);
    3438    };
    35    
    36     typedef std::list<ContourLine*> ContourLineList;
    37    
    38 private :
    39     ContourLineList _lines;
    40     Vector3Array* _colorMap;
    41     bool _top;
    42 public :
     39
     40    typedef std::list<ContourLine *> ContourLineList;
     41
    4342    ContourLineFilter();
    44    
    45 private :
    46     void clear();
    47    
    48 public :
    49     R2Geometry* create(float min, float max, int linecount, Vector3* vertices, int width, int height);
    50     R2Geometry* create(float min, float max, int linecount, Vector4* vertices, int width, int height);
    51     void setColorMap(Vector3Array* colorMap);
     43
     44    R2Geometry *create(float min, float max, int linecount, Vector3 *vertices, int width, int height);
     45    R2Geometry *create(float min, float max, int linecount, Vector4 *vertices, int width, int height);
     46
     47    void setColorMap(Vector3Array *colorMap);
    5248   
    5349    void setHeightTop(bool top)
     
    5551        _top = top;
    5652    }
     53
     54private:
     55    void clear();
     56
     57    ContourLineList _lines;
     58    Vector3Array *_colorMap;
     59    bool _top;
    5760};
    5861
Note: See TracChangeset for help on using the changeset viewer.