Salome HOME
Merge branch 'V8_0_0_BR'
authorvsr <vsr@opencascade.com>
Wed, 9 Mar 2016 14:28:19 +0000 (17:28 +0300)
committervsr <vsr@opencascade.com>
Wed, 9 Mar 2016 14:29:09 +0000 (17:29 +0300)
23 files changed:
CMakeLists.txt
idl/GEOM_Gen.idl
src/GEOM/GEOM_Engine.cxx
src/GEOMBase/CMakeLists.txt
src/GEOMGUI/GEOMGUI.cxx
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx
src/GEOMToolsGUI/CMakeLists.txt
src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
src/GEOM_SWIG/geomBuilder.py
src/GEOM_SWIG_WITHIHM/CMakeLists.txt
src/Material/CMakeLists.txt
src/PrimitiveGUI/CMakeLists.txt
src/Tools/geom_plugins.py
src/Tools/t_shape/t_shape_dialog.py
src/Tools/t_shape/t_shape_progress.py
src/XAOPlugin/XAOPlugin_IOperations.cxx
src/XAOPlugin/XAOPlugin_IOperations.hxx

index cd26147d5542ed6bed68ce8fb1e2e8528046075a..15509ee2b4403d99472cbfc2806662751e725f55 100755 (executable)
@@ -29,8 +29,8 @@ CMAKE_POLICY(SET CMP0003 NEW)
 # Project name, upper case
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
-SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
+SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
index 830fcc3984dfdef42f54e5e4567a932a644e3a86..be4adbbd0c744a61047e0f35ce5c5a76181839a5 100644 (file)
@@ -299,7 +299,9 @@ module GEOM
     long GetStudyID();
 
     /*!
-     *  \brief Get internal type of the object (POINT, BOX, CYLINDER, EXTRUSION...).
+     *  \brief Get internal type of operation created this object (POINT, BOX, CYLINDER, EXTRUSION...).
+     *  \note To get topological information on the object, use \ref GEOM_IMeasureOperations::WhatIs() "WhatIs()"
+     * or \ref GEOM_IMeasureOperations::KindOfShape() "KindOfShape()" operation.
      */
     long GetType();
 
@@ -2654,7 +2656,8 @@ module GEOM
      *  coincident with \a theShapeWhat or could be a part of it.
      *  \param theShapeWhere Shape to find sub-shapes of.
      *  \param theShapeWhat Shape, specifying what to find.
-     *  \return Group of all found sub-shapes or a single found sub-shape.
+     *  \return Compound which includes all found sub-shapes if they have different types; 
+     *          or group of all found shapes of the equal type; or a single found sub-shape.
      */
     GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
                             in GEOM_Object theShapeWhat);
@@ -2677,7 +2680,8 @@ module GEOM
      *
      *  \param theShapeWhere Shape to find sub-shapes of.
      *  \param theShapeWhat Shape, specifying what to find.
-     *  \return Group of all found sub-shapes or a single found sub-shape.
+     *  \return Compound which includes all found sub-shapes if they have different types; 
+     *          or group of all found shapes of the equal type; or a single found sub-shape.
      */
     GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere,
                                      in GEOM_Object theShapeWhat);
index e7921bed45520072b77f5adaec1feb7d13c833ca..41be7c204759355bfbe06639a660505cd3ecd30d 100644 (file)
@@ -1278,7 +1278,10 @@ void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
 
             const int aRefTag = GetTag(anObjEntry);
 
-            theRefMap[anObjTag].push_back(aRefTag);
+            if (anObjTag != aRefTag) {
+              // Avoid making references for operations without copy.
+              theRefMap[anObjTag].push_back(aRefTag);
+            }
           }
         }
       }
index a6b58e6a51931c3ab74915ce635a0b4b92186961..21cd7e8b27a89a5104445dbe3d87e57fd4f5c9d4 100755 (executable)
@@ -17,6 +17,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(UseQtExt)
+
 # --- options ---
 
 # additional include directories
