Box

This class represents the concept Box.

Class

class GeometricItem
   relation material
      range Material, cardinality [0, 1]
class Solid
class Box
   property height
      range double (64 bit), cardinality [1, 1]
   property length
      range double (64 bit), cardinality [1, 1]
   property width
      range double (64 bit), cardinality [1, 1]    

Example (based on GEOM ontology wrapper)

Here you can find code snippits that show how the API call Box can be used.

using RDF;      //  include at least engine.cs and geom.cs within your solution

public void CreateBox()
{
    Int64 model = RDF.engine.CreateModel();

    if (model != 0)
    {
        GEOM.Box myBox = GEOM.Box.Create(model);

        myBox.set_length(2.8);
        myBox.set_width(1.3);
        myBox.set_height(1.4);

        //
        //  The resulting model can be viewed in 3D-Editor.exe
        //
        RDF.engine.SaveModel(model, "c:\\created\\myBox.bin");
        RDF.engine.CloseModel(model);
    }
}
    

Example (based on pure and inline API calls)

Here you can find code snippits that show how the API call Box can be used.

using RDF;      //  include at least engine.cs within your solution

public void CreateBox()
{
    Int64 model = RDF.engine.CreateModel();

    if (model != 0)
    {
        //
        //  Classes
        //
        Int64   classBox = RDF.engine.GetClassByName(model, "Box");

        //
        //  Datatype Properties (attributes)
        //
        Int64   propertyLength = RDF.engine.GetPropertyByName(model, "length"),
                propertyWidth = RDF.engine.GetPropertyByName(model, "width"),
                propertyHeight = RDF.engine.GetPropertyByName(model, "height");

        //
        //  Instances (creating)
        //
        Int64   myInstanceBox = RDF.engine.CreateInstance(classBox, (string) null);

        double  length = 2.8,
                width = 1.3,
                height = 1.4;

        RDF.engine.SetDatatypeProperty(myInstanceBox, propertyLength, ref length, 1);
        RDF.engine.SetDatatypeProperty(myInstanceBox, propertyWidth, ref width, 1);
        RDF.engine.SetDatatypeProperty(myInstanceBox, propertyHeight, ref height, 1);

        //
        //  The resulting model can be viewed in 3D-Editor.exe
        //
        RDF.engine.SaveModel(model, "c:\\created\\myBox.bin");
        RDF.engine.CloseModel(model);
    }
}
    

Example (based on pure API calls)

Here you can find code snippits that show how the API call Box can be used.

using RDF;      //  include at least engine.cs within your solution

public void CreateBox()
{
    Int64 model = RDF.engine.CreateModel();

    if (model != 0)
    {
        //
        //  Classes
        //
        Int64   classBox = RDF.engine.GetClassByName(model, "Box");

        //
        //  Datatype Properties (attributes)
        //
        Int64   propertyLength = RDF.engine.GetPropertyByName(model, "length"),
                propertyWidth = RDF.engine.GetPropertyByName(model, "width"),
                propertyHeight = RDF.engine.GetPropertyByName(model, "height");

        //
        //  Instances (creating)
        //
        Int64   myInstanceBox = RDF.engine.CreateInstance(classBox, (string) null);

        double  length = 2.8,
                width = 1.3,
                height = 1.4;

        RDF.engine.SetDatatypeProperty(myInstanceBox, propertyLength, ref length, 1);
        RDF.engine.SetDatatypeProperty(myInstanceBox, propertyWidth, ref width, 1);
        RDF.engine.SetDatatypeProperty(myInstanceBox, propertyHeight, ref height, 1);

        //
        //  The resulting model can be viewed in 3D-Editor.exe
        //
        RDF.engine.SaveModel(model, "c:\\created\\myBox.bin");
        RDF.engine.CloseModel(model);
    }
}