]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refactoring code (cpplint, name...)
authorJérôme <jerome.lucas@cesgenslab.fr>
Thu, 22 Oct 2020 17:58:28 +0000 (19:58 +0200)
committerJérôme <jerome.lucas@cesgenslab.fr>
Thu, 22 Oct 2020 17:58:28 +0000 (19:58 +0200)
src/FeaturesAPI/FeaturesAPI_Fillet.cpp
src/FeaturesPlugin/FeaturesPlugin_Fillet.cpp
src/FeaturesPlugin/FeaturesPlugin_Fillet.h
src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.cpp
src/FeaturesPlugin/FeaturesPlugin_VersionedChFi.h
src/FeaturesPlugin/FeaturesPlugin_WidgetCreator.cpp
src/FeaturesPlugin/FeaturesPlugin_WidgetFilletMultiRadiuses.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Fillet.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Fillet.h
src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp [deleted file]
src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.h [deleted file]

index a6233275241f723af66dd3f6c6866c73d28d6816..1b0f7172d617cd4421bdd022f20e6b8677dce93c 100644 (file)
@@ -213,7 +213,7 @@ FeaturesAPI_Fillet2D::FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Featur
     myvalues()->setValue(aVal, aRowIndex, 0 );
     aVal.myDouble = aRowsRadiusIter->value();
     myvalues()->setValue(aVal, aRowIndex, 1 );
+
     execute();
   }
 }
@@ -226,7 +226,8 @@ FeaturesAPI_Fillet2D::FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Featur
 {
   if (initialize()) {
     fillAttribute(FeaturesPlugin_Fillet::METHOD_MULTIPLES_RADIUSES(), mycreationMethod);
-    fillAttribute(FeaturesPlugin_Fillet::CREATION_METHOD_BY_CURVILEAR_ABSCISSA(), mycreationMethodmulti);
+    fillAttribute(FeaturesPlugin_Fillet::CREATION_METHOD_BY_CURVILEAR_ABSCISSA(),
+                                                                 mycreationMethodmulti);
     fillAttribute(theEdgesFaces, myedgesfacesmultiselected);
 
     int aRowIndex = 0;
@@ -240,7 +241,7 @@ FeaturesAPI_Fillet2D::FeaturesAPI_Fillet2D(const std::shared_ptr<ModelAPI_Featur
       myvaluescurv()->setValue(aVal, aRowIndex, 0 );
       aVal.myDouble = aRowsRadiusIter->value();
       myvaluescurv()->setValue(aVal, aRowIndex, 1 );
-    } 
+    }
     if (myedgesfacesmultiselected->size() > 0)
       execute();
   }
@@ -299,7 +300,8 @@ void FeaturesAPI_Fillet2D::dump(ModelHighAPI_Dumper& theDumper) const
           aBase->selectionList(FeaturesPlugin_Fillet::ARRAY_POINT_RADIUS_BY_POINTS());
       AttributeTablesPtr anAttrTable =
           aBase->tables(FeaturesPlugin_Fillet::VALUES_ID());
-      theDumper << aBase << " = model.addFilletMultiRadiusByPoints(" << aDocName << ", " << anAttrEdgeSelec;
+      theDumper << aBase << " = model.addFilletMultiRadiusByPoints("
+                         << aDocName << ", " << anAttrEdgeSelec;
       theDumper << ", " << anAttrPoint ;
       theDumper<<", [";
       for(int aRow = 0; aRow < myvalues()->rows(); aRow++) {
@@ -314,7 +316,8 @@ void FeaturesAPI_Fillet2D::dump(ModelHighAPI_Dumper& theDumper) const
       AttributeSelectionListPtr anAttrEdgesFaces =
                       aBase->selectionList(FeaturesPlugin_Fillet::EDGES_FACES_MULTI_LIST_ID());
       AttributeTablesPtr anAttrTable = aBase->tables(FeaturesPlugin_Fillet::VALUES_CURV_ID());
-      theDumper << aBase << " = model.addFilletMultiRadiusBycurvAbs(" << aDocName << ", " << anAttrEdgesFaces;
+      theDumper << aBase << " = model.addFilletMultiRadiusBycurvAbs("
+                         << aDocName << ", " << anAttrEdgesFaces;
       theDumper << ", ";
       theDumper<<"[";
       for(int aRow = 0; aRow < myvaluescurv()->rows(); aRow++) {
@@ -332,7 +335,7 @@ void FeaturesAPI_Fillet2D::dump(ModelHighAPI_Dumper& theDumper) const
       theDumper<<"]";
     }
   }else