index 05dabb9fe66b30786516fa9c18a908dd33d993e4..9425cb809fc7f50c58e7da891998425bbccdefce 100644 (file)
@@ -68,7 +68,7 @@ bool GEOMGUI::OnGUIEvent( int /*theCommandID*/, SUIT_Desktop* /*parent*/ )
 
 //=================================================================================
 // class    : GEOMGUI::OnMousePress
-// purpose  : Mouse press event processing. Should return FALSE to let the event 
+// purpose  : Mouse press event processing. Should return false to let the event 
 //            be processed further.
 //=================================================================================
 bool GEOMGUI::OnMousePress( QMouseEvent* /*pe*/, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* /*studyFrame*/ )
index 5a094f30350e99d841b479aa8bd979c7027a9e99..7aef53a751b3625a813ffaf0b1fbf2838fc82a75 100644 (file)
@@ -4960,10 +4960,18 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
         <translation>Show dependency tree</translation>
     </message>
+    <message>
+        <source>STB_POP_SHOW_DEPENDENCY_TREE</source>
+        <translation>Show dependency tree</translation>
+    </message>
     <message>
         <source>MEN_POP_REDUCE_STUDY</source>
         <translation>Reduce study</translation>
     </message>
+    <message>
+        <source>STB_POP_REDUCE_STUDY</source>
+        <translation>Reduce study</translation>
+    </message>
     <message>
         <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
         <translation>Show all dimensions</translation>
index 01acd20ca6eab1a8ae9b5a00f7a97c0e5efe2a39..a7111b94cdd24dccee789e52734d003a84e1fdb8 100644 (file)
@@ -4952,10 +4952,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
         <translation>Montrer l&apos;arbre des dépendances</translation>
     </message>
+    <message>
+        <source>STB_POP_SHOW_DEPENDENCY_TREE</source>
+        <translation>Montrer l&apos;arbre des dépendances</translation>
+    </message>
     <message>
         <source>MEN_POP_REDUCE_STUDY</source>
         <translation>Etude réduite</translation>
     </message>
+    <message>
+        <source>STB_POP_REDUCE_STUDY</source>
+        <translation>Etude réduite</translation>
+    </message>
     <message>
         <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
         <translation>Afficher les cotations </translation>
index 0a55e444fd7b2cd6d66f5f56061e08721a6aeca1..0e42dfe3d1eb514175630d8ce303014118e3e316 100644 (file)
       <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
       <translation>依存ツリーの表示</translation>
     </message>
+    <message>
+      <source>STB_POP_SHOW_DEPENDENCY_TREE</source>
+      <translation>依存ツリーの表示</translation>
+    </message>
     <message>
       <source>MEN_POP_REDUCE_STUDY</source>
       <translation>スタディの削減</translation>
     </message>
+    <message>
+      <source>STB_POP_REDUCE_STUDY</source>
+      <translation>スタディの削減</translation>
+    </message>
     <message>
       <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
       <translation>すべての寸法を表示</translation>
