GetClassByName
When there is no class with such a name the return value is 0 (note that GetModellingStyle(..) can change this behavior).
Syntax
// // Strong typing definition // OwlClass GetClassByName( OwlModel model, const char * name ); static inline OwlClass GetClassByName( OwlModel model, char * name ) { return GetClassByName( model, (const char*) name ); } // // Weak typing definition // int64_t __declspec(dllexport) __stdcall GetClassByName( int64_t model, const char * name ); static inline int64_t GetClassByName( int64_t model, char * name ) { return GetClassByName( model, (const char*) name ); }
Property model
Size: 64 bit / 8 byte (value)Property name
Size: 32 bit / 4 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call GetClassByName can be used.
#include "./include/engine.h" #include <cmath> int64_t model = CreateModel(); if (model) { // // Classes // int64_t classArc3D = GetClassByName(model, "Arc3D"); // // Datatype Properties (attributes) // int64_t propertyRadius = GetPropertyByName(model, "radius"), propertyStart = GetPropertyByName(model, "start"), propertySize = GetPropertyByName(model, "size"), propertySegmentationParts = GetPropertyByName(model, "segmentationParts"); // // Instances (creating) // int64_t myInstanceArc3D = CreateInstance(classArc3D, nullptr); double Pi = 2. * acos(0.), radius = 2.1, start = 0., size = 2. * Pi; int64_t segmentationParts = 36; SetDatatypeProperty(myInstanceArc3D, propertyRadius, &radius, 1); SetDatatypeProperty(myInstanceArc3D, propertyStart, &start, 1); // in this case we could also do without, i.e. default value SetDatatypeProperty(myInstanceArc3D, propertySize, &size, 1); // in this case we could also do without, i.e. default value SetDatatypeProperty(myInstanceArc3D, propertySegmentationParts, &segmentationParts, 1); // // The resulting model can be viewed in 3D-Editor.exe // SaveModel(model, "c:\\created\\myFile.bin"); CloseModel(model); }