Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_SymbolPrs.h
index 6cce9503e6e7bdc97b27fc3ca0913ed4142fa7f6..7a9c37b032529b8b89e16eab40c65eed85c1f407 100644 (file)
 #include <Standard_DefineHandle.hxx>
 #include <map>
 
+#include <OpenGl_Workspace.hxx>
+
 class SketchPlugin_Constraint;
+class OpenGl_Context;
 
 
 DEFINE_STANDARD_HANDLE(SketcherPrs_SymbolPrs, AIS_InteractiveObject)
@@ -38,13 +41,38 @@ public:
   //! to this selectable object ( for fast presentation draw )
   Standard_EXPORT virtual void ClearSelected();
 
+
+  //! Method which draws selected owners ( for fast presentation draw )
+  Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, 
+                                               const SelectMgr_SequenceOfOwner& theOwners);
+  
+  //! Method which hilight an owner belonging to
+  //! this selectable object  ( for fast presentation draw )
+  Standard_EXPORT virtual void HilightOwnerWithColor(const Handle(PrsMgr_PresentationManager3d)& thePM, 
+                                                     const Quantity_NameOfColor theColor, const Handle(SelectMgr_EntityOwner)& theOwner);
+
   Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return myPlane; }
 
   Standard_EXPORT SketchPlugin_Constraint* feature() const { return myConstraint; }
 
+
+  Handle(Graphic3d_ArrayOfPoints) pointsArray() const { return myPntArray; }
+
+  void Render(const Handle(OpenGl_Workspace)& theWorkspace) const;
+
+  void Release (OpenGl_Context* theContext);
+
   DEFINE_STANDARD_RTTI(SketcherPrs_SymbolPrs)
 
 protected:
+  /// Redefinition of virtual function
+  Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
+    const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
+
+  /// Redefinition of virtual function
+  Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
+    const Standard_Integer aMode);
+
   /// Returns an icon file name. Has to be redefined in successors
   virtual const char* iconName() const = 0;
 
@@ -60,6 +88,15 @@ protected:
   /// \param theAttrName an attribute name which corresponds to referenced line
   void addLine(const Handle(Graphic3d_Group)& theGroup, std::string theAttrName) const;
 
+  /// Redefine this function in order to add additiona lines of constraint base
+  /// \param thePrs a presentation
+  /// \param theColor a color of additiona lines
+  virtual void drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const {}
+
+  /// Update myPntArray according to presentation positions
+  /// \return true in case of success
+  virtual bool updatePoints(double theStep) const { return true; }
+
 protected:
   /// Constraint feature
   SketchPlugin_Constraint* myConstraint;
@@ -70,9 +107,14 @@ protected:
   /// Aspect for entities drawing
   Handle(Graphic3d_AspectMarker3d) myAspect;
 
+  /// Array of symbols positions
+  mutable Handle(Graphic3d_ArrayOfPoints) myPntArray;
+
 private: 
   /// Static map to collect constraints icons {IconName : IconPixMap}
   static std::map<const char*, Handle(Image_AlienPixMap)> myIconsMap;
+
+  mutable Handle(OpenGl_VertexBuffer) myVboAttribs;
 };
 
 #endif
\ No newline at end of file