System Startup

When you make the first call to any HOOPS routine, (either the first time on the application or since the last Reset_System), HOOPS performs a standard startup sequence. This "startup sequence" is where items such as the default colors, segments, and aliases get created. This chapter describes the operation in detail.

Startup Error Handler

When HOOPS first starts up, it has no default states or error handling. The first thing that happens is Define_Error_Handler is called with a special startup error handler. This special error handler forces all incoming "warning" and "error" severities to "fatal error." The error handler calls Report_Error to print the text, no matter what the severity was. Then forces program exit. This traps any errors whatsoever in the startup sequence.

"Crayola 73" Color Set

Next, the default color names are defined. These names, and the screen colors they are matched with, are derived from the standard "Crayola 64" box of crayons and 8 new colors added. In addition, cyan has been defined, so there are 73 colors.

The exact definitions for the colors used in HOOPS are listed in Table 3.1 below:

Name1st degree2nd degreeHIC Definition
apricot22, 0.83, 1.00
aquamarine166, 0.48, 1.00
bittersweet8, 0.41, 1.00
black166, 0.48, 1.00
aquamarinedimmer, dim, darker, dark, blackerdarkish, blackish0, 0, 0
bluebluerbluish240, 0.50, 1.00
blue green169, 0.35, 1.00
blue grey205, 0.41, 0.60
blue violet266, 0.13, 1.00
brick red4, 0.32, 1.00
brown, moose brownbrownerbrownish12, 0.63, 0.89
burnt orange27, 0.35, 1.00
burnt sienna12, 0.31, 0.84
cadet blue240, 0.44, 0.29
cerulean197, 0.20, 1.00
copper26, 0.26, 1.00
cornflower240, 0.71, 1.00
cyan180, 0.50, 1.00
dandelion43, 0.45, 1.00
forest green140, 0.18, 1.00
fuchsia325, 0.33, 1.00
goldgoldergoldish31, 0.34, 1.00
goldenrod24, 0.50, 1.00
greengreenergreenish120, 0.50, 1.00
green blue20, 0.40, 1.00
green yellow72, 0.50, 1.00
grey, graygreyer, grayergreyish, grayish24, 0.50, 0.00
indian red0, 0.25, 1.00
jungle green154, 0.33, 1.00
lavender330, 0.78, 1.00
lemon yellow45, 0.52, 1.00
magenta325, 0.50, 1.00
mahogany0, 0.27, 1.00
maize36, 0.50, 1.00
maroon331, 0.25, 1.00
melon12, 0.63, 0.89
midnight blue, midnite blue12, 0.63, 0.89
mulberry325, 0.38, 1.00
navy blue240, 0.24, 1.00
olive green60, 0.25, 1.00
orangeorangerorangish13, 0.50, 1.00
orange red7, 0.38, 1.00
orange yellow30, 0.50, 1.00
orchid317, 0.59, 0.88
peach21, 0.75, 1.00
periwinkle221, 0.84, 1.00
pine green160, 0.18, 1.00
pink, carnation pinkpinkerpinkish240, 0.44, 0.29
plum316, 0.27, 1.00
purple, violetpurplerpurplish334, 0.32, 1.00
raw sienna24, 0.29, 0.97
raw umber28, 0.16, 1.00
redredderreddish0, 0.50, 1.00
red orange7, 0.50, 1.00
red violet313, 0.31, 1.00
royal purple274, 0.20, 1.00
salmon17, 0.69, 1.00
sea green120, 0.58, 1.00
sepia17, 0.08, 1.00
silversilverish0, 0.72, 0.00
sky blue200, 0.72, 1.00
spring green84, 0.63, 1.00
strawberry, wild strawberry34, 0.40, 1.00
tan18, 0.35, 1.00
tangerine, vivid tangerine26, 0.50, 1.00
teal, teal blue154, 0.33, 1.00
thistle317, 0.43, 0.91
turquoise blue193, 0.32, 1.00
violet blue260, 0.08, 1.00
violet red334, 0.32, 1.00
whitebrighter, bright, lighter, light, whiterlightish, whitish0, 1.00, 0.00
yellowyelloweryellowish60, 0.50, 1.00
yellow green90, 0.50, 1.00
yellow orange19, 0.50, 1.00

Startup Segments

Initial Alias Definitions

Segment definitions are made for a number of standard aliases. The table below describes each segment created. The root segment is created by the first subsegment creation. The "?Include Library" and "?Style Library" segments are given dummy -1.0. +1.0 window attributes. This is done to prevent window-clearing changes from propagating up the tree, causing the root segment to repaint.

AliasDefinitionIntended Use
?Home/The root of the world. Starting place for all other segments.
?Include Library/include libraryA standard non-visible place to keep segments used for including.
?Style Library/style libraryA standard non-visible place to keep segments used as styles.
?Driver/driverA standard place for device drivers (i.e., segments with "driver" attributes).
?Null?Driver/nullA segment that just has the null driver attached.
?Picture?Driver/generic/ specific The segment with an attached driver. Used as the default display surface.
?Locater?Driver/generic/ specific The driver segment. Used for default location and selection input.
?Keyboard?Driver/generic/ specific The driver segment. Used for default button and string input.

Generic Device Drivers

There is one generic device driver for each supported device type (See your installation instructions for the list of those available on your system; "UIS", "X", and "Iris" are typical names). The drivers attached to supported devices wait and watch for any segment to be created within them. If such a segment appears, the driver calls Set_Driver on the new segment with a pointer to the real device driver for given device type. When you create segments within "?Driver/*", you automatically initialize physical devices.

The "?Picture" Segment and "HOOPS_PICTURE"

