GetNameOfClass
Syntax
// // Strong typing definition // const char * GetNameOfClass( OwlClass owlClass, const char ** name ); static inline const char * GetNameOfClass( OwlClass owlClass, char ** name ) { return GetNameOfClass( owlClass, (const char**) name ); } static inline const char * GetNameOfClass( OwlClass owlClass ) { return GetNameOfClass( owlClass, (const char**) nullptr // name ); } // // Weak typing definition // const char __declspec(dllexport) * __stdcall GetNameOfClass( int64_t owlClass, const char ** name ); static inline const char * GetNameOfClass( int64_t owlClass, char ** name ) { return GetNameOfClass( owlClass, (const char**) name ); } static inline const char * GetNameOfClass( int64_t owlClass ) { return GetNameOfClass( owlClass, (const char**) nullptr // name ); }
Property owlClass
Size: 64 bit / 8 byte (value)Property name
Size: 64 bit / 8 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call GetNameOfClass can be used.
#include "./include/engine.h" #include <cmath> int64_t model = CreateModel(); if (model) { // // Classes // int64_t myClass = CreateClass(model, "MyCreatedClass"); // // Datatype Properties (attributes) // int64_t propertyLength = GetPropertyByName(model, "length"); // // Instances (creating) // int64_t myInstance = CreateInstance(myClass, nullptr); double length = 2.; SetDatatypeProperty(myInstance, propertyLength, &length, 1); assert(GetVolume(myInstance, 0, 0) == 0.); char * classNameI = nullptr; GetNameOfClass(myClass, &classNameI); SetNameOfClass(myClass, "OtherClassName"); char * classNameII = nullptr; GetNameOfClass(myClass, &classNameII); SetClassParent(myClass, GetClassByName(model, "Cube"), 1); assert(GetVolume(myInstance, 0, 0) == 8.); SetNameOfClass(myClass, "OutOfIdeasForClassName"); char * classNameIII = nullptr; GetNameOfClass(myClass, &classNameIII); // // The retrieved class names have the following values // classNameI : 'MyCreatedClass' // classNameII : 'OtherClassName' // classNameIII : 'OutOfIdeasForClassName' // // // The resulting model can be viewed in 3D-Editor.exe // SaveModel(model, "c:\\created\\myFile.bin"); CloseModel(model); }