Shape The base class of all Shapes
All Lines, Rectangles, Circles, Ellipses, LineStrips, Polys and Points are different kind of Shapes. See the section Derived Classes, which lists all possible primitives you can create. An important thing to note is that OpenLayer deviates from most libraries in the way that there's no primitive rendering functions (anymore). Instead, there's primitive classes with member functions to render them. The idea is that, for example, a filled rectangle, an outline of a rectangle and a gradien filled rectangle can all use a common constructor because they all need to know the position and the size of the rectangle. Also this allows for more specialized constructors, for example rounded rectangles, while still allowing for the same drawing operations. The idea is even clearer with Circles as they have quite a lot of different ways to render them, for example you might only want to draw a slice of the circle, or maybe a disk... Note that many parameters are optional. Thus even if a function might seem complicated at first it's in fact simplier to use than it looks. The extra parameters are there just in case if you need them. Member functions
Derived Classes
Questions about Shape? Click here. |