SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
smtk::model::EntityRef Class Reference

A lightweight entityref pointing to a model entity's resource. More...

#include <EntityRef.h>

Inheritance diagram for smtk::model::EntityRef:
[legend]
Collaboration diagram for smtk::model::EntityRef:
[legend]

Public Member Functions

 SMTK_BASE_TYPE (EntityRef)
 
 EntityRef ()
 Construct an invalid entityref.
 
 EntityRef (ResourcePtr resource, const smtk::common::UUID &entityId)
 Construct a entityref referencing a given entity residing in the given rsrc.
 
 EntityRef (EntityPtr src)
 Construct a entityref referencing a given entity residing in the given rsrc.
 
bool setResource (ResourcePtr resource)
 Change the underlying resource the entityref references.
 
ResourcePtr resource ()
 Return the underlying resource the entityref references.
 
const ResourcePtr resource () const
 
bool setEntity (const smtk::common::UUID &entityId)
 Change the UUID of the entity the entityref references.
 
const smtk::common::UUIDentity () const
 Return the UUID of the entity the entityref references.
 
smtk::model::EntityPtr entityRecord () const
 Return the smtk::model::Entity record for this model entity.
 
smtk::resource::ComponentPtr component () const
 Return the resource component for this model entity.
 
int dimension () const
 Return the nominal parametric dimension of the entity (or -1). More...
 
int dimensionBits () const
 Return the nominal parametric dimension(s) of the entity as a bit vector. More...
 
void setDimensionBits (BitFlags dim)
 Set the dimensionality of this entity. More...
 
BitFlags entityFlags () const
 Return the bit vector describing the entity's type. More...
 
std::string flagSummary (int form=0) const
 A string summary of the type of entity represented by this entityref. More...
 
int maxParametricDimension () const
 Return the maximum number of coordinates required to parameterize this model's point locus. More...
 
int embeddingDimension () const
 Return the dimension of the space into which this entity is embedded. More...
 
std::string name () const
 Report the name associated with this entity. More...
 
void setName (const std::string &n)
 Assign a name to an entity. More...
 
std::string assignDefaultName (bool overwrite=false)
 Assign a default name to the entity. More...
 
bool hasVisibility () const
 Returns true if the "visible" integer-property exists.
 
bool visible () const
 Report the visibility associated with this entity. More...
 
void setVisible (bool vis)
 Assign the visible property to an entity. More...
 
void setExclusions (bool v, int mask=Exclusions::Everything)
 Set the exclusions. More...
 
int exclusions (int mask=Exclusions::Everything) const
 Get the exclusions status. More...
 
FloatList color () const
 Return a user-assigned color for the entity. More...
 
bool hasColor () const
 Returns true if the "color" float-property exists. No check on the size is performed.
 
void setColor (const FloatList &rgba)
 Assign a color to an entity. More...
 
void setColor (double r, double g, double b, double a=1.)
 Assign a color to an entity. More...
 
bool isValid () const
 Return whether the entityref is pointing to valid resource that contains the UUID of the entity. More...
 
virtual bool isValid (EntityPtr *entityRecord) const
 Return whether the entityref is pointing to valid resource that contains the UUID of the entity. More...
 
virtual bool checkForArrangements (ArrangementKind k, EntityPtr &entry, Arrangements *&arr) const
 A wrapper around EntityRef::isValid() which also verifies an arrangement exists.
 
bool isCellEntity () const
 
bool isUseEntity () const
 
bool isShellEntity () const
 
bool isGroup () const
 
bool isModel () const
 
bool isInstance () const
 
bool isSessionRef () const
 
bool isAuxiliaryGeometry () const
 
bool isConcept () const
 
bool isVertex () const
 
bool isEdge () const
 
bool isFace () const
 
bool isVolume () const
 
bool isChain () const
 
bool isLoop () const
 
bool isShell () const
 
bool isVertexUse () const
 
bool isEdgeUse () const
 
bool isFaceUse () const
 
bool isVolumeUse () const
 
template<typename T >
as () const
 Reinterpret a entityref as a subclass. More...
 
EntityRefs bordantEntities (int ofDimension=-2) const
 
EntityRefs boundaryEntities (int ofDimension=-2) const
 
