1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0031136: Modeling Data - BinXCAF persistence loses normals from triangulation-only Faces

Information about normals are stored in BinOCAF, XmlOCAF, BRep and BBRep (in case of triangulation-only Faces).
Versions of formats have been changed (11 for TDocStd, 4 for BRep Shape and 3 for Binary BRep Shape)
theWithNormals parameter added to BRepTools::Write()
IsWithNormals()/SetWithNormals() function added to BRepTools_ShapeSet
-normals/-noNormals option added to StoreTriangulation DRAW command
-normals/-noNormals option added to writebrep DRAW command
Tests for writing to brep/binary brep/BinXCaf/XmlXCaf added
Test for StoreTriangulation options -normals/-noNormals added
This commit is contained in:
asuraven
2020-11-17 20:37:01 +03:00
committed by bugmaster
parent 6fab0b3428
commit 9f45d35b6b
40 changed files with 703 additions and 209 deletions

View File

@@ -41,9 +41,30 @@ Poly_Triangulation::Poly_Triangulation(const Standard_Integer theNbNodes,
//=======================================================================
//function : Poly_Triangulation
//purpose :
//purpose :
//=======================================================================
Poly_Triangulation::Poly_Triangulation(const Standard_Integer theNbNodes,
const Standard_Integer theNbTriangles,
const Standard_Boolean theHasUVNodes,
const Standard_Boolean theHasNormals)
: myDeflection(0),
myNodes (1, theNbNodes),
myTriangles (1, theNbTriangles)
{
if (theHasUVNodes)
{
myUVNodes = new TColgp_HArray1OfPnt2d(1, theNbNodes);
}
if (theHasNormals)
{
myNormals = new TShort_HArray1OfShortReal(1, theNbNodes * 3);
}
}
//=======================================================================
//function : Poly_Triangulation
//purpose :
//=======================================================================
Poly_Triangulation::Poly_Triangulation(const TColgp_Array1OfPnt& theNodes,
const Poly_Array1OfTriangle& theTriangles)
: myDeflection(0),

View File

@@ -76,6 +76,17 @@ public:
//! enable a 2D representation).
Standard_EXPORT Poly_Triangulation(const Standard_Integer nbNodes, const Standard_Integer nbTriangles, const Standard_Boolean UVNodes);
//! Constructs a triangulation from a set of triangles.
//! The triangulation is initialized without a triangle or a node,
//! but capable of containing nbNodes nodes, and nbTriangles triangles.
//! Here the UVNodes flag indicates whether 2D nodes will be associated with 3D ones,
//! (i.e. to enable a 2D representation).
//! Here the hasNormals flag indicates whether normals will be given and associated with nodes.
Standard_EXPORT Poly_Triangulation(const Standard_Integer nbNodes,
const Standard_Integer nbTriangles,
const Standard_Boolean UVNodes,
const Standard_Boolean hasNormals);
//! Constructs a triangulation from a set of triangles. The
//! triangulation is initialized with 3D points from Nodes and triangles
//! from Triangles.