MeshLink
Computational geometry access
MeshSheet.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2012-2018 Pointwise, Inc.
4  * All rights reserved.
5  *
6  * This sample Pointwise source code is not supported by Pointwise, Inc.
7  * It is provided freely for demonstration purposes only.
8  * SEE THE WARRANTY DISCLAIMER AT THE BOTTOM OF THIS FILE.
9  *
10  ***************************************************************************/
11 
12 #ifndef MESH_SHEET_CLASS
13 #define MESH_SHEET_CLASS
14 
15 #include "Types.h"
16 #include "MeshTopo.h"
17 #include "MeshString.h"
18 
19 #include <algorithm>
20 #include <map>
21 #include <string>
22 
23 
24 /****************************************************************************
25  * MeshSheet class
26  ***************************************************************************/
35 class ML_STORAGE_CLASS MeshSheet : public MeshTopo {
36 public:
37  friend class MeshAssociativity;
38  friend class MeshModel;
39 
46  MeshSheet(
47  MLINT mid,
48  MLINT aref,
49  MLINT gref,
50  const std::string &name);
51 
59  MeshSheet(
60  const std::string &ref,
61  MLINT mid,
62  MLINT aref,
63  MLINT gref,
64  const std::string &name);
65 
75  virtual bool addFace(MLINT i1, MLINT i2, MLINT i3,
76  MLINT mid,
77  MLINT aref,
78  MLINT gref,
79  const std::string &name,
80  ParamVertex *pv1, ParamVertex *pv2,
81  ParamVertex *pv3, bool mapID);
82 
87  virtual MeshFace *findFaceByInds(MLINT i1, MLINT i2, MLINT i3,
88  MLINT i4 = MESH_TOPO_INDEX_UNUSED) const;
89 
94  virtual void deleteFaceByInds(MLINT i1, MLINT i2, MLINT i3,
95  MLINT i4 = MESH_TOPO_INDEX_UNUSED);
96 
106  virtual bool addFace(
107  const std::string &ref,
108  MLINT mid,
109  MLINT aref,
110  MLINT gref,
111  const std::string &name,
112  ParamVertex *pv1, ParamVertex *pv2,
113  ParamVertex *pv3, bool mapID);
114 
124  virtual bool addFace(MLINT i1, MLINT i2, MLINT i3, MLINT i4,
125  MLINT mid,
126  MLINT aref,
127  MLINT gref,
128  const std::string &name,
129  ParamVertex *pv1, ParamVertex *pv2,
130  ParamVertex *pv3, ParamVertex *pv4, bool mapID);
131 
141  virtual bool addFace(
142  const std::string &ref,
143  MLINT mid,
144  MLINT aref,
145  MLINT gref,
146  const std::string &name,
147  ParamVertex *pv1, ParamVertex *pv2,
148  ParamVertex *pv3, ParamVertex *pv4, bool mapID);
149 
150 
154  virtual MeshFace * getMeshFaceByName(const std::string &name) const;
155 
159  virtual MeshFace * getMeshFaceByRef(const std::string &ref) const;
160 
172  virtual void addFaceEdge(MLINT i1, MLINT i2,
173  MLINT mid,
174  MLINT aref,
175  MLINT gref,
176  ParamVertex *pv1 = NULL, ParamVertex *pv2 = NULL);
177 
181  virtual MeshEdge *findFaceEdgeByInds(MLINT i1, MLINT i2) const;
182 
186  virtual void deleteFaceEdgeByInds(MLINT i1, MLINT i2);
187 
189  virtual MLINT getNumFaceEdges() const;
190 
192  virtual MLINT getNumFaces() const;
193 
197  virtual void getFaceEdges(std::vector<const MeshEdge *> &faceEdges) const;
198 
202  virtual void getMeshFaces(std::vector<const MeshFace *> &faces) const;
203 
205  MeshSheet();
207  ~MeshSheet();
208 
210  virtual const std::string &getBaseName() const;
212  virtual MLUINT &getNameCounter();
213 
214 private:
217 
219  std::map<pwiFnvHash::FNVHash, MeshPoint*> pointMap_; // not the owner
224 
226  std::map<pwiFnvHash::FNVHash, MeshEdge*> faceEdgeMap_;
227 
229  std::map<pwiFnvHash::FNVHash, MeshFace*> faceMap_; // not the owner
230 
233 
236 
239 
242 
245 };
246 
247 typedef std::map<std::string, MeshSheet *> MeshSheetNameMap;
248 
249 
250 #endif
251 
252 /****************************************************************************
253  *
254  * DISCLAIMER:
255  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, POINTWISE DISCLAIMS
256  * ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED
257  * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
258  * PURPOSE, WITH REGARD TO THIS SCRIPT. TO THE MAXIMUM EXTENT PERMITTED
259  * BY APPLICABLE LAW, IN NO EVENT SHALL POINTWISE BE LIABLE TO ANY PARTY
260  * FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
261  * WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
262  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE
263  * USE OF OR INABILITY TO USE THIS SCRIPT EVEN IF POINTWISE HAS BEEN
264  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE
265  * FAULT OR NEGLIGENCE OF POINTWISE.
266  *
267  ***************************************************************************/
MLUINT faceEdgeCounter_
Serial counter as faceEdges are added to the sheet (zero-based)
Definition: MeshSheet.h:241
MeshFace * getMeshFaceByRef(const std::string &ref) const
Find a MeshFace in the MeshModel using reference.
MeshTopoRefToNameMap meshFaceRefToNameMap_
Map application-defined face reference string to face name.
Definition: MeshSheet.h:238
static MLUINT nameCounter_
The unique name counter for sheets.
Definition: MeshSheet.h:216
Storage for mesh topology and geometry associativity data.
MeshTopoIDToNameMap meshPointIDToNameMap_
Map point IDs to point names.
Definition: MeshSheet.h:223
MLUINT64 MLUINT
Standard unsigned integer - value depends on IS64BIT macro.
Definition: Types.h:122
std::map< std::string, MeshFace * > MeshFaceNameMap
Definition: MeshTopo.h:696
std::map< pwiFnvHash::FNVHash, MeshEdge * > faceEdgeMap_
Map face edge indices hash to edge.
Definition: MeshSheet.h:226
3D (volume) mesh topology
Definition: MeshModel.h:38
std::map< std::string, MeshSheet * > MeshSheetNameMap
Definition: MeshSheet.h:247
2D (surface) mesh topology
Definition: MeshSheet.h:35
std::map< std::string, std::string > MeshTopoRefToNameMap
Definition: MeshTopo.h:308
MeshFace * getMeshFaceByName(const std::string &name) const
Find a MeshFace in the MeshModel using name.
bool addFace(MLINT i1, MLINT i2, MLINT i3, MLINT mid, MLINT aref, MLINT gref, std::string &name, ParamVertex *pv1, ParamVertex *pv2, ParamVertex *pv3, bool mapID)
Add a triangular MeshFace to the MeshModel using indices.
std::map< pwiFnvHash::FNVHash, MeshFace * > faceMap_
Map face indices hash to face.
Definition: MeshSheet.h:229
MeshTopoIDToNameMap meshFaceIDToNameMap_
Map face IDs to face names.
Definition: MeshSheet.h:235
std::map< MLINT, std::string > MeshTopoIDToNameMap
Definition: MeshTopo.h:304
virtual MLUINT & getNameCounter()
Returns the current value of the counter used for generating unique mesh entity names.
1-D (edge) mesh entity
Definition: MeshTopo.h:421
virtual const std::string & getBaseName() const
Returns the base name used for generating unique mesh entity names.
MeshFaceNameMap meshFaceNameMap_
Map face names to face.
Definition: MeshSheet.h:232
2-D (face) mesh entity
Definition: MeshTopo.h:548
void addFaceEdge(MLINT i1, MLINT i2, MLINT mid, MLINT aref, MLINT gref, ParamVertex *pv1, ParamVertex *pv2)
Add a face-edge to the MeshModel.
std::map< std::string, MeshPoint * > MeshPointNameMap
Definition: MeshTopo.h:408
void getMeshFaces(std::vector< const MeshFace * > &faces) const
Return list of all MeshFace in the MeshModel.
std::map< pwiFnvHash::FNVHash, MeshPoint * > pointMap_
Map point hash values to points.
Definition: MeshSheet.h:219
MeshFace * findFaceByInds(MLINT i1, MLINT i2, MLINT i3, MLINT i4=MESH_TOPO_INDEX_UNUSED)
Find a (triangular or quadrilateral) face in the MeshSheet associativity data.
void deleteFaceByInds(MLINT i1, MLINT i2, MLINT i3, MLINT i4=MESH_TOPO_INDEX_UNUSED)
Delete an MeshFace from the MeshModel using indices.
MeshPointNameMap meshPointNameMap_
Map point names to points.
Definition: MeshSheet.h:221
MeshEdge * findFaceEdgeByInds(MLINT i1, MLINT i2) const
Find an edge in the MeshSheet associativity data.
Base class for mesh topology entities.
Definition: MeshTopo.h:132
Parametric geometry data.
Definition: MeshTopo.h:69
MLINT64 MLINT
Standard integer - value depends on IS64BIT macro.
Definition: Types.h:120
MLINT getNumFaces() const
Return the number of faces in the MeshModel.
MLUINT faceCounter_
Serial counter as faces are added to the sheet (zero-based)
Definition: MeshSheet.h:244