SilverScreen Solid Modeler

POLYGON_NODE

POLYGON_NODE

Previous topic Next topic  

POLYGON_NODE

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

SilverSharp.POLYGON_NODE

 

Structure

A SilverSharp.POLYGON_NODE object stores information relevant to a SilverScreen polygon and polyline primitive

 

 

 

C# Code

 

 class POLYGON_NODE sealed : PRIM_NODE

    {

    POLYGON_NODE(POLYGON_NODE rhs);

    POLYGON_NODE(string polygon_path);

 

    readonly SURFACE_NODE sn;

    readonly TEXTURE_DATA texture;

    property SS_RGB       surface_rgb { get; }

    property uint         surface_pattern_number { get; }

 

    property PrimList  Children   { get; }

    property PRIM_NODE first_node { get; }

               

    property PrimList  Phantoms      { get; }

    property PRIM_NODE first_phantom { get; }

    };

 

 

 

Properties

The following read-only properties mimic the purpose of their counter-parts in the SilverC POLYGON_NODE:

 

Name

Description

sn

A SURFACE_NODE reference, that if not null, stores the surface properties for rendering this primitive. When this member is null, then the surface properties from the parent OBJECT_NODE will be used to render this primitive.

texture

A TEXTURE_DATA reference, that if not null, stores the texture properties for rendering this primitive. When this member is null, then the texture properties from the parent OBJECT_NODE will be used to render this primitive.

surface_rgb

The fill color for closed circles and ellipses

surface_pattern_number

The surface pattern index for closed circles and ellipses, or 0 if there is none.

first_node

The first primitive in the list of arc and line primitives that create the polygon boundary. SilverSharp programmers might prefer using the Children enumerator.

first_phantom

The first primitive in the list of round primitives that have been turned into facets to construct the polygon boundary. SilverSharp programmers might prefer using the Phantoms enumerator

 

The following read-only properties extend POLYGON_NODE for SilverSharp:

 

Name

Description

Children

Enumerates the list of arc and line primitives that create the polygon boundary.

Phantoms

Enumerates the list of round primitives that have been turned into facets to construct the polygon boundary. This happens, for instance, when a polygon containing fillets is swept.

 

 

Members

Member

Description

POLYGON_NODE

Constructors to initialize the object

 

 

Remarks

A polygon can be differentiated from a polyline by checking the SilverSharp.PRIM_NODE properties IsPolygon or IsPolyline. Also, the IsClosed property indicates a polygon.

 

A SilverSharp.POLYGON_NODE inherits from a SilverSharp.PRIM_NODE and therefore includes those properties and methods as well; for instance, Path, Type, and PrimBits are inherited properties of a SilverSharp.PRIM_NODE.

 

Note: A SilverSharp.POLYGON_NODE is a SilverSharp.PRIM_NODE, but the reverse is not true.

 

 

See Also

Primitive Types, SilverC POLYGON_NODE, PRIM_NODE

 

 

Example

The SilverSharp.POLYGON_NODE was extended to contain enumerators for child primitives and phantoms. It also inherits the Holes enumerator from SilverSharp.PRIM_NODE. The following example shows how to use the Children enumerator:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 POLYGON_NODE poly = SC.get_prim("polygon \\obj1.1") as POLYGON_NODE;

 

 if ( PRIM_NODE.IsEmpty(poly) )

    return;

 

 foreach ( PRIM_NODE prim in poly.Children )

    VisitOnePrimNode(prim)