Internal Structures

Direct Structure Access

Direct access to SilverScreen internal data structures is primarily through the use of the get_bos and get_prim built-in functions.  These functions return pointers to the structures described below. These structures are defined in the distribution header file ssnodes.h.

Entity Structures

BOS_NODE information common to all entity nodes
BLOCK_NODE block information
OBJECT_NODE object information
SYMBOL_NODE symbol information
TEXT_NODE text node for both stroke and TrueType text

Primitive Structures

PRIM_NODE information common to all primitive nodes
LINE_NODE line information
ROUND_NODE circle, ellipse, and arc information
POLYGON_NODE polygon information
POLYLINE_NODE polyline information
POINT_NODE point information
CURVE_NODE curve (Bezier and spline) information
SPOINT_NODE information for point of spline curve
BPOINT_NODE information for point of Bezier curve

Other Structures

FONT_NODE information about the font used in a TEXT_NODE
TAG_NODE Information about data that has been attached to a BOS_NODE
LIGHT_NODE light source information
SURFACE_NODE surface property information
MODEL_NODE information about a model that is attached to a SYMBOL_NODE
ATTRIBUTE_NODE attribute information
SCHEMA_NODE schema information that is attached to a BOS_NODE
TEXTURE_DATA texture information
SS_PATTERN pattern information

 

Entity Structures

BOS_NODE

BOS_NODE
   {
   int bits1;
   int bits2;
   SS_XYZ high;
   SS_XYZ low;
   SS_XYZ center;
   SS_XYZ top_axis;
   SS_XYZ bottom_axis;
   SS_XYZ local_horz;
   SS_XYZ local_vert;
   SS_XYZ local_base;
   NAME name;
   int force_style_color;
   RGB force_rgb;
   BOS_NODE *next_bos;
   BOS_NODE *prev_bos;
   BLOCK_NODE *parent;
   };
 

For bits1, the following are used:

E_BLOCK is a BLOCK_NODE .
E_OBJECT is a OBJECT_NODE .
E_SYMBOL is a SYMBOL_NODE .
E_TEXT is a TEXT_NODE .
E_DETAIL is a DETAIL_NODE .
HAS_HIGHLOW high-low extents are current.
HAS_CENTER center of rotation is set.
HAS_AXIS axis of rotation is set.
IS_FORCE_COLOR has force color applied.
IS_FORCE_LINESTYLE has force linestyle applied.
IS_FORCE_WIDTH has force width applied.
IS_VISIBLE is visible.

For bits2, the following are used:

IS_ANNOTATE is an annotation block (blocks only).
IS_SOLID is a valid solid. (objects only).
IS_NONSOLID is not a valid solid. (objects only).
IS_DELETED has been deleted.

Field descriptions:

bits1 see description above
bits2 see description above
high maximum extent values (if HAS_HIGHLOW)
low minimum extent values (if HAS_HIGHLOW)
center center of rotation (if HAS_CENTER)
top_axis top of the axis of rotation (if HAS_AXIS)
bottom_axis bottom of the axis of rotation (if HAS_AXIS)
local_horz horizontal displacement of e-space
local_vert vertical displacement of e-space
local_base base point of e-space
name nameof the entity
force_style_color force bits
force_rgb force RGB if color is forced
next_bos pointer to next BOS_NODE
prev_bos pointer to previous BOS_NODE
parent pointer to parent block

 

BLOCK_NODE

BLOCK_NODE
   {
   // Common BOS_NODE section omitted
   BOS_NODE *first_bos;
   SCHEMA_NODE *first_schema;
   TAG_NODE *first_tag;
   void *unused1;
   void *unused2;
   };
 

Field descriptions:

first_bos pointer to the first entity contained within the block. NULL if the block contains no entities.
first_schema pointer to the first schema associated with the block.
first_tag pointer to the first tag associated with the block.

 

OBJECT_NODE

OBJECT_NODE
   {
   // Common BOS_NODE section omitted
   SCHEMA_NODE *first_schema;
   void *unused1;
   void *unused2;
   void *unused3;
   PRIM_NODE *first_node;
   PRIM_NODE *last_node;
   int primitives;
   int high_id;
   EDGE edges;
   VERTEX vertices;
   double pattern_scale;
   int pattern_color;
   RGB pattern_rgb;
   SURFACE_NODE sn;
   };

