SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
ShellEntity.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 #ifndef smtk_model_ShellEntity_h
11 #define smtk_model_ShellEntity_h
12 
13 #include "smtk/model/EntityRef.h"
14 #include "smtk/model/EntityRefArrangementOps.h"
15 
16 namespace smtk
17 {
18 namespace model
19 {
20 
21 class CellEntity;
22 class ShellEntity;
23 typedef std::vector<ShellEntity> ShellEntities;
24 class UseEntity;
25 typedef std::vector<UseEntity> UseEntities;
26 
33 class SMTKCORE_EXPORT ShellEntity : public EntityRef
34 {
35 public:
37 
38  CellEntity boundingCell() const;
39  UseEntity boundingUseEntity() const;
40 
41  bool contains(const UseEntity& bdyUse) const;
42 
43  template<typename T>
44  T uses() const;
45  template<typename T>
46  T cellsOfUses() const;
47 
48  ShellEntity containingShellEntity() const;
49  template<typename T>
50  T containedShellEntities() const;
51 
52  ShellEntity& addUse(const UseEntity& use);
53  template<typename T>
54  ShellEntity& addUses(const T& useContainer);
55 };
56 
66 template<typename T>
68 {
69  T result;
71  return result;
72 }
73 
77 template<typename T>
79 {
80  T result;
82  return result;
83 }
84 
85 template<typename T>
86 ShellEntity& ShellEntity::addUses(const T& useContainer)
87 {
88  for (typename T::const_iterator it = useContainer.begin(); it != useContainer.end(); ++it)
89  {
90  this->addUse(*it);
91  }
92  return *this;
93 }
94 
95 } // namespace model
96 } // namespace smtk
97 
98 #endif // smtk_model_ShellEntity_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::model::ShellEntities
std::vector< smtk::model::ShellEntity > ShellEntities
Definition: PublicPointerDefs.h:208
smtk::model::ShellEntity::containedShellEntities
T containedShellEntities() const
Return all the shell-entities contained inside this one.
Definition: ShellEntity.h:78
smtk::model::ShellEntity::addUse
ShellEntity & addUse(const UseEntity &use)
Add the (lower-dimensional) use as a child of the shell.
Definition: ShellEntity.cxx:81
smtk::model::HAS_USE
@ HAS_USE
How this cell's shells are combined into a single orientation for use by bordant cells.
Definition: ArrangementKind.h:54
smtk::model::ShellEntity::uses
T uses() const
Return the uses (cells with an orientation, or sense) composing this shell.
Definition: ShellEntity.h:67
EntityRef.h
smtk::model::CellEntity
A entityref subclass with methods specific to cell entities.
Definition: CellEntity.h:30
smtk::model::INCLUDES
@ INCLUDES
How another cell is contained in the interior of this cell.
Definition: ArrangementKind.h:51
smtk::model::UseEntities
std::vector< smtk::model::UseEntity > UseEntities
Definition: PublicPointerDefs.h:213
smtk::model::UseEntity
A entityref subclass that provides methods specific to entity-use records.
Definition: UseEntity.h:53
smtk::model::ShellEntity
A entityref subclass with methods specific to shell entities.
Definition: ShellEntity.h:33
SMTK_ENTITYREF_CLASS
#define SMTK_ENTITYREF_CLASS(thisclass, superclass, typecheck)
A macro to implement mandatory EntityRef-subclass constructors.
Definition: EntityRef.h:43
smtk::model::EntityRefArrangementOps::appendAllRelations
static void appendAllRelations(const EntityRef &c, ArrangementKind k, T &result)
Append all the relations of kind k to result.
Definition: EntityRefArrangementOps.h:62
smtk::model::EntityRef
A lightweight entityref pointing to a model entity's resource.
Definition: EntityRef.h:112