cppCreAVertex
UseCase2
//****************************************************************************
//
// Date Created: November 20, 1995
//
//****************************************************************************
//
// Changes:
// Date Changed:
//
//****************************************************************************
//
// This propagation pattern will create a new Alternation Vertex. It takes in
// the Vertex Name, its Location and an Offset (distance from the vertex to
// where the vertex name is drawn). The propagation pattern stores these three
// parameters (Vertex Name, Location and Offset).
//
//****************************************************************************
(@
#include <iostream.h>
#include <strstream.h>
@)
*operation* void cppCreAVertex(char* Labelname,
char* Location,
char* Offset)
*wrapper* Graph
(@ AltVertex* tempAVert = new AltVertex();
DemString* tempLocation = new DemString(Location);
Coordinates* tempCoord = new Coordinates(tempLocation);
tempAVert->set_position(tempCoord);
DemIdent* tempLabel = new DemIdent(Labelname);
tempLocation = new DemString(Offset);
tempCoord = new Coordinates(tempLocation);
VertexName* tempName = new VertexName(tempLabel, tempCoord);
tempAVert->set_vertexname(tempName);
this->get_vertices()->append(tempAVert); @)