#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()
//=======================================================================
//function : ~NIS_DrawList
-//purpose :
+//purpose :
//=======================================================================
NIS_DrawList::~NIS_DrawList ()
//=======================================================================
//function : BeginPrepare
-//purpose :
+//purpose :
//=======================================================================
void NIS_DrawList::BeginPrepare (const Standard_Integer theType)
//=======================================================================
//function : EndPrepare
-//purpose :
+//purpose :
//=======================================================================
void NIS_DrawList::EndPrepare (const Standard_Integer theType)
//=======================================================================
//function : Call
-//purpose :
+//purpose :
//=======================================================================
void NIS_DrawList::Call (const Standard_Integer theType)
//=======================================================================
//function : SetDynHilighted
-//purpose :
+//purpose :
//=======================================================================
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
//=======================================================================
//function : SetUpdated
-//purpose :
+//purpose :
//=======================================================================
void NIS_DrawList::SetUpdated (const Standard_Integer theType)
#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,
//=======================================================================
//function : SetColor
-//purpose :
+//purpose :
//=======================================================================
void NIS_SurfaceDrawer::SetColor(const Quantity_Color &theColor)
//=======================================================================
//function : Assign
-//purpose :
+//purpose :
//=======================================================================
void NIS_SurfaceDrawer::Assign (const Handle_NIS_Drawer& theOther)
//=======================================================================
//function : redraw
-//purpose :
+//purpose :
//=======================================================================
void NIS_SurfaceDrawer::redraw (const DrawType theType,
//=======================================================================
//function : BeforeDraw
-//purpose :
+//purpose :
//=======================================================================
void NIS_SurfaceDrawer::BeforeDraw (const DrawType theType,
//=======================================================================
//function : AfterDraw
-//purpose :
+//purpose :
//=======================================================================
void NIS_SurfaceDrawer::AfterDraw (const DrawType theType,
//=======================================================================
//function : Draw
-//purpose :
+//purpose :
//=======================================================================
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)
//=======================================================================
//function : setColor
-//purpose :
+//purpose :
//=======================================================================
void setColor(GLenum theFace,
#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
// 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
//=======================================================================
//function : Assign
-//purpose :
+//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::Assign (const Handle_NIS_Drawer& theOther)
//=======================================================================
//function : BeforeDraw
-//purpose :
+//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::BeforeDraw (const DrawType theType,
//=======================================================================
//function : AfterDraw
-//purpose :
+//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::AfterDraw (const DrawType theType,
//=======================================================================
//function : Draw
-//purpose :
+//purpose :
//=======================================================================
void NIS_TriangulatedDrawer::Draw (const Handle_NIS_InteractiveObject& theObj,
#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)
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)
{
//=======================================================================
//function : SetWindow
-//purpose :
+//purpose :
//=======================================================================
void NIS_View::SetWindow(const Handle(Aspect_Window) &theWindow)
//=======================================================================
//function : AddContext
-//purpose :
+//purpose :
//=======================================================================
void NIS_View::AddContext (NIS_InteractiveContext * theCtx)
//=======================================================================
//function : RemoveContext
-//purpose :
+//purpose :
//=======================================================================
void NIS_View::RemoveContext (NIS_InteractiveContext * theCtx)
//=======================================================================
//function : FitAll3d
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean NIS_View::FitAll3d (const Quantity_Coefficient theCoef)
//=======================================================================
//function : GetBndBox
-//purpose :
+//purpose :
//=======================================================================
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();
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
// 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
//=======================================================================
//function : DynamicHilight
-//purpose :
+//purpose :
//=======================================================================
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)
// 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();
//=======================================================================
//function : DynamicUnhilight
-//purpose :
+//purpose :
//=======================================================================
void NIS_View::DynamicUnhilight(const Handle_NIS_InteractiveObject& theObj)
//=======================================================================
//function : Pick
-//purpose :
+//purpose :
//=======================================================================
Handle_NIS_InteractiveObject NIS_View::Pick (const Standard_Integer theX,
//=======================================================================
//function : Pick
-//purpose :
+//purpose :
//=======================================================================
Handle_NIS_InteractiveObject NIS_View::Pick
#include <InterfaceGraphic_Aspect.hxx>
#include <InterfaceGraphic_Visual3d.hxx>
-#include <GL/glu.h> // gluUnProject()
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
float xmin = 0.0f, ymin = 0.0f, zmin = 0.0f, xmax = 100.0f, ymax = 100.0f, zmax = 100.0f;
/* Normal of the view (not normalized!) */
-static float getNormal(float* normal)
+static float getNormal(float* normal)
{
GLint viewport[4];
GLdouble model_matrix[16], proj_matrix[16];
return normal[0] * (x - center[0]) + normal[1] * (y - center[1]) + normal[2] * (z - center[2]);
}
-static char getFarestCorner(float d000, float d100, float d010, float d001,
+static char getFarestCorner(float d000, float d100, float d010, float d001,
float d110, float d101, float d011, float d111)
{
- if (d000 > 0.0f &&
- d000 > d100 && d000 > d010 && d000 > d001 && d000 > d110 &&
+ if (d000 > 0.0f &&
+ d000 > d100 && d000 > d010 && d000 > d001 && d000 > d110 &&
d000 > d101 && d000 > d011 && d000 > d111)
{
return 1;
}
else if (d100 > 0.0f &&
- d100 > d000 && d100 > d010 && d100 > d001 && d100 > d110 &&
+ d100 > d000 && d100 > d010 && d100 > d001 && d100 > d110 &&
d100 > d101 && d100 > d011 && d100 > d111)
{
return 2;
}
else if (d010 > 0.0f &&
- d010 > d000 && d010 > d100 && d010 > d001 && d010 > d110 &&
+ d010 > d000 && d010 > d100 && d010 > d001 && d010 > d110 &&
d010 > d101 && d010 > d011 && d010 > d111)
{
return 3;
}
else if (d001 > 0.0f &&
- d001 > d000 && d001 > d100 && d001 > d010 && d001 > d110 &&
+ d001 > d000 && d001 > d100 && d001 > d010 && d001 > d110 &&
d001 > d101 && d001 > d011 && d001 > d111)
{
return 4;
}
else if (d110 > 0.0f &&
- d110 > d000 && d110 > d100 && d110 > d010 && d110 > d001 &&
+ d110 > d000 && d110 > d100 && d110 > d010 && d110 > d001 &&
d110 > d101 && d110 > d011 && d110 > d111)
{
return 5;
}
else if (d101 > 0.0f &&
- d101 > d000 && d101 > d100 && d101 > d010 && d101 > d001 &&
+ d101 > d000 && d101 > d100 && d101 > d010 && d101 > d001 &&
d101 > d110 && d101 > d011 && d101 > d111)
{
return 6;
}
else if (d011 > 0.0f &&
- d011 > d000 && d011 > d100 && d011 > d010 && d011 > d001 &&
+ d011 > d000 && d011 > d100 && d011 > d010 && d011 > d001 &&
d011 > d110 && d011 > d101 && d011 > d111)
{
return 7;
*/
}
-static void drawArrow(float x1, float y1, float z1,
+static void drawArrow(float x1, float y1, float z1,
float x2, float y2, float z2,
float xn, float yn, float zn)
{
{
glColor3fv(myXNameColor);
offset = myXAxisOffset + myXTickmarkLength;
- drawText(AWorkspace, myXName, myFontOfNames, myStyleOfNames, mySizeOfNames,
+ drawText(AWorkspace, myXName, myFontOfNames, myStyleOfNames, mySizeOfNames,
m1[0], m1[1] + offset * m2[1], m1[2] + offset * m2[2]);
}
{
sprintf(textValue, "%g", LX1[0] + i * step);
j = 0; while (wtextValue[j] = textValue[j]) j++;
- drawText(AWorkspace, wtextValue, myFontOfValues, myStyleOfValues, mySizeOfValues,
+ drawText(AWorkspace, wtextValue, myFontOfValues, myStyleOfValues, mySizeOfValues,
LX1[0] + i * step, m1[1] + offset * m2[1], m1[2] + offset * m2[2]);
i++;
}
{
glColor3fv(myYNameColor);
offset = myYAxisOffset + myYTickmarkLength;
- drawText(AWorkspace, myYName, myFontOfNames, myStyleOfNames, mySizeOfNames,
+ drawText(AWorkspace, myYName, myFontOfNames, myStyleOfNames, mySizeOfNames,
m1[0] + offset * m2[0], m1[1], m1[2] + offset * m2[2]);
}
{
sprintf(textValue, "%g", LY1[1] + i * step);
j = 0; while (wtextValue[j] = textValue[j]) j++;
- drawText(AWorkspace, wtextValue, myFontOfValues, myStyleOfValues, mySizeOfValues,
+ drawText(AWorkspace, wtextValue, myFontOfValues, myStyleOfValues, mySizeOfValues,
m1[0] + offset * m2[0], LY1[1] + i * step, m1[2] + offset * m2[2]);
i++;
}
{
glColor3fv(myZNameColor);
offset = myZAxisOffset + myZTickmarkLength;
- drawText(AWorkspace, myZName, myFontOfNames, myStyleOfNames, mySizeOfNames,
+ drawText(AWorkspace, myZName, myFontOfNames, myStyleOfNames, mySizeOfNames,
m1[0] + offset * m2[0], m1[1] + offset * m2[1], m1[2]);
}
{
sprintf(textValue, "%g", LZ1[2] + i * step);
j = 0; while (wtextValue[j] = textValue[j]) j++;
- drawText(AWorkspace, wtextValue, myFontOfValues, myStyleOfValues, mySizeOfValues,
+ drawText(AWorkspace, wtextValue, myFontOfValues, myStyleOfValues, mySizeOfValues,
m1[0] + offset * m2[0], m1[1] + offset * m2[1], LZ1[2] + i * step);
i++;
}
#include <OpenGl_AspectText.hxx>
#include <OpenGl_TextParam.hxx>
-#include <GL/glu.h>
-
/*----------------------------------------------------------------------*/
struct OpenGl_LAYER_PROP
// update if there are any modifications
if (strcmp (TheLayerProp.AspectText.Font(), Font) != 0 ||
(int)TheLayerProp.AspectText.DisplayType() != AType ||
- aSubColor.rgb[0] != (float)R ||
+ aSubColor.rgb[0] != (float)R ||
aSubColor.rgb[1] != (float)G ||
aSubColor.rgb[2] != (float)B)
{
glLogicOp(GL_XOR);
}
break;
-
+
// subtitle type
case Aspect_TODT_SUBTITLE:
{
gluUnProject (aWinX, aWinY + aDescent, aWinZ, aModelMatrix,
aProjMatrix, aViewport, &aCoordX[0], &aCoordY[0], &aCoordZ[0]);
- // right bottom corner
+ // right bottom corner
gluUnProject (aWinX + aWidth, aWinY + aDescent, aWinZ, aModelMatrix,
aProjMatrix, aViewport, &aCoordX[1], &aCoordY[1], &aCoordZ[1]);
aProjMatrix, aViewport, &aCoordX[2], &aCoordY[2], &aCoordZ[2]);
// left top corner
- gluUnProject (aWinX, aWinY + anAscent, aWinZ, aModelMatrix,
+ gluUnProject (aWinX, aWinY + anAscent, aWinZ, aModelMatrix,
aProjMatrix, aViewport, &aCoordX[3], &aCoordY[3], &aCoordZ[3]);
// draw colored plane and reset the color
gluUnProject (aWinX, aWinY, aWinZ, aModelMatrix, aProjMatrix,
aViewport, &aProjX, &aProjY, &aProjZ);
- gluUnProject (aWinX - 1, aWinY - 1, aWinZ, aModelMatrix, aProjMatrix,
+ gluUnProject (aWinX - 1, aWinY - 1, aWinZ, aModelMatrix, aProjMatrix,
aViewport, &aProjX, &aProjY, &aProjZ);
openglDisplay->RenderText(aWChStr, 1, (float)aProjX, (float)aProjY,
(float)aProjZ, &TheLayerProp.AspectText, &TheLayerProp.TextParam);
- gluUnProject (aWinX - 1, aWinY + 1, aWinZ, aModelMatrix, aProjMatrix,
+ gluUnProject (aWinX - 1, aWinY + 1, aWinZ, aModelMatrix, aProjMatrix,
aViewport, &aProjX, &aProjY, &aProjZ);
openglDisplay->RenderText(aWChStr, 1, (float)aProjX, (float)aProjY,
#include <OpenGl_Structure.hxx>
#include <OpenGl_Workspace.hxx>
-#include <GL/glu.h>
-
#if (defined(_WIN32) || defined(__WIN32__))
#define STATIC
#else
#include <OpenGl_Structure.hxx>
#include <OpenGl_Workspace.hxx>
-#include <GL/glu.h> // gluUnProject()
-
/*----------------------------------------------------------------------*/
OpenGl_Text::OpenGl_Text (const TCollection_ExtendedString& AText,
#include <OpenGl_View.hxx>
#include <OpenGl_Trihedron.hxx>
-#include <GL/glu.h> // gluNewQuadric()
-
IMPLEMENT_STANDARD_HANDLE(OpenGl_Trihedron,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Trihedron,MMgt_TShared)
#include <Graphic3d_TextureEnv.hxx>
-#include <GL/glu.h> // gluUnProject()
-
IMPLEMENT_STANDARD_HANDLE(OpenGl_View,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_View,MMgt_TShared)
#include <OpenGl_PrinterContext.hxx>
#include <OpenGl_Workspace.hxx>
-#include <GL/glu.h> // gluProject(), gluUnProject()
-
/*----------------------------------------------------------------------*/
//TelProjectionRaster in OpenGl_telem_util.cxx
#include <OpenGl_PrinterContext.hxx>
#include <OpenGl_Structure.hxx>
-#include <GL/glu.h> // gluBuild2DMipmaps()
-
#define EPSI 0.0001
static const GLfloat default_amb[4] = { 0.F, 0.F, 0.F, 1.F };
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
+#include <OpenGl_GlCore11.hxx>
+
#include <InterfaceGraphic.hxx>
#include <OpenGl_Window.hxx>
#include <Aspect_GraphicDeviceDefinitionError.hxx>
#include <TCollection_AsciiString.hxx>
-#include <GL/glu.h> // gluOrtho2D()
-
IMPLEMENT_STANDARD_HANDLE(OpenGl_Window,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Window,MMgt_TShared)
#include <OpenGl_View.hxx>
#include <OpenGl_Display.hxx>
-#include <GL/glu.h> // gluOrtho2D()
-
//10-05-96 : CAL ; Ajout d'un nouveau delta dans les copies de pixels (voir CALL_DEF_DELTA)
#define CALL_DEF_DELTA 10