24 #include <dtkCoreSupport/dtkGlobal.h>
31 class axlCircleArcPrivate {
47 d(new axlCircleArcPrivate) {
61 d(new axlCircleArcPrivate) {
77 d(new axlCircleArcPrivate) {
80 this->setParent(other.parent());
81 d->point1 = other.d->point1;
82 d->point2 = other.d->point2;
83 d->center = other.d->center;
84 d->normal = other.d->normal;
86 d->direct = other.d->direct;
95 QString res =
"axlCircleArc";
96 res.append(
"\nPoint1: " + d->point1.description());
97 res.append(
"\nPoint2: " + d->point2.description());
98 res.append(
"\nNormal: " + d->normal.description());
99 res.append(
"\nCenter: " + d->center.description());
100 res.append(
"\nDirect: " + QString::number(d->direct));
106 return "axlCircleArc";
148 if (newNormal.
norm() > 0.001)
173 d->point1.coordinates()[0] = point1[0];
174 d->point1.coordinates()[1] = point1[1];
175 d->point1.coordinates()[2] = point1[2];
179 d->point2.coordinates()[0] = point2[0];
180 d->point2.coordinates()[1] = point2[1];
181 d->point2.coordinates()[2] = point2[2];
185 d->center.coordinates()[0] = center[0];
186 d->center.coordinates()[1] = center[1];
187 d->center.coordinates()[2] = center[2];
191 d->normal.coordinates()[0] = normal[0];
192 d->normal.coordinates()[1] = normal[1];
193 d->normal.coordinates()[2] = normal[2];
197 d->point1 = other.d->point1;
198 d->point2 = other.d->point2;
199 d->normal = other.d->normal;
200 d->center = other.d->center;
202 d->direct = other.d->direct;
223 d->point1.transformAsPoint(matrix);
224 d->point2.transformAsPoint(matrix);
225 d->center.transformAsPoint(matrix);
226 d->normal.transformAsVector(matrix);
280 if (newNormal.
norm() > 0.001)
286 QVariant
id = QVariant::fromValue(
identifier());
287 QVariant direct = QVariant::fromValue(d->direct);
288 QVariantList
center = d->center.convertDataToQVariant();
289 QVariantList
point1 = d->point1.convertDataToQVariant();
290 QVariantList
point2 = d->point2.convertDataToQVariant();
291 QVariantList
normal = d->normal.convertDataToQVariant();
298 QVariant name = QVariant::fromValue(objectName());
306 center.append(data.at(1));
307 center.append(data.at(2));
308 center.append(data.at(3));
309 center.append(data.at(4));
310 center.append(data.at(5));
311 d->center.convertQVariantToData(center);
313 point1.append(data.at(6));
314 point1.append(data.at(7));
315 point1.append(data.at(8));
316 point1.append(data.at(9));
317 point1.append(data.at(10));
318 d->point1.convertQVariantToData(point1);
320 point2.append(data.at(11));
321 point2.append(data.at(12));
322 point2.append(data.at(13));
323 point2.append(data.at(14));
324 point2.append(data.at(15));
325 d->point2.convertQVariantToData(point2);
327 normal.append(data.at(16));
328 normal.append(data.at(17));
329 normal.append(data.at(18));
330 normal.append(data.at(19));
331 normal.append(data.at(20));
332 d->normal.convertQVariantToData(normal);
334 setObjectName(data.last().toString());
bool isDirect(void) const
Class axlPoint defines 3D points.
void onCenterZChanged(double z)
virtual ~axlCircleArc(void)
void onPoint1XChanged(double x)
axlPoint point1(void) const
virtual QString identifier(void) const
void modifyCenter(double *center)
void setValues(const axlPoint &point1, const axlPoint &point2, const axlPoint ¢er, const axlPoint &normal, bool direct=true)
void modifyPoint2(double *point2)
double calculateRadius(void) const
void setCenter(const axlPoint ¢er)
int convertQVariantToData(const QVariantList &data)
Modify properties and geometry variables of the axlAbstractData. Return 1 if the modification was suc...
void onNormalYChanged(double y)
void setDirect(bool direct)
void onPoint2XChanged(double x)
void onNormalZChanged(double z)
axlCircleArc(QObject *parent=0)
axlPoint center(void) const
void onNormalXChanged(double x)
void applyMatrix(double *matrix)
void modifyNormal(double *normal)
void onCenterYChanged(double y)
axlCircleArc & operator=(const axlCircleArc &other)
void modifyPoint1(double *point1)
QDebug operator<<(QDebug dbg, axlCircleArc arc)
Generic interface for parametric curve.
dtkAbstractData * createaxlCircleArc(void)
virtual void onDirectChanged(bool direct)
axlPoint point2(void) const
void onPoint2YChanged(double y)
axlPoint & normalized(void)
void setPoint1(const axlPoint &point1)
axlPoint calculateNormal(void) const
virtual QString description(void) const
void onCenterXChanged(double x)
void setPoint2(const axlPoint &point2)
axlPoint normal(void) const
void onPoint1YChanged(double y)
void onPoint1ZChanged(double z)
static axlPoint crossProduct(const axlPoint &lhs, const axlPoint &rhs)
Returns the cross product between lhs (coords) and rhs (coords).
static double distance(const axlPoint &lhs, const axlPoint &rhs)
Returns the distance between lhs point and rhs point.
QVariantList convertDataToQVariant(void) const
Convert an axlAbstractData into a QVariantList that specifies all properties of the axlAbstractData...
void onPoint2ZChanged(double z)
void setNormal(const axlPoint &normal)