Field descriptions:

first_schema pointer to the first schema associated with object
first_node pointer to the first primitive in object
last_node pointer to the last primitive in object
primitives bit field identifying types of primtives in object
high_id highest id number of any primitive in object
edges number of edges in object
vertices number of vertices in object
pattern_scale scale applied to patterns
pattern_color color used to display patterns
pattern_rgb RGB color value used to display patterns
sn structure of surface characteristics

 

SYMBOL_NODE

SYMBOL_NODE
   {
   // Common BOS_NODE section omitted
   MATRIX matrix;
   double pattern_scale;
   MODEL_NODE *model;
   SCHEMA_NODE *first_schema;
   TAG_NODE *first_tag;
   NAME model_name;
   FILE_NAME library_name;
   RGB pattern_rgb;
   RGB surface_rgb;
   int bits_surface;
   int pattern_color;
   int surface_pattern_color;
   };
 

Field descriptions:

matrix transformation matrix for the associated model
pattern_scale scale applied to patterns
model pointer to the model associated with the symbol
first_schema pointer to the first schema
first_tag pointer to the first tag associated with the block
model_name name of the model associated with the symbol
library_name name of the library which is associated with the symbol (drawing name if symbol is internal)
pattern_rgb RGB color value used to display patterns
surface_rgb surface color of the symbol if a surface color is forced
bits_surface information about forced surface colors
pattern_color color for pattern display
surface_pattern_color pattern number and surface color if forced

 

TEXT_NODE

TEXT_NODE
  {
   // Common BOS_NODE section omitted
   MATRIX matrix;
   SS_XYZ where;
   SS_XYZ xyz2;
   double height;
   double width_ratio;
   double spacing_ratio;
   double slant;
   double angle;
   double total_width;
   double total_height;
   char *text;
   FONT_NODE *font_ptr;
   int underscore;
   int overscore;
   int direction;
   int justification;
   RGB text_rgb;
   int text_width_style;
   int is_filled;
   };
 

Field descriptions:

matrix transformation matrix used to orient the text.
where start point for display of the text.
xyz2 dependent upon the text justification:

IS_RIGHT:It is the right point of the text
IS_CENTER: It is the center point of the text
IS_ALIGNED: It is the right point of the text

 
height height of the text.
width_ratio height/width ratio of the text.
spacing_ratio spacing ratio.
slant angle of slant applied to the text (degrees).
angle angle of rotation applied to the text.
total_width total width of the text.
total_height total height of the text.
text pointer to the string of text being displayed.
font_ptr pointer to the FONT_NODE that describes the font being used to display the text. (See below.)
underscore 0 for no underscore
1 for single underscore
2 for double underscore
overscore 0 no overscore
1 for single overscore
direction indicates the direction of text:

IS_HORIZONTAL: text is horizontal
IS_VERTICAL: text is vertical
IS_DIAGONAL: text is diagonal
IS_ALIGNED: text is aligned

justification tests to indicate justification of text:

IS_RIGHT: text is right justified
IS_LEFT: text is left justified
IS_CENTER: text is centered
IS_ALIGNED: text is aligned

text_rgb RGB for text
is_filled TRUE if TrueType font is filled

 

Primitive Structures

PRIM_NODE

PRIM_NODE
   {
   int bits;
   int id;
   PRIM_NODE *next_node;
   PRIM_NODE *prev_node;
   OBJECT_NODE *parent;
   };
 

Settings for the bits field:

P_LINE is a line node
P_POLYGON is a polygon node
P_POLYLINE is a polyline node
P_SPLINE is a spline node
P_ROUND is a round node
P_BEZIER is a bezier node
P_SPOINT is a spline control point node
P_BPOINT is a bezier control point node
P_POINT is a point node
P_ARC is an arc (only for round node)
P_CIRCLE is a cirlipse (only for round node)
IS_PHANTOM is a phantom (only for round node)
IS_CLOSED is a closed (only for curve node)
IS_HOLE is a hole (only for cirlipses, polygons and closed curves)
IS_REVERSED node normal is to be reversed in direction from computed setting (polygons only)
IS_SINGLE Bezier curve only: Bezier curve is drawn with single degree of control
IS_DELETED has been deleted

Field descriptions:

