[89] | 1 | #ifndef qwt3d_SurfacePlot_h__2004_03_05_11_36_begin_guarded_code
|
---|
| 2 | #define qwt3d_SurfacePlot_h__2004_03_05_11_36_begin_guarded_code
|
---|
| 3 |
|
---|
| 4 | #include "qwt3d_plot.h"
|
---|
| 5 |
|
---|
| 6 | namespace Qwt3D
|
---|
| 7 | {
|
---|
| 8 | //! A class representing Surfaces
|
---|
| 9 | /**
|
---|
| 10 | A SurfacePlot ...
|
---|
| 11 |
|
---|
| 12 | */
|
---|
| 13 | class QWT3D_EXPORT SurfacePlot : public Plot3D
|
---|
| 14 | {
|
---|
| 15 | Q_OBJECT
|
---|
| 16 |
|
---|
| 17 | public:
|
---|
| 18 | #if QT_VERSION < 0x040000
|
---|
| 19 | SurfacePlot( QWidget* parent = 0, const char* name = 0 );
|
---|
| 20 | #else
|
---|
| 21 | SurfacePlot( QWidget * parent = 0, const QGLWidget * shareWidget = 0 );
|
---|
| 22 | #endif
|
---|
| 23 | ~SurfacePlot();
|
---|
| 24 | void updateNormals(); //!< Recalculates surface normals;
|
---|
| 25 | int resolution() const {return resolution_p;} //!< Returns data resolution (1 means all data)
|
---|
| 26 | std::pair<int,int> facets() const; //!< Returns the number of mesh cells for the ORIGINAL data
|
---|
| 27 | bool loadFromData(Qwt3D::Triple** data, unsigned int columns, unsigned int rows
|
---|
| 28 | , bool uperiodic = false, bool vperiodic = false);
|
---|
| 29 | bool loadFromData(double** data, unsigned int columns, unsigned int rows
|
---|
| 30 | ,double minx, double maxx, double miny, double maxy);
|
---|
| 31 | bool loadFromData(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly);
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | //! Equivalent to loadFromData();
|
---|
| 35 | /**
|
---|
| 36 | \deprecated Use loadFromData instead
|
---|
| 37 | */
|
---|
| 38 | bool createDataRepresentation(Qwt3D::Triple** data, unsigned int columns, unsigned int rows
|
---|
| 39 | , bool uperiodic = false, bool vperiodic = false)
|
---|
| 40 | {
|
---|
| 41 | return loadFromData(data, columns, rows, uperiodic, vperiodic);
|
---|
| 42 | }
|
---|
| 43 | //! Equivalent to loadFromData();
|
---|
| 44 | /**
|
---|
| 45 | \deprecated Use loadFromData instead
|
---|
| 46 | */
|
---|
| 47 | bool createDataRepresentation(double** data, unsigned int columns, unsigned int rows
|
---|
| 48 | ,double minx, double maxx, double miny, double maxy)
|
---|
| 49 | {
|
---|
| 50 | return loadFromData(data, columns, rows, minx, maxx, miny, maxy);
|
---|
| 51 | }
|
---|
| 52 | //! Equivalent to loadFromData();
|
---|
| 53 | /**
|
---|
| 54 | \deprecated Use loadFromData instead
|
---|
| 55 | */
|
---|
| 56 | bool createDataRepresentation(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly)
|
---|
| 57 | {
|
---|
| 58 | return loadFromData(data, poly);
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 | Qwt3D::FLOORSTYLE floorStyle() const { return floorstyle_;} //!< Return floor style
|
---|
| 63 | void setFloorStyle( Qwt3D::FLOORSTYLE val ) {floorstyle_ = val;} //!< Sets floor style
|
---|
| 64 | void showNormals(bool); //!< Draw normals to every vertex
|
---|
| 65 | bool normals() const { return datanormals_p;} //!< Returns \c true, if normal drawing is on
|
---|
| 66 |
|
---|
| 67 | void setNormalLength(double val); //!< Sets length of normals in percent per hull diagonale
|
---|
| 68 | double normalLength() const { return normalLength_p; }//!< Returns relative length of normals
|
---|
| 69 | void setNormalQuality(int val); //!< Increases plotting quality of normal arrows
|
---|
| 70 | int normalQuality() const { return normalQuality_p; }//!< Returns plotting quality of normal arrows
|
---|
| 71 |
|
---|
| 72 |
|
---|
| 73 | signals:
|
---|
| 74 | void resolutionChanged(int);
|
---|
| 75 |
|
---|
| 76 | public slots:
|
---|
| 77 | void setResolution( int );
|
---|
| 78 |
|
---|
| 79 | protected:
|
---|
| 80 | bool datanormals_p;
|
---|
| 81 | double normalLength_p;
|
---|
| 82 | int normalQuality_p;
|
---|
| 83 |
|
---|
| 84 | virtual void calculateHull();
|
---|
| 85 | virtual void createData();
|
---|
| 86 | virtual void createEnrichment(Qwt3D::Enrichment& p);
|
---|
| 87 | virtual void createFloorData();
|
---|
| 88 | void createNormals();
|
---|
| 89 | void createPoints();
|
---|
| 90 |
|
---|
| 91 | int resolution_p;
|
---|
| 92 |
|
---|
| 93 | void readIn(Qwt3D::GridData& gdata, Triple** data, unsigned int columns, unsigned int rows);
|
---|
| 94 | void readIn(Qwt3D::GridData& gdata, double** data, unsigned int columns, unsigned int rows,
|
---|
| 95 | double minx, double maxx, double miny, double maxy);
|
---|
| 96 | void calcNormals(GridData& gdata);
|
---|
| 97 | void sewPeriodic(GridData& gdata);
|
---|
| 98 |
|
---|
| 99 | //void calcLowResolution();
|
---|
| 100 | private:
|
---|
| 101 |
|
---|
| 102 | void Data2Floor();
|
---|
| 103 | void Isolines2Floor();
|
---|
| 104 |
|
---|
| 105 | Qwt3D::FLOORSTYLE floorstyle_;
|
---|
| 106 |
|
---|
| 107 | // grid plot
|
---|
| 108 |
|
---|
| 109 | Qwt3D::GridData* actualDataG_;
|
---|
| 110 | virtual void createDataG();
|
---|
| 111 | virtual void createFloorDataG();
|
---|
| 112 | void createNormalsG();
|
---|
| 113 | void Data2FloorG();
|
---|
| 114 | void Isolines2FloorG();
|
---|
| 115 | void setColorFromVertexG(int ix, int iy, bool skip = false);
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | // mesh plot
|
---|
| 119 |
|
---|
| 120 | Qwt3D::CellData* actualDataC_;
|
---|
| 121 | virtual void createDataC();
|
---|
| 122 | virtual void createFloorDataC();
|
---|
| 123 | void createNormalsC();
|
---|
| 124 | void Data2FloorC();
|
---|
| 125 | void Isolines2FloorC();
|
---|
| 126 | void setColorFromVertexC(int node, bool skip = false);
|
---|
| 127 | };
|
---|
| 128 |
|
---|
| 129 | } // ns
|
---|
| 130 |
|
---|
| 131 |
|
---|
| 132 | #endif
|
---|