0027916: Visualization - access violation occurs within AIS_ColoredShape::Compute...
authorkgv <kgv@opencascade.com>
Wed, 28 Sep 2016 17:18:25 +0000 (20:18 +0300)
committerapn <apn@opencascade.com>
Thu, 6 Oct 2016 09:16:28 +0000 (12:16 +0300)
AIS_ColoredShape::Compute() - add NULL shape check.
AIS presentations - removed redundant clearance within ::Compute()
which is always done in advance within PrsMgr_PresentationManager::Update().

30 files changed:
src/AIS/AIS_AngleDimension.cxx
src/AIS/AIS_Axis.cxx
src/AIS/AIS_Chamf2dDimension.cxx
src/AIS/AIS_Chamf3dDimension.cxx
src/AIS/AIS_Circle.cxx
src/AIS/AIS_ColoredShape.cxx
src/AIS/AIS_ConcentricRelation.cxx
src/AIS/AIS_DiameterDimension.cxx
src/AIS/AIS_EqualDistanceRelation.cxx
src/AIS/AIS_EqualRadiusRelation.cxx
src/AIS/AIS_FixRelation.cxx
src/AIS/AIS_IdenticRelation.cxx
src/AIS/AIS_LengthDimension.cxx
src/AIS/AIS_Line.cxx
src/AIS/AIS_MaxRadiusDimension.cxx
src/AIS/AIS_MidPointRelation.cxx
src/AIS/AIS_MinRadiusDimension.cxx
src/AIS/AIS_OffsetDimension.cxx
src/AIS/AIS_ParallelRelation.cxx
src/AIS/AIS_PerpendicularRelation.cxx
src/AIS/AIS_Plane.cxx
src/AIS/AIS_PlaneTrihedron.cxx
src/AIS/AIS_Point.cxx
src/AIS/AIS_PointCloud.cxx
src/AIS/AIS_RadiusDimension.cxx
src/AIS/AIS_Shape.cxx
src/AIS/AIS_SymmetricRelation.cxx
src/AIS/AIS_TangentRelation.cxx
src/AIS/AIS_TexturedShape.cxx
src/AIS/AIS_Trihedron.cxx

