8848d5cb42432730591b3ec362f5639c77b47439
[occt.git] / src / OpenGl / OpenGl_Trihedron.hxx
1 // Created on: 2011-09-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2013 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 _OpenGl_Trihedron_Header
17 #define _OpenGl_Trihedron_Header
18
19 #include <OpenGl_Element.hxx>
20
21 #include <Aspect_TypeOfTriedronPosition.hxx>
22 #include <OpenGl_AspectLine.hxx>
23 #include <OpenGl_AspectText.hxx>
24 #include <OpenGl_Text.hxx>
25 #include <Quantity_NameOfColor.hxx>
26
27 class OpenGl_Trihedron : public OpenGl_Element
28 {
29 public:
30
31   static void Setup (const Quantity_NameOfColor theXColor,
32                      const Quantity_NameOfColor theYColor,
33                      const Quantity_NameOfColor theZColor,
34                      const Standard_Real        theSizeRatio,
35                      const Standard_Real        theAxisDiametr,
36                      const Standard_Integer     theNbFacettes);
37
38 public:
39
40   OpenGl_Trihedron (const Aspect_TypeOfTriedronPosition thePosition,
41                     const Quantity_NameOfColor          theColor,
42                     const Standard_Real                 theScale,
43                     const Standard_Boolean              theAsWireframe);
44
45   virtual void Render  (const Handle(OpenGl_Workspace)& theWorkspace) const;
46   virtual void Release (OpenGl_Context* theCtx);
47
48 protected:
49
50   virtual ~OpenGl_Trihedron();
51
52   void redraw        (const Handle(OpenGl_Workspace)& theWorkspace) const;
53   void redrawZBuffer (const Handle(OpenGl_Workspace)& theWorkspace) const;
54
55 protected:
56
57   Aspect_TypeOfTriedronPosition myPos;
58   Standard_Real myScale;
59   Standard_Boolean myIsWireframe;
60   // Parameters for zbuffered mode
61   TEL_COLOUR myXColor;
62   TEL_COLOUR myYColor;
63   TEL_COLOUR myZColor;
64   float myRatio;
65   float myDiameter;
66   int   myNbFacettes;
67
68   OpenGl_AspectLine   myAspectLine;
69   OpenGl_AspectText   myAspectText;
70   mutable OpenGl_Text myLabelX;
71   mutable OpenGl_Text myLabelY;
72   mutable OpenGl_Text myLabelZ;
73
74 public:
75
76   DEFINE_STANDARD_ALLOC
77
78 };
79
80 #endif //_OpenGl_Trihedron_Header