24 #include <dtkCoreSupport/dtkGlobal.h>
53 d->basePoint =
new axlPoint(1.0, 0.0, 0.0);
68 d->basePoint =
new axlPoint(basePoint);
82 d->basePoint =
new axlPoint(basePoint);
93 this->setParent(other.parent());
94 d->apex =
new axlPoint(other.d->apex);
95 d->basePoint =
new axlPoint(other.d->basePoint);
96 d->radius = other.
radius();
125 *(d->apex) = *(other.d->apex);
126 *(d->basePoint) = *(other.d->basePoint);
127 d->radius = other.
radius();
175 *(d->basePoint) = *basePoint;
194 d->apex->coordinates()[0] = apex[0];
195 d->apex->coordinates()[1] = apex[1];
196 d->apex->coordinates()[2] = apex[2];
205 *(d->basePoint) = *basePoint;
212 d->basePoint->coordinates()[0] = basePoint[0];
213 d->basePoint->coordinates()[1] = basePoint[1];
214 d->basePoint->coordinates()[2] = basePoint[2];
234 double oldLength = this->
length();
237 (*d->basePoint) = *(d->apex) + (*(d->basePoint) - *(d->apex)) * (length/oldLength) ;
240 qDebug()<<
"cone is not correctly defined length = 0.0";
253 d->basePoint->setCoordinates(basePoint.
x(),basePoint.
y(),basePoint.
z());
259 d->apex->setCoordinates(apex.
x(),apex.
y(),apex.
z());
290 QString result =
"axlCone";
292 return "Please set an apex";
295 return "Please set a base point";
297 result.append(
"\napex : "+d->apex->description() +
"\nbase point : "+d->basePoint->description() +
"\nradius : "+ QString::number(d->radius));
315 *(d->basePoint) = *basePoint;
329 QVariant
id = QVariant::fromValue(
identifier());
330 QVariant
radius = QVariant::fromValue(d->radius);
331 QVariantList base = d->basePoint->convertDataToQVariant();
332 QVariantList
apex = d->apex->convertDataToQVariant();
337 QVariant name = QVariant::fromValue(objectName());
345 QVariantList baseList;
346 baseList.append(data.at(2));
347 baseList.append(data.at(3));
348 baseList.append(data.at(4));
349 baseList.append(data.at(5));
350 baseList.append(data.at(6));
351 d->basePoint->convertQVariantToData(baseList);
352 QVariantList apexList;
353 apexList.append(data.at(7));
354 apexList.append(data.at(8));
355 apexList.append(data.at(9));
356 apexList.append(data.at(10));
357 d->apex->convertQVariantToData(apexList);
358 setObjectName(data.last().toString());
Class axlPoint defines 3D points.
QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
axlCone & operator=(const axlCone &other)
Assigns other to this cone and returns a reference to this cone.
virtual QString identifier(void) const
virtual QString description(void) const
QDebug operator<<(QDebug dbg, axlCone cone)
void touchApex(axlPoint apex)
~axlCone(void)
Destroys the axel cone.
void setApex(axlPoint *apex)
Change apex of this cone.
void onApexChanged(axlPoint *apex)
void setRadius(double radius)
Change radius of this cone.
axlPoint * apex(void) const
Returns apex of the cone.
axlCone(QObject *parent=0)
Constructs a axel cone of with apex and basePoint point are NULL and 1.0 radius with parent parent of...
double length(void) const
Returns length of the cone.
void touchBasePoint(axlPoint basePoint)
void onRadiusChanged(double radius)
void setLength(double length)
Change length of this cone we considered then apex is the origin of the cone and we change base point...
void onBasePointChanged(axlPoint *basePoint)
void setValues(axlPoint *apex, axlPoint *basePoint, double radius)
Change apex and basePoint of this cone.
Class axlCone defines 3D cones.
axlPoint * basePoint(void) const
Returns basePoint point of the cone.
void setBasePoint(axlPoint *basePoint)
Change base point of this cone.
static double distance(const axlPoint &lhs, const axlPoint &rhs)
Returns the distance between lhs point and rhs point.
int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
Class axlAbstractData defines an API for all type of axel data.
double radius(void) const
Returns radius of the cone.
dtkAbstractData * createaxlCone(void)
void touchRadius(double radius)