]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_CustomPrs.h
Salome HOME
Issue #591 - Highlight of the first argument of constraints
[modules/shaper.git] / src / PartSet / PartSet_CustomPrs.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_CustomPrs.hxx
4 // Created:     30 Jun 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef PartSet_CustomPrs_H
8 #define PartSet_CustomPrs_H
9
10 #include "PartSet.h"
11
12 #include "PartSet_OperationPrs.h"
13
14 #include <ModelAPI_Object.h>
15 #include <ModelAPI_Result.h>
16 #include <ModelAPI_Feature.h>
17
18 #include <GeomAPI_ICustomPrs.h>
19 #include <GeomAPI_AISObject.h>
20 #include <GeomAPI_Shape.h>
21
22 class ModuleBase_IWorkshop;
23
24 /**
25 * Interface of a class which can provide specific customization of
26 * object presentation
27 */
28 class PartSet_CustomPrs : public GeomAPI_ICustomPrs
29 {
30 public:
31   PARTSET_EXPORT PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop);
32   PARTSET_EXPORT virtual ~PartSet_CustomPrs() {};
33
34   /// Returns true if the presentation is active
35   bool isActive() const;
36
37   /// Initializes the presentation by the parameter object
38   void activate(const FeaturePtr& theObject);
39
40   void deactivate();
41
42   /// Modifies the given presentation in the custom way.
43   bool customize(const ObjectPtr& theObject);
44
45   /// Modifies the given presentation in the custom way.
46   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
47                                      std::shared_ptr<GeomAPI_ICustomPrs> theCustomPrs);
48 private:
49   /// Returns the AIS presentation
50   Handle(PartSet_OperationPrs) getPresentation() const;
51
52   /// Displays the internal presentation in the viewer of workshop
53   void displayPresentation();
54   /// Erases the internal presentation from the viewer of workshop
55   void erasePresentation();
56   /// Sets color, point size and width of the presentation
57   void customizePresentation();
58
59 private:
60   ModuleBase_IWorkshop* myWorkshop; /// current workshop
61   AISObjectPtr myOperationPrs; /// the AIS presentation, which is displayed/erased in the viewer
62 };
63
64 #endif