std::vector< double > boundingBox () const
 
std::vector< double > unionBoundingBox (const std::vector< double > &b1, const std::vector< double > &b2) const
 
std::vector< double > unionBoundingBox (const std::vector< double > &b1, const std::array< double, 6 > &b2) const
 
EntityRefs lowerDimensionalBoundaries (int lowerDimension)
 
EntityRefs higherDimensionalBordants (int higherDimension)
 
EntityRefs adjacentEntities (int ofDimension)
 
template<typename T >
relationsAs () const
 Return all of the entities related to this entityref. More...
 
EntityRefs relations () const
 Return a set of entities related to this entity. This method is provided for Python wrapping.
 
EntityRefaddRawRelation (const EntityRef &ent)
 Add a relation to an entity, ent, without specifying the relationship's nature. More...
 
EntityReffindOrAddRawRelation (const EntityRef &ent)
 Find or add a relation to an entity, ent, without specifying the relationship's nature. More...
 
EntityRefelideRawRelation (const EntityRef &ent)
 Nullify a relation to the given entity, ent. More...
 
smtk::mesh::MeshSet meshTessellation () const
 Return the entity's mesh tessellation. More...
 
TessellationresetTessellation ()
 Return an empty tessellation attached to the entity. More...
 
const TessellationhasTessellation () const
 Return the entity's tessellation if one exists or nullptr otherwise.
 
const TessellationhasAnalysisMesh () const
 Return the entity's analysis mesh if one exists or nullptr otherwise.
 
const TessellationgotMesh () const
 Return the entity's analysis mesh if one exists, otherwise return the entity's tessellation. More...
 
int setTessellation (const Tessellation *tess, int analysisMesh=0, bool updateBBox=false)
 Set the tessellation of the entity, returning its generation number (or -1 on failure). More...
 
int setTessellationAndBoundingBox (const Tessellation *tess, int analysisMesh=0)
 
bool removeTessellation (bool removeGen=false)
 Remove the tessellation of the entity, returning true if such a tessellation existed. More...
 
void findEntitiesWithTessellation (std::map< smtk::model::EntityRef, smtk::model::EntityRef > &entityrefMap, std::set< smtk::model::EntityRef > &touched) const
 A convenient method for finding all entities with tessellations owned by this entity. More...
 
int tessellationGeneration () const
 Return the generation number of the current tessellation (or -1 if no tessellation).
 
bool setTessellationGeneration (int gen)
 Set the tessellation generation number. More...
 
void setBoundingBox (const double bbox[6])
 Set the bounding box of the entity. More...
 
template<typename T >
bool disassociateAttributes (const T &attribPtrs)
 Returns true if at least 1 attribute in the set of attribPtrs was removed.
 
smtk::attribute::Attributes attributes (smtk::attribute::ConstResourcePtr res) const
 Return a list of attributes on the entity based on an attribute resource.
 
smtk::attribute::Attributes attributes () const
 Return a list of attributes on the entity based on the resource manager. More...
 
template<typename T >
bool removeProperty (const std::string &name)
 Remove the property of type T with the given name, returning true on success. More...
 
void setFloatProperty (const std::string &propName, smtk::model::Float propValue)
 
void setFloatProperty (const std::string &propName, const smtk::model::FloatList &propValue)
 
smtk::model::FloatList const & floatProperty (const std::string &propName) const
 
smtk::model::FloatList & floatProperty (const std::string &propName)
 
bool hasFloatProperty (const std::string &propName) const
 
bool removeFloatProperty (const std::string &propName)
 
bool hasFloatProperties () const
 Does this entity have any float-valued properties? More...
 
std::set< std::string > floatPropertyNames () const
 Return the names of all the floating-point properties.
 
void setStringProperty (const std::string &propName, const smtk::model::String &propValue)
 
void setStringProperty (const std::string &propName, const smtk::model::StringList &propValue)
 
smtk::model::StringList const & stringProperty (const std::string &propName) const
 
smtk::model::StringListstringProperty (const std::string &propName)
 
bool hasStringProperty (const std::string &propName) const
 
bool removeStringProperty (const std::string &propName)
 
bool hasStringProperties () const
 Does this entity have any string-valued properties? More...
 
std::set< std::string > stringPropertyNames () const
 Return the names of all the string properties.
 
