]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 26 Dec 2014 14:18:25 +0000 (17:18 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 26 Dec 2014 14:18:25 +0000 (17:18 +0300)
15 files changed:
src/Config/Config_Common.cpp
src/Config/Config_Common.h
src/Config/Config_Keywords.h
src/Config/Config_ModuleReader.cpp
src/Config/Config_ModuleReader.h
src/Config/plugins.xml
src/ConnectorPlugin/plugin-Connector.xml
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_icons.qrc
src/PartSet/icons/geom_export.png [new file with mode: 0644]
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h
src/XGUI/XGUI_Selection.cpp
src/XGUI/XGUI_Selection.h

index 634a4337ff73b7c0eb0c92d9eedf9581eece9798..2da152dccd3c9ea4271fb4066786e624f68c62af 100644 (file)
@@ -130,8 +130,7 @@ std::string getProperty(xmlNodePtr theNode, const char* thePropName)
 \r
 bool getBooleanAttribute(xmlNodePtr theNode, const char* theAttributeName, bool theDefault)\r
 {\r
-  std::string prop = getProperty(theNode, theAttributeName);\r
-  std::transform(prop.begin(), prop.end(), prop.begin(), ::tolower);\r
+  std::string prop = normalize(getProperty(theNode, theAttributeName));\r
   bool result = theDefault;\r
   if (prop == "true" || prop == "1") {\r
     result = true;\r
@@ -140,3 +139,17 @@ bool getBooleanAttribute(xmlNodePtr theNode, const char* theAttributeName, bool
   }\r
   return result;\r
 }\r
+\r
+CONFIG_EXPORT std::string normalize(const char* theString)\r
+{\r
+  if (!theString)\r
+    return std::string();\r
+  return normalize(std::string(theString));\r
+}\r
+\r
+CONFIG_EXPORT std::string normalize(const std::string& theString)\r
+{\r
+  std::string result = theString;\r
+  std::transform(result.begin(), result.end(), result.begin(), ::tolower);\r
+  return result;\r
+}\r
index 05e2024fd2d049eee678883a1fd34b9d6da8c4dd..a2cc7884378b87a13006242531dc20f146aa88fb 100644 (file)
@@ -93,4 +93,11 @@ CONFIG_EXPORT bool getBooleanAttribute(xmlNodePtr theNode,
                                        const char* theAttributeName,
                                        bool theDefault);
 
+/*
+ * Returns normalized (lower case) version of string.
+ * Should be used for case insensitive string matching.
+ */
+CONFIG_EXPORT std::string normalize(const char* theString);
+CONFIG_EXPORT std::string normalize(const std::string& theString);
+
 #endif
index bc9f4e419bae005781f5767e4311b8ba6526534d..9fe94e769dc6cbd07a3c6da72937277dcafa1c6f 100644 (file)
@@ -84,5 +84,11 @@ const static char* PLUGINS_MODULE = "module";
 const static char* PLUGIN_CONFIG = "configuration";
 const static char* PLUGIN_LIBRARY = "library";
 const static char* PLUGIN_SCRIPT = "script";
+const static char* PLUGIN_PLATFORM = "platform";
+
+const static char* PLUGIN_PLATFORM_SALOME = "salome";
+const static char* PLUGIN_PLATFORM_NEWGEOM = "openparts";
+
+
 
 #endif /* CONFIG_KEYWORDS_H_ */
index 21925af599b1b91fca64131371d931ed98ad6443..d0da80ba0a8f0914a27ea7baa8706096f209f066 100644 (file)
 
 //Necessary for cerr
 #include <iostream>
+#include <algorithm>
 
 #ifdef WIN32
 #include <windows.h>
+#pragma warning(disable : 4996) // for getenv
 #else
 #include <dlfcn.h>
 #endif
@@ -34,6 +36,13 @@ Config_ModuleReader::Config_ModuleReader(const char* theEventGenerated)
     : Config_XMLReader(PLUGIN_FILE),
       myEventGenerated(theEventGenerated)
 {
+  myHaveSalome = false;
+  char* anEnv = getenv("SALOME_ROOT_DIR");
+  std::string value = normalize(anEnv);
+  if (!value.empty()) {
+    myHaveSalome = true;
+  }
+
 }
 
 Config_ModuleReader::~Config_ModuleReader()
@@ -61,6 +70,9 @@ std::string Config_ModuleReader::getModuleName()
 void Config_ModuleReader::processNode(xmlNodePtr theNode)
 {
   if (isNode(theNode, NODE_PLUGIN, NULL)) {
+    bool isAvailable = isAvaliableOnThisPlatform(getProperty(theNode, PLUGIN_PLATFORM));
+    if (!isAvailable)
+      return;
     std::string aPluginConf = getProperty(theNode, PLUGIN_CONFIG);
     std::string aPluginLibrary = getProperty(theNode, PLUGIN_LIBRARY);
     std::string aPluginScript = getProperty(theNode, PLUGIN_SCRIPT);
@@ -111,8 +123,8 @@ std::string Config_ModuleReader::addPlugin(const std::string& aPluginLibrary,
   }
   if(!aPluginName.empty()) {
     myPluginTypes[aPluginName] = aType;
-
   }
+
   return aPluginName;
 }
 
@@ -134,6 +146,29 @@ void Config_ModuleReader::loadPlugin(const std::string thePluginName)
   }
 }
 
+bool Config_ModuleReader::isAvaliableOnThisPlatform(const std::string& thePluginPlatform)
+{
+  bool result = true;
+  PluginPlatform aPlatform = All;
+  std::string aPlatformName = normalize(thePluginPlatform) ;
+  if (aPlatformName == PLUGIN_PLATFORM_SALOME) {
+    aPlatform = Salome;
+  } else if (aPlatformName == PLUGIN_PLATFORM_NEWGEOM) {
+    aPlatform = OpenParts;
+  } else if (!thePluginPlatform.empty()) {
+    Events_Error::send("Unknown platform: " + thePluginPlatform);
+  }
+  if (aPlatform == All) {
+    result = true;
+  } else if (myHaveSalome) {
+    result = aPlatform == Salome;
+  } else {
+    result = aPlatform == OpenParts;
+  }
+  return result;
+
+}
+
 void Config_ModuleReader::loadScript(const std::string theFileName)
 {
   /* aquire python thread */
index 2281eb5cd33910e46bd16949e25b8b8b7afe6f7e..c32eb37d96f566b537068a45f614dbef66e513e9 100644 (file)
@@ -24,6 +24,11 @@ class Config_ModuleReader : public Config_XMLReader
     Intrenal = 1,
     Python = 2
   };
+  enum PluginPlatform {
+    All = 0,
+    OpenParts = 1,
+    Salome = 2
+  };
 
  public:
   CONFIG_EXPORT Config_ModuleReader(const char* theEventGenerated = 0);
@@ -43,6 +48,7 @@ class Config_ModuleReader : public Config_XMLReader
   void processNode(xmlNodePtr aNode);
   bool processChildren(xmlNodePtr aNode);
 
+  bool isAvaliableOnThisPlatform(const std::string& thePluginPlatform);
   std::list<std::string> importPlugin(const std::string& thePluginLibrary,
                                       const std::string& thePluginFile);
   std::string addPlugin(const std::string& aPluginLibrary,
@@ -53,6 +59,7 @@ class Config_ModuleReader : public Config_XMLReader
   std::map<std::string, std::string> myFeaturesInFiles;
   static std::map<std::string, PluginType> myPluginTypes;
   const char* myEventGenerated;
+  bool myHaveSalome;
 
 };
 
index 00f45dba9e9c5d1a49d53e88c56292926a490c36..0f4a255863c57a284c85359a9f0025f3b850b54f 100644 (file)
@@ -6,7 +6,7 @@
   <plugin library="ConstructionPlugin" configuration="plugin-Construction.xml"/>
   <plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
   <plugin library="ExchangePlugin" configuration="plugin-Exchange.xml"/>
-  <plugin script="ConnectorPlugin" configuration="plugin-Connector.xml"/>
+  <plugin script="ConnectorPlugin" configuration="plugin-Connector.xml" platform="Salome"/>
   <plugin library="SketchSolver"/>
   <plugin library="GeomValidators"/>
   <plugin library="DFBrowser" internal="true"/>
index 2ba73b20330f1ba8a84f9565c96d9e67e16a8d53..638d4ecb74bfcc5949b60c7b486abab6ceaeac9a 100644 (file)
@@ -5,7 +5,7 @@
         id="ExportToGEOM"
         title="Export to GEOM"
         tooltip="Exports all bodies into GEOM module"
-        icon=":pictures/part_ico.png"/>
+        icon=":icons/geom_export.png"/>
     </group>
   </workbench>
 </plugin>
\ No newline at end of file
index 403fb7b1f7cd7f9db785ca104cdab73d93154c2d..edc27e0b7ae1e236a16dc66cbb3ee53ee70b27d8 100644 (file)
@@ -12,6 +12,7 @@
 #include <XGUI_ModuleConnector.h>
 #include <XGUI_Displayer.h>
 #include <XGUI_Workshop.h>
+#include <XGUI_Selection.h>
 
 #include <ModuleBase_IViewer.h>
 #include <ModuleBase_IWorkshop.h>
@@ -35,6 +36,9 @@
 #include <SketchPlugin_ConstraintRadius.h>
 #include <SketchPlugin_ConstraintRigid.h>
 
+#include <SelectMgr_IndexedMapOfOwner.hxx>
+#include <StdSelect_BRepOwner.hxx>
+
 #include <ModelAPI_Events.h>
 
 #include <QMouseEvent>
@@ -265,10 +269,46 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve
         std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
           std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
         if (aSketchFeature) { 
+          // save the previous selection
+          /*ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
+          XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
+          XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+          QIntList anActivatedModes;
+
+          ResultPtr aResult = aSketchFeature->firstResult();
+
+          aDisplayer->getModesOfActivation(aResult, anActivatedModes);
+
+          std::list<AttributePtr> aSelectedAttributes;
+          getCurrentSelection(aSketchFeature, myCurrentSketch, aWorkshop, aSelectedAttributes);*/
+          // save the previous selection: end
+
+
           aSketchFeature->move(dX, dY);
           ModelAPI_EventCreator::get()->sendUpdated(aSketchFeature, anEvent);
+          /*
+          // TODO: the selection restore should be after the AIS presentation is rebuilt
+          Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_MOVED));
+          Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+
+          // restore the previous selection
+          aResult = aSketchFeature->firstResult();
+            aDisplayer->activate(aResult, anActivatedModes);
+
+          SelectMgr_IndexedMapOfOwner anOwnersToSelect;
+          getSelectionOwners(aSketchFeature, myCurrentSketch, aWorkshop, aSelectedAttributes,
+                             anOwnersToSelect);
+          
+          ModuleBase_IViewer* aViewer = aWorkshop->viewer();
+          Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+          for (Standard_Integer i = 1, n = anOwnersToSelect.Extent(); i <= n; i++)
+            aContext->AddOrRemoveSelected(anOwnersToSelect(i), false); // SetSelected()
+
+          aContext->UpdateCurrentViewer();
+          // restore the previous selection*/
         }
       }
