| 1 | #ifndef qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code
|
|---|
| 2 | #define qwt3d_enrichment_h__2004_02_23_19_24_begin_guarded_code
|
|---|
| 3 |
|
|---|
| 4 | #include "qwt3d_global.h"
|
|---|
| 5 | #include "qwt3d_types.h"
|
|---|
| 6 |
|
|---|
| 7 | namespace Qwt3D
|
|---|
| 8 | {
|
|---|
| 9 |
|
|---|
| 10 | class Plot3D;
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | //! Abstract base class for data dependent visible user objects
|
|---|
| 14 | /**
|
|---|
| 15 | Enrichments provide a framework for user defined OPenGL objects. The base class has a pure virtuell
|
|---|
| 16 | function clone(). 2 additional functions are per default empty and could also get a new implementation
|
|---|
| 17 | in derived classes. They can be used for initialization issues or actions not depending on the related
|
|---|
| 18 | primitive.
|
|---|
| 19 | */
|
|---|
| 20 | class QWT3D_EXPORT Enrichment
|
|---|
| 21 | {
|
|---|
| 22 | public:
|
|---|
| 23 | enum TYPE{
|
|---|
| 24 | VERTEXENRICHMENT,
|
|---|
| 25 | EDGEENRICHMENT,
|
|---|
| 26 | FACEENRICHMENT,
|
|---|
| 27 | VOXELENRICHMENT
|
|---|
| 28 | }; //!< Type of the Enrichment - only VERTEXENRICHMENT's are defined at this moment.
|
|---|
| 29 |
|
|---|
| 30 | Enrichment() : plot(0) {}
|
|---|
| 31 | virtual ~Enrichment(){}
|
|---|
| 32 | virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here
|
|---|
| 33 | virtual void drawBegin(){}; //!< Empty per default. Can be overwritten.
|
|---|
| 34 | virtual void drawEnd(){}; //!< Empty per default. Can be overwritten.
|
|---|
| 35 | virtual void assign(Plot3D const& pl) {plot = &pl;} //!< Assign to existent plot;
|
|---|
| 36 | virtual TYPE type() const = 0; //!< Overwrite
|
|---|
| 37 |
|
|---|
| 38 | protected:
|
|---|
| 39 | const Plot3D* plot;
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | //! Abstract base class for vertex dependent visible user objects
|
|---|
| 43 | /**
|
|---|
| 44 | VertexEnrichments introduce a specialized draw routine for vertex dependent data.
|
|---|
| 45 | draw() is called, when the Plot realizes its internal OpenGL data representation
|
|---|
| 46 | for every Vertex associated to his argument.
|
|---|
| 47 | */
|
|---|
| 48 | class QWT3D_EXPORT VertexEnrichment : public Enrichment
|
|---|
| 49 | {
|
|---|
| 50 | public:
|
|---|
| 51 |
|
|---|
| 52 | VertexEnrichment() : Qwt3D::Enrichment() {}
|
|---|
| 53 | virtual Enrichment* clone() const = 0; //!< The derived class should give back a new Derived(something) here
|
|---|
| 54 | virtual void draw(Qwt3D::Triple const&) = 0; //!< Overwrite this
|
|---|
| 55 | virtual TYPE type() const {return Qwt3D::Enrichment::VERTEXENRICHMENT;} //!< This gives VERTEXENRICHMENT
|
|---|
| 56 | };
|
|---|
| 57 |
|
|---|
| 58 | // todo EdgeEnrichment, FaceEnrichment, VoxelEnrichment etc.
|
|---|
| 59 |
|
|---|
| 60 | } // ns
|
|---|
| 61 |
|
|---|
| 62 | #endif
|
|---|