Click or drag to resize

PrimitiveManagerAddNode Method

Add Node

Namespace:  VIZCore3D.NET.Manager
Assembly:  VIZCore3D.NET (in VIZCore3D.NET.dll) Version: 2.8.24.1104 (2.8.24.1104)
Syntax
C#
public PrimitiveObject AddNode(
	string nodeName,
	int colorIndex = 1
)

Parameters

nodeName
Type: SystemString
Node Name
colorIndex (Optional)
Type: SystemInt32
Color Index (rev2bst.config.rev)

Return Value

Type: PrimitiveObject
Added PrimitiveObject
Examples
C#
// VIZCore3D.NET Control
private VIZCore3D.NET.VIZCore3DControl vizcore3d;

private void Example()
{
    // Color Index : rev2bst.config.rev 파일 참고

    VIZCore3D.NET.Manager.PrimitiveObject root =
        vizcore3d.Primitive.AddNode("Root", 4 /* Yellow Color*/);

    VIZCore3D.NET.Manager.PrimitiveObject child1 =
        root.AddNode("CHILD1", 7 /* Blue Color */);

    {
        VIZCore3D.NET.Manager.PrimitiveBox box1 = 
            new VIZCore3D.NET.Manager.PrimitiveBox();

        box1.Set2Point(
            new float[] { 0, 0, 0 }
            , new float[] { 100, 100, 100 }
            , 50.0f
            );

        child1.AddPrimitive(box1);


        VIZCore3D.NET.Manager.PrimitiveBox box2 =
            new VIZCore3D.NET.Manager.PrimitiveBox();

        VIZCore3D.NET.Data.BoundBox3D boundBox1 =
            new VIZCore3D.NET.Data.BoundBox3D(
                new VIZCore3D.NET.Data.Vertex3D(
                    200, 200, 200
                    )
                , new VIZCore3D.NET.Data.Vertex3D(
                    300, 300, 300
                    )
                );

        box2.SetMinMaxPoints(boundBox1);

        child1.AddPrimitive(box2);
    }


    VIZCore3D.NET.Manager.PrimitiveObject child2 =
        root.AddNode("CHILD2", 11 /* Pink Color */);

    {
        VIZCore3D.NET.Manager.PrimitiveCylinder cylinder1 =
            new VIZCore3D.NET.Manager.PrimitiveCylinder();

        cylinder1.Set2Point(
            new float[] { 400, 400, 400 }
            , new float[] { 600, 600, 600 }
            , 50.0f
            );

        child2.AddPrimitive(cylinder1);
    }

    // Open Model
    vizcore3d.Primitive.OpenModel("Primitive", false);
}
See Also