QXRD
0.11.16
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
qxrd
source
qxrdplotvectorfielddata.cpp
Go to the documentation of this file.
1
#include "
qxrdplotvectorfielddata.h
"
2
3
QxrdPlotVectorFieldData::QxrdPlotVectorFieldData
()
4
{
5
}
6
7
void
QxrdPlotVectorFieldData::append
(
const
QxrdPoint4D
&pt)
8
{
9
d_samples.append(pt);
10
}
11
12
QRectF
QxrdPlotVectorFieldData::boundingRect
()
const
13
{
14
int
n = d_samples.count();
15
16
if
(n > 0) {
17
double
minx, maxx, miny, maxy;
18
19
for
(
int
i=0; i<n; i++) {
20
QxrdPoint4D
pt = d_samples[i];
21
double
x0 = pt.
x
(),
22
y0 = pt.
y
();
23
double
x1 = x0 + pt.
z
(),
24
y1 = y0 + pt.
t
();
25
26
if
(i==0) {
27
minx = qMin(x0, x1);
28
maxx = qMax(x0, x1);
29
miny = qMin(y0, y1);
30
maxy = qMax(y0, y1);
31
}
else
{
32
minx = qMin(minx, x0);
33
minx = qMin(minx, x1);
34
maxx = qMax(maxx, x0);
35
maxx = qMax(maxx, x1);
36
miny = qMin(miny, y0);
37
miny = qMin(miny, y1);
38
maxy = qMax(maxy, y0);
39
maxy = qMax(maxy, y1);
40
}
41
}
42
43
return
QRectF(minx, miny, maxx - minx, maxy - miny);
44
}
else
{
45
return
QRectF();
46
}
47
}
48
qxrdplotvectorfielddata.h
QxrdPoint4D::t
double t() const
Definition:
qxrdpoint4d.h:67
QxrdPoint4D::y
double y() const
Definition:
qxrdpoint4d.h:57
QxrdPlotVectorFieldData::boundingRect
QRectF boundingRect() const
Definition:
qxrdplotvectorfielddata.cpp:12
QxrdPoint4D::x
double x() const
Definition:
qxrdpoint4d.h:52
QxrdPlotVectorFieldData::QxrdPlotVectorFieldData
QxrdPlotVectorFieldData()
Definition:
qxrdplotvectorfielddata.cpp:3
QxrdPlotVectorFieldData::append
void append(const QxrdPoint4D &pt)
Definition:
qxrdplotvectorfielddata.cpp:7
QxrdPoint4D::z
double z() const
Definition:
qxrdpoint4d.h:62
QxrdPoint4D
Definition:
qxrdpoint4d.h:4
Generated by
1.8.10