]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refacto ModelAPI_ResultMeta class inheritance
authorNicolas RECHATIN <nicolas.rechatin@cea.fr>
Thu, 22 Jul 2021 11:22:58 +0000 (13:22 +0200)
committerNicolas RECHATIN <nicolas.rechatin@cea.fr>
Thu, 22 Jul 2021 11:22:58 +0000 (13:22 +0200)
src/Model/CMakeLists.txt
src/Model/Model_ResultVolume.cpp
src/ModelAPI/CMakeLists.txt
src/ModelAPI/ModelAPI_ResultBody.cpp
src/ModelAPI/ModelAPI_ResultBody.h
src/ModelAPI/ModelAPI_ResultMeta.cpp [new file with mode: 0644]
src/ModelAPI/ModelAPI_ResultMeta.h [new file with mode: 0644]
src/ModelAPI/ModelAPI_ResultVolume.cpp
src/ModelAPI/ModelAPI_ResultVolume.h
src/ModelAPI/ModelAPI_Session.cpp

index 620650aa773fc782be4e49d55b64a71397198d72..96248507deaad716a385d3087b80bc3ee2c52c78 100644 (file)
@@ -48,9 +48,7 @@ SET(PROJECT_HEADERS
     Model_FeatureValidator.h
     Model_FiltersFactory.h
     Model_ResultBody.h
-
     Model_ResultVolume.h
-
     Model_ResultConstruction.h
     Model_ResultPart.h
     Model_ResultField.h
@@ -89,9 +87,7 @@ SET(PROJECT_SOURCES
     Model_FeatureValidator.cpp
     Model_FiltersFactory.cpp
     Model_ResultBody.cpp
-
     Model_ResultVolume.cpp
-
     Model_ResultConstruction.cpp
     Model_ResultPart.cpp
     Model_ResultField.cpp
index eda5d69844272e26a13f6ad9e2f2f0425edd49cc..cc852ede13d36152b0ebaf63aac2d5a823c89de1 100644 (file)
@@ -156,7 +156,7 @@ void Model_ResultVolume::colorConfigInfo(std::string& theSection, std::string& t
   std::string& theDefault)
 {
   theSection = "Visualization";
-  theName = "result_body_color";
+  theName = "result_volume_color";
   theDefault = DEFAULT_COLOR();
 }
 
index b9977abdfc74a37480b5299ccb91fd9fbe3e0685..3db02400dde813a9dcdc9e042ccd02fdf61eae22 100644 (file)
@@ -60,10 +60,9 @@ SET(PROJECT_HEADERS
     ModelAPI_Object.h
     ModelAPI_Plugin.h
     ModelAPI_Result.h
+    ModelAPI_ResultMeta.h
     ModelAPI_ResultBody.h
-
     ModelAPI_ResultVolume.h
-
     ModelAPI_ResultConstruction.h
     ModelAPI_ResultField.h
     ModelAPI_ResultGroup.h
@@ -107,6 +106,7 @@ SET(PROJECT_SOURCES
     ModelAPI_Object.cpp
     ModelAPI_Plugin.cpp
     ModelAPI_Result.cpp
+    ModelAPI_ResultMeta.cpp
     ModelAPI_ResultBody.cpp
     ModelAPI_ResultVolume.cpp
     ModelAPI_ResultConstruction.cpp
index 0187d253403c5d2a3ed84ffcaa1c994bb9a30aee..0d88bef99579d471301488268d247a9d9606d629 100644 (file)
 
 #include "ModelAPI_ResultBody.h"
 
-#include <ModelAPI_BodyBuilder.h>
-#include <Events_Loop.h>
-#include <ModelAPI_Events.h>
+ModelAPI_ResultBody::ModelAPI_ResultBody() {}
 
-ModelAPI_ResultBody::ModelAPI_ResultBody()
-  : myBuilder(0)
-{
-  myConnect = ConnectionNotComputed;
-}
-
-ModelAPI_ResultBody::~ModelAPI_ResultBody()
-{
-}
+ModelAPI_ResultBody::~ModelAPI_ResultBody() {}
 
 std::string ModelAPI_ResultBody::groupName()
 {
-  return group();
-}
-
-void ModelAPI_ResultBody::store(const GeomShapePtr& theShape,
-                                const bool theIsStoreSameShapes)
-{
-  myBuilder->store(theShape, theIsStoreSameShapes);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theShape);
-}
-
-void ModelAPI_ResultBody::storeGenerated(const GeomShapePtr& theFromShape,
-                                         const GeomShapePtr& theToShape)
-{
-  myBuilder->storeGenerated(theFromShape, theToShape);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theToShape);
-}
-
-void ModelAPI_ResultBody::storeGenerated(
-  const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
-  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
-{
-  myBuilder->storeGenerated(theFromShapes, theToShape, theMakeShape);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theToShape, theFromShapes, theMakeShape, true);
-}
-
-void ModelAPI_ResultBody::storeModified(const GeomShapePtr& theOldShape,
-                                        const GeomShapePtr& theNewShape,
-                                        const bool theIsCleanStored)
-{
-  myBuilder->storeModified(theOldShape, theNewShape, theIsCleanStored);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theNewShape);
-}
-
-void ModelAPI_ResultBody::storeModified(
-  const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
-  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
-{
-  myBuilder->storeModified(theOldShapes, theNewShape, theMakeShape);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theNewShape, theOldShapes, theMakeShape, false);
-}
-
-GeomShapePtr ModelAPI_ResultBody::shape()
-{
-  return myBuilder->shape();
-}
-
-void ModelAPI_ResultBody::generated(const GeomShapePtr& theOldShape,
-                                    const GeomShapePtr& theNewShape,
-                                    const std::string& theName)
-{
-  myBuilder->generated(theOldShape, theNewShape, theName);
-}
-
-void ModelAPI_ResultBody::modified(const GeomShapePtr& theOldShape,
-                                   const GeomShapePtr& theNewShape,
-                                   const std::string& theName)
-{
-  myBuilder->modified(theOldShape, theNewShape, theName);
-}
-
-
-void ModelAPI_ResultBody::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
-                                            const GeomShapePtr& theOldShape,
-                                            const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                            const GeomShapePtr& theShapesToExclude)
-{
-  myBuilder->loadDeletedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theShapesToExclude);
-}
-
-// LCOV_EXCL_START
-bool ModelAPI_ResultBody::isConnectedTopology()
-{
-  if (myConnect == ConnectionNotComputed) {
-    myConnect = shape()->isConnectedTopology() ? IsConnected : IsNotConnected;
-  }
-  return myConnect == IsConnected;
+  return ModelAPI_ResultBody::group();
 }
 
 void ModelAPI_ResultBody::setDisplayed(const bool theDisplay)
