Transformation

This class represents the concept Transformation.

Class

class GeometricItem
   relation material
      range Material, cardinality [0, 1]
class Transformation
   relation matrix
      range Matrix, cardinality [0, 1]
   relation object
      range GeometricItem, cardinality [0, 1]
   property recalculateBBox
      range bool, cardinality [0, 1]    

Example (based on pure API calls)

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

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

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

    if (model != 0)
    {
        //
        //  Classes
        //
        Int64   classCylinder = RDF.engine.GetClassByName(model, "Cylinder"),
                classMatrix = RDF.engine.GetClassByName(model, "Matrix"),
                classTransformation = RDF.engine.GetClassByName(model, "Transformation");

        //
        //  Object Properties (relations)
        //
        Int64   propertyMatrix = RDF.engine.GetPropertyByName(model, "matrix"),
                propertyObject = RDF.engine.GetPropertyByName(model, "object");

        //
        //  Datatype Properties (attributes)
        //
        Int64   property_41 = RDF.engine.GetPropertyByName(model, "_41"),
                property_42 = RDF.engine.GetPropertyByName(model, "_42"),
                property_43 = RDF.engine.GetPropertyByName(model, "_43"),
                propertyLength = RDF.engine.GetPropertyByName(model, "length"),
                propertyRadius = RDF.engine.GetPropertyByName(model, "radius"),
                propertySegmentationParts = RDF.engine.GetPropertyByName(model, "segmentationParts");

        //
        //  Instances (creating)
        //
        Int64   myInstanceCylinder = RDF.engine.CreateInstance(classCylinder, (string) null),
                myInstanceMatrix = RDF.engine.CreateInstance(classMatrix, (string) null),
                myInstanceTransformation = RDF.engine.CreateInstance(classTransformation, (string) null);

        RDF.engine.SetObjectProperty(myInstanceTransformation, propertyObject, ref myInstanceCylinder, 1);
        RDF.engine.SetObjectProperty(myInstanceTransformation, propertyMatrix, ref myInstanceMatrix, 1);

        double  length = 2.8,
                radius = 1.3;
        Int64   segmentationParts = 36;

        RDF.engine.SetDatatypeProperty(myInstanceCylinder, propertyLength, ref length, 1);
        RDF.engine.SetDatatypeProperty(myInstanceCylinder, propertyRadius, ref radius, 1);
        RDF.engine.SetDatatypeProperty(myInstanceCylinder, propertySegmentationParts, ref segmentationParts, 1);

        double  offsetX = 3.3,
                offsetY = -1.2,
                offsetZ = 0.5;
        RDF.engine.SetDatatypeProperty(myInstanceMatrix, property_41, ref offsetX, 1);
        RDF.engine.SetDatatypeProperty(myInstanceMatrix, property_42, ref offsetY, 1);
        RDF.engine.SetDatatypeProperty(myInstanceMatrix, property_43, ref offsetZ, 1);

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