1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROGUI_SHAPE_H
20 #define HYDROGUI_SHAPE_H
22 #include <HYDROData_Entity.h>
24 #include <AIS_InteractiveContext.hxx>
25 #include <TopoDS_Shape.hxx>
29 class TopoDS_Compound;
36 HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext,
37 const Handle(HYDROData_Entity)& theObject,
38 const int theZLayer = -1 );
39 virtual ~HYDROGUI_Shape();
42 virtual void display( const bool theIsUpdateViewer = true );
43 virtual void erase( const bool theIsUpdateViewer = true );
45 virtual void highlight( bool theIsHighlight, bool isUpdateViewer );
46 virtual bool isHighlighted() const;
48 Handle(AIS_InteractiveContext) getContext() const;
49 Handle(HYDROData_Entity) getObject() const;
50 TopoDS_Shape getTopoShape() const;
52 virtual void update( bool isUpdateViewer,
53 bool isDeactivateSelection );
55 virtual bool getIsToUpdate() const;
56 virtual void setIsToUpdate( bool theState );
58 virtual bool isVisible() const;
59 virtual void setVisible( const bool theState,
60 const bool theIsUpdateViewer = true );
62 virtual void setWire( const TopoDS_Wire& theWire,
63 const bool theToDisplay = true,
64 const bool theIsUpdateViewer = true );
66 virtual void setFaces( const TopoDS_Compound& theWires,
67 const bool theToDisplay = true,
68 const bool theIsUpdateViewer = true );
70 virtual void setFace( const TopoDS_Wire& theWire,
71 const bool theToDisplay,
72 const bool theIsUpdateViewer,
73 const QString& theTextureFileName );
75 virtual void setFace( const TopoDS_Face& theFace,
76 const bool theToDisplay,
77 const bool theIsUpdateViewer,
78 const QString& theTextureFileName );
80 virtual void setShape( const TopoDS_Shape& theShape,
81 const bool theToDisplay = true,
82 const bool theIsUpdateViewer = true,
83 const int theDisplayMode = AIS_Shaded );
85 virtual void setFillingColor( const QColor& theColor,
86 const bool theToDisplay = true,
87 const bool theIsUpdateViewer = true );
88 virtual QColor getFillingColor() const;
90 virtual void setBorderColor( const QColor& theColor,
91 const bool theToDisplay = true,
92 const bool theIsUpdateViewer = true );
93 virtual QColor getBorderColor() const;
95 virtual void setHighlightColor( const QColor& theColor );
96 virtual QColor getHighlightColor() const;
98 virtual Handle(AIS_InteractiveObject) getAISObject() const;
100 void setZLayer( const int theZLayer );
102 void setSelectionMode( int theSelectionMode );
105 virtual void buildShape();
106 virtual void updateShape( const bool theToDisplay = true,
107 const bool theIsUpdateViewer = true );
108 virtual void displayShape( const bool theIsUpdateViewer );
109 virtual void eraseShape( const bool theIsUpdateViewer );
111 virtual QColor getActiveColor() const;
112 virtual Handle_AIS_InteractiveObject createShape() const;
114 void setDisplayMode( int theDisplayMode );
117 static double getQuantityColorVal( const int theColorVal );
118 void colorShapeBorder( const QColor& theColor );
121 Handle(AIS_InteractiveContext) myContext;
122 Handle(HYDROData_Entity) myObject;
123 Handle(AIS_InteractiveObject) myShape;
131 TopoDS_Shape myTopoShape;
135 QColor myFillingColor;
136 QColor myBorderColor;
137 QColor myHighlightColor;