]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
EDF 2281 : Possibility to choose the division pattern for the cylinder and missing...
authorrnc <rnc@opencascade.com>
Fri, 27 Jul 2012 09:18:14 +0000 (09:18 +0000)
committerrnc <rnc@opencascade.com>
Fri, 27 Jul 2012 09:18:14 +0000 (09:18 +0000)
13 files changed:
idl/GEOM_Gen.idl
idl/GEOM_Superv.idl
src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx
src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.h
src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx
src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx
src/GEOM_I/GEOM_IAdvancedOperations_i.cc
src/GEOM_I/GEOM_IAdvancedOperations_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc
src/GEOM_I_Superv/GEOM_Superv_i.hh

index 551283a946e9e602b1f268b50f8c5e72db8e0f7b..a3819178c458b5500f906a42c301e91b6402b103 100644 (file)
@@ -3804,7 +3804,9 @@ module GEOM
      *  \param theH Height of the cylinder
      *  \return New GEOM_Object, containing the created shape.
      */
-    GEOM_Object MakeDividedCylinder (in double theR, in double theH);
+    GEOM_Object MakeDividedCylinder (in double theR, 
+                                     in double theH,
+                                     in pattern thePattern );
 
     /*@@ insert new functions before this line @@ do not remove this line @@*/
   };
index a07c1789f2edcd3f9a156974d31b634e80ef98c9..36c204b1dea3a796b271ca909c9572efd7799c52 100644 (file)
@@ -620,7 +620,8 @@ module GEOM
     GEOM_Object MakeDividedDisk (in double theR, in double theRatio, in short theOrientation,
                                  in pattern thePattern);
 
-    GEOM_Object MakeDividedCylinder (in double theR, in double theH);
+    GEOM_Object MakeDividedCylinder (in double theR, in double theH,
+                                     in pattern thePattern);
 
     /*@@ insert new functions before this line @@ do not remove this line @@*/
  };