void setIntegerProperty (const std::string &propName, smtk::model::Integer propValue)
 
void setIntegerProperty (const std::string &propName, const smtk::model::IntegerList &propValue)
 
smtk::model::IntegerList const & integerProperty (const std::string &propName) const
 
smtk::model::IntegerList & integerProperty (const std::string &propName)
 
bool hasIntegerProperty (const std::string &propName) const
 
bool removeIntegerProperty (const std::string &propName)
 
bool hasIntegerProperties () const
 Does this entity have any integer-valued properties? More...
 
std::set< std::string > integerPropertyNames () const
 Return the names of all the integer properties.
 
int numberOfArrangementsOfKind (ArrangementKind k) const
 Return the number of arrangements of the given kind k.
 
ArrangementfindArrangement (ArrangementKind k, int index)
 Return the i-th arrangement of kind k (or nullptr).
 
const ArrangementfindArrangement (ArrangementKind k, int index) const
 Return the i-th arrangement of kind k (or nullptr).
 
bool clearArrangements ()
 Delete all arrangements of this entity with prejudice.
 
EntityRef relationFromArrangement (ArrangementKind k, int arrangementIndex, int offset) const
 Return the relation specified by the offset into the specified arrangement.
 
bool removeArrangement (ArrangementKind k, int index=-1)
 Remove an arrangement. More...
 
EntityRefembedEntity (const EntityRef &thingToEmbed, bool checkExistence=true)
 Embed the specified thingToEmbed as an inclusion into this entityref's entity. More...
 
template<typename T >
EntityRefembedEntities (const T &container, bool checkExistence=true)
 Embed each of the entities in the container inside this entity.
 
bool isEmbedded (EntityRef &ent) const
 Return whether the specified entity is a direct inclusion in this entityref's entity.
 
EntityRef embeddedIn () const
 Report the entity into which this entity is directly embedded. More...
 
bool unembedEntity (const EntityRef &thingToUnembed)
 Unembed the specified thingToUnembed as an inclusion into this entityref's entity. More...
 
template<typename T >
EntityRefunembedEntities (const T &container)
 
template<typename T >
embeddedEntities () const
 
template<typename T >
instances () const
 Return all the instances this object serves as a prototype for.
 
Model owningModel () const
 Return the Model which owns this entity. More...
 
SessionRef owningSession () const
 Return the SessionRef which owns this entity. More...
 
Groups containingGroups () const
 Return the Groups which contains this entity.
 
bool isMember (const EntityRef &entity) const
 Return true when this EntityRef has a SUPERSET_OF relationship with ent.
 
EntityRef memberOf () const
 Return the first entity that this EntityRef has a SUBSET_OF relationship with.
 
bool operator== (const EntityRef &other) const
 A comparator provided so that entityrefs may be included in ordered sets.
 
bool operator!= (const EntityRef &other) const
 A comparator provided for convenience.
 
bool operator< (const EntityRef &other) const
 A comparator provided so that entityrefs may be included in ordered sets.
 
 operator bool () const
 
std::size_t hash () const
 A hash function for entityrefs. More...
 
template<>
SMTKCORE_EXPORT bool removeProperty (const std::string &pname)
 
template<>
SMTKCORE_EXPORT bool removeProperty (const std::string &pname)
 
template<>
SMTKCORE_EXPORT bool removeProperty (const std::string &pname)
 
Attribute associations
bool hasAttributes () const
 Does the entityref have any attributes associated with it? Note that this method uses the resource manager. More...
 
bool hasAttributes (smtk::attribute::ConstResourcePtr attRes) const
 Does the entityref have any attributes associated with it from a specific attribute resource?
 
bool hasAttribute (const smtk::common::UUID &attribId) const
 Does the entityref have a specific attribute (represented by an UUID) associate to it. More...
 
bool associateAttribute (smtk::attribute::ResourcePtr attResource, const smtk::common::UUID &attribId)
 Does the entityref have any attributes associated with it? - To be deprecated.
 
bool disassociateAttribute (smtk::attribute::ResourcePtr attResource, const smtk::common::UUID &attribId)
 Disassociate an attribute from the entity? - To be deprecated.
 
