1 // Created on: 1995-09-21
2 // Created by: Philippe GIRODENGO
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _StlMesh_MeshDomain_HeaderFile
18 #define _StlMesh_MeshDomain_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Real.hxx>
24 #include <Standard_Integer.hxx>
25 #include <TColgp_SequenceOfXYZ.hxx>
26 #include <StlMesh_SequenceOfMeshTriangle.hxx>
27 #include <MMgt_TShared.hxx>
28 #include <Standard_Boolean.hxx>
29 class Standard_NegativeValue;
30 class Standard_NullValue;
33 class StlMesh_MeshDomain;
34 DEFINE_STANDARD_HANDLE(StlMesh_MeshDomain, MMgt_TShared)
36 //! A mesh domain is a set of triangles defined with
37 //! three geometric vertices and a given orientation.
38 //! The mesh domain has its own deflection.
39 //! Internal class used to classify the triangles of each domain.
40 class StlMesh_MeshDomain : public MMgt_TShared
46 //! The mesh deflection is defaulted to Confusion from
47 //! package Precision.
48 Standard_EXPORT StlMesh_MeshDomain();
50 //! Raised if the deflection is lower than zero
51 //! Raised if the deflection is lower than Confusion
52 //! from package Precision
53 Standard_EXPORT StlMesh_MeshDomain(const Standard_Real Deflection);
55 //! Build a triangle with the triplet of vertices (V1,
56 //! V2, V3). This triplet defines the indexes of the
57 //! vertex in the current domain The coordinates Xn,
58 //! Yn, Zn defines the normal direction to the
59 //! triangle. Returns the range of the triangle in
60 //! the current domain.
61 Standard_EXPORT virtual Standard_Integer AddTriangle (const Standard_Integer V1, const Standard_Integer V2, const Standard_Integer V3, const Standard_Real Xn, const Standard_Real Yn, const Standard_Real Zn);
63 //! Returns the range of the vertex in the current
65 Standard_EXPORT virtual Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z);
67 //! Returns the range of the vertex in the current
68 //! domain. The current vertex is not inserted in the
69 //! mesh if it already exist.
70 Standard_EXPORT virtual Standard_Integer AddOnlyNewVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, Standard_Boolean& IsNew);
72 virtual Standard_Real Deflection() const;
74 //! Number of triangles in the mesh.
75 virtual Standard_Integer NbTriangles() const;
77 //! Number of vertices in the mesh.
78 virtual Standard_Integer NbVertices() const;
80 //! Returns the set of triangles of the current mesh domain
81 virtual const StlMesh_SequenceOfMeshTriangle& Triangles() const;
83 //! Returns the coordinates of the vertices of the
84 //! mesh domain of range <DomainIndex>. {XV1, YV1,
85 //! ZV1, XV2, YV2, ZV2, XV3,.....}
86 virtual const TColgp_SequenceOfXYZ& Vertices() const;
91 DEFINE_STANDARD_RTTI(StlMesh_MeshDomain,MMgt_TShared)
101 Standard_Real deflection;
102 Standard_Integer nbVertices;
103 Standard_Integer nbTriangles;
104 TColgp_SequenceOfXYZ vertexCoords;
105 StlMesh_SequenceOfMeshTriangle trianglesVertex;
111 #include <StlMesh_MeshDomain.lxx>
117 #endif // _StlMesh_MeshDomain_HeaderFile