TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/graph/IVertex.cpp
Go to the documentation of this file.
00001 #include "IVertex.hpp"
00002 #include "GraphExporter.hpp"
00003 
00004 #include <tuttle/host/ImageEffectNode.hpp>
00005 
00006 namespace tuttle {
00007 namespace host {
00008 namespace graph {
00009 
00010 int IVertex::_count = 0;
00011 
00012 IVertex::IVertex( const std::string& name )
00013         : _name( name )
00014         , _processNode( NULL )
00015         , _fake( true )
00016         , _used( true )
00017         , _id( _count++ )
00018 {}
00019 
00020 IVertex::IVertex( const std::string& name, INode& processNode )
00021         : _name( name )
00022         , _processNode( &processNode )
00023         , _fake( false )
00024         , _used( true )
00025         , _id( _count++ )
00026 {}
00027 
00028 IVertex::IVertex( const IVertex& v )
00029 {
00030         IVertex::operator=( v );
00031         _id = _count++;
00032 }
00033 
00034 IVertex::~IVertex()
00035 {
00036 }
00037 
00038 
00039 std::ostream& IVertex::exportDotDebug( std::ostream& os ) const
00040 {
00041         std::ostringstream s;
00042         s << subDotEntry( "label", getName() );
00043         if( ! isFake() )
00044         {
00045                 /// @todo remove this. Temporary solution
00046                 s << subDotEntry( "bitdepth", static_cast<const ImageEffectNode&>( getProcessNode() ).getOutputClip().getBitDepthString() );
00047         }
00048         
00049         os << "[" << std::endl;
00050         os << dotEntry( "type", "Node" ) << ", " << std::endl;
00051         os << dotEntry( "label", s.str() ) << ", " << std::endl;
00052         os << "]" << std::endl;
00053         return os;
00054 }
00055 
00056 std::ostream& operator<<( std::ostream& os, const IVertex& v )
00057 {
00058         os << v.getName();
00059         return os;
00060 }
00061 
00062 
00063 }
00064 }
00065 }