Meta Tree Control

From Serious Sam Wiki
Jump to: navigation, search

Introduction

Meta tree control is the mechanism that is used by the editor to display data and to enable corresponding controls in panels of the property group.

Functional principle

Meta tree control uses an iterative process to create the data display and data controls of property group panels. The process is started by adding a root data to the list of data to display in the active property group panel. Meta tree control builds the corresponding tree of data entries and controls iteratively by

  1. Analyzing
    the meta data structure of the next item in the list of data to display,
  2. Adding
    to the property group panel an entry for that item with the appropriate control, and
  3. Inserting
    data to the list of data to display if the meta data structure has more than one member.

In most cases, the root data of this process is specified by

  • the selected entity in the viewport, and
  • the chosen property group panel.
Screenshot of Entity panel for StaticModel in Serious Editor 4.0

Examples

As an example, the screenshot on the right displays the properties of a StaticModel with all sorts of controls in the Entity panel. When a StaticModel is selected in the viewport and the Entity panel is activated, CStaticModelProperties is added as root data to the list of data to display. At this point meta tree control starts building the Entity panel display:

1. Root data

The meta data structure of CStaticModelProperies contains information about each and every property of a StaticModel which prompts meta tree control
  • to add the top entry of the list to the Entity panel (CStaticModelProperties),
  • to add an expansion item next to the data name because the meta data structure requires more data entries for this data, and
  • to add all necessary data identified in the meta data structure to the list of data to display (ie Model, Use outline model, etc).

2. Tree data:

Because it was added in the first step, the next item on the list of data to display is CModelConfiguration* which is a pointer to data of the type CModelConfiguration.
StaticModel Model Properties.png
The meta data structure of this data has 13 members (one for each data that is part of CModelConfiguration). It also tells meta tree control that CModelConfiguration is resource type data. Accordingly, meta tree control
  • adds an entry for CModelConfiguration* to the Entity panel,
  • adds an expansion item next to the data name because the meta data structure requires more data entries for this data,
  • adds a resource control to that entry, and
  • inserts 13 items to the list of data to display after CModelConfiguration*.

This process is iterated until the end of the list of data to display is reached by meta tree control. The data tree is completely displayed and all approriate controls are available.