// Author: Sergey ZERCHANINOV
// Copyright: OPEN CASCADE 2011
+#include <OpenGl_tgl_all.hxx>
#include <OpenGl_Display.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <OpenGl_FontMgr.hxx>
-
+#include <OpenGl_PrinterContext.hxx>
#include <OpenGl_AspectText.hxx>
#ifdef HAVE_GL2PS
if( !aspect->IsZoomable() )
{
+#ifdef WNT
+ // if the context has assigned printer context, use it's parameters
+ OpenGl_PrinterContext* aPrinterContext =
+ OpenGl_PrinterContext::GetPrinterContext( GET_GL_CONTEXT() );
+ if( aPrinterContext )
+ {
+ // get printing scaling in x and y dimensions
+ GLfloat aTextScalex = 1, aTextScaley = 1;
+ aPrinterContext->GetScale( aTextScalex, aTextScaley );
+
+ // text should be scaled in all directions with same
+ // factor to save its proportions, so use height (y) scaling
+ // as it is better for keeping text/3d graphics proportions
+ glScalef( aTextScaley, aTextScaley, aTextScaley );
+ }
+#endif
glScaled( h, h, h );
}
else
if (!myGraduatedTrihedron.IsNull())
myGraduatedTrihedron->Render(AWorkspace);
+ // The applied aspects should be reset to make it possible to
+ // update gl state and bring it into line with currently set
+ // aspects by reapplying them. Reset should be done, because
+ // the glPopAttrib() will return original gl state while the
+ // internal TKOpenGl state stills unchanged.
+ AWorkspace->ResetAppliedAspect();
glPopAttrib(); // GL_FOG_BIT | GL_LIGHTING_BIT | GL_ENABLE_BIT
// Restore face culling
const OpenGl_AspectMarker* AspectMarker (const Standard_Boolean theWithApply);
const OpenGl_AspectText* AspectText (const Standard_Boolean theWithApply);
+ //! Clear the applied aspect state.
+ void ResetAppliedAspect();
+
//// RELATED TO FONTS ////
int FindFont (const char* theFontName,
}
/*----------------------------------------------------------------------*/
+
+//=======================================================================
+//function : ResetAppliedAspect
+//purpose :
+//=======================================================================
+
+void OpenGl_Workspace::ResetAppliedAspect()
+{
+ AspectLine_applied = NULL;
+ AspectFace_applied = NULL;
+ AspectMarker_applied = NULL;
+ AspectText_applied = NULL;
+ TextParam_applied = NULL;
+}