SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_markup_Resource_h
12 #define smtk_markup_Resource_h
14 #include "smtk/graph/Resource.h"
15 #include "smtk/markup/Domain.h"
16 #include "smtk/markup/DomainFactory.h"
17 #include "smtk/markup/DomainMap.h"
19 #include "smtk/resource/DerivedFrom.h"
20 #include "smtk/resource/Manager.h"
22 #include "smtk/markup/Exports.h"
24 #include "nlohmann/json.hpp"
62 bool setLocation(
const std::string& location)
override;
65 template<
typename componentT,
typename... Args>
66 smtk::shared_ptr<componentT> createNode(Args&&... args)
68 return GraphResource::create<componentT>(std::forward<Args>(args)...);
73 const std::string& query)
const override;
79 const DomainMap& domains()
const {
return m_domains; }
91 Resource(smtk::resource::Manager::Ptr manager =
nullptr);
95 template<
typename Modifier>
96 bool modifyComponent(
Component& component,
const Modifier& modifier);
102 template<
typename Modifier>
103 bool Resource::modifyComponent(Component& component,
const Modifier& modifier)
105 auto& nodesById = NodeContainer::m_nodes.
get<detail::IdTag>();
106 auto it = nodesById.find(component.id());
107 if (it != nodesById.end())
109 NodeContainer::m_nodes.modify(it, modifier);
120 #include "smtk/markup/arcs/ReferencesToPrimaries.txx"
122 #endif // smtk_markup_Resource_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Derived resources are subclassed from smtk::resource::Resource.
Definition: DerivedFrom.h:32
Definition: Component.h:51
A resource for annotating geometric models.
Definition: Resource.h:49
#define smtkCreateMacro(...)
Add static create() methods to a class.
Definition: SharedFromThis.h:173
static DomainFactory & domainFactory()
Return the factory used to construct markup domains.
Definition: Resource.h:85
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:128
A Factory is a class that constructs instances of registered classes which all inherit a common BaseT...
Definition: Factory.h:112
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
DomainMap & domains()
Return the resource's catalog of domains.
Definition: Resource.h:78
Component is the base class for records stored in an smtk::resource::Resource.
Definition: Component.h:43
An abstract base class for SMTK resources and their components.
Definition: PersistentObject.h:39
A resource for conceptual modeling of geometric components.
Definition: PublicPointerDefs.h:59
Interface< TagType, true > get() const
Access a convenience Interface for creating objects that singles out one of the three modes of creati...
Definition: Factory.h:420
Container for all the namespaces a resource presents for components to share.
Definition: DomainMap.h:32