\image html plane2.png
\n Finally, you can define a \b Plane by another \b Plane or <b>Local
-Coordinate System</b> and a <b>Size of the Plane</b>.
+Coordinate System</b> and a <b>Size of the Plane</b>. To change selection type cilck the corresponding
+radio button "Face" or "Local Coordinate System".
\n <b>TUI Command:</b> <em>geompy.MakePlaneFace(Face, TrimSize)</em>
\n <b>Arguments:</b> Name + 1 face + 1 value (to define the size of
the plane).
Group3Pnts->LineEdit2->setEnabled( false );
Group3Pnts->LineEdit3->setEnabled( false );
- GroupFace = new DlgRef_1Sel1Spin( centralWidget() );
+ GroupFace = new DlgRef_3Radio1Sel1Spin( centralWidget() );
+ GroupFace->RadioButton1->setText(tr("GEOM_FACE"));
+ GroupFace->RadioButton2->setText(tr("GEOM_LCS"));
+ GroupFace->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+ GroupFace->RadioButton3->close();
GroupFace->GroupBox1->setTitle( tr( "GEOM_FACE_OR_LCS" ) );
GroupFace->TextLabel1->setText( tr( "GEOM_SELECTION" ) );
GroupFace->TextLabel2->setText( tr( "GEOM_PLANE_SIZE" ) );
{
/* init variables */
myEditCurrentArgument = GroupPntDir->LineEdit1;
+ GroupFace->RadioButton1->setChecked(true);
myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = myFace = GEOM::GEOM_Object::_nil();
connect( Group3Pnts->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( Group3Pnts->LineEdit3, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
connect( GroupFace->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+ connect( GroupFace->RadioButton1,SIGNAL( clicked() ), this, SLOT( SelectionTypeClicked() ) );
+ connect( GroupFace->RadioButton2,SIGNAL( clicked() ), this, SLOT( SelectionTypeClicked() ) );
connect( GroupPntDir->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
connect( Group3Pnts->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
GroupFace->SpinBox_DX->setSingleStep(step);
}
+//=================================================================================
+// function : SelectionTypeClicked()
+// purpose : Selection type radio buttons managment
+//=================================================================================
+void BasicGUI_PlaneDlg::SelectionTypeClicked()
+{
+ myFace = GEOM::GEOM_Object::_nil();
+ if ( GroupFace->RadioButton1->isChecked()) {
+ globalSelection(); // close local contexts, if any
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ } else if ( GroupFace->RadioButton2->isChecked()) {
+ TColStd_MapOfInteger aMap;
+ aMap.Add( GEOM_PLANE );
+ aMap.Add( GEOM_MARKER );
+ globalSelection( aMap );
+ }
+ displayPreview();
+}
+
//=================================================================================
// function : ConstructorsClicked()
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
break;
}
- case 2: /* plane from a planar face selection */
+ case 2: /* plane from a planar face or LSC selection */
{
GroupPntDir->hide();
Group3Pnts->hide();
GroupFace->LineEdit1->setText( "" );
GroupFace->PushButton1->setDown( true );
- /* for the first argument */
- //globalSelection( GEOM_PLANE );
- TColStd_MapOfInteger aMap;
- aMap.Add( GEOM_PLANE );
- aMap.Add( GEOM_MARKER );
- globalSelection( aMap );
+ if ( GroupFace->RadioButton1->isChecked()) {
+ globalSelection(); // close local contexts, if any
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+ } else if ( GroupFace->RadioButton2->isChecked()) {
+ TColStd_MapOfInteger aMap;
+ aMap.Add( GEOM_PLANE );
+ aMap.Add( GEOM_MARKER );
+ globalSelection( aMap );
+ }
break;
}
}
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
aNeedType = TopAbs_EDGE;
+ else if ( myEditCurrentArgument == GroupFace->LineEdit1 )
+ aNeedType = TopAbs_FACE;
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
myEditCurrentArgument->setText( aName );
- if (!aSelectedObject->_is_nil()) { // clear selection if something selected
+ /* if (!aSelectedObject->_is_nil()) { // clear selection if something selected
globalSelection();
if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
TColStd_MapOfInteger aMap;
}
else
localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
- }
+ }*/
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) {
myPoint = aSelectedObject;
class DlgRef_1Sel1Spin;
class DlgRef_2Sel1Spin;
class DlgRef_3Sel1Spin;
+class DlgRef_3Radio1Sel1Spin;
//=================================================================================
// class : BasicGUI_PlaneDlg
DlgRef_2Sel1Spin* GroupPntDir;
DlgRef_3Sel1Spin* Group3Pnts;
- DlgRef_1Sel1Spin* GroupFace;
+ DlgRef_3Radio1Sel1Spin* GroupFace;
private slots:
void ClickOnOk();
void ConstructorsClicked( int );
void ValueChangedInSpinBox( double );
void SetDoubleSpinBoxStep( double );
+ void SelectionTypeClicked();
};
#endif // BASICGUI_PLANEDLG_H
{
}
+//////////////////////////////////////////
+// DlgRef_3Radio1Sel1Spin
+//////////////////////////////////////////
+
+DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
+{
+}
+
//////////////////////////////////////////
// DlgRef_3Sel1Check
//////////////////////////////////////////
~DlgRef_3Radio();
};
+//////////////////////////////////////////
+// DlgRef_1Sel3Radio1Sel1Spin
+//////////////////////////////////////////
+
+#include "ui_DlgRef_3Radio1Sel1Spin_QTD.h"
+
+class DLGREF_EXPORT DlgRef_3Radio1Sel1Spin : public QWidget,
+ public Ui::DlgRef_3Radio1Sel1Spin_QTD
+{
+ Q_OBJECT
+
+public:
+ DlgRef_3Radio1Sel1Spin( QWidget* = 0, Qt::WindowFlags = 0 );
+ ~DlgRef_3Radio1Sel1Spin();
+};
+
//////////////////////////////////////////
// DlgRef_3Sel1Check
//////////////////////////////////////////
--- /dev/null
+<ui version="4.0" >
+ <class>DlgRef_3Radio1Sel1Spin_QTD</class>
+ <widget class="QWidget" name="DlgRef_3Radio1Sel1Spin_QTD" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>357</width>
+ <height>131</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="GroupBox1" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>357</width>
+ <height>131</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string/>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" colspan="3" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QRadioButton" name="RadioButton1" >
+ <property name="text" >
+ <string>RadioButton1</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="RadioButton2" >
+ <property name="text" >
+ <string>RadioButton2</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="RadioButton3" >
+ <property name="text" >
+ <string>RadioButton3</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="TextLabel1" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>TL1</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="PushButton1" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QLineEdit" name="LineEdit1" />
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="TextLabel2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>TL2</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="2" >
+ <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+ </item>
+ <item row="3" column="2" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>256</width>
+ <height>19</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>QtxDoubleSpinBox</class>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global" >QtxDoubleSpinBox.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>LineEdit1</tabstop>
+ <tabstop>SpinBox_DX</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
ui_DlgRef_2Spin_QTD.h \
ui_DlgRef_3Check_QTD.h \
ui_DlgRef_3Radio_QTD.h \
+ ui_DlgRef_3Radio1Sel1Spin_QTD.h \
ui_DlgRef_3Sel1Check_QTD.h \
ui_DlgRef_3Sel1Spin_QTD.h \
ui_DlgRef_3Sel3Spin1Check_QTD.h \
<source>GEOM_FACE</source>
<translation>Face</translation>
</message>
+ <message>
+ <source>GEOM_LCS</source>
+ <translation>Local coordinate system</translation>
+ </message>
<message>
<source>GEOM_FACES</source>
<translation>Faces</translation>