SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
10 #ifndef smtk_model_Model_h
11 #define smtk_model_Model_h
15 #include "smtk/model/CellEntity.h"
16 #include "smtk/model/Group.h"
24 typedef std::vector<CellEntity> CellEntities;
25 typedef std::vector<Model>
Models;
37 void setEmbeddingDimension(
int dim);
43 bool isModified()
const;
44 void setIsModified(
bool isModified);
46 CellEntities cells()
const;
47 Groups groups()
const;
56 T submodelsAs()
const;
58 void appendCells(T& container)
const;
63 Model& addCells(
const T& container,
bool checkExists =
true);
65 Model& removeCells(
const T& container);
70 Model& addGroups(
const T& container);
72 Model& removeGroups(
const T& container);
77 Model& addSubmodels(
const T& container);
79 Model& removeSubmodels(
const T& container);
84 Model& addAuxiliaryGeometries(
const T& container);
86 Model& removeAuxiliaryGeometries(
const T& container);
88 void assignDefaultNames();
98 CellEntities tmp = this->
cells();
100 for (CellEntities::iterator it = tmp.begin(); it != tmp.end(); ++it)
102 typename T::value_type entry(*it);
104 result.insert(result.end(), *it);
114 Groups tmp = this->
groups();
116 for (Groups::iterator it = tmp.begin(); it != tmp.end(); ++it)
118 typename T::value_type entry(*it);
120 result.insert(result.end(), *it);
132 for (Models::iterator it = tmp.begin(); it != tmp.end(); ++it)
134 typename T::value_type entry(*it);
136 result.insert(result.end(), *it);
146 CellEntities tmp = this->
cells();
147 for (CellEntities::iterator it = tmp.begin(); it != tmp.end(); ++it)
149 typename T::value_type entry(*it);
151 container.insert(container.end(), *it);
171 this->unembedEntities(container);
179 for (
typename T::const_iterator it = container.begin(); it != container.end(); ++it)
190 for (
typename T::const_iterator it = container.begin(); it != container.end(); ++it)
192 this->removeGroup(*it);
201 for (
typename T::const_iterator it = container.begin(); it != container.end(); ++it)
203 this->addSubmodel(*it);
212 for (
typename T::const_iterator it = container.begin(); it != container.end(); ++it)
214 this->removeSubmodel(*it);
223 for (
typename T::const_iterator it = container.begin(); it != container.end(); ++it)
234 for (
typename T::const_iterator it = container.begin(); it != container.end(); ++it)
244 #endif // smtk_model_Model_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Model & addAuxiliaryGeometries(const T &container)
Add all the auxiliary geometry entities in container to this model.
Definition: Model.h:221
Model & removeGroups(const T &container)
Add all the groups in container to this model.
Definition: Model.h:188
Model & addCells(const T &container, bool checkExists=true)
Add all the free cells in container to this model.
Definition: Model.h:161
Model & addAuxiliaryGeometry(const AuxiliaryGeometry &ag)
Add the given auxiliary geometry to this model.
Definition: Model.cxx:263
std::vector< smtk::model::AuxiliaryGeometry > AuxiliaryGeometries
Definition: PublicPointerDefs.h:144
A entityref subclass that provides methods specific to models.
Definition: Model.h:30
CellEntities cells() const
Return the cells directly owned by this model.
Definition: Model.cxx:114
A entityref subclass with methods specific to cell entities.
Definition: CellEntity.h:30
Model & addSubmodels(const T &container)
Add all the models in container as submodels to this model.
Definition: Model.h:199
Model & removeAuxiliaryGeometry(const AuxiliaryGeometry &ag)
Remove the given auxiliary geometry from this model (if present as a top-level entry).
Definition: Model.cxx:273
An EntityRef subclass for representing unmodeled geometry to be included in a scene.
Definition: AuxiliaryGeometry.h:44
Model & removeSubmodels(const T &container)
Remove all the models in container from this model (if they are submodels).
Definition: Model.h:210
Model & addGroups(const T &container)
Add all the groups in container to this model.
Definition: Model.h:177
EntityRef & embedEntities(const T &container, bool checkExistence=true)
Embed each of the entities in the container inside this entity.
Definition: EntityRef.h:425
ModelGeometryStyle
Enumerate how model domains are represented.
Definition: EntityTypeBits.h:307
A entityref subclass that provides methods specific to entity use records.
Definition: SessionRef.h:28
T cellsAs() const
Return the top-level (free) cells of this model in a container of the template type.
Definition: Model.h:95
Model & removeCells(const T &container)
Remove all the free cells in container from this model.
Definition: Model.h:169
T submodelsAs() const
Return the child models of this model in a container of the template type.
Definition: Model.h:127
A entityref subclass that provides methods specific to entity use records.
Definition: Group.h:27
T groupsAs() const
Return the top-level (free) groups of this model in a container of the template type.
Definition: Model.h:111
void appendCells(T &container) const
Append free cells of this model to the given container. Only valid cells are inserted.
Definition: Model.h:143
Groups groups() const
Return the groups directly owned by this model.
Definition: Model.cxx:141
std::vector< smtk::model::Model > Models
Definition: PublicPointerDefs.h:200
#define SMTK_ENTITYREF_CLASS(thisclass, superclass, typecheck)
A macro to implement mandatory EntityRef-subclass constructors.
Definition: EntityRef.h:43
std::set< smtk::model::EntityRef > EntityRefs
Definition: PublicPointerDefs.h:162
A lightweight entityref pointing to a model entity's resource.
Definition: EntityRef.h:112
Models submodels() const
Return the models directly owned by this model.
Definition: Model.cxx:149
Model & removeAuxiliaryGeometries(const T &container)
Remove all the auxiliary geometry entities in container from this model.
Definition: Model.h:232