GetClassByName

Returns a handle to the class as stored inside. When the class does not exist yet and the name is unique the class will be created on the fly and the handle will be returned. When the name is not unique and given to an instance, objectTypeProperty or dataTypeProperty 0 will be returned.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall GetClassByName(
            __int64        model,
            const char      * owlClassName
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t GetClassByName(
            int64_t        model,
            const char      * owlClassName
        );    

Property model

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

Property owlClassName

Size: 64 bit / 8 byte (reference)
the name of the owlClass

Example

Here you can find code snippits that show how the API call GetClassByName 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);
}