MeshLink
Computational geometry access
GeometryGroup.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2019-2020 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 GEOMETRY_GROUP_CLASS
13 #define GEOMETRY_GROUP_CLASS
14 #undef _DEBUG
15 
16 #include "Types.h"
17 
18 #include <set>
19 #include <vector>
20 #include <string>
21 
22 class projectionData;
23 class MeshAssociativity;
24 
25 /****************************************************************************
26  * GeometryGroup class
27  ***************************************************************************/
39 public:
41  GeometryGroup();
44 
48  void setName(const char* name);
49 
51  const std::string &getName() const;
52 
56  void setID(MLINT id);
57 
59  MLINT getID() const;
60 
62  void setGroupID(MLINT id);
63 
65  //
68  bool getGroupID(MLINT &id);
69 
73  void addGID(MLINT gid);
74 
76  const std::vector<MLINT> &getGIDs();
77 
81  void setAref(MLINT aref);
82 
84  MLINT getAref() const;
85 
89  void addEntityName(const char *name);
90 
94  void setEntityNames(const std::set<std::string> &names);
95 
97  const std::set<std::string> &getEntityNameSet() const;
98 
100  const std::vector<std::string> getEntityNames() const;
101 
103  bool hasAref() const;
104 
112  bool getArefID(MLINT *aref) const;
113 
121  std::vector<MLINT> get_refAttIDs(const MeshAssociativity &meshAssoc) const;
122 
123 private:
125  std::string name_;
133  std::vector<MLINT> groupIDs_; // could be empty if this is a
134  // GeometryReference and not a
135  // GeometryGroup (see schema)
137  std::set<std::string> entity_names_; // the content
138 };
139 
140 
141 /****************************************************************************
142  * GeometryGroupManager class
143  ***************************************************************************/
153 public:
154  bool addGroup(GeometryGroup &group);
155 
156  GeometryGroup * getByName(std::string name);
157 
159 
161  void getIDs(std::vector<MLINT> &idList) const;
162 
164  MLINT getCount() const;
165 
166 private:
167  std::vector<GeometryGroup> geometry_groups_;
168 };
169 
170 #endif
171 
172 /****************************************************************************
173  *
174  * DISCLAIMER:
175  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, POINTWISE DISCLAIMS
176  * ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED
177  * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
178  * PURPOSE, WITH REGARD TO THIS SCRIPT. TO THE MAXIMUM EXTENT PERMITTED
179  * BY APPLICABLE LAW, IN NO EVENT SHALL POINTWISE BE LIABLE TO ANY PARTY
180  * FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
181  * WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
182  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE
183  * USE OF OR INABILITY TO USE THIS SCRIPT EVEN IF POINTWISE HAS BEEN
184  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE
185  * FAULT OR NEGLIGENCE OF POINTWISE.
186  *
187  ***************************************************************************/
bool addGroup(GeometryGroup &group)
void addGID(MLINT gid)
Add GeometryGroup that is part of this group.
bool getGroupID(MLINT &id)
Get the ID of the group containing this group.
std::vector< MLINT > groupIDs_
IDs of contained geometry groups.
const std::set< std::string > & getEntityNameSet() const
Get a set of geometry entity names referenced by the GeometryGroup.
GeometryGroup * getByName(std::string name)
Storage for mesh topology and geometry associativity data.
void setAref(MLINT aref)
Set the MeshLinkAttribute AttID referenced by the GeometryGroup.
void setID(MLINT id)
Set the ID of this GeometryGroup.
std::string name_
Group name.
std::set< std::string > entity_names_
Names of contained geometry entities.
MLINT gid_
Group unique ID.
bool hasAref() const
Whether the GeometryGroup has a MeshLinkAttribute AttID reference defined.
void setName(const char *name)
Set the name of the GeometryGroup.
std::vector< GeometryGroup > geometry_groups_
const std::vector< MLINT > & getGIDs()
Return the GeometryGroup IDs that make up this group.
void getIDs(std::vector< MLINT > &idList) const
Return array of GeometryGroup IDs.
Storage for geometry groups.
void addEntityName(const char *name)
Add a geometry entity's name to the GeometryGroup.
const std::vector< std::string > getEntityNames() const
Get a list of geometry entity names referenced by the GeometryGroup.
GeometryGroup()
Default constructor.
MLINT getAref() const
Get the MeshLinkAttribute AttID referenced by the GeometryGroup.
MLINT groupID_
Group ID of containing group.
void setGroupID(MLINT id)
Set the ID of the group containing this group.
MLINT getCount() const
Return count of GeometryGroups.
const std::string & getName() const
Get the name of this GeometryGroup.
void setEntityNames(const std::set< std::string > &names)
Set the GeometryGroup's geometry entity list.
MLINT aref_
Group attribute ID.
~GeometryGroup()
Destructor.
Definition: GeometryGroup.h:43
std::vector< MLINT > get_refAttIDs(const MeshAssociativity &meshAssoc) const
Return list of MeshLinkAttribute AttIDs referenced by the GeometryGroup.
MLINT getID() const
Get the ID of this GeometryGroup.
MLINT64 MLINT
Standard integer - value depends on IS64BIT macro.
Definition: Types.h:120
GeometryGroup * getByID(MLINT id)
bool getArefID(MLINT *aref) const
Return the MeshLinkAttribute AttID referenced by the GeometryGroup.
Storage for geometry association by entity reference.
Definition: GeometryGroup.h:38