GroupControls->GroupBox1->setTitle(tr("GEOM_CONTROLS"));
GroupControls->CheckBox1->setText(tr("Show length dimensions")); //TODO translation
GroupControls->CheckBox2->setText(tr("Show angle dimensions")); //TODO translation
+ GroupControls->CheckBox3->setText(tr("Show start/end point coordinates")); //TODO translation
+ GroupControls->lineEdit_1->setReadOnly(true);
+ GroupControls->lineEdit_2->setReadOnly(true);
+ GroupControls->lineEdit_3->setReadOnly(true);
+ GroupControls->lineEdit_4->setReadOnly(true);
+ GroupControls->lineEdit_5->setReadOnly(true);
+ GroupControls->lineEdit_6->setReadOnly(true);
+ GroupControls->label_1->setText(tr("X:"));
+ GroupControls->label_2->setText(tr("Y:"));
+ GroupControls->label_3->setText(tr("Z:"));
+ GroupControls->label_4->setText(tr("X:"));
+ GroupControls->label_5->setText(tr("Y:"));
+ GroupControls->label_6->setText(tr("Z:"));
buttonOk()->setText(tr("GEOM_BUT_END_SKETCH"));
buttonApply()->setText(tr("GEOM_BUT_CLOSE_SKETCH"));
//TEST
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
// globalSelection(GEOM_PREVIEW);
+// setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
/* Get setting of step value from file configuration */
double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0);
GroupControls->CheckBox1->setChecked(true);
GroupControls->CheckBox2->setChecked(true);
+ GroupControls->CheckBox3->setChecked(true);
+
isLengthVisible = true;
isAngleVisible = true;
connect(GroupAngles->checkBox, SIGNAL(clicked (bool)), this, SLOT(BoxChecked (bool))) ;
connect(GroupControls->CheckBox1, SIGNAL(clicked (bool)), this, SLOT(BoxChecked (bool))) ;
connect(GroupControls->CheckBox2, SIGNAL(clicked (bool)), this, SLOT(BoxChecked (bool))) ;
+ connect(GroupControls->CheckBox3, SIGNAL(clicked (bool)), this, SLOT(BoxChecked (bool))) ;
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
initName(tr("GEOM_3DSKETCHER"));
+
+ GroupControls->CheckBox3->click();
UpdateButtonsState();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
// purpose : called when the point coordinates is Applyed
//=================================================================================
void EntityGUI_3DSketcherDlg::ClickOnAddPoint()
-{
+{
QString msg;
if (!isValid(msg)) {
showError(msg);
myLengthIORedoList.Clear();
myAngleIORedoList.Clear();
- if (myMode == 1) {
+ if (myMode == 1)
+ {
Group3Spin->SpinBox_DX->setValue(0.0);
Group3Spin->SpinBox_DY->setValue(0.0);
Group3Spin->SpinBox_DZ->setValue(0.0);
GroupAngles->SpinBox_DL->setValue(0.0);
GroupAngles->SpinBox_DA2->setValue(0.0);
}
+
+ UpdatePointCoordinates();
+
UpdateButtonsState();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
}
GroupAngles->buttonRedo->setEnabled(myRedoList.count() > 0);
}
+//=================================================================================
+// function : UpdatePointCoordinates()
+// purpose :Update point coordinates in the control groupbox
+//=================================================================================
+void EntityGUI_3DSketcherDlg::UpdatePointCoordinates()
+{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ int aPrecision = resMgr->integerValue("Geometry", "length_precision", 6);
+
+ if (myPointsList.count() == 0)
+ {
+ GroupControls->lineEdit_1->setText("");
+ GroupControls->lineEdit_2->setText("");
+ GroupControls->lineEdit_3->setText("");
+
+ GroupControls->lineEdit_4->setText("");
+ GroupControls->lineEdit_5->setText("");
+ GroupControls->lineEdit_6->setText("");
+ }
+ else if (myPointsList.count() == 1)
+ {
+ GroupControls->lineEdit_1->setText(DlgRef::PrintDoubleValue(getLastPoint().x, aPrecision));
+ GroupControls->lineEdit_2->setText(DlgRef::PrintDoubleValue(getLastPoint().y, aPrecision));
+ GroupControls->lineEdit_3->setText(DlgRef::PrintDoubleValue(getLastPoint().z, aPrecision));
+
+ GroupControls->lineEdit_4->setText("");
+ GroupControls->lineEdit_5->setText("");
+ GroupControls->lineEdit_6->setText("");
+ }
+ else
+ {
+ GroupControls->lineEdit_4->setText(DlgRef::PrintDoubleValue(getLastPoint().x, aPrecision));
+ GroupControls->lineEdit_5->setText(DlgRef::PrintDoubleValue(getLastPoint().y, aPrecision));
+ GroupControls->lineEdit_6->setText(DlgRef::PrintDoubleValue(getLastPoint().z, aPrecision));
+ }
+
+}
+
//=================================================================================
// function : ClickOnUndo()
// purpose :
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myLengthPrs);
if (isAngleVisible)
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs);
+
+ // Update of point coordinates in the control groupbox
+ UpdatePointCoordinates();
updateViewer();
}
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myLengthPrs);
if (isAngleVisible)
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myAnglePrs);
+
+ // Update of point coordinates in the control groupbox
+ UpdatePointCoordinates();
updateViewer();
}
else
isAngleVisible=false;
}
+ else if (send == GroupControls->CheckBox3)
+ {
+ GroupControls->lineEdit_1->setVisible(checked);
+ GroupControls->lineEdit_2->setVisible(checked);
+ GroupControls->lineEdit_3->setVisible(checked);
+ GroupControls->lineEdit_4->setVisible(checked);
+ GroupControls->lineEdit_5->setVisible(checked);
+ GroupControls->lineEdit_6->setVisible(checked);
+
+ GroupControls->label_1->setVisible(checked);
+ GroupControls->label_2->setVisible(checked);
+ GroupControls->label_3->setVisible(checked);
+ GroupControls->label_4->setVisible(checked);
+ GroupControls->label_5->setVisible(checked);
+ GroupControls->label_6->setVisible(checked);
+ GroupControls->label_7->setVisible(checked);
+ GroupControls->label_8->setVisible(checked);
+
+ GroupControls->updateGeometry();
+ GroupControls->resize(minimumSizeHint());
+ }
+ updateGeometry();
+ resize(minimumSizeHint());
+
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
}
{
P1 = gp_Pnt(Last.x + theLength,Last.y,Last.z); // X direction
P2 = gp_Pnt(Last.x + theLength * cos(theAngle1 * M_PI / 180.) ,
- Last.y,
- Last.z + theLength * sin(theAngle1 * M_PI / 180.));
+ Last.y,
+ Last.z + theLength * sin(theAngle1 * M_PI / 180.));
break;
}
}
<rect>
<x>0</x>
<y>0</y>
- <width>327</width>
- <height>50</height>
+ <width>278</width>
+ <height>181</height>
</rect>
</property>
<property name="windowTitle">
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="GroupBox1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title">
<string/>
</property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QCheckBox" name="CheckBox2">
- <property name="text">
- <string/>
- </property>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="CheckBox2">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="CheckBox1">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="CheckBox3">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="CheckBox1">
- <property name="text">
- <string/>
- </property>
- </widget>
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Start:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_1">
+ <property name="text">
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="lineEdit_1"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="lineEdit_2"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="lineEdit_3"/>
+ </item>
+ <item row="0" column="3">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>End:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLineEdit" name="lineEdit_4"/>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLineEdit" name="lineEdit_5"/>
+ </item>
+ <item row="3" column="2">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Z</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="QLineEdit" name="lineEdit_6"/>
+ </item>
+ </layout>
</item>
</layout>
</widget>