cherish
Polygon.h
1 #ifndef POLYGON_H
2 #define POLYGON_H
3 
4 #include "Settings.h"
5 #include "Entity2D.h"
6 #include "ShaderedEntity2D.h"
7 #include "libSGControls/ProgramPolygon.h"
8 
9 #include <osg/Geometry>
10 #include <osgDB/ObjectWrapper>
11 
12 namespace entity {
13 
48 {
49 public:
51  Polygon();
52 
54  Polygon(const Polygon& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
55 
56  META_Node(entity, Polygon)
57 
58 
60  virtual bool copyFrom(const entity::ShaderedEntity2D* copy);
61 
63  void editLastPoint(float u, float v);
64 
66  void removeLastPoint();
67 
71  virtual bool redefineToShape(osg::MatrixTransform *t = 0);
72 
74  bool isPolygon() const;
75 
76  virtual void appendPoint(const float u, const float v);
77 
78 public:
79 
82  cher::ENTITY_TYPE getEntityType() const;
83 
84  virtual ProgramPolygon* getProgram() const;
85 
86 protected:
87 
88  bool redefineToShader(osg::MatrixTransform *t);
89 
90 private:
91 };
92 } // namespace entity
93 
94 #endif // POLYGON_H
virtual bool redefineToShape(osg::MatrixTransform *t=0)
Definition: Polygon.cpp:70
Definition: ProgramPolygon.h:12
Polygon()
Definition: Polygon.cpp:16
Scene graph entities.
Definition: AddEntityCommand.h:17
bool isPolygon() const
Definition: Polygon.cpp:88
Geometry class that defines opacity polygons drawn by a user. The creation and usage of this class mu...
Definition: Polygon.h:47
virtual bool copyFrom(const entity::ShaderedEntity2D *copy)
Definition: ShaderedEntity2D.cpp:61
bool redefineToShader(osg::MatrixTransform *t)
Definition: Polygon.cpp:108
Settings is a configuration variables file for Cherish: enums, consts, defaults. Contains settings su...
void removeLastPoint()
Definition: Polygon.cpp:52
Abstract class for all the shaderized entities, i.e., strokes, polygons and line segments.
Definition: ShaderedEntity2D.h:18
cher::ENTITY_TYPE getEntityType() const
Definition: Polygon.cpp:98