mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0022782: Uninitialized global variable used in conditionals in OpenGl package
This commit is contained in:
parent
695bdd1bbc
commit
529afc1a20
@ -11,10 +11,6 @@
|
|||||||
#include <Aspect_Drawable.hxx>
|
#include <Aspect_Drawable.hxx>
|
||||||
#include <Aspect_RenderingContext.hxx>
|
#include <Aspect_RenderingContext.hxx>
|
||||||
|
|
||||||
#define OCC_REDRAW_WINDOW 1
|
|
||||||
#define OCC_REDRAW_WINDOWAREA 2
|
|
||||||
#define OCC_REDRAW_BITMAP 3
|
|
||||||
|
|
||||||
// The flags below provide additional information to define the moment when
|
// The flags below provide additional information to define the moment when
|
||||||
// callback was invoked in redraw procedure. These flags are bitwise OR'ed
|
// callback was invoked in redraw procedure. These flags are bitwise OR'ed
|
||||||
// with the "reason" value of callback:
|
// with the "reason" value of callback:
|
||||||
|
@ -90,14 +90,4 @@ typedef struct {
|
|||||||
|
|
||||||
} CALL_DEF_LAYER;
|
} CALL_DEF_LAYER;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
#ifdef IMP100701
|
|
||||||
int depth;
|
|
||||||
#endif
|
|
||||||
Aspect_Drawable bitmap;
|
|
||||||
Aspect_RenderingContext bitmapContext;
|
|
||||||
} CALL_DEF_BITMAP;
|
|
||||||
|
|
||||||
#endif /* InterfaceGraphic_AspectHeader */
|
#endif /* InterfaceGraphic_AspectHeader */
|
||||||
|
@ -209,8 +209,6 @@ typedef struct {
|
|||||||
|
|
||||||
CALL_DEF_WINDOW DefWindow;
|
CALL_DEF_WINDOW DefWindow;
|
||||||
|
|
||||||
CALL_DEF_BITMAP DefBitmap;
|
|
||||||
|
|
||||||
void *ptrUnderLayer;
|
void *ptrUnderLayer;
|
||||||
void *ptrOverLayer;
|
void *ptrOverLayer;
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ void OpenGl_GraphicDriver::ClipLimit (const Graphic3d_CView& ACView, const Stand
|
|||||||
if (aCView)
|
if (aCView)
|
||||||
{
|
{
|
||||||
aCView->View->SetClipLimit(ACView);
|
aCView->View->SetClipLimit(ACView);
|
||||||
if (!AWait && !ACView.DefBitmap.bitmap)
|
if (!AWait)
|
||||||
{
|
{
|
||||||
aCView->WS->Resize(ACView.DefWindow);
|
aCView->WS->Resize(ACView.DefWindow);
|
||||||
aCView->WS->Invalidate();
|
aCView->WS->Invalidate();
|
||||||
@ -131,15 +131,6 @@ Standard_Boolean OpenGl_GraphicDriver::ProjectRaster (const Graphic3d_CView& ACV
|
|||||||
|
|
||||||
Standard_Integer aWidth = aCView->WS->Width();
|
Standard_Integer aWidth = aCView->WS->Width();
|
||||||
Standard_Integer aHeight = aCView->WS->Height();
|
Standard_Integer aHeight = aCView->WS->Height();
|
||||||
|
|
||||||
//if we want project something before to dump it into pixmap
|
|
||||||
//For right copution of projection before dumping to pixmap
|
|
||||||
if ( ACView.DefBitmap.bitmap )
|
|
||||||
{
|
|
||||||
aWidth = ACView.DefBitmap.width;
|
|
||||||
aHeight = ACView.DefBitmap.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_ShortReal xr, yr;
|
Standard_ShortReal xr, yr;
|
||||||
if (aCView->View->ProjectObjectToRaster(aWidth, aHeight, AX, AY, AZ, xr, yr))
|
if (aCView->View->ProjectObjectToRaster(aWidth, aHeight, AX, AY, AZ, xr, yr))
|
||||||
{
|
{
|
||||||
@ -180,12 +171,11 @@ Standard_Boolean OpenGl_GraphicDriver::UnProjectRasterWithRay (const Graphic3d_C
|
|||||||
return aCView->View->ProjectRasterToObjectWithRay( aWidth, aHeight, AU, AYM-Aym-AV, Ax, Ay, Az, Dx, Dy, Dz );
|
return aCView->View->ProjectRasterToObjectWithRay( aWidth, aHeight, AU, AYM-Aym-AV, Ax, Ay, Az, Dx, Dy, Dz );
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::RatioWindow (const Graphic3d_CView& ACView)
|
void OpenGl_GraphicDriver::RatioWindow (const Graphic3d_CView& theCView)
|
||||||
{
|
{
|
||||||
const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
|
const OpenGl_CView* aCView = (const OpenGl_CView* )theCView.ptrView;
|
||||||
if (!aCView)
|
if (aCView != NULL)
|
||||||
if( !ACView.DefBitmap.bitmap )
|
aCView->WS->Resize (theCView.DefWindow);
|
||||||
aCView->WS->Resize(ACView.DefWindow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::Redraw (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height)
|
void OpenGl_GraphicDriver::Redraw (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height)
|
||||||
@ -478,7 +468,7 @@ void OpenGl_GraphicDriver::ViewMapping (const Graphic3d_CView& ACView, const Sta
|
|||||||
if (aCView)
|
if (aCView)
|
||||||
{
|
{
|
||||||
aCView->View->SetMapping(ACView);
|
aCView->View->SetMapping(ACView);
|
||||||
if (!AWait && !ACView.DefBitmap.bitmap)
|
if (!AWait)
|
||||||
{
|
{
|
||||||
aCView->WS->Resize(ACView.DefWindow);
|
aCView->WS->Resize(ACView.DefWindow);
|
||||||
aCView->WS->Invalidate();
|
aCView->WS->Invalidate();
|
||||||
@ -492,7 +482,7 @@ void OpenGl_GraphicDriver::ViewOrientation (const Graphic3d_CView& ACView, const
|
|||||||
if (aCView)
|
if (aCView)
|
||||||
{
|
{
|
||||||
aCView->View->SetOrientation(ACView);
|
aCView->View->SetOrientation(ACView);
|
||||||
if (!AWait && !ACView.DefBitmap.bitmap)
|
if (!AWait)
|
||||||
{
|
{
|
||||||
aCView->WS->Resize(ACView.DefWindow);
|
aCView->WS->Resize(ACView.DefWindow);
|
||||||
aCView->WS->Invalidate();
|
aCView->WS->Invalidate();
|
||||||
|
@ -24,6 +24,5 @@
|
|||||||
#define OPENGL_NS_FORBIDSETTEX (1<<14)
|
#define OPENGL_NS_FORBIDSETTEX (1<<14)
|
||||||
#define OPENGL_NS_FLIST (1<<15)
|
#define OPENGL_NS_FLIST (1<<15)
|
||||||
#define OPENGL_NS_WHITEBACK (1<<16)
|
#define OPENGL_NS_WHITEBACK (1<<16)
|
||||||
#define OPENGL_NS_ISBITMAP (1<<17)
|
|
||||||
|
|
||||||
#endif //_OpenGl_NamedStatus_Header
|
#endif //_OpenGl_NamedStatus_Header
|
||||||
|
@ -1200,14 +1200,12 @@ D = -[Px,Py,Pz] dot |Nx|
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Step 6: Draw overlayer
|
// Step 6: Draw overlayer
|
||||||
// Redrawing to bitmap or window?
|
const int aMode = 0;
|
||||||
const int amode = (AWorkspace->NamedStatus & OPENGL_NS_ISBITMAP)? OCC_REDRAW_BITMAP : OCC_REDRAW_WINDOW;
|
AWorkspace->DisplayCallback (ACView, (aMode | OCC_PRE_OVERLAY));
|
||||||
|
|
||||||
AWorkspace->DisplayCallback(ACView,(amode | OCC_PRE_OVERLAY));
|
|
||||||
|
|
||||||
RedrawLayer2d(AWorkspace, ACView, ACOverLayer);
|
RedrawLayer2d(AWorkspace, ACView, ACOverLayer);
|
||||||
|
|
||||||
AWorkspace->DisplayCallback(ACView,amode);
|
AWorkspace->DisplayCallback (ACView, aMode);
|
||||||
|
|
||||||
// Restore clipping planes
|
// Restore clipping planes
|
||||||
for ( ptrPlane = oldPlanes, planeid = GL_CLIP_PLANE0; planeid < lastid; planeid++, ptrPlane++ )
|
for ( ptrPlane = oldPlanes, planeid = GL_CLIP_PLANE0; planeid < lastid; planeid++, ptrPlane++ )
|
||||||
@ -1278,15 +1276,8 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, con
|
|||||||
|| ACLayer.ptrLayer == NULL
|
|| ACLayer.ptrLayer == NULL
|
||||||
|| ACLayer.ptrLayer->listIndex == 0) return;
|
|| ACLayer.ptrLayer->listIndex == 0) return;
|
||||||
|
|
||||||
GLsizei dispWidth, dispHeight;
|
GLsizei dispWidth = (GLsizei )ACLayer.viewport[0];
|
||||||
if ( ACView.DefBitmap.bitmap ) {
|
GLsizei dispHeight = (GLsizei )ACLayer.viewport[1];
|
||||||
dispWidth = ACView.DefBitmap.width;
|
|
||||||
dispHeight = ACView.DefBitmap.height;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dispWidth = (GLsizei) ACLayer.viewport[0];
|
|
||||||
dispHeight = (GLsizei) ACLayer.viewport[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
const GLboolean isl = glIsEnabled(GL_LIGHTING); /*OCC6247*/
|
const GLboolean isl = glIsEnabled(GL_LIGHTING); /*OCC6247*/
|
||||||
if (isl)
|
if (isl)
|
||||||
|
@ -566,7 +566,6 @@ Standard_Boolean OpenGl_Workspace::Print
|
|||||||
bool isDone = true;
|
bool isDone = true;
|
||||||
|
|
||||||
// Set up status for printing
|
// Set up status for printing
|
||||||
NamedStatus |= OPENGL_NS_ISBITMAP;
|
|
||||||
if (!showBackground)
|
if (!showBackground)
|
||||||
NamedStatus |= OPENGL_NS_WHITEBACK;
|
NamedStatus |= OPENGL_NS_WHITEBACK;
|
||||||
|
|
||||||
@ -750,7 +749,7 @@ Standard_Boolean OpenGl_Workspace::Print
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Reset status after printing
|
// Reset status after printing
|
||||||
NamedStatus &= ~(OPENGL_NS_WHITEBACK | OPENGL_NS_ISBITMAP);
|
NamedStatus &= ~OPENGL_NS_WHITEBACK;
|
||||||
|
|
||||||
return (Standard_Boolean) isDone;
|
return (Standard_Boolean) isDone;
|
||||||
|
|
||||||
|
@ -278,7 +278,6 @@ Standard_Real um, vm, uM, vM;
|
|||||||
MyCView.Backfacing = 0;
|
MyCView.Backfacing = 0;
|
||||||
#endif // G003
|
#endif // G003
|
||||||
|
|
||||||
MyCView.DefBitmap.bitmap = 0;
|
|
||||||
MyCView.ptrUnderLayer = 0;
|
MyCView.ptrUnderLayer = 0;
|
||||||
MyCView.ptrOverLayer = 0;
|
MyCView.ptrOverLayer = 0;
|
||||||
MyCView.GContext = 0;
|
MyCView.GContext = 0;
|
||||||
@ -421,7 +420,6 @@ Standard_Real um, vm, uM, vM;
|
|||||||
ComputedModeIsActive = Standard_False;
|
ComputedModeIsActive = Standard_False;
|
||||||
#endif // G003
|
#endif // G003
|
||||||
|
|
||||||
MyCView.DefBitmap.bitmap = 0;
|
|
||||||
MyCView.ptrUnderLayer = 0;
|
MyCView.ptrUnderLayer = 0;
|
||||||
MyCView.ptrOverLayer = 0;
|
MyCView.ptrOverLayer = 0;
|
||||||
MyCView.GContext = 0;
|
MyCView.GContext = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user