/// \return a desktop instance
QMainWindow* desktop() const;
- //! Returns icon name according to feature
- static QIcon featureIcon(const FeaturePtr& theFeature);
+ //! Delete features
+ void deleteObjects();
- //! Activates or deactivates a part
- //! If PartPtr is Null pointer then PartSet will be activated
- void activatePart(std::shared_ptr<ModelAPI_ResultPart> theFeature);
+ //! Returns true if there is at least one selected body/construction/group result
+ //! \return boolean value
+ bool canChangeColor() const;
- //! Delete features
- void deleteObjects(const QObjectPtrList& theList);
+ //! Change color of the features if it is possible
+ //! The operation is available for construction, body and group results
+ //! theObjects a list of selected objects
+ void changeColor(const QObjectPtrList& theObjects);
//! Show the given features in 3d Viewer
void showObjects(const QObjectPtrList& theList, bool isVisible);
*/
bool isActiveOperationAborted();
+ //! Delete features. Delete the referenced features. There can be a question with a list of referenced
+ //! objects.
+ //! \param theList an objects to be deleted
+ //! \param theIgnoredFeatures a list of features to be ignored during delete
+ //! \param theParent a parent widget for the question message box
+ //! \param theAskAboutDeleteReferences if true, the message box with a list of references to the
+ //! objects features appear. If the user chose do not continue, the deletion is not performed
+ //! \return the success of the delete
+ static bool deleteFeatures(const QObjectPtrList& theList,
+ std::set<FeaturePtr> theIgnoredFeatures = std::set<FeaturePtr>(),
+ QWidget* theParent = 0,
+ const bool theAskAboutDeleteReferences = false);
+
signals:
/// Emitted when selection happens in Salome viewer
void salomeViewerSelection();
/// Reaction on command call
void onFeatureTriggered();
- /// Change active document
- /// \param theObj a part object. If it is NULL then active document is a main document
- void changeCurrentDocument(ObjectPtr theObj);
-
- //void activateLastPart();
-
/// Close document
void closeDocument();
/// Process feature redisplay message
void onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
- /// Process feature delete message
- void onObjectDeletedMsg(const std::shared_ptr<ModelAPI_ObjectDeletedMessage>& );
-
/// Display all results
void displayAllResults();
void createDockWidgets();
/// Displaus object and fit all viewer if the object is first (update viewer will not be called)
- void displayObject(ObjectPtr theObj);
+ /// Asks the module whether the object can be displayed
+ /// \param theObj an object
+ /// \return true if the object is displayed
+ bool displayObject(ObjectPtr theObj);
//! Extends undo/redo toolbutton's with history menu
//! \param theObject - in the OpenParts it is a QToolButton by itself,
XGUI_ModuleConnector* myModuleConnector;
QString myCurrentDir;
- static QMap<QString, QString> myIcons;
bool myUpdatePrefs;
// Flag to check that part document is in process of activating
bool myPartActivating;
+
+ /// The flag is true when we loading a document
+ bool myIsLoadingData;
};
#endif