21 #include <dtkCoreSupport/dtkGlobal.h>
27 class axlTorusPrivate {
32 double crossSectionRadius;
41 d(new axlTorusPrivate) {
46 d->direction =
new axlPoint(1.0, 0.0, 0.0);
48 d->crossSectionRadius = 0.2;
53 d(new axlTorusPrivate) {
58 d->direction =
new axlPoint(direction);
65 d(new axlTorusPrivate) {
70 d->direction =
new axlPoint(direction);
77 d(new axlTorusPrivate) {
80 this->setParent(other.parent());
81 d->center =
new axlPoint(other.d->center);
82 d->direction =
new axlPoint(other.d->direction);
83 d->ringRadius = other.d->ringRadius;
84 d->crossSectionRadius = other.d->crossSectionRadius;
101 QString res =
"axlTorus";
102 res.append(
"\nCenter: " + d->center->description());
103 res.append(
"\nDirection: " + d->direction->description());
104 res.append(
"\nRing radius: " + QString::number(d->ringRadius));
105 res.append(
"\nCross section radius: " + QString::number(d->crossSectionRadius));
122 return d->ringRadius;
126 return d->crossSectionRadius;
130 *(d->center) = *center;
131 *(d->direction) = *direction;
137 *(d->center) = *center;
141 *(d->direction) = *direction;
153 d->center->coordinates()[0] = center[0];
154 d->center->coordinates()[1] = center[1];
155 d->center->coordinates()[2] = center[2];
160 d->direction->coordinates()[0] = direction[0];
161 d->direction->coordinates()[1] = direction[1];
162 d->direction->coordinates()[2] = direction[2];
168 d->center->setCoordinates(center.
x(),center.
y(),center.
z());
174 d->direction->setCoordinates(direction.
x(),direction.
y(),direction.
z());
191 *(d->center) = *(other.d->center);
192 *(d->direction) = *(other.d->direction);
193 d->ringRadius = other.d->ringRadius;
194 d->crossSectionRadius = other.d->crossSectionRadius;
215 *(d->center) = *center;
220 *(d->direction) = *direction;
236 QVariant
id = QVariant::fromValue(
identifier());
238 QVariant
ringRadius = QVariant::fromValue(d->ringRadius);
239 QVariantList center = d->center->convertDataToQVariant();
240 QVariantList
direction = d->direction->convertDataToQVariant();
243 list.append(direction);
244 list.append(crossSectionRadius);
245 list.append(ringRadius);
246 QVariant name = QVariant::fromValue(objectName());
254 center.append(data.at(1));
255 center.append(data.at(2));
256 center.append(data.at(3));
257 center.append(data.at(4));
258 center.append(data.at(5));
259 d->center->convertQVariantToData(center);
261 direction.append(data.at(6));
262 direction.append(data.at(7));
263 direction.append(data.at(8));
264 direction.append(data.at(9));
265 direction.append(data.at(10));
266 d->direction->convertQVariantToData(direction);
269 setObjectName(data.last().toString());
Class axlPoint defines 3D points.
void onDirectionChanged(axlPoint *direction)
void setCenter(axlPoint *center)
axlTorus(QObject *parent=0)
void setCrossSectionRadius(double crossSectionRadius)
void onCrossSectionRadiusChanged(double crossSectionRadius)
void onCenterChanged(axlPoint *center)
dtkAbstractData * createaxlTorus(void)
void touchCenterPoint(axlPoint center)
void touchCrossSectionRadius(double crossSectionRadius)
void setValues(axlPoint *center, axlPoint *direction, double ringRadius, double crossSectionRadius)
void onRingRadiusChanged(double ringRadius)
axlTorus & operator=(const axlTorus &other)
QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
void touchDirection(axlPoint direction)
int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
axlPoint * centerPoint(void) const
void setRingRadius(double ringRadius)
void setDirection(axlPoint *direction)
virtual QString identifier(void) const
QDebug operator<<(QDebug dbg, axlTorus torus)
double ringRadius(void) const
axlPoint * direction(void) const
double crossSectionRadius(void) const
Class axlAbstractData defines an API for all type of axel data.
void touchRingRadius(double ringRadius)
virtual QString description(void) const