@@ -154,4 +34,3 @@ void ModelAPI_ResultBody::setDisplayed(const bool theDisplay)
   for (int i = 0; i < numberOfSubs(); i++)
     subResult(i)->setDisplayed(theDisplay);
 }
-// LCOV_EXCL_STOP
index 5c19f711ccd2c2f7ec8c8e7f163cec4aa87b8ab9..53cd191097e31ee7d12ec50aeaf8b517eacbf4c4 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef ModelAPI_ResultBody_H_
 #define ModelAPI_ResultBody_H_
 
-#include "ModelAPI_Result.h"
+#include "ModelAPI_ResultMeta.h"
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_DataMapOfShapeShape.h>
 #include <string>
@@ -39,176 +39,39 @@ class GeomAlgoAPI_MakeShape;
 * of result must be optimized.
 * Also provides a container of sub-body result in case it is compound or compsolid.
 */
-class ModelAPI_ResultBody : public ModelAPI_Result
+class ModelAPI_ResultBody : public ModelAPI_ResultMeta
 {
-public:
-  /// Internal enumeration for storage the information of connected topology flag
-  enum ConnectedTopologyFlag {
-    ConnectionNotComputed, ///< not yet computed
-    IsConnected,           ///< the topology is connected
-    IsNotConnected         ///< the topology is connected
-  };
+  public:
+    MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
 
-protected:
-  /// Keeps (not persistently) the connected topology flag
-  ConnectedTopologyFlag myConnect;
+    // /// Returns the group identifier of this result
+    MODELAPI_EXPORT virtual std::string groupName();
 
-  ModelAPI_BodyBuilder* myBuilder; ///< provides the body processing in naming shape
-
-public:
-  MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
-
-  /// Returns the group identifier of this result
-  MODELAPI_EXPORT virtual std::string groupName();
-
-  /// Returns the group identifier of this result
-  inline static std::string group()
-  {
-    static std::string MY_GROUP = "Bodies";
-    return MY_GROUP;
-  }
-
-  /// default color for a result body
-  inline static const std::string& DEFAULT_COLOR()
-  {
-    static const std::string RESULT_BODY_COLOR("200,200,230");
-    return RESULT_BODY_COLOR;
-  }
-
-  /// default deflection for a result body
-  inline static const std::string DEFAULT_DEFLECTION()
-  {
-    return "0.0001";
-  }
-
-  /// Returns the number of sub-elements
-  MODELAPI_EXPORT virtual int numberOfSubs(bool forTree = false) const = 0;
-
-  /// Returns the sub-result by zero-base index
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_ResultBody> subResult(
+    /// Returns the sub-result by zero-base index
+    MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_ResultBody> subResult(
     const int theIndex, bool forTree = false) const = 0;
 
-  /// Returns true if theResult belong to this composite result as sub.
-  /// Returns theIndex - zero based index of sub if found
-  MODELAPI_EXPORT virtual bool isSub(ObjectPtr theResult, int& theIndex) const = 0;
-
-  /// \brief Stores the shape (called by the execution method).
-  /// param[in] theShape shape to store.
-  /// param[in] theIsStoreSameShapes if false stores reference to the same shape
-  ///                                if it is already in document.
-  MODELAPI_EXPORT virtual void store(const GeomShapePtr& theShape,
-                                     const bool theIsStoreSameShapes = true);
-
-  /// Stores the generated shape (called by the execution method).
-  MODELAPI_EXPORT virtual void storeGenerated(const GeomShapePtr& theFromShape,
-                                              const GeomShapePtr& theToShape);
-
-  /// Stores the root modified shapes (called by the execution method).
-  MODELAPI_EXPORT virtual void storeGenerated(
-    const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
-
-  /// Stores the modified shape (called by the execution method).
-  MODELAPI_EXPORT virtual void storeModified(const GeomShapePtr& theOldShape,
-                                             const GeomShapePtr& theNewShape,
-                                             const bool theIsCleanStored = true);
-
-  /// Stores the root modified shapes (called by the execution method).
-  MODELAPI_EXPORT virtual void storeModified(
-    const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
-
-  /// Returns the shape-result produced by this feature
-  MODELAPI_EXPORT virtual GeomShapePtr shape();
-
-  /// Records the subshape newShape which was generated during a topological construction.
-  /// As an example, consider the case of a face generated in construction of a box.
-  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
-  MODELAPI_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
-    const std::string& theName, const bool theCheckIsInResult = true) = 0;
-
-  /// Records the shape newShape which was generated from the shape oldShape during a topological
-  /// construction. As an example, consider the case of a face generated from an edge in
-  /// construction of a prism.
-  MODELAPI_EXPORT virtual void generated(const GeomShapePtr& theOldShape,
-                                         const GeomShapePtr& theNewShape,
-                                         const std::string& theName = "");
-
-  /// Records the shape newShape which is a modification of the shape oldShape.
-  /// As an example, consider the case of a face split or merged in a Boolean operation.
-  MODELAPI_EXPORT virtual void modified(const GeomShapePtr& theOldShape,
-                                        const GeomShapePtr& theNewShape,
-                                        const std::string& theName = "");
-
-  /// load deleted shapes
-  MODELAPI_EXPORT
-  virtual void loadDeletedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                                 const GeomShapePtr& theOldShape,
-                                 const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                 const GeomShapePtr& theShapesToExclude = GeomShapePtr());
-
-  /// load and orient modified shapes
-  MODELAPI_EXPORT
-  virtual void loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                                  const GeomShapePtr& theOldShape,
-                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                  const std::string& theName = "") = 0;
-
-  /// load and orient generated shapes
-  MODELAPI_EXPORT
-  virtual void loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                                   const GeomShapePtr& theOldShape,
-                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                   const std::string& theName = "",
-                                   const bool theSaveOldIfNotInTree = false) = 0;
-
-  /// load shapes of the first level (to be used during shape import)
-  MODELAPI_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape,
-                                              const std::string& theName) = 0;
-
-  /// Returns true is the topology is connected.
-  MODELAPI_EXPORT virtual bool isConnectedTopology() = 0;
-
-  /// Set displayed flag to the result and all sub results
-  /// \param theDisplay a boolean value
-  MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
-
-  /// Updates the sub-bodies if shape of this object is compsolid or compound
-  MODELAPI_EXPORT virtual void updateSubs(const GeomShapePtr& theThisShape,
-    const bool theShapeChanged = true) = 0;
-
-  /// Updates the sub-bodies in accordance to the algorithm history information
-  MODELAPI_EXPORT virtual void updateSubs(
-    const GeomShapePtr& theThisShape, const std::list<GeomShapePtr>& theOlds,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape, const bool isGenerated) = 0;
-
-  /// Cleans cash related to the already stored elements
-  MODELAPI_EXPORT virtual void cleanCash() = 0;
-
-  /// Add shape Name for read shape in step file
-  MODELAPI_EXPORT virtual std::wstring addShapeName
-                              (std::shared_ptr<GeomAPI_Shape>,const std::wstring& theName) = 0;
-
-  /// Add color for shape Name read shape in step file
-  MODELAPI_EXPORT virtual void addShapeColor
-                              (const std::wstring& theName,std::vector<int>& theColor) = 0;
-
-  /// Set the map of name and color read shape in step file
-  MODELAPI_EXPORT virtual void setShapeName
-                          (std::map< std::wstring, std::shared_ptr<GeomAPI_Shape> > &theShapeName,
-                           std::map< std::wstring, std::vector<int>> & theColorsShape) = 0;
-
-  /// Clear the map of name and color read shape in step file
-  MODELAPI_EXPORT virtual void clearShapeNameAndColor() = 0;
+    /// Set displayed flag to the result and all sub results
+    /// \param theDisplay a boolean value
+    MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
 
-  /// find the name of shapp read in step file
-  MODELAPI_EXPORT virtual std::wstring findShapeName(std::shared_ptr<GeomAPI_Shape> theShape) = 0;
+    inline static std::string group()
+    {
+      static std::string MY_GROUP = "Bodies";
+      return MY_GROUP;
+    }
 
+    /// default color for a result volume
+    inline static const std::string DEFAULT_COLOR()
+    {
+      static const std::string RESULT_BODY_COLOR("200,200,230");
+      return RESULT_BODY_COLOR;
+    }
 
-protected:
-  /// Default constructor accessible only from Model_Objects
-  MODELAPI_EXPORT ModelAPI_ResultBody();
 
+  protected:
+    /// Default constructor accessible only from Model_Objects
+    MODELAPI_EXPORT ModelAPI_ResultBody();
 };
 
 //! Pointer on feature object
diff --git a/src/ModelAPI/ModelAPI_ResultMeta.cpp b/src/ModelAPI/ModelAPI_ResultMeta.cpp
new file mode 100644 (file)
index 0000000..337f8f4
--- /dev/null
@@ -0,0 +1,145 @@
+// Copyright (C) 2014-2021  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 "ModelAPI_ResultMeta.h"
+
+#include <ModelAPI_BodyBuilder.h>
+#include <Events_Loop.h>
+#include <ModelAPI_Events.h>
+
+ModelAPI_ResultMeta::ModelAPI_ResultMeta()
+  : myBuilder(0)
+{
+  myConnect = ConnectionNotComputed;
+}
+
+ModelAPI_ResultMeta::~ModelAPI_ResultMeta()
+{
+}
+
+void ModelAPI_ResultMeta::store(const GeomShapePtr& theShape,
+                                const bool theIsStoreSameShapes)
+{
+  myBuilder->store(theShape, theIsStoreSameShapes);
+  myConnect = ConnectionNotComputed;
+
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theShape);
+}
+
+void ModelAPI_ResultMeta::storeGenerated(const GeomShapePtr& theFromShape,
+                                         const GeomShapePtr& theToShape)
+{
+  myBuilder->storeGenerated(theFromShape, theToShape);
+  myConnect = ConnectionNotComputed;
+
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theToShape);
+}
+
+void ModelAPI_ResultMeta::storeGenerated(
+  const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+{
+  myBuilder->storeGenerated(theFromShapes, theToShape, theMakeShape);
+  myConnect = ConnectionNotComputed;
+
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theToShape, theFromShapes, theMakeShape, true);
+}
+
+void ModelAPI_ResultMeta::storeModified(const GeomShapePtr& theOldShape,
+                                        const GeomShapePtr& theNewShape,
+                                        const bool theIsCleanStored)
+{
+  myBuilder->storeModified(theOldShape, theNewShape, theIsCleanStored);
+  myConnect = ConnectionNotComputed;
+
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theNewShape);
+}
+
+void ModelAPI_ResultMeta::storeModified(
+  const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
+  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+{
+  myBuilder->storeModified(theOldShapes, theNewShape, theMakeShape);
+  myConnect = ConnectionNotComputed;
+
+  static Events_Loop* aLoop = Events_Loop::loop();
+  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+  aECreator->sendUpdated(data()->owner(), aRedispEvent);
+
+  updateSubs(theNewShape, theOldShapes, theMakeShape, false);
+}
+
+GeomShapePtr ModelAPI_ResultMeta::shape()
+{
+  return myBuilder->shape();
+}
+
+void ModelAPI_ResultMeta::generated(const GeomShapePtr& theOldShape,
+                                    const GeomShapePtr& theNewShape,
+                                    const std::string& theName)
+{
+  myBuilder->generated(theOldShape, theNewShape, theName);
+}
+
+void ModelAPI_ResultMeta::modified(const GeomShapePtr& theOldShape,
+                                   const GeomShapePtr& theNewShape,
+                                   const std::string& theName)
+{
+  myBuilder->modified(theOldShape, theNewShape, theName);
+}
+
+
+void ModelAPI_ResultMeta::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
+                                            const GeomShapePtr& theOldShape,
+                                            const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                            const GeomShapePtr& theShapesToExclude)
+{
+  myBuilder->loadDeletedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theShapesToExclude);
+}
+
+// LCOV_EXCL_START
+bool ModelAPI_ResultMeta::isConnectedTopology()
+{
+  if (myConnect == ConnectionNotComputed) {
+    myConnect = shape()->isConnectedTopology() ? IsConnected : IsNotConnected;
+  }
+  return myConnect == IsConnected;
+}
+// LCOV_EXCL_STOP
diff --git a/src/ModelAPI/ModelAPI_ResultMeta.h b/src/ModelAPI/ModelAPI_ResultMeta.h
new file mode 100644 (file)
index 0000000..56bfb78
--- /dev/null
@@ -0,0 +1,192 @@
+// Copyright (C) 2014-2021  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 ModelAPI_ResultMeta_H_
+#define ModelAPI_ResultMeta_H_
+
+#include "ModelAPI_Result.h"
+#include <GeomAPI_Shape.h>
+#include <GeomAPI_DataMapOfShapeShape.h>
+#include <string>
+#include <map>
+#include <vector>
+
+class ModelAPI_BodyBuilder;
+class GeomAlgoAPI_MakeShape;
+
+/**\class ModelAPI_ResultMeta
+* \ingroup DataModel
+* \brief The body (shape) result of a feature.
+*
+* Provides a shape that may be displayed in the viewer.
+* May provide really huge results, so, working with this kind
+* of result must be optimized.
+* Also provides a container of sub-body result in case it is compound or compsolid.
+*/
+class ModelAPI_ResultMeta : public ModelAPI_Result
+{
+public:
+  /// Internal enumeration for storage the information of connected topology flag
+  enum ConnectedTopologyFlag {
+    ConnectionNotComputed, ///< not yet computed
+    IsConnected,           ///< the topology is connected
+    IsNotConnected         ///< the topology is connected
+  };
+
+protected:
+  /// Keeps (not persistently) the connected topology flag
+  ConnectedTopologyFlag myConnect;
+
+  ModelAPI_BodyBuilder* myBuilder; ///< provides the body processing in naming shape
+
+public:
+  /// default deflection for a result body
+  inline static const std::string DEFAULT_DEFLECTION()
+  {
+    return "0.0001";
+  }
+
+  MODELAPI_EXPORT virtual ~ModelAPI_ResultMeta();
+
+  /// Returns the number of sub-elements
+  MODELAPI_EXPORT virtual int numberOfSubs(bool forTree = false) const = 0;
+
+  /// Returns true if theResult belong to this composite result as sub.
+  /// Returns theIndex - zero based index of sub if found
+  MODELAPI_EXPORT virtual bool isSub(ObjectPtr theResult, int& theIndex) const = 0;
+
+  /// \brief Stores the shape (called by the execution method).
+  /// param[in] theShape shape to store.
+  /// param[in] theIsStoreSameShapes if false stores reference to the same shape
+  ///                                if it is already in document.
+  MODELAPI_EXPORT virtual void store(const GeomShapePtr& theShape,
+                                     const bool theIsStoreSameShapes = true);
+
+  /// Stores the generated shape (called by the execution method).
+  MODELAPI_EXPORT virtual void storeGenerated(const GeomShapePtr& theFromShape,
+                                              const GeomShapePtr& theToShape);
+
+  /// Stores the root modified shapes (called by the execution method).
+  MODELAPI_EXPORT virtual void storeGenerated(
+    const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
+
+  /// Stores the modified shape (called by the execution method).
+  MODELAPI_EXPORT virtual void storeModified(const GeomShapePtr& theOldShape,
+                                             const GeomShapePtr& theNewShape,
+                                             const bool theIsCleanStored = true);
+
+  /// Stores the root modified shapes (called by the execution method).
+  MODELAPI_EXPORT virtual void storeModified(
+    const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
+
+  /// Returns the shape-result produced by this feature
+  MODELAPI_EXPORT virtual GeomShapePtr shape();
+
+  /// Records the subshape newShape which was generated during a topological construction.
+  /// As an example, consider the case of a face generated in construction of a box.
+  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
+  MODELAPI_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
+    const std::string& theName, const bool theCheckIsInResult = true) = 0;
+
+  /// Records the shape newShape which was generated from the shape oldShape during a topological
+  /// construction. As an example, consider the case of a face generated from an edge in
+  /// construction of a prism.
+  MODELAPI_EXPORT virtual void generated(const GeomShapePtr& theOldShape,
+                                         const GeomShapePtr& theNewShape,
+                                         const std::string& theName = "");
+
+  /// Records the shape newShape which is a modification of the shape oldShape.
+  /// As an example, consider the case of a face split or merged in a Boolean operation.
+  MODELAPI_EXPORT virtual void modified(const GeomShapePtr& theOldShape,
+                                        const GeomShapePtr& theNewShape,
+                                        const std::string& theName = "");
+
+  /// load deleted shapes
+  MODELAPI_EXPORT
+  virtual void loadDeletedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                 const GeomShapePtr& theOldShape,
+                                 const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                 const GeomShapePtr& theShapesToExclude = GeomShapePtr());
+
+  /// load and orient modified shapes
+  MODELAPI_EXPORT
+  virtual void loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                  const GeomShapePtr& theOldShape,
+                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                  const std::string& theName = "") = 0;
+
+  /// load and orient generated shapes
+  MODELAPI_EXPORT
+  virtual void loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                   const GeomShapePtr& theOldShape,
+                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                   const std::string& theName = "",
+                                   const bool theSaveOldIfNotInTree = false) = 0;
+
+  /// load shapes of the first level (to be used during shape import)
+  MODELAPI_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape,
+                                              const std::string& theName) = 0;
+
+  /// Returns true is the topology is connected.
+  MODELAPI_EXPORT virtual bool isConnectedTopology() = 0;
+
+  /// Updates the sub-bodies if shape of this object is compsolid or compound
+  MODELAPI_EXPORT virtual void updateSubs(const GeomShapePtr& theThisShape,
+    const bool theShapeChanged = true) = 0;
+
+  /// Updates the sub-bodies in accordance to the algorithm history information
+  MODELAPI_EXPORT virtual void updateSubs(
+    const GeomShapePtr& theThisShape, const std::list<GeomShapePtr>& theOlds,
+    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape, const bool isGenerated) = 0;
+
+  /// Cleans cash related to the already stored elements
+  MODELAPI_EXPORT virtual void cleanCash() = 0;
+
+  /// Add shape Name for read shape in step file
+  MODELAPI_EXPORT virtual std::wstring addShapeName
+                              (std::shared_ptr<GeomAPI_Shape>,const std::wstring& theName) = 0;
+
+  /// Add color for shape Name read shape in step file
+  MODELAPI_EXPORT virtual void addShapeColor
+                              (const std::wstring& theName,std::vector<int>& theColor) = 0;
+
+  /// Set the map of name and color read shape in step file
+  MODELAPI_EXPORT virtual void setShapeName
+                          (std::map< std::wstring, std::shared_ptr<GeomAPI_Shape> > &theShapeName,
+                           std::map< std::wstring, std::vector<int>> & theColorsShape) = 0;
+
+  /// Clear the map of name and color read shape in step file
+  MODELAPI_EXPORT virtual void clearShapeNameAndColor() = 0;
+
+  /// find the name of shapp read in step file
+  MODELAPI_EXPORT virtual std::wstring findShapeName(std::shared_ptr<GeomAPI_Shape> theShape) = 0;
+
+
+protected:
+  /// Default constructor accessible only from Model_Objects
+  MODELAPI_EXPORT ModelAPI_ResultMeta();
+
+};
+
+//! Pointer on feature object
+typedef std::shared_ptr<ModelAPI_ResultMeta> ResultMetaPtr;
+
+#endif
index 39537a7d16e7c25e6db70a11d0902a01c58552bf..99175e884e210e0c49b8c533a5004257a5ce4d83 100644 (file)
 
 #include "ModelAPI_ResultVolume.h"
 
-#include <ModelAPI_BodyBuilder.h>
-#include <Events_Loop.h>
-#include <ModelAPI_Events.h>
+ModelAPI_ResultVolume::ModelAPI_ResultVolume() {}
 
-ModelAPI_ResultVolume::ModelAPI_ResultVolume()
-  : myBuilder(0)
-{
-  myConnect = ConnectionNotComputed;
-}
-
-ModelAPI_ResultVolume::~ModelAPI_ResultVolume()
-{
-}
+ModelAPI_ResultVolume::~ModelAPI_ResultVolume() {}
 
 std::string ModelAPI_ResultVolume::groupName()
 {
-  return group();
-}
-
-void ModelAPI_ResultVolume::store(const GeomShapePtr& theShape,
-                                const bool theIsStoreSameShapes)
-{
-  myBuilder->store(theShape, theIsStoreSameShapes);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theShape);
-}
-
-void ModelAPI_ResultVolume::storeGenerated(const GeomShapePtr& theFromShape,
-                                         const GeomShapePtr& theToShape)
-{
-  myBuilder->storeGenerated(theFromShape, theToShape);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theToShape);
-}
-
-void ModelAPI_ResultVolume::storeGenerated(
-  const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
-  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
-{
-  myBuilder->storeGenerated(theFromShapes, theToShape, theMakeShape);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theToShape, theFromShapes, theMakeShape, true);
-}
-
-void ModelAPI_ResultVolume::storeModified(const GeomShapePtr& theOldShape,
-                                        const GeomShapePtr& theNewShape,
-                                        const bool theIsCleanStored)
-{
-  myBuilder->storeModified(theOldShape, theNewShape, theIsCleanStored);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theNewShape);
-}
-
-void ModelAPI_ResultVolume::storeModified(
-  const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
-  const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
-{
-  myBuilder->storeModified(theOldShapes, theNewShape, theMakeShape);
-  myConnect = ConnectionNotComputed;
-
-  static Events_Loop* aLoop = Events_Loop::loop();
-  static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  aECreator->sendUpdated(data()->owner(), aRedispEvent);
-
-  updateSubs(theNewShape, theOldShapes, theMakeShape, false);
-}
-
-GeomShapePtr ModelAPI_ResultVolume::shape()
-{
-  return myBuilder->shape();
-}
-
-void ModelAPI_ResultVolume::generated(const GeomShapePtr& theOldShape,
-                                    const GeomShapePtr& theNewShape,
-                                    const std::string& theName)
-{
-  myBuilder->generated(theOldShape, theNewShape, theName);
-}
-
-void ModelAPI_ResultVolume::modified(const GeomShapePtr& theOldShape,
-                                   const GeomShapePtr& theNewShape,
-                                   const std::string& theName)
-{
-  myBuilder->modified(theOldShape, theNewShape, theName);
-}
-
-
-void ModelAPI_ResultVolume::loadDeletedShapes(const GeomMakeShapePtr& theAlgo,
-                                            const GeomShapePtr& theOldShape,
-                                            const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                            const GeomShapePtr& theShapesToExclude)
-{
-  myBuilder->loadDeletedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theShapesToExclude);
-}
-
-// LCOV_EXCL_START
-bool ModelAPI_ResultVolume::isConnectedTopology()
-{
-  if (myConnect == ConnectionNotComputed) {
-    myConnect = shape()->isConnectedTopology() ? IsConnected : IsNotConnected;
-  }
-  return myConnect == IsConnected;
+  return ModelAPI_ResultVolume::group();
 }
 
 void ModelAPI_ResultVolume::setDisplayed(const bool theDisplay)