bool disassociateAttribute (smtk::attribute::ResourcePtr attResource, const smtk::common::UUID &attribId, bool reverse)
 Disassociate an attribute from the entity? - To be deprecated!
 
bool disassociateAllAttributes (smtk::attribute::ResourcePtr attResource)
 Remove all attribute association form this entityref.
 
bool disassociateAllAttributes (smtk::attribute::ResourcePtr attResource, bool reverse)
 Remove all attribute association form this entityref - To be deprecated!
 
smtk::attribute::Attributes attributes (smtk::attribute::ConstDefinitionPtr def) const
 Return a list of attributes on the entity based on an attribute definition. More...
 

Static Public Member Functions

template<typename S , typename T >
static void EntityRefsFromUUIDs (S &result, ResourcePtr, const T &uids)
 Convert a set of UUIDs into a set of entityrefs referencing the same rsrc. More...
 
template<typename S , typename T >
static void EntityRefsToUUIDs (S &uids, const T &entRefs)
 

Protected Member Functions

EntityRefaddMemberEntity (const EntityRef &memberToAdd)
 Add an entity as a member of this entity without any membership constraint checks.
 
template<typename T >
EntityRefaddMemberEntities (T begin, T end)
 
EntityRefremoveMemberEntity (const EntityRef &memberToRemove)
 Remove the memberToRemove from this EntityRef. More...
 
EntityRefremoveMemberEntity (int indexOfMemberToRemove)
 Remove a member from this EntityRef given the index of its arrangement. More...
 
template<typename T >
EntityRefremoveMemberEntities (T begin, T end)
 
ResourceEventRelationType subsetRelationType (const EntityRef &member) const
 Determine the nature of a SUPERSET_OF relationship. More...
 
ResourceEventRelationType embeddingRelationType (const EntityRef &embedded) const
 Determine the nature of an EMBEDDED_IN relationship. More...
 

Protected Attributes

smtk::model::WeakResourcePtr m_resource
 
smtk::common::UUID m_entity
 

Friends

class Group
 
class Model
 
class SessionRef
 

Detailed Description

A lightweight entityref pointing to a model entity's resource.

This class exposes methods from multiple members of the model resource that are all associated with a given entity. See Resource, Resource, Entity, EntityTypeBits, and other headers for documentation on the methods in this class.

It is a convenience class only and new functionality added to Resource and other smtk::model classes should not rely on it.

Member Function Documentation

◆ addRawRelation()

EntityRef & smtk::model::EntityRef::addRawRelation ( const EntityRef ent)

Add a relation to an entity, ent, without specifying the relationship's nature.

The relation is considered "raw" because no arrangement information is added describing the nature of the arrangement.

This method adds a relation regardless of whether ent is already a relation; ent may appear in the entity's list of relations multiple times after this call.

◆ as()

template<typename T >
T smtk::model::EntityRef::as ( ) const
inline

Reinterpret a entityref as a subclass.

Note that you should call isValid() on the resulting entityref subclass to perform sanity checks; this method will happily return an invalid object.

◆ assignDefaultName()

std::string smtk::model::EntityRef::assignDefaultName ( bool  overwrite = false)

Assign a default name to the entity.

This uses counters associated with the owning model or model resource to name the entity.

◆ attributes() [1/2]

smtk::attribute::Attributes smtk::model::EntityRef::attributes ( ) const

Return a list of attributes on the entity based on the resource manager.

Return the attributes associated with the entity that are from attribute resources managed by the resource manager associated to the model resource.

◆ attributes() [2/2]

smtk::attribute::Attributes smtk::model::EntityRef::attributes ( smtk::attribute::ConstDefinitionPtr  def) const

Return a list of attributes on the entity based on an attribute definition.

Return the attributes associated with the entity that are from a specific attribute resource.

Return the attributes associated with the entity that are of type (or derived type) def.

◆ color()

FloatList smtk::model::EntityRef::color ( ) const

Return a user-assigned color for the entity.

If no color was assigned, (0,0,0,-1) will be returned.

◆ dimension()

int smtk::model::EntityRef::dimension ( ) const

Return the nominal parametric dimension of the entity (or -1).

A value of -1 is returned when the entityref is invalid, or the entity does not have any specified dimension, or the entity may have components with multiple distinct dimensionalities.

