MeshLib C Docs
Loading...
Searching...
No Matches
MRObjectComparableWithReference.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMisc/common.h>
4#include <MRCMisc/exports.h>
5
6#include <stdbool.h>
7#include <stddef.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct MR_DistanceMeasurementObject MR_DistanceMeasurementObject; // Defined in `#include <MRCMesh/MRDistanceMeasurementObject.h>`.
14typedef struct MR_PointMeasurementObject MR_PointMeasurementObject; // Defined in `#include <MRCMesh/MRPointMeasurementObject.h>`.
15typedef struct MR_std_optional_MR_ObjectComparableWithReference_ComparableProperty MR_std_optional_MR_ObjectComparableWithReference_ComparableProperty; // Defined in `#include <MRCMisc/std_optional_MR_ObjectComparableWithReference_ComparableProperty.h>`.
16typedef struct MR_std_optional_MR_ObjectComparableWithReference_ComparisonTolerance MR_std_optional_MR_ObjectComparableWithReference_ComparisonTolerance; // Defined in `#include <MRCMisc/std_optional_MR_ObjectComparableWithReference_ComparisonTolerance.h>`.
17typedef struct MR_std_optional_float MR_std_optional_float; // Defined in `#include <MRCMisc/std_optional_float.h>`.
18typedef struct MR_std_string_view MR_std_string_view; // Defined in `#include <MRCMisc/std_string_view.h>`.
19typedef struct MR_std_variant_float_MR_Vector3f MR_std_variant_float_MR_Vector3f; // Defined in `#include <MRCMisc/std_variant_float_MR_Vector3f.h>`.
20
21
22// A base class for a data-model object that is a feature/measurement that can be compared between two models.
29
32
33// Tolerances:
36
37// This can't be `std::optional<Var>`, because we still need the variant to know the correct type.
40
43
46
47// When comparing this object with a reference, how many different properties can we output?
51
52// `i` goes up to `numComparableProperties()`, exclusive.
57
58// Compute a value of a property.
59// Compare `value` and `referenceValue` using the tolerance.
60// This can return null if the value is impossible to compute, e.g. for some types if the reference isn't set (e.g. if
61// we're computing the distance to a reference point).
62// `i` goes up to `numComparableProperties()`, exclusive.
67
68// Returns the tolerance for a specific comparable property. Returns null if not set.
69// `i` goes up to `numComparableProperties()`, exclusive.
74
75// Sets the tolerance for a specific comparable property.
76// `i` goes up to `numComparableProperties()`, exclusive.
82
83// If true, indicates that the getter will always return zero negative tolerance, and the setter will ignore the negative tolerance.
84// `i` goes up to `numComparableProperties()`, exclusive.
88
89// The number and types of reference values can be entirely different compared to `numComparableProperties()`.
93
94// `i` goes up to `numComparisonReferenceValues()`, exclusive.
99
100// Returns the internal reference value.
101// If the value wasn't set yet (as indicated by `isSet == false`), you can still use the returned variant to get the expected type.
102// `i` goes up to `numComparisonReferenceValues()`, exclusive.
107
108// Sets the internal reference value. Makes `hasComparisonReferenceValue()` return true.
109// If you pass nullopt, removes this reference value.
110// Only a certain variant type is legal to pass, depending on the derived class and the index. Use `getComparisonReferenceValue()` to determine that type.
111// `i` goes up to `numComparisonReferenceValues()`, exclusive.
117
122
125
128
133
137
142
146
153
159
164
168
173
177
184
190
195
199
204
205// This can be null if the reference value isn't set, or something else is wrong.
206// This can match whatever is set via `get/setComparisonReferenceValue()`, but not necessarily.
207// E.g. for point coordinates, those functions act on the reference coordinates (three optional floats), but this number is always zero,
208// and the `value` is the distance to those coordinates.
213
214// This can be null if the reference value isn't set, or something else is wrong.
215// This can match whatever is set via `get/setComparisonReferenceValue()`, but not necessarily.
216// E.g. for point coordinates, those functions act on the reference coordinates (three optional floats), but this number is always zero,
217// and the `value` is the distance to those coordinates.
222
223// This can be null if the reference value isn't set, or something else is wrong.
224// This can match whatever is set via `get/setComparisonReferenceValue()`, but not necessarily.
225// E.g. for point coordinates, those functions act on the reference coordinates (three optional floats), but this number is always zero,
226// and the `value` is the distance to those coordinates.
231
235
240
245
248
251
256
259
262
268
269// How much larger can this value be compared to the reference?
274
275// How much larger can this value be compared to the reference?
279
280// How much larger can this value be compared to the reference?
285
286// How much smaller can this value be compared to the reference?
287// This number should normally be zero or negative.
292
293// How much smaller can this value be compared to the reference?
294// This number should normally be zero or negative.
298
299// How much smaller can this value be compared to the reference?
300// This number should normally be zero or negative.
305
309
314
318
321
324
329
332
335
341
346
350
355
356// If `isSet == false`, this will hold zeroes, or some other default values.
361
362// If `isSet == false`, this will hold zeroes, or some other default values.
367
368// If `isSet == false`, this will hold zeroes, or some other default values.
373
377
382
387
390
393
398
401
404
410
411#ifdef __cplusplus
412} // extern "C"
413#endif
struct MR_std_optional_float MR_std_optional_float
Definition MRBestFitPolynomial.h:14
struct MR_std_string_view MR_std_string_view
Definition MRDistanceMeasurementObject.h:25
struct MR_std_optional_MR_ObjectComparableWithReference_ComparableProperty MR_std_optional_MR_ObjectComparableWithReference_ComparableProperty
Definition MRDistanceMeasurementObject.h:21
struct MR_std_optional_MR_ObjectComparableWithReference_ComparisonTolerance MR_std_optional_MR_ObjectComparableWithReference_ComparisonTolerance
Definition MRDistanceMeasurementObject.h:22
struct MR_DistanceMeasurementObject MR_DistanceMeasurementObject
Definition MRDistanceMeasurementObject.h:40
struct MR_ObjectComparableWithReference MR_ObjectComparableWithReference
Definition MRDistanceMeasurementObject.h:17
struct MR_ObjectComparableWithReference_ComparisonTolerance MR_ObjectComparableWithReference_ComparisonTolerance
Definition MRDistanceMeasurementObject.h:19
struct MR_ObjectComparableWithReference_ComparisonReferenceValue MR_ObjectComparableWithReference_ComparisonReferenceValue
Definition MRDistanceMeasurementObject.h:18
struct MR_std_variant_float_MR_Vector3f MR_std_variant_float_MR_Vector3f
Definition MRDistanceMeasurementObject.h:26
struct MR_PointMeasurementObject MR_PointMeasurementObject
Definition MRMeasurementObject.h:16
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_DefaultConstruct(void)
MRC_API MR_DistanceMeasurementObject * MR_ObjectComparableWithReference_MutableDynamicDowncastToOrFail_MR_DistanceMeasurementObject(MR_ObjectComparableWithReference *object)
MRC_API MR_uint64_t MR_ObjectComparableWithReference_numComparableProperties(const MR_ObjectComparableWithReference *_this)
MRC_API const MR_DistanceMeasurementObject * MR_ObjectComparableWithReference_DynamicDowncastToOrFail_MR_DistanceMeasurementObject(const MR_ObjectComparableWithReference *object)
MRC_API void MR_ObjectComparableWithReference_setComparisonReferenceValue(MR_ObjectComparableWithReference *_this, MR_uint64_t i, const MR_std_variant_float_MR_Vector3f *value)
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_OffsetMutablePtr(MR_ObjectComparableWithReference_ComparisonReferenceValue *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_OffsetMutablePtr(MR_ObjectComparableWithReference_ComparisonTolerance *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const float * MR_ObjectComparableWithReference_ComparisonTolerance_Get_negative(const MR_ObjectComparableWithReference_ComparisonTolerance *_this)
MRC_API void MR_ObjectComparableWithReference_ComparisonTolerance_DestroyArray(const MR_ObjectComparableWithReference_ComparisonTolerance *_this)
Destroys a heap-allocated array of MR_ObjectComparableWithReference_ComparisonTolerance....
MRC_API MR_PointMeasurementObject * MR_ObjectComparableWithReference_MutableDynamicDowncastToOrFail_MR_PointMeasurementObject(MR_ObjectComparableWithReference *object)
MRC_API MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_DefaultConstructArray(size_t num_elems)
MRC_API const MR_PointMeasurementObject * MR_ObjectComparableWithReference_StaticDowncastTo_MR_PointMeasurementObject(const MR_ObjectComparableWithReference *object)
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_ConstructFromAnother(const MR_ObjectComparableWithReference_ComparisonReferenceValue *_other)
MRC_API const float * MR_ObjectComparableWithReference_ComparisonTolerance_Get_positive(const MR_ObjectComparableWithReference_ComparisonTolerance *_this)
MRC_API MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_ConstructFrom(float value, const float *referenceValue)
MRC_API float * MR_ObjectComparableWithReference_ComparisonTolerance_GetMutable_negative(MR_ObjectComparableWithReference_ComparisonTolerance *_this)
MRC_API float * MR_ObjectComparableWithReference_ComparisonTolerance_GetMutable_positive(MR_ObjectComparableWithReference_ComparisonTolerance *_this)
MRC_API void MR_ObjectComparableWithReference_Destroy(const MR_ObjectComparableWithReference *_this)
Destroys a heap-allocated instance of MR_ObjectComparableWithReference. Does nothing if the pointer i...
MRC_API MR_PointMeasurementObject * MR_ObjectComparableWithReference_MutableStaticDowncastTo_MR_PointMeasurementObject(MR_ObjectComparableWithReference *object)
MRC_API const MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_OffsetPtr(const MR_ObjectComparableWithReference_ComparisonTolerance *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const MR_PointMeasurementObject * MR_ObjectComparableWithReference_DynamicDowncastTo_MR_PointMeasurementObject(const MR_ObjectComparableWithReference *object)
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_AssignFromAnother(MR_ObjectComparableWithReference_ComparisonReferenceValue *_this, const MR_ObjectComparableWithReference_ComparisonReferenceValue *_other)
MRC_API void MR_ObjectComparableWithReference_ComparisonTolerance_Set_negative(MR_ObjectComparableWithReference_ComparisonTolerance *_this, float value)
MRC_API MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_AssignFromAnother(MR_ObjectComparableWithReference_ComparableProperty *_this, const MR_ObjectComparableWithReference_ComparableProperty *_other)
MRC_API MR_std_optional_MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_getComparisonTolerence(const MR_ObjectComparableWithReference *_this, MR_uint64_t i)
struct MR_ObjectComparableWithReference_ComparableProperty MR_ObjectComparableWithReference_ComparableProperty
Generated from class MR::ObjectComparableWithReference::ComparableProperty.
Definition MRObjectComparableWithReference.h:31
MRC_API const float * MR_ObjectComparableWithReference_ComparableProperty_Get_value(const MR_ObjectComparableWithReference_ComparableProperty *_this)
MRC_API void MR_ObjectComparableWithReference_ComparableProperty_DestroyArray(const MR_ObjectComparableWithReference_ComparableProperty *_this)
Destroys a heap-allocated array of MR_ObjectComparableWithReference_ComparableProperty....
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_DefaultConstructArray(size_t num_elems)
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_ConstructFrom(bool isSet, const MR_std_variant_float_MR_Vector3f *var)
MRC_API const MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_ComparisonReferenceValue_OffsetPtr(const MR_ObjectComparableWithReference_ComparisonReferenceValue *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_ConstructFromAnother(const MR_ObjectComparableWithReference_ComparisonTolerance *_other)
MRC_API const MR_PointMeasurementObject * MR_ObjectComparableWithReference_DynamicDowncastToOrFail_MR_PointMeasurementObject(const MR_ObjectComparableWithReference *object)
MRC_API void MR_ObjectComparableWithReference_ComparisonReferenceValue_Set_isSet(MR_ObjectComparableWithReference_ComparisonReferenceValue *_this, bool value)
MRC_API MR_uint64_t MR_ObjectComparableWithReference_numComparisonReferenceValues(const MR_ObjectComparableWithReference *_this)
MRC_API MR_std_string_view * MR_ObjectComparableWithReference_getComparablePropertyName(const MR_ObjectComparableWithReference *_this, MR_uint64_t i)
MRC_API MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_ConstructFromAnother(const MR_ObjectComparableWithReference_ComparableProperty *_other)
MRC_API MR_DistanceMeasurementObject * MR_ObjectComparableWithReference_MutableDynamicDowncastTo_MR_DistanceMeasurementObject(MR_ObjectComparableWithReference *object)
MRC_API void MR_ObjectComparableWithReference_ComparisonReferenceValue_Destroy(const MR_ObjectComparableWithReference_ComparisonReferenceValue *_this)
Destroys a heap-allocated instance of MR_ObjectComparableWithReference_ComparisonReferenceValue....
MRC_API void MR_ObjectComparableWithReference_setComparisonTolerance(MR_ObjectComparableWithReference *_this, MR_uint64_t i, const MR_ObjectComparableWithReference_ComparisonTolerance *newTolerance)
MRC_API void MR_ObjectComparableWithReference_ComparisonReferenceValue_Set_var(MR_ObjectComparableWithReference_ComparisonReferenceValue *_this, const MR_std_variant_float_MR_Vector3f *value)
MRC_API MR_std_optional_float * MR_ObjectComparableWithReference_ComparableProperty_GetMutable_referenceValue(MR_ObjectComparableWithReference_ComparableProperty *_this)
MRC_API bool MR_ObjectComparableWithReference_comparisonToleranceIsAlwaysOnlyPositive(const MR_ObjectComparableWithReference *_this, MR_uint64_t i)
MRC_API const MR_ObjectComparableWithReference * MR_ObjectComparableWithReference_OffsetPtr(const MR_ObjectComparableWithReference *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_ObjectComparableWithReference_ComparisonReferenceValue_DestroyArray(const MR_ObjectComparableWithReference_ComparisonReferenceValue *_this)
Destroys a heap-allocated array of MR_ObjectComparableWithReference_ComparisonReferenceValue....
MRC_API void MR_ObjectComparableWithReference_DestroyArray(const MR_ObjectComparableWithReference *_this)
Destroys a heap-allocated array of MR_ObjectComparableWithReference. Does nothing if the pointer is n...
MRC_API MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_DefaultConstructArray(size_t num_elems)
MRC_API MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_OffsetMutablePtr(MR_ObjectComparableWithReference_ComparableProperty *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_DefaultConstruct(void)
MRC_API MR_std_string_view * MR_ObjectComparableWithReference_getComparisonReferenceValueName(const MR_ObjectComparableWithReference *_this, MR_uint64_t i)
MRC_API MR_ObjectComparableWithReference_ComparisonReferenceValue * MR_ObjectComparableWithReference_getComparisonReferenceValue(const MR_ObjectComparableWithReference *_this, MR_uint64_t i)
MRC_API const MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_ComparableProperty_OffsetPtr(const MR_ObjectComparableWithReference_ComparableProperty *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_AssignFromAnother(MR_ObjectComparableWithReference_ComparisonTolerance *_this, const MR_ObjectComparableWithReference_ComparisonTolerance *_other)
MRC_API const MR_std_variant_float_MR_Vector3f * MR_ObjectComparableWithReference_ComparisonReferenceValue_Get_var(const MR_ObjectComparableWithReference_ComparisonReferenceValue *_this)
MRC_API void MR_ObjectComparableWithReference_ComparisonTolerance_Set_positive(MR_ObjectComparableWithReference_ComparisonTolerance *_this, float value)
MRC_API MR_std_optional_MR_ObjectComparableWithReference_ComparableProperty * MR_ObjectComparableWithReference_computeComparableProperty(const MR_ObjectComparableWithReference *_this, MR_uint64_t i)
MRC_API MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_ConstructFrom(float positive, float negative)
MRC_API MR_DistanceMeasurementObject * MR_ObjectComparableWithReference_MutableStaticDowncastTo_MR_DistanceMeasurementObject(MR_ObjectComparableWithReference *object)
MRC_API float * MR_ObjectComparableWithReference_ComparableProperty_GetMutable_value(MR_ObjectComparableWithReference_ComparableProperty *_this)
MRC_API void MR_ObjectComparableWithReference_ComparableProperty_Set_value(MR_ObjectComparableWithReference_ComparableProperty *_this, float value)
MRC_API const MR_DistanceMeasurementObject * MR_ObjectComparableWithReference_StaticDowncastTo_MR_DistanceMeasurementObject(const MR_ObjectComparableWithReference *object)
MRC_API void MR_ObjectComparableWithReference_ComparableProperty_Set_referenceValue(MR_ObjectComparableWithReference_ComparableProperty *_this, const float *value)
MRC_API MR_ObjectComparableWithReference * MR_ObjectComparableWithReference_OffsetMutablePtr(MR_ObjectComparableWithReference *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const bool * MR_ObjectComparableWithReference_ComparisonReferenceValue_Get_isSet(const MR_ObjectComparableWithReference_ComparisonReferenceValue *_this)
MRC_API const MR_DistanceMeasurementObject * MR_ObjectComparableWithReference_DynamicDowncastTo_MR_DistanceMeasurementObject(const MR_ObjectComparableWithReference *object)
MRC_API MR_PointMeasurementObject * MR_ObjectComparableWithReference_MutableDynamicDowncastTo_MR_PointMeasurementObject(MR_ObjectComparableWithReference *object)
MRC_API void MR_ObjectComparableWithReference_ComparisonTolerance_Destroy(const MR_ObjectComparableWithReference_ComparisonTolerance *_this)
Destroys a heap-allocated instance of MR_ObjectComparableWithReference_ComparisonTolerance....
MRC_API void MR_ObjectComparableWithReference_setComparisonReferenceVal(MR_ObjectComparableWithReference *_this, MR_uint64_t i, const MR_ObjectComparableWithReference_ComparisonReferenceValue *value)
MRC_API bool * MR_ObjectComparableWithReference_ComparisonReferenceValue_GetMutable_isSet(MR_ObjectComparableWithReference_ComparisonReferenceValue *_this)
MRC_API MR_std_variant_float_MR_Vector3f * MR_ObjectComparableWithReference_ComparisonReferenceValue_GetMutable_var(MR_ObjectComparableWithReference_ComparisonReferenceValue *_this)
MRC_API const MR_std_optional_float * MR_ObjectComparableWithReference_ComparableProperty_Get_referenceValue(const MR_ObjectComparableWithReference_ComparableProperty *_this)
MRC_API MR_ObjectComparableWithReference_ComparisonTolerance * MR_ObjectComparableWithReference_ComparisonTolerance_DefaultConstruct(void)
MRC_API void MR_ObjectComparableWithReference_ComparableProperty_Destroy(const MR_ObjectComparableWithReference_ComparableProperty *_this)
Destroys a heap-allocated instance of MR_ObjectComparableWithReference_ComparableProperty....
uint64_t MR_uint64_t
Definition common.h:14
#define MRC_API
Definition exports.h:11