+      // TODO: set here
       Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_MOVED));
       Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
     }
@@ -417,3 +457,99 @@ void PartSet_SketcherMgr::onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& th
 {
   myPlaneFilter->setPlane(thePln->impl<gp_Pln>());
 }
+
+void PartSet_SketcherMgr::getCurrentSelection(const ObjectPtr& theObject,
+                                              const FeaturePtr& theSketch,
+                                              ModuleBase_IWorkshop* theWorkshop,
+                                              std::list<AttributePtr>& theSelectedAttributes)
+{
+  FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+  if (aFeature.get() == NULL)
+    return;
+
+  ModuleBase_IViewer* aViewer = theWorkshop->viewer();
+  Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+  XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
+  XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+
+  // TODO: check all results and IPresentable feature
+  ResultPtr aResult = aFeature->firstResult();
+
+  bool isVisibleSketch = aDisplayer->isVisible(aResult);
+  AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult);
+
+  if (aAISObj.get() != NULL) {
+    Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+    for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
+    {
+      Handle(StdSelect_BRepOwner) aBRepOwner = Handle(StdSelect_BRepOwner)::DownCast(
+                                                                      aContext->SelectedOwner());
+      if (aBRepOwner.IsNull()) continue;
+
+      Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(
+                                                                       aBRepOwner->Selectable());
+      if (anIO != anAISIO) continue;
+
+      if (aBRepOwner->HasShape()) {
+        const TopoDS_Shape& aShape = aBRepOwner->Shape();
+        TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
+        if (aShapeType == TopAbs_VERTEX) {
+          AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(theObject,
+                                                                        aShape, theSketch);
+          if (aPntAttr.get() != NULL)
+            theSelectedAttributes.push_back(aPntAttr);
+        }
+      }
+    }
+  }
+}
+
+void PartSet_SketcherMgr::getSelectionOwners(const ObjectPtr& theObject,
+                                             const FeaturePtr& theSketch,
+                                             ModuleBase_IWorkshop* theWorkshop,
+                                             const std::list<AttributePtr>& theSelectedAttributes,
+                                             SelectMgr_IndexedMapOfOwner& anOwnersToSelect)
+{
+  FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+  if (aFeature.get() == NULL)
+    return;
+
+  ModuleBase_IViewer* aViewer = theWorkshop->viewer();
+  Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+  XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWorkshop);
+  XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+
+  // TODO: check all results and IPresentable feature
+  ResultPtr aResult = aFeature->firstResult();
+
+  bool isVisibleSketch = aDisplayer->isVisible(aResult);
+  AISObjectPtr aAISObj = aDisplayer->getAISObject(aResult);
+
+  if (aAISObj.get() != NULL) {
+    Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+
+    SelectMgr_IndexedMapOfOwner aSelectedOwners;
+
+    XGUI_Selection::entityOwners(anAISIO, aContext, aSelectedOwners);
+    for  ( Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++ ) {
+      Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(aSelectedOwners(i));
+      if ( anOwner.IsNull() || !anOwner->HasShape() )
+        continue;
+      const TopoDS_Shape& aShape = anOwner->Shape();
+      TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
+      if (aShapeType == TopAbs_VERTEX) {
+        AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(aFeature, aShape, theSketch);
+        if (aPntAttr.get() != NULL) {
+          std::list<AttributePtr>::const_iterator anIt = theSelectedAttributes.begin(),
+                                                  aLast = theSelectedAttributes.end();
+          for (; anIt != aLast; anIt++) {
+            AttributePtr anAttrIt = *anIt;
+            if (anAttrIt.get() == aPntAttr.get()) {
+              anOwnersToSelect.Add(anOwner);
+            }
+          }
+        }
+      }
+    }
+  }
+}
index 81315782944fa4a930e9a74d642790d44ccc781e..9c79ee43781b9e707e7d8babd0cd6807999e2d7b 100644 (file)
 #include <ModelAPI_CompositeFeature.h>
 
 #include <ModuleBase_ViewerFilters.h>