◆ dimensionBits()

int smtk::model::EntityRef::dimensionBits ( ) const

Return the nominal parametric dimension(s) of the entity as a bit vector.

A value of 0 is returned when the entityref is invalid. Multiple bits will be set if the entity may have components with multiple distinct dimensionalities.

◆ elideRawRelation()

EntityRef & smtk::model::EntityRef::elideRawRelation ( const EntityRef ent)

Nullify a relation to the given entity, ent.

Any matching entries to ent in this entity's list of relations is set to the null UUID. This is done (as opposed to removing the relation) so that indices into the list of relations are preserved for any UUIDs that appear after ent.

The relation is considered "raw" because no arrangement information (which would describe the nature of the arrangement) is presumed to exist.

This method has no effect if ent is unrelated.

◆ embeddedIn()

EntityRef smtk::model::EntityRef::embeddedIn ( ) const

Report the entity into which this entity is directly embedded.

If the entity is not embedded into another, the result will be an invalid entityref.

◆ embeddingDimension()

int smtk::model::EntityRef::embeddingDimension ( ) const

Return the dimension of the space into which this entity is embedded.

This is the number of actual coordinate values associated with points in the underlying space of the entity (i.e., the point locus that make it up). It should be equal to or greater than the maximum parametric dimension.

All the entities in a model must have the same embedding dimension; it is a property stored with the model.

By default, the embedding dimension is 3.

◆ embeddingRelationType()

ResourceEventRelationType smtk::model::EntityRef::embeddingRelationType ( const EntityRef embedded) const
protected

Determine the nature of an EMBEDDED_IN relationship.

Given an EMBEDDED_IN arrangement, use the types of the involved entities to determine the exact nature of the relationship. This is used by the event framework so that observers can watch for particular types of events.

◆ embedEntity()

EntityRef & smtk::model::EntityRef::embedEntity ( const EntityRef thingToEmbed,
bool  checkExistence = true 
)

Embed the specified thingToEmbed as an inclusion into this entityref's entity.

This adds an INCLUDES relation (if necessary) to this entity and an EMBEDDED_IN relation (if necessary) to the thingToEmbed.

If checkExistence is true, then the relationship is not added if it would be a duplicate. This check is expensive because relationships are not indexed, so if you know thingToEmbed is not already embedded, pass false to checkExistence. The default is true.

◆ entityFlags()

BitFlags smtk::model::EntityRef::entityFlags ( ) const

Return the bit vector describing the entity's type.

See also
isVector, isEdge, ...

◆ EntityRefsFromUUIDs()

template<typename S , typename T >
void smtk::model::EntityRef::EntityRefsFromUUIDs ( S &  result,
ResourcePtr  rsrc,
const T &  uids 
)
static

Convert a set of UUIDs into a set of entityrefs referencing the same rsrc.

Convert a set of entity references into just UUIDs.

Only valid entities are inserted into result. This means that the UUID must be non-nullptr and have a corresponding entry in the model resource, rsrc, that matches the output container type in order to appear in result.

EntityRef entities in entRefs are not checked for validity before insertion; however, only non-nullptr UUIDs are inserted into result. (This means that cursors that do not have entries in the model resource will still have their UUIDs added to the result.)

◆ exclusions()

int smtk::model::EntityRef::exclusions ( int  mask = Exclusions::Everything) const

Get the exclusions status.

If the mask is not specified, it will return the aggregated status of each exclusion If the mask is specified, it will only return the status of the specified exclusion. 1 -> hidden and 0 -> not hidden

◆ findEntitiesWithTessellation()

void smtk::model::EntityRef::findEntitiesWithTessellation ( std::map< smtk::model::EntityRef, smtk::model::EntityRef > &  entityrefMap,
std::set< smtk::model::EntityRef > &  touched 
) const

A convenient method for finding all entities with tessellations owned by this entity.

Note that the entityrefMap is a map of entity with tessellation to its parent, and the touched is a set of entities already visited.

◆ findOrAddRawRelation()

EntityRef & smtk::model::EntityRef::findOrAddRawRelation ( const EntityRef ent)

Find or add a relation to an entity, ent, without specifying the relationship's nature.

The relation is considered "raw" because no arrangement information is added describing the nature of the arrangement.

