SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_graph_ResourceBase_h
12 #define smtk_graph_ResourceBase_h
14 #include "smtk/geometry/Manager.h"
15 #include "smtk/geometry/Resource.h"
17 #include "smtk/graph/ArcMap.h"
42 virtual const ArcMap& arcs()
const = 0;
43 virtual ArcMap& arcs() = 0;
46 virtual const std::set<smtk::string::Token>& nodeTypes()
const = 0;
49 virtual const std::set<smtk::string::Token>& arcTypes()
const = 0;
52 virtual bool isNodeTypeAcceptable(
const smtk::graph::ComponentPtr& node) = 0;
60 virtual bool addNode(
const smtk::graph::ComponentPtr& node)
62 if (this->isNodeTypeAcceptable(node))
64 return this->insertNode(node);
92 virtual bool disconnect(
Component* node,
bool explicitOnly =
false) = 0;
101 virtual void dump(
const std::string& filename,
const std::string& mimeType =
"text/vnd.graphviz")
114 virtual std::size_t eraseNodes(
const smtk::graph::ComponentPtr& node) = 0;
122 virtual bool insertNode(
const smtk::graph::ComponentPtr& node) = 0;
125 : Superclass(manager)
130 : Superclass(uid, manager)
134 ResourceBase(ResourceBase&&) noexcept = default;
142 #endif // smtk_graph_ResourceBase_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Graph Component represents a node in the graph resource.
Definition: Component.h:66
Derived resources are subclassed from smtk::resource::Resource.
Definition: DerivedFrom.h:32
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:128
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
std::string typeName()
Return the name of a class.
Definition: TypeName.h:289
A string token identified by an integer.
Definition: Token.h:29
virtual bool addNode(const smtk::graph::ComponentPtr &node)
Insert a node, checking that nodes of its type are allowed.
Definition: ResourceBase.h:60
A container for arcs held by a resource.
Definition: ArcMap.h:48
A non-templated base class for graph resources.
Definition: ResourceBase.h:35
smtk::shared_ptr< smtk::resource::Manager > ManagerPtr
Definition: PublicPointerDefs.h:288