// $Revision: 1.6 $ // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_GRAPHDRAWER #include "GraphDrawer.h" #endif #ifndef TaligentSamples_STANDARDGRAPH #include "StandardGraph.h" #endif #ifndef Taligent_ASSERTIONS #include #endif //============================================================================== // TGraphDrawer TaligentTypeExtensionMacro_Abstract(TGraphDrawer); TGraphDrawer::TGraphDrawer() : fTargetGraph(NIL) { } TGraphDrawer::TGraphDrawer(const TGraphDrawer& source) : fTargetGraph(source.fTargetGraph) { } TGraphDrawer::~TGraphDrawer() { // Nothing is being deleted because TGraphDrawer does not own // any pointers that need deleting. } TGraphDrawer& TGraphDrawer::operator=(const TGraphDrawer& source) { if (&source != this) { fTargetGraph = source.fTargetGraph; } return *this; } TStream& TGraphDrawer::operator>>=(TStream& toStream) const { ::WriteVersion(toStream, kOriginalVersion); ::Flatten(fTargetGraph, toStream); return toStream; } TStream& TGraphDrawer::operator<<=(TStream& fromStream) { ::ReadVersion(fromStream, kOriginalVersion, kOriginalVersion); TStandardGraph* theGraph; ::Resurrect(theGraph, fromStream); fTargetGraph = theGraph; return fromStream; } const TStandardGraph& TGraphDrawer::GetTargetGraph() const { ::Assertion(fTargetGraph != NIL, "Target graph can't be NIL here!"); return *fTargetGraph; } void TGraphDrawer::SetTargetGraph(const TStandardGraph* graph) { fTargetGraph = graph; } void TGraphDrawer::Prepare(const TStandardGraph& graph) { // default does nothing }