1 // File: NIS_SurfaceDrawer.h
2 // Created: 20.03.08 09:05
3 // Author: Alexander GRIGORIEV
4 // Copyright: Open Cascade S.A. 2008
6 #ifndef NIS_SurfaceDrawer_HeaderFile
7 #define NIS_SurfaceDrawer_HeaderFile
9 #include <NIS_Drawer.hxx>
10 #include <gp_Trsf.hxx>
11 #include <Quantity_Color.hxx>
16 * Drawer for interactive object type NIS_Surface.
19 class NIS_SurfaceDrawer : public NIS_Drawer
22 // ---------- PUBLIC METHODS ----------
27 Standard_EXPORT NIS_SurfaceDrawer(const Quantity_Color &theNormal,
28 const Quantity_Color &theHilight
29 = Quantity_NOC_GRAY65,
30 const Quantity_Color &theDynHilight
31 = Quantity_NOC_CYAN1);
34 * Sets the color of the drawer.
36 Standard_EXPORT void SetColor (const Quantity_Color &theColor);
39 * Define the color used for the back side of rendered triangles.
40 * By default this color is the same as the 'Normal' color.
42 inline void SetBackColor (const Quantity_Color& theColor)
44 myBackColor = theColor;
48 * Sets the transformation to the drawer.
50 inline void SetTransformation (const gp_Trsf &theTrsf)
56 * Returns the transformation to the drawer.
58 inline const gp_Trsf& GetTransformation () const
64 * Sets the surface offset
66 inline void SetPolygonOffset (const Standard_Real theOffset)
68 myPolygonOffset = static_cast<Standard_ShortReal>(theOffset);
72 * Get the surface offset.
74 inline Standard_Real GetPolygonOffset () const
76 return static_cast<Standard_Real>(myPolygonOffset);
80 * Copy the relevant information from another instance of Drawer.
81 * raises exception if theOther has incompatible type (test IsKind).
83 Standard_EXPORT virtual void Assign (const Handle_NIS_Drawer& theOther);
86 * Called before execution of Draw(), once per group of interactive objects.
88 Standard_EXPORT virtual void BeforeDraw(const DrawType theType,
89 const NIS_DrawList& theDrawList);
92 * Called after execution of Draw(), once per group of interactive objects.
94 Standard_EXPORT virtual void AfterDraw(const DrawType theType,
95 const NIS_DrawList& theDrawList);
98 * Main function: display the given interactive object in the given view.
100 Standard_EXPORT virtual void Draw (const Handle_NIS_InteractiveObject&,
101 const DrawType theType,
102 const NIS_DrawList& theDrawList);
105 * Matching two instances, for Map interface.
107 Standard_EXPORT virtual Standard_Boolean
108 IsEqual (const Handle_NIS_Drawer& theOth)const;
111 Standard_EXPORT virtual void redraw (const DrawType theType,
112 const Handle_NIS_View& theView);
116 Quantity_Color myColor[5];
117 Quantity_Color myBackColor;
119 Standard_ShortReal myPolygonOffset;
120 Standard_Boolean myIsWireframe;
122 friend class NIS_Surface;
125 // Declaration of CASCADE RTTI
126 DEFINE_STANDARD_RTTI (NIS_SurfaceDrawer)
129 // Definition of HANDLE object using Standard_DefineHandle.hxx
130 DEFINE_STANDARD_HANDLE (NIS_SurfaceDrawer, NIS_Drawer)