The Shapes sample library defines some data types expressed in the Xc++ language which can be used to represent shapes.
namespace shapes
{
$model+ TPoint
{
float32 X;
float32 Y;
};
$model+ TPolygon
{
xvector<TPoint> V;
};
$model+ TCircle
{
float32 Radius;
};
$model+ TRectangle
{
float32 Width;
float32 Height;
};
$variant+ TShape
{
default TCircle(200);
TCircle Circle;
TRectangle Rectangle;
TPolygon Polygon;
};
}
Note that TShape is a $variant
Shapes ├── src │ ├── Shapes.cpp │ └── Shapes.xcpj └── Shapes.h