-  { 
+  {
 
     std::string aCreationMethod = aBase->string(FeaturesPlugin_Fillet::CREATION_METHOD())->value();
 
index 96054ea28b50272c0d34912681db661de685cc99..1fc2904233ec1744badbf19afdc70c14ddf3aa1d 100644 (file)
@@ -65,15 +65,15 @@ void FeaturesPlugin_Fillet::initAttributes()
   AttributePtr aSelectionList =
       data()->addAttribute(OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
 
-  AttributePtr aSelectionEdgesFacesList = 
+  AttributePtr aSelectionEdgesFacesList =
       data()->addAttribute(EDGES_FACES_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
-  
-  AttributePtr aSelectionEdgesFacesMultiList = 
+
+  AttributePtr aSelectionEdgesFacesMultiList =
     data()->addAttribute(EDGES_FACES_MULTI_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
-  
+
   AttributePtr aSelectionEdgeSelected =
       data()->addAttribute(EDGE_SELECTED_ID(), ModelAPI_AttributeSelection::typeId());
-  
+
   data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(CREATION_MULTI_RADIUS_METHODE(), ModelAPI_AttributeString::typeId());
 
@@ -86,10 +86,12 @@ void FeaturesPlugin_Fillet::initAttributes()
   data()->addAttribute(ARRAY_POINT_RADIUS_BY_POINTS(), ModelAPI_AttributeSelectionList::typeId());
 
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), END_RADIUS_ID());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ARRAY_POINT_RADIUS_BY_POINTS());
+  ModelAPI_Session::get()->validators()->
+                          registerNotObligatory(getKind(), ARRAY_POINT_RADIUS_BY_POINTS());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), VALUES_ID());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), VALUES_CURV_ID());
-  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), CREATION_MULTI_RADIUS_METHODE());
+  ModelAPI_Session::get()->validators()->
+                          registerNotObligatory(getKind(), CREATION_MULTI_RADIUS_METHODE());
 
   initVersion(aSelectionEdgeSelected);
   initVersion(aSelectionEdgesFacesMultiList);
@@ -99,7 +101,7 @@ void FeaturesPlugin_Fillet::initAttributes()
 }
 
 AttributePtr FeaturesPlugin_Fillet::objectsAttribute()
