X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_CustomPrs.h;h=c12768e0e549f4248fdcba0c060e0255722e3d81;hb=4d3ed04028394a778cbba218593158d0f84c6607;hp=1c749413817d516dfefabd1e82798315cb95ce68;hpb=5ebfd3be8bf1d28be01c4edd749e73852591dd21;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_CustomPrs.h b/src/PartSet/PartSet_CustomPrs.h index 1c7494138..c12768e0e 100755 --- a/src/PartSet/PartSet_CustomPrs.h +++ b/src/PartSet/PartSet_CustomPrs.h @@ -23,31 +23,47 @@ class ModuleBase_IWorkshop; class XGUI_Workshop; /** -* Interface of a class which can provide specific customization of -* object presentation + * This is the module custom presentation, which manage an AIS presentation, that can be filled + * by a feature and visualized in the viewer additionally to usual workshop objects. */ class PartSet_CustomPrs { public: + /// Constructor + /// \param theWorkshop a reference to workshop PARTSET_EXPORT PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop); PARTSET_EXPORT virtual ~PartSet_CustomPrs() {}; /// Returns true if the presentation is active bool isActive(); - /// Initializes the presentation by the parameter object - void activate(const FeaturePtr& theObject); - - void deactivate(); - - /// Modifies the given presentation in the custom way. - void customize(const ObjectPtr& theObject); - + /// Initializes the operation presentation by the parameter object and display the presentation + /// \param theObject an operation feature source to fill the presentation + /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly + /// \returns true if the presentation is displayed + bool activate(const FeaturePtr& theObject, const bool theUpdateViewer); + + /// Initializes the operation presentation by empty object and erase the presentation + /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly + /// \returns true if the presentation has been displayed and now it is erased + bool deactivate(const bool theUpdateViewer); + + /// If the presentation is active[displayed], the shapes of the presentation is recomputed + /// and the presentation is redisplayed. + /// \param theObject an object to redisplay + /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly + /// \returns true if the presentation is redisplayed + bool redisplay(const ObjectPtr& theObject, const bool theUpdateViewer); + + /// Nullify the operation presentation. For example, it can be useful when the viewer/context + /// is closed. If this is not performed and the presentation is assigned in another context, + /// it caused erroneus case because the presentation has linkage to the previous context. void clearPrs(); +private: + /// Creates the AIS operation presentation void initPrs(); -private: /// Returns the AIS presentation Handle(PartSet_OperationPrs) getPresentation(); @@ -55,13 +71,19 @@ private: XGUI_Workshop* workshop() const; /// Displays the internal presentation in the viewer of workshop - void displayPresentation(); + /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly + void displayPresentation(const bool theUpdateViewer); + /// Erases the internal presentation from the viewer of workshop - void erasePresentation(); + /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly + void erasePresentation(const bool theUpdateViewer); + /// Sets color, point size and width of the presentation - void customizePresentation(); + /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly + void customizePresentation(const bool theUpdateViewer); private: + bool myIsActive; ModuleBase_IWorkshop* myWorkshop; /// current workshop AISObjectPtr myOperationPrs; /// the AIS presentation, which is displayed/erased in the viewer };