SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
smtk::model::Arrangement Class Reference

Store an arrangement of solid model entities. More...

#include <Arrangement.h>

Collaboration diagram for smtk::model::Arrangement:
[legend]

Classes

struct  IndexAndSenseHelper
 A helper to extract the relationship from an arrangement that stores an index and sense. More...
 
struct  IndexHelper
 A helper to extract the relationship from an arrangement that stores only an index. More...
 
struct  IndexRangeHelper
 A helper to extract relationships from an arrangement that stores an index range. More...
 
struct  IndexSenseAndOrientationHelper
 A helper to extract the relationship from an arrangement that stores an index, sense, and orientation. More...
 

Public Types

typedef IndexSenseAndOrientationHelper<&Arrangement::IndexSenseAndOrientationFromCellHasUseCellHasUseRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromCellEmbeddedInEntityCellEmbeddedInEntityRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromCellIncludesEntityCellIncludesEntityRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromCellHasShellCellHasShellRelationHelper
 
typedef IndexAndSenseHelper<&Arrangement::IndexAndSenseFromUseHasCellUseHasCellRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromUseHasShellUseHasShellRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromUseOrShellIncludesShellUseOrShellIncludesShellRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromShellHasCellShellHasCellRelationHelper
 
typedef IndexRangeHelper<&Arrangement::IndexRangeFromShellHasUseShellHasUseRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromShellEmbeddedInUseOrShellShellEmbeddedInUseOrShellRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromInstanceInstanceOfInstanceInstanceOfRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromEntityInstancedByInstanceInstancedByRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromEntitySupersetOfEntitySupersetOfRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromEntitySubsetOfEntitySubsetOfRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromAuxiliaryGeometryEmbeddedInEntityAuxiliaryGeometryEmbeddedInEntityRelationHelper
 
typedef IndexHelper<&Arrangement::IndexFromAuxiliaryGeometryIncludesEntityAuxiliaryGeometryIncludesEntityRelationHelper
 

Public Member Functions

bool relations (smtk::common::UUIDArray &relsOut, EntityPtr ent, ArrangementKind k) const
 Return the UUIDs of any related entities referenced by this arrangement. More...
 