+#include <ModuleBase_Definitions.h>
 
 #include <GeomAPI_Pln.h>
+#include <SelectMgr_IndexedMapOfOwner.hxx>
 
 #include <QObject>
 #include <QList>
@@ -67,6 +69,32 @@ private:
   void get2dPoint(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent, 
                   double& theX, double& theY);
 
+  /// Obtains the current selection of the object in the workshop viewer 
+  /// It includes the selection in all modes of activation, even local context - vertexes, edges
+  /// The result is a list of attributes of the feature of the object
+  /// In addition, it retuns a list of selection modes, where the object is activated
+  /// \param theObject a feature or result object
+  /// \param theSketch a current sketch feature
+  /// \param theWorkshop a workshop to have an access to AIS context and displayer
+  /// \param theSelectedAttributes an out list of selected attributes
+  static void getCurrentSelection(const ObjectPtr& theObject,
+                                  const FeaturePtr& theSketch,
+                                  ModuleBase_IWorkshop* theWorkshop,
+                                  std::list<AttributePtr>& theSelectedAttributes);
+
+  /// Applyes the current selection to the object in the workshop viewer 
+  /// It includes the selection in all modes of activation, even local context - vertexes, edges
+  /// The result is a list of attributes of the feature of the object
+  /// In addition, it retuns a list of selection modes, where the object is activated
+  /// \param theObject a feature or result object
+  /// \param theSketch a current sketch feature
+  /// \param theWorkshop a workshop to have an access to AIS context and displayer
+  /// \param theSelectedAttributes an out list of selected attributes
+  static void getSelectionOwners(const ObjectPtr& theObject,
+                                  const FeaturePtr& theSketch,
+                                  ModuleBase_IWorkshop* theWorkshop,
+                                  const std::list<AttributePtr>& theSelectedAttributes,
+                                  SelectMgr_IndexedMapOfOwner& anOwnersToSelect);
 
 private:
   PartSet_Module* myModule;
