SilverScreen Solid Modeler

MAKE_WIDTH_STYLE

MAKE_WIDTH_STYLE

Previous topic Next topic  

MAKE_WIDTH_STYLE

Previous topic Next topic JavaScript is required for the print function  

 

SilverScreenAPI

 

USINT MAKE_WIDTH_STYLE ( int width, int style )

 

int width;         // An integer value indicating line width

int style_index;   // An integer value indicating line style

 

 




Synopsis

#include "silver.h"

 

The MAKE_WIDTH_STYLE macro combines an edge-width and style-index into an unsigned integer value formatted appropriately for SilverScreen drawings.

 

 

Parameters

width is an integer value between 1 and 9, where 1 indicates a normal line and 9 indicates a line of maximum width.

 

style is an integer value between 0 and 255, where the value indicates an index into the linestyle table associated with the current drawing. A linestyle of 0 is reserved for solid lines, and a value of 255 is reserved for invisible lines.

 

 

Return Value

MAKE_WIDTH_STYLE returns an unsigned integer value that stores line width and style information appropriately formatted for SilverScreen drawings.

 

 

Remarks

Here are some pre-defined line width constants from ssnodes.h

 

Constant

Value

Meaning

NORMAL_LINE_WIDTH

1

Indicates a line that is a single pixel wide

WIDE_LINE_WIDTH

3

Indicates a line with a medium width

MAX_LINE_WIDTH

9

Indicates a line that is maximum width

 

Here are some pre-defined linestyle constants

 

Constant

Value

Meaning

SOLID_LINE_STYLE

0

A line with this style will be unbroken

INVISIBLE_LINE_STYLE

255

A line with this style will not appear on the screen

 

See Also

LINE_WIDTH, LINE_STYLE

 

 

Example

The following example formats a width and style for use with a SilverScreen drawing, then extracts the width and style components.

 

C / C++ Code

 

 #include "silver.h"

 #include "ssnodes.h"

 

 USINT round_ws    = MAKE_WIDTH_STYLE(NORMAL_LINE_WIDTH, SOLID_LINE_STYLE);

 

 int   round_width = LINE_WIDTH(round_ws);

 int   round_style = LINE_STYLE(round_ws);