index c7a2be3..4bb905d 100644 (file)
@@ -594,7 +594,6 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
                                   const Handle(Prs3d_Presentation)& thePresentation,
                                   const Standard_Integer theMode)
 {
-  thePresentation->Clear();
   mySelectionGeom.Clear (theMode);
 
   if (!IsValid())
index ee9601d..d04e55e 100644 (file)
@@ -169,9 +169,6 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                       const Handle(Prs3d_Presentation)& aPresentation, 
                       const Standard_Integer)
 {
-  aPresentation->Clear();
-
-  //Pro.... : pas de prise en compte des axes lors du FITALL (jmi)
   aPresentation->SetInfiniteState (myInfiniteState);
 
   aPresentation->SetDisplayPriority(5);
index 1be69f4..1cad4d9 100644 (file)
@@ -104,8 +104,6 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
                                   const Handle(Prs3d_Presentation)& aPresentation, 
                                   const Standard_Integer)
 {
-    aPresentation->Clear();
-
     Handle(Geom_Curve) gcurv;
     gp_Pnt pfirst,plast;
     const TopoDS_Edge& thechamfedge = TopoDS::Edge(myFShape);
index 50d3a61..9cf07d2 100644 (file)
@@ -99,8 +99,6 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
                                   const Handle(Prs3d_Presentation)& aPresentation, 
                                   const Standard_Integer)
 {
-  aPresentation->Clear();
-
   //----------------------------
   // Calcul du centre de la face
   //----------------------------
index b337894..82254ca 100644 (file)
@@ -78,8 +78,6 @@ void AIS_Circle::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresenta
                          const Handle(Prs3d_Presentation)& aPresentation, 
                          const Standard_Integer /*aMode*/)
 {
-  aPresentation->Clear();
-
   aPresentation->SetDisplayPriority(5);
 
   if (myCircleIsArc) ComputeArc(aPresentation);
index e8f20dd..d092581 100644 (file)
@@ -299,7 +299,11 @@ void AIS_ColoredShape::Compute (const Handle(PrsMgr_PresentationManager3d)& ,
                                 const Handle(Prs3d_Presentation)&           thePrs,
                                 const Standard_Integer                      theMode)
 {
-  thePrs->Clear();
+  if (myshape.IsNull())
+  {
+    return;
+  }
+
   if (IsInfinite())
   {
     thePrs->SetInfiniteState (Standard_True);
index aa11bce..51445a9 100644 (file)
@@ -66,8 +66,6 @@ void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&
                                     const Handle(Prs3d_Presentation)& aPresentation, 
                                     const Standard_Integer)
 {
-  aPresentation->Clear();
-
   TopAbs_ShapeEnum type2(mySShape.ShapeType());
   aPresentation->SetInfiniteState(Standard_True);
   switch (myFShape.ShapeType()) {
index 0d679da..d9da0ea 100644 (file)
@@ -282,7 +282,6 @@ void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)&
                                      const Handle(Prs3d_Presentation)& thePresentation, 
                                      const Standard_Integer theMode)
 {
-  thePresentation->Clear();
   mySelectionGeom.Clear (theMode);
 
   if (!IsValid())
index f999dc3..6cd5b5d 100644 (file)
@@ -81,9 +81,6 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
                                         const Handle( Prs3d_Presentation )& aPresentation,
                                         const Standard_Integer ) 
 {
-
-  aPresentation->Clear();
-
   gp_Pnt Position12 =  myPosition, Position34 = myPosition;
 
   Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
index e055dad..4f903e8 100644 (file)
@@ -65,8 +65,6 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
                                       const Handle( Prs3d_Presentation )& aPresentation,
                                       const Standard_Integer ) 
 {
-  aPresentation->Clear();
-
   BRepAdaptor_Curve FirstCurve( TopoDS::Edge( myFShape ) ), SecondCurve( TopoDS::Edge( mySShape ) );
 
   Standard_Real FirstPar1 = FirstCurve.FirstParameter(), LastPar1 = FirstCurve.LastParameter(),
index 4497926..15737d9 100644 (file)
@@ -171,8 +171,6 @@ void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                              const Handle(Prs3d_Presentation)& aPresentation, 
                              const Standard_Integer)
 {
-  aPresentation->Clear();
-
   // Calculate position of the symbol and
   // point of attach of the segment on the shape
   gp_Pnt curpos;
index ad24346..203a800 100644 (file)
@@ -309,8 +309,6 @@ void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                  const Handle(Prs3d_Presentation)& aprs, 
                                  const Standard_Integer)
 {
-  aprs->Clear();
-
   switch ( myFShape.ShapeType() ) {
     
   case TopAbs_VERTEX:
index ad63207..7249c67 100755 (executable)
@@ -272,7 +272,6 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
                                    const Handle(Prs3d_Presentation)& thePresentation,
                                    const Standard_Integer theMode)
 {
-  thePresentation->Clear();
   mySelectionGeom.Clear (theMode);
 
   if (!IsValid())
index 93422d0..b9229cf 100644 (file)
@@ -117,8 +117,6 @@ void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                       const Handle(Prs3d_Presentation)& aPresentation, 
                       const Standard_Integer)
 {
-  aPresentation->Clear();
-
   aPresentation->SetDisplayPriority(5);
 
   if (!myLineIsSegment) ComputeInfiniteLine(aPresentation);
index 44eeb6d..9486fca 100644 (file)
@@ -104,8 +104,6 @@ void AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&
                                     const Handle(Prs3d_Presentation)& aPresentation, 
                                     const Standard_Integer /*aMode*/)
 {
-  aPresentation->Clear();
-
 //  if( myAutomaticPosition )
     {//ota : recompute in any case 
       ComputeGeometry();
index c64c5ad..910b960 100644 (file)
@@ -80,8 +80,6 @@ void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                   const Handle(Prs3d_Presentation)& aprs, 
                                   const Standard_Integer)
 {
-  aprs->Clear();
-  
   if (myTool.ShapeType() == TopAbs_VERTEX)
     {
       gp_Pnt pp;
index 3263f01..6c98841 100644 (file)
@@ -104,8 +104,6 @@ void AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&
                                     const Handle(Prs3d_Presentation)& aPresentation, 
                                     const Standard_Integer /*aMode*/)
 {
-  aPresentation->Clear();
-
 //  if( myAutomaticPosition )
     //{ //ota : recompute ellipse always
   ComputeGeometry();
index f41cbaa..a4232ad 100644 (file)
@@ -90,10 +90,6 @@ void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                  const Handle(Prs3d_Presentation)& aprs,
                                  const Standard_Integer)
 {
-  aprs->Clear();
-
-  //cout << endl << "This is strange Offset Dimension!" << endl;
-
   gp_Trsf aInvertTrsf = myRelativePos;
   //myArrowSize = fabs (myVal/5.);
   myArrowSize = fabs (myVal/10.0);
index 7ad8833..77a3220 100644 (file)
@@ -98,8 +98,6 @@ void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                   const Handle(Prs3d_Presentation)& aPresentation, 
                                   const Standard_Integer)
 {
-  aPresentation->Clear();
-
   switch (myFShape.ShapeType())
     {
     case TopAbs_FACE :
index 8d9f90e..4971b14 100644 (file)
@@ -86,8 +86,6 @@ void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3
                                        const Handle(Prs3d_Presentation)& aPresentation, 
                                        const Standard_Integer)
 {
-  aPresentation->Clear();
-
   if (myFShape.ShapeType() == mySShape.ShapeType()) {
     switch (myFShape.ShapeType()) {
     case TopAbs_FACE :
index 087cf1e..8608862 100644 (file)
@@ -238,8 +238,6 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
                        const Handle(Prs3d_Presentation)& aPresentation, 
                        const Standard_Integer aMode)
 {
-  aPresentation->Clear();
-
   ComputeFields();
   aPresentation->SetInfiniteState(myInfiniteState);
   myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(myCurrentMode == 0? 1 : 3);
index 9f6ae8e..728520d 100644 (file)
@@ -157,7 +157,6 @@ void AIS_PlaneTrihedron::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                    const Handle(Prs3d_Presentation)& aPresentation, 
                                    const Standard_Integer)
 {
-  aPresentation->Clear();
   aPresentation->SetDisplayPriority(5);
   // drawing axis in X direction
   gp_Pnt first, last;
index 7d752ee..916be5d 100644 (file)
@@ -79,8 +79,6 @@ void AIS_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
                         const Handle(Prs3d_Presentation)& aPresentation, 
                         const Standard_Integer aMode)
 {
-  aPresentation->Clear();
-
   aPresentation->SetInfiniteState(myInfiniteState);
 
   if (aMode==0)
index a9f8902..67038d8 100644 (file)
@@ -409,7 +409,6 @@ void AIS_PointCloud::Compute (const Handle(PrsMgr_PresentationManager3d)& /*theP
                               const Handle(Prs3d_Presentation)&           thePrs,
                               const Standard_Integer                      theMode)
 {
-  thePrs->Clear();
   switch (theMode)
   {
     case AIS_PointCloud::DM_Points:
index b1114e9..e4fd73d 100644 (file)
@@ -222,7 +222,6 @@ void AIS_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
                                    const Handle(Prs3d_Presentation)& thePresentation,
                                    const Standard_Integer theMode)
 {
-  thePresentation->Clear();
   mySelectionGeom.Clear (theMode);
 
   if (!IsValid())
index d0fc5d3..6024728 100644 (file)
@@ -123,7 +123,6 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
                         const Handle(Prs3d_Presentation)& aPrs,
                         const Standard_Integer theMode)
 {  
-  aPrs->Clear();
   if(myshape.IsNull()) return;
 
   // wire,edge,vertex -> pas de HLR + priorite display superieure
index 8865a9d..003b1d6 100644 (file)
@@ -77,8 +77,6 @@ void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                    const Handle(Prs3d_Presentation)& aprs, 
                                    const Standard_Integer)
 {
-  aprs->Clear();
-
   switch (myFShape.ShapeType()) {
   case TopAbs_FACE :
     {
index 9660554..d7bda08 100644 (file)
@@ -96,8 +96,6 @@ void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
                                  const Handle(Prs3d_Presentation)& aPresentation, 
                                  const Standard_Integer)
 {
-  aPresentation->Clear();
   switch (myFShape.ShapeType())
     {
     case TopAbs_FACE :
index aa53722..4b7ba3b 100644 (file)
@@ -397,8 +397,6 @@ void AIS_TexturedShape::Compute (const Handle(PrsMgr_PresentationManager3d)& /*t
                                  const Handle(Prs3d_Presentation)&           thePrs,
                                  const Standard_Integer                      theMode)
 {
-  thePrs->Clear();
-
   if (myshape.IsNull())
   {
     return;
index 27d5506..2bdee5f 100644 (file)
@@ -276,8 +276,6 @@ void AIS_Trihedron::Compute(
  const Handle(Prs3d_Presentation)& aPresentation, 
  const Standard_Integer aMode)
 {
-  aPresentation->Clear();
-
   aPresentation->SetInfiniteState (Standard_True);
   switch(aMode){
   case 0: