source: trunk/packages/vizservers/nanovis/ContourLineFilter.h @ 3464

Last change on this file since 3464 was 3463, checked in by ldelgass, 11 years ago

Begin process of renaming R2 library

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