]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add documentation, unit test and example
authorJérôme <jerome.lucas@cesgenslab.fr>
Tue, 1 Dec 2020 13:52:28 +0000 (14:52 +0100)
committerJérôme <jerome.lucas@cesgenslab.fr>
Tue, 1 Dec 2020 13:52:28 +0000 (14:52 +0100)
16 files changed:
src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.cpp
src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.h
src/FeaturesPlugin/CMakeLists.txt
src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.cpp
src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.h
src/FeaturesPlugin/Test/TestCheckDuplictedFaces.py [new file with mode: 0644]
src/FeaturesPlugin/doc/FeaturesPlugin.rst
src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst [new file with mode: 0644]
src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py [new file with mode: 0644]
src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/duplicatedFacesResult.png [new file with mode: 0644]
src/FeaturesPlugin/doc/images/duplicated_shapes.png [new file with mode: 0644]
src/FeaturesPlugin/plugin-Features.xml
src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.cpp
src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.h

index 9dcdded51e91a6fd9c08b9738bc52dc41c4e5297..5b86cb56ec0842915ce599dcf88f530af3ab7468 100644 (file)
@@ -28,7 +28,7 @@
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
 
-
+//=================================================================================================
 FeaturesAPI_DuplicatedFaces::
           FeaturesAPI_DuplicatedFaces(const std::shared_ptr<ModelAPI_Feature>& theFeature)
   : ModelHighAPI_Interface(theFeature)
@@ -36,30 +36,31 @@ FeaturesAPI_DuplicatedFaces::
   initialize();
 }
 
+//=================================================================================================
 FeaturesAPI_DuplicatedFaces::~FeaturesAPI_DuplicatedFaces()
 {
 }
 
+//=================================================================================================
 FeaturesAPI_DuplicatedFaces::FeaturesAPI_DuplicatedFaces(
-                                    const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                    const ModelHighAPI_Selection& theObject,
-                                    const double theTransparency,
-                                    const std::string & theNameGroup)
+                             const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                             const ModelHighAPI_Selection& theObject,
+                             const double theTransparency,
+                             const std::string & theNameGroup)
 :ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
     fillAttribute(theObject, myobjectselected);
     fillAttribute(theTransparency, mytransparency);
-    if( theNameGroup != "" )
-    {
-      fillAttribute(true,
-                feature()->boolean(FeaturesPlugin_DuplicatedFaces::CREATE_GROUP_ID()));
+    if (theNameGroup != "") {
+      fillAttribute(true,feature()->boolean(FeaturesPlugin_DuplicatedFaces::CREATE_GROUP_ID()));
       fillAttribute(theNameGroup, mygroupname);
     }
     execute();
   }
 }
 
+//=================================================================================================
 void FeaturesAPI_DuplicatedFaces::dump(ModelHighAPI_Dumper& theDumper) const
 {
   FeaturePtr aBase = feature();
@@ -77,6 +78,7 @@ void FeaturesAPI_DuplicatedFaces::dump(ModelHighAPI_Dumper& theDumper) const
   theDumper << ")" << std::endl;
 }
 
+//=================================================================================================
 DuplicatedFacesPtr getDuplicatedFaces(const std::shared_ptr<ModelAPI_Document>& thePart,
                                       const ModelHighAPI_Selection& theObject,
                                       const double theTransparency,
index 1a4b9bd460c5320bb8469aac7e34bac08acc3f92..4924a0597648c50b4252e055415daf18e0a866db 100644 (file)
@@ -78,8 +78,8 @@ typedef std::shared_ptr<FeaturesAPI_DuplicatedFaces> DuplicatedFacesPtr;
 /// \param theobject the object selected
 FEATURESAPI_EXPORT
 DuplicatedFacesPtr getDuplicatedFaces(const std::shared_ptr<ModelAPI_Document>& thePart,
-                                  const ModelHighAPI_Selection& theObject,
-                                  const double theTransparency = 0.0,
-                                  const std::string & theNameGroup = "");
+                                      const ModelHighAPI_Selection& theObject,
+                                      const double theTransparency = 0.0,
+                                      const std::string & theNameGroup = "");
 
 #endif // FeaturesAPI_DuplicatedFaces_H_
index 12745b1298d1668317a8900cc8405dfaa1a8b681..39470e1f5d8972fa5ab11eec11aa28bd21987a14 100644 (file)
@@ -708,4 +708,5 @@ ADD_UNIT_TESTS(TestExtrusion.py
                TestFillet1D_Wire_3.py
                TestFillet1D_Wire_4.py
                TestFillet1D_Wire_5.py
+               TestCheckDuplictedFaces.py
 )
index 088213d3af77da479164f8abe16053de7ee478c9..9442b55538029fd9530851881fecfb8fdc96efb2 100644 (file)
@@ -45,7 +45,7 @@
 #include <sstream>
 #include <iostream>
 
-
+//=================================================================================================
 FeaturesPlugin_DuplicatedFaces::FeaturesPlugin_DuplicatedFaces()
 {
 }
@@ -66,9 +66,10 @@ void FeaturesPlugin_DuplicatedFaces::initAttributes()
   boolean(CREATE_GROUP_ID())->setValue(false);
 }
 
+//=================================================================================================
 void explode(const GeomShapePtr& theCompound, ListOfShape& theSubs)
 {
-  if (theCompound->isCompound() || theCompound->isCompSolid() ) {
+  if (theCompound->isCompound() || theCompound->isCompSolid()) {
     GeomAPI_ShapeIterator anIt(theCompound);
     for (; anIt.more(); anIt.next())
       explode(anIt.current(), theSubs);
@@ -77,23 +78,30 @@ void explode(const GeomShapePtr& theCompound, ListOfShape& theSubs)
     theSubs.push_back(theCompound);
 }
 
+//=================================================================================================
 void FeaturesPlugin_DuplicatedFaces::execute()
 {
   if(boolean(CREATE_GROUP_ID())->value()
     && selectionList(LIST_FACES_ID())->isInitialized()
-    && string(GROUP_NAME_ID())->value() != "" )
-  {
-    AttributeStringPtr aNameAtt = string( GROUP_NAME_ID() ) ;
+    && string(GROUP_NAME_ID())->value() != "" ){
+
+    AttributeStringPtr aNameAtt = string(GROUP_NAME_ID());
     std::wstring aNameFace = aNameAtt->isUValue() ?
                             Locale::Convert::toWString(aNameAtt->valueU()) :
                             Locale::Convert::toWString(aNameAtt->value());
 
-
+    if (myGroup.get())
+      eraseResults();
     setFacesGroup(aNameFace);
-  }
-  if( selection(OBJECT_ID())->isInitialized() )
-  {
 
+  } else {
+    if (myGroup.get()) {
+      eraseResults();
+      myGroup.reset();
+    }
+
+  }
+  if (selection(OBJECT_ID())->isInitialized()) {
     AttributeSelectionPtr ancompSolidAttr = selection(OBJECT_ID());
     ResultPtr aResult = ancompSolidAttr->context();
 
@@ -104,12 +112,13 @@ void FeaturesPlugin_DuplicatedFaces::execute()
     std::list<ResultPtr> allRes;
     ModelAPI_Tools::allSubs(aResultBody, allRes);
     std::list<ResultPtr>::iterator aRes;
-    for(aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
+    for (aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
         ModelAPI_Tools::setTransparency(*aRes, aTranparency);
     }
   }
 }
 
+//=================================================================================================
 void FeaturesPlugin_DuplicatedFaces::attributeChanged(const std::string& theID)
 {
   if (theID == OBJECT_ID()) {
@@ -119,13 +128,13 @@ void FeaturesPlugin_DuplicatedFaces::attributeChanged(const std::string& theID)
     if (aShape.get() && ancompSolidAttr->context().get()) {
 
       aShape = ancompSolidAttr->context()->shape();
-      if(aShape){
+      if (aShape) {
         std::string anError;
         ListOfShape aFaces;
         ListOfShape theSubs;
         explode(aShape, theSubs);
 
-        if( !GetDuplicatedFaces( theSubs,
+        if (!GetDuplicatedFaces(theSubs,
                                 0.001,
                                 aFaces,
                                 anError))
@@ -136,8 +145,8 @@ void FeaturesPlugin_DuplicatedFaces::attributeChanged(const std::string& theID)
                     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>
                                                       (attribute(LIST_FACES_ID()));
 
-        if ( aFacesListAttr->isInitialized())
-              aFacesListAttr->clear();
+        if (aFacesListAttr->isInitialized())
+          aFacesListAttr->clear();
 
         aFacesListAttr->setSelectionType("face");
 
@@ -154,19 +163,19 @@ void FeaturesPlugin_DuplicatedFaces::attributeChanged(const std::string& theID)
         std::stringstream alabel;
         alabel << "Number of duplicated faces : " << aFacesListAttr->size();
         string(NUMBER_FACES_ID() )->setValue( alabel.str() );
-
       }
     }
   }
 }
 
+//=================================================================================================
 void FeaturesPlugin_DuplicatedFaces::setFacesGroup(const std::wstring& theName )
 {
   std::vector<int> aColor;
-  ResultGroupPtr aGroup = document()->createGroup(data());
+  myGroup = document()->createGroup(data());
   // clean the result of the operation
-  aGroup->data()->setName(theName);
-  aGroup->store(GeomShapePtr());
+  myGroup->data()->setName(theName);
+  myGroup->store(GeomShapePtr());
 
   // shapes containing in each group
   ListOfShape aFaces;
@@ -174,16 +183,15 @@ void FeaturesPlugin_DuplicatedFaces::setFacesGroup(const std::wstring& theName )
                     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>
                                                         (attribute(LIST_FACES_ID()));
 
-  for(int anI =0; anI< aFacesListAttr->size(); anI++  )
-  {
+  for (int anI =0; anI< aFacesListAttr->size(); anI++) {
     AttributeSelectionPtr aAtt = aFacesListAttr->value(anI);
     aFaces.push_back( aAtt->value() );
   }
+
   GeomShapePtr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aFaces);
-  aGroup->store(aCompound);
+  myGroup->store(aCompound);
   aColor = {255,0,0};
-  setResult(aGroup);
+  setResult(myGroup);
   ModelAPI_Tools::setColor( lastResult(),aColor);
-
 }
 
index 2d847875a7f7d8fc66d6f0d55793e655b8dde7a3..490208992ab809b6116636c44339a7d1e716974d 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "FeaturesPlugin.h"
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_ResultGroup.h>
 
 #include <GeomAPI_IPresentable.h>
 #include <GeomAPI_IScreenParams.h>
@@ -102,10 +103,10 @@ public:
   FeaturesPlugin_DuplicatedFaces();
 
   private:
-
   //Set group of faces
   void setFacesGroup(const std::wstring& theName );
 
+  ResultGroupPtr myGroup;
 };
 
 #endif
diff --git a/src/FeaturesPlugin/Test/TestCheckDuplictedFaces.py b/src/FeaturesPlugin/Test/TestCheckDuplictedFaces.py
new file mode 100644 (file)
index 0000000..50b8e44
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+"""
+      Unit test of Check Duplicated faces
+"""
+#=========================================================================
+# Initialization of the test
+#=========================================================================
+
+
+import os
+import math
+
+from ModelAPI import *
+from GeomAPI import *
+from salome.shaper import model
+
+
+__updated__ = "2020-11-12"
+
+
+if __name__ == '__main__':
+
+    model.begin()
+    partSet = model.moduleDocument()
+    Part_1 = model.addPart(partSet)
+    Part_1_doc = Part_1.document()
+    ### Create Box
+    Box_1 = model.addBox(Part_1_doc, 100, 50, 100)
+    ### Create Point
+    Point_1 = model.addPoint(Part_1_doc, 100, 0, 0)
+    ### Create Point
+    Point_2 = model.addPoint(Part_1_doc, 250, 50, 100)
+    ### Create Box
+    Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "all-in-Point_1"), model.selection("VERTEX", "all-in-Point_2"))
+    ### Create Point
+    Point_3 = model.addPoint(Part_1_doc, 100, 50, 250)
+    ### Create Box
+    Box_3 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "Point_3"))
+    ### Create Compound
+    Compound_1_objects = [model.selection("SOLID", "Box_1_1"), 
+                          model.selection("SOLID", "Box_2_1"), 
+                          model.selection("SOLID", "Box_3_1")]
+    Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
+    ### Create Duplicated_faces
+    Duplicated_faces_1 = model.getDuplicatedFaces(Part_1_doc, model.selection("COMPOUND", "Compound_1_1"), 50, "mygroup")
+
+    model.do()
+     # Check results
+    Duplicated_faces_1_Feature = Duplicated_faces_1.feature()
+    assert Duplicated_faces_1_Feature.error() == ''
+    assert Duplicated_faces_1_Feature.name() == "Duplicated_faces_1"
+
+    aSelectionList = Duplicated_faces_1_Feature.selectionList("faces")
+    assert aSelectionList.size() == 2
+
+    assert(Part_1_doc.size("Groups") == 1)
+
+    #assert Part_1_doc.object("Groups", 0).name() == "mygroup"
+    resShape = modelAPI_Result(Part_1_doc.object("Groups", 0)).shape()
+    assert(not resShape.isNull())
+
+    # the group result is a face, check that this is one face
+    aShapeExplorer = GeomAPI_ShapeExplorer(resShape, GeomAPI_Shape.FACE)
+    assert(aShapeExplorer.more())
+    assert(aShapeExplorer.current().isFace())
+    aShapeExplorer.next()
+    aShapeExplorer.next()
+    assert(not aShapeExplorer.more())
+    
+    model.end()
+
+    #=========================================================================
+    # End of test
+    #=========================================================================
index fb8e2a344b707376d72df48edb52804796a2e7bf..538a0dbef315fa22e097a3dd9d8a52081f1d0898 100644 (file)
@@ -24,6 +24,7 @@ Features plug-in provides a set of common topological operations. It implements
    importResultFeature.rst
    linearCopyFeature.rst
    measurementFeature.rst
+   checkDuplicatedFaceFeature.rst
    pipeFeature.rst
    placementFeature.rst
    recoverFeature.rst
diff --git a/src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst b/src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst
new file mode 100644 (file)
index 0000000..3690573
--- /dev/null
@@ -0,0 +1,11 @@
+
+  .. _tui_duplicated_faces:
+
+Check duplicated faces
+======================
+
+.. literalinclude:: examples/checkDuplicatedFaces.py 
+    :linenos:
+    :language: python
+
+:download:`Download this script <examples/checkDuplicatedFaces.py>`
diff --git a/src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst b/src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst
new file mode 100644 (file)
index 0000000..aba107e
--- /dev/null
@@ -0,0 +1,53 @@
+.. |duplicated_shapes.icon|    image:: images/duplicated_shapes.png
+
+Check duplicated faces
+======================
+
+The **Check duplicated faces** feature find the duplicated faces of a composolid or compound.
+
+The result is a list of faces and a group can be created with name specified.   
+
+To check duplicated faces in the active part:
+
+#. select in the Main Menu *Inspection - > Check duplicated faces* item  or
+#. click |duplicated_shapes.icon| **Check duplicated faces** button in the toolbar
+
+The property panel is shown below.
+
+.. figure:: images/checkduplicatedFacesPropertyPanel.png
+   :align: center
+
+   Check duplicated faces
+
+
+Input fields:
+
+- **Object** contains composolid or compound selected in 3D OCC viewer or object browser. 
+- **Number of duplicated faces** indicate the number of found faces. 
+- **List of faces** the list of found faces.
+- **Transparency** set the transparency of selected object.   
+- **Create group** check-box allow the creation of the group of found faces. 
+- **Group name**  specified the name of the group created. 
+
+
+**TUI Command**:
+
+.. py:function:: model.getDuplicatedFaces(Part_doc, shape, transparency, nameGroup)
+    :param part: The current part object.
+    :param object: A composolid or compound in format *model.selection("Type", shape)*.
+    :param number: value for the transparency.
+    :param string: name of group created. 
+    :return: Created group.
+
+Result
+""""""
+
+Result of **Check duplicated faces** where **Create group** is checked.
+
+.. figure:: images/duplicatedFacesResult.png
+   :align: center
+
+   Duplicated faces
+
+**See Also** a sample TUI Script of :ref:`tui_duplicated_faces` operation.
\ No newline at end of file
diff --git a/src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py b/src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py
new file mode 100644 (file)
index 0000000..1ccb4cb
--- /dev/null
@@ -0,0 +1,29 @@
+from salome.shaper import model
+import os
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+### Create Box
+Box_1 = model.addBox(Part_1_doc, 100, 50, 100)
+### Create Point
+Point_1 = model.addPoint(Part_1_doc, 100, 0, 0)
+### Create Point
+Point_2 = model.addPoint(Part_1_doc, 250, 50, 100)
+### Create Box
+Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "all-in-Point_1"), model.selection("VERTEX", "all-in-Point_2"))
+### Create Point
+Point_3 = model.addPoint(Part_1_doc, 100, 50, 250)
+### Create Box
+Box_3 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "Point_3"))
+### Create Compound
+Compound_1_objects = [model.selection("SOLID", "Box_1_1"), 
+                      model.selection("SOLID", "Box_2_1"), 
+                      model.selection("SOLID", "Box_3_1")]
+Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects)
+### Create Duplicated_faces
+Duplicated_faces_1 = model.getDuplicatedFaces(Part_1_doc, model.selection("COMPOUND", "Compound_1_1"), 50, "mygroup")
+
+model.do()
+model.end()
diff --git a/src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png b/src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png
new file mode 100644 (file)
index 0000000..48700f6
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png differ
diff --git a/src/FeaturesPlugin/doc/images/duplicatedFacesResult.png b/src/FeaturesPlugin/doc/images/duplicatedFacesResult.png
new file mode 100644 (file)
index 0000000..56e1869
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/duplicatedFacesResult.png differ
diff --git a/src/FeaturesPlugin/doc/images/duplicated_shapes.png b/src/FeaturesPlugin/doc/images/duplicated_shapes.png
new file mode 100644 (file)
index 0000000..0d66a11
Binary files /dev/null and b/src/FeaturesPlugin/doc/images/duplicated_shapes.png differ
index 749b0927930320cfb1b4770c4e88affce03c28e1..9a39b109fc56dc8e3e80952bc9e523caccf86771 100644 (file)
     </group>
     <group id="Face">
       <feature id="Duplicated_faces" title="Check duplicated faces" tooltip="Check the duplicated faces" auto_preview="true"
-               icon="icons/Features/duplicatedFaces.png" helpfile="measurementFeature.html"> 
+               icon="icons/Features/duplicatedFaces.png" helpfile="checkDuplicatedFaceFeature.html"> 
         <source path="duplicatedFaces_widget.xml"/>
       </feature>
     </group>
index b4c8b0639e302af0c6bd24a9fefb7f4d42de4c67..4fbe817757b21519546aeac1eda936a6046fb410 100644 (file)
@@ -23,7 +23,6 @@
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Compound.hxx>
 #include <BRep_Builder.hxx>
-#include <TColStd_HSequenceOfTransient.hxx>
 #include <GeomAlgoAPI_GlueDetector.h>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <GeomAlgoAPI_ShapeBuilder.h>
 #include <GeomAlgoAPI_SortListOfShapes.h>
 #include <TopExp.hxx>
 
-
 //=================================================================================================
-bool GetDuplicatedFaces( const ListOfShape& theShapes,
+bool GetDuplicatedFaces(const ListOfShape& theShapes,
                         const Standard_Real& theTolerance,
                         ListOfShape & theFaces,
                         std::string& theError)
 {
-
   #ifdef _DEBUG
   std::cout << "GetDuplicatedFaces " << std::endl;
   #endif
@@ -48,7 +45,7 @@ bool GetDuplicatedFaces( const ListOfShape& theShapes,
 
   ListOfShape::const_iterator anIt = theShapes.cbegin();
 
-  for(; anIt != theShapes.cend(); ++anIt) {
+  for (; anIt != theShapes.cend(); ++anIt) {
 
     GeomShapePtr aShapePtr = *anIt;
 
@@ -60,8 +57,7 @@ bool GetDuplicatedFaces( const ListOfShape& theShapes,
     aShapesSeq.Append( aShape );
   }
 
-  if ( aShapesSeq.Length() > 1 )
-  {
+  if (aShapesSeq.Length() > 1){
     TopoDS_Compound aCompound;
     BRep_Builder aBuilder;
     aBuilder.MakeCompound( aCompound );
@@ -80,7 +76,7 @@ bool GetDuplicatedFaces( const ListOfShape& theShapes,
 
   std::vector< TopTools_IndexedMapOfShape* > anIndices( aShapesSeq.Length(), NULL );
   Handle(TColStd_HArray1OfInteger) anArray;
-  GeomShapePtr anObj;//Handle(GEOM_Object) anObj;
+  GeomShapePtr anObj;
 
   ListOfShape listOnePerSet;
 
@@ -88,7 +84,6 @@ bool GetDuplicatedFaces( const ListOfShape& theShapes,
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS (aImages);
   for (int index = 1; aItDMSLS.More(); aItDMSLS.Next(), ++index) {
     // some key shape
-    //const TopoDS_Shape& aSkey = aItDMSLS.Key();
 
     // list of shapes of the argument that can be glued
     const TopTools_ListOfShape& aLSD = aItDMSLS.Value();
@@ -108,18 +103,16 @@ bool GetDuplicatedFaces( const ListOfShape& theShapes,
 
   //TopTools_ListIteratorOfListOfShape aListIt (listOnePerSet);
   ListOfShape::const_iterator aListIt = listOnePerSet.cbegin();
-  for (; aListIt != listOnePerSet.cend(); ++aListIt)
-  {
+  for (; aListIt != listOnePerSet.cend(); ++aListIt) {
     TopoDS_Shape aValue = (*aListIt)->impl<TopoDS_Shape>();
     // find a shape to add aValue as a sub-shape
     anObj.reset();
 
     anIt = theShapes.cbegin();
     GeomShapePtr aShapePtr;
-    for ( int i = 0; i < theShapes.size(); ++i, ++anIt )
-    {
+    for (int i = 0; i < theShapes.size(); ++i, ++anIt) {
       aShapePtr = *anIt;
-      if ( !anIndices[i] ) {
+      if (!anIndices[i]) {
         anIndices[i] = new TopTools_IndexedMapOfShape;
         aShape = aShapePtr->impl<TopoDS_Shape>();
         TopExp::MapShapes( aShape, *anIndices[i]);
@@ -130,13 +123,13 @@ bool GetDuplicatedFaces( const ListOfShape& theShapes,
         GeomShapePtr aS(new GeomAPI_Shape);
         aS->setImpl<TopoDS_Shape>(new TopoDS_Shape(aSelShape));
         // GeomAlgoAPI_ShapeBuilder::add(aShapePtr,aS);
-        if ( aS.get())
+        if (aS.get())
             theFaces.push_back(aS);
         break;
       }
     }
   }
-  for ( size_t i = 0 ; i < anIndices.size(); ++i )
+  for (size_t i = 0 ; i < anIndices.size(); ++i)
     delete anIndices[i];
 
   return true;
index b0e5c72940bd0ec4d1706c967567a5b0440aadfd..e95fa06c9c1eb3410edbac9734120dc18e0b8af1 100644 (file)
 #include <Standard_TypeDef.hxx>
 
 /// get the boundin box of theshape.
-  /// \param theShape   the shape
-  /// \param theTolerance precise TRUE for precise computation; FALSE for fast one.
-  /// \param theFaces  the duplicated faces
-  /// \param theError  error
+/// \param theShape   the shape
+/// \param theTolerance precise TRUE for precise computation; FALSE for fast one.
+/// \param theFaces  the duplicated faces
+/// \param theError  error
 GEOMALGOAPI_EXPORT
-bool GetDuplicatedFaces( const ListOfShape& theShapes,
-                         const Standard_Real& theTolerance,
-                         ListOfShape & theFaces,
-                         std::string& theError);
+bool GetDuplicatedFaces(const ListOfShape& theShapes,
+                        const Standard_Real& theTolerance,
+                        ListOfShape & theFaces,
+                        std::string& theError);
 
 #endif //GEOMALGOAPI_DUPLICATEDFACES_H_