9 #include "fwData/config.hpp" 10 #include "fwData/Edge.hpp" 11 #include "fwData/factory/new.hpp" 12 #include "fwData/Node.hpp" 13 #include "fwData/Object.hpp" 18 fwCampAutoDeclareDataMacro((
fwData)(Graph), FWDATA_API);
37 FWDATA_API
static const bool UP_STREAM;
38 FWDATA_API
static const bool DOWN_STREAM;
40 typedef std::map< Edge::sptr, std::pair< Node::sptr, Node::sptr > > ConnectionContainer;
41 typedef std::set< Node::sptr > NodeContainer;
60 FWDATA_API
virtual ~
Graph();
67 FWDATA_API
bool addNode( Node::sptr _node);
74 FWDATA_API
bool removeNode( Node::csptr _node);
80 FWDATA_API NodeContainer& getNodes();
81 FWDATA_API
const NodeContainer& getNodes()
const;
91 FWDATA_API
const ConnectionContainer& getConnections()
const;
92 FWDATA_API ConnectionContainer& getConnections();
102 FWDATA_API
bool addEdge(Edge::sptr _edge, Node::csptr _nodeSource, Node::csptr _nodeDestination);
110 Edge::sptr makeConnection( Node::csptr _nodeSource,
111 std::string _nodeSourceOutputPortID,
112 Node::csptr _nodeDestination,
113 std::string _nodeDestinationInputPortID,
114 std::string _EdgeNature
123 FWDATA_API
bool removeEdge(Edge::sptr _edge);
130 FWDATA_API Node::sptr getSourceNode(Edge::sptr _edge);
137 FWDATA_API Node::sptr getDestinationNode(Edge::sptr _edge);
147 FWDATA_API Node::sptr getNode(Edge::sptr _edge,
bool _upStream);
155 FWDATA_API std::vector< Edge::sptr > getInputEdges(Node::csptr _node);
163 FWDATA_API std::vector< Edge::sptr > getOutputEdges(Node::csptr _node);
175 FWDATA_API std::vector< Edge::sptr > getEdges(
const Node::csptr& _node,
bool _upStream,
176 const std::string& _nature =
"",
177 const std::string& _portID =
"");
189 FWDATA_API std::vector< ::fwData::Node::sptr > getNodes( const ::fwData::Node::csptr& node,
bool upStream,
190 const std::string& nature =
"",
191 const std::string& portID =
"" );
196 FWDATA_API
size_t getNbNodes()
const;
201 FWDATA_API
size_t getNbEdges()
const;
203 FWDATA_API
void shallowCopy(
const Object::csptr& _source )
override;
205 FWDATA_API
void cachedDeepCopy(
const Object::csptr& _source, DeepCopyCacheType& cache)
override;
212 FWDATA_API
bool haveConnectedEdges(Node::csptr _node )
const;
219 NodeContainer m_nodes;
220 ConnectionContainer m_connections;
This class defines a graph object.
std::vector< ::fwData::Object::sptr > UpdatedDataType
Type of signal m_sigUpdated.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
::fwCom::Signal< void(UpdatedDataType, UpdatedDataType) > UpdatedSignalType
Update signal type Signal updated is composed of two parameters which represent added and removed ele...
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_UPDATED_SIG
Updated signal key.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
UpdatedSignalType::sptr m_sigUpdated
Updated signal.
Contains the representation of the data objects used in the framework.