Salome HOME
Copyright update 2022
[modules/gui.git] / src / OCCViewer / OCCViewer_Trihedron.cxx
index 14ac128f7d0f201c238d13607ded5ea682377d5e..a3898914247e2ca888aaeee836a3ebb95fea82a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <windows.h>
 #endif
 
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#else
 #include <GL/gl.h>
+#endif
 
 #include "OCCViewer_Trihedron.h"
 
@@ -37,7 +41,7 @@
 #include <PrsMgr_PresentationManager3d.hxx>
 
 
-#ifndef WIN32
+#if !defined WIN32 && !defined __APPLE__
 # include <GL/glx.h>
 #endif
 
@@ -45,7 +49,6 @@
 
 #define PI   3.14159265359
 
-IMPLEMENT_STANDARD_HANDLE( OCCViewer_Trihedron, AIS_InteractiveObject )
 IMPLEMENT_STANDARD_RTTIEXT( OCCViewer_Trihedron, AIS_InteractiveObject )
 
 /*!
@@ -69,7 +72,6 @@ OCCViewer_Trihedron::~OCCViewer_Trihedron()
 /*!
  * Sets the bounding box (MinMax values).
  */
-#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
 void OCCViewer_Trihedron::bounds( Graphic3d_BndBox4f& theMinMax ) const
 {
   Graphic3d_Vec4 aMinPt (-1.f, -1.f, -1.f, 1.f);
@@ -78,20 +80,6 @@ void OCCViewer_Trihedron::bounds( Graphic3d_BndBox4f& theMinMax ) const
   theMinMax.Add (aMinPt);
   theMinMax.Add (aMaxPt);
 }
-#else
-void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
-{
-  Standard_Real aXMin = -1, aYMin = -1, aZMin = -1;
-  Standard_Real aXMax =  1, aYMax =  1, aZMax =  1;
-
-  if( aMinMax.XMin > aXMin ) aMinMax.XMin = aXMin;
-  if( aMinMax.YMin > aYMin ) aMinMax.YMin = aYMin;
-  if( aMinMax.ZMin > aZMin ) aMinMax.ZMin = aZMin;
-  if( aMinMax.XMax < aXMax ) aMinMax.XMax = aXMax;
-  if( aMinMax.YMax < aYMax ) aMinMax.YMax = aYMax;
-  if( aMinMax.ZMax < aZMax ) aMinMax.ZMax = aZMax;
-}
-#endif
 
 /*!
  * Redefined method. Calculates the object presentation.
@@ -123,7 +111,7 @@ GLuint generateTextList()
   bool ok = false;
   GLuint aList = glGenLists( 256 );
 
-#ifdef WIN32
+#if defined(WIN32)
   HGLRC hglrc = wglGetCurrentContext();
   if( hglrc )
   {
@@ -143,7 +131,7 @@ GLuint generateTextList()
     SelectObject( hdc, oldFont );
     DeleteObject( font );
   }
-#else // X Window
+#elif !defined(__APPLE__) // X Window
   Display* dpy = glXGetCurrentDisplay();
   if( dpy )
   {