Salome HOME
Selector implementation for OCC viewer.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.h
index 885e23d04896953cc44768e7e6ec6527c9694b17..7e67eb08bdb4e6bbe59ea687300cad77776f6868 100644 (file)
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Shape.hxx>
 
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Wire.hxx>
+#include <HYDROData_Object.h>
 
 #include <QColor>
 
-class BRepBuilderAPI_MakeFace;
-class BRepBuilderAPI_MakeWire;
-class gp_Pnt;
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Wire.hxx>
 
 class HYDROGUI_Shape
 {
 public:
-  HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext );
+  HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext,
+                  const Handle(HYDROData_Object)&       theObject );
   ~HYDROGUI_Shape();
 
 public:
@@ -48,18 +47,37 @@ public:
   virtual void               highlight( bool theIsHighlight );
   virtual bool               isHighlighted() const;
 
+  Handle(HYDROData_Object)   getObject() const { return myObject; }
+
+  virtual void               update( const bool theIsUpdateViewer = true );
+
+  virtual bool               getIsToUpdate() const { return myIsToUpdate; }
+  virtual void               setIsToUpdate( bool theState ) { myIsToUpdate = theState; }
+
+  virtual bool               isVisible() const { return myIsVisible; }
+  virtual void               setVisible( const bool theState,
+                                         const bool theIsUpdateViewer = true );
+
   virtual void               setWire( const TopoDS_Wire& theWire,
-                                      const bool         theToDisplay = true );
+                                      const bool         theToDisplay = true,
+                                      const bool         theIsUpdateViewer = true );
+
+  virtual void               setFace( const TopoDS_Wire& theWire,
+                                      const bool         theToDisplay = true,
+                                      const bool         theIsUpdateViewer = true );
 
   virtual void               setFace( const TopoDS_Face& theFace,
-                                      const bool         theToDisplay = true );
+                                      const bool         theToDisplay = true,
+                                      const bool         theIsUpdateViewer = true );
 
   virtual void               setFillingColor( const QColor& theColor,
-                                              const bool    theToDisplay = true );
+                                              const bool    theToDisplay = true,
+                                              const bool    theIsUpdateViewer = true );
   virtual QColor             getFillingColor() const;
 
   virtual void               setBorderColor( const QColor& theColor,
-                                             const bool    theToDisplay = true );
+                                             const bool    theToDisplay = true,
+                                             const bool    theIsUpdateViewer = true );
   virtual QColor             getBorderColor() const;
 
   virtual void               setHighlightColor( const QColor& theColor );
@@ -67,7 +85,8 @@ public:
 
 protected:
   virtual void               buildShape();
-  virtual void               updateShape( const bool theIsForce = true );
+  virtual void               updateShape( const bool theToDisplay      = true,
+                                          const bool theIsUpdateViewer = true );
   virtual QColor             getActiveColor() const;
 
 private:
@@ -76,10 +95,15 @@ private:
 
 private:
   Handle(AIS_InteractiveContext) myContext;
+  Handle(HYDROData_Object)       myObject;
   Handle(AIS_Shape)              myShape;
 
+  bool                           myIsToUpdate;
+  bool                           myIsVisible;
+
   bool                           myIsHighlight;
-  TopoDS_Face                    myFace;
+  TopoDS_Shape                   myTopoShape;
+  int                            myDisplayMode;
   
   QColor                         myFillingColor;
   QColor                         myBorderColor;