]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
IPAL20712 5x: Couldn't select plane as "Face-Selection"
authordmv <dmv@opencascade.com>
Mon, 1 Dec 2008 10:32:42 +0000 (10:32 +0000)
committerdmv <dmv@opencascade.com>
Mon, 1 Dec 2008 10:32:42 +0000 (10:32 +0000)
doc/salome/gui/GEOM/images/plane1.png
doc/salome/gui/GEOM/images/plane2.png
doc/salome/gui/GEOM/images/plane3.png
doc/salome/gui/GEOM/input/creating_plane.doc
src/BasicGUI/BasicGUI_PlaneDlg.cxx
src/BasicGUI/BasicGUI_PlaneDlg.h
src/DlgRef/DlgRef.cxx
src/DlgRef/DlgRef.h
src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui [new file with mode: 0644]
src/DlgRef/Makefile.am
src/GEOMGUI/GEOM_msg_en.ts

index 10b4202834f2f1e7adb29ff2b9f4db5282214e66..aaf7f12d5ad4e74d3d33de1a7cf2dcb8b257eb10 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/plane1.png and b/doc/salome/gui/GEOM/images/plane1.png differ
index f6c50d7d96ab1219e49a6fb2c83b087323095494..3644d6b38498e5a336da626d0462f68a534474c8 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/plane2.png and b/doc/salome/gui/GEOM/images/plane2.png differ
index e48916cc8bbb288be715d9742d0ff15d784c6434..b815f8d0d666168bcee7ebd3ccf70ae2b7291a01 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/plane3.png and b/doc/salome/gui/GEOM/images/plane3.png differ
index d7c9e8f9fd613d10ed363ba60707a60cf0cf780b..c6116021bf289a98ca52a1aae6cc2176a49e0c0a 100644 (file)
@@ -27,7 +27,8 @@ of the plane).
 \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).
index 8e8914ccefdf1aec73f913d0e49c1eaa9a320048..5070f7d50b688f519909efc0bb2cb2b844b03e11 100644 (file)
@@ -100,7 +100,11 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg( GeometryGUI* theGeometryGUI, QWidget* pare
   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" ) );
@@ -139,6 +143,7 @@ void BasicGUI_PlaneDlg::Init()
 {
   /* init variables */
   myEditCurrentArgument = GroupPntDir->LineEdit1;
+  GroupFace->RadioButton1->setChecked(true);
 
   myPoint = myDir = myPoint1 = myPoint2 = myPoint3 = myFace = GEOM::GEOM_Object::_nil();
 
@@ -180,6 +185,8 @@ void BasicGUI_PlaneDlg::Init()
   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 ) ) );
@@ -205,6 +212,25 @@ void BasicGUI_PlaneDlg::SetDoubleSpinBoxStep( double step )
   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()
@@ -257,7 +283,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       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();
@@ -267,12 +293,15 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       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;
     }
   }
@@ -342,6 +371,8 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
     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() ) {
@@ -377,7 +408,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
 
     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;
@@ -387,7 +418,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
       }
       else
        localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
-    }
+       }*/
 
     if      ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) {
       myPoint  = aSelectedObject;
index ec43ced5ecb012e86931ccd544554a9a437d0520..819d74480e05594e49fcccf88616c8f5179cb1c1 100644 (file)
@@ -31,6 +31,7 @@
 class DlgRef_1Sel1Spin;
 class DlgRef_2Sel1Spin;
 class DlgRef_3Sel1Spin;
+class DlgRef_3Radio1Sel1Spin;
 
 //=================================================================================
 // class    : BasicGUI_PlaneDlg
@@ -61,7 +62,7 @@ private:
 
   DlgRef_2Sel1Spin*                  GroupPntDir;
   DlgRef_3Sel1Spin*                  Group3Pnts;
-  DlgRef_1Sel1Spin*                  GroupFace;
+  DlgRef_3Radio1Sel1Spin*            GroupFace;
 
 private slots:
   void                               ClickOnOk();
@@ -76,6 +77,7 @@ private slots:
   void                               ConstructorsClicked( int );
   void                               ValueChangedInSpinBox( double );
   void                               SetDoubleSpinBoxStep( double );
+  void                               SelectionTypeClicked();
 };
 
 #endif // BASICGUI_PLANEDLG_H
index f93df1ac281416f08518c0d33627f2c718b585bb..5f575d77fb0683229087b7276db6e78d0ebc9d73 100644 (file)
@@ -485,6 +485,20 @@ DlgRef_3Radio::~DlgRef_3Radio()
 {
 }
 
+//////////////////////////////////////////
+// DlgRef_3Radio1Sel1Spin
+//////////////////////////////////////////
+
+DlgRef_3Radio1Sel1Spin::DlgRef_3Radio1Sel1Spin( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+}
+
+DlgRef_3Radio1Sel1Spin::~DlgRef_3Radio1Sel1Spin()
+{
+}
+
 //////////////////////////////////////////
 // DlgRef_3Sel1Check
 //////////////////////////////////////////
index 4e677a32109f9ac7a6ecb3b1e26a309fc1ad1395..4becec59a90fc914d2f7b564e5f84436ea7cc1ea 100644 (file)
@@ -564,6 +564,22 @@ public:
   ~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
 //////////////////////////////////////////
diff --git a/src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui b/src/DlgRef/DlgRef_3Radio1Sel1Spin_QTD.ui
new file mode 100644 (file)
index 0000000..a1c1475
--- /dev/null
@@ -0,0 +1,150 @@
+<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>
index 46df04ce78d1dbb13c47d9b370b17d441f447fb7..07cf7fe2c53499e28868aa752bfbc69f96eb9488 100644 (file)
@@ -71,6 +71,7 @@ UIC_FILES =                                   \
        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         \
index 361dde1f59c172c1c712c7a12beec5ae0fae3331..1d9d864659856b03ab85be9561993192a0377885 100644 (file)
@@ -552,6 +552,10 @@ Please, select face, shell or solid and try again</translation>
             <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>