myVisualization(AContext.Visualization),
myIntShadingMethod(TEL_SM_GOURAUD),
myAntiAliasing(Standard_False),
- myAnimationListIndex(0),
- myAnimationListReady(Standard_False),
myTransPers(&myDefaultTransPers),
myIsTransPers(Standard_False),
- myResetFLIST(Standard_False)
+ myTrihedron(NULL),
+ myGraduatedTrihedron(NULL)
{
// Initialize matrices
memcpy(myOrientationMatrix,myDefaultMatrix,sizeof(Tmatrix3));
void OpenGl_View::ReleaseGlResources (const Handle(OpenGl_Context)& theCtx)
{
+ OpenGl_Element::Destroy (theCtx, myTrihedron);
+ OpenGl_Element::Destroy (theCtx, myGraduatedTrihedron);
+
if (!myTextureEnv.IsNull())
{
theCtx->DelayedRelease (myTextureEnv);
glDeleteTextures (1, (GLuint*)&(myBgTexture.TexId));
myBgTexture.TexId = 0;
}
- if (myAnimationListIndex)
- {
- glDeleteLists ((GLuint )myAnimationListIndex, 1);
- myAnimationListIndex = 0;
- }
}
void OpenGl_View::SetTextureEnv (const Handle(OpenGl_Context)& theCtx,
myTextureEnv = new OpenGl_Texture (theTexture->GetParams());
Handle(Image_PixMap) anImage = theTexture->GetImage();
- myTextureEnv->Init (theCtx, *anImage.operator->(), theTexture->Type());
+ if( !anImage.IsNull())
+ myTextureEnv->Init (theCtx, *anImage.operator->(), theTexture->Type());
}
/*----------------------------------------------------------------------*/
-void OpenGl_View::SetBackfacing (const Standard_Integer AMode)
+void OpenGl_View::SetBackfacing (const Standard_Integer theMode)
{
- myBackfacing = AMode;
- myResetFLIST = Standard_True;
+ myBackfacing = theMode;
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
-void OpenGl_View::TriedronDisplay (const Aspect_TypeOfTriedronPosition APosition, const Quantity_NameOfColor AColor,
- const Standard_Real AScale, const Standard_Boolean AsWireframe)
+void OpenGl_View::TriedronDisplay (const Handle(OpenGl_Context)& theCtx,
+ const Aspect_TypeOfTriedronPosition thePosition,
+ const Quantity_NameOfColor theColor,
+ const Standard_Real theScale,
+ const Standard_Boolean theAsWireframe)
{
- myTrihedron = new OpenGl_Trihedron (APosition, AColor, AScale, AsWireframe);
+ OpenGl_Element::Destroy (theCtx, myTrihedron);
+ myTrihedron = new OpenGl_Trihedron (thePosition, theColor, theScale, theAsWireframe);
}
/*----------------------------------------------------------------------*/
-void OpenGl_View::TriedronErase ()
+void OpenGl_View::TriedronErase (const Handle(OpenGl_Context)& theCtx)
{
- myTrihedron.Nullify();
+ OpenGl_Element::Destroy (theCtx, myTrihedron);
}
/*----------------------------------------------------------------------*/
-void OpenGl_View::GraduatedTrihedronDisplay (const Graphic3d_CGraduatedTrihedron &data)
+void OpenGl_View::GraduatedTrihedronDisplay (const Handle(OpenGl_Context)& theCtx,
+ const Graphic3d_CGraduatedTrihedron& theData)
{
- myGraduatedTrihedron = new OpenGl_GraduatedTrihedron(data);
+ OpenGl_Element::Destroy (theCtx, myGraduatedTrihedron);
+ myGraduatedTrihedron = new OpenGl_GraduatedTrihedron (theData);
}
/*----------------------------------------------------------------------*/
-void OpenGl_View::GraduatedTrihedronErase ()
+void OpenGl_View::GraduatedTrihedronErase (const Handle(OpenGl_Context)& theCtx)
{
- myGraduatedTrihedron.Nullify();
+ OpenGl_Element::Destroy (theCtx, myGraduatedTrihedron);
}
/*----------------------------------------------------------------------*/