X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FOpenGl%2FOpenGl_GraphicDriver_2.cxx;h=c81b1b6e57c95a90c311aee430fd2a223305d6b2;hb=2166f0fad8d7bd32bed2ce4b8766e115d7be63a8;hpb=1d2b1ccb453fcdf3aac0bdb2d5baf34dfb1cc4f9 diff --git a/src/OpenGl/OpenGl_GraphicDriver_2.cxx b/src/OpenGl/OpenGl_GraphicDriver_2.cxx index 1751db14b2..c81b1b6e57 100755 --- a/src/OpenGl/OpenGl_GraphicDriver_2.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver_2.cxx @@ -1,125 +1,40 @@ +// File: OpenGl_GraphicDriver_2.cxx +// Created: 20 October 2011 +// Author: Sergey ZERCHANINOV +// Copyright: OPEN CASCADE 2011 +#include -// File OpenGl_GraphicDriver_2.cxx -// Created Mardi 28 janvier 1997 -// Author CAL - -//-Copyright MatraDatavision 1997 - -//-Version - -//-Design Declaration des variables specifiques aux Drivers - -//-Warning Un driver encapsule les Pex et OpenGl drivers - -//-References - -//-Language C++ 2.0 - -//-Declarations - -// for the class -#include - -#include +#include +#include +#include #include -//-Aliases - -//-Global data definitions - -//-Methods, in order - -Standard_Integer OpenGl_GraphicDriver::InquireLightLimit () { - - if (MyTraceLevel) { - PrintFunction ("call_togl_inquirelight"); - } - Standard_Integer Result = call_togl_inquirelight (); - if (MyTraceLevel) { - PrintIResult ("call_togl_inquirelight", Result); - } - return Result; - +Standard_Integer OpenGl_GraphicDriver::InquireLightLimit () +{ + return (openglDisplay.IsNull()? 0 : openglDisplay->Facilities().MaxLights); } -void OpenGl_GraphicDriver::InquireMat (const Graphic3d_CView& ACView, TColStd_Array2OfReal& AMatO, TColStd_Array2OfReal& AMatM) { - - Graphic3d_CView MyCView = ACView; - - Standard_Integer i, j; - - CALL_DEF_MATRIX4X4 ori_matrix; - CALL_DEF_MATRIX4X4 map_matrix; - - if (MyTraceLevel) { - PrintFunction ("call_togl_inquiremat"); - PrintCView (MyCView, 1); - } - if (call_togl_inquiremat (&MyCView, ori_matrix, map_matrix) == 0) - for (i=0; i<=3; i++) - for (j=0; j<=3; j++) { - AMatO (i, j) = Standard_Real (ori_matrix[i][j]); - AMatM (i, j) = Standard_Real (map_matrix[i][j]); - } - else - for (i=0; i<=3; i++) - for (j=0; j<=3; j++) { - if (i == j) { - AMatM (i, j) = 1.0; - AMatO (i, j) = 1.0; - } - else { - AMatM (i, j) = 0.0; - AMatO (i, j) = 0.0; - } - } - - if (MyTraceLevel) { - PrintMatrix ("Orientation", AMatO); - PrintMatrix ("Mapping", AMatM); - } - +void OpenGl_GraphicDriver::InquireMat (const Graphic3d_CView& ACView, TColStd_Array2OfReal& AMatO, TColStd_Array2OfReal& AMatM) +{ + const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView; + if (aCView) + aCView->View->GetMatrices(AMatO,AMatM,ACView.Orientation.IsCustomMatrix); } -Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit () { - - if (MyTraceLevel) { - PrintFunction ("call_togl_inquireplane"); - } - Standard_Integer Result = call_togl_inquireplane (); - if (MyTraceLevel) { - PrintIResult ("call_togl_inquireplane", Result); - } - return Result; - +Standard_Integer OpenGl_GraphicDriver::InquireViewLimit () +{ + return (openglDisplay.IsNull()? 0 : openglDisplay->Facilities().MaxViews); } -Standard_Integer OpenGl_GraphicDriver::InquireViewLimit () { - - if (MyTraceLevel) { - PrintFunction ("call_togl_inquireview"); - } - Standard_Integer Result = call_togl_inquireview (); - if (MyTraceLevel) { - PrintIResult ("call_togl_inquireview", Result); - } - return Result; - +Standard_Boolean OpenGl_GraphicDriver::InquireTextureAvailable () +{ + return Standard_True; } - - -Standard_Boolean OpenGl_GraphicDriver::InquireTextureAvailable () { - - if (MyTraceLevel) { - PrintFunction ("call_togl_inquiretexture"); - } - Standard_Integer Result = call_togl_inquiretexture (); - if (MyTraceLevel) { - PrintIResult ("call_togl_inquiretexture", Result); - } - return Result; - +Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit () +{ + return call_togl_inquireplane(); } +