source: branches/blt4/packages/vizservers/nanovis/ContourLineFilter.h @ 2742

Last change on this file since 2742 was 1982, checked in by gah, 13 years ago

Clean up debugging/printing traces

File size: 1.4 KB
Line 
1#ifndef _CONTOURFILTER_H_
2#define _CONTOURFILTER_H_
3
4#include "Vector3.h"
5#include "Vector4.h"
6#include "TypeDefs.h"
7#include <R2/graphics/R2Geometry.h>
8#include <list>
9
10class ContourLineFilter {
11public :
12    class ContourLine {
13    public :
14        float _value;
15        std::list<Vector3> _points;
16    public :
17        ContourLine(float value);
18       
19    private :
20        bool isValueWithIn(float v1, float v2) {
21            return ((_value >= v1 && _value <= v2) ||
22                    (_value >= v2 && _value <= v1));
23        }
24        void getContourPoint(int vertexIndex1, int vertexIndex2, Vector3* vertices, int width, bool top);
25        void getContourPoint(int vertexIndex1, int vertexIndex2, Vector4* vertices, int width, bool top);
26    public : 
27        /**
28         * @brief
29         * @ret Returns the number of points
30         */
31        int createLine(int width, int height, Vector3* vertices, bool top);
32        int createLine(int width, int height, Vector4* vertices, bool top);
33    };
34   
35    typedef std::list<ContourLine*> ContourLineList;
36   
37private :
38    ContourLineList _lines;
39    Vector3Array* _colorMap;
40    bool _top;
41public :
42    ContourLineFilter();
43   
44private :
45    void clear();
46   
47public :
48    R2Geometry* create(float min, float max, int linecount, Vector3* vertices, int width, int height);
49    R2Geometry* create(float min, float max, int linecount, Vector4* vertices, int width, int height);
50    void setColorMap(Vector3Array* colorMap);
51   
52    void setHeightTop(bool top)
53    {
54        _top = top;
55    }
56};
57
58#endif
Note: See TracBrowser for help on using the repository browser.