This method has no effect if ent is already a relation.

◆ flagSummary()

std::string smtk::model::EntityRef::flagSummary ( int  form = 0) const

A string summary of the type of entity represented by this entityref.

If form is non-zero, the plural form of the summary is returned.

◆ gotMesh()

const Tessellation * smtk::model::EntityRef::gotMesh ( ) const

Return the entity's analysis mesh if one exists, otherwise return the entity's tessellation.

If neither exist return nullptr.

◆ hasAttribute()

bool smtk::model::EntityRef::hasAttribute ( const smtk::common::UUID attribId) const

Does the entityref have a specific attribute (represented by an UUID) associate to it.

Note that this method requires a resource manager. If the model and/or attribute resource is not managed, the method will always return false - To be deprecated

◆ hasAttributes()

bool smtk::model::EntityRef::hasAttributes ( ) const

Does the entityref have any attributes associated with it? Note that this method uses the resource manager.

If the corresponding model resource is unmanaged this will return false.

◆ hasFloatProperties()

bool smtk::model::EntityRef::hasFloatProperties ( ) const

Does this entity have any float-valued properties?

If not, you should call EntityRef::setFloatProperty() before calling EntityRef::floatProperties().

◆ hash()

std::size_t smtk::model::EntityRef::hash ( ) const

A hash function for entityrefs.

This allows entityrefs to be put into sets in Python.

◆ hasIntegerProperties()

bool smtk::model::EntityRef::hasIntegerProperties ( ) const

Does this entity have any integer-valued properties?

If not, you should call EntityRef::setIntegerProperty() before calling EntityRef::integerProperties().

◆ hasStringProperties()

bool smtk::model::EntityRef::hasStringProperties ( ) const

Does this entity have any string-valued properties?

If not, you should call EntityRef::setStringProperty() before calling EntityRef::stringProperties().

◆ isValid() [1/2]

bool smtk::model::EntityRef::isValid ( ) const

Return whether the entityref is pointing to valid resource that contains the UUID of the entity.

Subclasses should not override this method.

◆ isValid() [2/2]

bool smtk::model::EntityRef::isValid ( EntityPtr entityRecord) const
virtual

Return whether the entityref is pointing to valid resource that contains the UUID of the entity.

Subclasses override this and additionally return whether the entity is of a type that matches the EntityRef subclass. For example, it is possible to create a Vertex entityref from a UUID referring to an EdgeUse. While EntityRef::isValid() will return true, Vertex::isValid() will return false.

The optional entityRecord will be set when a non-nullptr value is passed and the entity is valid.

◆ maxParametricDimension()

int smtk::model::EntityRef::maxParametricDimension ( ) const

Return the maximum number of coordinates required to parameterize this model's point locus.

Unlike EntityRef::dimension(), this will always return a non-negative number for valid cell, use, shell and model entities. It returns -1 for unpopulated groups with no members, instance entities, sessions, and other entities with no dimension bits set.

◆ meshTessellation()

smtk::mesh::MeshSet smtk::model::EntityRef::meshTessellation ( ) const

Return the entity's mesh tessellation.

Each entity has a single meshset describing its tessellation. The meshset could, but does not have to, contain sub-meshsets within it.

◆ name()

std::string smtk::model::EntityRef::name ( ) const

Report the name associated with this entity.

This will not assign a default name to the entity (that would violate the const-ness of the method), but will report a UUID-based name for the entity if it does not have a user-assigned name.

◆ owningModel()

Model smtk::model::EntityRef::owningModel ( ) const

Return the Model which owns this entity.

A Model is analogous to a body in some kernels, a lump in others, or a group of regions in yet others. In SMTK, models are the objects that get associated with sessions to other kernels, so determining the owning model is important for discovering which modeling operations (including reading and writing to/from disk) are possible.

Note that the returned model may be invalid.

◆ owningSession()

SessionRef smtk::model::EntityRef::owningSession ( ) const

Return the SessionRef which owns this entity.

A session is a collection of models held at the same URL (i.e., in the same file), if loaded from storage, and managed by the same modeling kernel.

◆ relationsAs()

template<typename T >
T smtk::model::EntityRef::relationsAs

Return all of the entities related to this entityref.