@@ -154,4 +34,3 @@ void ModelAPI_ResultVolume::setDisplayed(const bool theDisplay)
   for (int i = 0; i < numberOfSubs(); i++)
     subResult(i)->setDisplayed(theDisplay);
 }
-// LCOV_EXCL_STOP
index 3bf86b1a61469597eaa8c3ae53d56662483ae39e..e8c0cd2761ce92919339ea59dc1f2168160e7710 100644 (file)
 #ifndef ModelAPI_ResultVolume_H_
 #define ModelAPI_ResultVolume_H_
 
-#include "ModelAPI_Result.h"
-#include <GeomAPI_Shape.h>
-#include <GeomAPI_DataMapOfShapeShape.h>
-#include <string>
-#include <map>
-#include <vector>
-
-class ModelAPI_BodyBuilder;
-class GeomAlgoAPI_MakeShape;
+#include "ModelAPI_ResultMeta.h"
 
 /**\class ModelAPI_ResultVolume
 * \ingroup DataModel
@@ -39,175 +31,39 @@ class GeomAlgoAPI_MakeShape;
 * of result must be optimized.
 * Also provides a container of sub-body result in case it is compound or compsolid.
 */
-class ModelAPI_ResultVolume : public ModelAPI_Result
+class ModelAPI_ResultVolume : public ModelAPI_ResultMeta
 {
-public:
-  /// Internal enumeration for storage the information of connected topology flag
-  enum ConnectedTopologyFlag {
-    ConnectionNotComputed, ///< not yet computed
-    IsConnected,           ///< the topology is connected
-    IsNotConnected         ///< the topology is connected
-  };
-
-protected:
-  /// Keeps (not persistently) the connected topology flag
-  ConnectedTopologyFlag myConnect;
-
-  ModelAPI_BodyBuilder* myBuilder; ///< provides the body processing in naming shape
-
-public:
-  MODELAPI_EXPORT virtual ~ModelAPI_ResultVolume();
-
-  /// Returns the group identifier of this result
-  MODELAPI_EXPORT virtual std::string groupName();
+  public:
+    MODELAPI_EXPORT virtual ~ModelAPI_ResultVolume();
 
-  /// Returns the group identifier of this result
-  inline static std::string group()
-  {
-    static std::string MY_GROUP = "Volumes";
-    return MY_GROUP;
-  }
+    /// Returns the group identifier of this result
+    MODELAPI_EXPORT std::string groupName();
 
-  /// default color for a result body
-  inline static const std::string& DEFAULT_COLOR()
-  {
-    static const std::string RESULT_BODY_COLOR("200,200,230");
-    return RESULT_BODY_COLOR;
-  }
-
-  /// default deflection for a result body
-  inline static const std::string DEFAULT_DEFLECTION()
-  {
-    return "0.0001";
-  }
-
-  /// Returns the number of sub-elements
-  MODELAPI_EXPORT virtual int numberOfSubs(bool forTree = false) const = 0;
-
-  /// Returns the sub-result by zero-base index
-  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_ResultVolume> subResult(
+    /// Returns the sub-result by zero-base index
+    MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_ResultVolume> subResult(
     const int theIndex, bool forTree = false) const = 0;
 
-  /// Returns true if theResult belong to this composite result as sub.
-  /// Returns theIndex - zero based index of sub if found
-  MODELAPI_EXPORT virtual bool isSub(ObjectPtr theResult, int& theIndex) const = 0;
-
-  /// \brief Stores the shape (called by the execution method).
-  /// param[in] theShape shape to store.
-  /// param[in] theIsStoreSameShapes if false stores reference to the same shape
-  ///                                if it is already in document.
-  MODELAPI_EXPORT virtual void store(const GeomShapePtr& theShape,
-                                     const bool theIsStoreSameShapes = true);
-
-  /// Stores the generated shape (called by the execution method).
-  MODELAPI_EXPORT virtual void storeGenerated(const GeomShapePtr& theFromShape,
-                                              const GeomShapePtr& theToShape);
-
-  /// Stores the root modified shapes (called by the execution method).
-  MODELAPI_EXPORT virtual void storeGenerated(
-    const std::list<GeomShapePtr>& theFromShapes, const GeomShapePtr& theToShape,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
-
-  /// Stores the modified shape (called by the execution method).
-  MODELAPI_EXPORT virtual void storeModified(const GeomShapePtr& theOldShape,
-                                             const GeomShapePtr& theNewShape,
-                                             const bool theIsCleanStored = true);
-
-  /// Stores the root modified shapes (called by the execution method).
-  MODELAPI_EXPORT virtual void storeModified(
-    const std::list<GeomShapePtr>& theOldShapes, const GeomShapePtr& theNewShape,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
-
-  /// Returns the shape-result produced by this feature
-  MODELAPI_EXPORT virtual GeomShapePtr shape();
-
-  /// Records the subshape newShape which was generated during a topological construction.
-  /// As an example, consider the case of a face generated in construction of a box.
-  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
-  MODELAPI_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
-    const std::string& theName, const bool theCheckIsInResult = true) = 0;
-
-  /// Records the shape newShape which was generated from the shape oldShape during a topological
-  /// construction. As an example, consider the case of a face generated from an edge in
-  /// construction of a prism.
-  MODELAPI_EXPORT virtual void generated(const GeomShapePtr& theOldShape,
-                                         const GeomShapePtr& theNewShape,
-                                         const std::string& theName = "");
-
-  /// Records the shape newShape which is a modification of the shape oldShape.
-  /// As an example, consider the case of a face split or merged in a Boolean operation.
-  MODELAPI_EXPORT virtual void modified(const GeomShapePtr& theOldShape,
-                                        const GeomShapePtr& theNewShape,
-                                        const std::string& theName = "");
-
-  /// load deleted shapes
-  MODELAPI_EXPORT
-  virtual void loadDeletedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                                 const GeomShapePtr& theOldShape,
-                                 const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                 const GeomShapePtr& theShapesToExclude = GeomShapePtr());
-
-  /// load and orient modified shapes
-  MODELAPI_EXPORT
-  virtual void loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                                  const GeomShapePtr& theOldShape,
-                                  const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                  const std::string& theName = "") = 0;
-
-  /// load and orient generated shapes
-  MODELAPI_EXPORT
-  virtual void loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
-                                   const GeomShapePtr& theOldShape,
-                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                   const std::string& theName = "",
-                                   const bool theSaveOldIfNotInTree = false) = 0;
-
-  /// load shapes of the first level (to be used during shape import)
-  MODELAPI_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape,
-                                              const std::string& theName) = 0;
-
-  /// Returns true is the topology is connected.
-  MODELAPI_EXPORT virtual bool isConnectedTopology() = 0;
-
-  /// Set displayed flag to the result and all sub results
-  /// \param theDisplay a boolean value
-  MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
-
-  /// Updates the sub-bodies if shape of this object is compsolid or compound
-  MODELAPI_EXPORT virtual void updateSubs(const GeomShapePtr& theThisShape,
-    const bool theShapeChanged = true) = 0;
-
-  /// Updates the sub-bodies in accordance to the algorithm history information
-  MODELAPI_EXPORT virtual void updateSubs(
-    const GeomShapePtr& theThisShape, const std::list<GeomShapePtr>& theOlds,
-    const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape, const bool isGenerated) = 0;
-
-  /// Cleans cash related to the already stored elements
-  MODELAPI_EXPORT virtual void cleanCash() = 0;
-
-  /// Add shape Name for read shape in step file
-  MODELAPI_EXPORT virtual std::wstring addShapeName
-                              (std::shared_ptr<GeomAPI_Shape>,const std::wstring& theName) = 0;
-
-  /// Add color for shape Name read shape in step file
-  MODELAPI_EXPORT virtual void addShapeColor
-                              (const std::wstring& theName,std::vector<int>& theColor) = 0;
-
-  /// Set the map of name and color read shape in step file
-  MODELAPI_EXPORT virtual void setShapeName
-                          (std::map< std::wstring, std::shared_ptr<GeomAPI_Shape> > &theShapeName,
-                           std::map< std::wstring, std::vector<int>> & theColorsShape) = 0;
-
-  /// Clear the map of name and color read shape in step file
-  MODELAPI_EXPORT virtual void clearShapeNameAndColor() = 0;
-
-  /// find the name of shapp read in step file
-  MODELAPI_EXPORT virtual std::wstring findShapeName(std::shared_ptr<GeomAPI_Shape> theShape) = 0;
-
-
-protected:
-  /// Default constructor accessible only from Model_Objects
-  MODELAPI_EXPORT ModelAPI_ResultVolume();
+    /// Set displayed flag to the result and all sub results
+    /// \param theDisplay a boolean value
+    MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay);
+
+    /// Returns the group identifier of this result
+    inline static std::string group()
+    {
+      static std::string MY_GROUP = "Volumes";
+      return MY_GROUP;
+    }
+
+    /// default color for a result volume
+    inline static const std::string DEFAULT_COLOR()
+    {
+      static const std::string RESULT_VOLUME_COLOR("102,0,204");
+      return RESULT_VOLUME_COLOR;
+    }
+
+  protected:
+    /// Default constructor accessible only from Model_Objects
+    MODELAPI_EXPORT ModelAPI_ResultVolume();
 
 };
 
index 75e2068b877bbd1810e0bd32eb0d210069b3f893..a75ae9b4352b2340c2ea409c244b27067a8e8478 100644 (file)
@@ -42,6 +42,7 @@
 #include <ModelAPI_Events.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultMeta.h>
 #include <ModelAPI_ResultConstruction.h>
 
 #include <Config_ModuleReader.h>