20 #ifndef PartSet_CustomPrs_H
21 #define PartSet_CustomPrs_H
25 #include "PartSet_OperationPrs.h"
27 #include <ModuleBase_IModule.h>
28 #include <ModelAPI_Object.h>
29 #include <ModelAPI_Result.h>
30 #include <ModelAPI_Feature.h>
32 #include <Events_Listener.h>
34 #include <GeomAPI_ICustomPrs.h>
35 #include <GeomAPI_AISObject.h>
36 #include <GeomAPI_Shape.h>
75 bool activate(
const FeaturePtr& theObject,
77 const bool theUpdateViewer);
84 const bool theUpdateViewer);
92 bool redisplay(
const ObjectPtr& theObject,
94 const bool theUpdateViewer);
104 myDisabledMode = theMode;
105 erasePresentation(theMode,
false);
112 virtual void processEvent(
const std::shared_ptr<Events_Message>& theMessage);
124 const bool theToCreate);
134 const bool theUpdateViewer);
141 const bool theUpdateViewer);
155 void clearErrorShape();
159 FeaturePtr myFeature;
160 bool myPresentationIsEmpty;
162 QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, AISObjectPtr> myPresentations;
164 QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, bool> myIsActive;
168 Handle(AIS_Shape) myErrorShapes;
Base interface for any event listener.
Definition: Events_Listener.h:37
ModuleBase_CustomizeFlag
enumeration to know which objects should be customized
Definition: ModuleBase_IModule.h:74
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
This is the module custom presentation, which manage an AIS presentation, that can be filled by a fea...
Definition: PartSet_CustomPrs.h:46
static const std::string OPERATION_PARAMETER_COLOR()
Returns yellow color.
Definition: PartSet_CustomPrs.h:49
bool isActive(const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag)
Returns true if the presentation is active.
Definition: PartSet_CustomPrs.cpp:65
void disableCustomMode(ModuleBase_IModule::ModuleBase_CustomizeFlag theMode)
Disable displaying of custom mode.
Definition: PartSet_CustomPrs.h:103
PartSet_CustomPrs(ModuleBase_IWorkshop *theWorkshop)
Constructor.
Definition: PartSet_CustomPrs.cpp:48
static const std::string OPERATION_RESULT_COLOR()
Returns green color.
Definition: PartSet_CustomPrs.h:51
static const std::string OPERATION_REMOVE_FEATURE_COLOR()
Returns color lighter than sketch feature entity : pink.
Definition: PartSet_CustomPrs.h:56
bool redisplay(const ObjectPtr &theObject, const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
If the presentation is active[displayed], the shapes of the presentation is recomputed and the presen...
Definition: PartSet_CustomPrs.cpp:235
static const std::string OPERATION_SKETCH_PLANE()
Returns color equal to default color of construction plugin : green.
Definition: PartSet_CustomPrs.h:59
virtual void processEvent(const std::shared_ptr< Events_Message > &theMessage)
Redefinition of Events_Listener method to listen a moment that the presentation becomes empty.
Definition: PartSet_CustomPrs.cpp:268
static const std::string OPERATION_HIGHLIGHT_COLOR()
Returns color between white and color of highlight.
Definition: PartSet_CustomPrs.h:53
bool activate(const FeaturePtr &theObject, const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
Initializes the operation presentation by the parameter object and display the presentation.
Definition: PartSet_CustomPrs.cpp:70
void clearPrs()
Nullify all internal presentations.
Definition: PartSet_CustomPrs.cpp:249
void enableCustomModes()
Enables disabled custom mode.
Definition: PartSet_CustomPrs.h:109
bool deactivate(const ModuleBase_IModule::ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
Initializes the operation presentation by empty object and erase the presentation.
Definition: PartSet_CustomPrs.cpp:99
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:83