index ef5b07e7943a51d232e5e7aa9ed7e7a13bcdebf7..039bf002733835441382fdcf1bd5d509b69ad62e 100644 (file)
@@ -180,6 +180,8 @@ static GeomFill_Trihedron EvaluateBestSweepMode(const TopoDS_Shape& Spine)
 //=======================================================================
 static Standard_Boolean BuildPipeShell(BRepOffsetAPI_MakePipeShell &theBuilder)
 {
+  theBuilder.SetForceApproxC1(Standard_True);
+
   theBuilder.Build();
 
   Standard_Boolean isDone = theBuilder.IsDone();
@@ -3125,7 +3127,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
     else
     {
       GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
-      BRepOffsetAPI_MakePipe aMkPipe(aWirePath, aShapeBase, theBestMode);
+      BRepOffsetAPI_MakePipe aMkPipe
+        (aWirePath, aShapeBase, theBestMode, Standard_True);
 
       if (aMkPipe.IsDone() && aMkPipe.ErrorOnSurface() <= TolPipeSurf) {
         aShape = aMkPipe.Shape();
@@ -3137,7 +3140,7 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
       } else if (theBestMode != GeomFill_IsDiscreteTrihedron) {
         // Try to use Descrete Trihedron mode.
         BRepOffsetAPI_MakePipe aMkPipeDescrete
-          (aWirePath, aShapeBase, GeomFill_IsDiscreteTrihedron);
+          (aWirePath, aShapeBase, GeomFill_IsDiscreteTrihedron, Standard_True);
 
         if (aMkPipeDescrete.IsDone()) {
           aShape = aMkPipeDescrete.Shape();
index 8b585f83eb84600974d473540fda0a53d1070955..46bcd193eb05c6f17811afd69e9513c49eccac6d 100644 (file)
@@ -73,6 +73,8 @@
 #include <TopoDS_Compound.hxx>
 #include <TopoDS_Iterator.hxx>
 
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_HSequenceOfShape.hxx>
 
@@ -161,6 +163,185 @@ namespace
 
     return result;
   }
+
+  /**
+   * This function adds faces from the input shape into the list of faces. If
+   * the input shape is a face, it is added itself. If it is a shell, its
+   * sub-shapes (faces) are added. If it is a compound, its sub-shapes
+   * (faces or shells) are added in the list. For null shapes and for other
+   * types of shapes an exception is thrown.
+   *
+   * @param theShape the shape to be added. Either face or shell or a compound
+   *        of faces and/or shells.
+   * @param theListFaces the list of faces that is modified on output.
+   * @param theMapFence the map that protects from adding the same faces in
+   *        the list.
+   */
+  void addFaces(const TopoDS_Shape         &theShape,
+                      TopTools_ListOfShape &theListFaces,
+                      TopTools_MapOfShape  &theMapFence)
+  {
+    if (theShape.IsNull()) {
+      Standard_NullObject::Raise("Face for shell construction is null");
+    }
+
+    // Append the shape is the mapFence
+    if (theMapFence.Add(theShape)) {
+      // Shape type
+      const TopAbs_ShapeEnum aType = theShape.ShapeType();
+
+      if (aType == TopAbs_FACE) {
+        theListFaces.Append(theShape);
+      } else if (aType == TopAbs_SHELL || aType == TopAbs_COMPOUND) {
+        TopoDS_Iterator anIter(theShape);
+
+        for (; anIter.More(); anIter.Next()) {
+          // Add sub-shapes: faces for shell or faces/shells for compound.
+          const TopoDS_Shape &aSubShape = anIter.Value();
+
+          addFaces(aSubShape, theListFaces, theMapFence);
+        }
+      } else {
+        Standard_TypeMismatch::Raise
+          ("Shape for shell construction is neither a shell nor a face");
+      }
+    }
+  }
+
+  /**
+   * This function constructs a shell or a compound of shells
+   * from a set of faces and/or shells.
+   *
+   * @param theShapes is a set of faces, shells and/or
+   *        compounds of faces/shells.
+   * @return a shell or a compound of shells.
+   */
+  TopoDS_Shape makeShellFromFaces
+        (const Handle(TColStd_HSequenceOfTransient) &theShapes)
+  {
+    const Standard_Integer aNbShapes = theShapes->Length();
+    Standard_Integer       i;
+    TopTools_ListOfShape   aListFaces;
+    TopTools_MapOfShape    aMapFence;
+    BRep_Builder           aBuilder;
+
+    // Fill the list of unique faces
+    for (i = 1; i <= aNbShapes; ++i) {
+      // Function
+      const Handle(GEOM_Function) aRefShape =
+        Handle(GEOM_Function)::DownCast(theShapes->Value(i));
+
+      if (aRefShape.IsNull()) {
+        Standard_NullObject::Raise("Face for shell construction is null");
+      }
+
+      // Shape
+      const TopoDS_Shape aShape = aRefShape->GetValue();
+
+      addFaces(aShape, aListFaces, aMapFence);
+    }
+
+    // Perform computation of shells.
+    TopTools_ListOfShape               aListShells;
+    TopTools_ListIteratorOfListOfShape anIter;
+
+    while (!aListFaces.IsEmpty()) {
+      // Perform sewing
+      BRepBuilderAPI_Sewing aSewing(Precision::Confusion()*10.0);
+
+      for (anIter.Initialize(aListFaces); anIter.More(); anIter.Next()) {
+        aSewing.Add(anIter.Value());
+      }
+
+      aSewing.Perform();
+
+      // Fill list of shells.
+      const TopoDS_Shape &aSewed = aSewing.SewedShape();
+      TopExp_Explorer     anExp(aSewed, TopAbs_SHELL);
+      Standard_Boolean    isNewShells = Standard_False;
+
+      // Append shells
+      for (; anExp.More(); anExp.Next()) {
+        aListShells.Append(anExp.Current());
+        isNewShells = Standard_True;
+      }
+
+      // Append single faces.
+      anExp.Init(aSewed, TopAbs_FACE, TopAbs_SHELL);
+
+      for (; anExp.More(); anExp.Next()) {
+        TopoDS_Shell aShell;
+
+        aBuilder.MakeShell(aShell);
+        aBuilder.Add(aShell, anExp.Current());
+        aListShells.Append(aShell);
+        isNewShells = Standard_True;
+      }
+
+      if (!isNewShells) {
+        // There are no more shell can be obtained. Break the loop.
+        break;
+      }
+
+      // Remove faces that are in the result from the list.
+      TopTools_IndexedMapOfShape aMapFaces;
+
+      TopExp::MapShapes(aSewed, TopAbs_FACE, aMapFaces);
+
+      // Add deleted faces to the map
+      const Standard_Integer aNbDelFaces = aSewing.NbDeletedFaces();
+
+      for (i = 1; i <= aNbDelFaces; ++i) {
+        aMapFaces.Add(aSewing.DeletedFace(i));
+      }
+
+      for (anIter.Initialize(aListFaces); anIter.More();) {
+        const TopoDS_Shape &aFace      = anIter.Value();
+        Standard_Boolean    isFaceUsed = Standard_False;
+
+        if (aMapFaces.Contains(aFace) || aSewing.IsModified(aFace)) {
+          // Remove face from the list.
+          aListFaces.Remove(anIter);
+        } else {
+          // Go to the next face.
+          anIter.Next();
+        }
+      }
+    }
+
+    // If there are faces not used in shells create a shell for each face.
+    for (anIter.Initialize(aListFaces); anIter.More(); anIter.Next()) {
+      TopoDS_Shell aShell;
+
+      aBuilder.MakeShell(aShell);
+      aBuilder.Add(aShell, anIter.Value());
+      aListShells.Append(aShell);
+    }
+
+    // Construct the result that can be either a shell or a compound of shells
+    TopoDS_Shape aResult;
+
+    if (!aListShells.IsEmpty()) {
+      if (aListShells.Extent() == 1) {
+        aResult = aListShells.First();
+      } else {
+        // There are more then one shell.
+        TopoDS_Compound aCompound;
+
+        aBuilder.MakeCompound(aCompound);
+
+        for (anIter.Initialize(aListShells); anIter.More(); anIter.Next()) {
+          aBuilder.Add(aCompound, anIter.Value());
+        }
+
+        aResult = aCompound;
+      }
+    }
+
+    return aResult;
+  }
+
+  // End of namespace
 }
 
 //modified by NIZNHY-PKV Wed Dec 28 13:48:20 2011f
@@ -432,60 +613,13 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
-    unsigned int ind, nbshapes = aShapes->Length();
 
-    // add faces
-    BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
-    for (ind = 1; ind <= nbshapes; ind++) {
-      Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
-      TopoDS_Shape aShape_i = aRefShape->GetValue();
-      if (aShape_i.IsNull()) {
-        Standard_NullObject::Raise("Face for shell construction is null");
-      }
-      aSewing.Add(aShape_i);
-    }
-
-    aSewing.Perform();
-
-    TopoDS_Shape sh = aSewing.SewedShape();
-
-    if (sh.ShapeType()==TopAbs_FACE && nbshapes==1) {
-      // case for creation of shell from one face - PAL12722 (skl 26.06.2006)
-      TopoDS_Shell ss;
-      B.MakeShell(ss);
-      B.Add(ss,sh);
-      aShape = ss;
-    }
-    else {
-      //TopExp_Explorer exp (aSewing.SewedShape(), TopAbs_SHELL);
-      TopExp_Explorer exp (sh, TopAbs_SHELL);
-      Standard_Integer ish = 0;
-      for (; exp.More(); exp.Next()) {
-        aShape = exp.Current();
-        ish++;
-      }
-
-      if (ish != 1) {
-        // try the case of one face (Mantis issue 0021809)
-        TopExp_Explorer expF (sh, TopAbs_FACE);
-        Standard_Integer ifa = 0;
-        for (; expF.More(); expF.Next()) {
-          aShape = expF.Current();
-          ifa++;
-        }
-
-        if (ifa == 1) {
-          TopoDS_Shell ss;
-          B.MakeShell(ss);
-          B.Add(ss,aShape);
-          aShape = ss;
-        }
-        else {
-          aShape = aSewing.SewedShape();
-        }
-      }
+    if (aShapes.IsNull()) {
+      Standard_NullObject::Raise("Argument Shapes is null");
     }
 
+    // Compute a shell or a compound of shells.
+    aShape = makeShellFromFaces(aShapes);
   }
   else if (aType == SOLID_SHELLS) {
     // result may be only a solid or a compound of solids
index 96380bee200dd35a559061624d99094405f7a2f5..47164d839e54afcd169384a75937e9284f0311f7 100755 (executable)
@@ -17,6 +17,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(UseQtExt)
+
 # --- options ---
 
 # additional include directories
index 1d8bc588b7addaeee135cc631c2ff8e3a2c58282..0a8e4ffdee156502cfeddbab559133679353ea1f 100644 (file)
@@ -43,7 +43,7 @@
 // purpose  : Constructs a GEOMToolsGUI_DeflectionDlg which is a child of 'parent', with the
 //            name 'name' and widget flags set to 'f'.
 //            The dialog will by default be modeless, unless you set 'modal' to
-//            TRUE to construct a modal dialog.
+//            true to construct a modal dialog.
 //=================================================================================
 GEOMToolsGUI_DeflectionDlg::GEOMToolsGUI_DeflectionDlg (QWidget* parent)
   : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
index bfadece29630050034f0a1936ef73c347ca081aa..82985ae1a99a04ec4f428d264ce816ec3162690b 100644 (file)
@@ -44,7 +44,7 @@
 // purpose  : Constructs a GEOMToolsGUI_LineWidthDlg which is a child of 'parent', with the
 //            name 'name' and widget flags set to 'f'.
 //            The dialog will by default be modeless, unless you set 'modal' to
-//            TRUE to construct a modal dialog.
+//            true to construct a modal dialog.
 //=================================================================================
 
 GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QString& title)
index 724346eb831819f12cb3fc242490bd3df132c329..4e7541f0422a700ffbc9e3be430a6a36688993df 100644 (file)
@@ -44,7 +44,7 @@
 // purpose  : Constructs a GEOMToolsGUI_NbIsosDlg which is a child of 'parent', with the 
 //            name 'name' and widget flags set to 'f'.
 //            The dialog will by default be modeless, unless you set 'modal' to
-//            TRUE to construct a modal dialog.
+//            true to construct a modal dialog.
 //=================================================================================
 GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
   :QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
index 0f90ef502729c5cd536a1c8c0cf915e1220f8f15..379105b72a48a6dcf43e508f4921e63a3a4b22dc 100644 (file)
@@ -4834,8 +4834,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "face")
             return anObj
 
-        ## Create a shell from the set of faces and shells.
-        #  @param theFacesAndShells List of faces and/or shells.
+        ## Create a shell from the set of faces, shells and/or compounds of faces.
+        #  @param theFacesAndShells List of faces, shells and/or compounds of faces.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -5866,7 +5866,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return Group of all found sub-shapes or a single found sub-shape.
+        #  @return Compound which includes all found sub-shapes if they have different types; 
+        #          or group of all found shapes of the equal type; or a single found sub-shape.
         #
         #  @note This function has a restriction on argument shapes.
         #        If \a theShapeWhere has curved parts with significantly
@@ -5891,7 +5892,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                Group of all found sub-shapes or a single found sub-shape.
+                Compound which includes all found sub-shapes if they have different types; 
+                or group of all found shapes of the equal type; or a single found sub-shape.
 
 
             Note:
@@ -5927,7 +5929,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return Group of all found sub-shapes or a single found sub-shape.
+        #  @return Compound which includes all found sub-shapes if they have different types; 
+        #          or group of all found shapes of the equal type; or a single found sub-shape.
         #
         #  @ref swig_GetInPlace "Example"
         @ManageTransactions("ShapesOp")
@@ -5948,7 +5951,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                Group of all found sub-shapes or a single found sub-shape.
+                Compound which includes all found sub-shapes if they have different types; 
+                or group of all found shapes of the equal type; or a single found sub-shape.
             """
             # Example: see GEOM_TestOthers.py
             anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
index 8580ae6ebb0ca701bb4440cdcf9af7e7f60fcd71..4b06077951312ac34fd35c0bec75a6f8bf704b9f 100755 (executable)
 #
 
 INCLUDE(${SWIG_USE_FILE})
-INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
+  ${QT_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
index c7f0291abcbe94a8622757a3df3cb7eb17bffd6b..7511183a63b32b10fa2ec4f75fd067a003d778f9 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(UseQtExt)
+
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
+  ${QT_INCLUDE_DIRS}
   ${VTK_INCLUDE_DIRS}
   ${OMNIORB_INCLUDE_DIR}
   ${CAS_INCLUDE_DIRS}
index 876d2068f53a253bd73767e2e151be3a341ff520..38a9d318e2f8220e285f9cb375aa6820f5e72d1f 100755 (executable)
@@ -17,6 +17,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+INCLUDE(UseQtExt)
+
 # --- options ---
 
 # additional include directories
index 39596159581e0d708e839bba2dbeaf9eecde8201..d9f72d4abf38e28c1738704d5f86006ced00be52 100644 (file)
@@ -26,7 +26,7 @@ def t_shape_fluid(context):
     from salome.geom.t_shape import t_shape_dialog
     from salome.geom.t_shape import t_shape_progress
     import xalome
-    from PyQt4.QtGui import QMessageBox
+    from qtsalome import QMessageBox
     activeStudy = context.study
     
     dialog = t_shape_dialog.TShapeDialog()
index c385efd0c1f9b7d1699de620022d33aea2a492fb..7ee76c238433b402cd85f7ccabacb164dbf2f44f 100644 (file)
 # Author : Renaud Nédélec (OpenCascade S.A.S)
 
 import sys
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from qtsalome import *
 
 from t_shape_dialog_ui import Ui_Dialog
 
 
-class TShapeDialog(QtGui.QDialog):
+class TShapeDialog(QDialog):
     def __init__(self):
-      QtGui.QDialog.__init__(self, None, QtCore.Qt.Tool)
+      QDialog.__init__(self, None, Qt.Tool)
       # Set up the user interface from Designer.
       self.ui = Ui_Dialog()
       self.ui.setupUi(self)
@@ -43,7 +42,7 @@ class TShapeDialog(QtGui.QDialog):
    
     def accept(self):
       self._wasOk = True
-      QtGui.QDialog.accept(self)
+      QDialog.accept(self)
       
     def getData(self):
       r1 = self.ui.dsb_bigRadius.value()
@@ -58,7 +57,7 @@ class TShapeDialog(QtGui.QDialog):
 
     def reject(self):
         self._wasOk = False
-        QtGui.QDialog.reject(self)
+        QDialog.reject(self)
 
     def wasOk(self):
         return self._wasOk
@@ -70,7 +69,7 @@ class TShapeDialog(QtGui.QDialog):
 
 def main( args ):
     import sys
-    app = QtGui.QApplication(sys.argv)
+    app = QApplication(sys.argv)
     Dialog = TShapeDialog()
     ui = Ui_Dialog()
     ui.setupUi(Dialog)
index 38f804502aa86cd8022731ab96fdc20a82c7808b..96415d1ac6f557e8ce2641cb11133eaeadfcf5f0 100644 (file)
 # Author : Renaud Nédélec (OpenCascade S.A.S)
 
 from salome.geom.t_shape import t_shape_builder
-from PyQt4.QtGui import QProgressDialog
-from PyQt4 import QtCore
+from qtsalome import *
 
 class t_shape_progress(QProgressDialog):
     _totSteps = 0
     _nmaxSteps = 27
     
     def __init__(self, parent=None):
-      QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, QtCore.Qt.Tool)
+      QProgressDialog.__init__(self, "t_shape fluid build", "stop", 0, self._nmaxSteps, parent, Qt.Tool)
       self.show()
         
     def run(self, activeStudy, r1, r2, h1, h2, thickness):
index d8c886274f57b19a6f7af9d30444b4f41ad78052..a6f094194cd7edbc01b88b41698a0043ce0f5a44 100644 (file)
@@ -113,15 +113,19 @@ XAOPlugin_IOperations::~XAOPlugin_IOperations()
   MESSAGE( "XAOPlugin_IOperations::~XAOPlugin_IOperations" );
 }
 
-void XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupList,
-                                                  XAO::Xao* xaoObject,
-                                                  XAO::BrepGeometry* geometry )
+bool XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupList,
+                                          XAO::Xao* xaoObject,
+                                          XAO::BrepGeometry* geometry )
 {
   // add the groups
   std::list<Handle(GEOM_Object)>::iterator groupIterator = groupList.begin();
   while (groupIterator != groupList.end())
   {
     Handle(GEOM_Object) currGroup = (*groupIterator++);
+    if (currGroup->GetType() != GEOM_GROUP) {
+      SetErrorCode("Error when export groups: you could perform this operation only with group.");
+      return false;
+    }
     Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(currGroup);
 
     TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(currGroup);
@@ -164,11 +168,12 @@ void XAOPlugin_IOperations::exportGroups( std::list<Handle(GEOM_Object)> groupLi
       break;
     }
   }
+  return true;
 }
 
 void XAOPlugin_IOperations::exportFields( std::list<Handle(GEOM_Field)> fieldList,
-                                                  XAO::Xao* xaoObject,
-                                                  XAO::BrepGeometry* geometry )
+                                          XAO::Xao* xaoObject,
+                                          XAO::BrepGeometry* geometry )
 {
   std::list<Handle(GEOM_Field)>::iterator fieldIterator = fieldList.begin();
   while (fieldIterator != fieldList.end())
@@ -301,10 +306,10 @@ void XAOPlugin_IOperations::exportSubshapes( const Handle(GEOM_Object)& shape, X
  */
 //=============================================================================
 bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape,
-                                      std::list<Handle(GEOM_Object)> groupList,
-                                      std::list<Handle(GEOM_Field)> fieldList,
-                                      const char* author,
-                                      const char* fileName )
+                                       std::list<Handle(GEOM_Object)> groupList,
+                                       std::list<Handle(GEOM_Field)> fieldList,
+                                       const char* author,
+                                       const char* fileName )
 {
   SetErrorCode(KO);
 
@@ -337,7 +342,7 @@ bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape,
   exportSubshapes(shape, geometry);
   xaoObject->setGeometry(geometry);
 
-  exportGroups(groupList, xaoObject, geometry);
+  if (!exportGroups(groupList, xaoObject, geometry)) return false;
   exportFields(fieldList, xaoObject, geometry);
 
   // export the XAO to the file
@@ -380,8 +385,8 @@ bool XAOPlugin_IOperations::ExportXAO( Handle(GEOM_Object) shape,
 }
 
 void XAOPlugin_IOperations::importSubShapes( XAO::Geometry* xaoGeometry,
-                                                     Handle(GEOM_Function) function, int shapeType, int dim,
-                                                     Handle(TColStd_HSequenceOfTransient)& subShapeList )
+                                             Handle(GEOM_Function) function, int shapeType, int dim,
+                                             Handle(TColStd_HSequenceOfTransient)& subShapeList )
 {
   Handle(GEOM_Object) subShape;
   Handle(GEOM_Function) aFunction;
@@ -433,10 +438,10 @@ void XAOPlugin_IOperations::importSubShapes( XAO::Geometry* xaoGeometry,
  */
 //=============================================================================
 bool XAOPlugin_IOperations::ImportXAO( const char* fileName,
-                                               Handle(GEOM_Object)& shape,
-                                               Handle(TColStd_HSequenceOfTransient)& subShapes,
-                                               Handle(TColStd_HSequenceOfTransient)& groups,
-                                               Handle(TColStd_HSequenceOfTransient)& fields )
+                                       Handle(GEOM_Object)& shape,
+                                       Handle(TColStd_HSequenceOfTransient)& subShapes,
+                                       Handle(TColStd_HSequenceOfTransient)& groups,
+                                       Handle(TColStd_HSequenceOfTransient)& fields )
 {
   SetErrorCode(KO);
 
index 869e3a1c2547b9baa4ff8468193714807717f339..2b477442a1a0d42b3237f2edab9c5b7da0184429 100644 (file)
@@ -44,31 +44,31 @@ public:
   ~XAOPlugin_IOperations();
 
   bool ExportXAO( Handle(GEOM_Object) shape,
-                 std::list<Handle(GEOM_Object)> groupList,
-                 std::list<Handle(GEOM_Field)> fieldList,
-                 const char* author,
-                 const char* fileName );
+                  std::list<Handle(GEOM_Object)> groupList,
+                  std::list<Handle(GEOM_Field)> fieldList,
+                  const char* author,
+                  const char* fileName );
   
   bool ImportXAO( const char* fileName,
-                 Handle(GEOM_Object)& shape,
-                 Handle(TColStd_HSequenceOfTransient)& subShapes,
-                 Handle(TColStd_HSequenceOfTransient)& groups,
-                 Handle(TColStd_HSequenceOfTransient)& fields );
+                  Handle(GEOM_Object)& shape,
+                  Handle(TColStd_HSequenceOfTransient)& subShapes,
+                  Handle(TColStd_HSequenceOfTransient)& groups,
+                  Handle(TColStd_HSequenceOfTransient)& fields );
 
 private:
-  void            importSubShapes( XAO::Geometry* xaoGeometry,
-                                  Handle(GEOM_Function) function,
-                                  int shapeType,
-                                  int dim,
-                                  Handle(TColStd_HSequenceOfTransient)& subshapeList );
-  void            exportSubshapes( const Handle(GEOM_Object)& shape,
-                                  XAO::BrepGeometry* geometry );
-  void            exportFields( std::list<Handle(GEOM_Field)> fieldList,
-                               XAO::Xao* xaoObject,
-                               XAO::BrepGeometry* geometry );
-  void            exportGroups( std::list<Handle(GEOM_Object)> groupList,
-                               XAO::Xao* xaoObject,
-                               XAO::BrepGeometry* geometry );
+  void importSubShapes( XAO::Geometry* xaoGeometry,
+                        Handle(GEOM_Function) function,
+                        int shapeType,
+                        int dim,
+                        Handle(TColStd_HSequenceOfTransient)& subshapeList );
+  void exportSubshapes( const Handle(GEOM_Object)& shape,
+                        XAO::BrepGeometry* geometry );
+  void exportFields( std::list<Handle(GEOM_Field)> fieldList,
+                     XAO::Xao* xaoObject,
+                     XAO::BrepGeometry* geometry );
+  bool exportGroups( std::list<Handle(GEOM_Object)> groupList,
+                     XAO::Xao* xaoObject,
+                     XAO::BrepGeometry* geometry );
 };
 
 #endif