diff --git a/src/Adaptor2d/Adaptor2d_Curve2dPtr.hxx b/src/Adaptor2d/Adaptor2d_Curve2dPtr.hxx deleted file mode 100644 index 1c781d4de8..0000000000 --- a/src/Adaptor2d/Adaptor2d_Curve2dPtr.hxx +++ /dev/null @@ -1,23 +0,0 @@ -// Created on: 1992-10-08 -// Created by: Isabelle GRIGNON -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Adaptor2d_Curve2dPtr_HeaderFile -#define _Adaptor2d_Curve2dPtr_HeaderFile - -class Adaptor2d_Curve2d; -typedef Adaptor2d_Curve2d* Adaptor2d_Curve2dPtr; - -#endif // _Adaptor2d_Curve2dPtr_HeaderFile diff --git a/src/Adaptor2d/FILES b/src/Adaptor2d/FILES index c202b55999..7096ea29d6 100644 --- a/src/Adaptor2d/FILES +++ b/src/Adaptor2d/FILES @@ -1,6 +1,5 @@ Adaptor2d_Curve2d.cxx Adaptor2d_Curve2d.hxx -Adaptor2d_Curve2dPtr.hxx Adaptor2d_GenHCurve2d.gxx Adaptor2d_GenHCurve2d.lxx Adaptor2d_HCurve2d.cxx diff --git a/src/BRepAdaptor/BRepAdaptor_Curve.cxx b/src/BRepAdaptor/BRepAdaptor_Curve.cxx index 4960d8deb2..4b75698d01 100644 --- a/src/BRepAdaptor/BRepAdaptor_Curve.cxx +++ b/src/BRepAdaptor/BRepAdaptor_Curve.cxx @@ -74,6 +74,18 @@ BRepAdaptor_Curve::BRepAdaptor_Curve(const TopoDS_Edge& E, Initialize(E,F); } +//======================================================================= +//function : Reset +//purpose : +//======================================================================= +void BRepAdaptor_Curve::Reset() +{ + myCurve.Reset(); + myConSurf.Nullify(); + myEdge.Nullify(); + myTrsf = gp_Trsf(); +} + //======================================================================= //function : Initialize //purpose : diff --git a/src/BRepAdaptor/BRepAdaptor_Curve.hxx b/src/BRepAdaptor/BRepAdaptor_Curve.hxx index 96a87a73a6..640505d6f7 100644 --- a/src/BRepAdaptor/BRepAdaptor_Curve.hxx +++ b/src/BRepAdaptor/BRepAdaptor_Curve.hxx @@ -86,7 +86,10 @@ public: //! is raised if the edge does not have a pcurve on //! the face. Standard_EXPORT BRepAdaptor_Curve(const TopoDS_Edge& E, const TopoDS_Face& F); - + + //! Reset currently loaded curve (undone Load()). + Standard_EXPORT void Reset(); + //! Sets the Curve to acces to the geometry of //! edge . Standard_EXPORT void Initialize (const TopoDS_Edge& E); diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx index ad98572264..63bb4420f1 100644 --- a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx @@ -168,6 +168,19 @@ Geom2dAdaptor_Curve::Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& theCrv, Load(theCrv, theUFirst, theULast); } +//======================================================================= +//function : Reset +//purpose : +//======================================================================= +void Geom2dAdaptor_Curve::Reset() +{ + myTypeCurve = GeomAbs_OtherCurve; + myCurve.Nullify(); + myCurveCache.Nullify(); + myNestedEvaluator.Nullify(); + myBSplineCurve.Nullify(); + myFirst = myLast = 0.0; +} //======================================================================= //function : Load diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx index 6ecbf6a5c4..a230c342f6 100644 --- a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.hxx @@ -68,7 +68,10 @@ public: //! ConstructionError is raised if Ufirst>Ulast Standard_EXPORT Geom2dAdaptor_Curve(const Handle(Geom2d_Curve)& C, const Standard_Real UFirst, const Standard_Real ULast); - + + //! Reset currently loaded curve (undone Load()). + Standard_EXPORT void Reset(); + void Load (const Handle(Geom2d_Curve)& C); //! ConstructionError is raised if Ufirst>Ulast diff --git a/src/GeomAdaptor/GeomAdaptor_Curve.cxx b/src/GeomAdaptor/GeomAdaptor_Curve.cxx index 0215eefe66..89f9f57f98 100644 --- a/src/GeomAdaptor/GeomAdaptor_Curve.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Curve.cxx @@ -124,6 +124,19 @@ GeomAbs_Shape GeomAdaptor_Curve::LocalContinuity(const Standard_Real U1, } } +//======================================================================= +//function : Reset +//purpose : +//======================================================================= +void GeomAdaptor_Curve::Reset() +{ + myTypeCurve = GeomAbs_OtherCurve; + myCurve.Nullify(); + myNestedEvaluator.Nullify(); + myBSplineCurve.Nullify(); + myCurveCache.Nullify(); + myFirst = myLast = 0.0; +} //======================================================================= //function : Load diff --git a/src/GeomAdaptor/GeomAdaptor_Curve.hxx b/src/GeomAdaptor/GeomAdaptor_Curve.hxx index 690480906c..6e138872a6 100644 --- a/src/GeomAdaptor/GeomAdaptor_Curve.hxx +++ b/src/GeomAdaptor/GeomAdaptor_Curve.hxx @@ -70,7 +70,10 @@ public: //! ConstructionError is raised if Ufirst>Ulast GeomAdaptor_Curve(const Handle(Geom_Curve)& C, const Standard_Real UFirst, const Standard_Real ULast); - + + //! Reset currently loaded curve (undone Load()). + Standard_EXPORT void Reset(); + void Load (const Handle(Geom_Curve)& C); //! ConstructionError is raised if Ufirst>Ulast diff --git a/src/StdPrs/StdPrs_Isolines.cxx b/src/StdPrs/StdPrs_Isolines.cxx index 8a7227fb68..6a5febf137 100644 --- a/src/StdPrs/StdPrs_Isolines.cxx +++ b/src/StdPrs/StdPrs_Isolines.cxx @@ -387,12 +387,7 @@ void StdPrs_Isolines::addOnSurface (const Handle(BRepAdaptor_HSurface)& theSurfa for (anEdgeTool.Init(); anEdgeTool.More(); anEdgeTool.Next()) { TopAbs_Orientation anOrientation = anEdgeTool.Orientation(); - if (anOrientation != TopAbs_FORWARD && anOrientation != TopAbs_REVERSED) - { - continue; - } - - Adaptor2d_Curve2dPtr anEdgeCurve = anEdgeTool.Value(); + const Adaptor2d_Curve2d* anEdgeCurve = &anEdgeTool.Value(); if (anEdgeCurve->GetType() != GeomAbs_Line) { GCPnts_QuasiUniformDeflection aSampler (*anEdgeCurve, aSamplerDeflection); diff --git a/src/StdPrs/StdPrs_ToolRFace.cxx b/src/StdPrs/StdPrs_ToolRFace.cxx index 464c617dd2..5450da2f8f 100644 --- a/src/StdPrs/StdPrs_ToolRFace.cxx +++ b/src/StdPrs/StdPrs_ToolRFace.cxx @@ -12,114 +12,59 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include #include #include -#include -#include #include //======================================================================= //function : StdPrs_ToolRFace -//purpose : +//purpose : //======================================================================= StdPrs_ToolRFace::StdPrs_ToolRFace() +: myHasNullCurves (Standard_False) { } //======================================================================= //function : StdPrs_ToolRFace -//purpose : +//purpose : //======================================================================= - -StdPrs_ToolRFace::StdPrs_ToolRFace(const Handle(BRepAdaptor_HSurface)& aSurface) : - myFace(((BRepAdaptor_Surface*)&(aSurface->Surface()))->Face()) +StdPrs_ToolRFace::StdPrs_ToolRFace (const Handle(BRepAdaptor_HSurface)& theSurface) +: myFace (theSurface->ChangeSurface().Face()), + myHasNullCurves (Standard_False) { myFace.Orientation(TopAbs_FORWARD); } //======================================================================= -//function : IsOriented -//purpose : +//function : next +//purpose : //======================================================================= - -Standard_Boolean StdPrs_ToolRFace::IsOriented () const { - - return Standard_True; - -} - -//======================================================================= -//function : Init -//purpose : -//======================================================================= - -void StdPrs_ToolRFace::Init() +void StdPrs_ToolRFace::next() { - myExplorer.Init(myFace,TopAbs_EDGE); - if (myExplorer.More()) { - Standard_Real U1,U2; - const Handle(Geom2d_Curve)& C = - BRep_Tool::CurveOnSurface(TopoDS::Edge(myExplorer.Current()), - myFace, - U1,U2); - DummyCurve.Load(C,U1,U2); - } -} - -//======================================================================= -//function : More -//purpose : -//======================================================================= - -Standard_Boolean StdPrs_ToolRFace::More() const -{ - return myExplorer.More(); -} - -//======================================================================= -//function : Next -//purpose : -//======================================================================= - -void StdPrs_ToolRFace::Next() -{ - myExplorer.Next(); - - if (myExplorer.More()) { + Standard_Real aParamU1, aParamU2; + for (; myExplorer.More(); myExplorer.Next()) + { // skip INTERNAL and EXTERNAL edges - while (myExplorer.More() && (myExplorer.Current().Orientation() == TopAbs_INTERNAL - || myExplorer.Current().Orientation() == TopAbs_EXTERNAL)) - myExplorer.Next(); - if (myExplorer.More()) { - Standard_Real U1,U2; - const Handle(Geom2d_Curve)& C = - BRep_Tool::CurveOnSurface(TopoDS::Edge(myExplorer.Current()), - myFace, - U1,U2); - if ( !C.IsNull() ) - DummyCurve.Load(C,U1,U2); + if (myExplorer.Current().Orientation() != TopAbs_FORWARD + && myExplorer.Current().Orientation() != TopAbs_REVERSED) + { + continue; + } + + if (Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface (TopoDS::Edge (myExplorer.Current()), myFace, aParamU1, aParamU2)) + { + myCurve.Load (aCurve, aParamU1, aParamU2); + return; + } + else + { + myHasNullCurves = Standard_True; } } + + myCurve.Reset(); } - -//======================================================================= -//function : Value -//purpose : -//======================================================================= - -Adaptor2d_Curve2dPtr StdPrs_ToolRFace::Value() const -{ - return (Adaptor2d_Curve2dPtr)&DummyCurve; -} - -//======================================================================= -//function : Orientation -//purpose : -//======================================================================= - -TopAbs_Orientation StdPrs_ToolRFace::Orientation () const { - return myExplorer.Current().Orientation(); -} - diff --git a/src/StdPrs/StdPrs_ToolRFace.hxx b/src/StdPrs/StdPrs_ToolRFace.hxx index 6a5e837de3..09cfdfd226 100644 --- a/src/StdPrs/StdPrs_ToolRFace.hxx +++ b/src/StdPrs/StdPrs_ToolRFace.hxx @@ -24,60 +24,64 @@ #include #include #include -#include -#include #include class BRepAdaptor_HSurface; - - +//! Iterator over 2D curves restricting a face (skipping internal/external edges). +//! In addition, the algorithm skips NULL curves - IsInvalidGeometry() can be checked if this should be handled within algorithm. class StdPrs_ToolRFace { public: DEFINE_STANDARD_ALLOC - + //! Empty constructor. Standard_EXPORT StdPrs_ToolRFace(); - + + //! Constructor with initialization. Standard_EXPORT StdPrs_ToolRFace(const Handle(BRepAdaptor_HSurface)& aSurface); - Standard_EXPORT Standard_Boolean IsOriented() const; + //! Return TRUE indicating that iterator looks only for oriented edges. + Standard_Boolean IsOriented() const { return Standard_True; } - Standard_EXPORT void Init(); - - Standard_EXPORT Standard_Boolean More() const; - - Standard_EXPORT void Next(); - - Standard_EXPORT Adaptor2d_Curve2dPtr Value() const; - - Standard_EXPORT TopAbs_Orientation Orientation() const; + //! Move iterator to the first element. + void Init() + { + myExplorer.Init (myFace, TopAbs_EDGE); + next(); + } + //! Return TRUE if iterator points to the curve. + Standard_Boolean More() const { return myExplorer.More(); } + //! Go to the next curve in the face. + void Next() + { + myExplorer.Next(); + next(); + } + //! Return current curve. + const Adaptor2d_Curve2d& Value() const { return myCurve; } -protected: - - - + //! Return current edge orientation. + TopAbs_Orientation Orientation() const { return myExplorer.Current().Orientation(); } + //! Return TRUE if NULL curves have been skipped. + Standard_Boolean IsInvalidGeometry() const { return myHasNullCurves; } private: + //! Find nearest valid item for the iterator. + Standard_EXPORT void next(); +private: TopoDS_Face myFace; TopExp_Explorer myExplorer; - Geom2dAdaptor_Curve DummyCurve; - + Geom2dAdaptor_Curve myCurve; + Standard_Boolean myHasNullCurves; }; - - - - - - #endif // _StdPrs_ToolRFace_HeaderFile diff --git a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx index 40520ee732..d212da923d 100644 --- a/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx +++ b/src/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx @@ -146,8 +146,7 @@ void StdPrs_WFDeflectionRestrictedFace::Add for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { TopAbs_Orientation Orient = ToolRst.Orientation(); - if ( Orient == TopAbs_FORWARD || Orient == TopAbs_REVERSED ) { - Adaptor2d_Curve2dPtr TheRCurve = ToolRst.Value(); + const Adaptor2d_Curve2d* TheRCurve = &ToolRst.Value(); if (TheRCurve->GetType() != GeomAbs_Line) { GCPnts_QuasiUniformDeflection UDP(*TheRCurve, ddefle); if (UDP.IsDone()) { @@ -180,7 +179,6 @@ void StdPrs_WFDeflectionRestrictedFace::Add tabP.Append(P1); } } - } } #ifdef OCCT_DEBUG else { @@ -385,7 +383,7 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::Match UMax = VMax = RealFirst(); for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { - Adaptor2d_Curve2dPtr TheRCurve = ToolRst.Value(); + const Adaptor2d_Curve2d* TheRCurve = &ToolRst.Value(); u = TheRCurve->FirstParameter(); v = TheRCurve->LastParameter(); step = ( v - u) / nbPoints; @@ -438,8 +436,7 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::Match gp_Pnt dummypnt; for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { TopAbs_Orientation Orient = ToolRst.Orientation(); - if ( Orient == TopAbs_FORWARD || Orient == TopAbs_REVERSED ) { - Adaptor2d_Curve2dPtr TheRCurve = ToolRst.Value(); + const Adaptor2d_Curve2d* TheRCurve = &ToolRst.Value(); GCPnts_QuasiUniformDeflection UDP(*TheRCurve, Deflection); if (UDP.IsDone()) { Standard_Integer NumberOfPoints = UDP.NbPoints(); @@ -462,7 +459,6 @@ Standard_Boolean StdPrs_WFDeflectionRestrictedFace::Match cout << "Cannot evaluate curve on surface"<FirstParameter(); + anU2 = aRCurve->LastParameter(); + if (aRCurve->GetType() != GeomAbs_Line) { - Adaptor2d_Curve2dPtr aRCurve = aToolRst.Value(); - anU1 = aRCurve->FirstParameter(); - anU2 = aRCurve->LastParameter(); - if (aRCurve->GetType() != GeomAbs_Line) + aDU = (anU2-anU1)/(aNbPoints-1); + aPoint2 = aRCurve->Value(anU1); + for (anI = 2; anI <= aNbPoints; ++anI) { - aDU = (anU2-anU1)/(aNbPoints-1); - aPoint2 = aRCurve->Value(anU1); - for (anI = 2; anI <= aNbPoints; ++anI) - { - anU = anU1 + (anI-1)*aDU; - aPoint1 = aPoint2; - aPoint2 = aRCurve->Value(anU); - if(anOrientation == TopAbs_FORWARD ) - anIsoBuild.Trim(aPoint1,aPoint2); - else - anIsoBuild.Trim(aPoint2,aPoint1); - } - } - else { - aPoint1 = aRCurve->Value(anU1); - aPoint2 = aRCurve->Value(anU2); + anU = anU1 + (anI-1)*aDU; + aPoint1 = aPoint2; + aPoint2 = aRCurve->Value(anU); if(anOrientation == TopAbs_FORWARD ) anIsoBuild.Trim(aPoint1,aPoint2); else anIsoBuild.Trim(aPoint2,aPoint1); } } + else { + aPoint1 = aRCurve->Value(anU1); + aPoint2 = aRCurve->Value(anU2); + if(anOrientation == TopAbs_FORWARD ) + anIsoBuild.Trim(aPoint1,aPoint2); + else + anIsoBuild.Trim(aPoint2,aPoint1); + } } // Draw the isos @@ -243,7 +240,7 @@ Standard_Boolean StdPrs_WFRestrictedFace::Match for (aToolRst.Init(); aToolRst.More(); aToolRst.Next()) { - Adaptor2d_Curve2dPtr aRCurve = aToolRst.Value(); + const Adaptor2d_Curve2d* aRCurve = &aToolRst.Value(); anU = aRCurve->FirstParameter(); aV = aRCurve->LastParameter(); if (aRCurve->GetType() != GeomAbs_Line) @@ -319,32 +316,29 @@ Standard_Boolean StdPrs_WFRestrictedFace::Match for (aToolRst.Init(); aToolRst.More(); aToolRst.Next()) { TopAbs_Orientation Orient = aToolRst.Orientation(); - if (Orient == TopAbs_FORWARD || Orient == TopAbs_REVERSED) - { - Adaptor2d_Curve2dPtr aRCurve = aToolRst.Value(); - anU1 = aRCurve->FirstParameter(); - anU2 = aRCurve->LastParameter(); - if (aRCurve->GetType() != GeomAbs_Line) { - aDU = (anU2-anU1)/(aNbPoints-1); - aPoint2 = aRCurve->Value(anU1); - for (anI = 2; anI <= aNbPoints; anI++) { - anU = anU1 + (anI-1)*aDU; - aPoint1 = aPoint2; - aPoint2 = aRCurve->Value(anU); - if(Orient == TopAbs_FORWARD ) - anIsoBuild.Trim(aPoint1,aPoint2); - else - anIsoBuild.Trim(aPoint2,aPoint1); - } - } - else { - aPoint1 = aRCurve->Value(anU1); - aPoint2 = aRCurve->Value(anU2); + const Adaptor2d_Curve2d* aRCurve = &aToolRst.Value(); + anU1 = aRCurve->FirstParameter(); + anU2 = aRCurve->LastParameter(); + if (aRCurve->GetType() != GeomAbs_Line) { + aDU = (anU2-anU1)/(aNbPoints-1); + aPoint2 = aRCurve->Value(anU1); + for (anI = 2; anI <= aNbPoints; anI++) { + anU = anU1 + (anI-1)*aDU; + aPoint1 = aPoint2; + aPoint2 = aRCurve->Value(anU); if(Orient == TopAbs_FORWARD ) anIsoBuild.Trim(aPoint1,aPoint2); else anIsoBuild.Trim(aPoint2,aPoint1); - } + } + } + else { + aPoint1 = aRCurve->Value(anU1); + aPoint2 = aRCurve->Value(anU2); + if(Orient == TopAbs_FORWARD ) + anIsoBuild.Trim(aPoint1,aPoint2); + else + anIsoBuild.Trim(aPoint2,aPoint1); } } diff --git a/src/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/StdSelect/StdSelect_BRepSelectionTool.cxx index d7f619598b..5dc8b6ea4a 100644 --- a/src/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -621,7 +621,16 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_ BRepAdaptor_Curve cu3d; for (BRepTools_WireExplorer aWireExplorer (aWire); aWireExplorer.More(); aWireExplorer.Next()) { - cu3d.Initialize (aWireExplorer.Current()); + try + { + OCC_CATCH_SIGNALS + cu3d.Initialize (aWireExplorer.Current()); + } + catch (Standard_NullObject) + { + continue; + } + Standard_Real wf = 0.0, wl = 0.0; BRep_Tool::Range (aWireExplorer.Current(), wf, wl); if (Abs (wf - wl) <= Precision::Confusion()) diff --git a/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx b/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx index 89c9410fa3..fe1239e5d0 100644 --- a/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx +++ b/src/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx @@ -144,8 +144,7 @@ void VrmlConverter_WFDeflectionRestrictedFace::Add gp_Pnt dummypnt; for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { TopAbs_Orientation Orient = ToolRst.Orientation(); - if ( Orient == TopAbs_FORWARD || Orient == TopAbs_REVERSED ) { - Adaptor2d_Curve2dPtr TheRCurve = ToolRst.Value(); + const Adaptor2d_Curve2d* TheRCurve = &ToolRst.Value(); if (TheRCurve->GetType() != GeomAbs_Line) { GCPnts_QuasiUniformDeflection UDP(*TheRCurve, Deflection); if (UDP.IsDone()) { @@ -178,7 +177,6 @@ void VrmlConverter_WFDeflectionRestrictedFace::Add else isobuild.Trim(P2,P1); } - } } // draw the isos diff --git a/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx b/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx index 351790878a..db8fd3ffc0 100644 --- a/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx +++ b/src/VrmlConverter/VrmlConverter_WFRestrictedFace.cxx @@ -52,8 +52,8 @@ void VrmlConverter_WFRestrictedFace::Add Bnd_Box2d B; for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { - Adaptor2d_Curve2dPtr TheRCurve = ToolRst.Value(); - BndLib_Add2dCurve::Add(*TheRCurve, Precision::PConfusion(), B); + const Adaptor2d_Curve2d& TheRCurve = ToolRst.Value(); + BndLib_Add2dCurve::Add(TheRCurve, Precision::PConfusion(), B); } B.Get(UMin, VMin, UMax, VMax); @@ -97,8 +97,7 @@ void VrmlConverter_WFRestrictedFace::Add for (ToolRst.Init(); ToolRst.More(); ToolRst.Next()) { TopAbs_Orientation Orient = ToolRst.Orientation(); - if ( Orient == TopAbs_FORWARD || Orient == TopAbs_REVERSED ) { - Adaptor2d_Curve2dPtr TheRCurve = ToolRst.Value(); + const Adaptor2d_Curve2d* TheRCurve = &ToolRst.Value(); U1 = TheRCurve->FirstParameter(); U2 = TheRCurve->LastParameter(); if (TheRCurve->GetType() != GeomAbs_Line) { @@ -121,8 +120,7 @@ void VrmlConverter_WFRestrictedFace::Add isobuild.Trim(P1,P2); else isobuild.Trim(P2,P1); - } - } + } } diff --git a/tests/bugs/vis/bug30146 b/tests/bugs/vis/bug30146 new file mode 100644 index 0000000000..98e8bed9fc --- /dev/null +++ b/tests/bugs/vis/bug30146 @@ -0,0 +1,18 @@ +puts "=============" +puts "0030146: Visualization - e x c e p t i o n during attempt to display Edge without geometry" +puts "=============" + +pload MODELING VISUALIZATION + +restore [locate_data_file CTO904_cts20176a.rle] a +incmesh a 0.1 +tclean -geom a + +vclear +vinit View1 +vviewparams -scale 3.69 -proj 0.30 0.94 0.14 -up -0.46 0.013 0.88 -at 103.9 -59.94 -27.08 +vdisplay -dispMode 0 a +vdump ${imagedir}/${casename}_wireframe.png + +vdisplay -dispMode 1 a +vdump ${imagedir}/${casename}_shaded.png