Shapes Overview

As the base class for most shapes, the ccShape class offers a common interface to support high-level tools that operate on shapes. By accessing shape information through the ccShape base class, these tools are able to work automatically on any kind of shape, without requiring separate versions of a tool for each type of shape. Two immediate examples are synthetic PatMax training and synthetic rendering, both of which were previously available only for cc2Wireframe shapes. The ccShape base class now provides methods that allow these tools to be implemented generically for all shapes.

A common shape base class also provides support for shape hierarchies (also known as shape trees), which often contain arbitrary collections of shapes. Providing pointers to a base class facilitates the handling of these complex shape hierarchies. See Shape Hierarchies.

Finally, a common base class facilitates adding new shapes. Some CAD files contain shapes such as splines. Classes representing these shapes have been added to support the importing of CAD files into CVL (for example, ccBezierCurve and ccCubicSpline and its derived types). As they all inherit from the ccShape base class, these new shape types are able to incorporate all of the existing functionality for shapes that operate through the base class.

The table below shows the possible origins of shape information. Whatever the origin, shape information placed in a shape tree can be used with a number of CVL vision tools.

Possible origins and uses for shape information

Illustrated in sample file

Origin of shape information

 

Example uses for shape or shape tree

pmalign3.cpp

Drawn onscreen with ccUI* API

To create a mask for the Blob tool

pmalign4.cpp

Imported from DXF format CAD file

Use with the Edgelet Filtering tool

pmalign5.cpp

Drawn in code with shapes API

As a PatMax model (uses shape models)