The "?Picture" device is created automatically during startup. The definition for "?Picture" is obtained by asking the operating system for the current definition of the environment variable or logical name "HOOPS_PICTURE", which is normally defined before you start your program. "?Driver" is concatenated with whatever "HOOPS_PICTURE" translates to, and the result ("?Driver/X11/unix:0.0", for example) is defined as "?Picture" and created.

If "HOOPS_LOCATER" and/or "HOOPS_KEYBOARD" are defined outside your program, then "?locater" and/or "?Keyboard" are defined in a similar way to "?Picture". If the separate environment variables are not defined, the "?locater" and "?Keyboard" aliases are set equal to "?Picture".

"?driver" has a special device driver. This driver's only function is to check that every segment appearing within "?driver" has a generic or specific driver attached to it. This guards against "?Picture", "?locater", or "?Keyboard" being given a value that doesn't correspond to any known device type.

Default Attributes

The root segment ("/") is given a value for every attribute HOOPS uses, as shown in the table below. This is done by calling the appropriate Set routines, one after another. HOOPS attribute settings in a segment are inherited by the sub-segments (unless the sub-segment has a different setting). Since the root segment is at the top of the tree, these HOOPS attribute settings have the effect of being default attributes for the whole world.

  • If the environment variable "HOOPS_APPLICATION" is set, the value is used for the "application" System Option.
  • If "HOOPS_SYSTEM_OPTIONS" is set, the entire value is passed to Define_System_Options.
  • If "HOOPS_DRIVER_OPTIONS" is set, the value overrides (is merged with) the default Driver Options on the root segment.
  • Similarly, if "HOOPS_HEURISTICS" is set, the value overrides the default heuristics set on the root segment.
  • If "HOOPS_RENDERING_OPTIONS" is set, the value overrides the default rendering options on the root segment.
  • If "HOOPS_COLORS" is set, the value overrides the default color on the root segment.
  • If "HOOPS_TEXT_FONT" is set, the value overrides the default text font on the root segment.
  • If "HOOPS_FONT_DIRECTORY" is set, the value overrides the default font directory on the root segment.
  • If "HOOPS_METAFLE_DIRECTORY" is set, the value overrides the default metafile directory on the root segment.
  • If "HOOPS_VISIBILITY" is set, the value overrides the default visibilities on the root segment.
  • If "HOOPS_PICTURE" is set and "HOOPS_PICTURE_OPTIONS" is set, the value is passed to QSet_Driver_Options on the "?picture" segment. This overrides the default from "HOOPS_DRIVER_OPTIONS".
  • Similarly, if "HOOPS_HARDCOPY" and "HOOPS_HARDCOPY_OPTIONS" are set, the value is passed to QSet_Driver_Options on the "?hardcopy" segment.
  • If "HOOPS_LICENSE" is set, the value overrides the default license on the root segment.
  • If your program overrides any of these environment values (for example, by calling the "getenv()" and "putenv()" routines available on some UNIX systems), the override should happen before the first HOOPS call in the program.
AttributeDefault Setting
Cameraposition = (0.0, 0.0, -5.0), target = (0.0, 0.0, 0.0), up vector = (0.0, 1.0, 0.0), width = 2.0, height = 2.0, projection = Perspective
Colorgeometry = window contrast = black, windows = face contrast = lighting = white, ambient = dark gray
Color_Mapnone (length zero)
Driverthe null driver
Driver_Optionsno backing store, border, color consolidation = 1.5625%, control area, no debug, no disable input, no double-buffering, no first color, no fixed colors, no force black-and-white, no gamma correction, landscape orientation, no light scaling, locater transform = (0,0,0,0,0,0), no number of colors, no output for mat, pen speed=1.0, no physical size, no selection proximity, no special events, no subscreen, subscreen moving, subscreen resizing, no subscreen stretching, no title, update interrupts, no use color map ID, no use window ID, no use window ID2, write mask = 0
Heuristicsbackplane cull, clipping, no concave polygons, hidden surfaces, incremental updates, no intersecting polygons, no memory purge, no partial erase, no polygon crossings, no polygon handedness, no quick moves, related selection limit = 5, transformations
Metafileno read, no write, no name, no directory, no follow cross-references, no overwrite, no state save, no use color names
Rendering_Optionslighting interpolation, color interpolation, color index interpolation, no attribute lock, hsr algorithm = hardware z-buffer, software frame buffer options = (no size limit, color depth = match device, no retention), face displacement = 8, quantization = ordered dither, no debug, no atmospheric attenuation
Selectabilityeverything= off, windows = v
Optionsfatal errors, errors, warnings, info, no continuous update, no C string length, application = <from OS>, no message limit, no debug, no event checker, update control, bounding volumes, no font directory, no code generation, no license
Text_Fontname=sans serif, size=0.03 sru, size tolerance=50%, no transforms, no rotation, no slant, no extra space
Text_Path1.0, 0.0, 0.0
Window-1.0, 1.0, -1.0, 1.0

Nonsegmented Mode

If the first routine called by the program --- the routine that initiated the whole startup sequence --- was a simple Set or Insert routine, then one more thing is done: the system is put into "non-segmented" mode. In other words, if you didn't start by opening a segment, but instead you just started drawing things, the system assumes you don't want to be bothered with knowing about segments at all.

"Non-segmented" mode consists of:

  1. Opening up "?Picture" (and leaving it open).
  2. Setting the "Streaming Mode" attribute to "on".
  3. Calling Update_Display once to make sure that the screen is properly initialized
  4. Locking "?Picture" open (via an internal flag) so that a stray Close_Segment in the application program won't accidentally close it.

The Finish

Once all of that is done, the regular error handler, Report_Error is defined and the special always-fatal handler is undefined. Control returns to the originally-called HOOPS Visualize routine and that routine proceeds as normal.

top_level:2 prog_guide:0 prog_guide/3DGS:0