0023457: Slow text rendering
[occt.git] / src / OpenGl / OpenGl_Trihedron.hxx
index b282246..547536b 100644 (file)
@@ -1,6 +1,6 @@
 // Created on: 2011-09-20
 // Created by: Sergey ZERCHANINOV
-// Copyright (c) 2011-2012 OPEN CASCADE SAS
+// Copyright (c) 2011-2013 OPEN CASCADE SAS
 //
 // The content of this file is subject to the Open CASCADE Technology Public
 // License Version 6.5 (the "License"). You may not use the content of this file
 // purpose or non-infringement. Please see the License for the specific terms
 // and conditions governing the rights and limitations under the License.
 
-
 #ifndef _OpenGl_Trihedron_Header
 #define _OpenGl_Trihedron_Header
 
-#include <Handle_OpenGl_Trihedron.hxx>
+#include <OpenGl_Element.hxx>
 
-#include <Quantity_NameOfColor.hxx>
 #include <Aspect_TypeOfTriedronPosition.hxx>
-
 #include <OpenGl_AspectLine.hxx>
 #include <OpenGl_AspectText.hxx>
+#include <OpenGl_Text.hxx>
+#include <Quantity_NameOfColor.hxx>
 
-class OpenGl_Trihedron : public MMgt_TShared
+class OpenGl_Trihedron : public OpenGl_Element
 {
- public:
-  OpenGl_Trihedron (const Aspect_TypeOfTriedronPosition APosition, const Quantity_NameOfColor AColor, const Standard_Real AScale, const Standard_Boolean AsWireframe);
-  virtual ~OpenGl_Trihedron ();
+public:
+
+  static void Setup (const Quantity_NameOfColor theXColor,
+                     const Quantity_NameOfColor theYColor,
+                     const Quantity_NameOfColor theZColor,
+                     const Standard_Real        theSizeRatio,
+                     const Standard_Real        theAxisDiametr,
+                     const Standard_Integer     theNbFacettes);
 
-  static void Setup (const Quantity_NameOfColor XColor, const Quantity_NameOfColor YColor, const Quantity_NameOfColor ZColor,
-                     const Standard_Real SizeRatio, const Standard_Real AxisDiametr, const Standard_Integer NbFacettes);
+public:
 
-  void Render (const Handle(OpenGl_Workspace) &AWorkspace) const;
+  OpenGl_Trihedron (const Aspect_TypeOfTriedronPosition thePosition,
+                    const Quantity_NameOfColor          theColor,
+                    const Standard_Real                 theScale,
+                    const Standard_Boolean              theAsWireframe);
 
-  // Type definition
-  //
-  DEFINE_STANDARD_RTTI(OpenGl_Trihedron)
+  virtual void Render  (const Handle(OpenGl_Workspace)& theWorkspace) const;
+  virtual void Release (const Handle(OpenGl_Context)&   theCtx);
 
- protected:
+protected:
 
-  void Redraw (const Handle(OpenGl_Workspace) &AWorkspace) const;
-  void RedrawZBuffer (const Handle(OpenGl_Workspace) &AWorkspace) const;
+  virtual ~OpenGl_Trihedron();
+
+  void redraw        (const Handle(OpenGl_Workspace)& theWorkspace) const;
+  void redrawZBuffer (const Handle(OpenGl_Workspace)& theWorkspace) const;
+
+protected:
 
   Aspect_TypeOfTriedronPosition myPos;
   Standard_Real myScale;
@@ -60,11 +69,16 @@ class OpenGl_Trihedron : public MMgt_TShared
   float myDiameter;
   int   myNbFacettes;
 
-  OpenGl_AspectLine myAspectLine;
-  OpenGl_AspectText myAspectText;
+  OpenGl_AspectLine   myAspectLine;
+  OpenGl_AspectText   myAspectText;
+  mutable OpenGl_Text myLabelX;
+  mutable OpenGl_Text myLabelY;
+  mutable OpenGl_Text myLabelZ;
+
+public:
 
- public:
   DEFINE_STANDARD_ALLOC
+
 };
 
 #endif //_OpenGl_Trihedron_Header