MeshLink
Computational geometry access
MeshLinkAttribute Class Reference

Storage for MeshLink Attribute and AttributeGroup data. More...

#include <MeshAssociativity.h>

Public Member Functions

 MeshLinkAttribute ()
 Default constructor. More...
 
 MeshLinkAttribute (MLINT attid, std::string &name, std::string &contents, bool is_group, MeshAssociativity &meshAssoc)
 
MLINT getAttID () const
 Get the AttID of this attribute. More...
 
bool isGroup () const
 Whether this attribute is a group of other MeshLinkAttribute s. More...
 
bool isValid () const
 
const std::vector< MLINT > & getAttributeIDs () const
 Get the AttIDs referenced by this attribute. More...
 

Private Member Functions

bool buildGroupArefs (MeshAssociativity &meshAssoc)
 Build list of MeshLinkAttribute IDs referenced by the GeometryGroup. More...
 

Private Attributes

MLINT attid_
 The AttID of this attribute. More...
 
std::string name_
 The name of this attribute. More...
 
std::string contents_
 The application-defined contents of the attribute, from the MeshLink file. More...
 
bool is_group_
 Whether this attribute is a group of other attributes. More...
 
bool is_valid_
 Whether this attribute is valid. More...
 
std::vector< MLINTgroup_arefs_
 

Friends

class MeshAssociativity
 

Detailed Description

Storage for MeshLink Attribute and AttributeGroup data.

MeshLink entities reference attributes through an AREF attribute which is the integer ID of the MeshLinkAttribute associated with the entity. A MeshLinkAttribute can be a group of other MeshLinkAttributes.

MeshLink attributes are for use by applications, and have no expressed nor implied usage within MeshLink. Access to attributes by an application are through MeshAssociativity.getAttribute and MeshAssociativity.getAttributeByID.

Definition at line 301 of file MeshAssociativity.h.

Constructor & Destructor Documentation

◆ MeshLinkAttribute() [1/2]

MeshLinkAttribute::MeshLinkAttribute ( )

Default constructor.

◆ MeshLinkAttribute() [2/2]

MeshLinkAttribute::MeshLinkAttribute ( MLINT  attid,
std::string &  name,
std::string &  contents,
bool  is_group,
MeshAssociativity meshAssoc 
)

Constructor for an attribute with a unique attribute ID (AttID) and name. The attribute's definition is given by its contents.

Member Function Documentation

◆ buildGroupArefs()

bool MeshLinkAttribute::buildGroupArefs ( MeshAssociativity meshAssoc)
private

Build list of MeshLinkAttribute IDs referenced by the GeometryGroup.

For an attribute group, recursively dereference attributes to build a complete and unique list of all attributes referenced by the group.

◆ getAttID()

MLINT MeshLinkAttribute::getAttID ( ) const

Get the AttID of this attribute.

◆ getAttributeIDs()

const std::vector<MLINT>& MeshLinkAttribute::getAttributeIDs ( ) const

Get the AttIDs referenced by this attribute.

If the MeshLinkAttribute is a group, the AttIDs of the group members are returned, otherwise, this attribute's AttID is returned

◆ isGroup()

bool MeshLinkAttribute::isGroup ( ) const

Whether this attribute is a group of other MeshLinkAttribute s.

◆ isValid()

bool MeshLinkAttribute::isValid ( ) const

Whether this attribute is valid. An attribute may be invalid if it is a group of other attribute IDs, and any one of which do not exist.

Friends And Related Function Documentation

◆ MeshAssociativity

friend class MeshAssociativity
friend

Definition at line 303 of file MeshAssociativity.h.

Member Data Documentation

◆ attid_

MLINT MeshLinkAttribute::attid_
private

The AttID of this attribute.

Definition at line 339 of file MeshAssociativity.h.

◆ contents_

std::string MeshLinkAttribute::contents_
private

The application-defined contents of the attribute, from the MeshLink file.

Definition at line 343 of file MeshAssociativity.h.

◆ group_arefs_

std::vector<MLINT> MeshLinkAttribute::group_arefs_
private

The list of other attribute AttIDs to which this attribute refers (for attribute groups).

Definition at line 350 of file MeshAssociativity.h.

◆ is_group_

bool MeshLinkAttribute::is_group_
private

Whether this attribute is a group of other attributes.

Definition at line 345 of file MeshAssociativity.h.

◆ is_valid_

bool MeshLinkAttribute::is_valid_
private

Whether this attribute is valid.

Definition at line 347 of file MeshAssociativity.h.

◆ name_

std::string MeshLinkAttribute::name_
private

The name of this attribute.

Definition at line 341 of file MeshAssociativity.h.


The documentation for this class was generated from the following file: