22 #include "frameitem.h" 92 ThreeDItem(
double x0 = 4,
double y0 = 3,
double width = 15,
93 double height = 10,
unsigned colFrame = 0,
unsigned colGrid = 0,
94 unsigned colData = 0,
bool logX =
false,
bool logY =
false,
95 bool logZ =
false,
GridMode gridMode = AxesWithLabels,
96 Mode3D mode3D = Grid,
double xMax = 15,
double yMax = 10,
97 double zMax = 15,
const QString& textX =
"",
99 const QString& header =
"",
double relSize = 1,
int numDigX = -1,
100 int numDigY = -1,
int numDigZ = -1,
int minTicX = 5,
101 int minTicY = 2,
int minTicZ = 5,
int expX = 0,
int expY = 0,
102 int expZ = 0,
double xMin = 0,
double yMin = 0,
double zMin = 0,
103 double xTic = 5,
double yTic = 2,
double zTic = 5,
104 double deltaX = 0,
double deltaZ = 0,
double phi = 20,
105 double theta = -20,
double boxX = 7.5,
double boxY = 7.5,
106 double boxZ = 7.5,
double xRef = 7.5,
double yRef = 4,
107 double fx = 1,
double fy = 1,
double fz = 1,
108 bool showFrame =
true,
bool collapsed =
false,
109 bool visible =
true);
127 ThreeDItem(
const KConfigGroup* plo,
double x0,
double y0,
double width,
128 double height,
unsigned colorFrame,
unsigned colorGrid,
129 unsigned colorData,
GridMode gridMode);
135 inline double boxX()
const {
return m_boxX; };
137 inline double boxY()
const {
return m_boxY; };
139 inline double boxZ()
const {
return m_boxZ; };
141 inline unsigned colorData()
const {
return m_colorData; };
143 inline double deltaX()
const {
return m_deltaX; };
145 inline double deltaZ()
const {
return m_deltaZ; };
153 void exportTable(
QTextStream& stream,
char separator,
char format,
154 int precision)
const;
156 inline int expZ()
const {
return m_expZ; };
158 inline double fX()
const {
return m_fX; };
160 inline double fY()
const {
return m_fY; };
162 inline double fZ()
const {
return m_fZ; };
164 inline bool logZ()
const {
return m_logZ; };
166 inline int minTicZ()
const {
return m_minTicZ; };
173 inline int numDigZ()
const {
return m_numDigZ; };
184 inline double phi()
const {
return m_phi; };
224 inline void setFX(
double fx) { m_fX = fx; };
229 inline void setFY(
double fy) { m_fY = fy; };
234 inline void setFZ(
double fz) { m_fZ = fz; };
239 inline void setLogZ(
bool logZ) { m_logZ = logZ; };
244 inline void setMinTicZ(
int minTicZ) { m_minTicZ = minTicZ; };
254 inline void setNumDigZ(
int numDigZ) { m_numDigZ = numDigZ; };
259 inline void setPhi(
double phi) { m_phi = phi; };
279 inline void setTheta(
double theta) { m_theta = theta; };
284 inline void setXRef(
double xRef) { m_xRef = xRef; };
289 inline void setYRef(
double yRef) { m_yRef = yRef; };
294 inline void setZMax(
double zMax) { m_zMax = zMax; };
299 inline void setZMin(
double zMin) { m_zMin = zMin; };
304 inline void setZTic(
double zTic) { m_zTic = zTic; };
310 inline double theta()
const {
return m_theta; };
317 void writePlo(KConfigGroup* plo)
const;
319 inline double xRef()
const {
return m_xRef; };
321 inline double yRef()
const {
return m_yRef; };
323 double**
yValues()
const {
return m_yValues; };
325 inline double zMax()
const {
return m_zMax; };
327 inline double zMin()
const {
return m_zMin; };
329 inline double zTic()
const {
return m_zTic; };
355 void axis3D(
QPainter* painter,
double vMin,
double vMax,
double tic,
357 double f,
double scale,
double xAxis,
double zAxis,
358 double ticLen,
int numDig,
Axis axis,
bool log,
372 double dir = 0)
const;
391 void line3D(
QPainter* painter,
double x1,
double y1,
double z1,
392 double x2,
double y2,
double z2,
PSGraph* ps = 0)
const;
418 void plot3D(
QPainter* painter,
bool xArray,
bool yArray,
bool zArray,
419 const double* xData,
const double* yData,
420 const double* zData,
double xScale,
double yScale,
421 double zScale,
bool firstLine,
int n,
double xOffset,
422 double yOffset,
double* vertex,
PSGraph* ps = 0)
const;
432 void plotArray(
QPainter* painter,
const double* x,
const double* y,
int n,
447 double xFrom3d(
double x,
double z)
const;
454 double yFrom3d(
double x,
double y,
double z)
const;
455 bool m_showFrame, m_logZ;
456 mutable bool logXo, logZo;
457 int m_numDigZ, m_minTicZ, m_expZ;
460 unsigned m_colorData;
461 double m_zMin, m_zMax, m_deltaX, m_deltaZ, m_zTic, m_phi, m_theta, m_boxX,
462 m_boxY, m_boxZ, m_xRef, m_yRef, m_fX, m_fY, m_fZ, zminl;
463 mutable double xStep, zStep, xMino, xMaxo, deltaXo, zMino, zMaxo, deltaZo,
464 scalx, scaly, scalz, scal3D, phio, thetao, xOff3D, yOff3D;
465 mutable double** m_yValues;
466 mutable double vertex[16];
double fX() const
Returns normalization factor for x values.
Definition: threeditem.h:158
double deltaZ() const
Returns z step size of grid.
Definition: threeditem.h:145
int expZ() const
Returns logarithm of normalization factor for z axis.
Definition: threeditem.h:156
bool showFrame() const
Returns true for shown frame.
Definition: threeditem.h:306
double boxZ() const
Returns z box width in cm.
Definition: threeditem.h:139
void setFZ(double fz)
Sets z normalization factor.
Definition: threeditem.h:234
double yRef() const
Returns y position of center of box bottom plane.
Definition: threeditem.h:321
Mode3D mode3D() const
Returns 0 for lines parallel to x, 1 for lines parallel to z, 2 for x,z grid.
Definition: threeditem.h:171
int numDigZ() const
Returns number of digits for z axis.
Definition: threeditem.h:173
GridMode
Grid mode.
Definition: frameitem.h:37
void setTheta(double theta)
Sets angle of rotation about y axis.
Definition: threeditem.h:279
double ** yValues() const
Returns pointer to y value array.
Definition: threeditem.h:323
void update()
Applies changes and forces redrawing.
void setPhi(double phi)
Sets angle of rotation about y axis.
Definition: threeditem.h:259
double deltaX() const
Returns x step size of grid.
Definition: threeditem.h:143
Alignment
Text alignment.
Definition: textitem.h:33
void setBoxY(double width)
Sets y box width in cm.
Definition: threeditem.h:194
double zMin() const
Returns lower z data limit user units.
Definition: threeditem.h:327
double boxX() const
Returns x box width in cm.
Definition: threeditem.h:135
void setColorData(unsigned color)
Sets color for data.
Definition: threeditem.h:204
double xRef() const
Returns x position of center of box bottom plane.
Definition: threeditem.h:319
void setNumDigZ(int numDigZ)
Sets number of digits for z axis.
Definition: threeditem.h:254
double zMax() const
Returns upper z data limit user units.
Definition: threeditem.h:325
void setDeltaZ(double dz)
Sets z step size of grid.
Definition: threeditem.h:214
Mode3D
3D mode.
Definition: threeditem.h:34
void setMinTicZ(int minTicZ)
Sets number of intervals between major tics of z axis.
Definition: threeditem.h:244
void setDeltaX(double dx)
Sets x step size of grid.
Definition: threeditem.h:209
PS graphics class.
Definition: psgraph.h:45
unsigned colorData() const
Returns color for data.
Definition: threeditem.h:141
void setZTic(double zTic)
Sets z tic distance.
Definition: threeditem.h:304
void drawText(QPainter *painter, const QString &text, double x, double y, TextItem::Alignment alignment, double dir=0) const
Plots text.
double width() const
Returns width in cm.
Definition: frameitem.h:408
double boxY() const
Returns y box width in cm.
Definition: threeditem.h:137
int minTicZ() const
Returns number of intervals between major tics of z axis.
Definition: threeditem.h:166
x axis.
Definition: threeditem.h:334
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Paints item.
Axis
3D mode.
Definition: threeditem.h:333
double phi() const
Returns angle of rotation about y axis in deg.
Definition: threeditem.h:184
QString textZ() const
Returns z axis text.
Definition: threeditem.h:308
void setShowFrame(bool showFrame)
Sets frame mode.
Definition: threeditem.h:269
double zTic() const
Returns distance between major tics of z axis.
Definition: threeditem.h:329
void setTextZ(const QString &text)
Sets z axis text.
Definition: threeditem.h:274
virtual QRectF boundingRect() const
Calculates bounding rectangle.
double fY() const
Returns normalization factor for y values.
Definition: threeditem.h:160
void setExpZ(int e)
Sets exponent of z normalization factor.
Definition: threeditem.h:219
void paintCond(QPainter *painter) const
Paints or calculates bounding area.
y axis.
Definition: threeditem.h:335
void setProperties()
Sets properties according to transformation matrix.
Lines along x direction.
Definition: threeditem.h:35
void setMode3D(Mode3D mode3D)
Sets 3D mode.
Definition: threeditem.h:249
void setXRef(double xRef)
Sets x position of center of box bottom plane.
Definition: threeditem.h:284
double theta() const
Returns angle of rotation about y axis in deg.
Definition: threeditem.h:310
void setZMin(double zMin)
Sets lower z data limit.
Definition: threeditem.h:299
void setYRef(double yRef)
Sets y position of center of box bottom plane.
Definition: threeditem.h:289
3D item class.
Definition: threeditem.h:30
void setFY(double fy)
Sets y normalization factor.
Definition: threeditem.h:229
void setLogZ(bool logZ)
Sets logarithmic mode of z axis.
Definition: threeditem.h:239
Lines along z direction.
Definition: threeditem.h:36
void setZMax(double zMax)
Sets upper z data limit.
Definition: threeditem.h:294
void setBoxX(double width)
Sets x box width in cm.
Definition: threeditem.h:189
double fZ() const
Returns normalization factor for z values.
Definition: threeditem.h:162
bool logZ() const
Returns true for logarithmic z axis.
Definition: threeditem.h:164
void writePlo(KConfigGroup *plo) const
Writes into plot file.
Frame item class.
Definition: frameitem.h:33
void setFX(double fx)
Sets x normalization factor.
Definition: threeditem.h:224
void setBoxZ(double width)
Sets z box width in cm.
Definition: threeditem.h:199