bits see description above
id a number which uniquely identifies a primitive within its parent object
next_node pointer to the next primitive.
prev_node pointer to the previous primitive.
parent pointer to the object containing the primitive. (Not used for polygon and polyline nodes.)

 

LINE_NODE

LINE_NODE
   {
   // Common PRIM_NODE section omitted
   EDGE edge;
   };
 

Field descriptions:

edge edge number of the line.

 

ROUND_NODE

ROUND_NODE
   {
   // Common PRIM_NODE section omitted
   PRIM_NODE *first_hole;
   SS_XYZ horizontal;
   SS_XYZ vertical;
   double start_angle;
   double stop_angle;
   SURFACE_NODE *sn;
   RGB surface_rgb;
   RGB round_rgb;
   int unused2;
   int unused3;
   VERTEX center;
   int unused4;
   TEXTURE_DATA *texture;
   };
 

Field descriptions:

first_hole pointer to first hole (applicable only to cirlipses)
horizontal displacement from the center indicating the horizontal direction of the cirlipse or arc
vertical displacement from the center indicating the vertical direction of the cirlipse or arc
start_angle start angle in radians (applicable only to arcs)
stop_angle stop angle in radians (applicable only to arcs)
sn pointer to surface information (possibly NULL)
surface_rgb surface color (applicable only to cirlipses)
round_rgb edge color
center vertex number of the center point
texture pointer to texture data (possibly NULL)

 

POLYGON_NODE

POLYGON_NODE
   {
   // Common PRIM_NODE section omitted
   PRIM_NODE *first_hole;
   SURFACE_NODE *sn;
   RGB surface_rgb;
   int unused;
   PRIM_NODE *first_node;
   PRIM_NODE *first_phantom;
   TEXTURE_DATA *texture;
   };
 

Field descriptions:

first_hole pointer to first hole
sn pointer to surface information (possibly NULL)
surface_rgb surface color
first_node pointer to first node in polygon
first_phantom pointer to first phantom the polygon
texture pointer to texture data (possibly NULL)

 

POLYLINE_NODE

POLYLINE_NODE
   {
   // Common PRIM_NODE section omitted
   void *unused1;
   void *unused2;
   int unused3;
   int unused4;
   PRIM_NODE *first_node;
   void *unused5;
   void *unused6;
   };
 

Field descriptions:

first_node pointer to first node in polyline

 

POINT_NODE

POINT_NODE
   {
   // Common PRIM_NODE section omitted
   VERTEX point;
   int type;
   int unused2;
   double size;
   RGB line_rgb;
   };
 

Field descriptions:

point vertex number
type possible values:

0: common point
1: XY-point
2: YZ-point
3: ZX-point
4: triad point

size width of the point (if not type 0).
line_rgb color of the point and the lines.

 

CURVE_NODE

CURVE_NODE
   {
   // Common PRIM_NODE section omitted
   PRIM_NODE *first_hole;
   SURFACE_NODE *sn;
   RGB surface_rgb;
   int unused4;
   int unused3;
   RGB line_rgb;
   PRIM_NODE *first_point;
   TEXTURE_DATA *texture;
   };
 

Field descriptions:

first_hole pointer to first hole (only if closed)
sn pointer to surface information (possibly NULL)
surface_rgb surface color (only if closed)
line_rgb line color
first_point pointer to first node in curve
texture pointer to texture data (possibly NULL)

 

SPOINT_NODE

SPOINT_NODE
   {
   // Common PRIM_NODE section omitted
   VERTEX point;
   int knots;
   };
 

Field descriptions:

point vertex number of control point.
knots number of knots at point (0, 1 or 2).

 

BPOINT_NODE

BPOINT_NODE
  
{
   // Common PRIM_NODE section omitted
   VERTEX point;
   SS_XYZ forward;
   SS_XYZ backward;
   };
 

Field descriptions:

point vertex number of control point.
forward displacement for forward slope vector.
backward displacement for backward slope vector.

 

Other Structures

FONT_NODE

FONT_NODE
  
{
   int font_type;
   FILE_NAME font_name;
   USINT style;
   FILE_NAME screen_font_name;
   USINT screen_style;
   int space_out;
   BOS_NODE **the_chars;
   int first_char;
   int last_char;
   int default_char;
   double unused;
   FONT_NODE *next_font;
   };
 