bool relationIndices (std::vector< int > &relsOut, EntityPtr ent, ArrangementKind k) const
 Return the indices (into the entity's relations) of any entities referenced by this arrangement. More...
 
std::vector< int > & details ()
 Access to the integer vector defining an arrangement.
 
std::vector< int > const & details () const
 Access to the integer vector defining an arrangement.
 

Static Public Member Functions

Methods to construct arrangement records.

These should be preferred to manual construction of arrangements so that conventions can be changed in the future.

Each method starts with the name of entity type the arrangement will be associated with (e.g., an arrangement that specifies how a relation on a cell is related to that cell starts with "Cell"). This is followed by the name of the ArrangementKind enumerant describing the relationship (e.g., HAS_USE becomes "HasUse"). Finally, the parameters are called out as part of the method name where appropriate to prevent misinterpretation when calling (e.g., "CellHasUseWithIndexSenseAndOrientation" is used to note the order of the relation index and sense in the function call – this does not necessarily reflect their order in the arrangement).

static Arrangement Construct (EntityTypeBits t, ArrangementKind k, int relationIdx, int sense, Orientation o)
 Construct the "parent" end of a bidirectional arrangement of kind k. More...
 
static Arrangement CellHasUseWithIndexSenseAndOrientation (int relationIdx, int sense, Orientation o)
 Construct an arrangement record to add to a cell, indicating a use of that cell. More...
 
static Arrangement CellEmbeddedInEntityWithIndex (int relationIdx)
 Construct an arrangement record to add to a cell, indicating its parent entity. More...
 
static Arrangement CellIncludesEntityWithIndex (int relationIdx)
 Construct an arrangement record to add to a cell, indicating that it contains an entity. More...
 
static Arrangement CellHasShellWithIndex (int relationIdx)
 Construct an arrangement record to add to a cell, indicating a boundary shell. More...
 
static Arrangement UseHasCellWithIndexAndSense (int relationIdx, int sense)
 Construct an arrangement record to add to a cell-use, indicating its parent cell. More...
 
static Arrangement UseHasShellWithIndex (int relationIdx)
 Construct an arrangement record to add to a cell-use, indicating its parent shell. More...
 
static Arrangement UseOrShellIncludesShellWithIndex (int relationIdx)
 Construct an arrangement record to add to a cell-use, indicating a child shell. More...
 
static Arrangement ShellHasCellWithIndex (int relationIdx)
 Construct an arrangement to add to a shell, indicating its parent cell. More...
 
static Arrangement ShellHasUseWithIndexRange (int relationBegin, int relationEnd)
 Construct an arrangement to add to a shell, indicating the uses that compose it. More...
 
static Arrangement ShellEmbeddedInUseOrShellWithIndex (int relationIdx)
 Create a record for a shell indicating the entity it is embedded in.
 
static Arrangement InstanceInstanceOfWithIndex (int relationIdx)
 Create a record for an instance indicating the prototype entity it instantiates.
 
static Arrangement EntityInstancedByWithIndex (int relationIdx)
 Create a record for an entity indicating that it serves as a prototype for an instance.
 
static Arrangement EntitySupersetOfWithIndex (int relationIdx)
 Create a record for an entity indicating that it groups other entities beneath it (as children).
 
static Arrangement EntitySubsetOfWithIndex (int relationIdx)
 Create a record for an entity indicating that is a group member of another (its parent).
 

Protected Attributes

std::vector< int > m_details
 

Methods to interpret arrangements.

Use these methods to obtain integers assocated with a semantic meaning from the arrangement vector.

If a vector is not sized properly, these methods will return false.

bool IndexSenseAndOrientationFromCellHasUse (int &relationIdx, int &sense, Orientation &orient) const
 Obtain the index (relationIdx), sense, and orientation (orient) from a cell's HAS_USE arrangement.
 
bool IndexFromCellEmbeddedInEntity (int &relationIdx) const
 Obtain the index of the including entity from a cell EMBEDDED_IN arrangement.
 
bool IndexFromCellIncludesEntity (int &relationIdx) const
 Obtain the index of an embedded entity from a cell INCLUDES arrangement.
 
bool IndexFromCellHasShell (int &relationIdx) const
 Obtain the index of a shell entity from a cell's HAS_SHELL arrangement.
 
bool IndexAndSenseFromUseHasCell (int &relationIdx, int &sense) const
 Obtain the index and sense of a cell entity from a cell-use's HAS_CELL arrangement.
 
bool IndexFromUseHasShell (int &relationIdx) const
 Obtain the index of a shell containing this cell-use.
 
bool IndexFromUseOrShellIncludesShell (int &relationIdx) const
 Obtain the index of a child shell included in this use or shell.
 
bool IndexFromShellHasCell (int &relationIdx) const
 Obtain the index (relationIdx), sense, and orientation (orient) from a cell's HAS_USE arrangement.
 
bool IndexRangeFromShellHasUse (int &relationBegin, int &relationEnd) const
 Obtain the index (relationIdx), sense, and orientation (orient) from a cell's HAS_USE arrangement.
 
bool IndexFromShellEmbeddedInUseOrShell (int &relationIdx) const
 Obtain the index of the shell or cell-use in which this shell is embedded.
 
bool IndexFromInstanceInstanceOf (int &relationIdx) const
 Obtain the index of the prototype of which this entity is an instance.
 
bool IndexFromEntityInstancedBy (int &relationIdx) const
 Obtain the index of the instance for which this entity is a prototype.
 
bool IndexFromEntitySupersetOf (int &relationIdx) const
 Obtain the index of an entity contained within this entity.
 
bool IndexFromEntitySubsetOf (int &relationIdx) const
 Obtain the index of the entity containing this one as its child.
 
bool IndexFromAuxiliaryGeometryEmbeddedInEntity (int &relationIdx) const
 Obtain the index of the including entity from an auxiliary geometry EMBEDDED_IN arrangement.
 
bool IndexFromAuxiliaryGeometryIncludesEntity (int &relationIdx) const
 Obtain the index of an embedded entity from an auxiliary geometry INCLUDES arrangement.
 
bool IndexFromSimple (int &relationIdx) const
 Return the index of a related entity from an arrangement holding only this single index.
 
static Arrangement SimpleIndex (int relationIdx)
 Create an arrangement holding the index of a single entity ID (a simple arrangement).
 

Detailed Description

Store an arrangement of solid model entities.

Note that arrangements may be some combination of permutations, combinations, or hierarchies. This structure provides storage for any type of arrangement via a vector of integers. These integers may be the sense in which a cell is used or offsets into a cell's relations or arrangements.

See the documentation of ArrangementKind for specifics.

Member Function Documentation

◆ CellEmbeddedInEntityWithIndex()

Arrangement smtk::model::Arrangement::CellEmbeddedInEntityWithIndex ( int  relationIdx)
static

Construct an arrangement record to add to a cell, indicating its parent entity.

The relationIdx is the offset in the Entity::relations() array of the CELL_ENTITY.

When the parent entity is a topological entity and the cell is dimension d, the parent entity must be of dimension greater than or equal to d and the cell must be completely interior to its parent. (Example: you may embed a point, edge, or face in a face, but not a volume within a face.)

◆ CellHasShellWithIndex()

Arrangement smtk::model::Arrangement::CellHasShellWithIndex ( int  relationIdx)
static

Construct an arrangement record to add to a cell, indicating a boundary shell.

The relationIdx is the offset in the Entity::relations() array of the CELL_ENTITY. Only toplevel shells (not contained inside other shells of this cell) should be added directly to the cell. Other shells should be added to the shell entities which contain them. In this way, the shells form a tree.

◆ CellHasUseWithIndexSenseAndOrientation()

Arrangement smtk::model::Arrangement::CellHasUseWithIndexSenseAndOrientation ( int  relationIdx,
int  sense,
Orientation  orient 
)
static

Construct an arrangement record to add to a cell, indicating a use of that cell.

The relationIdx is the offset in the Entity::relations() array of the USE_ENTITY. The sense is an arbitrary integer, but for faces should be either 0 (when orient is NEGATIVE) or 1 (when orient is POSITIVE). the values of the enum should be used.

◆ CellIncludesEntityWithIndex()

Arrangement smtk::model::Arrangement::CellIncludesEntityWithIndex ( int  relationIdx)
static

Construct an arrangement record to add to a cell, indicating that it contains an entity.

The relationIdx is the offset in the Entity::relations() array of the CELL_ENTITY.

When the entity to be included is a topological entity and the cell is dimension d, the included entity must be of dimension than or equal to d and must be completely geometrically interior to the cell. (Example: a face may include a point or edge or face, but not a volume.)

◆ Construct()

Arrangement smtk::model::Arrangement::Construct ( EntityTypeBits  t,
ArrangementKind  k,
int  relationIdx,
int  sense,
Orientation  orientation 
)
static

Construct the "parent" end of a bidirectional arrangement of kind k.

Note that sense and orientation may be ignored depending on k; in these cases, you may pass any value.

◆ relationIndices()

bool smtk::model::Arrangement::relationIndices ( std::vector< int > &  idxsOut,
EntityPtr  ent,
ArrangementKind  k 
) const

Return the indices (into the entity's relations) of any entities referenced by this arrangement.

You must provide the smtk::model::Entity record ent and smtk::model::ArrangementKind k that define this arrangement. These provide the context in which the arrangement information should be interpreted: ent provides the type of entity on which the arrangement is defined, k defines the type of relationship, and ent then provides the list of UUIDs which some entry in this arrangement references.

If this method returns true, then idxsOut will have the relevant UUID(s) appended. Otherwise, idxsOut will be unchanged. Note that this method does not clear idxsOut so that you may accumulate relations from multiple arrangements into a single array for later processing.

◆ relations()

bool smtk::model::Arrangement::relations ( smtk::common::UUIDArray relsOut,
EntityPtr  ent,
ArrangementKind  k 
) const

Return the UUIDs of any related entities referenced by this arrangement.

You must provide the smtk::model::Entity record ent and smtk::model::ArrangementKind k that define this arrangement. These provide the context in which the arrangement information should be interpreted: ent provides the type of entity on which the arrangement is defined, k defines the type of relationship, and ent then provides the list of UUIDs which some entry in this arrangement references.

If this method returns true, then relsOut will have the relevant UUID(s) appended. Otherwise, relsOut will be unchanged. Note that this method does not clear relsOut so that you may accumulate relations from multiple arrangements into a single array for later processing.

This method and smtk::model::Resource::findDualArrangements() are the two main methods which determine how arrangements should be interpreted in context without any prior constraints on the context. (Other methods create and interpret arrangements in specific circumstances where the context is known.)

◆ ShellHasCellWithIndex()

Arrangement smtk::model::Arrangement::ShellHasCellWithIndex ( int  relationIdx)
static

Construct an arrangement to add to a shell, indicating its parent cell.

This relationship indicates that the shell forms part of the boundary of its parent cell. The relationIdx is the offset in the Entity::relations() array of the SHELL_ENTITY.

◆ ShellHasUseWithIndexRange()

Arrangement smtk::model::Arrangement::ShellHasUseWithIndexRange ( int  relationBegin,
int  relationEnd 
)
static

Construct an arrangement to add to a shell, indicating the uses that compose it.

The relationStart and relationEnd specify a range of offsets in the Entity::relations() array of the SHELL_ENTITY. The range is half-open: relationBegin is included but relationEnd is not.

◆ UseHasCellWithIndexAndSense()

Arrangement smtk::model::Arrangement::UseHasCellWithIndexAndSense ( int  relationIdx,
int  sense 
)
static

Construct an arrangement record to add to a cell-use, indicating its parent cell.

The relationIdx is the offset in the Entity::relations() array of the CELL_ENTITY. The sense is an arbitrary integer, but for edges and faces (not vertices), the values of the CellUseSenses enum should be used.

◆ UseHasShellWithIndex()

Arrangement smtk::model::Arrangement::UseHasShellWithIndex ( int  relationIdx)
static

Construct an arrangement record to add to a cell-use, indicating its parent shell.

The relationIdx is the offset in the Entity::relations() array of a single parent SHELL_ENTITY. The parent shell must span a dimension higher than the cell-use. A cell-use may also have an EMBEDDED_IN arrangement to indicate child shell(s).

◆ UseOrShellIncludesShellWithIndex()

Arrangement smtk::model::Arrangement::UseOrShellIncludesShellWithIndex ( int  relationIdx)
static

Construct an arrangement record to add to a cell-use, indicating a child shell.

The relationIdx is the offset in the Entity::relations() array of the SHELL_ENTITY.


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