Salome HOME
PR: quadtree
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.h
index 6572c80d5674fcc3798e086aa7941efb2cf9d5e2..6226f542fbcff620d7907c1012eef022af2d6007 100644 (file)
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Shape.hxx>
 
-#include <HYDROData_Object.h>
+#include <HYDROData_Entity.h>
 
 #include <QColor>
+#include <QImage>
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Wire.hxx>
+#include <TopoDS_Compound.hxx>
 
 class HYDROGUI_Shape
 {
 public:
   HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext,
-                  const Handle(HYDROData_Object)&       theObject );
+                  const Handle(HYDROData_Entity)&       theObject,
+                  const int                             theZLayer = -1 );
   ~HYDROGUI_Shape();
 
 public:
   virtual void               display( const bool theIsUpdateViewer = true );
   virtual void               erase( const bool theIsUpdateViewer = true );
 
-  virtual void               highlight( bool theIsHighlight );
+  virtual void               highlight( bool theIsHighlight, bool isUpdateViewer );
   virtual bool               isHighlighted() const;
 
-  Handle(HYDROData_Object)   getObject() const { return myObject; }
+  Handle(HYDROData_Entity)   getObject() const { return myObject; }
 
   virtual void               update( const bool theIsUpdateViewer = true );
 
@@ -62,10 +65,22 @@ public:
                                       const bool         theToDisplay = true,
                                       const bool         theIsUpdateViewer = true );
 
+  virtual void               setFaces( const TopoDS_Compound& theWires,
+                                       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         theIsUpdateViewer = true );
 
+  virtual void               setShape( const TopoDS_Shape& theShape,
+                                       const bool          theToDisplay = true,
+                                       const bool          theIsUpdateViewer = true );
+
   virtual void               setFillingColor( const QColor& theColor,
                                               const bool    theToDisplay = true,
                                               const bool    theIsUpdateViewer = true );
@@ -79,30 +94,51 @@ public:
   virtual void               setHighlightColor( const QColor& theColor );
   virtual QColor             getHighlightColor() const;
 
+  virtual void               setTextureFileName( const QString& theFileName,
+                                                 const bool     theToDisplay = true,
+                                                 const bool     theIsUpdateViewer = true );
+  virtual QString            getTextureFileName() const;
+
+  virtual Handle(AIS_Shape)  getAISShape() const { return myShape; }
+
+  void                       setZLayer( const int theZLayer );
+
 protected:
   virtual void               buildShape();
   virtual void               updateShape( const bool theToDisplay      = true,
                                           const bool theIsUpdateViewer = true );
+  void                       displayShape( const bool theIsUpdateViewer );
+
   virtual QColor             getActiveColor() const;
 
 private:
   static double              getQuantityColorVal( const int theColorVal );
   void                       colorShapeBorder( const QColor& theColor );
 
+  static QString             generateTextureFileName( const Handle(HYDROData_Entity)& theImageObj );
+  void                       removeTextureFile() const;
+
+  static QImage              reduceTexture( const QImage& theImage, const int theSizeLimit );
+
 private:
   Handle(AIS_InteractiveContext) myContext;
-  Handle(HYDROData_Object)       myObject;
+  Handle(HYDROData_Entity)       myObject;
   Handle(AIS_Shape)              myShape;
 
+  int                            myZLayer;
+
   bool                           myIsToUpdate;
   bool                           myIsVisible;
 
   bool                           myIsHighlight;
-  TopoDS_Face                    myFace;
+  TopoDS_Shape                   myTopoShape;
+  int                            myDisplayMode;
   
   QColor                         myFillingColor;
   QColor                         myBorderColor;
   QColor                         myHighlightColor;
+
+  QString                        myTextureFileName;
 };
 
 #endif