cee::ug::PartInfo

class PartInfo

Simple class containing metadata info for a part.

A result info contains:

  • Part id

  • Part name

Default part id is -1 which indicates an invalid id.

Metadata for a model is accessed from the data source directory.

Example

Example on getting the name of a specific part using the metadata directory.

int geometryIndex = 0;
int partId = 1;

PartInfo partInfo = source->directory()->findPartInfo(geometryIndex, partId);
sdt::wstring partName = partInfo.name();

Public Functions

PartInfo()

Constructs an empty object.

Default id is -1 (invalid).

PartInfo(int partId, const Str &partName)

Constructs a new object with the given part id and part name.

PartInfo(const PartInfo &other)

Constructs a new PartInfo that is a copy of other.

PartInfo &operator=(const PartInfo &rhs)

Assigns rhs to this part info and returns a reference to this part info.

bool operator==(const PartInfo &rhs) const

Returns true if the object is equal to rhs.

bool operator!=(const PartInfo &rhs) const

Returns true if the object is not equal to rhs.

int id() const

Returns the part id.

Returns -1 if this object is invalid.

Str name() const

Returns the part name.

bool isBoundaryCondition() const

Returns true if the part is used to locate boundary conditions.

void setBoundaryCondition(bool on)

Sets the flag that indicates if the part is used to locate boundary conditions.

int parentId() const

Returns the parent part id.

Returns -1 if this object is invalid or has not been set

void setParentId(int parentId)

Sets the parent Part info.

Str partDataValue(const Str &name) const

Returns the value of the given part data attribute.

Part data is additional key/value pairs provided by the file reader, and is only used for information purposes.

std::vector<Str> partDataNames() const

Returns the names of all the part data attributes for this part.

Part data is additional key/value pairs provided by the file reader, and is only used for information purposes.

void setPartData(const Str &name, const Str &value)

Sets the value of the given part data attribute. Inserts the part data attribute if not already present.