index b0bffcc5ae59cd015c706a1ed2578748543181fb..796ec88ef9ccfdc1f81f2ec25c7355ab86cc9f95 100644 (file)
@@ -28,5 +28,6 @@
      <file>icons/shape_group.png</file>
      <file>icons/fixed.png</file>
      <file>icons/placement.png</file>
+     <file>icons/geom_export.png</file>
  </qresource>
  </RCC>
diff --git a/src/PartSet/icons/geom_export.png b/src/PartSet/icons/geom_export.png
new file mode 100644 (file)
index 0000000..07ec5dd
Binary files /dev/null and b/src/PartSet/icons/geom_export.png differ
index 3b0cbc3e601d47d0116a22974f13d4812092f160..c06aae88a7d4fbbd78c538005d9aed8ac2c77a27 100644 (file)
@@ -251,6 +251,28 @@ void XGUI_Displayer::activate(ObjectPtr theObject, const QIntList& theModes)
   }
 }
 
+void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theModes)
+{
+  if (!isVisible(theObject))
+    return;
+
+  Handle(AIS_InteractiveContext) aContext = AISContext();
+  if (aContext.IsNull())
+    return;
+
+  AISObjectPtr aAISObj = getAISObject(theObject);
+
+  if (aAISObj.get() != NULL) {
+    Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+    TColStd_ListOfInteger aTColModes;
+    aContext->ActivatedModes(anAISIO, aTColModes);
+    TColStd_ListIteratorOfListOfInteger itr( aTColModes );
+    for (; itr.More(); itr.Next() ) {
+      theModes.append(itr.Value());
+    }
+  }
+}
+
 void XGUI_Displayer::activateObjects(const QIntList& theModes)
 {
   // In order to avoid doblications of selection modes
index 0dfb1cae12935e1f2e7daab0d73f80d4b1dfa410..176f52bc4ee7feda4b1cb925b983068ae9d2871a 100644 (file)
@@ -93,7 +93,7 @@ class XGUI_EXPORT XGUI_Displayer
   void updateViewer();
 
   /// Searches the interactive object by feature
-  /// \param theFeature the feature or NULL if it not visualized
+  /// \param theFeature the object or presentable feature
   /// \return theIO an interactive object
   AISObjectPtr getAISObject(ObjectPtr theFeature) const;
 
@@ -110,6 +110,11 @@ class XGUI_EXPORT XGUI_Displayer
   /// \param theModes - modes on which it has to be activated (can be empty)
   void activate(ObjectPtr theFeature, const QIntList& theModes);
 
+  /// Returns the modes of activation
+  /// \param theFeature the feature or NULL if it not visualized
+  /// \param theModes - modes on which it is activated (can be empty)
+  void getModesOfActivation(ObjectPtr theObject, QIntList& theModes);
+
   /// Activates the given object with default modes
   void activate(ObjectPtr theFeature);
 
index a4ca2212d0923951d50cc95fd5ff483dc3d4dad8..7b4bb5ff1601e0c22f1ca481dd0fcc3c9969bd38 100644 (file)
 
 #include <AIS_InteractiveContext.hxx>
 
+#include <SelectMgr_Selection.hxx>
+#include <SelectBasics_SensitiveEntity.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+
 #include <set>
 
 XGUI_Selection::XGUI_Selection(XGUI_Workshop* theWorkshop)
@@ -152,3 +156,33 @@ void XGUI_Selection::selectedShapes(NCollection_List<TopoDS_Shape>& theList,
     }
   }
 }
