PROGRAMMING GUIDE
A definition is the name for any of the resources that are stored in a portfolio. There are eight types of definitions:
Definition | Description |
---|---|
NamedStyleDefinition | A named group of attributes applied to a segment as opposed to setting attributes individually. See section 4.3.1. |
GlyphDefinition | A simple geometric symbol used for styling markers, vertices and lines. For an in-depth discussion on glyphs, see section 4.5. |
ImageDefinition | A two dimensional array of pixel data used as source for textures. See section 4.4 for an example on how to load an image into a portfolio. |
TextureDefinition | A description of how an image source will be applied to a given facetted surface. For more details on how to load and use textures, see section 5.3. |
LinePatternDefinition | A description of how a line is rendered using patterned lines, glyphs, and end caps. Line patterns are discussed in section 4.6. |
MaterialPaletteDefinition | A collection of materials that can be referenced by index. A palette can be used to apply materials to facetted geometry. Material palettes are discussed in section 5.1. |
CubeMapDefinition | A texture definition composed of six images that correspond to the faces of a cube. Typically used to render background scenery with the viewpoint at the center of the cube. See the example in section 5.3.4. |
ShaderDefinition | A set of instructions for altering the appearance of a pixel at render time. For more on shaders, see section 5.4. |
Most definitions are created by passing the corresponding kit to the portfolio where the definition will be contained. It is recommended that a descriptive name be used for the definition since all definitions are referred to by name. However, this is not a requirement and you can create nameless definitions by passing an empty string or null_ptr as the name.
After the resources are defined, they are accessible by any segment that is using the portfolio. Similarly, definitions can be undefined.
In addition to creating definitions, you can also import them from other portfolios. When importing, there are three layers of granularity. You can import all the definitions from a portfolio, all definitions for a specific category, or individual definitions. When you import definitions from another portfolio, use the portfolio key:
All of the Import functions have a second parameter which defaults to true. This flag controls whether the definitions that are being imported will replace the existing definitions.