Fixed URL for libccmio-2.6.1 (bug report #5 by Thomas Oliveira)
[foam-extend-3.2.git] / src / mesh / cfMesh / utilities / meshes / triSurf / triSurfAddressing.H
blob0fdbde13109106565a563493a8031af469e9d66f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | cfMesh: A library for mesh generation
4    \\    /   O peration     |
5     \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6      \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9     This file is part of cfMesh.
11     cfMesh is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 3 of the License, or (at your
14     option) any later version.
16     cfMesh is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with cfMesh.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     triSurfAddressing
27 Description
28     Provides topology addressing of the triangulated surface
30 SourceFiles
31     triSurfAddressing.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef triSurfAddressing_H
36 #define triSurfAddressing_H
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 #include "VRWGraph.H"
41 #include "edgeLongList.H"
42 #include "triSurfFacets.H"
43 #include "labelledTri.H"
44 #include "DynList.H"
46 #include <map>
48 namespace Foam
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 class triSurfAddressing
55     // Private data
56         //- const reference to the points
57         const pointField& points_;
59     // Topology addressing
60         //- const reference to the facets
61         const LongList<labelledTri>& facets_;
63         //- facets connected to a point
64         mutable VRWGraph* pointFacetsPtr_;
66         //- edges in the triangulation
67         mutable edgeLongList* edgesPtr_;
69         //- labels of edges in the triangles
70         mutable VRWGraph* facetEdgesPtr_;
72         //- labels of triangles connected to an edge
73         mutable VRWGraph* edgeFacetsPtr_;
75         //- labels of edges connected to a point
76         mutable VRWGraph* pointEdgesPtr_;
78         //- facets connected tp a facet via edges
79         mutable VRWGraph* facetFacetsEdgesPtr_;
81     // Geometry data
82         //- point normals
83         mutable vectorField* pointNormalsPtr_;
85         //- face normals
86         mutable vectorField* facetNormalsPtr_;
88         //- face centres
89         mutable vectorField* facetCentresPtr_;
91     // Private member functions
92         //- calculate point-facets addressing
93         void calculatePointFacets() const;
95         //- calculate edges, facet-edges and edge-facets addressing
96         void calculateEdges() const;
98         //- calculate facet-edges addresing
99         void calculateFacetEdges() const;
101         //- calculate edge-facets addressing
102         void calculateEdgeFacets() const;
104         //- calculate point-edges addressing
105         void calculatePointEdges() const;
107         //- calculate facet-faceys addressing
108         void calculateFacetFacetsEdges() const;
110         //- calculate point normals
111         void calculatePointNormals() const;
113         //- calculate normals of facets
114         void calculateFacetNormals() const;
116         //- calculate centres of facets
117         void calculateFacetCentres() const;
119     // Disallow bitwise assignment
120         void operator=(const triSurfAddressing&);
122         triSurfAddressing(const triSurfAddressing&);
124 public:
126     // Constructors
127         //- Construct from surface triangles
128         triSurfAddressing
129         (
130             const pointField& points,
131             const LongList<labelledTri>& triangles
132         );
134     // Destructor
135         ~triSurfAddressing();
137     // Member functions
138         //- return point-facets addressing
139         inline const VRWGraph& pointFacets() const;
141         //- return edges
142         inline const LongList<edge>& edges() const;
144         //- return facet-edges addressing
145         inline const VRWGraph& facetEdges() const;
147         //- return edge-facets addressing
148         inline const VRWGraph& edgeFacets() const;
150         //- return point-edges addressing
151         inline const VRWGraph& pointEdges() const;
153         //- return facet-facets addressing
154         inline const VRWGraph& facetFacets() const;
156         //- return point normals
157         inline const pointField& pointNormals() const;
159         //- return normals of facets
160         inline const vectorField& facetNormals() const;
162         //- return centres of facets
163         inline const vectorField& facetCentres() const;
165         //- delete all data
166         void clearAddressing();
168         //- delete geometry data
169         void clearGeometry();
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #include "triSurfAddressingI.H"
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #endif
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //