]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_ResultCompSolid.h
Salome HOME
Speed-up of the access from OB to complicated compsolids in the frames of issue ...
[modules/shaper.git] / src / Model / Model_ResultCompSolid.h
index 7fcf5cc59bae616da02259d634912179528e381b..c748aeeae3800401f93f8124c0d6d19e8378d285 100755 (executable)
@@ -24,6 +24,7 @@
 #include "Model.h"
 #include <ModelAPI_ResultCompSolid.h>
 #include <vector>
+#include <map>
 
 /**\class Model_ResultCompSolid
 * \ingroup DataModel
@@ -35,6 +36,8 @@ class Model_ResultCompSolid : public ModelAPI_ResultCompSolid
 {
   /// Sub-bodies if this is compsolid: zero base index to subs
   std::vector<std::shared_ptr<ModelAPI_ResultBody> > mySubs;
+  /// Also keep map of result to index in mySubs to facilitate speed of access from OB
+  std::map<ObjectPtr, int> mySubsMap;
   /// Flag that stores the previous state of "concealed": if it is changed,
   /// The event must be generated to redisplay this and all subs.
   bool myLastConcealed;
@@ -74,7 +77,8 @@ public:
     bool forTree = false) const;
 
   /// Returns true if feature or reuslt belong to this composite feature as subs
-  MODEL_EXPORT virtual bool isSub(ObjectPtr theObject) const;
+  /// Returns theIndex - zero based index of sub if found
+  MODEL_EXPORT virtual bool isSub(ObjectPtr theObject, int& theIndex) const;
 
   /// Returns the parameters of color definition in the resources config manager
   MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,