SetDatatypeProperty

This function sets the value(s) of a certain datatypeTypeProperty in the context of an instance. The value of card gives the actual card of the value list. The list value of undefined (void) items is a list of booleans, chars, integers or doubles, this list has a length as givin in the value card. The actual used type is given by the definition of the dataTypeProperty.

Note: the client application needs to make sure the cardinality of the property is within the boundaries.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall SetDatatypeProperty(
            __int64        owlInstance,
            __int64        rdfProperty,
            void           * value,
            __int64        card
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t SetDatatypeProperty(
            int64_t        owlInstance,
            int64_t        rdfProperty,
            void           * value,
            int64_t        card
        );    

Property owlInstance

Size: 64 bit / 8 byte (value)
...

Property rdfProperty

Size: 64 bit / 8 byte (value)
...

Property value

Size: 64 bit / 8 byte (reference)
...

Property card

Size: 64 bit / 8 byte (value)
the cardinality of the array as given or returned

Example

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

__int64 rdfModel = CreateModel();

if (rdfModel) {
    __int64 classArc3D = GetClassByName(rdfModel, "Arc3D");

    __int64 propertyRadius = GetPropertyByName(rdfModel, "radius"),
            propertyStart = GetPropertyByName(rdfModel, "start"),
            propertySize = GetPropertyByName(rdfModel, "size"),
            propertySegmentationParts = GetPropertyByName(rdfModel, "segmentationParts");

    __int64 myInstanceArc3D = CreateInstance(classArc3D, nullptr);

    double  Pi = 2. * acos(0.),
            radius = 2.1,
            start = 0.,
            size = 2. * Pi;
    __int64 segmentationParts = 36;
        
    SetDatatypeProperty(myInstanceArc3D, propertyRadius, &radius, 1);
    SetDatatypeProperty(myInstanceArc3D, propertyStart, &start, 1);
    SetDatatypeProperty(myInstanceArc3D, propertySize, &size, 1);
    SetDatatypeProperty(myInstanceArc3D, propertySegmentationParts, &segmentationParts, 1);

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