SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_mesh_core_Resource_h
12 #define smtk_mesh_core_Resource_h
14 #include "smtk/CoreExports.h"
18 #include "smtk/common/FileLocation.h"
19 #include "smtk/common/UUID.h"
21 #include "smtk/mesh/core/CellSet.h"
22 #include "smtk/mesh/core/Component.h"
23 #include "smtk/mesh/core/Handle.h"
24 #include "smtk/mesh/core/Interface.h"
25 #include "smtk/mesh/core/MeshSet.h"
26 #include "smtk/mesh/core/PointConnectivity.h"
27 #include "smtk/mesh/core/QueryTypes.h"
28 #include "smtk/mesh/core/TypeSet.h"
31 #include "smtk/model/Model.h"
34 #include "smtk/geometry/Resource.h"
36 #include "smtk/resource/DerivedFrom.h"
83 static constexpr smtk::resource::Links::RoleType ClassificationRole = -3;
87 smtk::shared_ptr<smtk::resource::Resource> shared(
new Resource(resourceID));
88 return smtk::static_pointer_cast<Resource>(shared);
93 smtk::shared_ptr<smtk::resource::Resource> shared(
new Resource(interface));
94 return smtk::static_pointer_cast<Resource>(shared);
97 static smtk::shared_ptr<Resource> create(
101 smtk::shared_ptr<smtk::resource::Resource> shared(
new Resource(resourceID, interface));
102 return smtk::static_pointer_cast<Resource>(shared);
105 ~Resource()
override;
108 std::function<bool(
const resource::Component&)> queryOperation(
const std::string&)
const override;
111 void visit(resource::Component::Visitor& v)
const override;
114 bool isValid()
const;
122 bool isModified()
const;
131 void writeLocation(
const std::string& path)
140 void clearReadWriteLocations();
147 std::string interfaceName()
const;
152 std::size_t numberOfMeshes()
const;
168 void assignDefaultNames();
172 std::vector<std::string> meshNames()
const;
196 smtk::mesh::DimensionType dim)
const;
203 smtk::mesh::DimensionType dim)
const;
209 smtk::mesh::DimensionType dim)
const;
216 smtk::mesh::DimensionType dim)
const;
222 smtk::mesh::DimensionType dim)
const;
229 smtk::mesh::DimensionType dim)
const;
234 bool hasAssociations()
const;
243 bool isAssociatedToModel()
const;
269 std::vector<smtk::mesh::Domain> domains()
const;
281 std::vector<smtk::mesh::Dirichlet> dirichlets()
const;
295 std::vector<smtk::mesh::Neumann> neumanns()
const;
313 void readLocation(
const std::string& path)
331 int m_nameCounter{ -1 };
337 std::map<smtk::common::UUID, Component::Ptr> m_componentMap;
347 #endif // smtk_mesh_core_Resource_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Definition: Resource.cxx:29
CellType
Enum types used for querying the interface.
Definition: CellTypes.h:29
Derived resources are subclassed from smtk::resource::Resource.
Definition: DerivedFrom.h:32
Definition: PointSet.h:28
smtk::shared_ptr< smtk::mesh::Resource > ResourcePtr
Definition: PublicPointerDefs.h:363
Definition: Resource.h:55
Definition: FileLocation.h:36
static UUID null()
Generate a nil UUID.
Definition: UUID.cxx:78
Definition: QueryTypes.h:68
Definition: QueryTypes.h:50
Definition: PointConnectivity.h:30
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:128
smtk::weak_ptr< smtk::model::Resource > WeakResourcePtr
Definition: PublicPointerDefs.h:428
smtk::shared_ptr< smtk::model::Resource > ResourcePtr
Definition: PublicPointerDefs.h:426
#define smtkSharedPtrCreateMacro(...)
A convenience macro for declaring shared_from_this and create methods.
Definition: SharedFromThis.h:267
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
Definition: QueryTypes.h:59
static std::shared_ptr< Component > create(const smtk::mesh::ResourcePtr &, const smtk::common::UUID &)
Construct a mesh component corresponding to a meshset from the input resource and id.
Definition: Component.cxx:48
smtk::shared_ptr< smtk::mesh::Interface > InterfacePtr
Definition: PublicPointerDefs.h:369
Definition: EntityIterator.h:31
Macros for dealing with shared-pointer classes.
An abstract base class for SMTK resources and their components.
Definition: PersistentObject.h:39
smtk::shared_ptr< smtk::resource::Component > ComponentPtr
Definition: PublicPointerDefs.h:304
A lightweight entityref pointing to a model entity's resource.
Definition: EntityRef.h:112
An abstract base class for SMTK resources that provide geometry for themselves and/or their component...
Definition: Resource.h:33
Read an entire SMTK mesh resource from a file, or just sub-sections.
Definition: ReadMesh.h:30