mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026458: BRepBuilderAPI_Copy does not copy mesh structure
* The possibility to copy mesh is implemented. It may be enabled by copyMesh flag, by default it is disabled. * Poly_Triangulation::Copy() method is added. * The mesh is copied if and only if copyMesh flag is true.
This commit is contained in:
@@ -77,6 +77,25 @@ Poly_Triangulation::Poly_Triangulation(const TColgp_Array1OfPnt& Nodes,
|
||||
myUVNodes->ChangeArray1() = UVNodes;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Copy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Poly_Triangulation) Poly_Triangulation::Copy()
|
||||
{
|
||||
Handle(Poly_Triangulation) aCopy;
|
||||
if (HasUVNodes())
|
||||
aCopy = new Poly_Triangulation(Nodes(), UVNodes(), Triangles());
|
||||
else
|
||||
aCopy = new Poly_Triangulation(Nodes(), Triangles());
|
||||
aCopy->Deflection(myDeflection);
|
||||
if (HasNormals())
|
||||
aCopy->myNormals = new TShort_HArray1OfShortReal(myNormals->Array1());
|
||||
|
||||
return aCopy;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Deflection
|
||||
//purpose :
|
||||
|
@@ -90,6 +90,9 @@ public:
|
||||
//! constructed triangulation.
|
||||
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();
|
||||
|
||||
//! Returns the deflection of this triangulation.
|
||||
Standard_EXPORT Standard_Real Deflection() const;
|
||||
|
||||
|
Reference in New Issue
Block a user