SilverScreen Solid Modeler

CURVE_NODE

CURVE_NODE

Previous topic Next topic  

CURVE_NODE

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

SilverSharp.CURVE_NODE

 

Structure

A SilverSharp.CURVE_NODE object stores information relevant to a SilverScreen spline or Bezier curve primitive

 

 

 

C# Code

 

 class CURVE_NODE sealed : PRIM_NODE

    {

    CURVE_NODE(CURVE_NODE rhs);

    CURVE_NODE(string curve_path);

 

    readonly SURFACE_NODE sn;

    readonly TEXTURE_DATA texture;

    property SS_RGB       surface_rgb { get; }

    property uint         surface_pattern_number { get; }

    property SS_RGB       curve_rgb   { get; }

    property WidthStyle   curve_width_style      { get; }

 

    property PrimList  Points      { get; }

    property PRIM_NODE first_point { get; }

    };

 

 

 

Properties

The following read-only properties mimic the purpose of their counter-parts in the SilverC CURVE_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 spline and Bezier curves

surface_pattern_number

The surface pattern index for closed spline and Bezier curves, or 0 if there is none.

curve_width_style

The edge width and style index for rendering the curve.

curve_rgb

The edge color for rendering the curve.

first_point

The first primitive in the list of spline-point or Bezier-point primitives make up the control points of the curve. SilverSharp programmers might prefer using the Points enumerator

 

The following read-only properties extend CURVE_NODE for SilverSharp:

 

Name

Description

Points

Enumerates the list of spline-point or Bezier-point primitives that make up the control points of the curve.

 

 

Members

Member

Description

CURVE_NODE

Constructors to initialize the object

 

 

Remarks

A SilverSharp.CURVE_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.

 

A spline curve can be differentiated from a Bezier curve by checking the SilverSharp.PRIM_NODE properties IsSpline or IsBezier.

 

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

 

 

See Also

Primitive Types, PRIM_NODE, SilverC CURVE_NODE

 

 

Example

The SilverSharp.CURVE_NODE was extended to contain enumerators for control points. It also inherits the Holes enumerator from SilverSharp.PRIM_NODE. The following example shows how to use the Points  enumerator:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 CURVE_NODE curve = SC.get_prim("spline \\obj1.1") as CURVE_NODE;

 

 if ( PRIM_NODE.IsEmpty(curve) )

    return;

 

 foreach ( PRIM_NODE prim in curve.Points )

    VisitOnePrimNode(prim)