Options

From DocR21

Jump to: navigation, search

Options are global variables that may be used to modify the behavior of ACIS.

Many options are only for internal testing by Spatial and are not to be modified by users. If an option is not documented, its value should not be modified by users. Some internal use options are documented in reference templates that contain only a statement indicating that they should not be modified.

Contents

Availability

In general, options are valid in two contexts: Scheme and a C++ application. However, some options may not apply to all contexts. (For instance, some display options exist in the Scheme AIDE but not in the C++ interface to ACIS.) The options available to a particular application depend on the component libraries linked into the executable.

Definition

Options are defined in the ACIS code using the C++ class option_header. An option contains a name string, a default value, and a stack of values. (The top of the stack is the current value.) An application may inquire about an option's current value, modify an option's current value, push or pop a value onto or off the stack, or reset the option's value to its default value.

The name string is used to identify the option when setting its value, performing an inquiry on the option, or displaying its value. The name string is the same in both contexts (Scheme or C++). The name string for some options may be abbreviated when used to set the option. An option_header can be found using find_option.

States

For many options, the value simply indicates an on or off state. For other options, the value may be a number (either an integer or a floating point number) or character string.

The data type and representation of an option's value vary depending on the context. For example, an option that just has an on/off state is represented in Scheme with the Scheme data type boolean, with possible values #t for on or #f for off. And in C++, this same option is represented as a logical (which is defined in ACIS and is equivalent to an int) with the values TRUE for on or FALSE for off (the symbolic constants TRUE and FALSE are defined as equivalent to the integer constants 1 and 0, respectively).

The current state of an option can be queried by one of the following option_header methods, depending on the data type of the option value:

  • count — when the value is an int or logical
  • string — when the value is a char* (character string)
  • value — when the value is a double

Setting an Option

Three API functions are available for setting options in C++; the appropriate API function to use depends on the data type of the option value:

Alternatively, an option can be set by using one of the signatures of option_header::set; the appropriate signature to use depends on the data type of the option value.

An option is set in Scheme using the Scheme extension option:set.

See Also

For a complete list of options, refer to ACIS Options.

Personal tools
Live