cppDrawEdges
UseCase3
// COM1205 Propagation Pattern for DemDraw Project.
//
// TO DO: Comment the new pps created to take adv. of ds shy prog.
//
//
// Modification History:
//
// 11/29/95
// Minor modification to use GetVName() to retreive the name of
// the from and to verticies. Keeps with the Data-Structure
// Shy Programming started by Carlos.
//
// 11/27/95 Carlos Santiago (carlos@ccs.neu.edu)
// Modified to take advantage of Data-Structured Shy Programming
//
// 11/21/95 Carlos Santiago (carlos@ccs.neu.edu)
// Modified to take advantage of the fact that coordinates are now stored
// as strings.
//
// Created by Tom Kneeland (tomk@ccs.neu.edu)
//
// This propagation patter will traverse all the edges stored in a Graph
// object, collect all Position and Name data, and call either
// tclCEdge, or tclAEdge to draw a Construction Edge, or Alternation Edge
// appropriately.
(@
#include <iostream.h>
#include <strstream.h>
//#include "tclexec.h"
@)
*operation* void cppDrawEdges()
*traverse*
*from* Graph
*through* -> *,edges,*
*to* {AltEdge, ConstEdge }
*wrapper* AltEdge
*suffix*
(@
ostrstream str;
str << "tclAEdge " ;
str << this->get_from()->GetVName() << " ";
str << this->get_to()->GetVName() << " ";
if (this->get_middlepoints() != NULL)
{
char tempchar[300];
strcpy(tempchar,*this->cppGetMiddlePoints()) ;
str << tempchar;
}
cout << "+++ tcl call " << str.str() << endl;
//tclexec << str.str();
@)
*wrapper* ConstEdge
*suffix*
(@
ostrstream str;
char tempchar[300];
str << "tclCEdge " ;
str << this->GetCEName() << " ";
str << this->get_from()->GetVName() << " ";
str << this->get_to()->GetVName() << " ";
strcpy( tempchar, *this->cppGetEdgeLabelCoordinates());
str << tempchar << " ";
if (this->get_middlepoints() != NULL)
{
strcpy(tempchar,*this->cppGetMiddlePoints()) ;
str << tempchar;
}
cout << "+++ tcl call " << str.str() << endl;
//tclexec << str.str();
@)