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:
@@ -25,3 +25,9 @@
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
|
||||
Standard_Boolean BRepTools_Modification::NewTriangulation(const TopoDS_Face&, Handle(Poly_Triangulation)&)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
class Geom2d_Curve;
|
||||
class Poly_Triangulation;
|
||||
|
||||
|
||||
class BRepTools_Modification;
|
||||
@@ -59,7 +60,12 @@ public:
|
||||
//! false, and the values of S, L, Tol, RevWires and
|
||||
//! RevFace are not significant.
|
||||
Standard_EXPORT virtual Standard_Boolean NewSurface (const TopoDS_Face& F, Handle(Geom_Surface)& S, TopLoc_Location& L, Standard_Real& Tol, Standard_Boolean& RevWires, Standard_Boolean& RevFace) = 0;
|
||||
|
||||
|
||||
//! Returns true if the face has been modified according to changed triangulation.
|
||||
//! If the face has been modified:
|
||||
//! - T is a new triangulation on the face
|
||||
Standard_EXPORT virtual Standard_Boolean NewTriangulation(const TopoDS_Face& F, Handle(Poly_Triangulation)& T);
|
||||
|
||||
//! Returns true if the edge, E, has been modified.
|
||||
//! If the edge has been modified:
|
||||
//! - C is the new geometry associated with the edge,
|
||||
|
@@ -286,6 +286,20 @@ Standard_Boolean BRepTools_Modifier::Rebuild
|
||||
B.NaturalRestriction(TopoDS::Face(result),
|
||||
BRep_Tool::NaturalRestriction(TopoDS::Face(S)));
|
||||
}
|
||||
|
||||
// update triangulation on the copied face
|
||||
Handle(Poly_Triangulation) aTriangulation;
|
||||
if (M->NewTriangulation(TopoDS::Face(S), aTriangulation))
|
||||
{
|
||||
if (rebuild) // the copied face already exists => update it
|
||||
B.UpdateFace(TopoDS::Face(result), aTriangulation);
|
||||
else
|
||||
{ // create new face with bare triangulation
|
||||
B.MakeFace(TopoDS::Face(result), aTriangulation);
|
||||
result.Location(S.Location());
|
||||
}
|
||||
rebuild = Standard_True;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user