SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Typedefs | Enumerations | Functions
smtk::graph Namespace Reference

Subsystem for modeling using nodes connected to one another by arcs. More...

Classes

struct  ArcConstness
 For endpoint interfaces, provide tag classes used to select const or non-const APIs. More...
 
struct  ArcDirection
 For endpoint interfaces, provide tag classes used to select incoming or outgoing APIs. More...
 
class  ArcEndpointInterface
 An object that a node instance can present to access/edit its outgoing/incoming arcs. More...
 
class  ArcImplementation
 A wrapper around arc type-traits classes that provides API. More...
 
class  ArcImplementationBase
 A base class for all arc implementations. More...
 
class  ArcMap
 A container for arcs held by a resource. More...
 
class  ArcProperties
 Checks that can be performed on arc trait-types. More...
 
class  Component
 Graph Component represents a node in the graph resource. More...
 
class  ExplicitArcs
 A wrapper around arc type-traits classes that provides explicit storage of arcs. More...
 
class  NodeProperties
 Checks that can be performed on a node-type. More...
 
class  NodeSet
 
struct  OtherNodeVisitor
 A template for visiting nodes at either end of a given node and arc type. More...
 
struct  OtherNodeVisitor< NodeType, ArcType, smtk::graph::IncomingArc >
 
struct  OtherNodeVisitor< NodeType, ArcType, smtk::graph::OutgoingArc >
 
class  Registrar
 
class  Resource
 A resource for conceptual modeling of geometric components. More...
 
class  ResourceBase
 A non-templated base class for graph resources. More...
 
struct  RuntimeArc
 A base class for arc-types defined at runtime. More...
 
class  RuntimeArcEndpoint
 An object that can query and manipulate arcs at run-time. More...
 

Typedefs

typedef std::shared_ptr< ComponentComponentPtr
 
template<typename GraphTraits >
using ResourcePtr = std::shared_ptr< Resource< GraphTraits > >
 
using ConstArc = ArcConstness< true >
 
using NonConstArc = ArcConstness< false >
 
using OutgoingArc = ArcDirection< true >
 
using IncomingArc = ArcDirection< false >
 

Enumerations

enum  Directionality : bool { IsUndirected = false, IsDirected = true }
 An enumeration indicated whether an arc is directed or undirected. More...
 
enum  OwnershipSemantics { OwnershipSemantics::None, OwnershipSemantics::FromNodeOwnsToNode, OwnershipSemantics::ToNodeOwnsFromNode }
 Indicate whether one arc endpoint "owns" the other. More...
 

Functions

constexpr std::size_t unconstrained ()
 Return a constant used to indicate the maximimum degree of an arc endpoint is unconstrained.
 
template<typename T >
constexpr std::enable_if< std::is_integral< decltype(T::MaxOutDegree)>::value, std::size_t >::type maxOutDegree (std::size_t)
 Return the maximum out-degree of an arc type (or unconstrained() if unspecified).
 
template<typename T >
constexpr std::size_t maxOutDegree (...)
 
template<typename T >
constexpr std::enable_if< std::is_integral< decltype(T::MaxInDegree)>::value, std::size_t >::type maxInDegree (std::size_t)
 Return the maximum in-degree of an arc type (or unconstrained() if unspecified).
 
template<typename T >
constexpr std::size_t maxInDegree (...)
 
template<typename T >
constexpr std::enable_if< std::is_integral< decltype(T::MinOutDegree)>::value, std::size_t >::type minOutDegree (std::size_t)
 Return the minimum out-degree of an arc type (or 0 if unspecified).
 
template<typename T >
constexpr std::size_t minOutDegree (...)
 
template<typename T >
constexpr std::enable_if< std::is_integral< decltype(T::MinInDegree)>::value, std::size_t >::type minInDegree (std::size_t)
 Return the minimum in-degree of an arc type (or 0 if unspecified).
 
template<typename T >
constexpr std::size_t minInDegree (...)
 
Directionality directionalityEnumerant (smtk::string::Token directionalityToken)
 Return a directionality given a string token.
 
smtk::string::Token directionalityToken (Directionality directionalityEnumerant)
 Return a string token for a Directionality enumerant.
 
template<typename ArcType , typename SourceNode , typename Outgoing = typename std::conditional< std::is_same<typename ArcType::FromType, SourceNode>::value, smtk::graph::OutgoingArc, smtk::graph::IncomingArc>::type, typename TargetNode = typename std:: conditional<Outgoing::value, typename ArcType::ToType, typename ArcType::FromType>::type>
std::set< std::pair< TargetNode *, TargetNode * > > findArcCorrespondences (SourceNode *nodeA, SourceNode *nodeB, std::function< bool(TargetNode *, TargetNode *)> comparator)
 Find correspondences between destination nodes of two nodes along the given ArcType. More...
 
template<typename ArcType , typename SourceNode , typename Outgoing = std::conditional< std::is_same<typename ArcType::FromType, SourceNode>::value, smtk::graph::OutgoingArc, smtk::graph::IncomingArc>, typename TargetNode = std::conditional<Outgoing::value, typename ArcType::ToType, typename ArcType::FromType>>
std::set< std::pair< TargetNode *, TargetNode * > > findArcCorrespondences (const std::shared_ptr< SourceNode > &nodeA, const std::shared_ptr< SourceNode > &nodeB, std::function< bool(TargetNode *, TargetNode *)> comparator)
 A variant of findArcCorrespondences that takes shared pointers to nodes.
 

Detailed Description

Subsystem for modeling using nodes connected to one another by arcs.

Enumeration Type Documentation

◆ Directionality

An enumeration indicated whether an arc is directed or undirected.

Enumerator
IsUndirected 

Arcs are not directional (a – b == b – a), also called bidirectional.

IsDirected 

Arcs are directed (a → b != b → a), also called unidirectional.

◆ OwnershipSemantics

Indicate whether one arc endpoint "owns" the other.

Enumerator
None 

Neither endpoint owns its neighbor.

FromNodeOwnsToNode 

The "from" node owns the "to" node.

ToNodeOwnsFromNode 

The "to" node owns the "from" node.

Function Documentation

◆ findArcCorrespondences()

template<typename ArcType , typename SourceNode , typename Outgoing = typename std::conditional< std::is_same<typename ArcType::FromType, SourceNode>::value, smtk::graph::OutgoingArc, smtk::graph::IncomingArc>::type, typename TargetNode = typename std:: conditional<Outgoing::value, typename ArcType::ToType, typename ArcType::FromType>::type>
std::set<std::pair<TargetNode*, TargetNode*> > smtk::graph::findArcCorrespondences ( SourceNode *  nodeA,
SourceNode *  nodeB,
std::function< bool(TargetNode *, TargetNode *)>  comparator 
)

Find correspondences between destination nodes of two nodes along the given ArcType.

Given:

  • an ArcType arc-trait object,
  • two nodes (nodeA and nodeB), and
  • a lambda comparator that returns true if two destination nodes (nodeC and nodeD, connected to nodeA and nodeB, respectively) correspond to one another.

This function returns a set of pairs of nodes such that

  • if both nodes in a pair are non-null, the comparator returns true; and
  • if one node in a pair is null, there are no nodes nodeC and nodeD that correspond to one another attached to nodeA and nodeB, respectively.