index fdd172abcb3810bf0690c4ece51296058ba5f203..1d6d55edb6299e8baaa55d159f8840f25b6e016b 100644 (file)
@@ -62,10 +62,18 @@ AdvancedGUI_DividedCylinderDlg::AdvancedGUI_DividedCylinderDlg (GeometryGUI* the
   GroupParams->GroupBox1->setTitle(tr("GEOM_BOX_OBJ"));
   GroupParams->TextLabel1->setText(tr("GEOM_RADIUS"));
   GroupParams->TextLabel2->setText(tr("GEOM_HEIGHT"));
+  
+  GroupPattern = new DlgRef_3Radio(centralWidget());
+  GroupPattern->GroupBox1->setTitle(tr("GEOM_PATTERN"));
+  GroupPattern->RadioButton1->setText(tr("GEOM_SQUARE"));
+  GroupPattern->RadioButton2->setText(tr("GEOM_HEXAGON"));
+  GroupPattern->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+  GroupPattern->RadioButton3->close();
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
   layout->addWidget(GroupParams);
+  layout->addWidget(GroupPattern);
   /***************************************************************/
 
   setHelpFileName("create_dividedcylinder_page.html");
@@ -100,6 +108,9 @@ void AdvancedGUI_DividedCylinderDlg::Init()
   double aHeight = 300;
   GroupParams->SpinBox_DX->setValue(aRadius);
   GroupParams->SpinBox_DY->setValue(aHeight);
+  
+  GroupPattern->RadioButton1->setChecked(true);
+  myPattern = GEOM::SQUARE;
 
   // Signal/slot connections
   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
@@ -109,6 +120,9 @@ void AdvancedGUI_DividedCylinderDlg::Init()
   
   connect(GroupParams->SpinBox_DX,     SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
   connect(GroupParams->SpinBox_DY,     SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
+  
+  connect(GroupPattern->RadioButton1,  SIGNAL(clicked()),            this, SLOT(RadioButtonClicked()));
+  connect(GroupPattern->RadioButton2,  SIGNAL(clicked()),            this, SLOT(RadioButtonClicked()));
 
   initName(tr("GEOM_DIVIDEDCYLINDER"));
   
@@ -125,6 +139,23 @@ void AdvancedGUI_DividedCylinderDlg::SetDoubleSpinBoxStep (double step)
   //@@ set double spin box step for all spin boxes here @@//
 }
 
+//=================================================================================
+// function : RadioButtonClicked()
+// purpose  : Radio button management
+//=================================================================================
+void AdvancedGUI_DividedCylinderDlg::RadioButtonClicked()
+{ 
+  QRadioButton* send = (QRadioButton*)sender();
+  
+  // Division pattern
+  if (send == GroupPattern->RadioButton1)
+    myPattern = GEOM::SQUARE;
+  else if (send == GroupPattern->RadioButton2)
+    myPattern = GEOM::HEXAGON;
+  
+  displayPreview(true);
+}
+
 //=================================================================================
 // function : ClickOnOk()
 // purpose  :
@@ -218,7 +249,7 @@ bool AdvancedGUI_DividedCylinderDlg::execute (ObjectList& objects)
   CORBA::Double theH = GroupParams->SpinBox_DY->value();
 
   // call engine function
-  anObj = anOper->MakeDividedCylinder(theR, theH);
+  anObj = anOper->MakeDividedCylinder(theR, theH, myPattern);
   res = !anObj->_is_nil();
   if (res && !IsPreview())
   {
index 60624d2efa55f475827186022d675ae533d6ff43..6cbf0363e49f63ed1de677cf4fd1747678383640 100644 (file)
@@ -25,6 +25,7 @@
 #include <GEOMBase_Skeleton.h>
 
 class DlgRef_2Spin;
+class DlgRef_3Radio;
 
 //=================================================================================
 // class    : AdvancedGUI_DividedCylinderDlg
@@ -50,6 +51,8 @@ private:
 
 private:
   DlgRef_2Spin*                      GroupParams;
+  DlgRef_3Radio*                     GroupPattern;
+  GEOM::pattern                      myPattern;
 
 private slots:
   void                               ClickOnOk();
@@ -57,6 +60,7 @@ private slots:
   void                               ActivateThisDialog();
   void                               ValueChangedInSpinBox();
   void                               SetDoubleSpinBoxStep( double );
+  void                               RadioButtonClicked();
 };
 
 #endif // ADVANCEDGUI_DIVIDEDCYLINDERDLG_H
index 44bf52392b172b4c325e1aba89b08da53a5446ec..85a4d099d9110540912baeae0eab4beef5c37eb7 100644 (file)
@@ -79,10 +79,11 @@ AdvancedGUI_DividedDiskDlg::AdvancedGUI_DividedDiskDlg (GeometryGUI* theGeometry
   
   GroupPattern = new DlgRef_3Radio(centralWidget());
   GroupPattern->GroupBox1->setTitle(tr("GEOM_PATTERN"));
+  GroupPattern->RadioButton1->setText(tr("GEOM_SQUARE"));
+  GroupPattern->RadioButton2->setText(tr("GEOM_HEXAGON"));
   GroupPattern->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
   GroupPattern->RadioButton3->close();
   
-  
   GroupPntVecR = new DlgRef_2Sel1Spin(centralWidget());
   GroupPntVecR->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
   GroupPntVecR->TextLabel1->setText(tr("GEOM_CENTER_POINT"));
index 6a1488952191ef2af83ad7e7390fec3c075a8980..1da62ff229d3131809ce35029967c62f10fdf4ad 100644 (file)
@@ -838,6 +838,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_HEIGHT</source>
         <translation>Height :</translation>
     </message>
+    <message>
+        <source>GEOM_HEXAGON</source>
+        <translation>Hexagon</translation>
+    </message>
     <message>
         <source>GEOM_HOLES</source>
         <translation>Holes</translation>
@@ -1146,6 +1150,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_OFFSET_TITLE</source>
         <translation>Offset Surface</translation>
     </message>
+    <message>
+        <source>GEOM_PATTERN</source>
+        <translation>Division pattern</translation>
+    </message>
     <message>
         <source>GEOM_PROJECTION</source>
         <translation>Projection</translation>
@@ -1850,6 +1858,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_SPLINE_TITLE</source>
         <translation>Spline Construction</translation>
     </message>
+    <message>
+        <source>GEOM_SQUARE</source>
+        <translation>Square</translation>
+    </message>
     <message>
         <source>GEOM_START_LCS</source>
         <translation>Start LCS</translation>
index c23bc423e7942f48c88218ab4fa5acf9a2a81064..75db6a8ae2f51ee8d452f7672ef76e533ded7224 100644 (file)
@@ -838,6 +838,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_HEIGHT</source>
         <translation>Hauteur:</translation>
     </message>
+    <message>
+        <source>GEOM_HEXAGON</source>
+        <translation>Héxagone</translation>
+    </message>
     <message>
         <source>GEOM_HOLES</source>
         <translation>Trous</translation>
@@ -1146,6 +1150,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_OFFSET_TITLE</source>
         <translation>Décaler une surface</translation>
     </message>
+    <message>
+        <source>GEOM_PATTERN</source>
+        <translation>Schema de découpe</translation>
+    </message>
     <message>
         <source>GEOM_PROJECTION</source>
         <translation>Projection</translation>
@@ -1850,6 +1858,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_SPLINE_TITLE</source>
         <translation>Construction d&apos;un spline</translation>
     </message>
+    <message>
+        <source>GEOM_SQUARE</source>
+        <translation>Carré</translation>
+    </message>
     <message>
         <source>GEOM_START_LCS</source>
         <translation>SCL du Début</translation>
index 017c849cb6d261a3758fd8453c89184a4df98b8a..1532c0bc3bdb0cc8faa3e08101f5377ad62edced 100644 (file)
@@ -2367,14 +2367,16 @@ Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedDiskPntVecR (Handle
  *  \return New GEOM_Object, containing the created shape.
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR, double theH)
+Handle(GEOM_Object) GEOMImpl_IAdvancedOperations::MakeDividedCylinder (double theR, 
+                                                                       double theH,
+                                                                       int    thePattern)
 {
   SetErrorCode(KO);
   
   //Add a new object
   Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER);
 
-  Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 50.0, 1, 0);
+  Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern);
   aBaseShape->GetLastFunction()->SetDescription("");   // Erase dump of MakeDividedDisk
   
   aShape = my3DPrimOperations->MakePrismDXDYDZ(aBaseShape,0.0,0.0,theH, -1.0);
index 278ab2b80516294b0568606546d03ea5ce03ee31..a7c11d6ff0fbac7edea45a76d95e2bb1d223b03a 100644 (file)
@@ -118,7 +118,10 @@ public:
                                                               double theRatio,
                                                               int    thePattern);
   
