IsDuplicate
Syntax
// // Strong typing definition // bool IsDuplicate( OwlInstance originalOwlInstance, OwlInstance duplicateOwlInstance, double * duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial ); static inline bool IsDuplicate( OwlInstance originalOwlInstance, OwlInstance duplicateOwlInstance, double * duplicateMatrix, double epsilon, bool checkMaterial ) { return IsDuplicate( originalOwlInstance, duplicateOwlInstance, duplicateMatrix, epsilon, 0., // relativeEpsilon checkMaterial ); } static inline bool IsDuplicate( OwlInstance originalOwlInstance, OwlInstance duplicateOwlInstance ) { return IsDuplicate( originalOwlInstance, duplicateOwlInstance, nullptr, // duplicateMatrix 0., // absoluteEpsilon 0., // relativeEpsilon false // checkMaterial ); } // // Weak typing definition // bool __declspec(dllexport) __stdcall IsDuplicate( int64_t originalOwlInstance, int64_t duplicateOwlInstance, double * duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial ); static inline bool IsDuplicate( int64_t originalOwlInstance, int64_t duplicateOwlInstance, double * duplicateMatrix, double epsilon, bool checkMaterial ) { return IsDuplicate( originalOwlInstance, duplicateOwlInstance, duplicateMatrix, epsilon, 0., // relativeEpsilon checkMaterial ); } static inline bool IsDuplicate( int64_t originalOwlInstance, int64_t duplicateOwlInstance ) { return IsDuplicate( originalOwlInstance, duplicateOwlInstance, nullptr, // duplicateMatrix 0., // absoluteEpsilon 0., // relativeEpsilon false // checkMaterial ); }
Property originalOwlInstance
Size: 64 bit / 8 byte (value)Property duplicateOwlInstance
Size: 64 bit / 8 byte (value)Property duplicateMatrix
Size: 64 bit / 8 byte (reference)Property absoluteEpsilon
Size: 64 bit / 8 byte (value)???.
Property relativeEpsilon
Size: 64 bit / 8 byte (value)???.
Property checkMaterial
Size: 8 bit / 1 byte (value)
Example (based on pure API calls)
Here you can find code snippits that show how the API call IsDuplicate can be used.
#include "./include/engine.h" int64_t model = CreateModel(); double epsilon = 0.000001; // Box (https://rdf.bg/gkdoc/Box/CP64.html)e int64_t owlInstanceBox = CreateInstance(GetClassByName(model, "Box")); SetDatatypeProperty(owlInstanceBox, GetPropertyByName(model, "height"), 4. - epsilon / 3.); SetDatatypeProperty(owlInstanceBox, GetPropertyByName(model, "length"), 4.); SetDatatypeProperty(owlInstanceBox, GetPropertyByName(model, "width"), 4. + epsilon / 3.); // Cube (https://rdf.bg/gkdoc/Cube/CP64.html) int64_t owlInstanceCube = CreateInstance(GetClassByName(model, "Cube")); SetDatatypeProperty(owlInstanceCube, GetPropertyByName(model, "length"), 4.); // Matrix (https://rdf.bg/gkdoc/Matrix/CP64.html) int64_t owlInstanceMatrix = CreateInstance(GetClassByName(model, "Matrix")); SetDatatypeProperty(owlInstanceMatrix, GetPropertyByName(model, "_11"), 0.); SetDatatypeProperty(owlInstanceMatrix, GetPropertyByName(model, "_12"), 1.); SetDatatypeProperty(owlInstanceMatrix, GetPropertyByName(model, "_21"), - 1.); SetDatatypeProperty(owlInstanceMatrix, GetPropertyByName(model, "_22"), 0.); SetDatatypeProperty(owlInstanceMatrix, GetPropertyByName(model, "_41"), 12.); SetDatatypeProperty(owlInstanceMatrix, GetPropertyByName(model, "_43"), 33.); // Transformation (https://rdf.bg/gkdoc/Transformation/CP64.html) int64_t owlInstanceTransformation = CreateInstance(GetClassByName(model, "Transformation")); SetObjectProperty(owlInstanceTransformation, GetPropertyByName(model, "object"), owlInstanceCube); SetObjectProperty(owlInstanceTransformation, GetPropertyByName(model, "matrix"), owlInstanceMatrix); double matrix[12]; assert(IsDuplicate(owlInstanceTransformation, owlInstanceBox, matrix, 0., false) == false); bool isDuplicate = IsDuplicate(owlInstanceTransformation, owlInstanceBox, matrix, epsilon, false); assert(isDuplicate && matrix[0] == 0. && matrix[3] == 1. && matrix[6] == 0. && matrix[9] == 0. && matrix[1] == - 1. && matrix[4] == 0. && matrix[7] == 0. && matrix[10] == 12. && matrix[2] == 0. && matrix[5] == 0. && matrix[8] == 1. && matrix[11] == - 33.); CloseModel(model);