26 #include <dtkGuiSupport/dtkColorButton.h>
27 #include <dtkGuiSupport/dtkSplitter.h>
31 class axlInspectorObjectCircleArcPrivate {
33 QSlider *sliderOpacity;
34 dtkColorButton *colorButton;
37 QDoubleSpinBox* coordinatePoint1_x;
38 QDoubleSpinBox* coordinatePoint1_y;
39 QDoubleSpinBox* coordinatePoint1_z;
41 QDoubleSpinBox* coordinatePoint2_x;
42 QDoubleSpinBox* coordinatePoint2_y;
43 QDoubleSpinBox* coordinatePoint2_z;
45 QDoubleSpinBox* coordinateCenter_x;
46 QDoubleSpinBox* coordinateCenter_y;
47 QDoubleSpinBox* coordinateCenter_z;
49 QDoubleSpinBox* coordinateNormal_x;
50 QDoubleSpinBox* coordinateNormal_y;
51 QDoubleSpinBox* coordinateNormal_z;
53 QLabel* coordinateNormalLabel_x;
54 QLabel* coordinateNormalLabel_y;
55 QLabel* coordinateNormalLabel_z;
57 QCheckBox* counterClockWiseCheckBox;
61 QLabel* linedUpMessage;
62 QLabel* centerModifiedMessage;
67 QComboBox *comboBoxShader;
69 QCheckBox* checkBoxShader;
70 QLineEdit* lineEditShader;
71 QPushButton* buttonShader;
77 d(new axlInspectorObjectCircleArcPrivate)
80 d->coordinatePoint1_x = NULL;
81 d->coordinatePoint1_y = NULL;
82 d->coordinatePoint1_z = NULL;
84 d->coordinatePoint2_x = NULL;
85 d->coordinatePoint2_y = NULL;
86 d->coordinatePoint2_z = NULL;
88 d->coordinateCenter_x = NULL;
89 d->coordinateCenter_y = NULL;
90 d->coordinateCenter_z = NULL;
92 d->coordinateNormal_x = NULL;
93 d->coordinateNormal_y = NULL;
94 d->coordinateNormal_z = NULL;
99 d->colorButton = NULL;
101 d->comboBoxShader = NULL;
103 d->checkBoxShader = NULL;
104 d->lineEditShader = NULL;
105 d->buttonShader = NULL;
107 d->sliderOpacity = NULL;
116 return QSize(300, 300);
122 connect(d->arc, SIGNAL(modifiedGeometry()),
this, SLOT(
updateValues()));
125 void axlInspectorObjectCircleArc::initWidget(
void) {
128 d->linedUpMessage =
new QLabel(
"Point1, Point2 and Center are lined up.\nPlease provide the normal of the plane\ncontaining the circle arc.");
129 d->linedUpMessage->setStyleSheet(
"color: #0000FF;");
130 d->linedUpMessage->setVisible(
false);
133 d->centerModifiedMessage =
new QLabel(
"Warning: your center has been modified\nto be on the mediatory of [Point1;Point2].");
134 d->centerModifiedMessage->setStyleSheet(
"color: #FF6600;");
135 d->centerModifiedMessage->setVisible(
false);
139 QHBoxLayout *layoutSize =
new QHBoxLayout;
140 layoutSize->addWidget(
new QLabel(
"Size",
this));
145 d->size =
new QDoubleSpinBox(
this);
146 d->size->setDecimals(3);
147 d->size->setRange(0, 100);
148 d->size->setSingleStep(0.1);
149 d->size->setValue(d->arc->size());
150 layoutSize->addWidget(d->size);
153 d->sliderOpacity =
new QSlider(Qt::Horizontal,
this);
155 QHBoxLayout *layoutOpacity =
new QHBoxLayout;
156 layoutOpacity->addWidget(
new QLabel(
"Opacity",
this));
157 layoutOpacity->addWidget(d->sliderOpacity);
158 d->sliderOpacity->setMaximum(100);
159 d->sliderOpacity->setValue(initOpacityValue());
162 d->colorButton =
new dtkColorButton(
this);
164 QHBoxLayout *layoutColorButton =
new QHBoxLayout;
165 layoutColorButton->addWidget(
new QLabel(
"Color",
this));
166 layoutColorButton->addWidget(d->colorButton);
167 d->colorButton->setColor(this->initColorValue());
170 d->coordinatePoint1_x =
new QDoubleSpinBox(
this);
171 d->coordinatePoint1_x->setRange(-1000.0, 1000.0);
172 d->coordinatePoint1_x->setValue(d->arc->point1().x());
173 d->coordinatePoint1_x->setSingleStep(0.1);
175 QHBoxLayout *layoutPoint1_x =
new QHBoxLayout;
176 layoutPoint1_x->addWidget(
new QLabel(
"X",
this));
177 layoutPoint1_x->addWidget(d->coordinatePoint1_x);
179 d->coordinatePoint1_y =
new QDoubleSpinBox(
this);
180 d->coordinatePoint1_y->setRange(-1000.0, 1000.0);
181 d->coordinatePoint1_y->setValue(d->arc->point1().y());
182 d->coordinatePoint1_y->setSingleStep(0.1);
184 QHBoxLayout *layoutPoint1_y =
new QHBoxLayout;
185 layoutPoint1_y->addWidget(
new QLabel(
"Y",
this));
186 layoutPoint1_y->addWidget(d->coordinatePoint1_y);
188 d->coordinatePoint1_z =
new QDoubleSpinBox(
this);
189 d->coordinatePoint1_z->setRange(-1000.0, 1000.0);
190 d->coordinatePoint1_z->setValue(d->arc->point1().z());
191 d->coordinatePoint1_z->setSingleStep(0.1);
193 QHBoxLayout *layoutPoint1_z =
new QHBoxLayout;
194 layoutPoint1_z->addWidget(
new QLabel(
"Z",
this));
195 layoutPoint1_z->addWidget(d->coordinatePoint1_z);
197 QVBoxLayout *layoutPoint1 =
new QVBoxLayout;
199 layoutPoint1->addWidget(
new QLabel(
"Point1:",
this));
200 layoutPoint1->addLayout(layoutPoint1_x);
201 layoutPoint1->addLayout(layoutPoint1_y);
202 layoutPoint1->addLayout(layoutPoint1_z);
205 d->coordinatePoint2_x =
new QDoubleSpinBox(
this);
206 d->coordinatePoint2_x->setRange(-1000.0, 1000.0);
207 d->coordinatePoint2_x->setValue(d->arc->point2().x());
208 d->coordinatePoint2_x->setSingleStep(0.1);
210 QHBoxLayout *layoutPoint2_x =
new QHBoxLayout;
211 layoutPoint2_x->addWidget(
new QLabel(
"X",
this));
212 layoutPoint2_x->addWidget(d->coordinatePoint2_x);
214 d->coordinatePoint2_y =
new QDoubleSpinBox(
this);
215 d->coordinatePoint2_y->setRange(-1000.0, 1000.0);
216 d->coordinatePoint2_y->setValue(d->arc->point2().y());
217 d->coordinatePoint2_y->setSingleStep(0.1);
219 QHBoxLayout *layoutPoint2_y =
new QHBoxLayout;
220 layoutPoint2_y->addWidget(
new QLabel(
"Y",
this));
221 layoutPoint2_y->addWidget(d->coordinatePoint2_y);
223 d->coordinatePoint2_z =
new QDoubleSpinBox(
this);
224 d->coordinatePoint2_z->setRange(-1000.0, 1000.0);
225 d->coordinatePoint2_z->setValue(d->arc->point2().z());
226 d->coordinatePoint2_z->setSingleStep(0.1);
228 QHBoxLayout *layoutPoint2_z =
new QHBoxLayout;
229 layoutPoint2_z->addWidget(
new QLabel(
"Z",
this));
230 layoutPoint2_z->addWidget(d->coordinatePoint2_z);
232 QVBoxLayout *layoutPoint2 =
new QVBoxLayout;
234 layoutPoint2->addWidget(
new QLabel(
"Point2:",
this));
235 layoutPoint2->addLayout(layoutPoint2_x);
236 layoutPoint2->addLayout(layoutPoint2_y);
237 layoutPoint2->addLayout(layoutPoint2_z);
240 d->coordinateCenter_x =
new QDoubleSpinBox(
this);
241 d->coordinateCenter_x->setRange(-1000.0, 1000.0);
242 d->coordinateCenter_x->setValue(d->arc->center().x());
243 d->coordinateCenter_x->setSingleStep(0.1);
245 QHBoxLayout *layoutCenter_x =
new QHBoxLayout;
246 layoutCenter_x->addWidget(
new QLabel(
"X",
this));
247 layoutCenter_x->addWidget(d->coordinateCenter_x);
249 d->coordinateCenter_y =
new QDoubleSpinBox(
this);
250 d->coordinateCenter_y->setRange(-1000.0, 1000.0);
251 d->coordinateCenter_y->setValue(d->arc->center().y());
252 d->coordinateCenter_y->setSingleStep(0.1);
254 QHBoxLayout *layoutCenter_y =
new QHBoxLayout;
255 layoutCenter_y->addWidget(
new QLabel(
"Y",
this));
256 layoutCenter_y->addWidget(d->coordinateCenter_y);
258 d->coordinateCenter_z =
new QDoubleSpinBox(
this);
259 d->coordinateCenter_z->setRange(-1000.0, 1000.0);
260 d->coordinateCenter_z->setValue(d->arc->center().z());
261 d->coordinateCenter_z->setSingleStep(0.1);
263 QHBoxLayout *layoutCenter_z =
new QHBoxLayout;
264 layoutCenter_z->addWidget(
new QLabel(
"Z",
this));
265 layoutCenter_z->addWidget(d->coordinateCenter_z);
267 QVBoxLayout *layoutCenter =
new QVBoxLayout;
269 layoutCenter->addWidget(
new QLabel(
"Center:",
this));
270 layoutCenter->addLayout(layoutCenter_x);
271 layoutCenter->addLayout(layoutCenter_y);
272 layoutCenter->addLayout(layoutCenter_z);
275 d->radiusLabel =
new QLabel(QString::number(d->arc->calculateRadius()));
277 QHBoxLayout *layoutRadius =
new QHBoxLayout;
278 layoutRadius->addWidget(
new QLabel(
"Radius",
this));
279 layoutRadius->addWidget(d->radiusLabel);
282 d->coordinateNormal_x =
new QDoubleSpinBox(
this);
283 d->coordinateNormal_x->setRange(-1000.0, 1000.0);
284 d->coordinateNormal_x->setValue(d->arc->normal().x());
285 d->coordinateNormal_x->setSingleStep(0.1);
287 d->coordinateNormalLabel_x =
new QLabel(QString::number(d->arc->normal().x()));
289 QHBoxLayout *layoutNormal_x =
new QHBoxLayout;
290 layoutNormal_x->addWidget(
new QLabel(
"X",
this));
291 layoutNormal_x->addWidget(d->coordinateNormalLabel_x);
292 layoutNormal_x->addWidget(d->coordinateNormal_x);
294 d->coordinateNormal_y =
new QDoubleSpinBox(
this);
295 d->coordinateNormal_y->setRange(-1000.0, 1000.0);
296 d->coordinateNormal_y->setValue(d->arc->normal().y());
297 d->coordinateNormal_y->setSingleStep(0.1);
299 d->coordinateNormalLabel_y =
new QLabel(QString::number(d->arc->normal().y()));
301 QHBoxLayout *layoutNormal_y =
new QHBoxLayout;
302 layoutNormal_y->addWidget(
new QLabel(
"Y",
this));
303 layoutNormal_y->addWidget(d->coordinateNormalLabel_y);
304 layoutNormal_y->addWidget(d->coordinateNormal_y);
306 d->coordinateNormal_z =
new QDoubleSpinBox(
this);
307 d->coordinateNormal_z->setRange(-1000.0, 1000.0);
308 d->coordinateNormal_z->setValue(d->arc->normal().z());
309 d->coordinateNormal_z->setSingleStep(0.1);
311 d->coordinateNormalLabel_z =
new QLabel(QString::number(d->arc->normal().z()));
313 QHBoxLayout *layoutNormal_z =
new QHBoxLayout;
314 layoutNormal_z->addWidget(
new QLabel(
"Z",
this));
315 layoutNormal_z->addWidget(d->coordinateNormalLabel_z);
316 layoutNormal_z->addWidget(d->coordinateNormal_z);
318 QVBoxLayout *layoutNormal =
new QVBoxLayout;
320 layoutNormal->addWidget(
new QLabel(
"Normal:",
this));
321 layoutNormal->addWidget(d->linedUpMessage);
322 layoutNormal->addLayout(layoutNormal_x);
323 layoutNormal->addLayout(layoutNormal_y);
324 layoutNormal->addLayout(layoutNormal_z);
326 d->coordinateNormal_x->setVisible(
false);
327 d->coordinateNormal_y->setVisible(
false);
328 d->coordinateNormal_z->setVisible(
false);
331 d->counterClockWiseCheckBox =
new QCheckBox(
"Counter Clock Wise",
this);
332 d->counterClockWiseCheckBox->setChecked(d->arc->isDirect());
335 d->comboBoxShader =
new QComboBox(
this);
336 d->comboBoxShader->setInsertPolicy(QComboBox::InsertAlphabetically);
338 d->checkBoxShader =
new QCheckBox(
this);
339 d->lineEditShader =
new QLineEdit(
this);
340 d->buttonShader =
new QPushButton(
this);
341 d->buttonShader->setText(
"open");
343 d->lineEditShader->setText(this->initShaderValue());
344 this->initComboBoxShaderValue();
346 if(d->lineEditShader->text().isEmpty())
348 d->lineEditShader->setEnabled(
false);
349 d->buttonShader->setEnabled(
false);
350 d->comboBoxShader->setEnabled(
false);
353 d->checkBoxShader->setChecked(
true);
356 QVBoxLayout *layoutShader =
new QVBoxLayout;
357 QHBoxLayout *layoutShader1 =
new QHBoxLayout;
359 QLabel *labelShader =
new QLabel(
"Shader",
this);
360 layoutShader1->addWidget(labelShader);
361 layoutShader1->addWidget(d->checkBoxShader);
362 layoutShader1->addWidget(d->comboBoxShader);
363 layoutShader1->addWidget(d->buttonShader);
365 layoutShader1->setStretchFactor(labelShader, 2);
366 layoutShader1->setStretchFactor(d->checkBoxShader, 1);
367 layoutShader1->setStretchFactor(d->comboBoxShader, 4);
368 layoutShader1->setStretchFactor(d->buttonShader, 3);
370 layoutShader->addLayout(layoutShader1);
371 layoutShader->addWidget(d->lineEditShader);
373 QVBoxLayout *layoutTop =
new QVBoxLayout(
this);
375 layoutTop->addWidget(
new QLabel(
"axlInspectorObjectCircleArc",
this));
377 layoutTop->addLayout(layoutPoint1);
378 layoutTop->addLayout(layoutPoint2);
379 layoutTop->addLayout(layoutCenter);
380 layoutTop->addLayout(layoutRadius);
381 layoutTop->addLayout(layoutNormal);
383 layoutTop->addWidget(d->counterClockWiseCheckBox);
385 layoutTop->addLayout(layoutSize);
387 layoutTop->addLayout(layoutColorButton);
388 layoutTop->addLayout(layoutOpacity);
390 layoutTop->addWidget(d->centerModifiedMessage);
392 layoutTop->addLayout(layoutShader);
394 QWidget *top =
new QWidget(
this);
395 top->setLayout(layoutTop);
396 top->setMaximumWidth(295);
398 dtkSplitter *splitter =
new dtkSplitter(
this,
true);
399 splitter->setOrientation(Qt::Vertical);
400 splitter->addWidget(top);
402 QVBoxLayout *layout =
new QVBoxLayout(
this);
403 layout->setContentsMargins(0, 0, 0, 0);
404 layout->setSpacing(0);
405 layout->addWidget(splitter);
411 connect(d->coordinatePoint1_x, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
412 connect(d->coordinatePoint1_y, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
413 connect(d->coordinatePoint1_z, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
415 connect(d->coordinatePoint1_x, SIGNAL(valueChanged(
double)),
this, SLOT(
manageCenter(
double)));
416 connect(d->coordinatePoint1_y, SIGNAL(valueChanged(
double)),
this, SLOT(
manageCenter(
double)));
417 connect(d->coordinatePoint1_z, SIGNAL(valueChanged(
double)),
this, SLOT(
manageCenter(
double)));
423 connect(d->coordinatePoint2_x, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
424 connect(d->coordinatePoint2_y, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
425 connect(d->coordinatePoint2_z, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
427 connect(d->coordinatePoint2_x, SIGNAL(valueChanged(
double)),
this, SLOT(
manageCenter(
double)));
428 connect(d->coordinatePoint2_y, SIGNAL(valueChanged(
double)),
this, SLOT(
manageCenter(
double)));
429 connect(d->coordinatePoint2_z, SIGNAL(valueChanged(
double)),
this, SLOT(
manageCenter(
double)));
439 connect(d->coordinateCenter_x, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
440 connect(d->coordinateCenter_y, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
441 connect(d->coordinateCenter_z, SIGNAL(valueChanged(
double)),
this, SLOT(
manageNormal(
double)));
443 connect(d->counterClockWiseCheckBox, SIGNAL(clicked()),
this, SLOT(
inverseNormal()));
446 connect(d->size, SIGNAL(valueChanged(
double)),
this, SLOT(
onSizeChanged(
double)));
448 connect(d->colorButton, SIGNAL(colorChanged(QColor)),
this, SLOT(
onColorChanged(QColor)));
450 connect(d->sliderOpacity, SIGNAL(valueChanged(
int)),
this, SLOT(
onOpacityChanged(
int)));
451 connect(d->comboBoxShader, SIGNAL(currentIndexChanged(QString)),
this, SLOT(
onLineEditShaderChanged(QString)));
453 connect(d->buttonShader, SIGNAL(clicked()),
this, SLOT(
openShader()));
454 connect(d->lineEditShader, SIGNAL(textChanged(QString)),
this, SLOT(
onShaderChanged(QString)));
457 QString axlInspectorObjectCircleArc::initShaderValue(
void) {
458 return d->arc->shader();
461 int axlInspectorObjectCircleArc::initSizeValue(
void) {
462 return 100.0*(log(d->arc->size()/0.125))/log(2.0);
465 QColor axlInspectorObjectCircleArc::initColorValue(
void) {
466 return d->arc->color();
469 int axlInspectorObjectCircleArc::initOpacityValue(
void) {
470 double initOpacity = 0.0;
471 double opacity = d->arc->opacity();
472 if(opacity > initOpacity)
473 initOpacity = opacity;
475 return 100 * (1.0 - initOpacity);
479 if(d->lineEditShader->isEnabled()) {
481 fileToOpen = QFileDialog::getOpenFileName(
this, tr(
"Open shader"),
"", tr(
"vs file (*.vs)"));
482 d->lineEditShader->setText(fileToOpen);
487 d->arc->setShader(shader);
491 d->arc->touchProperty();
496 d->comboBoxShader->setEnabled(
true);
497 d->lineEditShader->setEnabled(
true);
498 d->buttonShader->setEnabled(
true);
503 d->comboBoxShader->setEnabled(
false);
504 d->lineEditShader->setEnabled(
false);
505 d->buttonShader->setEnabled(
false);
507 d->arc->setShader(
"");
513 d->arc->touchProperty();
516 void axlInspectorObjectCircleArc::initComboBoxShaderValue(
void) {
517 if(d->comboBoxShader) {
523 QDir dirShader(
":axlShader/shader/");
524 dirShader.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
526 dirShader.setNameFilters(filters);
528 QFileInfoList list = dirShader.entryInfoList();
533 QSettings settings(
"inria",
"dtk");
535 settings.beginGroup(
"shader");
536 QString defaultPathShader = settings.value(
"path", defaultPath).toString();
537 defaultPathShader.append(
"/");
539 QDir defaultDirShader(defaultPathShader);
540 defaultDirShader.setNameFilters(filters);
541 QFileInfoList list2 = defaultDirShader.entryInfoList();
547 for (
int i = 0; i < list.size(); ++i) {
548 if(!items.contains(list.at(i).fileName()))
549 items << list.at(i).fileName();
553 int indInitShader = -1;
554 int indCurrentShader = -1;
556 foreach(QString item, items) {
558 d->comboBoxShader->addItem(item);
560 QFileInfo currentFileInfo(d->lineEditShader->text());
562 if(currentFileInfo.exists())
564 if(item == currentFileInfo.fileName())
565 indInitShader =indCurrentShader;
570 if(indInitShader != -1)
571 d->comboBoxShader->setCurrentIndex(indInitShader);
577 QDir dirShader(
":axlShader/shader/");
578 dirShader.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
580 QFileInfo currentFile(dirShader, shader);
581 if(!currentFile.exists()) {
582 QSettings settings(
"inria",
"dtk");
584 settings.beginGroup(
"shader");
585 QString defaultPathShader = settings.value(
"path", defaultPath).toString();
586 defaultPathShader.append(
"/");
588 QDir defaultDirShader(defaultPathShader);
589 currentFile = QFileInfo(defaultDirShader, shader);
591 d->lineEditShader->setText(currentFile.absoluteFilePath());
595 d->arc->onPoint1XChanged(x);
596 d->arc->touchGeometry();
601 d->arc->onPoint1YChanged(y);
602 d->arc->touchGeometry();
607 d->arc->onPoint1ZChanged(z);
608 d->arc->touchGeometry();
613 d->arc->onPoint2XChanged(x);
614 d->arc->touchGeometry();
619 d->arc->onPoint2YChanged(y);
620 d->arc->touchGeometry();
625 d->arc->onPoint2ZChanged(z);
626 d->arc->touchGeometry();
631 d->arc->onCenterXChanged(x);
632 d->arc->touchGeometry();
637 d->arc->onCenterYChanged(y);
638 d->arc->touchGeometry();
643 d->arc->onCenterZChanged(z);
644 d->arc->touchGeometry();
649 d->arc->onNormalXChanged(x);
650 d->arc->touchGeometry();
655 d->arc->onNormalYChanged(y);
656 d->arc->touchGeometry();
661 d->arc->onNormalZChanged(z);
662 d->arc->touchGeometry();
667 QVariant variant = d->arc->QObject::property(
"size");
668 if(variant.isValid()) {
669 d->arc->setSize(size);
678 QVariant variant = d->arc->QObject::property(
"color");
679 if(variant.isValid()) {
680 d->arc->setColor(color);
683 d->arc->touchProperty();
689 double opacity_d = 1.0 - 0.01 * opacity;
691 QVariant variant = d->arc->QObject::property(
"opacity");
692 if(variant.isValid()) {
693 d->arc->setOpacity(opacity_d);
696 d->arc->touchProperty();
702 axlPoint p1(d->coordinatePoint1_x->text().toDouble(), d->coordinatePoint1_y->text().toDouble(), d->coordinatePoint1_z->text().toDouble());
703 axlPoint p2(d->coordinatePoint2_x->text().toDouble(), d->coordinatePoint2_y->text().toDouble(), d->coordinatePoint2_z->text().toDouble());
704 axlPoint c(d->coordinateCenter_x->text().toDouble(), d->coordinateCenter_y->text().toDouble(), d->coordinateCenter_z->text().toDouble());
709 bool linedUpPoints = calculatedNormal.
norm() < 0.001;
711 d->coordinateNormal_x->setVisible(linedUpPoints);
713 d->coordinateNormalLabel_x->setVisible(!linedUpPoints);
714 d->coordinateNormalLabel_x->setText(QString(
"%1").arg(calculatedNormal.
x()));
716 d->coordinateNormal_y->setVisible(linedUpPoints);
718 d->coordinateNormalLabel_y->setVisible(!linedUpPoints);
719 d->coordinateNormalLabel_y->setText(QString(
"%1").arg(calculatedNormal.
y()));
721 d->coordinateNormal_z->setVisible(linedUpPoints);
723 d->coordinateNormalLabel_z->setVisible(!linedUpPoints);
724 d->coordinateNormalLabel_z->setText(QString(
"%1").arg(calculatedNormal.
z()));
726 d->linedUpMessage->setVisible(linedUpPoints);
728 d->arc->touchGeometry();
733 axlPoint p1(d->coordinatePoint1_x->text().toDouble(), d->coordinatePoint1_y->text().toDouble(), d->coordinatePoint1_z->text().toDouble());
734 axlPoint p2(d->coordinatePoint2_x->text().toDouble(), d->coordinatePoint2_y->text().toDouble(), d->coordinatePoint2_z->text().toDouble());
735 axlPoint c(d->coordinateCenter_x->text().toDouble(), d->coordinateCenter_y->text().toDouble(), d->coordinateCenter_z->text().toDouble());
738 calculatedNormal =
axlPoint(d->coordinateNormal_x->value(), d->coordinateNormal_y->value(), d->coordinateNormal_z->value());
744 axlPoint newCenter = middle+mediatory*ps;
746 d->coordinateCenter_x->setValue(newCenter.
x());
747 d->coordinateCenter_y->setValue(newCenter.
y());
748 d->coordinateCenter_z->setValue(newCenter.
z());
750 d->arc->touchGeometry();
757 d->coordinateNormal_x->setValue(-d->coordinateNormal_x->value());
758 d->coordinateNormal_y->setValue(-d->coordinateNormal_y->value());
759 d->coordinateNormal_z->setValue(-d->coordinateNormal_z->value());
761 d->coordinateNormalLabel_x->setText(QString(
"%1").arg(-d->coordinateNormalLabel_x->text().toDouble()));
762 d->coordinateNormalLabel_y->setText(QString(
"%1").arg(-d->coordinateNormalLabel_y->text().toDouble()));
763 d->coordinateNormalLabel_z->setText(QString(
"%1").arg(-d->coordinateNormalLabel_z->text().toDouble()));
765 d->arc->onDirectChanged(d->counterClockWiseCheckBox->isChecked());
767 d->arc->touchGeometry();
774 const QSignalBlocker blockerCoordCenterX(d->coordinateCenter_x);
775 const QSignalBlocker blockerCoordCenterY(d->coordinateCenter_y);
776 const QSignalBlocker blockerCoordCenterZ(d->coordinateCenter_z);
777 const QSignalBlocker blockerCoordPoint1X(d->coordinatePoint1_x);
778 const QSignalBlocker blockerCoordPoint1Y(d->coordinatePoint1_y);
779 const QSignalBlocker blockerCoordPoint1Z(d->coordinatePoint1_z);
780 const QSignalBlocker blockerCoordPoint2X(d->coordinatePoint2_x);
781 const QSignalBlocker blockerCoordPoint2Y(d->coordinatePoint2_y);
782 const QSignalBlocker blockerCoordPoint2Z(d->coordinatePoint2_z);
783 const QSignalBlocker blockerCoordNormalX(d->coordinateNormal_x);
784 const QSignalBlocker blockerCoordNormalY(d->coordinateNormal_y);
785 const QSignalBlocker blockerCoordNormalZ(d->coordinateNormal_z);
787 d->coordinateCenter_x->setValue(d->arc->center().x());
788 d->coordinateCenter_y->setValue(d->arc->center().y());
789 d->coordinateCenter_z->setValue(d->arc->center().z());
791 d->coordinatePoint1_x->setValue(d->arc->point1().x());
792 d->coordinatePoint1_y->setValue(d->arc->point1().y());
793 d->coordinatePoint1_z->setValue(d->arc->point1().z());
795 d->coordinatePoint2_x->setValue(d->arc->point2().x());
796 d->coordinatePoint2_y->setValue(d->arc->point2().y());
797 d->coordinatePoint2_z->setValue(d->arc->point2().z());
799 d->coordinateNormal_x->setValue(d->arc->normal().x());
800 d->coordinateNormal_y->setValue(d->arc->normal().y());
801 d->coordinateNormal_z->setValue(d->arc->normal().z());
Class axlPoint defines 3D points.
void onCoordDataChangedPoint1_z(double z)
void onColorChanged(QColor color)
void manageNormal(double)
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
axlInspectorObjectCircleArc(QWidget *parent=0)
void onCoordDataChangedNormal_x(double x)
void onCoordDataChangedCenter_x(double x)
void onCoordDataChangedPoint1_x(double x)
void onCoordDataChangedPoint2_x(double x)
void onLineEditShaderChanged(QString shader)
void onShaderChanged(QString shader)
void onCoordDataChangedNormal_y(double y)
void onSizeChanged(double)
axlPoint & normalized(void)
void onCoordDataChangedNormal_z(double z)
void onCoordDataChangedPoint2_y(double y)
static double dotProduct(const axlPoint &lhs, const axlPoint &rhs)
void setData(axlCircleArc *arc)
void onCoordDataChangedCenter_y(double y)
void onCoordDataChangedCenter_z(double z)
void manageCenter(double)
void onShaderStateChanged(bool isShader)
QSize sizeHint(void) const
void modifiedProperty(dtkAbstractData *, int)
void onCoordDataChangedPoint2_z(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.
void onOpacityChanged(int opacity)
void onCoordDataChangedPoint1_y(double y)
virtual ~axlInspectorObjectCircleArc(void)