]> OCCT Git - occt-copy.git/commitdiff
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 c7a2be3e063e3c88c68639edc3b07c256ffac3c2..4bb905d332c5a8177635970b8b6cc49b271402a6 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 ee9601d29f6a29d216ef73b867f862053a010d94..d04e55eb8746e6f530f1bd19ea7ba125ae066bf5 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 1be69f41bd453f3593e1946c6817213a1c66425a..1cad4d968b3a609e1fa5d774d7060a770c3436bf 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 50d3a615f860ae32495b960427a10e5053762876..9cf07d2ca93be66d4eb3573abcce0e6563a9b9d3 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 b33789431b61ca185f808dc4c863fd4cbe6c78c9..82254ca47df9885d1051ab4cc25006e1ee00f8f9 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 e8f20ddeda1d28b9e4ad56fbf074e5fd94656127..d0925817978a06eeebac62d188748290af815e6c 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 aa11bcebbd57344bb57451618cd4e2c704fdddcb..51445a906cc7486de85a543b34e3963eb189d5f2 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 0d679da64ef06198877a4eb7f4a843b62152ca13..d9da0eac9cdd204d52449751ec6f510284a53a61 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 f999dc37b231a87feb71929a0cc1d0d3f5d24d68..6cd5b5de9d113f0fb836166d69c3cac808e54816 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 e055dad667dba25696d85646c6b2a1d6d485c7ef..4f903e8f773f62b6ec6968025e94543aad41f448 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 4497926a63180ba4ed2af4e8cb6bada443160857..15737d9f425a3dbbf313c2558857c1797e552f53 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 ad243462a44b5391d5295e69d04fc534b74f7c37..203a8008ab97ea084d27a84b35af92e6ab37790a 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 ad6320769664e928f8a065b624c5b4fc6db43ae5..7249c67ec718642e073b7c3043b4e1798e80fbdf 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 93422d02db1a08bc3ace3a22e7a5bce39dc3a3c7..b9229cf3ef3787824a0ff8315bbf58cdd982ff1d 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 44eeb6d53217fcef136f2f20f23cb5041925ed4a..9486fcad2eb7e576a3c2f68d67e232aba5ede468 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 c64c5ad68c54b081c51e307e438e4db3694f6bc8..910b9600eaaef008e70f33280bd1e7bb01a121f0 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 3263f01da0f8baba8f96420e867eab06cf56db61..6c988411b0e979d5de8565369691c888e79f05b2 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 f41cbaa86b083348b1fef64a4932834ca2786606..a4232ad35ed0168af57f2f5be67effe716886bd3 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 7ad88331f4bfa867421661a31ed859ccedf3954b..77a3220921162ddd3e4d4df3d2549e43461f0afd 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 8d9f90e48cdc7def0a0a6fbac573f7ce27056aa2..4971b147a1c04cd08a10f53c51403301bce38a21 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 087cf1e28d45e1dad396635a3955ed8bed6338f5..86088627b8e2c734eedc63600a110b7edecc3a39 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 9f6ae8ea2fab271fd61acca414162361f9549855..728520d7e27715336fe21b25aa69d40ae5515c98 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 7d752ee8a4fca2e6960df3fc785d962bc4503129..916be5d52c87d527d142cfb6d399ea8e2ff00ff9 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 a9f89022ae2f4b90a663befa519d9237d5de949a..67038d8fb8002a1db935752b4d2ba311304ad7a9 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 b1114e9181650228160ca72d9db8f7cf690865a8..e4fd73d53230f0f5a950ba64ce43b29815c2d063 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 d0fc5d3fed32d27ac0d688b46e7551f88f81ae65..602472874c94a5bb449fb3a90c0a1aa587a84af8 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 8865a9dac77ab382cfeab5c00ddfa86cc54a9c08..003b1d668c70c365365228ef4496b94f36713715 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 966055400689e7197df92d1acd05b2ece1bc4252..d7bda0862c50aecdee66bee5d127a2c3998631eb 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 aa537220fe804031452dfb2c721bb4452857d05b..4b7ba3b4495d2cfbac2928d372a08e8faaeeca44 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 27d55068ee9568313f085d860eab589c157e1624..2bdee5f5797d9b221a22ce96d31b0cf172a1258d 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: