The geometry of the model for a certain state. More...
Public Member Functions | |
DataGeometry () | |
Constructs an empty DataGeometry. More... | |
int | id () const |
Returns the id of the geometry. The ids are autoassigned by Ceetron Desktop Components. More... | |
size_t | partCount () const |
Returns number of parts in geometry. More... | |
const DataPart * | part (size_t partIndex) const |
Returns the part at the given part index. More... | |
DataPart * | part (size_t partIndex) |
Returns the part at the given part index. More... | |
size_t | partIndex (int partId) const |
Returns the index of the part with the specified id. More... | |
void | addPart (DataPart *part) |
Adds a part to the geometry. More... | |
void | removeAllParts () |
Removes all parts. More... | |
void | removeEmptyParts () |
Removes parts which either DataElements*or DataNodes* are NULL ptr. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
The geometry of the model for a certain state.
A DataGeometry is a collection of nodes, elements, element connectivity, and aggregations to parts defining the geometry at certain state. A state (DataState) can have several geometries.
Access an existing geometry using DataState::geometry() with the requested geometry index. For convenience, there's a DataState::firstGeometry() which returns a pointer to the geometry at index = 0.
The DataGeometry object consists of a number of DataPart objects. A geometry is allowed to have zero parts.
A DataPart is added to the geometry using addPart(). Call partCount() to get number of parts in the geometry. To get a specific part, use part() with the requested part index. To get a part index from a part id, use the partIndex() function.
Example on creating a simple geometry containing one part with two triangle elements.
Create a state and add it to the current data source. Number of geometries for the state is set in the constructor and cannot be changed later.
Create the geometry and add it to the state at index 0 (since there's only one geometry).
Create the nodes object and set the node coordinates for this part.
Create the elements object and specify the connectivities for this part. This part contains two triangles.
Create the part object and set newly created nodes and elements objects to this part. Specify a unique id when creating the DataPart.
The part is finished and can be added to the geometry.
See the entire example: UnstructGrid: Simple model with two triangles
cee::ug::DataGeometry::DataGeometry | ( | ) |
Constructs an empty DataGeometry.
void cee::ug::DataGeometry::addPart | ( | DataPart * | part | ) |
Adds a part to the geometry.
int cee::ug::DataGeometry::id | ( | ) | const |
Returns the id of the geometry. The ids are autoassigned by Ceetron Desktop Components.
The id is used e.g. in DataElementSetItems
const DataPart * cee::ug::DataGeometry::part | ( | size_t | partIndex | ) | const |
Returns the part at the given part index.
DataPart * cee::ug::DataGeometry::part | ( | size_t | partIndex | ) |
Returns the part at the given part index.
size_t cee::ug::DataGeometry::partCount | ( | ) | const |
Returns number of parts in geometry.
size_t cee::ug::DataGeometry::partIndex | ( | int | partId | ) | const |
Returns the index of the part with the specified id.
Returns cee::UNDEFINED_SIZE_T if no part with the specified id is found
void cee::ug::DataGeometry::removeAllParts | ( | ) |
Removes all parts.
void cee::ug::DataGeometry::removeEmptyParts | ( | ) |
Removes parts which either DataElements*or DataNodes* are NULL ptr.