-{ 
+{
   if( string(CREATION_METHOD())->value() == METHOD_MULTIPLES_RADIUSES() )
   {
     if( string(CREATION_MULTI_RADIUS_METHODE())->value() == CREATION_METHOD_BY_POINTS())
@@ -138,34 +140,34 @@ GeomMakeShapePtr FeaturesPlugin_Fillet::performOperation(const GeomShapePtr& the
     setError(anError);
     return GeomMakeShapePtr();
   }
-   
+
   std::shared_ptr<GeomAlgoAPI_Fillet> aFilletBuilder;
-  
+
   ListOfShape aFilletEdges = extractEdges(theEdges);
   if ( aCreationMethod->value() == METHOD_MULTIPLES_RADIUSES())
   {
 
-    std::list<double> coodCurv; 
-    std::list<double> radiuses;
+    std::list<double> aCoodCurv;
+    std::list<double> aRadiuses;
     AttributeTablesPtr aTablesAttr;
 
     if( string(CREATION_MULTI_RADIUS_METHODE())->value() == CREATION_METHOD_BY_POINTS() )
     {
       aTablesAttr =  tables(VALUES_ID());
-  
+
     }else{
       aTablesAttr =  tables(VALUES_CURV_ID());
     }
 
     int aRows = aTablesAttr->rows();
     ModelAPI_AttributeTables::Value aVal;
-    for (int k = 0; k < aRows; k++) { 
+    for (int k = 0; k < aRows; k++) {
         aVal = aTablesAttr->value(k, 0);
-        coodCurv.push_back(aVal.myDouble);
+        aCoodCurv.push_back(aVal.myDouble);
         aVal = aTablesAttr->value(k, 1);
-        radiuses.push_back(aVal.myDouble);
+        aRadiuses.push_back(aVal.myDouble);
     }
-    aFilletBuilder.reset(new GeomAlgoAPI_Fillet(theSolid, aFilletEdges, coodCurv,radiuses));
+    aFilletBuilder.reset(new GeomAlgoAPI_Fillet(theSolid, aFilletEdges, aCoodCurv,aRadiuses));
 
   }else
   {
index b8d11935dbd1422a8d0cd5485d24886853784332..8175928371d8b2cfa2604ed06616f0eb552f4082 100644 (file)
@@ -108,7 +108,7 @@ public:
   /// Attribute name of main objects.
   inline static const std::string& EDGES_FACES_MULTI_LIST_ID()
   {
-    static const std::string 
+    static const std::string
                 MY_EDGES_FACES_MULTI_LIST_ID("edges_faces_seleted_multi");
     return MY_EDGES_FACES_MULTI_LIST_ID;
   }
@@ -132,7 +132,7 @@ public:
     static const std::string MY_VALUES_ID("values");
     return MY_VALUES_ID;
   }
-  
+
   /// attribute name of list of tables that contain deafult values (row 0) and the custom values
   inline static const std::string& VALUES_CURV_ID()
   {
index 51bba73a30f1b996850cd5b41948f1fc3db728e9..ede9bb1d58d9b4375e4b27fd70d09250b63b0445 100644 (file)
@@ -119,7 +119,7 @@ bool FeaturesPlugin_VersionedChFi::processAttribute(const AttributePtr& theAttri
 
   if( anObject.get() )
   {
-    if ( !addShapeInHierarchy(anObject , theObjects, isStoreFullHierarchy) ) 
+    if ( !addShapeInHierarchy(anObject , theObjects, isStoreFullHierarchy) )
       return false;
     return true;
   }
@@ -128,7 +128,7 @@ bool FeaturesPlugin_VersionedChFi::processAttribute(const AttributePtr& theAttri
   for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); ++anObjectsIndex) {
     AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
 
-    if ( !addShapeInHierarchy(anObjectAttr , theObjects, isStoreFullHierarchy) ) 
+    if ( !addShapeInHierarchy(anObjectAttr , theObjects, isStoreFullHierarchy) )
        return false;
   }
   return true;
@@ -168,7 +168,7 @@ bool FeaturesPlugin_VersionedChFi::addShapeInHierarchy(const AttributeSelectionP
       theObjects.addObject(anObject);
       theObjects.addParent(anObject, aParent);
     }
-    
+
     if (theIsStoreFullHierarchy)
       ModelAPI_Tools::fillShapeHierarchy(aParent, aContext, theObjects);
   } else { // get it from a feature
index 8e51fe6e4fd743f896ff767f4ede097670ed8531..de48fc201ba30011e66228054dbbe03eba81a976 100644 (file)
@@ -49,8 +49,8 @@ protected:
   /// Process SelectionList attribute and fill the objects hierarchy.
   bool processAttribute(const std::shared_ptr<ModelAPI_Attribute>& theAttribute,
                         GeomAPI_ShapeHierarchy& theObjects);
-  
-  // Add Shape in the object hierarchy 
+
+  // Add Shape in the object hierarchy
   bool addShapeInHierarchy(const AttributeSelectionPtr& theAttribute,
                            GeomAPI_ShapeHierarchy& theObjects,
                            bool theIsStoreFullHierarchy);
index 05478d8bc71c7d52da16386edc59a040373bc614..310ef83889a1868d0747f2d3a0ca76221f221e63 100644 (file)
@@ -45,12 +45,18 @@ ModuleBase_ModelWidget* FeaturesPlugin_WidgetCreator::createWidgetByType(
     return aWidget;
 
   if (theType == "multiradius-panel") {
-    aWidget = new FeaturesPlugin_WidgetFilletMultiRadiuses(theParent, theWorkshop, theWidgetApi, true);
+    aWidget = new FeaturesPlugin_WidgetFilletMultiRadiuses(theParent,
+                                                           theWorkshop,
+                                                           theWidgetApi,
+                                                           true);
   }else if (theType == "multiradiuscurv-panel")
   {
-    aWidget = new FeaturesPlugin_WidgetFilletMultiRadiuses(theParent, theWorkshop, theWidgetApi, false);
+    aWidget = new FeaturesPlugin_WidgetFilletMultiRadiuses(theParent,
+                                                           theWorkshop,
+                                                           theWidgetApi,
+                                                           false);
   }
-  
+
 
   return aWidget;
 }
index d2091a551ec9ef47797e9c6102b274432a976d8d..ca8cfa72b029f006ccf9d28fdd9b20348cde6a35 100644 (file)
@@ -68,32 +68,32 @@ const char* MYFalse = "False";
 
 class TextFieldDoubleValidator : public QDoubleValidator {
 public:
-       TextFieldDoubleValidator (QObject * parent = 0) : QDoubleValidator(parent) {}
-       TextFieldDoubleValidator (double bottom, double top, int decimals, QObject * parent) :
-       QDoubleValidator(bottom, top, decimals, parent) {}
-
-       QValidator::State validate(QString & s, int & pos) const {
-           if (s.isEmpty() || s.startsWith("0.") || s == "0" ){//|| s.startsWith("-")) {
-               // allow empty field or minus sign
-               return QValidator::Intermediate;
-           }
-           // check length of decimal places
-           QChar point = locale().decimalPoint();
-           if(s.indexOf(point) != -1) {
-               int lengthDecimals = s.length() - s.indexOf(point) - 1;
-               if (lengthDecimals > decimals()) {
-                   return QValidator::Invalid;
-               }
-           }
-
-           // check range of value
-           bool isNumber;
-           double value = locale().toDouble(s, &isNumber);
-           if (isNumber && bottom() <= value && value <= top()) {
-               return QValidator::Acceptable;
-           }
-           return QValidator::Invalid;
-       }
+  TextFieldDoubleValidator (QObject * parent = 0) : QDoubleValidator(parent) {}
+  TextFieldDoubleValidator (double bottom, double top, int decimals, QObject * parent) :
+  QDoubleValidator(bottom, top, decimals, parent) {}
+
+  QValidator::State validate(QString & s, int & pos) const {
+      if (s.isEmpty() || s.startsWith("0.") || s == "0" ){
+          // allow empty field or minus sign
+          return QValidator::Intermediate;
+      }
+      // check length of decimal places
+      QChar point = locale().decimalPoint();
+      if(s.indexOf(point) != -1) {
+          int lengthDecimals = s.length() - s.indexOf(point) - 1;
+          if (lengthDecimals > decimals()) {
+              return QValidator::Invalid;
+          }
+      }
+
+      // check range of value
+      bool isNumber;
+      double value = locale().toDouble(s, &isNumber);
+      if (isNumber && bottom() <= value && value <= top()) {
+          return QValidator::Acceptable;
+      }
+      return QValidator::Invalid;
+  }
 
 };
 
@@ -318,7 +318,6 @@ bool FeaturesPlugin_WidgetFilletMultiRadiuses::storeValueCustom()
       aTablesAttr->setValue( getValue( aTblVal ), i, j);
     }
   }
-  
 
   if(myTypeMethodeBypoint && mySortList ){
       AttributeSelectionListPtr aSelectionListAttr =
@@ -368,7 +367,7 @@ bool FeaturesPlugin_WidgetFilletMultiRadiuses::restoreValueCustom()
   else{
     aTablesAttr = aData->tables(FeaturesPlugin_Fillet::VALUES_CURV_ID());
   }
-  
+
   if( aTablesAttr->rows() == 0 )
   {
     aTablesAttr->setSize(2,2);
@@ -441,8 +440,7 @@ bool FeaturesPlugin_WidgetFilletMultiRadiuses::restoreValueCustom()
     res = 0.0;
     myValuesSort[ res ] = std::make_pair (myfirstRowValue[0], findRadius( QString::number(res) ));
     res = 1.0;
-    std::cout << "res =  restore = " << res << std::endl;
-    myValuesSort[ res ] = std::make_pair (myLastRowValue[0], findRadius( QString::number(res) )); 
+    myValuesSort[ res ] = std::make_pair (myLastRowValue[0], findRadius( QString::number(res) ));
     aRows =  myValuesSort.size();
   }else{
 
@@ -521,8 +519,8 @@ void FeaturesPlugin_WidgetFilletMultiRadiuses::onAdd()
 {
   QModelIndex index = myDataTbl->currentIndex();
   int i  = index.row();
-  if( i != -1 
-      && !(!myDataTbl->currentItem()->isSelected() && myDataTbl->rowCount() >2)) 
+  if( i != -1
+      && !(!myDataTbl->currentItem()->isSelected() && myDataTbl->rowCount() >2))
   {
 
     myDataTbl->blockSignals(true);
index f1241dd3627ffc67e279274337d15283b18f4683..1a4bd5bfdcc07283ccf7ea127e54fe3b86950dac 100644 (file)
@@ -121,11 +121,11 @@ void GeomAlgoAPI_Fillet::build(const GeomShapePtr& theBaseSolid,
   }
 
   TColgp_Array1OfPnt2d array(1, theRadiuses.size());
+
   int i = 1;
   std::list<double>::const_iterator itCurv = theCurvCoord.begin();
   std::list<double>::const_iterator itRadius = theRadiuses.begin();
-  
+
   for( ; itCurv != theCurvCoord.end(); ++itCurv, ++itRadius )
   {
     array.SetValue(i, gp_Pnt2d( (*itCurv) , (*itRadius)));
index 175a88717dd699c3196108a5bbf2b6b731b1839e..2cfd2de9ac94f9f49e4e8bac060f94c7a0679ee4 100644 (file)
@@ -49,7 +49,7 @@ public:
                                         const ListOfShape&  theFilletEdges,
                                         const double        theStartRadius,
                                         const double        theEndRadius);
-  
+
   /// Run fillet operation with variable radius.
   /// \param theBaseSolid    a changing solid
   /// \param theFilletEdges  list of edges the fillet is performed on
@@ -77,8 +77,8 @@ private:
   /// \param theBaseSolid    a changing solid
   /// \param theFilletEdges  list of edges the fillet is performed on
   /// \param theCurvCoord    the coordinate of a point defines a relative parameter on the edge
-  /// \param theRadiuses     the corresponding value of the radius, and the radius evolves 
-  //                         between the first and last vertices of the contour of index 
+  /// \param theRadiuses     the corresponding value of the radius, and the radius evolves
+  //                         between the first and last vertices of the contour of index
   void build(const GeomShapePtr& theBaseSolid,
              const ListOfShape&  theFilletEdges,
              const std::list<double>& theCurvCoord,
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp
deleted file mode 100644 (file)
index 3e2a700..0000000
+++ /dev/null
@@ -1,446 +0,0 @@
-// 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
-//
-
-#include <GeomAlgoAPI_STEPImportXCAF.h>
-
-#include <TDF_ChildIDIterator.hxx>
-#include <TDF_Label.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDataStd_Comment.hxx>
-#include <TNaming_Builder.hxx>
-#include <TNaming_NamedShape.hxx>
-
-#include <IFSelect_ReturnStatus.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_InterfaceModel.hxx>
-#include <Interface_Static.hxx>
-#include <STEPControl_Reader.hxx>
-#include <StepBasic_Product.hxx>
-#include <StepBasic_ProductDefinition.hxx>
-#include <StepBasic_ProductDefinitionFormation.hxx>
-#include <StepGeom_GeometricRepresentationItem.hxx>
-#include <StepShape_TopologicalRepresentationItem.hxx>
-#include <StepRepr_DescriptiveRepresentationItem.hxx>
-#include <StepRepr_ProductDefinitionShape.hxx>
-#include <StepRepr_PropertyDefinitionRepresentation.hxx>
-#include <StepRepr_Representation.hxx>
-#include <TransferBRep.hxx>
-#include <Transfer_Binder.hxx>
-#include <Transfer_TransientProcess.hxx>
-#include <XSControl_TransferReader.hxx>
-#include <XSControl_WorkSession.hxx>
-
-#include <BRep_Builder.hxx>
-
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS_Iterator.hxx>
-
-#include <XCAFApp_Application.hxx>
-#include <XCAFDoc_DocumentTool.hxx>
-#include <OSD_Exception.hxx>
-#include <Locale_Convert.h>
-
-#include <TDocStd_Document.hxx>
-#include <XCAFDoc_ColorTool.hxx>
-#include <XCAFDoc_ShapeTool.hxx>
-#include <XCAFDoc_MaterialTool.hxx> 
-#include <Quantity_Color.hxx>
-#include <TopoDS.hxx>
-#include <STEPConstruct.hxx>
-#include <STEPConstruct_Tool.hxx>
-#include <StepBasic_ProductDefinitionRelationship.hxx>
-#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
-#include <XCAFDoc_Location.hxx>
-
-#include <TColStd_SequenceOfAsciiString.hxx>
-
-#include <Standard_Failure.hxx>
-#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
-
-//=============================================================================
-/*!
- *  GetShape()
- */
-//=============================================================================
-
-TopoDS_Shape GetShape(const Handle(Standard_Transient)        &theEnti,
-                        const Handle(Transfer_TransientProcess) &theTP)
-{
-  TopoDS_Shape            aResult;
-  Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
-
-  if (aBinder.IsNull()) {
-    return aResult;
-  }
-
-  aResult = TransferBRep::ShapeResult(aBinder);
-
-  return aResult;
-}
-
-// ----------------------------------------------------------------------------
-
-std::shared_ptr<GeomAPI_Shape> readAttributes( STEPCAFControl_Reader &reader,
-                                               std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                               const bool  anMaterials,
-                                               std::map< std::wstring, std::list<std::wstring>> &theMaterialShape,
-                                               const std::string &format)
-{
-  // dummy XCAF Application to handle the STEP XCAF Document
-  Handle(XCAFApp_Application) dummy_app = XCAFApp_Application::GetApplication();
-  // XCAF Document to contain the STEP/IGES file itself
-  Handle(TDocStd_Document) doc;
-   // check if a file is already open under this handle, if so, close it to
-  // prevent segfaults when trying to create a new document
-  if(dummy_app->NbDocuments() > 0) {
-    dummy_app->GetDocument(1, doc);
-    dummy_app->Close(doc);
-  }
-
-  dummy_app->NewDocument( TCollection_ExtendedString("MDTV-CAF"), doc);
-  // transfer STEP/IGES into the document, and get the main label
-  reader.Transfer(doc);
-  TDF_Label mainLabel = doc->Main();
-  Handle_XCAFDoc_ShapeTool shapeTool = XCAFDoc_DocumentTool::ShapeTool(mainLabel);
-  Handle_XCAFDoc_ColorTool colorTool = XCAFDoc_DocumentTool::ColorTool(mainLabel);
-  Handle(XCAFDoc_MaterialTool) materialTool = XCAFDoc_DocumentTool::MaterialTool(mainLabel);
-  // traverse the labels recursively to set attributes on shapes
-  setShapeAttributes(shapeTool, colorTool, materialTool, mainLabel,
-                     TopLoc_Location(),theResultBody,theMaterialShape,false);
-
-     
-  std::shared_ptr<GeomAPI_Shape> ageom =  setgeom(shapeTool,mainLabel);
-  STEPControl_Reader aReader = reader.ChangeReader();   
-  
-  // BEGIN: reading materials of sub-shapes from file
-  if ( anMaterials )
-  {
-    TopTools_IndexedMapOfShape anIndices;
-    TopExp::MapShapes(ageom->impl<TopoDS_Shape>(), anIndices);
-
-    Handle(Interface_InterfaceModel) Model = aReader.WS()->Model();
-    Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader();
-    if (!TR.IsNull()) {
-      Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
-
-      Standard_Integer nb = Model->NbEntities();
-
-      for (Standard_Integer ie = 1; ie <= nb; ie++) {
-        Handle(Standard_Transient) enti = Model->Value(ie);
-
-        // Store materials.
-        StoreMaterial(theResultBody,enti, anIndices, TP, mainLabel,theMaterialShape);
-      }
-    }
-  }
-
-  return ageom;                                  
-}
-
-std::shared_ptr<GeomAPI_Shape> setgeom(const Handle(XCAFDoc_ShapeTool) &shapeTool,
-                                       const TDF_Label &label)
-{
-  BRep_Builder B;
-  TopoDS_Compound compound;
-  B.MakeCompound(compound);
-
-  TDF_LabelSequence frshapes;
-  shapeTool->GetShapes(frshapes);
-
-  std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
-
-  if (frshapes.Length() == 0) {
-      aGeomShape->setImpl(new TopoDS_Shape());
-      return aGeomShape;
-  } else if (frshapes.Length() == 1) {
-    TopoDS_Shape shape = shapeTool->GetShape(frshapes.Value(1));
-    aGeomShape->setImpl(new TopoDS_Shape(shape));
-    return aGeomShape;
-  } else {
-    for (Standard_Integer i=1; i<frshapes.Length(); i++) {
-      TopoDS_Shape S = shapeTool->GetShape(frshapes.Value(i));
-
-      TDF_Label aLabel = shapeTool->FindShape(S, Standard_False);
-      if ( (!aLabel.IsNull()) && (shapeTool->IsShape(aLabel)) ) {
-        if (shapeTool->IsFree(aLabel) ) {
-          if (S.IsNull()) {
-            continue;
-          }
-          else {
-            B.Add(compound, S);
-          }
-        }
-      }
-    }
-    TopoDS_Shape shape = compound;
-    aGeomShape->setImpl(new TopoDS_Shape(shape));
-    return aGeomShape;
-  }
-}
-
-void setShapeAttributes(const Handle(XCAFDoc_ShapeTool) &shapeTool,
-                                    const Handle(XCAFDoc_ColorTool) &colorTool,
-                                    const Handle(XCAFDoc_MaterialTool) &materialTool,
-                                    const TDF_Label &label,
-                                    const TopLoc_Location &loc,
-                                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                                    std::map< std::wstring, std::list<std::wstring>> &theMaterialShape,
-                                    bool isRef)
-{
-  std::wstring shapeName;
-  Handle(TDataStd_Name) n;
-
-  if(label.FindAttribute(TDataStd_Name::GetID(), n)) {
-    TCollection_ExtendedString name = n->Get();
-
-    shapeName =  Locale::Convert::toWString(TCollection_AsciiString(name).ToCString()) ;
-  }
-  TopLoc_Location partLoc = loc;
-  Handle(XCAFDoc_Location) l;
-  if(label.FindAttribute(XCAFDoc_Location::GetID(), l)) {
-    if(isRef)
-      partLoc = partLoc * l->Get();
-    else
-      partLoc = l->Get();
-  }
-
-  TDF_Label ref;
-  if(shapeTool->IsReference(label) && shapeTool->GetReferredShape(label, ref)) {
-
-    setShapeAttributes( shapeTool, colorTool, materialTool, ref,
-                        partLoc,theResultBody,theMaterialShape,true);
-  }
-  if( shapeTool->IsSimpleShape(label) && (isRef || shapeTool->IsFree(label))) {
-
-    TopoDS_Shape shape = shapeTool->GetShape(label);
-
-    std::shared_ptr<GeomAPI_Shape> aShapeGeom(new GeomAPI_Shape);
-    if (!loc.IsIdentity()){
-        shape.Move(loc);
-    }
-    aShapeGeom->setImpl(new TopoDS_Shape(shape));
-    shapeName = theResultBody->addShapeName(aShapeGeom, shapeName);
-
-
-    shape.Location(isRef ? loc : partLoc);
-    int dim =
-      (shape.ShapeType() == TopAbs_VERTEX) ?
-        0 :
-        (shape.ShapeType() == TopAbs_EDGE || shape.ShapeType() == TopAbs_WIRE) ?
-        1 :
-        (shape.ShapeType() == TopAbs_FACE ||
-         shape.ShapeType() == TopAbs_SHELL) ? 2 :3;
-
-    Handle(TCollection_HAsciiString) matName;
-    Handle(TCollection_HAsciiString) matDescription;
-    Standard_Real matDensity;
-    Handle(TCollection_HAsciiString) matDensName;
-    Handle(TCollection_HAsciiString) matDensValType;
-
-    if(materialTool->GetMaterial(label, matName, matDescription, matDensity,
-                                 matDensName, matDensValType)) {
-      std::wstring nameMaterial = Locale::Convert::toWString(matName->ToCString()); 
-  
-      theMaterialShape[nameMaterial].push_back(shapeName);
-    }
-
-
-    Quantity_Color col;
-    if(colorTool->GetColor(label, XCAFDoc_ColorGen, col)) {
-      double r = col.Red(), g = col.Green(), b = col.Blue();
-      std::vector<int> ColRGB = {int(r*255),int(g*255),int(b*255)};
-      theResultBody->addShapeColor(shapeName, ColRGB);
-    }
-    else if(colorTool->GetColor(label, XCAFDoc_ColorSurf, col)) {
-      double r = col.Red(), g = col.Green(), b = col.Blue();
-      std::vector<int> ColRGB = {int(r*255),int(g*255),int(b*255)};
-      theResultBody->addShapeColor(shapeName, ColRGB);
-    }
-    else if(colorTool->GetColor(label, XCAFDoc_ColorCurv, col)) {
-     double r = col.Red(), g = col.Green(), b = col.Blue();
-     std::vector<int> ColRGB = {int(r*255),int(g*255),int(b*255)};
-      theResultBody->addShapeColor(shapeName, ColRGB);
-    }
-    // check explicit coloring of boundary entities
-    if(dim == 3) {
-      TopExp_Explorer xp2(shape, TopAbs_FACE);
-      while(xp2.More()) {
-        if(colorTool->GetColor(xp2.Current(), XCAFDoc_ColorGen, col) ||
-           colorTool->GetColor(xp2.Current(), XCAFDoc_ColorSurf, col) ||
-           colorTool->GetColor(xp2.Current(), XCAFDoc_ColorCurv, col)) {
-          double r = col.Red(), g = col.Green(), b = col.Blue();
-          TopoDS_Face face = TopoDS::Face(xp2.Current());
-          std::vector<int> ColRGB = {int(r*255),int(g*255),int(b*255)};
-          std::wstringstream aNameFace; 
-          TopoDS_Shape shapeface = xp2.Current();
-          if (!loc.IsIdentity()){
-                  shapeface.Move(loc);
-          }
-          aShapeGeom->setImpl(new TopoDS_Shape(shapeface));
-          theResultBody->addShapeColor(
-          theResultBody->addShapeName(aShapeGeom , aNameFace.str()), ColRGB);
-        }
-        xp2.Next();
-      }
-    }
-    if(dim == 2) {
-      TopExp_Explorer xp1(shape, TopAbs_EDGE);
-      while(xp1.More()) {
-        if(colorTool->GetColor(xp1.Current(), XCAFDoc_ColorGen, col) ||
-           colorTool->GetColor(xp1.Current(), XCAFDoc_ColorSurf, col) ||
-           colorTool->GetColor(xp1.Current(), XCAFDoc_ColorCurv, col)) {
-           double r = col.Red(), g = col.Green(), b = col.Blue();
-           std::vector<int> ColRGB = {int(r*255),int(g*255),int(b*255)};
-           std::wstringstream aNameEdge; 
-           aNameEdge << L"Edge_"<< shapeName;
-           aShapeGeom->setImpl(new TopoDS_Shape(xp1.Current() ));
-           theResultBody->addShapeColor(
-           theResultBody->addShapeName(aShapeGeom , aNameEdge.str()), ColRGB);
-        }
-        xp1.Next();
-      }
-    }
-  }
-  else {
-    int indiceChild = 1;  
-
-    if (!shapeTool->IsReference(label)){
-      TopoDS_Shape shape = shapeTool->GetShape(label);
-
-      std::shared_ptr<GeomAPI_Shape> aShapeGeom(new GeomAPI_Shape);
-      if (!loc.IsIdentity()){
-          shape.Move(loc);
-      }
-      aShapeGeom->setImpl(new TopoDS_Shape(shape));
-      shapeName = theResultBody->addShapeName(aShapeGeom, shapeName);
-    }
-    for(TDF_ChildIterator it(label); it.More(); it.Next()) { 
-
-      setShapeAttributes( shapeTool, colorTool, materialTool,
-                         it.Value(), partLoc,theResultBody,theMaterialShape, isRef);
-      indiceChild++;
-    }
-  }
-}
-
-
-//=============================================================================
-  /*!
-   *  StoreMaterial()
-   */
-  //=============================================================================
-
-  void StoreMaterial( std::shared_ptr<ModelAPI_ResultBody>    theResultBody,
-                      const Handle(Standard_Transient)        &theEnti,
-                      const TopTools_IndexedMapOfShape        &theIndices,
-                      const Handle(Transfer_TransientProcess) &theTP,
-                      const TDF_Label                         &theShapeLabel,
-                      std::map< std::wstring, std::list<std::wstring>> &theMaterialShape )
-  {
-    // Treat Product Definition Shape only.
-    Handle(StepRepr_ProductDefinitionShape) aPDS =
-      Handle(StepRepr_ProductDefinitionShape)::DownCast(theEnti);
-    Handle(StepBasic_ProductDefinition)     aProdDef;
-
-    if(aPDS.IsNull() == Standard_False) {
-      // Product Definition Shape ==> Product Definition
-      aProdDef = aPDS->Definition().ProductDefinition();
-    }
-
-    if (aProdDef.IsNull() == Standard_False) {
-      // Product Definition ==> Property Definition
-      const Interface_Graph    &aGraph = theTP->Graph();
-      Interface_EntityIterator  aSubs  = aGraph.Sharings(aProdDef);
-      TopoDS_Shape              aShape;
-
-      for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
-        Handle(StepRepr_PropertyDefinition) aPropD =
-          Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
-
-        if(aPropD.IsNull() == Standard_False) {
-          // Property Definition ==> Representation.
-          Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
-
-          for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
-            Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
-              Handle(StepRepr_PropertyDefinitionRepresentation)::
-              DownCast(aSubs1.Value());
-
-            if(aPDR.IsNull() == Standard_False) {
-              // Property Definition ==> Material Name.
-              Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
-
-              if(aRepr.IsNull() == Standard_False) {
-                Standard_Integer ir;
-
-                for(ir = 1; ir <= aRepr->NbItems(); ir++) {
-                  Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
-                  Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
-                    Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
-
-                  if(aDRI.IsNull() == Standard_False) {
-                    // Get shape from Product Definition
-                    Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
-                    if(aMatName.IsNull() == Standard_False) {
-                      TCollection_ExtendedString
-                        aMatNameExt (aMatName->ToCString());
-
-                      if (aShape.IsNull()) {
-                        //Get the shape.
-                        aShape = GetShape(aProdDef, theTP);
-                        if (aShape.IsNull()) {
-                          return;
-                        }
-                      }
-
-                      // as PRODUCT can be included in the main shape
-                      // several times, we look here for all iclusions.
-                      Standard_Integer isub, nbSubs = theIndices.Extent();
-
-                      for (isub = 1; isub <= nbSubs; isub++) {
-                        TopoDS_Shape aSub = theIndices.FindKey(isub);
-
-                        if (aSub.IsPartner(aShape)) {
-                          std::shared_ptr<GeomAPI_Shape> aShapeGeom(new GeomAPI_Shape);
-                          aShapeGeom->setImpl(new TopoDS_Shape(aSub));
-                          std::wstring nom = theResultBody->findShapeName(aShapeGeom);
-                          std::wstring matName= Locale::Convert::toWString(aMatName->ToCString()); 
-                          theMaterialShape[matName].push_back(nom);
-
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.h b/src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.h
deleted file mode 100644 (file)
index 2955a53..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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
-//
-
-#ifndef GEOMALGOAPI_STEPIMPORTXCAF_H_
-#define GEOMALGOAPI_STEPIMPORTXCAF_H_
-
-#include <GeomAlgoAPI.h>
-#include <TopoDS_Shape.hxx> 
-
-#include <string>
-#include <vector>
-#include <map>
-#include <set>
-#include <GeomAPI_Shape.h>
-#include <XCAFDoc_ColorTool.hxx>
-#include <XCAFDoc_ShapeTool.hxx>
-#include <XCAFDoc_MaterialTool.hxx>
-#include <TDocStd_Document.hxx>
-#include <XSControl_WorkSession.hxx>
-
-#include <STEPCAFControl_Reader.hxx>
-
-#include <ModelAPI_ResultBody.h>
-#include <TopTools_IndexedMapOfShape.hxx>
-
- // read Attributs of step file 
- GEOMALGOAPI_EXPORT
- std::shared_ptr<GeomAPI_Shape>  readAttributes( STEPCAFControl_Reader &reader,
-                                                 std::shared_ptr<ModelAPI_ResultBody> theResultBody, 
-                                                 const bool  anMaterials,
-                                                 std::map< std::wstring, std::list<std::wstring>> &theMaterialShape,          
-                                                 const std::string &format);
- // read attributs for  label                                          
- GEOMALGOAPI_EXPORT                            
- void setShapeAttributes(const Handle(XCAFDoc_ShapeTool) &shapeTool,
-                               const Handle(XCAFDoc_ColorTool) &colorTool,
-                               const Handle(XCAFDoc_MaterialTool) &materialTool,
-                               const TDF_Label &label,
-                               const TopLoc_Location &loc,
-                               std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                               std::map< std::wstring, std::list<std::wstring>> &theMaterialShape,
-                               bool isRef);
-
-// read geometry                              
-GEOMALGOAPI_EXPORT                              
-std::shared_ptr<GeomAPI_Shape> setgeom(const Handle(XCAFDoc_ShapeTool) &shapeTool,
-                                    const TDF_Label &label);
-
-// store Materiel for theShapeLabel in the map theMaterialShape
-GEOMALGOAPI_EXPORT 
-void StoreMaterial(  std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                     const Handle(Standard_Transient)        &theEnti,
-                      const TopTools_IndexedMapOfShape        &theIndices,
-                      const Handle(Transfer_TransientProcess) &theTP,
-                      const TDF_Label                         &theShapeLabel,
-                      std::map< std::wstring, std::list<std::wstring>> &theMaterialShape );
-
-#endif /* GEOMALGOAPI_STEPIMPORTXCAF_H_ */