Salome HOME
Fixed issue #20475
authorcg246364 <clarisse.genrault@cea.fr>
Tue, 15 Dec 2020 12:58:09 +0000 (13:58 +0100)
committercg246364 <clarisse.genrault@cea.fr>
Tue, 15 Dec 2020 13:00:23 +0000 (14:00 +0100)
src/ConnectorAPI/Test/TestImportSTEP.py
src/ExchangePlugin/ExchangePlugin_Import.h
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/ExchangePlugin/ExchangePlugin_msg_fr.ts
src/GeomAlgoAPI/GeomAlgoAPI_STEPImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_STEPImportXCAF.cpp
src/ModelAPI/CMakeLists.txt

index 84b6d90ce96b8cab3f7426adcc290379fe05adc3..c3a80f8a00475dac73eb3387e907e959269532a9 100644 (file)
@@ -31,14 +31,10 @@ import os
 import math
 from tempfile import TemporaryDirectory
 
-import GEOM
-
 from ModelAPI import *
 
 from salome.shaper import model
 
-from salome.geom import geomBuilder
-
 from GeomAPI import GeomAPI_Shape
 
 from GeomAlgoAPI import *
@@ -46,7 +42,6 @@ from GeomAlgoAPI import *
 __updated__ = "2015-05-22"
 
 salome.salome_init(1)
-geompy = geomBuilder.New()
 
 #=========================================================================
 # Help functions
@@ -115,10 +110,4 @@ def testImportSTEP():
 
 if __name__ == '__main__':
     with TemporaryDirectory() as tmp_dir:
-        #=========================================================================
-        # Export a shape into STL
-        #=========================================================================
         testImportSTEP()
-        #=========================================================================
-        # End of test
-        #=========================================================================
index 994b3c8be971889970b6ad3c7090632a0d2b9860..eeac517943217320b69804add40fb0a5a0e5726e 100644 (file)
@@ -123,10 +123,6 @@ class ExchangePlugin_Import : public ModelAPI_Feature
   /// \param theID identifier of changed attribute
   EXCHANGEPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
 
-  /// Called to update part
-  EXCHANGEPLUGIN_EXPORT
-  void updatePart(AttributeStringArrayPtr& thePartsAttr, AttributeIntegerPtr& theTargetAttr);
-
   /// Computes or recomputes the results
   EXCHANGEPLUGIN_EXPORT virtual void execute();
 
@@ -135,6 +131,11 @@ class ExchangePlugin_Import : public ModelAPI_Feature
 
   /// Reimplemented from ModelAPI_Feature::isPreviewNeeded(). Returns false.
   EXCHANGEPLUGIN_EXPORT virtual bool isPreviewNeeded() const { return false; }
+
+ private:
+  /// Called to update part
+  EXCHANGEPLUGIN_EXPORT
+  void updatePart(AttributeStringArrayPtr& thePartsAttr, AttributeIntegerPtr& theTargetAttr);
 };
 
 #endif /* IMPORT_IMPORTFEATURE_H_ */
index dc354267966f9112d9cb74c58c8166d8bc40e892..24c821f1c35398964afeb3bc70baaa958fb4eb87 100644 (file)
@@ -63,8 +63,6 @@
 
 #include <ExchangePlugin_Tools.h>
 
-#include <TopExp_Explorer.hxx>
-#include <OSD_Exception.hxx>
 
 
 ExchangePlugin_ImportFeature::ExchangePlugin_ImportFeature()
@@ -154,7 +152,7 @@ void ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
   std::string anError;
   std::shared_ptr<GeomAPI_Shape> aGeomShape;
 
-  std::map< std::wstring, std::list<std::wstring>> theMaterialShape;
+  std::map<std::wstring, std::list<std::wstring>> theMaterialShape;
 
   std::string anObjectName = GeomAlgoAPI_Tools::File_Tools::name(theFileName);
   data()->setName(Locale::Convert::toWString(anObjectName));
@@ -171,31 +169,22 @@ void ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
     bool anScalInterUnits =
             boolean(ExchangePlugin_ImportFeature::STEP_SCALE_INTER_UNITS_ID())->value();
 
