Contours and Regions
Contours are shapes that are continuous paths in the plane. They may be drawn with a single stroke of a pen, without lifting the pen or retracing. Most primitive shapes are contours. Exceptions are classes such as ccPointSet and ccCross, as well as all of the annulus classes, each of which comprise two contours.
Contours are considered open if they possess well-defined start and end points, both of which must be points not located in the interior of the contour. Examples include line segments, elliptical arcs, and open polygons. There is an implied direction along an open contour from the start point to the end point. Open contours are important because they form the building blocks of ccContourTrees. This hierarchical shape describes a complex contour obtained by connecting the end point of one open contour to the start point of the next.
Contours that do not have start and end points are considered closed. Examples of closed contours are circles, rectangles, and closed polygons. Infinite contours, such as lines, do not have start and end points and are, therefore, also closed.
Regions are shapes that partition the plane into an inside and an outside. Points exactly on the curve are neither inside nor outside. The inside has a finite area and extent, and the outside is the complement of the inside. Neither set is required to be connected. Regions include all non-intersecting closed contours as well as the annulus classes.