Salome HOME
empty AIS presentation should not be visualized in the viewer. It is caused by OCCT...
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_HVDirection.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_HVDirection.h
4 // Created:     16 February 2015
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef SketcherPrs_HVDirection_H
8 #define SketcherPrs_HVDirection_H
9
10 #include "SketcherPrs_SymbolPrs.h"
11 #include <ModelAPI_Feature.h>
12
13
14 DEFINE_STANDARD_HANDLE(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs)
15
16 /**
17 * \ingroup GUI
18 * A redefinition of standard AIS Interactive Object in order to provide  
19 * presentation of parallel constraint
20 */
21 class SketcherPrs_HVDirection: public SketcherPrs_SymbolPrs
22 {
23 public:
24   /// Constructor
25   /// \param theConstraint a constraint feature
26   /// \param thePlane a coordinate plane of current sketch
27   /// \param isHorisontal a flag horizontal or vertical presentation
28   Standard_EXPORT SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint, 
29                                          const std::shared_ptr<GeomAPI_Ax3>& thePlane,
30                                          bool isHorisontal);
31
32   DEFINE_STANDARD_RTTI(SketcherPrs_HVDirection)
33
34   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
35   /// \param theConstraint a constraint feature
36   /// \param thePlane a coordinate plane of current sketch
37   /// \return boolean result value
38   static bool IsReadyToDisplay(ModelAPI_Feature* theConstraint,
39                                const std::shared_ptr<GeomAPI_Ax3>& thePlane);
40
41 protected:
42   virtual const char* iconName() const { return myIsHorisontal? "horisontal.png" : "vertical.png"; }
43
44   /// Redefine this function in order to add additiona lines of constraint base
45   /// \param thePrs a presentation
46   /// \param theColor a color of additiona lines
47   virtual void drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const;
48
49   /// Update myPntArray according to presentation positions
50   /// \return true in case of success
51   virtual bool updatePoints(double theStep) const;
52
53 private:
54   bool myIsHorisontal;
55 };
56
57 #endif