#include "Behaviors/StateMachine.h"
$nodeclass DrawShapes : VisualRoutinesStateNode{
	$nodeclass FindLine : MapBuilderNode($,MapBuilderRequest::worldMap) : doStart {
		mapreq.addAllObjectColors(lineDataType);
	}
	$nodeclass EndPoints : StateNode : doStart{
		NEW_SHAPEVEC(lines, LineData, select_type<LineData>(worldShS));
		if(lines.size() > 0)
		{
			NEW_SHAPE(ellipse1, EllipseData, new EllipseData(worldShS, lines[0]->end1Pt()));
			NEW_SHAPE(ellipse2, EllipseData, new EllipseData(worldShS, lines[0]->end2Pt()));
			VRmixin::drawShapes.push_back(ellipse1);
			VRmixin::drawShapes.push_back(ellipse2);
		}
 		else
			cout << "No line found" << endl;
	}
	 $setupmachine{
		FindLine=C=>EndPoints
        }
}
REGISTER_BEHAVIOR(DrawShapes);