-    try{
+    // Process groups/fields
+    std::shared_ptr<ModelAPI_AttributeRefList> aRefListOfGroups =
+    std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(data()->attribute(FEATURES_ID()));
 
-      aResult->clearShapeNameAndColor();
-      // Process groups/fields
-      std::shared_ptr<ModelAPI_AttributeRefList> aRefListOfGroups =
-      std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(data()->attribute(FEATURES_ID()));
-
-      // Remove previous groups/fields stored in RefList
-      std::list<ObjectPtr> anGroupList = aRefListOfGroups->list();
-      std::list<ObjectPtr>::iterator anGroupIt = anGroupList.begin();
-      for (; anGroupIt != anGroupList.end(); ++anGroupIt) {
-        std::shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_Feature::feature(*anGroupIt);
-        if (aFeature)
+    // Remove previous groups/fields stored in RefList
+    std::list<ObjectPtr> anGroupList = aRefListOfGroups->list();
+    std::list<ObjectPtr>::iterator anGroupIt = anGroupList.begin();
+    for (; anGroupIt != anGroupList.end(); ++anGroupIt) {
+      std::shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_Feature::feature(*anGroupIt);
+      if (aFeature)
         document()->removeFeature(aFeature);
-      }
-
-      aGeomShape = STEPImportAttributs(theFileName, aResult, anScalInterUnits,
-                                       anMaterialsGroupSelected, anColorGroupSelected,
-                                       theMaterialShape,anError);
-
-    }
-    catch (OSD_Exception& e) {
-      //Try to load STEP file without colors...
-      aGeomShape = STEPImport(theFileName, anExtension,anScalInterUnits,anError);
     }
+
+    aGeomShape = STEPImportAttributs(theFileName, aResult, anScalInterUnits,
+                                     anMaterialsGroupSelected, anColorGroupSelected,
+                                     theMaterialShape, anError);
   } else if (anExtension == "IGES" || anExtension == "IGS") {
     aGeomShape = IGESImport(theFileName, anExtension, anError);
   } else {
@@ -224,6 +213,7 @@ void ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
   }
 
   setResult(aResult);
+  aResult->clearShapeNameAndColor();
 
 }
 
