mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0032008: Modeling Algorithms - disallow implicit copy of Extrema algorithms
Extrema_GenExtPS now prefers resizing of Array2 tables instead of managing tables by extra handles. Removed unsafe casts to Adaptor3d_SurfacePtr/Adaptor3d_CurvePtr in Extrema classes. Removed unsafe casts to curve adaptors in Extrema_ExtCC, Extrema_ExtCC2d classes. Extrema_GenExtPS, Extrema_GenExtSS, Extrema_ExtCS - copies by value are now disallowed; several unexpected places copying the object have been fixed. IntTools_Context - maps of void* have been replaced by typed maps.
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepFill_Filling.hxx>
|
||||
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <BRepFill_CurveConstraint.hxx>
|
||||
#include <BRepFill_EdgeFaceAndOrder.hxx>
|
||||
#include <BRepFill_FaceAndOrder.hxx>
|
||||
#include <BRepFill_Filling.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeVertex.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
@@ -393,7 +392,7 @@ void BRepFill_Filling::AddConstraints( const BRepFill_SequenceOfEdgeFaceAndOrder
|
||||
Constr->SetCurve2dOnSurf( Curve2d );
|
||||
}
|
||||
}
|
||||
myBuilder.Add( Constr );
|
||||
myBuilder->Add( Constr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,10 +570,8 @@ void BRepFill_Filling::FindExtremitiesOfHoles(const TopTools_ListOfShape& WireLi
|
||||
//======================================================================
|
||||
void BRepFill_Filling::Build()
|
||||
{
|
||||
GeomPlate_BuildPlateSurface thebuild( myDegree, myNbPtsOnCur, myNbIter,
|
||||
myTol2d, myTol3d, myTolAng, myTolCurv, myAnisotropie );
|
||||
|
||||
myBuilder = thebuild;
|
||||
myBuilder.reset (new GeomPlate_BuildPlateSurface (myDegree, myNbPtsOnCur, myNbIter,
|
||||
myTol2d, myTol3d, myTolAng, myTolCurv, myAnisotropie));
|
||||
TopoDS_Edge CurEdge;
|
||||
TopoDS_Face CurFace;
|
||||
Standard_Integer i, j;
|
||||
@@ -650,29 +647,33 @@ void BRepFill_Filling::Build()
|
||||
{
|
||||
Handle( BRepAdaptor_Surface ) HSurfInit = new BRepAdaptor_Surface();
|
||||
HSurfInit->Initialize( myInitFace );
|
||||
myBuilder.LoadInitSurface( BRep_Tool::Surface( HSurfInit->Face() ) );
|
||||
myBuilder->LoadInitSurface( BRep_Tool::Surface( HSurfInit->Face() ) );
|
||||
}
|
||||
|
||||
//Adding constraints to myBuilder
|
||||
AddConstraints( myBoundary );
|
||||
myBuilder.SetNbBounds( myBoundary.Length() );
|
||||
myBuilder->SetNbBounds( myBoundary.Length() );
|
||||
AddConstraints( myConstraints );
|
||||
for (i = 1; i <= myPoints.Length(); i++)
|
||||
myBuilder.Add( myPoints(i) );
|
||||
{
|
||||
myBuilder->Add (myPoints (i));
|
||||
}
|
||||
|
||||
myBuilder.Perform();
|
||||
if (myBuilder.IsDone())
|
||||
myBuilder->Perform();
|
||||
if (myBuilder->IsDone())
|
||||
{
|
||||
myIsDone = Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
return;
|
||||
}
|
||||
{
|
||||
myIsDone = Standard_False;
|
||||
return;
|
||||
}
|
||||
|
||||
Handle( GeomPlate_Surface ) GPlate = myBuilder.Surface();
|
||||
Handle( Geom_BSplineSurface ) Surface;
|
||||
Handle(GeomPlate_Surface) GPlate = myBuilder->Surface();
|
||||
Handle(Geom_BSplineSurface) Surface;
|
||||
// Approximation
|
||||
Standard_Real dmax = 1.1 * myBuilder.G0Error(); //???????????
|
||||
Standard_Real dmax = 1.1 * myBuilder->G0Error(); //???????????
|
||||
//Standard_Real dmax = myTol3d;
|
||||
if (! myIsInitFaceGiven)
|
||||
{
|
||||
@@ -680,9 +681,9 @@ void BRepFill_Filling::Build()
|
||||
|
||||
TColgp_SequenceOfXY S2d;
|
||||
TColgp_SequenceOfXYZ S3d;
|
||||
myBuilder.Disc2dContour(4,S2d);
|
||||
myBuilder.Disc3dContour(4,0,S3d);
|
||||
seuil = Max( myTol3d, 10*myBuilder.G0Error() ); //????????
|
||||
myBuilder->Disc2dContour (4, S2d);
|
||||
myBuilder->Disc3dContour (4, 0, S3d);
|
||||
seuil = Max (myTol3d, 10 * myBuilder->G0Error()); //????????
|
||||
GeomPlate_PlateG0Criterion Criterion( S2d, S3d, seuil );
|
||||
GeomPlate_MakeApprox Approx( GPlate, Criterion, myTol3d, myMaxSegments, myMaxDeg );
|
||||
Surface = Approx.Surface();
|
||||
@@ -697,7 +698,7 @@ void BRepFill_Filling::Build()
|
||||
|
||||
//Build the final wire and final face
|
||||
TopTools_ListOfShape FinalEdges;
|
||||
Handle(TColGeom2d_HArray1OfCurve) CurvesOnPlate = myBuilder.Curves2d();
|
||||
Handle(TColGeom2d_HArray1OfCurve) CurvesOnPlate = myBuilder->Curves2d();
|
||||
BRep_Builder BB;
|
||||
for (i = 1; i <= myBoundary.Length(); i++)
|
||||
{
|
||||
@@ -789,7 +790,7 @@ TopoDS_Face BRepFill_Filling::Face() const
|
||||
//==========================================================================
|
||||
Standard_Real BRepFill_Filling::G0Error() const
|
||||
{
|
||||
return myBuilder.G0Error();
|
||||
return myBuilder->G0Error();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -799,7 +800,7 @@ Standard_Real BRepFill_Filling::G0Error() const
|
||||
//======================================================================
|
||||
Standard_Real BRepFill_Filling::G1Error() const
|
||||
{
|
||||
return myBuilder.G1Error();
|
||||
return myBuilder->G1Error();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -809,7 +810,7 @@ Standard_Real BRepFill_Filling::G1Error() const
|
||||
//======================================================================
|
||||
Standard_Real BRepFill_Filling::G2Error() const
|
||||
{
|
||||
return myBuilder.G2Error();
|
||||
return myBuilder->G2Error();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
@@ -819,7 +820,7 @@ Standard_Real BRepFill_Filling::G2Error() const
|
||||
//==========================================================================
|
||||
Standard_Real BRepFill_Filling::G0Error( const Standard_Integer Index )
|
||||
{
|
||||
return myBuilder.G0Error( Index );
|
||||
return myBuilder->G0Error (Index);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
@@ -829,7 +830,7 @@ Standard_Real BRepFill_Filling::G0Error( const Standard_Integer Index )
|
||||
//==========================================================================
|
||||
Standard_Real BRepFill_Filling::G1Error( const Standard_Integer Index )
|
||||
{
|
||||
return myBuilder.G1Error( Index );
|
||||
return myBuilder->G1Error (Index);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
@@ -839,5 +840,5 @@ Standard_Real BRepFill_Filling::G1Error( const Standard_Integer Index )
|
||||
//==========================================================================
|
||||
Standard_Real BRepFill_Filling::G2Error( const Standard_Integer Index )
|
||||
{
|
||||
return myBuilder.G2Error( Index );
|
||||
return myBuilder->G2Error (Index);
|
||||
}
|
||||
|
@@ -17,30 +17,20 @@
|
||||
#ifndef _BRepFill_Filling_HeaderFile
|
||||
#define _BRepFill_Filling_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GeomPlate_BuildPlateSurface.hxx>
|
||||
#include <BRepFill_SequenceOfEdgeFaceAndOrder.hxx>
|
||||
#include <BRepFill_SequenceOfFaceAndOrder.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <GeomPlate_BuildPlateSurface.hxx>
|
||||
#include <GeomPlate_SequenceOfPointConstraint.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_ConstructionError;
|
||||
class TopoDS_Face;
|
||||
|
||||
#include <memory>
|
||||
|
||||
class TopoDS_Edge;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! N-Side Filling
|
||||
//! This algorithm avoids to build a face from:
|
||||
@@ -63,8 +53,8 @@ class TopoDS_Shape;
|
||||
//! Limitations:
|
||||
//! * If some constraints are not compatible
|
||||
//! The algorithm does not take them into account.
|
||||
//! So the constraints will not be satisfyed in an area containing
|
||||
//! the incompatibilitries.
|
||||
//! So the constraints will not be satisfied in an area containing
|
||||
//! the incompatibilities.
|
||||
//! * The constraints defining the bound of the face have to be
|
||||
//! entered in order to have a continuous wire.
|
||||
//!
|
||||
@@ -179,18 +169,8 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_Real G2Error (const Standard_Integer Index);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Adds constraints to builder
|
||||
Standard_EXPORT void AddConstraints (const BRepFill_SequenceOfEdgeFaceAndOrder& SeqOfConstraints);
|
||||
|
||||
@@ -201,8 +181,9 @@ private:
|
||||
//! Can properly operate only with convex contour
|
||||
Standard_EXPORT void FindExtremitiesOfHoles (const TopTools_ListOfShape& WireList, TopTools_SequenceOfShape& VerSeq) const;
|
||||
|
||||
private:
|
||||
|
||||
GeomPlate_BuildPlateSurface myBuilder;
|
||||
opencascade::std::shared_ptr<GeomPlate_BuildPlateSurface> myBuilder;
|
||||
BRepFill_SequenceOfEdgeFaceAndOrder myBoundary;
|
||||
BRepFill_SequenceOfEdgeFaceAndOrder myConstraints;
|
||||
BRepFill_SequenceOfFaceAndOrder myFreeConstraints;
|
||||
@@ -224,13 +205,6 @@ private:
|
||||
Standard_Boolean myIsInitFaceGiven;
|
||||
Standard_Boolean myIsDone;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepFill_Filling_HeaderFile
|
||||
|
Reference in New Issue
Block a user