]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0016756: EDF 545 GEOM : Extrusion, give the coordinates of the vector as input
authordmv <dmv@opencascade.com>
Tue, 22 Jul 2008 07:20:59 +0000 (07:20 +0000)
committerdmv <dmv@opencascade.com>
Tue, 22 Jul 2008 07:20:59 +0000 (07:20 +0000)
27 files changed:
doc/salome/gui/GEOM/images/extrusion1.png
doc/salome/gui/GEOM/images/extrusion2.png
doc/salome/gui/GEOM/images/extrusion3.png [new file with mode: 0644]
doc/salome/gui/GEOM/input/creating_extrusion.doc
idl/GEOM_Gen.idl
resources/Makefile.am
src/DlgRef/DlgRef.cxx
src/DlgRef/DlgRef.h
src/DlgRef/DlgRef.pro
src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui [new file with mode: 0644]
src/DlgRef/Makefile.am
src/GEOMGUI/GEOM_images.ts
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx
src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx
src/GEOMImpl/GEOMImpl_IPrism.hxx
src/GEOMImpl/GEOMImpl_PrismDriver.cxx
src/GEOMImpl/GEOMImpl_Types.hxx
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOM_I/GEOM_I3DPrimOperations_i.cc
src/GEOM_I/GEOM_I3DPrimOperations_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc
src/GEOM_I_Superv/GEOM_Superv_i.hh
src/GEOM_SWIG/GEOM_TestAll.py
src/GEOM_SWIG/geompyDC.py
src/GenerationGUI/GenerationGUI_PrismDlg.cxx
src/GenerationGUI/GenerationGUI_PrismDlg.h

index c278fdf9e7901c00be662a8b247325cd60be031f..4b0a7097082c8940e73f48b1a3f0473b422b2bbe 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/extrusion1.png and b/doc/salome/gui/GEOM/images/extrusion1.png differ
index f2037ffcdbeb1cdcfcecdeb99c4a8c897e4c3148..404f1f357efd36238eefdee41324889c94d3f1d9 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/extrusion2.png and b/doc/salome/gui/GEOM/images/extrusion2.png differ
diff --git a/doc/salome/gui/GEOM/images/extrusion3.png b/doc/salome/gui/GEOM/images/extrusion3.png
new file mode 100644 (file)
index 0000000..26284b8
Binary files /dev/null and b/doc/salome/gui/GEOM/images/extrusion3.png differ
index 3f3435ca63af7db30460688b174d26850399e8c6..70cc6edb0d15d0d3ab612e66b4fa87df26e4bf8e 100644 (file)
@@ -34,6 +34,16 @@ shell) serving as base object + 2 vertices.
 
 \image html extrusion2.png
 
+\n Finally, you can define the \b Extrusion by the <b>Base Shape</b>
+and the <b>DX, DY, DZ</b> Vector\n
+<b>Both Directions</b> checkbox allows extruding the
+source objects forward and backward also.
+\n <b>TUI Command:</b> <em>geompy.MakePrismDXDYDZ(Base, dx, dy, dz)</em>
+\n <b>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or
+shell) serving as base object + 3 axis directions.
+
+\image html extrusion3.png
+
 <b>Examples:</b>
 
 \image html prisms_basessn.png
index 26a9368dc948520a0448805d9289acf11eddb707..311f9ea63d3c891f8af2d3557ebadaa8f24eac48 100644 (file)
@@ -942,6 +942,18 @@ module GEOM
     GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase,
                                      in GEOM_Object thePoint1,
                                      in GEOM_Object thePoint2);
+                                   
+    /*!
+     *  Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ.
+     *  \param theBase Base shape to be extruded.
+     *  \param DX, DY, DZ end of extrusion vector.
+     *  \return New GEOM_Object, containing the created prism.
+     */
+    GEOM_Object MakePrismDXDYDZ (in GEOM_Object theBase,
+                                in double theDX, in double theDY, in double theDZ);
+    /*  The same prism but in two directions forward&backward */
+    GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase,
+                                      in double theDX, in double theDY, in double theDZ);
 
     /*!
      *  Create a shape by extrusion of the base shape along
index 5773224e33913c1a98c480a547d625b915f61ef4..bff974dee53c3fd58414236cafe54b7bc339d346 100644 (file)
@@ -119,6 +119,7 @@ point_line_intersection.png \
 polyline.png \
 prism.png \
 prism2.png \
+prism3.png \
 revol.png \
 rotate.png \
 rotatepnt.png \
index 434faf86e6b23a919b84b2a97e04551aca6eaefd..b29fdee59b472baadd54c50350a8ac5f49642b39 100644 (file)
@@ -177,6 +177,20 @@ DlgRef_1Sel3Spin::~DlgRef_1Sel3Spin()
 {
 }
 
+//////////////////////////////////////////
+// DlgRef_1Sel3Spin1Check
+//////////////////////////////////////////
+
+DlgRef_1Sel3Spin1Check::DlgRef_1Sel3Spin1Check( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+}
+
+DlgRef_1Sel3Spin1Check::~DlgRef_1Sel3Spin1Check()
+{
+}
+
 //////////////////////////////////////////
 // DlgRef_1Sel4Spin
 //////////////////////////////////////////
index 0fe826fcb98758a88613d8be135dc5a1d7dcc7a6..b84bd55a3eec1a14c725691b671d0de43d5231ea 100644 (file)
@@ -210,6 +210,22 @@ public:
   ~DlgRef_1Sel3Spin();
 };
 
+//////////////////////////////////////////
+// DlgRef_1Sel3Spin1Check
+//////////////////////////////////////////
+
+#include "ui_DlgRef_1Sel3Spin1Check_QTD.h"
+
+class DLGREF_EXPORT DlgRef_1Sel3Spin1Check : public QWidget, 
+                                             public Ui::DlgRef_1Sel3Spin1Check_QTD
+{
+  Q_OBJECT
+
+public:
+  DlgRef_1Sel3Spin1Check( QWidget* = 0, Qt::WindowFlags = 0 );
+  ~DlgRef_1Sel3Spin1Check();
+};
+
 //////////////////////////////////////////
 // DlgRef_1Sel4Spin
 //////////////////////////////////////////
index 8f0a5d198a9b25db10f409f6862f751193985382..f8f8240566942d5c06d5fc69e16e38dbd0a3277a 100644 (file)
@@ -42,6 +42,7 @@ HEADERS += DlgRef_2Sel1Spin_QTD.h
 HEADERS += DlgRef_2Sel2Spin_QTD.h
 HEADERS += DlgRef_2Sel3Spin_QTD.h
 HEADERS += DlgRef_1Sel1Spin1Check_QTD.h
+HEADERS += DlgRef_1Sel3Spin1Check_QTD.h
 HEADERS += DlgRef_2Sel1Spin2Check_QTD.h
 HEADERS += DlgRef_2Sel2Spin1Check_QTD.h
 HEADERS += DlgRef_2Sel4Spin1Check_QTD.h
@@ -66,6 +67,7 @@ HEADERS += DlgRef_2Sel1Spin.h
 HEADERS += DlgRef_2Sel2Spin.h
 HEADERS += DlgRef_2Sel3Spin.h
 HEADERS += DlgRef_1Sel1Spin1Check.h
+HEADERS += DlgRef_1Sel3Spin1Check.h
 HEADERS += DlgRef_2Sel1Spin2Check.h
 HEADERS += DlgRef_2Sel2Spin1Check.h
 HEADERS += DlgRef_2Sel4Spin1Check.h
@@ -93,6 +95,7 @@ SOURCES += DlgRef_2Sel1Spin.cxx
 SOURCES += DlgRef_2Sel2Spin.cxx
 SOURCES += DlgRef_2Sel3Spin.cxx
 SOURCES += DlgRef_1Sel1Spin1Check.cxx
+SOURCES += DlgRef_1Sel3Spin1Check.cxx
 SOURCES += DlgRef_2Sel1Spin2Check.cxx
 SOURCES += DlgRef_2Sel2Spin1Check.cxx
 SOURCES += DlgRef_2Sel4Spin1Check.cxx
diff --git a/src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui b/src/DlgRef/DlgRef_1Sel3Spin1Check_QTD.ui
new file mode 100644 (file)
index 0000000..f850113
--- /dev/null
@@ -0,0 +1,177 @@
+<ui version="4.0" >
+ <class>DlgRef_1Sel3Spin1Check_QTD</class>
+ <widget class="QWidget" name="DlgRef_1Sel3Spin1Check_QTD" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>156</width>
+    <height>120</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string/>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="leftMargin" >
+    <number>0</number>
+   </property>
+   <property name="topMargin" >
+    <number>0</number>
+   </property>
+   <property name="rightMargin" >
+    <number>0</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>0</number>
+   </property>
+   <property name="horizontalSpacing" >
+    <number>6</number>
+   </property>
+   <property name="verticalSpacing" >
+    <number>6</number>
+   </property>
+   <item row="0" column="0" >
+    <widget class="QGroupBox" name="GroupBox1" >
+     <property name="title" >
+      <string/>
+     </property>
+     <layout class="QGridLayout" >
+      <property name="leftMargin" >
+       <number>9</number>
+      </property>
+      <property name="topMargin" >
+       <number>9</number>
+      </property>
+      <property name="rightMargin" >
+       <number>9</number>
+      </property>
+      <property name="bottomMargin" >
+       <number>9</number>
+      </property>
+      <property name="horizontalSpacing" >
+       <number>6</number>
+      </property>
+      <property name="verticalSpacing" >
+       <number>6</number>
+      </property>
+      <item row="2" column="1" colspan="2" >
+       <widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
+      </item>
+      <item row="3" column="1" colspan="2" >
+       <widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
+      </item>
+      <item row="1" column="1" colspan="2" >
+       <widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
+      </item>
+      <item row="4" column="0" colspan="2" >
+       <widget class="QCheckBox" name="CheckButton1" >
+         <property name="text" >
+         <string/>
+        </property>
+       </widget>
+      </item>  
+      <item row="1" 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="3" column="0" >
+       <widget class="QLabel" name="TextLabel4" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string>TL4</string>
+        </property>
+        <property name="wordWrap" >
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0" >
+       <widget class="QLabel" name="TextLabel3" >
+        <property name="sizePolicy" >
+         <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="text" >
+         <string>TL3</string>
+        </property>
+        <property name="wordWrap" >
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2" >
+       <widget class="QLineEdit" name="LineEdit1" />
+      </item>
+      <item row="0" 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="0" 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>
+     </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>
+  <tabstop>SpinBox_DY</tabstop>
+  <tabstop>SpinBox_DZ</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
index a88a95ac49917c19e785ce77758a6ee8cbb0b564..ed593f335071e8060ee32859f723e79dd2b2da02 100644 (file)
@@ -49,6 +49,7 @@ UIC_FILES = \
        ui_DlgRef_1Sel2Spin_QTD.h               \
        ui_DlgRef_1Sel3Check_QTD.h              \
        ui_DlgRef_1Sel3Spin_QTD.h               \
+       ui_DlgRef_1Sel3Spin1Check_QTD.h         \
        ui_DlgRef_1Sel4Spin_QTD.h               \
        ui_DlgRef_1Sel5Spin1Check_QTD.h         \
        ui_DlgRef_1Sel5Spin_QTD.h               \
index 9e4d6862192b6bedd311cef0677bc14cc5fed97c..caa1b974c0f6f34d37162ff14187641debb40024 100644 (file)
             <source>ICON_DLG_PRISM_2P</source>
             <translation>prism2.png</translation>
         </message>
+       <message>
+            <source>ICON_DLG_PRISM_DXDYDZ</source>
+            <translation>prism3.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_PROPAGATE</source>
             <translation>propagate.png</translation>
index 0aed9801dfc74c2a1f2b9ba178eaf893099949eb..2544d2a81cb9d645a47f6947489b9f875c24f816 100644 (file)
@@ -496,6 +496,10 @@ Please, select face, shell or solid and try again</translation>
             <source>GEOM_EXTRUSION_BSV_2P</source>
             <translation>Base Shape + 2 Points</translation>
         </message>
+       <message>
+            <source>GEOM_EXTRUSION_DXDYDZ</source>
+            <translation>Base Shape + DX DY DZ Vector</translation>
+        </message>
         <message>
             <source>GEOM_EXTRUSION_TITLE</source>
             <translation>Construction by Extrusion</translation>
index a1c554544528d6aa825ae2b810144f72ca162eb0..e834e35bceeed16e764d972ec76050072b7ebf93 100644 (file)
@@ -874,6 +874,121 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismTwoPnt2Ways
   return aPrism;
 }
 
+//=============================================================================
+/*!
+ *  MakePrismDXDYDZ
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ
+       (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull()) return NULL;
+
+  //Add a new Prism object
+  Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+
+  //Add a new Prism function for creation a Prism by DXDYDZ
+  Handle(GEOM_Function) aFunction =
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_DXDYDZ);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
+
+  GEOMImpl_IPrism aCI (aFunction);
+
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+
+  if (aRefBase.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetDX(theDX);
+  aCI.SetDY(theDY);
+  aCI.SetDZ(theDZ);
+
+  //Compute the Prism value
+  try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Extrusion can not be created, check input data");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismDXDYDZ("
+    << theBase << ", " << theDX << ", " << theDY << ", " << theDZ << ")";
+
+  SetErrorCode(OK);
+  return aPrism;
+}
+
+//=============================================================================
+/*!
+ *  MakePrismDXDYDZ_2WAYS
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways
+       (Handle(GEOM_Object) theBase, double theDX, double theDY, double theDZ)
+{
+  SetErrorCode(KO);
+
+  if (theBase.IsNull()) return NULL;
+
+  //Add a new Prism object
+  Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+
+  //Add a new Prism function for creation a Prism by DXDYDZ
+  Handle(GEOM_Function) aFunction =
+    aPrism->AddFunction(GEOMImpl_PrismDriver::GetID(), PRISM_BASE_DXDYDZ_2WAYS);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_PrismDriver::GetID()) return NULL;
+
+  GEOMImpl_IPrism aCI (aFunction);
+
+  Handle(GEOM_Function) aRefBase = theBase->GetLastFunction();
+
+  if (aRefBase.IsNull()) return NULL;
+
+  aCI.SetBase(aRefBase);
+  aCI.SetDX(theDX);
+  aCI.SetDY(theDY);
+  aCI.SetDZ(theDZ);
+
+  //Compute the Prism value
+  try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Extrusion can not be created, check input data");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakePrismDXDYDZ2Ways("
+    << theBase << ", " << theDX << ", " << theDY << ", " << theDZ << ")";
+
+  SetErrorCode(OK);
+  return aPrism;
+}
 
 //=============================================================================
 /*!
index 5f1f52f36411681bc3dcef256689134ea7fa8dfe..707a0ca4edb3133491c94356bbe28467ea8f2db7 100644 (file)
@@ -70,6 +70,12 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
                                        Handle(GEOM_Object) thePoint1,
                                        Handle(GEOM_Object) thePoint2);
 
+  Standard_EXPORT Handle(GEOM_Object) MakePrismDXDYDZ (Handle(GEOM_Object) theBase,
+                                     double theDX, double theDY, double theDZ);
+
+  Standard_EXPORT Handle(GEOM_Object) MakePrismDXDYDZ2Ways (Handle(GEOM_Object) theBase,
+                                     double theDX, double theDY, double theDZ);
+
   Standard_EXPORT Handle(GEOM_Object) MakePipe (Handle(GEOM_Object) theBase,
                                 Handle(GEOM_Object) thePath);
 
index 14c01864e8fa8c0fe26baa74519528eecb8dc7e6..abe542b1acf24e01888c377449052fc8b58172fb 100644 (file)
@@ -27,6 +27,9 @@
 #define PRISM_ARG_BASE  3
 #define PRISM_ARG_PNT_F 4
 #define PRISM_ARG_PNT_L 5
+#define PRISM_ARG_DX    6
+#define PRISM_ARG_DY    7
+#define PRISM_ARG_DZ    8
 
 class GEOMImpl_IPrism
 {
@@ -39,6 +42,14 @@ class GEOMImpl_IPrism
   void SetFirstPoint(Handle(GEOM_Function) thePoint) { _func->SetReference(PRISM_ARG_PNT_F, thePoint); }
   void SetLastPoint (Handle(GEOM_Function) thePoint) { _func->SetReference(PRISM_ARG_PNT_L, thePoint); }
 
+  void SetDX(double theDX) { _func->SetReal(PRISM_ARG_DX, theDX); }
+  void SetDY(double theDY) { _func->SetReal(PRISM_ARG_DY, theDY); }
+  void SetDZ(double theDZ) { _func->SetReal(PRISM_ARG_DZ, theDZ); }
+
+  double GetDX() { return _func->GetReal(PRISM_ARG_DX); }
+  double GetDY() { return _func->GetReal(PRISM_ARG_DY); }
+  double GetDZ() { return _func->GetReal(PRISM_ARG_DZ); }
+
   Handle(GEOM_Function) GetBase  () { return _func->GetReference(PRISM_ARG_BASE); }
   Handle(GEOM_Function) GetVector() { return _func->GetReference(PRISM_ARG_VEC ); }
   Handle(GEOM_Function) GetFirstPoint() { return _func->GetReference(PRISM_ARG_PNT_F ); }
index 11bb15ad6418bd5ee07977c8e4f49020c33e556a..cc492ef143a7868afcfef89884e82b4e8723dbca 100644 (file)
@@ -129,7 +129,21 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
         }
       }
     }
-  } else {
+  } else if (aType == PRISM_BASE_DXDYDZ || aType == PRISM_BASE_DXDYDZ_2WAYS) {
+    Handle(GEOM_Function) aRefBase = aCI.GetBase();
+    TopoDS_Shape aShapeBase = aRefBase->GetValue();
+    gp_Vec aV (aCI.GetDX(), aCI.GetDY(), aCI.GetDZ());
+    if (aV.Magnitude() > gp::Resolution()) {
+      if (aType == PRISM_BASE_DXDYDZ_2WAYS)
+       {
+         gp_Trsf aTrsf;
+         aTrsf.SetTranslation(-aV);
+         BRepBuilderAPI_Transform aTransformation(aShapeBase, aTrsf, Standard_False);
+         aShapeBase = aTransformation.Shape();
+         aV = aV * 2;
+       }
+      aShape = BRepPrimAPI_MakePrism(aShapeBase, aV, Standard_False).Shape();
+    }
   }
 
   if (aShape.IsNull()) return 0;
index 54b1564480c11c632cc49b850cb68d810019f157..1a6ec8907a319fd60d7b3a875b1101163aa77bef 100755 (executable)
 #define PRISM_BASE_TWO_PNT       2
 #define PRISM_BASE_VEC_H_2WAYS   3
 #define PRISM_BASE_TWO_PNT_2WAYS 4
+#define PRISM_BASE_DXDYDZ        5
+#define PRISM_BASE_DXDYDZ_2WAYS  6
 
 #define REVOLUTION_BASE_AXIS_ANGLE       1
 #define REVOLUTION_BASE_AXIS_ANGLE_2WAYS 2
index 081edeee648c9436ba2cd2fb11ded67bcd8af3dc..781760a766cf8ade7379499056f31219ae7f75e8 100644 (file)
@@ -239,8 +239,8 @@ static bool inUse( _PTR(Study) study, const QString& component, const QMap<QStri
       continue;
 
     GEOM::ListOfGO_var list = geomObj->GetDependency();
-    if( list->length() <= 1 ) 
-      continue; // ??? why 1?
+    if( list->length() == 0 ) 
+      continue;
 
     for( int i = 0; i < list->length(); i++ ) {
       bool depends = false;
index 55160f0fb836aaf88279c1fc7422fee5263b77f0..6689cf3457bf8912ea6b512941cddaccc3146d9d 100644 (file)
@@ -459,6 +459,68 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismTwoPnt2Ways
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakePrismDXDYDZ
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ
+                      (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
+                      CORBA::Double theDY, CORBA::Double theDZ)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theBase == NULL) return aGEOMObject._retn();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
+    (theBase->GetStudyID(), theBase->GetEntry());
+
+  if (aBase.IsNull()) return aGEOMObject._retn();
+
+  //Create the Prism
+  Handle(GEOM_Object) anObject =
+      GetOperations()->MakePrismDXDYDZ(aBase, theDX, theDY, theDZ);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *  MakePrismDXDYDZ2Ways
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePrismDXDYDZ2Ways
+                      (GEOM::GEOM_Object_ptr theBase, CORBA::Double theDX,
+                      CORBA::Double theDY, CORBA::Double theDZ)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (theBase == NULL) return aGEOMObject._retn();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aBase = GetOperations()->GetEngine()->GetObject
+    (theBase->GetStudyID(), theBase->GetEntry());
+
+  if (aBase.IsNull()) return aGEOMObject._retn();
+
+  //Create the Prism
+  Handle(GEOM_Object) anObject =
+      GetOperations()->MakePrismDXDYDZ2Ways(aBase, theDX, theDY, theDZ);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  MakePipe
index 330f4974b59b5300cb2d17321c46ed2b5da296be..d661684bdc9f9bde49275ca241504624169e2abc 100644 (file)
@@ -94,6 +94,15 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
                                              GEOM::GEOM_Object_ptr thePoint1,
                                              GEOM::GEOM_Object_ptr thePoint2);
 
+  GEOM::GEOM_Object_ptr MakePrismDXDYDZ (GEOM::GEOM_Object_ptr theBase,
+                                        CORBA::Double         theDX,
+                                        CORBA::Double         theDY,
+                                        CORBA::Double         theDZ);
+  GEOM::GEOM_Object_ptr MakePrismDXDYDZ2Ways (GEOM::GEOM_Object_ptr theBase,
+                                             CORBA::Double         theDX,
+                                             CORBA::Double         theDY,
+                                             CORBA::Double         theDZ);
+
   GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
                                  GEOM::GEOM_Object_ptr thePath);
 
index 461ef2d96f38af20245e4ead23c67c4574d0998d..3df6f396fa8f787d5334899d7dc2c561bb45eaf7 100644 (file)
@@ -967,6 +967,34 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr
   return anObj;
 }
 
+//=============================================================================
+//  MakePrismDXDYDZ:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismDXDYDZ (GEOM::GEOM_Object_ptr theBase,
+                     CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
+{
+  beginService( " GEOM_Superv_i::MakePrismDXDYDZ" );
+  MESSAGE("GEOM_Superv_i::MakePrismDXDYDZ");
+  get3DPrimOp();
+  GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismDXDYDZ(theBase, theDX, theDY, theDZ);
+  endService( " GEOM_Superv_i::MakePrismDXDYDZ" );
+  return anObj;
+}
+
+//=============================================================================
+//  MakePrismDXDYDZ:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePrismDXDYDZ2Ways (GEOM::GEOM_Object_ptr theBase,
+                     CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
+{
+  beginService( " GEOM_Superv_i::MakePrismDXDYDZ2Ways" );
+  MESSAGE("GEOM_Superv_i::MakePrismDXDYDZ2Ways");
+  get3DPrimOp();
+  GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ);
+  endService( " GEOM_Superv_i::MakePrismDXDYDZ2Ways" );
+  return anObj;
+}
+
 //=============================================================================
 //  MakePipe:
 //=============================================================================
index bdeadb12db2eb269368e20306e8e208dec30b2af..d5e03edeea7b4b4174b8d8cff3b36fb0cb3f4e8e 100644 (file)
@@ -226,6 +226,14 @@ public:
   GEOM::GEOM_Object_ptr MakePrismTwoPnt2Ways (GEOM::GEOM_Object_ptr theBase,
                                              GEOM::GEOM_Object_ptr thePoint1,
                                              GEOM::GEOM_Object_ptr thePoint2);
+  GEOM::GEOM_Object_ptr MakePrismDXDYDZ (GEOM::GEOM_Object_ptr theBase,
+                                        CORBA::Double         theDX,
+                                        CORBA::Double         theDY,
+                                        CORBA::Double         theDZ);
+  GEOM::GEOM_Object_ptr MakePrismDXDYDZ2Ways (GEOM::GEOM_Object_ptr theBase,
+                                             CORBA::Double         theDX,
+                                             CORBA::Double         theDY,
+                                             CORBA::Double         theDZ);
   GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase, 
                                  GEOM::GEOM_Object_ptr thePath);
   GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase,
index 46fb32260acef11abb84a8ec95aec6c5224d3d27..17057005c21ace80be86b1e4f0a40d6876d53081 100644 (file)
@@ -171,6 +171,8 @@ def TestAll (geompy, math):
   Copy       = geompy.MakeCopy(Box)                      #(GEOM_Object_ptr)->GEOM_Object_ptr
   Prism      = geompy.MakePrismVecH(Face, vz, 100.0)     #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
   Prism2Ways = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
+  PrismDXDYDZ= geompy.MakePrismDXDYDZ(Face2, 10, 20, 100)#(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
+  PrismDXDYDZ2Ways= geompy.MakePrismDXDYDZ2Ways(Face, 30, -20, 200)#(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
   Revolution = geompy.MakeRevolution(Face, vz, angle2)   #
   Revolution2Ways = geompy.MakeRevolution(Face, vz, angle1)   #
   Filling    = geompy.MakeFilling(Compound, mindeg, maxdeg,
@@ -336,6 +338,8 @@ def TestAll (geompy, math):
   id_Copy       = geompy.addToStudy(Copy,       "Copy")
   id_Prism      = geompy.addToStudy(Prism,      "Prism")
   id_Prism2Ways = geompy.addToStudy(Prism2Ways, "Prism2Ways")
+  id_PrismDXDYDZ= geompy.addToStudy(PrismDXDYDZ,"PrismDXDYDZ")
+  id_PrismDXDYDZ2Ways= geompy.addToStudy(PrismDXDYDZ2Ways,"PrismDXDYDZ2Ways")
   id_Revolution = geompy.addToStudy(Revolution, "Revolution")
   id_Revolution2Ways = geompy.addToStudy(Revolution2Ways, "Revolution2Ways")
   id_Filling    = geompy.addToStudy(Filling,    "Filling")
index 65fde5c8aaa8df39e93fda12ae1e3545a3ec4bf1..fcc2d40280e636f20a006dad1838aa80acf1b924 100644 (file)
@@ -851,6 +851,32 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
             RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
             return anObj
+           
+       ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
+        #  @param theBase Base shape to be extruded.
+        #  @param theDX, theDY, theDZ Directions of extrusion.
+        #  @return New GEOM_Object, containing the created prism.
+        #
+        #  @ref tui_creation_prism "Example"
+        def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
+            # Example: see GEOM_TestAll.py
+            anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
+            RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
+            return anObj
+           
+       ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
+        #  i.e. all the space, transfixed by the base shape during its translation
+        #  along the vector on the given distance in 2 Ways (forward/backward) .
+        #  @param theBase Base shape to be extruded.
+        #  @param theDX, theDY, theDZ Directions of extrusion.
+        #  @return New GEOM_Object, containing the created prism.
+        #
+        #  @ref tui_creation_prism "Example"
+        def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
+            # Example: see GEOM_TestAll.py
+            anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
+            RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
+            return anObj
 
         ## Create a shape by revolution of the base shape around the axis
         #  on the given angle, i.e. all the space, transfixed by the base
index 2149a77816a08b68c9e243bd49f89ad680597dea..e64a13e6cfb5e564d1e48a9ab15a42e2cdab5bb9 100644 (file)
@@ -58,6 +58,7 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg( GeometryGUI* theGeometryGUI, QWi
   QPixmap image0( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM" ) ) );
   QPixmap image1( aResMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
   QPixmap image2( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM_2P" ) ) );
+  QPixmap image3( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PRISM_DXDYDZ" ) ) );
 
   setWindowTitle( tr( "GEOM_EXTRUSION_TITLE" ) );
 
@@ -65,11 +66,10 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg( GeometryGUI* theGeometryGUI, QWi
   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_EXTRUSION" ) );
   mainFrame()->RadioButton1->setIcon( image0 );
   mainFrame()->RadioButton2->setIcon( image2 );
-  mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
-  mainFrame()->RadioButton3->close();
+  mainFrame()->RadioButton3->setIcon( image3 );
 
   mainFrame()->RadioButton1->setChecked( true );
-  myBothway = myBothway2 = false;
+  myBothway = myBothway2 = myBothway3 = false;
 
   GroupPoints = new DlgRef_2Sel1Spin2Check( centralWidget() );
   GroupPoints->GroupBox1->setTitle( tr( "GEOM_EXTRUSION_BSV" ) );
@@ -85,7 +85,6 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg( GeometryGUI* theGeometryGUI, QWi
   GroupPoints->CheckButton2->setText( tr( "GEOM_REVERSE" ) );
 
   GroupPoints2 = new DlgRef_3Sel1Check( centralWidget() );
-
   GroupPoints2->GroupBox1->setTitle( tr( "GEOM_EXTRUSION_BSV_2P" ) );
   GroupPoints2->TextLabel1->setText( tr( "GEOM_BASE" ) );
   GroupPoints2->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
@@ -96,10 +95,21 @@ GenerationGUI_PrismDlg::GenerationGUI_PrismDlg( GeometryGUI* theGeometryGUI, QWi
   GroupPoints2->CheckButton1->setText( tr( "GEOM_BOTHWAY" ) );
   GroupPoints2->CheckButton1->setChecked( myBothway2 );
 
+  GroupPoints3 = new DlgRef_1Sel3Spin1Check( centralWidget() );
+  GroupPoints3->GroupBox1->setTitle(tr("GEOM_EXTRUSION_DXDYDZ"));
+  GroupPoints3->TextLabel1->setText(tr("GEOM_BASE"));
+  GroupPoints3->PushButton1->setIcon(image1);
+  GroupPoints3->TextLabel2->setText(tr("GEOM_DX"));
+  GroupPoints3->TextLabel3->setText(tr("GEOM_DY"));
+  GroupPoints3->TextLabel4->setText(tr("GEOM_DZ"));
+  GroupPoints3->CheckButton1->setText( tr( "GEOM_BOTHWAY" ) );
+  GroupPoints3->CheckButton1->setChecked( myBothway3 );
+
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
   layout->addWidget( GroupPoints );
   layout->addWidget( GroupPoints2 );
+  layout->addWidget( GroupPoints3);
   /***************************************************************/
 
   setHelpFileName( "create_extrusion_page.html" );
