]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_Tools.h
Salome HOME
Issue #1489 Multi-rotation problem if there is a reference to copied objects
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.h
index a9b38bd8055a11c701f88a01f9cbfd789ad48ddd..d053d279b6b39cb62692c9cba48e2426ab30fed0 100755 (executable)
@@ -21,6 +21,8 @@
 
 #include <QPixmap>
 
+#include <map>
+
 class QWidget;
 class QLayout;
 class QDoubleSpinBox;
@@ -229,42 +231,6 @@ MODULEBASE_EXPORT void blockUpdateViewer(const bool theValue);
 MODULEBASE_EXPORT QString wrapTextByWords(const QString& theValue, QWidget* theWidget,
                                              int theMaxLineInPixels = 150);
 
-//! Find all referenced features. Return direct and indirect lists of referenced object
-//! \param theList an objects to be checked
-//! \param aDirectRefFeatures a list of direct reference features
-//! \param aIndirectRefFeatures a list of features which depend on the feature through others
-MODULEBASE_EXPORT void findReferences(const QObjectPtrList& theList,
-                                      std::set<FeaturePtr>& aDirectRefFeatures,
-                                      std::set<FeaturePtr>& aIndirectRefFeatures);
-/*!
- Returns a container of references feature to the source object. The search happens in the object
- document and in other Part documents if the object belongs to the PartSet. The search is recursive,
- in other words it is applyed to set of the found objects until it is possible.
- It do not returns the referenced features to the object if this references is a composite feature
- which has the object as a sub object.
- \param theSourceObject an object, which references are searched
- \param theObject an intermediate recursive object, should be set in the source object
- \param theIgnoreList an ignore list, the found referernces which coincide with the objects are ignored
- \param theDirectRefFeatures direct references
- \param theIndirectRefFeatures indirect references. These are features that refers to the direct features
- \param theAlreadyProcessed set of processed elements, used for optimization (do not reanalyse processed)
- \return a boolean value
- */
-void MODULEBASE_EXPORT refsToFeatureInAllDocuments(const ObjectPtr& theSourceObject,
-                                                   const ObjectPtr& theObject,
-                                                   const QObjectPtrList& theIgnoreList,
-                                                   std::set<FeaturePtr>& theDirectRefFeatures,
-                                                   std::set<FeaturePtr>& theIndirectRefFeatures,
-                                                   std::set<FeaturePtr>& theAlreadyProcessed);
-
-/*!
-*/
-void MODULEBASE_EXPORT refsDirectToFeatureInAllDocuments(const ObjectPtr& theSourceObject, 
-                                                         const ObjectPtr& theObject,
-                                                         const QObjectPtrList& theIgnoreList,
-                                                         std::set<FeaturePtr>& theDirectRefFeatures, 
-                                                         std::set<FeaturePtr>& theAlreadyProcessed);
-
 /*!
   Returns a container of referenced feature to the current object in the object document.
   \param theObject an object, which will be casted to a feature type
@@ -293,19 +259,28 @@ bool MODULEBASE_EXPORT isSubOfComposite(const ObjectPtr& theObject, const Featur
 bool MODULEBASE_EXPORT isSubOfComposite(const ObjectPtr& theObject);
 
 
-//! Shows a dialog box about references. Ask whether they should be also removed.
-//! \param theList an objects to be checked
-//! \param aDirectRefFeatures a list of direct reference features
-//! \param aIndirectRefFeatures a list of features which depend on the feature through others
-//! \param theParent a parent widget for the question message box
-//! \param doDeleteReferences if there are parameters between features, ask if they should be
-//! replaced to their meaning without corresponded features remove
-//! \return true if in message box answer is Yes
-bool MODULEBASE_EXPORT isDeleteFeatureWithReferences(const QObjectPtrList& theList,
-                                                     const std::set<FeaturePtr>& aDirectRefFeatures,
-                                                     const std::set<FeaturePtr>& aIndirectRefFeatures,
-                                                     QWidget* theParent,
-                                                     bool& doDeleteReferences);
+/*!
+* Shows a dialog box about references. Ask whether they should be also removed.
+* \param theFeatures a list of features
+* \param theReferences a map of all references to the features
+* \param theParent a parent widget for the question message box
+* \param theReferencesToDelete an out set for references features to be removed
+* \return true if in message box answer is Yes
+*/
+bool MODULEBASE_EXPORT askToDelete(const std::set<FeaturePtr> aFeatures,
+                                   const std::map<FeaturePtr, std::set<FeaturePtr> >& theReferences,
+                                   QWidget* theParent,
+                                   std::set<FeaturePtr>& theReferencesToDelete);
+
+/*!
+* Converts a list of objects to set of corresponded features. If object is result, it is ingored
+* because the feauture only might be removed. But if result is in a parameter group, the feature
+* of this parameter is to be removed
+* \param theObjects a list of objects
+* \param theFeatures an out conteiner of features
+*/
+void MODULEBASE_EXPORT convertToFeatures(const QObjectPtrList& theObjects, std::set<FeaturePtr>& theFeatures);
+
 }
 
 #endif