X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FVisual3d%2FVisual3d_View.cxx;h=960f7f723b78af9a27c6ea33f78363d02904f099;hp=26685b1badba9546f6021dc8707131c6cca22136;hb=4269bd1b11727b8b96277ac5dba823b46e5fec15;hpb=788cbaf4c4c90b6c1da67f55765abd3d1aa64e8f diff --git a/src/Visual3d/Visual3d_View.cxx b/src/Visual3d/Visual3d_View.cxx index 26685b1bad..960f7f723b 100755 --- a/src/Visual3d/Visual3d_View.cxx +++ b/src/Visual3d/Visual3d_View.cxx @@ -147,11 +147,6 @@ #include #include -#include -#include -#include -#include - #include #include @@ -198,10 +193,6 @@ Standard_Integer i, j; MyCView.DefWindow.IsDefined = 0; MyCView.Context.NbActiveLight = 0; - MyCView.Context.NbActivePlane = 0; -#ifdef GER61454 - MyCView.Context.ActivePlane = NULL; -#endif for (i=0; i<=3; i++) for (j=0; j<=3; j++) @@ -311,10 +302,6 @@ Standard_Integer i, j; MyCView.DefWindow.IsDefined = 0; MyCView.Context.NbActiveLight = 0; - MyCView.Context.NbActivePlane = 0; -#ifdef GER61454 - MyCView.Context.ActivePlane = NULL; -#endif for (i=0; i<=3; i++) for (j=0; j<=3; j++) @@ -863,64 +850,14 @@ Visual3d_TypeOfLightSource LightType=Visual3d_TOLS_AMBIENT; } -void Visual3d_View::UpdatePlanes () { - -Standard_Integer i, j; -CALL_DEF_PLANE *planes=NULL; - - i = MyContext.NumberOfActivatedClipPlanes (); - j = MyGraphicDriver->InquirePlaneLimit (); - MyCView.Context.NbActivePlane = (i > j ? j : i); - - if (MyCView.Context.NbActivePlane > 0) { - - // Dynamic Allocation -#ifdef GER61454 //Keep the plane address for the next Update ! - if( !MyCView.Context.ActivePlane ) - MyCView.Context.ActivePlane = new CALL_DEF_PLANE [j]; - planes = MyCView.Context.ActivePlane; -#else - planes = new CALL_DEF_PLANE [MyCView.Context.NbActivePlane]; - - MyCView.Context.ActivePlane = planes; -#endif -Standard_Real A, B, C, D; - - // Parcing of clipping planes - for (j=0; jIdentification ()); - - (MyContext.ActivatedClipPlane (j+1))->Plane (A, B, C, D); - planes[j].CoefA = float (A); - planes[j].CoefB = float (B); - planes[j].CoefC = float (C); - planes[j].CoefD = float (D); - } - - } - - // Management of planes of clipping model - if (! IsDeleted ()) - if (IsDefined ()) - MyGraphicDriver->SetPlane (MyCView); - - // Dynamic allocation -#ifdef GER61454 - if ( MyCView.Context.ActivePlane && (MyCView.Context.NbActivePlane == 0) - ) { - delete [] MyCView.Context.ActivePlane; - MyCView.Context.ActivePlane = NULL; - } -#else - if (MyCView.Context.NbActivePlane > 0) delete [] planes; -#endif +void Visual3d_View::UpdatePlanes() +{ + MyCView.Context.ClipPlanes = MyContext.GetClipPlanes(); + + if (IsDeleted() || !IsDefined()) + return; + MyGraphicDriver->SetClipPlanes (MyCView); } void Visual3d_View::SetBackground (const Aspect_Background& ABack) {