@@ -133,6 +143,8 @@ void GenerationGUI_PrismDlg::Init()
   GroupPoints2->LineEdit2->setReadOnly( true );
   GroupPoints2->LineEdit3->setReadOnly( true );
 
+  GroupPoints3->LineEdit1->setReadOnly( true );
+
   myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
   myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
   
@@ -141,6 +153,13 @@ void GenerationGUI_PrismDlg::Init()
   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
 
   /* min, max, step and decimals for spin boxes & initial values */
+  initSpinBox( GroupPoints3->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+  initSpinBox( GroupPoints3->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+  initSpinBox( GroupPoints3->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
+  GroupPoints3->SpinBox_DX->setValue( 0.0 );
+  GroupPoints3->SpinBox_DY->setValue( 0.0 );
+  GroupPoints3->SpinBox_DZ->setValue( 0.0 );
+
   initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
   GroupPoints->SpinBox_DX->setValue( 100.0 );
 
@@ -165,12 +184,18 @@ void GenerationGUI_PrismDlg::Init()
   connect( GroupPoints2->PushButton1,  SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
   connect( GroupPoints2->PushButton2,  SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
   connect( GroupPoints2->PushButton3,  SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
-  connect( GroupPoints2->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( onBothway2() ) );
+  connect( GroupPoints2->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( onBothway() ) );
 
   connect( GroupPoints2->LineEdit1,    SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
   connect( GroupPoints2->LineEdit2,    SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
   connect( GroupPoints2->LineEdit3,    SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
 
+  connect( GroupPoints3->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
+  connect( GroupPoints3->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+  connect( GroupPoints3->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+  connect( GroupPoints3->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+  connect( GroupPoints3->SpinBox_DZ, SIGNAL( valueChanged ( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
+  connect( GroupPoints3->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( onBothway() ) );
 
   connect( myGeomGUI->getApp()->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
@@ -187,6 +212,9 @@ void GenerationGUI_PrismDlg::Init()
 void GenerationGUI_PrismDlg::SetDoubleSpinBoxStep( double step )
 {
   GroupPoints->SpinBox_DX->setSingleStep(step);
+  GroupPoints3->SpinBox_DX->setSingleStep(step);
+  GroupPoints3->SpinBox_DY->setSingleStep(step);
+  GroupPoints3->SpinBox_DZ->setSingleStep(step);
 }
 
 
@@ -205,6 +233,7 @@ void GenerationGUI_PrismDlg::ConstructorsClicked( int constructorId )
       globalSelection( GEOM_ALLSHAPES );
 
       GroupPoints2->hide();
+      GroupPoints3->hide();
       GroupPoints->show();
       
       myEditCurrentArgument = GroupPoints->LineEdit1;
@@ -221,6 +250,7 @@ void GenerationGUI_PrismDlg::ConstructorsClicked( int constructorId )
 
       GroupPoints->hide();
       GroupPoints2->show();
+      GroupPoints3->hide();
       
       myEditCurrentArgument = GroupPoints2->LineEdit1;
       GroupPoints2->LineEdit1->setText( GroupPoints->LineEdit1->text() ); // keep base
@@ -231,6 +261,17 @@ void GenerationGUI_PrismDlg::ConstructorsClicked( int constructorId )
       
       break;
     }
+  case 2:
+    {
+      globalSelection( GEOM_ALLSHAPES );
+
+      GroupPoints->hide();
+      GroupPoints2->hide();
+      GroupPoints3->show();
+
+      myEditCurrentArgument = GroupPoints3->LineEdit1;
+      GroupPoints3->LineEdit1->setText( GroupPoints->LineEdit1->text() ); // keep base
+    }
   }
 
   qApp->processEvents();
@@ -340,7 +381,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
     }
     myEditCurrentArgument->setText( aName );
   }
-  else { // getConstructorId()==1 - extrusion using 2 points
+  else if ( getConstructorId() == 1 ) { // getConstructorId()==1 - extrusion using 2 points
     if ( IObjectCount() != 1 ) {
       if ( myEditCurrentArgument == GroupPoints2->LineEdit1 )
         myOkBase = false;
@@ -410,6 +451,18 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
       myPoint2 = aSelectedObject;
     }
   }
+  else if ( getConstructorId() == 2 ) { // extrusion using dx dy dz
+    Standard_Boolean testResult = Standard_False;
+    GEOM::GEOM_Object_var aSelectedObject =
+      GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+    
+    if ( !testResult || CORBA::is_nil( aSelectedObject ) )
+      return;
+    
+    QString aName = GEOMBase::GetName( aSelectedObject );
+    myBase = aSelectedObject;
+    myEditCurrentArgument->setText( aName );
+  }
  
   displayPreview();
 }
@@ -447,6 +500,10 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints2->LineEdit3;
     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
   }
+  else   if ( send == GroupPoints3->PushButton1 ) {
+    GroupPoints3->LineEdit1->setFocus();
+    myEditCurrentArgument = GroupPoints3->LineEdit1;
+  }
 
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
@@ -464,7 +521,8 @@ void GenerationGUI_PrismDlg::LineEditReturnPressed()
        send == GroupPoints->LineEdit2 ||
        send == GroupPoints2->LineEdit1 ||
        send == GroupPoints2->LineEdit2 ||
-       send == GroupPoints2->LineEdit3 ) {
+       send == GroupPoints2->LineEdit3 ||
+       send == GroupPoints3->LineEdit1) {
     myEditCurrentArgument = send;
     GEOMBase_Skeleton::LineEditReturnPressed();
   }
@@ -532,8 +590,10 @@ bool GenerationGUI_PrismDlg::isValid( QString& )
 {
   if ( getConstructorId() == 0 )
     return ( myOkBase && myOkVec );     // by vector and height
-  else
+  else if ( getConstructorId() == 1 )
     return ( myOkBase && myOkPnt1 && myOkPnt2 );   // by two points
+  else if ( getConstructorId() == 2 )
+    return true;
 }
 
 //=================================================================================
@@ -565,6 +625,20 @@ bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
         MakePrismTwoPnt2Ways( myBase, myPoint1, myPoint2 );
     }
     break;
+  case 2 :
+    double dx = GroupPoints3->SpinBox_DX->value();
+    double dy = GroupPoints3->SpinBox_DY->value();
+    double dz = GroupPoints3->SpinBox_DZ->value();
+
+    if ( !myBothway3 ) {
+      anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+       MakePrismDXDYDZ( myBase, dx, dy, dz );
+    }
+    else {
+      anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+       MakePrismDXDYDZ2Ways( myBase, dx, dy, dz );
+    }
+    break;
   }
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
@@ -589,17 +663,25 @@ void GenerationGUI_PrismDlg::onReverse()
 //=================================================================================
 void GenerationGUI_PrismDlg::onBothway()
 {
-  bool anOldValue = myBothway;
-  myBothway = !anOldValue;
-  GroupPoints->CheckButton2->setEnabled( !myBothway );
-  displayPreview();
-}
-
-void GenerationGUI_PrismDlg::onBothway2()
-{
-  bool anOldValue = myBothway2;
-  myBothway2 = !anOldValue;
-  displayPreview();
+  bool anOldValue;
+  switch ( getConstructorId() ) {
+  case 0:
+    anOldValue = myBothway;
+    myBothway = !anOldValue;
+    GroupPoints->CheckButton2->setEnabled( !myBothway );
+    displayPreview();
+    break;
+  case 1:
+    anOldValue = myBothway2;
+    myBothway2 = !anOldValue;
+    displayPreview();
+    break;
+  case 2:
+    anOldValue = myBothway3;
+    myBothway3 = !anOldValue;
+    displayPreview();
+    break;
+  }
 }
 
 //=================================================================================
index c36047a50b881684a0507adb990d426eafbb941c..78bf3453afc5930f3cda5804da8a1e1f1254b62e 100644 (file)
@@ -30,6 +30,7 @@
 
 class DlgRef_2Sel1Spin2Check;
 class DlgRef_3Sel1Check;
+class DlgRef_1Sel3Spin1Check;
 
 //=================================================================================
 // class    : GenerationGUI_PrismDlg
@@ -66,9 +67,11 @@ private:
   bool                               myOkPnt2;
   bool                               myBothway;
   bool                               myBothway2;
+  bool                               myBothway3;
   
   DlgRef_2Sel1Spin2Check*            GroupPoints;
   DlgRef_3Sel1Check*                 GroupPoints2; // for second layout for extrusion using 2 points
+  DlgRef_1Sel3Spin1Check*            GroupPoints3;
   
 private slots:
   void                               ClickOnOk();
@@ -82,7 +85,6 @@ private slots:
   void                               SetDoubleSpinBoxStep( double );
   void                               onReverse();
   void                               onBothway();
-  void                               onBothway2();
 };
 
 #endif // GENERATIONGUI_PRISMDLG_H