mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026897: BRepBuilderAPI_Copy does not copy polygons
1. Implemented copying for 3D polygons and polygons on surfaces 2. Added test case bugs/modalg_6/bug26897
This commit is contained in:
@@ -53,6 +53,22 @@ Poly_Polygon3D::Poly_Polygon3D(const TColgp_Array1OfPnt& Nodes,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_Polygon3D) Poly_Polygon3D::Copy() const
|
||||
{
|
||||
Handle(Poly_Polygon3D) aCopy;
|
||||
if (myParameters.IsNull())
|
||||
aCopy = new Poly_Polygon3D(myNodes);
|
||||
else
|
||||
aCopy = new Poly_Polygon3D(myNodes, myParameters->Array1());
|
||||
aCopy->Deflection(myDeflection);
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Deflection
|
||||
|
@@ -58,6 +58,9 @@ public:
|
||||
//! Both the Nodes and Parameters tables must have the
|
||||
//! same bounds. This property is not checked at construction time.
|
||||
Standard_EXPORT Poly_Polygon3D(const TColgp_Array1OfPnt& Nodes, const TColStd_Array1OfReal& Parameters);
|
||||
|
||||
//! Creates a copy of current polygon
|
||||
Standard_EXPORT virtual Handle(Poly_Polygon3D) Copy() const;
|
||||
|
||||
//! Returns the deflection of this polygon
|
||||
Standard_EXPORT Standard_Real Deflection() const;
|
||||
|
@@ -47,6 +47,22 @@ Poly_PolygonOnTriangulation::Poly_PolygonOnTriangulation
|
||||
myParameters->ChangeArray1() = Parameters;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_PolygonOnTriangulation) Poly_PolygonOnTriangulation::Copy() const
|
||||
{
|
||||
Handle(Poly_PolygonOnTriangulation) aCopy;
|
||||
if (myParameters.IsNull())
|
||||
aCopy = new Poly_PolygonOnTriangulation(myNodes);
|
||||
else
|
||||
aCopy = new Poly_PolygonOnTriangulation(myNodes, myParameters->Array1());
|
||||
aCopy->Deflection(myDeflection);
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Deflection
|
||||
//purpose :
|
||||
|
@@ -68,7 +68,10 @@ public:
|
||||
//! The tables Nodes and Parameters must be the same size.
|
||||
//! This property is not checked at construction time.
|
||||
Standard_EXPORT Poly_PolygonOnTriangulation(const TColStd_Array1OfInteger& Nodes, const TColStd_Array1OfReal& Parameters);
|
||||
|
||||
|
||||
//! Creates a copy of current polygon
|
||||
Standard_EXPORT virtual Handle(Poly_PolygonOnTriangulation) Copy() const;
|
||||
|
||||
//! Returns the deflection of this polygon
|
||||
Standard_EXPORT Standard_Real Deflection() const;
|
||||
|
||||
|
@@ -82,7 +82,7 @@ Poly_Triangulation::Poly_Triangulation(const TColgp_Array1OfPnt& Nodes,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_Triangulation) Poly_Triangulation::Copy()
|
||||
Handle(Poly_Triangulation) Poly_Triangulation::Copy() const
|
||||
{
|
||||
Handle(Poly_Triangulation) aCopy;
|
||||
if (HasUVNodes())
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
Standard_EXPORT Poly_Triangulation(const TColgp_Array1OfPnt& Nodes, const TColgp_Array1OfPnt2d& UVNodes, const Poly_Array1OfTriangle& Triangles);
|
||||
|
||||
//! Creates full copy of current triangulation
|
||||
Standard_EXPORT virtual Handle(Poly_Triangulation) Copy();
|
||||
Standard_EXPORT virtual Handle(Poly_Triangulation) Copy() const;
|
||||
|
||||
//! Returns the deflection of this triangulation.
|
||||
Standard_EXPORT Standard_Real Deflection() const;
|
||||
|
Reference in New Issue
Block a user