// You may study, use, modify, and distribute this example for any purpose. // This example is provided WITHOUT WARRANTY either expressed or implied. // This shows the kind of graphic programming I did in the 1970's rewritten in C++ #include "ccc_win.h" using namespace std; /** Displays a stick figure of a man, or UML Actor. */ int ccc_win_main() { const double HEIGHT=4.0; const double WIDTH=HEIGHT*0.25; const double RADIUS=0.5*WIDTH;/* radius of the stick figure's head*/ const double CENTER=RADIUS; Point leftFoot(0.0,0.0); Point groin(leftFoot); groin.move(CENTER, WIDTH); Line leftleg(leftFoot, groin); cwin << leftleg; Point rightFoot(leftFoot); rightFoot.move(WIDTH,0.0); Line rightleg(groin, rightFoot); cwin << rightleg; double bodyheight=3.0*HEIGHT/4.0; Point neck(leftFoot); neck.move(CENTER,bodyheight); Line body (groin, neck); cwin << body; Point headCenter(neck); headCenter.move(0.0, RADIUS); Circle head (headCenter,RADIUS); cwin << head; const double armheight=0.6*HEIGHT; Point leftHand(leftFoot); leftHand.move(0.0, armheight); Point rightHand(rightFoot); rightHand.move(0.0, armheight); Line arms(leftHand, rightHand); cwin << arms; return 0; }//ccc_main