-  Standard_EXPORT Handle(GEOM_Object) MakeDividedCylinder (double theR, double theH);
+  Standard_EXPORT Handle(GEOM_Object) MakeDividedCylinder (double theR, 
+                                                           double theH,
+                                                           int thePattern);
+  
   /*@@ insert new functions before this line @@ do not remove this line @@*/
 };
 #endif
index f30bc23b0c6cc69b1cbbc0296e00e03a291d7776..77310827f73d307d2bd738763352ee097c0038c0 100644 (file)
@@ -387,7 +387,9 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedDiskPntVecR (GEOM::
  *  \return New GEOM_Object, containing the created shape.
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH)
+GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Double theR, 
+                                                                       CORBA::Double theH,
+                                                                       GEOM::pattern thePattern)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -395,7 +397,7 @@ GEOM::GEOM_Object_ptr GEOM_IAdvancedOperations_i::MakeDividedCylinder (CORBA::Do
   GetOperations()->SetNotDone();
 
   //Create the DividedCylinder
-  Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH);
+  Handle(GEOM_Object) anObject = GetOperations()->MakeDividedCylinder(theR, theH, thePattern);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
index 9e87ee201a26b84f4b76228fc16414a798f13d05..fde5fcfa59a0b4107e93613471496238c83a2ed8 100644 (file)
@@ -75,7 +75,9 @@ class GEOM_I_EXPORT GEOM_IAdvancedOperations_i :
                                                 CORBA::Double theRatio,
                                                 GEOM::pattern thePattern);
   
-  GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH);
+  GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, 
+                                             CORBA::Double theH,
+                                             GEOM::pattern thePattern);
   /*@@ insert new functions before this line @@ do not remove this line @@*/
 
   ::GEOMImpl_IAdvancedOperations* GetOperations()
index cfb7a01f8f2586f9d0a9cba9b7fefd01a441d548..684558c07b48cf99cedfaa4111f647543f86b3dc 100644 (file)
@@ -3419,12 +3419,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedDisk (CORBA::Double theR, CORBA:
 //=============================================================================
 //  MakeDividedCylinder
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH)
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeDividedCylinder (CORBA::Double theR, 
+                                                          CORBA::Double theH,
+                                                          GEOM::pattern thePattern)
 {
   beginService( " GEOM_Superv_i::MakeDividedCylinder" );
   MESSAGE("GEOM_Superv_i::MakeDividedCylinder");
   getAdvancedOp();
-  GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeDividedCylinder(theR, theH);
+  GEOM::GEOM_Object_ptr anObj = myAdvancedOp->MakeDividedCylinder(theR, theH, thePattern);
   endService( " GEOM_Superv_i::MakeDividedCylinder" );
   return anObj;
 }
index 880dfcec51b13de86289692c065280f123ecb826..3dd0192fe593bd1ce381ce0656bc6edc3993c685 100644 (file)
@@ -708,7 +708,9 @@ public:
                                                         GEOM::GEOM_Object_ptr theP1, GEOM::GEOM_Object_ptr theP2, GEOM::GEOM_Object_ptr theP3);
   GEOM::GEOM_Object_ptr MakeDividedDisk (CORBA::Double theR, CORBA::Double theRatio,
                                          CORBA::Short theOrientation, GEOM::pattern thePattern);
-  GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, CORBA::Double theH);
+  GEOM::GEOM_Object_ptr MakeDividedCylinder (CORBA::Double theR, 
+                                             CORBA::Double theH,
+                                             GEOM::pattern thePattern);
   /*@@ insert new functions before this line @@ do not remove this line @@*/
 
 private: