Changeset 2827 for trunk/packages/vizservers/nanovis/ContourLineFilter.h
- Timestamp:
- Mar 7, 2012 2:01:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/ContourLineFilter.h
r2798 r2827 1 1 /* -*- 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> 4 8 5 9 #include "Vector3.h" 6 10 #include "Vector4.h" 7 #include "TypeDefs.h"8 #include <R2/graphics/R2Geometry.h>9 #include <list>10 11 11 class ContourLineFilter { 12 public : 13 class ContourLine { 14 public : 12 class ContourLineFilter 13 { 14 public: 15 class ContourLine 16 { 17 public: 15 18 float _value; 16 19 std::list<Vector3> _points; 17 public : 20 18 21 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 { 22 33 return ((_value >= v1 && _value <= v2) || 23 34 (_value >= v2 && _value <= v1)); 24 35 } 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); 34 38 }; 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 43 42 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); 52 48 53 49 void setHeightTop(bool top) … … 55 51 _top = top; 56 52 } 53 54 private: 55 void clear(); 56 57 ContourLineList _lines; 58 Vector3Array *_colorMap; 59 bool _top; 57 60 }; 58 61
Note: See TracChangeset
for help on using the changeset viewer.