@@ -232,13 +222,13 @@ void ExchangePlugin_ImportFeature::setColorGroups(
 {
   std::vector<int> aColor;
   int anIndice = 1;
-  std::list< std::vector<int> > aColorsRead;
+  std::list<std::vector<int>> aColorsRead;
 
   ModelAPI_Tools::getColor(theResultBody, aColor);
   if (!aColor.empty() ){
     std::wstringstream aColorName;
     aColorName <<L"Color_"<< anIndice;
-    setColorGroup( theResultBody, aColor, aColorName.str());
+    setColorGroup(theResultBody, aColor, aColorName.str());
     anIndice++;
     aColorsRead.push_back(aColor);
   }
@@ -275,10 +265,10 @@ void ExchangePlugin_ImportFeature::setColorGroup(
   AttributeSelectionListPtr aSelectionList = aGroupFeature->selectionList("group_list");
 
   ModelAPI_Tools::getColor(theResultBody, aColor);
-  if (!aColor.empty() ){
-    if (aColor == theColor ) {
+  if (!aColor.empty()){
+    if (aColor == theColor) {
       GeomShapePtr aShape = theResultBody->shape();
-      aSelectionList->setSelectionType(aShape->shapeTypeStr() );
+      aSelectionList->setSelectionType(aShape->shapeTypeStr());
       aSelectionList->append(theResultBody,aShape);
     }
   }
@@ -290,9 +280,9 @@ void ExchangePlugin_ImportFeature::setColorGroup(
     ModelAPI_Tools::getColor(*aRes, aColor);
     GeomShapePtr aShape = (*aRes)->shape();
 
-    if (!aColor.empty() ){
-      if (aRes->get() &&  aColor == theColor ) {
-        aSelectionList->setSelectionType(aShape->shapeTypeStr() );
+    if (!aColor.empty()){
+      if (aRes->get() &&  aColor == theColor) {
+        aSelectionList->setSelectionType(aShape->shapeTypeStr());
         aSelectionList->append(theResultBody,aShape);
       }
     }
@@ -304,7 +294,7 @@ void ExchangePlugin_ImportFeature::setColorGroup(
 
   ModelAPI_Tools::setColor(aGroupFeature->lastResult(),theColor);
 
-  if (aSelectionList->size() == 0 ){
+  if (aSelectionList->size() == 0{
     document()->removeFeature(aGroupFeature);
   }
 }
@@ -314,7 +304,7 @@ void ExchangePlugin_ImportFeature::setMaterielGroup(
                                 std::map< std::wstring,std::list<std::wstring>>& theMaterialShape)
 {
   std::map< std::wstring, std::list<std::wstring>>::iterator anIt;
-  foranIt = theMaterialShape.begin(); anIt != theMaterialShape.end(); ++anIt) {
+  for (anIt = theMaterialShape.begin(); anIt != theMaterialShape.end(); ++anIt) {
 
     std::shared_ptr<ModelAPI_Feature> aGroupFeature = addFeature("Group");
     // group name
@@ -322,19 +312,18 @@ void ExchangePlugin_ImportFeature::setMaterielGroup(
 
     // fill selection
     AttributeSelectionListPtr aSelectionList = aGroupFeature->selectionList("group_list");
-    GeomShapePtr aShape = theResultBody->shape();
 
     std::list<ResultPtr> allRes;
     ModelAPI_Tools::allSubs(theResultBody, allRes);
-    for(std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); ++aRes) {
+    for (std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); ++aRes) {
 
       GeomShapePtr aShape = (*aRes)->shape();
-      for(std::list<std::wstring>::iterator aResMat = anIt->second.begin();
+      for (std::list<std::wstring>::iterator aResMat = anIt->second.begin();
                                  aResMat != anIt->second.end(); ++aResMat) {
         if (aRes->get() && ((*aRes)->data()->name() == (*aResMat)))
         {
           aSelectionList->append(theResultBody,aShape);
-          aSelectionList->setSelectionType(aShape->shapeTypeStr() );
+          aSelectionList->setSelectionType(aShape->shapeTypeStr());
           break;
         }
       }
index 72f1663eca902f45f7b1f6acea0d9e5f8067fec5..2774f3d5916b94df3b7dc40d43fd96fd12c1e8bd 100644 (file)
     </message>
     <message>
       <source>Create groups from</source>
-      <translation>créer des groupes à partir</translation>
+      <translation>Créer des groupes à partir</translation>
     </message>
     <message>
-    <source>Materials</source>
-    <translation>Matériels</translation>
-  </message>
+      <source>Materials</source>
+      <translation>Matériels</translation>
+    </message>
   </context>
   <context>
     <name>Import:file_path</name>
     </message>
   </context>
   <context>
-  <name>Import:step_scale_inter_units</name>
-  <message>
-    <source>Scale to International System of Units</source>
-    <translation>Mettre àl'échelle du système international d'unités</translation>
-  </message>
+    <name>Import:step_scale_inter_units</name>
+    <message>
+      <source>Scale to International System of Units</source>
+      <translation>Mettre à l'échelle du système international d'unités</translation>
+    </message>
   </context>
-  <name>Import:step_materials</name>
-  <message>
-    <source>Materials</source>
-    <translation>Matériels</translation>
-  </message>
+  <context>
+    <name>Import:step_materials</name>
+    <message>
+      <source>Materials</source>
+      <translation>Matériels</translation>
+    </message>
   </context>
   <context>
-  <name>Import:step_materials</name>
-  <message>
-    <source>Colors</source>
-    <translation>Couleurs</translation>
-  </message>
+    <name>Import:step_colors</name>
+    <message>
+      <source>Colors</source>
+      <translation>Couleurs</translation>
+    </message>
   </context>
   <context>
     <name>ImportMacro</name>
       <source>Import a file</source>
       <translation>Importer un fichier</translation>
     </message>
-  </context>
-  <message>
+    <message>
       <source>Create groups from</source>
-      <translation>créer des groupes à partir</translation>
+      <translation>Créer des groupes à partir</translation>
     </message>
+  </context> 
   <context>
     <name>ImportMacro:target_part</name>
     <message>
     <name>ImportMacro:step_scale_inter_units</name>
     <message>
       <source>Scale to International System of Units</source>
-      <translation>Mettre àl'échelle du système international d'unités</translation>
+      <translation>Mettre à l'échelle du système international d'unités</translation>
     </message>
   </context>
-  <name>Import:step_materials</name>
-  <message>
-    <source>Materials</source>
-    <translation>Matériels</translation>
-  </message>
+  <context>
+    <name>ImportMacro:step_materials</name>
+    <message>
+      <source>Materials</source>
+      <translation>Matériels</translation>
+    </message>
   </context>
   <context>
-  <name>Import:step_materials</name>
-  <message>
-    <source>Colors</source>
-    <translation>Couleurs</translation>
-  </message>
+    <name>ImportMacro:step_colors</name>
+    <message>
+      <source>Colors</source>
+      <translation>Couleurs</translation>
+    </message>
   </context>
   <context>
     <name>ImportMacro:file_path</name>
     </message>
   </context>
   <context>
-  <name>ImportMacro:step_file_path</name>
-  <message>
-    <source>Import file</source>
-    <translation>Importer un fichier</translation>
-  </message>
-</context>
-<context>
+    <name>ImportMacro:step_file_path</name>
+    <message>
+      <source>Import file</source>
+      <translation>Importer un fichier</translation>
+    </message>
+  </context>
   <context>
     <name>ImportMacro:file_path:ExchangePlugin_ImportFormat</name>
     <message>
index 7e557e32d29b0d3d113cc89bd3a7e4fb1e84dfcc..68818b7832aec8f7768394219a67c191773cb20c 100644 (file)
 #include <TopoDS_Iterator.hxx>
 
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
+#include <OSD_Exception.hxx>
+
+//=================================================================================================
+bool readUnits(const STEPControl_Reader& aReader,
+               const bool theScalInterUnits,
+               std::string& theError)
+{
+  // Regard or not the model units
+  if (!theScalInterUnits) {
+    // set UnitFlag to units from file
+    TColStd_SequenceOfAsciiString anUnitLengthNames;
+    TColStd_SequenceOfAsciiString anUnitAngleNames;
+    TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
+    aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
+    if (anUnitLengthNames.Length() > 0) {
+      TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
+      if (aLenUnits == "millimetre")
+        Interface_Static::SetCVal("xstep.cascade.unit", "MM");
+      else if (aLenUnits == "centimetre")
+        Interface_Static::SetCVal("xstep.cascade.unit", "CM");
+      else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
+        Interface_Static::SetCVal("xstep.cascade.unit", "M");
+      else if (aLenUnits == "INCH")
+        Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
+      else {
+        theError = "The file contains not supported units.";
+        return false;
+      }
+      // TODO (for other units than mm, cm, m or inch)
+      //else if (aLenUnits == "")
+      //  Interface_Static::SetCVal("xstep.cascade.unit", "???");
+    }
+  }
+  else {
+    //cout<<"need re-scale a model"<<endl;
+    // set UnitFlag to 'meter'
+    Interface_Static::SetCVal("xstep.cascade.unit","M");
+  }
+  return true;
+}
 
 
 //==================================================================================================
@@ -90,39 +130,11 @@ std::shared_ptr<GeomAPI_Shape> STEPImport(const std::string& theFileName,
     IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.c_str());
 
     if (status == IFSelect_RetDone) {
-
       // Regard or not the model units
-      if (!theScalInterUnits) {
-        // set UnitFlag to units from file
-        TColStd_SequenceOfAsciiString anUnitLengthNames;
-        TColStd_SequenceOfAsciiString anUnitAngleNames;
-        TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
-        aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
-        if (anUnitLengthNames.Length() > 0) {
-          TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
-          if (aLenUnits == "millimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "MM");
-          else if (aLenUnits == "centimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "CM");
-          else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
-            Interface_Static::SetCVal("xstep.cascade.unit", "M");
-          else if (aLenUnits == "INCH")
-            Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
-          else {
-            theError = "The file contains not supported units.";
-            std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
-            aGeomShape->setImpl(new TopoDS_Shape(aResShape));
-            return aGeomShape;
-          }
-          // TODO (for other units than mm, cm, m or inch)
-          //else if (aLenUnits == "")
-          //  Interface_Static::SetCVal("xstep.cascade.unit", "???");
-        }
-      }
-      else {
-        //cout<<"need re-scale a model"<<endl;
-        // set UnitFlag to 'meter'
-        Interface_Static::SetCVal("xstep.cascade.unit","M");
+      if( !readUnits(aReader,theScalInterUnits,theError)) {
+        std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
+        aGeomShape->setImpl(new TopoDS_Shape());
+        return aGeomShape;
       }
 
       Standard_Boolean failsonly = Standard_False;
@@ -209,75 +221,51 @@ GeomShapePtr STEPImportAttributs(const std::string& theFileName,
                                  std::string& theError)
 {
 
-  STEPControl_Reader aReader;
-  std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
-
-  Interface_Static::SetCVal("xstep.cascade.unit","M");
-  Interface_Static::SetIVal("read.step.ideas", 1);
-  Interface_Static::SetIVal("read.step.nonmanifold", 1);
-
   try {
-    OCC_CATCH_SIGNALS;
+    STEPControl_Reader aReader;
+    std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
 
-    IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.c_str());
+    Interface_Static::SetCVal("xstep.cascade.unit","M");
+    Interface_Static::SetIVal("read.step.ideas", 1);
+    Interface_Static::SetIVal("read.step.nonmanifold", 1);
 
-    if (status == IFSelect_RetDone) {
+    try {
+      OCC_CATCH_SIGNALS;
 
-      // Regard or not the model units
-      if (!theScalInterUnits) {
-        // set UnitFlag to units from file
-        TColStd_SequenceOfAsciiString anUnitLengthNames;
-        TColStd_SequenceOfAsciiString anUnitAngleNames;
-        TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
-        aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
-        if (anUnitLengthNames.Length() > 0) {
-          TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
-          if (aLenUnits == "millimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "MM");
-          else if (aLenUnits == "centimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "CM");
-          else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
-            Interface_Static::SetCVal("xstep.cascade.unit", "M");
-          else if (aLenUnits == "INCH")
-            Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
-          else {
-            theError = "The file contains not supported units.";
-            aGeomShape->setImpl(new TopoDS_Shape());
-            return aGeomShape;
-          }
-          // TODO (for other units than mm, cm, m or inch)
-          //else if (aLenUnits == "")
-          //  Interface_Static::SetCVal("xstep.cascade.unit", "???");
+      IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.c_str());
+
+      if (status == IFSelect_RetDone) {
+        // Regard or not the model units
+        if( !readUnits(aReader,theScalInterUnits,theError)) {
+          aGeomShape->setImpl(new TopoDS_Shape());
+          return aGeomShape;
         }
       }
-      else {
-        //cout<<"need re-scale a model"<<endl;
-        // set UnitFlag to 'meter'
-        Interface_Static::SetCVal("xstep.cascade.unit","M");
-      }
+    } catch (Standard_Failure const& anException) {
+      theError = anException.GetMessageString();
+      aGeomShape->setImpl(new TopoDS_Shape());
+      return aGeomShape;
     }
-  }
-  catch (Standard_Failure const& anException) {
-    theError = anException.GetMessageString();
-    aGeomShape->setImpl(new TopoDS_Shape());
-    return aGeomShape;
-  }
 
-  STEPCAFControl_Reader aCafreader;
-  aCafreader.SetColorMode(true);
-  aCafreader.SetNameMode(true);
-  aCafreader.SetMatMode(true);
+    STEPCAFControl_Reader aCafreader;
+    aCafreader.SetColorMode(true);
+    aCafreader.SetNameMode(true);
+    aCafreader.SetMatMode(true);
 
-  if(aCafreader.ReadFile(theFileName.c_str()) != IFSelect_RetDone) {
-    theError = "Wrong format of the imported file. Can't import file.";
-    std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
-    aGeomShape->setImpl(new TopoDS_Shape());
-    return aGeomShape;
-  }
+    if (aCafreader.ReadFile(theFileName.c_str()) != IFSelect_RetDone) {
+      theError = "Wrong format of the imported file. Can't import file.";
+      std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
+      aGeomShape->setImpl(new TopoDS_Shape());
+      return aGeomShape;
+    }
 
-  return readAttributes(aCafreader,
-                        theResultBody,
-                        theMaterials,
-                        theMaterialShape,
-                        theError);
+    return readAttributes(aCafreader,
+                          theResultBody,
+                          theMaterials,
+                          theMaterialShape,
+                          theError);
+  } catch (OSD_Exception& e) {
+    //Try to load STEP file without colors...
+    return STEPImport(theFileName,"",theScalInterUnits,theError);
+  }
 }
index 807d4f86d428cb8ef9bfaf8e57ff2d344572b168..b77defd1467483e10eed5967bcf3c0cc5b61bf35 100644 (file)
@@ -329,12 +329,12 @@ void storeMaterial( std::shared_ptr<ModelAPI_ResultBody>    theResultBody,
     Handle(StepRepr_ProductDefinitionShape)::DownCast(theEnti);
   Handle(StepBasic_ProductDefinition)     aProdDef;
 
-  if (aPDS.IsNull() == Standard_False) {
+  if (!aPDS.IsNull()) {
     // Product Definition Shape ==> Product Definition
     aProdDef = aPDS->Definition().ProductDefinition();
   }
 
-  if (aProdDef.IsNull() == Standard_False) {
+  if (!aProdDef.IsNull()) {
     // Product Definition ==> Property Definition
     const Interface_Graph    &aGraph = theTP->Graph();
     Interface_EntityIterator  aSubs  = aGraph.Sharings(aProdDef);
@@ -344,7 +344,7 @@ void storeMaterial( std::shared_ptr<ModelAPI_ResultBody>    theResultBody,
       Handle(StepRepr_PropertyDefinition) aPropD =
         Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
 
-      if (aPropD.IsNull() == Standard_False) {
+      if (!aPropD.IsNull()) {
         // Property Definition ==> Representation.
         Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
 
@@ -353,11 +353,11 @@ void storeMaterial( std::shared_ptr<ModelAPI_ResultBody>    theResultBody,
             Handle(StepRepr_PropertyDefinitionRepresentation)::
             DownCast(aSubs1.Value());
 
-          if (aPDR.IsNull() == Standard_False) {
+          if (!aPDR.IsNull()) {
             // Property Definition ==> Material Name.
             Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
 
-            if (aRepr.IsNull() == Standard_False) {
+            if (!aRepr.IsNull()) {
               Standard_Integer anIr;
 
               for(anIr = 1; anIr <= aRepr->NbItems(); anIr++) {
@@ -365,10 +365,10 @@ void storeMaterial( std::shared_ptr<ModelAPI_ResultBody>    theResultBody,
                 Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
                   Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
 
-                if (aDRI.IsNull() == Standard_False) {
+                if (!aDRI.IsNull()) {
                   // Get shape from Product Definition
                   Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
-                  if (aMatName.IsNull() == Standard_False) {
+                  if (!aMatName.IsNull()) {
                     TCollection_ExtendedString
                       aMatNameExt (aMatName->ToCString());
 
index 8d943e9c8cd50785f495e9a0e85d388c8c16463a..68b34a17718cdbc45fd0fb9155d4f5e2ed63b625 100644 (file)
@@ -117,6 +117,7 @@ SET(PROJECT_SOURCES
 SET(PROJECT_LIBRARIES
     Config
     GeomAPI
+    Locale
 )
 SET(CMAKE_SWIG_FLAGS -threads -w325,321,362,383,302,403,451,473)
 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
@@ -130,11 +131,6 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
                     ${PROJECT_SOURCE_DIR}/src/Locale
-                    ${OpenCASCADE_INCLUDE_DIR}
-                    ${OpenCASCADE_DataExchange_LIBRARIES}
-                    ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
-                    ${OpenCASCADE_ApplicationFramework_LIBRARIES}
-
 )