IsDuplicate
Syntax
public const string enginedll = @"engine.dll"; [DllImport(enginedll, EntryPoint = "IsDuplicate")] public static extern byte x86_IsDuplicate(Int64 originalOwlInstance, Int64 duplicateOwlInstance, out double duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial); [DllImport(enginedll, EntryPoint = "IsDuplicate")] public static extern byte x64_IsDuplicate(Int64 originalOwlInstance, Int64 duplicateOwlInstance, out double duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial); public static byte IsDuplicate(Int64 originalOwlInstance, Int64 duplicateOwlInstance, out double duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial) { if (IntPtr.Size == 4) { var _result = x86_IsDuplicate(originalOwlInstance, duplicateOwlInstance, out double _duplicateMatrix, absoluteEpsilon, relativeEpsilon, checkMaterial); duplicateMatrix = _duplicateMatrix; return _result; } else { return x64_IsDuplicate(originalOwlInstance, duplicateOwlInstance, out duplicateMatrix, absoluteEpsilon, relativeEpsilon, checkMaterial); } } [DllImport(enginedll, EntryPoint = "IsDuplicate")] public static extern byte x86_IsDuplicate(Int64 originalOwlInstance, Int64 duplicateOwlInstance, double[] duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial); [DllImport(enginedll, EntryPoint = "IsDuplicate")] public static extern byte x64_IsDuplicate(Int64 originalOwlInstance, Int64 duplicateOwlInstance, double[] duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial); public static byte IsDuplicate(Int64 originalOwlInstance, Int64 duplicateOwlInstance, double[] duplicateMatrix, double absoluteEpsilon, double relativeEpsilon, bool checkMaterial) { if (IntPtr.Size == 4) { var _result = x86_IsDuplicate(originalOwlInstance, duplicateOwlInstance, duplicateMatrix, absoluteEpsilon, relativeEpsilon, checkMaterial); return _result; } else { return x64_IsDuplicate(originalOwlInstance, duplicateOwlInstance, duplicateMatrix, absoluteEpsilon, relativeEpsilon, checkMaterial); } }
Property originalOwlInstance
Size: 64 bit / 8 byte (value)Property duplicateOwlInstance
Size: 64 bit / 8 byte (value)Property duplicateMatrix
Size: 32 bit / 4 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.
using RDF; // include at least engine.cs within your solution static void Main(string[] args) { Int64 model = RDF.engine.CreateModel(); double epsilon = 0.000001; // Box (https://rdf.bg/gkdoc/Box/CP64.html)e Int64 owlInstanceBox = RDF.engine.CreateInstance(RDF.engine.GetClassByName(model, "Box")); RDF.engine.SetDatatypeProperty(owlInstanceBox, RDF.engine.GetPropertyByName(model, "height"), 4.0 - epsilon / 3.0); RDF.engine.SetDatatypeProperty(owlInstanceBox, RDF.engine.GetPropertyByName(model, "length"), 4.0); RDF.engine.SetDatatypeProperty(owlInstanceBox, RDF.engine.GetPropertyByName(model, "width"), 4.0 + epsilon / 3.0); // Cube (https://rdf.bg/gkdoc/Cube/CP64.html) Int64 owlInstanceCube = RDF.engine.CreateInstance(RDF.engine.GetClassByName(model, "Cube")); RDF.engine.SetDatatypeProperty(owlInstanceCube, RDF.engine.GetPropertyByName(model, "length"), 4.0); // Matrix (https://rdf.bg/gkdoc/Matrix/CP64.html) Int64 owlInstanceMatrix = RDF.engine.CreateInstance(RDF.engine.GetClassByName(model, "Matrix")); RDF.engine.SetDatatypeProperty(owlInstanceMatrix, RDF.engine.GetPropertyByName(model, "_11"), 0.0); RDF.engine.SetDatatypeProperty(owlInstanceMatrix, RDF.engine.GetPropertyByName(model, "_12"), 1.0); RDF.engine.SetDatatypeProperty(owlInstanceMatrix, RDF.engine.GetPropertyByName(model, "_21"), - 1.0); RDF.engine.SetDatatypeProperty(owlInstanceMatrix, RDF.engine.GetPropertyByName(model, "_22"), 0.0); RDF.engine.SetDatatypeProperty(owlInstanceMatrix, RDF.engine.GetPropertyByName(model, "_41"), 12.0); RDF.engine.SetDatatypeProperty(owlInstanceMatrix, RDF.engine.GetPropertyByName(model, "_43"), 33.0); // Transformation (https://rdf.bg/gkdoc/Transformation/CP64.html) Int64 owlInstanceTransformation = RDF.engine.CreateInstance(RDF.engine.GetClassByName(model, "Transformation")); RDF.engine.SetObjectProperty(owlInstanceTransformation, RDF.engine.GetPropertyByName(model, "object"), owlInstanceCube); RDF.engine.SetObjectProperty(owlInstanceTransformation, RDF.engine.GetPropertyByName(model, "matrix"), owlInstanceMatrix); double matrix[12]; Debug.Assert(RDF.engine.IsDuplicate(owlInstanceTransformation, owlInstanceBox, matrix, 0.0, false) == false); bool isDuplicate = RDF.engine.IsDuplicate(owlInstanceTransformation, owlInstanceBox, matrix, epsilon, false); assert(isDuplicate && matrix[0] == 0.0 && matrix[3] == 1.0 && matrix[6] == 0.0 && matrix[9] == 0.0 && matrix[1] == - 1.0 && matrix[4] == 0.0 && matrix[7] == 0.0 && matrix[10] == 12.0 && matrix[2] == 0.0 && matrix[5] == 0.0 && matrix[8] == 1.0 && matrix[11] == - 33.0); CloseModel(model);