]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[bos #35154][EDF](2023-T1) Edge thickness.
authordish <dmitrii.shvydkoi@opencascade.com>
Thu, 13 Jun 2024 12:09:25 +0000 (12:09 +0000)
committerdish <dmitrii.shvydkoi@opencascade.com>
Thu, 13 Jun 2024 12:09:25 +0000 (12:09 +0000)
Remove duplicated methods.

src/Model/Model_Document.h
src/Model/Model_Objects.cpp
src/Model/Model_ResultBody.cpp
src/ModelAPI/ModelAPI_Document.h

index 7fe1e21ebdea0a976fdca7aaab6322768775625b..f8e40c76076aac92441d99c5273f1f23bad4b39a 100644 (file)
@@ -154,14 +154,6 @@ class Model_Document : public ModelAPI_Document
     std::shared_ptr<GeomAPI_Shape> theShape,
     const bool theAllowFolder = false);
 
-  //! Returns the shape index in the result.
-  //! \param theResult result
-  //! \param theShape result subshape
-  //! \returns index started from zero, or -1 if shape is not stored or is not a subshape of the result
-  MODEL_EXPORT virtual const int index(std::shared_ptr<ModelAPI_Result> theResult,
-    std::shared_ptr<GeomAPI_Shape> theShape,
-    const bool theAllowFolder = false);
-
   //! Internal sub-document by ID
   MODEL_EXPORT virtual std::shared_ptr<Model_Document> subDoc(int theDocID);
 
index cd69e162341fc01ff35f700842429355072639d6..ffdd25689dd065eb66c9cd16f2ff8b5b63882546 100644 (file)
@@ -807,7 +807,7 @@ void Model_Objects::setAttribute(const Handle(TDF_Attribute)& theAttribute,
     aResultLabel = resultLabel(theResult->data(), index(theResult));
   TDF_Label anAttributeLabel = subShapeLabel(aResultLabel, index(theResult, theShape)).FindChild(TAG_FEATURE_ARGUMENTS);
 
-  if (Standard_GUID::IsEqual(theAttribute->ID(), TDataStd_IntegerArray::GetID()))
+  if (theAttribute->ID() == TDataStd_IntegerArray::GetID())
   {
     Handle(TDataStd_IntegerArray) anColor;
     Handle(TDataStd_IntegerArray) anAttr =
@@ -855,7 +855,7 @@ Handle(TDF_Attribute) Model_Objects::getAttribute(const Standard_GUID& theID,
   TDF_Label anAttributeLabel = subShapeLabel(aResultLabel, anIndex).FindChild(TAG_FEATURE_ARGUMENTS);
 
   Handle(TDF_Attribute) anAttr;
-  anAttributeLabel.FindAttribute(theID, anAttr); // ? TDataStd_IntegerArray::GetID() or TDataStd_Integer::GetID()
+  anAttributeLabel.FindAttribute(theID, anAttr);
   return anAttr;
 }
 
@@ -922,11 +922,6 @@ void Model_Objects::removeShapeColors(const std::shared_ptr<ModelAPI_Result> the
   }
 }
 
-TDF_Label Model_Objects::shapesFromResult(TDF_Label theResult) const
-{
-  return theResult.Father().FindChild(TAG_RESULT_SHAPES);
-}
-
 void Model_Objects::getSubShapesWithEdgeThickness(
   const std::shared_ptr<ModelAPI_Result> theResult,
   std::map<std::shared_ptr<GeomAPI_Shape>, int>& oShapes
index 8c2a2af58ec5c79b58c9e641e80d9952bfae6857..2368d0e8c39511c57d41437a4dd2c1bd2c8f83b2 100644 (file)
@@ -39,6 +39,7 @@
 #include <TopExp_Explorer.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TDataStd_UAttribute.hxx>
+#include <TDataStd_Integer.hxx>
 #include <TDataStd_IntegerArray.hxx>
 #include <TNaming_Tool.hxx>
 #include <TDF_Reference.hxx>
@@ -298,49 +299,6 @@ void Model_ResultBody::getSubShapesWithEdgeThickness(
   anObjects->getSubShapesWithEdgeThickness(theResult, oShapes);
 }
 
-void Model_ResultBody::setSubShapeEdgeThickness(
-  const std::shared_ptr<ModelAPI_Result> theResult,
-  const std::shared_ptr<GeomAPI_Shape> theSubShape,
-  int theEdgeThickness
-)
-{
-  TopoDS_Shape aShape = shape()->impl<TopoDS_Shape>();
-  TopoDS_Shape aSubShape = theSubShape->impl<TopoDS_Shape>();
-  if (!shape()->isSubShape(theSubShape))
-    return;
-
-  Model_Objects* anObjects = std::dynamic_pointer_cast<Model_Document>(document())->objects();
-  document()->storeShape(data(), theResult, theSubShape);
-
-  Handle(TDataStd_Integer) aThickness = new TDataStd_Integer();
-  aThickness->Set(theEdgeThickness);
-  anObjects->setAttribute(aThickness, theResult, theSubShape);
-}
-
-int Model_ResultBody::getSubShapeEdgeThickness(const std::shared_ptr<ModelAPI_Result> theResult, const std::shared_ptr<GeomAPI_Shape> theSubShape) const
-{
-  TopoDS_Shape aShape = shape()->impl<TopoDS_Shape>();
-  TopoDS_Shape aSubShape = theSubShape->impl<TopoDS_Shape>();
-  if (!shape()->isSubShape(theSubShape))
-    return -1;
-
-  Model_Objects* anObjects = std::dynamic_pointer_cast<Model_Document>(document())->objects();
-  auto anAttr = Handle(TDataStd_Integer)::DownCast(anObjects->getAttribute(TDataStd_Integer::GetID(), theResult, theSubShape));
-  if (anAttr.IsNull())
-    return;
-
-  return anAttr->Get();
-}
-
-void Model_ResultBody::getSubShapesWithEdgeThickness(
-  const std::shared_ptr<ModelAPI_Result> theResult,
-  std::map<std::shared_ptr<GeomAPI_Shape>, int>& oShapes
-) const
-{
-  Model_Objects* anObjects = std::dynamic_pointer_cast<Model_Document>(document())->objects();
-  anObjects->getSubShapesWithEdgeThickness(theResult, oShapes);
-}
-
 void Model_ResultBody::addShapeColor( const std::wstring& theName,std::vector<int>& color)
 {
   if (myColorsShape.find(theName) == myColorsShape.end())
index da907084d867f657f44ec6d89f24dcffb25c0d23..64f638942c6ffd98d6fbade2927ac07b72f1f063 100644 (file)
@@ -117,14 +117,6 @@ public:
     std::shared_ptr<GeomAPI_Shape> theShape,
     const bool theAllowFolder = false) = 0;
 
-  //! Returns the shape index in the result.
-  //! \param theResult result
-  //! \param theShape result subshape
-  //! \returns index started from zero, or -1 if shape is not stored or is not a subshape of the result
-  virtual const int index(std::shared_ptr<ModelAPI_Result> theResult,
-    std::shared_ptr<GeomAPI_Shape> theShape,
-    const bool theAllowFolder = false) = 0;
-
   //! Returns the number of objects in the group of objects
   //! \param theGroupID group of objects
   //! \param theAllowFolder take into account grouping feature by folders