The return value is a template parameter naming container type. Each member is cast from a EntityRef to T::value_type and added to the container only if valid. This makes it possible to subset the relations by forcing them into a container of the desired type.

◆ removeArrangement()

bool smtk::model::EntityRef::removeArrangement ( ArrangementKind  k,
int  index = -1 
)

Remove an arrangement.

This will remove an arrangement – starting with the side held by this entity. Unlike other methods that generally start with the "parent" (the "one" in a "one-to-many" relationship), this starts with the current entity (even if it is the "child" or one of the "many"). This makes it possible to remove a broken, one-sided arrangement.

If index is invalid (i.e., negative), then the first arrangement of the given kind will be removed.

◆ removeProperty()

template<typename T >
smtk::model::EntityRef::removeProperty< T > ( const std::string &  name)

Remove the property of type T with the given name, returning true on success.

False is returned if the property did not exist for the given entity.

This templated version exists for use in functions where the property type is a template parameter.

◆ removeTessellation()

bool smtk::model::EntityRef::removeTessellation ( bool  removeGen = false)

Remove the tessellation of the entity, returning true if such a tessellation existed.

If removeGen is true (false is the default), then also remove the generation-number property (a monotonically increasing integer property used to signal that the tessellation has changed).

◆ resetTessellation()

Tessellation * smtk::model::EntityRef::resetTessellation ( )

Return an empty tessellation attached to the entity.

NB. You are responsible for calling setBoundingBox() on the entity after the resulting tessellation has been updated.

◆ setBoundingBox()

void smtk::model::EntityRef::setBoundingBox ( const double  bbox[6])

Set the bounding box of the entity.

This should not be called outside of an operator.

◆ setColor() [1/2]

void smtk::model::EntityRef::setColor ( const FloatList &  rgba)

Assign a color to an entity.

This will override any existing color. No check on the size is performed, but you should provide 4 values per color: red, green, blue, and alpha. Each should be in [0,1].

◆ setColor() [2/2]

void smtk::model::EntityRef::setColor ( double  red,
double  green,
double  blue,
double  alpha = 1. 
)

Assign a color to an entity.

This will override any existing color. Each value should be in [0,1].

◆ setDimensionBits()

void smtk::model::EntityRef::setDimensionBits ( BitFlags  dimBits)

Set the dimensionality of this entity.

WARNING: Intended for internal use only.

This method is used by some sessions to change the dimensionality of a model after it has been transcribed. Do not call it.

◆ setExclusions()

void smtk::model::EntityRef::setExclusions ( bool  v,
int  mask = Exclusions::Everything 
)

Set the exclusions.

If the mask is not specified, it wil update the exclusions::Everything to the provide value. If the mask is specified, it will only updates the specified exclusion

◆ setName()

void smtk::model::EntityRef::setName ( const std::string &  n)

Assign a name to an entity.

This will override any existing name.

◆ setTessellation()

int smtk::model::EntityRef::setTessellation ( const Tessellation tess,
int  analysisMesh = 0,
bool  updateBBox = false 
)

Set the tessellation of the entity, returning its generation number (or -1 on failure).

If analysisMesh is non-zero (zero is the default), then the tessellation is treated as an analysis mesh rather than a tessellation for display purposes.

This should not be called outside of an operator.

◆ setTessellationGeneration()

bool smtk::model::EntityRef::setTessellationGeneration ( int  gen)

Set the tessellation generation number.

This method is intended for use by mesh resources. Other resources should use resetTessellation() or setTessellation() to automatically advance the generation number.

Returns true when the generation number is set and false otherwise (invalid component or out-of-order generation number).

◆ setVisible()

void smtk::model::EntityRef::setVisible ( bool  vis)

Assign the visible property to an entity.

This will override any existing visibility.

◆ unembedEntity()

bool smtk::model::EntityRef::unembedEntity ( const EntityRef thingToEmbed)

Unembed the specified thingToUnembed as an inclusion into this entityref's entity.

This removes an INCLUDES relation (if necessary) to this entity and an EMBEDDED_IN relation (if necessary) to the thingToUnembed.

◆ visible()

bool smtk::model::EntityRef::visible ( ) const

Report the visibility associated with this entity.

If there is no "visible" property set,return true


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