8930ac35ac3883c7cd598126eb954fc7aabe5d1b
[occt.git] / src / NIS / NIS_TriangulatedDrawer.hxx
1 // Created on: 2007-07-19
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2007-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef NIS_TriangulatedDrawer_HeaderFile
17 #define NIS_TriangulatedDrawer_HeaderFile
18
19 #include <NIS_Drawer.hxx>
20 #include <Quantity_Color.hxx>
21
22 class NIS_Triangulated;
23
24 /**
25  * Drawer for interactive object type NIS_Triangulated.
26  */
27
28 class NIS_TriangulatedDrawer : public NIS_Drawer
29 {
30  public:
31   // ---------- PUBLIC METHODS ----------
32
33   /**
34    * Constructor.
35    */
36   Standard_EXPORT NIS_TriangulatedDrawer(const Quantity_Color theNormal,
37                                          const Quantity_Color theHilight
38                                                         = Quantity_NOC_GRAY80,
39                                          const Quantity_Color theDynHilight
40                                                         = Quantity_NOC_CYAN1);
41
42   /**
43    * Copy the relevant information from another instance of Drawer.
44    * raises exception if theOther has incompatible type (test IsKind).
45    */
46   Standard_EXPORT virtual void Assign    (const Handle_NIS_Drawer& theOther);
47
48   /**
49    * Called before execution of Draw(), once per group of interactive objects.
50    */
51   Standard_EXPORT virtual void BeforeDraw(const DrawType         theType,
52                                           const NIS_DrawList&    theDrawList);
53
54   /**
55    * Called after execution of Draw(), once per group of interactive objects.
56    */
57   Standard_EXPORT virtual void AfterDraw(const DrawType         theType,
58                                          const NIS_DrawList&    theDrawList);
59
60   /**
61    * Main function: display the given interactive object in the given view.
62    */
63   Standard_EXPORT virtual void Draw      (const Handle_NIS_InteractiveObject&,
64                                           const DrawType         theType,
65                                           const NIS_DrawList&    theDrawList);
66
67   /**
68    * Matching two instances, for Map interface.
69    */
70   Standard_EXPORT virtual Standard_Boolean
71                                 IsEqual  (const Handle_NIS_Drawer& theOth)const;
72
73 protected:
74   /**
75    * If myPolygonAsLineLoop is true then draw polygons of the object
76    * in the mode GL_LINE_LOOP instead of GL_POLYGON in the case if no filling
77    * was requested. This will eliminate the bug with Intel integrated graphic
78    * cards (e.g. 945G Express) for the sake of polygon offset functionality.
79    */
80   Standard_Boolean    myPolygonAsLineLoop;
81
82   Quantity_Color      myColor[5];
83   Standard_ShortReal  myLineWidth;
84   Standard_Boolean    myIsDrawPolygons;
85   unsigned int        myPolygonType;
86
87   friend class NIS_Triangulated;
88
89  public:
90 // Declaration of CASCADE RTTI
91 DEFINE_STANDARD_RTTI (NIS_TriangulatedDrawer)
92 };
93
94 // Definition of HANDLE object using Standard_DefineHandle.hxx
95 DEFINE_STANDARD_HANDLE (NIS_TriangulatedDrawer, NIS_Drawer)
96
97
98 #endif