+
+//**************************************************************
+void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject,
+                                  const Handle(AIS_InteractiveContext)& theContext,
+                                  SelectMgr_IndexedMapOfOwner& theOwners)
+{
+    if (theObject.IsNull() || theContext.IsNull())
+    return;
+
+  TColStd_ListOfInteger aModes;
+  theContext->ActivatedModes(theObject, aModes);
+
+  TColStd_ListIteratorOfListOfInteger anIt(aModes);
+  for (; anIt.More(); anIt.Next()) {
+    int aMode = anIt.Value();
+    if (!theObject->HasSelection(aMode))
+      continue;
+
+    Handle(SelectMgr_Selection) aSelection = theObject->Selection(aMode);
+    for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
+      Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive();
+      if (anEntity.IsNull())
+        continue;
+      Handle(SelectMgr_EntityOwner) anOwner =
+        Handle(SelectMgr_EntityOwner)::DownCast(anEntity->OwnerId());
+      if (!anOwner.IsNull())
+        theOwners.Add(anOwner);
+    }
+  }
+}
index cfefd28a0cb0730b5e7fc4b58c0d809c972459c9..c411d5ff09abea1af10db7caa360b173b5d1fba1 100644 (file)
@@ -18,6 +18,8 @@
 #include <NCollection_List.hxx>
 #include <TopoDS_Shape.hxx>
 
+#include <SelectMgr_IndexedMapOfOwner.hxx>
+
 class XGUI_Workshop;
 
 class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
@@ -55,6 +57,15 @@ class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
   virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theShapes, 
     std::list<ObjectPtr>& theOwners) const;
 
+  //! Returns a list of selection entity owners of the interactive object
+  /// It depends on the modes, in which the object is activated in the context
+  /// \param theObject an object
+  /// \param theContext a viewer interactive context
+  /// \param theOwners a map of entity owners
+  static void entityOwners(const Handle_AIS_InteractiveObject& theObject,
+                           const Handle_AIS_InteractiveContext& theContext,
+                           SelectMgr_IndexedMapOfOwner& theOwners);
+
  private:
   XGUI_Workshop* myWorkshop;
 };