1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0023715: Generated cmake files should link against Cocoa on Mac OS X

Replace inclusion of GL/glu.h header with OpenGl_GlCore11.hxx wrapper
GL/glu.h doesn't exists on Mac OS X without XQuartz 3rd-party library
This commit is contained in:
kgv
2013-01-22 11:42:43 +04:00
parent dac04bfa38
commit cfd5fa01e8
14 changed files with 72 additions and 100 deletions

View File

@@ -21,10 +21,7 @@
#include <NIS_Drawer.hxx>
#include <NIS_View.hxx>
#ifdef WNT
#include <windows.h>
#endif
#include <GL/gl.h>
#include <OpenGl_GlCore11.hxx>
//=======================================================================
//function : NIS_DrawList()
@@ -75,7 +72,7 @@ NIS_DrawList::NIS_DrawList (const Handle_NIS_View& theView)
//=======================================================================
//function : ~NIS_DrawList
//purpose :
//purpose :
//=======================================================================
NIS_DrawList::~NIS_DrawList ()
@@ -145,7 +142,7 @@ void NIS_DrawList::ClearListID (const Handle_NIS_View& theView)
//=======================================================================
//function : BeginPrepare
//purpose :
//purpose :
//=======================================================================
void NIS_DrawList::BeginPrepare (const Standard_Integer theType)
@@ -162,7 +159,7 @@ void NIS_DrawList::BeginPrepare (const Standard_Integer theType)
//=======================================================================
//function : EndPrepare
//purpose :
//purpose :
//=======================================================================
void NIS_DrawList::EndPrepare (const Standard_Integer theType)
@@ -173,7 +170,7 @@ void NIS_DrawList::EndPrepare (const Standard_Integer theType)
//=======================================================================
//function : Call
//purpose :
//purpose :
//=======================================================================
void NIS_DrawList::Call (const Standard_Integer theType)
@@ -183,7 +180,7 @@ void NIS_DrawList::Call (const Standard_Integer theType)
//=======================================================================
//function : SetDynHilighted
//purpose :
//purpose :
//=======================================================================
Standard_Boolean NIS_DrawList::SetDynHilighted
@@ -212,12 +209,12 @@ Standard_Boolean NIS_DrawList::SetDynHilighted
//=======================================================================
//function : SetUpdated
//purpose :
//purpose :
//=======================================================================
void NIS_DrawList::SetUpdated (const Standard_Integer theType,
const Standard_Boolean theFlag)
{
{
if (theFlag)
SetUpdated(theType);
else
@@ -226,7 +223,7 @@ void NIS_DrawList::SetUpdated (const Standard_Integer theType,
//=======================================================================
//function : SetUpdated
//purpose :
//purpose :
//=======================================================================
void NIS_DrawList::SetUpdated (const Standard_Integer theType)

View File

@@ -23,10 +23,7 @@
#include <NIS_InteractiveObject.hxx>
#include <Standard_ProgramError.hxx>
#ifdef WNT
#include <windows.h>
#endif
#include <GL/gl.h>
#include <OpenGl_GlCore11.hxx>
static void setColor(GLenum theFace,
Quantity_Parameter * theAmbient,
@@ -58,7 +55,7 @@ NIS_SurfaceDrawer::NIS_SurfaceDrawer
//=======================================================================
//function : SetColor
//purpose :
//purpose :
//=======================================================================
void NIS_SurfaceDrawer::SetColor(const Quantity_Color &theColor)
@@ -70,7 +67,7 @@ void NIS_SurfaceDrawer::SetColor(const Quantity_Color &theColor)
//=======================================================================
//function : Assign
//purpose :
//purpose :
//=======================================================================
void NIS_SurfaceDrawer::Assign (const Handle_NIS_Drawer& theOther)
@@ -128,7 +125,7 @@ Standard_Boolean NIS_SurfaceDrawer::IsEqual
//=======================================================================
//function : redraw
//purpose :
//purpose :
//=======================================================================
void NIS_SurfaceDrawer::redraw (const DrawType theType,
@@ -153,7 +150,7 @@ void NIS_SurfaceDrawer::redraw (const DrawType theType,
//=======================================================================
//function : BeforeDraw
//purpose :
//purpose :
//=======================================================================
void NIS_SurfaceDrawer::BeforeDraw (const DrawType theType,
@@ -221,7 +218,7 @@ void NIS_SurfaceDrawer::BeforeDraw (const DrawType theType,
//=======================================================================
//function : AfterDraw
//purpose :
//purpose :
//=======================================================================
void NIS_SurfaceDrawer::AfterDraw (const DrawType theType,
@@ -246,7 +243,7 @@ void NIS_SurfaceDrawer::AfterDraw (const DrawType theType,
//=======================================================================
//function : Draw
//purpose :
//purpose :
//=======================================================================
void NIS_SurfaceDrawer::Draw (const Handle_NIS_InteractiveObject& theObj,
@@ -263,7 +260,7 @@ void NIS_SurfaceDrawer::Draw (const Handle_NIS_InteractiveObject& theObj,
static_cast <const NIS_Surface *> (theObj.operator->());
glVertexPointer (3, GL_FLOAT, 0, pObject->Node(0));
// In Highlited mode the shape must be shown as wireframe
// In Highlited mode the shape must be shown as wireframe
Standard_Boolean isWireframe(myIsWireframe);
if (isWireframe == Standard_False && theType == Draw_DynHilighted)
if (pObject->NEdges() > 0)
@@ -287,7 +284,7 @@ void NIS_SurfaceDrawer::Draw (const Handle_NIS_InteractiveObject& theObj,
//=======================================================================
//function : setColor
//purpose :
//purpose :
//=======================================================================
void setColor(GLenum theFace,

View File

@@ -24,10 +24,8 @@
#ifdef _DEBUG
#include <Standard_ProgramError.hxx>
#endif
#ifdef WNT
#include <windows.h>
#endif
#include <GL/gl.h>
#include <OpenGl_GlCore11.hxx>
// Comment this line if you see no hilighting of triangulations due to negative
// polygon offsets. Disabling this macro means that all offsets will be created
@@ -35,7 +33,7 @@
// But before changing this macro please play with your OpenGL video card
// settings in the direction of performance improvement. Particularly, I had a
// good result after checking "Enable write combining" option in NVIDIA 6600.
// good result after checking "Enable write combining" option in NVIDIA 6600.
#define NEGATIVE_POFFSET
@@ -65,7 +63,7 @@ NIS_TriangulatedDrawer::NIS_TriangulatedDrawer
//=======================================================================
//function : Assign
//purpose :
//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::Assign (const Handle_NIS_Drawer& theOther)
@@ -115,7 +113,7 @@ Standard_Boolean NIS_TriangulatedDrawer::IsEqual
//=======================================================================
//function : BeforeDraw
//purpose :
//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::BeforeDraw (const DrawType theType,
@@ -195,7 +193,7 @@ void NIS_TriangulatedDrawer::BeforeDraw (const DrawType theType,
//=======================================================================
//function : AfterDraw
//purpose :
//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::AfterDraw (const DrawType theType,
@@ -230,7 +228,7 @@ void NIS_TriangulatedDrawer::AfterDraw (const DrawType theType,
//=======================================================================
//function : Draw
//purpose :
//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::Draw (const Handle_NIS_InteractiveObject& theObj,

View File

@@ -25,10 +25,8 @@
#include <Visual3d_View.hxx>
#include <Bnd_B2f.hxx>
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
#ifdef WNT
#include <Windows.h>
#endif
#include <GL/gl.h>
#include <OpenGl_GlCore11.hxx>
IMPLEMENT_STANDARD_HANDLE (NIS_View, V3d_OrthographicView)
IMPLEMENT_STANDARD_RTTIEXT (NIS_View, V3d_OrthographicView)
@@ -40,7 +38,7 @@ IMPLEMENT_STANDARD_RTTIEXT (NIS_View, V3d_OrthographicView)
NIS_View::NIS_View (const Handle(V3d_Viewer)& theViewer,
const Handle(Aspect_Window)& theWindow)
: V3d_OrthographicView (theViewer),
: V3d_OrthographicView (theViewer),
myIsTopHilight(Standard_False),
myDoHilightSelected(Standard_True)
{
@@ -50,7 +48,7 @@ NIS_View::NIS_View (const Handle(V3d_Viewer)& theViewer,
//=======================================================================
//function : SetWindow
//purpose :
//purpose :
//=======================================================================
void NIS_View::SetWindow(const Handle(Aspect_Window) &theWindow)
@@ -69,7 +67,7 @@ void NIS_View::SetWindow(const Handle(Aspect_Window) &theWindow)
//=======================================================================
//function : AddContext
//purpose :
//purpose :
//=======================================================================
void NIS_View::AddContext (NIS_InteractiveContext * theCtx)
@@ -85,7 +83,7 @@ void NIS_View::AddContext (NIS_InteractiveContext * theCtx)
//=======================================================================
//function : RemoveContext
//purpose :
//purpose :
//=======================================================================
void NIS_View::RemoveContext (NIS_InteractiveContext * theCtx)
@@ -108,7 +106,7 @@ void NIS_View::RemoveContext (NIS_InteractiveContext * theCtx)
//=======================================================================
//function : FitAll3d
//purpose :
//purpose :
//=======================================================================
Standard_Boolean NIS_View::FitAll3d (const Quantity_Coefficient theCoef)
@@ -194,7 +192,7 @@ Standard_Boolean NIS_View::FitAll3d (const Quantity_Coefficient theCoef)
//=======================================================================
//function : GetBndBox
//purpose :
//purpose :
//=======================================================================
Bnd_B3f NIS_View::GetBndBox() const
@@ -226,13 +224,13 @@ Bnd_B3f NIS_View::GetBndBox() const
//=======================================================================
//function : GetBndBox
//purpose :
//purpose :
//=======================================================================
void NIS_View::GetBndBox( Standard_Integer& theXMin, Standard_Integer& theXMax,
void NIS_View::GetBndBox( Standard_Integer& theXMin, Standard_Integer& theXMax,
Standard_Integer& theYMin, Standard_Integer& theYMax ) const
{
theXMin = theYMin = 0;
theXMin = theYMin = 0;
theXMax = theYMax = -1;
Bnd_B3f aBox = GetBndBox();
@@ -260,23 +258,23 @@ void NIS_View::GetBndBox( Standard_Integer& theXMin, Standard_Integer& theXMax,
if (aLimp[0] < aLimp[1] && aLimp[2] < aLimp[3])
{
// Scale the view
// WindowFit (aLimp[0], aLimp[2], aLimp[1], aLimp[3]);
// WindowFit (aLimp[0], aLimp[2], aLimp[1], aLimp[3]);
theXMin = aLimp[0];
theXMax = aLimp[1];
theYMin = aLimp[2];
theYMax = aLimp[3];
}
}
}
}
//=======================================================================
//function : MyCallback
//purpose :
//purpose :
//=======================================================================
int NIS_View::MyCallback (Aspect_Drawable /* Window ID */,
void* ptrData,
void* ptrData,
Aspect_GraphicCallbackStruct* callData /* call data */)
{
// Avoid multiple rendering of the scene ( accordingly with update of
@@ -286,7 +284,7 @@ int NIS_View::MyCallback (Aspect_Drawable /* Window ID */,
// see comments to OCC_REDRAW_ADDITIONAL_CALLBACKS definition )
if (callData->reason & OCC_REDRAW_ADDITIONAL_CALLBACKS)
return 0;
const Handle(NIS_View) thisView (static_cast<NIS_View *> (ptrData));
NCollection_List<NIS_InteractiveContext *>::Iterator anIter;
#ifdef CLIP
@@ -387,7 +385,7 @@ int NIS_View::MyCallback (Aspect_Drawable /* Window ID */,
//=======================================================================
//function : DynamicHilight
//purpose :
//purpose :
//=======================================================================
void NIS_View::DynamicHilight (const Standard_Integer theX,
@@ -396,7 +394,7 @@ void NIS_View::DynamicHilight (const Standard_Integer theX,
myDetected.Clear();
const Handle(NIS_InteractiveObject) aSelected = Pick (theX, theY);
// ASV: if at least one Context returns IsSelectable()==False,
// ASV: if at least one Context returns IsSelectable()==False,
// hilight is canceled, this method returns
if (aSelected.IsNull() == Standard_False) {
if (aSelected->IsSelectable() == Standard_False)
@@ -411,7 +409,7 @@ void NIS_View::DynamicHilight (const Standard_Integer theX,
// 30.07.10 - NKV - synchronize behaviour with AIS interactive context (if need)
if (aSelected.IsNull() ||
(myDoHilightSelected == Standard_False &&
(myDoHilightSelected == Standard_False &&
aSelected->GetDrawer()->GetContext()->IsSelected(aSelected)))
{
myDynHilighted.Nullify();
@@ -427,7 +425,7 @@ void NIS_View::DynamicHilight (const Standard_Integer theX,
//=======================================================================
//function : DynamicUnhilight
//purpose :
//purpose :
//=======================================================================
void NIS_View::DynamicUnhilight(const Handle_NIS_InteractiveObject& theObj)
@@ -594,7 +592,7 @@ void NIS_View::Select (const NCollection_List<gp_XY> &thePolygon,
//=======================================================================
//function : Pick
//purpose :
//purpose :
//=======================================================================
Handle_NIS_InteractiveObject NIS_View::Pick (const Standard_Integer theX,
@@ -616,7 +614,7 @@ Handle_NIS_InteractiveObject NIS_View::Pick (const Standard_Integer theX,
//=======================================================================
//function : Pick
//purpose :
//purpose :
//=======================================================================
Handle_NIS_InteractiveObject NIS_View::Pick