Field descriptions:

font_name name of font
style style of font
screen_font_name alternate screen font
screen_style alternate screen style
space_out TRUE for monospaced fonts
the_chars an array of BOS_NODE pointers to represent characters
first_char index of first character in array
last_char index of last character in array
default_char index of default character in array
next_font pointer to next FONT_NODE

 

TAG_NODE

TAG_NODE
   {
   int type;
   NAME name;
   union
      {
      double tag_double;
      XYZ tag_xyz;
      char *tag_text;
      } data;
   TAG_NODE *next_tag;
   };
 

Field descriptions:

type indicates data type contained in data
name tag_double: value if type is DOUBLE_TAG
tag_xyz: value if type is XYZ_TAG
tag_text: value if type is TEXT_TAG
next_tag pointer to next TAG_NODE

 

LIGHT_NODE

LIGHT_NODE
   {
   int type;
   int enabled;
   NAME light_name;
   char *light_shader;
   XYZ location;
   XYZ direction;
   double exponent;
   double constant_attenuation;
   double linear_attenuation;
   double quadratic_attenuation;
   double cone_angle;
   RGB light_rgb;
   LIGHT_NODE *next_light;
   };
 

Field descriptions:

type type of light source
enabled TRUE if light is enabled
light_name name of light source
light_shader  
location location of light source
direction vector indicating direction of light
exponent exponent for light decrease with distance
constant_attenuation three attenuation parameters
linear_attenuation  
quadratic_attenuation  
cone_angle cone angle for cone light sources
light_rgb color of light source
next_light pointer to next LIGHT_NODE

 

SURFACE_NODE

typedef struct
   {
   int bits;
   int ambient_diffusion;
   int diffusion;
   int spectral_intensity;
   int spectral_power;
   double opacity;
   RGB spectral_color;
   } SURFACE_NODE;
 

Field descriptions:

bits (bits & CASTS_A_SHADOW ): surface casts a shadow
ambient_diffusion percentage of ambient light reflected by surface
diffusion percentage of non-ambient light reflected by surface
spectral_intensity percentage of spectral reflectance exhibited by surface
spectral_power crispness of spectral reflection (range 1 - 200)
opacity percentage of opacity of this surface (red, green, and blue components may be extracted with RED_COLOR, GREEN_COLOR, and BLUE_COLOR macros)
spectral_color color of specular reflection

 

MODEL_NODE

MODEL_NODE
  
{
   int unused;
   NAME name;
   SS_XYZ high;
   SS_XYZ low;
   FILE_NAME library_name[12];
   BLOCK_NODE *root;
   MODEL_NODE *next_model;
   int high_low_set;
   };
 

Field descriptions:

name name of the model
high maximum values of the model in model space
low minimum values of the model in model space
library_name name of the library containing the model
root block containing the geometry for the model
next_model pointer to the next model of the drawing
high_low_set TRUE if the extents for the model are set

 

ATTRIBUTE_NODE

ATTRIBUTE_NODE
  
{
   int bits;
   int precision;
   double the_double;
   NAME name;
   char *value;
   ATTRIBUTE_NODE *next_attribute;
   };
 

Field descriptions:

bits (bits & 0x0001): string value
(bits & 0x0002): numeric value
precision display precision for attribute
numeric_value value if numeric
name name of attribute
string_value value if string
next_attribute pointer to next attribute

 

SCHEMA_NODE

SCHEMA_NODE
   {
   NAME name;
   char *description;
   ATTRIBUTE_NODE *first_attribute;
   SCHEMA_NODE *next_schema;
   };
 

Field descriptions:

name schema name
description schema description
first_attribute pointer to first attribute within schema
next_schema pointer to next schema

 

TEXTURE_DATA

typedef struct
   {
   int Flags;
   double Width;
   double Height;
   double Rotation;
   } TEXTURE_DATA;
 

Field descriptions:

Flags properties of textures
Width width (in inches) of texture map
Height height (in inches) of texture map
Rotation angle of rotation of texture map

 

SS_PATTERN

typedef struct
  
{
   double height;
   double width;
   int units;
   int fill;
   } SS_PATTERN;
 

Field descriptions:

height height of pattern
width width of pattern
units units of height and width
fill not used