0024381: Visualization, TKOpenGl - revise matrices stack and usage of temporary matrices
[occt.git] / src / OpenGl / OpenGl_Trihedron.hxx
CommitLineData
b311480e 1// Created on: 2011-09-20
2// Created by: Sergey ZERCHANINOV
a174a3c5 3// Copyright (c) 2011-2013 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
2166f0fa
SK
16#ifndef _OpenGl_Trihedron_Header
17#define _OpenGl_Trihedron_Header
18
a174a3c5 19#include <OpenGl_Element.hxx>
2166f0fa 20
2166f0fa 21#include <Aspect_TypeOfTriedronPosition.hxx>
2166f0fa
SK
22#include <OpenGl_AspectLine.hxx>
23#include <OpenGl_AspectText.hxx>
c827ea3a 24#include <OpenGl_Cylinder.hxx>
25#include <OpenGl_Disk.hxx>
26#include <OpenGl_Sphere.hxx>
a174a3c5 27#include <OpenGl_Text.hxx>
28#include <Quantity_NameOfColor.hxx>
2166f0fa 29
c827ea3a 30//! Class render trihedron
a174a3c5 31class OpenGl_Trihedron : public OpenGl_Element
2166f0fa 32{
a174a3c5 33public:
34
35 static void Setup (const Quantity_NameOfColor theXColor,
36 const Quantity_NameOfColor theYColor,
37 const Quantity_NameOfColor theZColor,
38 const Standard_Real theSizeRatio,
39 const Standard_Real theAxisDiametr,
40 const Standard_Integer theNbFacettes);
2166f0fa 41
a174a3c5 42public:
2166f0fa 43
a174a3c5 44 OpenGl_Trihedron (const Aspect_TypeOfTriedronPosition thePosition,
45 const Quantity_NameOfColor theColor,
46 const Standard_Real theScale,
47 const Standard_Boolean theAsWireframe);
2166f0fa 48
a174a3c5 49 virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
10b9c7df 50 virtual void Release (OpenGl_Context* theCtx);
2166f0fa 51
a174a3c5 52protected:
2166f0fa 53
a174a3c5 54 virtual ~OpenGl_Trihedron();
55
56 void redraw (const Handle(OpenGl_Workspace)& theWorkspace) const;
57 void redrawZBuffer (const Handle(OpenGl_Workspace)& theWorkspace) const;
58
59protected:
2166f0fa
SK
60
61 Aspect_TypeOfTriedronPosition myPos;
62 Standard_Real myScale;
63 Standard_Boolean myIsWireframe;
c827ea3a 64 // Parameters for z-buffered mode
2166f0fa
SK
65 TEL_COLOUR myXColor;
66 TEL_COLOUR myYColor;
67 TEL_COLOUR myZColor;
68 float myRatio;
69 float myDiameter;
70 int myNbFacettes;
71
c827ea3a 72 OpenGl_AspectLine myAspectLine;
73 OpenGl_AspectText myAspectText;
74 mutable OpenGl_Text myLabelX;
75 mutable OpenGl_Text myLabelY;
76 mutable OpenGl_Text myLabelZ;
77 mutable OpenGl_Cylinder myCylinder;
78 mutable OpenGl_Sphere mySphere;
79 mutable OpenGl_Cylinder myCone;
80 mutable OpenGl_Disk myDisk;
a174a3c5 81
82public:
2166f0fa 83
1c35b92f 84 DEFINE_STANDARD_ALLOC
a174a3c5 85
2166f0fa
SK
86};
87
88#endif //_OpenGl_Trihedron_Header