MeshLib C Docs
Loading...
Searching...
No Matches
MRObject.h
Go to the documentation of this file.
1#pragma once
2
4#include <MRCMesh/MRBox.h>
6#include <MRCMisc/common.h>
7#include <MRCMisc/exports.h>
8
9#include <stdbool.h>
10#include <stddef.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef struct MR_ViewportMask MR_ViewportMask; // Defined in `#include <MRCMesh/MRViewportId.h>`.
17typedef struct MR_ViewportProperty_MR_AffineXf3f MR_ViewportProperty_MR_AffineXf3f; // Defined in `#include <MRCMesh/MRViewportProperty.h>`.
18typedef struct MR_VisualObject MR_VisualObject; // Defined in `#include <MRCMesh/MRVisualObject.h>`.
19typedef struct MR_std_set_std_string MR_std_set_std_string; // Defined in `#include <MRCMisc/std_set_std_string.h>`.
20typedef struct MR_std_shared_ptr_MR_Object MR_std_shared_ptr_MR_Object; // Defined in `#include <MRCMisc/std_shared_ptr_MR_Object.h>`.
21typedef struct MR_std_shared_ptr_const_MR_Object MR_std_shared_ptr_const_MR_Object; // Defined in `#include <MRCMisc/std_shared_ptr_const_MR_Object.h>`.
22typedef struct MR_std_string MR_std_string; // Defined in `#include <MRCMisc/std_string.h>`.
23typedef struct MR_std_vector_std_shared_ptr_MR_Object MR_std_vector_std_shared_ptr_MR_Object; // Defined in `#include <MRCMisc/std_vector_std_shared_ptr_MR_Object.h>`.
24typedef struct MR_std_vector_std_shared_ptr_const_MR_Object MR_std_vector_std_shared_ptr_const_MR_Object; // Defined in `#include <MRCMisc/std_vector_std_shared_ptr_const_MR_Object.h>`.
25typedef struct MR_std_vector_std_string MR_std_vector_std_string; // Defined in `#include <MRCMisc/std_vector_std_string.h>`.
26
27
67
105typedef struct MR_Object MR_Object;
106
110
115
119
123
128
131
134
142
143// returns this Object as shared_ptr
144// finds it among its parent's recognized children
149
155
159
164
167MRC_API const MR_Object *MR_Object_OffsetPtr(const MR_Object *ptr, ptrdiff_t i);
168
172
177
181
187
192
197
200
203
211
212// return name of subtype for serialization purposes
215
218MRC_API const char *MR_Object_typeName(const MR_Object *_this);
219
223
228
232
237
241
245
250
255MRC_API void MR_Object_setName(MR_Object *_this, const char *name, const char *name_end);
256
263MRC_API MR_std_shared_ptr_const_MR_Object *MR_Object_find(const MR_Object *_this, const char *name, const char *name_end);
264
270MRC_API MR_std_shared_ptr_MR_Object *MR_Object_find_mut(MR_Object *_this, const char *name, const char *name_end);
271
279MRC_API const MR_AffineXf3f *MR_Object_xf(const MR_Object *_this, const MR_ViewportId *id, bool *isDef);
280
286
292
298
303
310MRC_API MR_AffineXf3f MR_Object_worldXf(const MR_Object *_this, const MR_ViewportId *id, bool *isDef);
311
317
321MRC_API void MR_Object_applyScale(MR_Object *_this, float scaleFactor);
322
328
334MRC_API bool MR_Object_globalVisibility(const MR_Object *_this, const MR_ViewportMask *viewportMask);
335
341MRC_API void MR_Object_setGlobalVisibility(MR_Object *_this, bool on, const MR_ViewportMask *viewportMask);
342
347
351
357
361
366
370
374MRC_API bool MR_Object_isAncestor(const MR_Object *_this, const MR_Object *ancestor);
375
383
388
394
400
405
413MRC_API bool MR_Object_addChild(MR_Object *_this, MR_PassBy child_pass_by, MR_std_shared_ptr_MR_Object *child, const bool *recognizedChild);
414
422
428
432
437
442
446MRC_API bool MR_Object_select(MR_Object *_this, bool on);
447
451
456MRC_API void MR_Object_setAncillary(MR_Object *_this, bool ancillary);
457
461
466
472MRC_API void MR_Object_setVisible(MR_Object *_this, bool on, const MR_ViewportMask *viewportMask);
473
479MRC_API bool MR_Object_isVisible(const MR_Object *_this, const MR_ViewportMask *viewportMask);
480
486
492
498
502
508
514
521
528
534
542
548
555
560
566
573
581MRC_API bool MR_Object_addTag(MR_Object *_this, const char *tag, const char *tag_end);
582
589MRC_API bool MR_Object_removeTag(MR_Object *_this, const char *tag, const char *tag_end);
590
595
596// return true if model of current object equals to model (the same) of other
600MRC_API bool MR_Object_sameModels(const MR_Object *_this, const MR_Object *other);
601
602// return hash of model (or hash object pointer if object has no model)
606
607// returns this Object as shared_ptr
608// finds it among its parent's recognized children
613
614#ifdef __cplusplus
615} // extern "C"
616#endif
struct MR_VisualObject MR_VisualObject
Definition MRAddVisualPropertiesMixin.h:32
struct MR_ViewportMask MR_ViewportMask
Definition MRAddVisualPropertiesMixin.h:28
struct MR_std_shared_ptr_MR_Object MR_std_shared_ptr_MR_Object
Definition MRAddVisualPropertiesMixin.h:35
struct MR_std_set_std_string MR_std_set_std_string
Definition MRAddVisualPropertiesMixin.h:34
struct MR_ViewportProperty_MR_AffineXf3f MR_ViewportProperty_MR_AffineXf3f
Definition MRAddVisualPropertiesMixin.h:29
struct MR_ObjectChildrenHolder MR_ObjectChildrenHolder
Definition MRAddVisualPropertiesMixin.h:26
struct MR_std_string MR_std_string
Definition MRCtm.h:32
struct MR_Object MR_Object
Definition MRGltf.h:10
struct MR_std_vector_std_shared_ptr_MR_Object MR_std_vector_std_shared_ptr_MR_Object
Definition MRHeapBytes.h:17
struct MR_std_vector_std_string MR_std_vector_std_string
Definition MRNesting3mfExport.h:18
MRC_API MR_Box3f MR_Object_getWorldTreeBox(const MR_Object *_this, const MR_ViewportId *_1)
MRC_API void MR_Object_setXf(MR_Object *_this, const MR_AffineXf3f *xf, const MR_ViewportId *id)
MRC_API void MR_Object_setVisible(MR_Object *_this, bool on, const MR_ViewportMask *viewportMask)
MRC_API MR_std_vector_std_string * MR_Object_getInfoLines(const MR_Object *_this)
MRC_API bool MR_Object_sameModels(const MR_Object *_this, const MR_Object *other)
MRC_API MR_uint64_t MR_ObjectChildrenHolder_heapBytes(const MR_ObjectChildrenHolder *_this)
MRC_API const MR_std_string * MR_Object_name(const MR_Object *_this)
MRC_API void MR_Object_setParentLocked(MR_Object *_this, bool lock)
MRC_API bool MR_Object_globalVisibility(const MR_Object *_this, const MR_ViewportMask *viewportMask)
MRC_API MR_ObjectChildrenHolder * MR_ObjectChildrenHolder_DefaultConstruct(void)
MRC_API MR_Object * MR_Object_parent_mut(MR_Object *_this)
MRC_API const char * MR_Object_StaticTypeName(void)
Generated from method MR::Object::StaticTypeName.
MRC_API bool MR_Object_isAncestor(const MR_Object *_this, const MR_Object *ancestor)
MRC_API void MR_Object_applyScale(MR_Object *_this, float scaleFactor)
MRC_API void MR_ObjectChildrenHolder_Destroy(const MR_ObjectChildrenHolder *_this)
Destroys a heap-allocated instance of MR_ObjectChildrenHolder. Does nothing if the pointer is null.
MRC_API MR_ViewportMask * MR_Object_globalVisibilityMask(const MR_Object *_this)
MRC_API bool MR_Object_getRedrawFlag(const MR_Object *_this, const MR_ViewportMask *_1)
MRC_API MR_Object * MR_Object_OffsetMutablePtr(MR_Object *ptr, ptrdiff_t i)
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_cloneTree(const MR_Object *_this)
MRC_API bool MR_Object_addChild(MR_Object *_this, MR_PassBy child_pass_by, MR_std_shared_ptr_MR_Object *child, const bool *recognizedChild)
MRC_API MR_Object * MR_Object_AssignFromAnother(MR_Object *_this, MR_PassBy _other_pass_by, MR_Object *_other)
MRC_API const MR_ObjectChildrenHolder * MR_ObjectChildrenHolder_OffsetPtr(const MR_ObjectChildrenHolder *ptr, ptrdiff_t i)
MRC_API MR_Object * MR_Object_findCommonAncestor_mut(MR_Object *_this, MR_Object *other)
MRC_API bool MR_Object_isAncillary(const MR_Object *_this)
struct MR_std_shared_ptr_const_MR_Object MR_std_shared_ptr_const_MR_Object
Definition MRObject.h:21
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_shallowClone(const MR_Object *_this)
MRC_API const MR_Object * MR_Object_OffsetPtr(const MR_Object *ptr, ptrdiff_t i)
MRC_API bool MR_Object_removeChild_std_shared_ptr_MR_Object(MR_Object *_this, const MR_std_shared_ptr_MR_Object *child)
MRC_API bool MR_Object_hasVisualRepresentation(const MR_Object *_this)
MRC_API void MR_Object_removeAllChildren(MR_Object *_this)
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_find_mut(MR_Object *_this, const char *name, const char *name_end)
MRC_API void MR_Object_setGlobalVisibility(MR_Object *_this, bool on, const MR_ViewportMask *viewportMask)
MRC_API void MR_ObjectChildrenHolder_DestroyArray(const MR_ObjectChildrenHolder *_this)
Destroys a heap-allocated array of MR_ObjectChildrenHolder. Does nothing if the pointer is null.
MRC_API MR_Object * MR_Object_DefaultConstructArray(size_t num_elems)
MRC_API void MR_Object_setLocked(MR_Object *_this, bool on)
MRC_API const MR_Object * MR_Object_StaticDowncastFrom_MR_ObjectChildrenHolder(const MR_ObjectChildrenHolder *object)
MRC_API MR_std_string * MR_Object_classNameInPlural(const MR_Object *_this)
MRC_API bool MR_Object_removeChild_MR_Object_ptr(MR_Object *_this, MR_Object *child)
MRC_API const MR_Object * MR_Object_findCommonAncestor(const MR_Object *_this, const MR_Object *other)
MRC_API MR_Object * MR_Object_MutableStaticDowncastFrom_MR_ObjectChildrenHolder(MR_ObjectChildrenHolder *object)
MRC_API MR_Object * MR_Object_DefaultConstruct(void)
MRC_API MR_ObjectChildrenHolder * MR_ObjectChildrenHolder_DefaultConstructArray(size_t num_elems)
MRC_API MR_std_shared_ptr_MR_Object * MR_ObjectChildrenHolder_getSharedPtr(const MR_ObjectChildrenHolder *_this)
MRC_API bool MR_Object_isLocked(const MR_Object *_this)
MRC_API MR_ObjectChildrenHolder * MR_ObjectChildrenHolder_ConstructFromAnother(MR_PassBy _other_pass_by, MR_ObjectChildrenHolder *_other)
MRC_API bool MR_Object_addTag(MR_Object *_this, const char *tag, const char *tag_end)
MRC_API void MR_Object_sortChildren(MR_Object *_this)
MRC_API MR_std_shared_ptr_const_MR_Object * MR_Object_find(const MR_Object *_this, const char *name, const char *name_end)
MRC_API bool MR_Object_select(MR_Object *_this, bool on)
MRC_API const MR_VisualObject * MR_Object_asType(const MR_Object *_this)
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_shallowCloneTree(const MR_Object *_this)
MRC_API void MR_Object_Destroy(const MR_Object *_this)
Destroys a heap-allocated instance of MR_Object. Does nothing if the pointer is null.
MRC_API const MR_ObjectChildrenHolder * MR_Object_UpcastTo_MR_ObjectChildrenHolder(const MR_Object *object)
MRC_API const char * MR_Object_StaticClassName(void)
MRC_API MR_uint64_t MR_Object_getModelHash(const MR_Object *_this)
MRC_API const MR_ViewportProperty_MR_AffineXf3f * MR_Object_xfsForAllViewports(const MR_Object *_this)
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_clone(const MR_Object *_this)
MRC_API MR_ObjectChildrenHolder * MR_ObjectChildrenHolder_AssignFromAnother(MR_ObjectChildrenHolder *_this, MR_PassBy _other_pass_by, MR_ObjectChildrenHolder *_other)
MRC_API const MR_Object * MR_Object_parent(const MR_Object *_this)
MRC_API bool MR_Object_isVisible(const MR_Object *_this, const MR_ViewportMask *viewportMask)
MRC_API MR_VisualObject * MR_Object_asType_mut(MR_Object *_this)
MRC_API MR_uint64_t MR_Object_heapBytes(const MR_Object *_this)
MRC_API void MR_Object_setWorldXf(MR_Object *_this, const MR_AffineXf3f *xf, const MR_ViewportId *id)
MRC_API const char * MR_Object_typeName(const MR_Object *_this)
MRC_API void MR_Object_swap(MR_Object *_this, MR_Object *other)
MRC_API void MR_Object_setVisibilityMask(MR_Object *_this, const MR_ViewportMask *viewportMask)
MRC_API bool MR_Object_hasModel(const MR_Object *_this)
MRC_API const MR_std_set_std_string * MR_Object_tags(const MR_Object *_this)
MRC_API const char * MR_Object_StaticClassNameInPlural(void)
MRC_API bool MR_Object_isGlobalAncillary(const MR_Object *_this)
MRC_API MR_Object * MR_Object_ConstructFromAnother(MR_PassBy _other_pass_by, MR_Object *_other)
MRC_API bool MR_Object_addChildBefore(MR_Object *_this, MR_PassBy newChild_pass_by, MR_std_shared_ptr_MR_Object *newChild, const MR_std_shared_ptr_MR_Object *existingChild)
MRC_API void MR_Object_setAncillary(MR_Object *_this, bool ancillary)
MRC_API const MR_AffineXf3f * MR_Object_xf(const MR_Object *_this, const MR_ViewportId *id, bool *isDef)
MRC_API MR_std_string * MR_Object_className(const MR_Object *_this)
MRC_API MR_AffineXf3f MR_Object_worldXf(const MR_Object *_this, const MR_ViewportId *id, bool *isDef)
MRC_API void MR_Object_setName(MR_Object *_this, const char *name, const char *name_end)
MRC_API bool MR_Object_isSelected(const MR_Object *_this)
MRC_API MR_ObjectChildrenHolder * MR_ObjectChildrenHolder_OffsetMutablePtr(MR_ObjectChildrenHolder *ptr, ptrdiff_t i)
MRC_API bool MR_Object_isParentLocked(const MR_Object *_this)
MRC_API void MR_Object_resetXf(MR_Object *_this, const MR_ViewportId *id)
MRC_API void MR_Object_setXfsForAllViewports(MR_Object *_this, MR_PassBy xf_pass_by, MR_ViewportProperty_MR_AffineXf3f *xf)
MRC_API bool MR_Object_detachFromParent(MR_Object *_this)
MRC_API const MR_std_vector_std_shared_ptr_const_MR_Object * MR_Object_children(const MR_Object *_this)
MRC_API const MR_std_vector_std_shared_ptr_MR_Object * MR_Object_children_mut(MR_Object *_this)
struct MR_std_vector_std_shared_ptr_const_MR_Object MR_std_vector_std_shared_ptr_const_MR_Object
Definition MRObject.h:24
MRC_API void MR_Object_resetRedrawFlag(const MR_Object *_this)
MRC_API MR_Box3f MR_Object_getWorldBox(const MR_Object *_this, const MR_ViewportId *_1)
MRC_API MR_ObjectChildrenHolder * MR_Object_MutableUpcastTo_MR_ObjectChildrenHolder(MR_Object *object)
MRC_API MR_ViewportMask * MR_Object_visibilityMask(const MR_Object *_this)
MRC_API void MR_Object_DestroyArray(const MR_Object *_this)
Destroys a heap-allocated array of MR_Object. Does nothing if the pointer is null.
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_getSharedPtr(const MR_Object *_this)
MRC_API bool MR_Object_removeTag(MR_Object *_this, const char *tag, const char *tag_end)
MR_PassBy
Definition common.h:23
uint64_t MR_uint64_t
Definition common.h:18
#define MRC_API
Definition include/MRCMisc/exports.h:11
Definition MRAffineXf.h:39
Definition MRBox.h:107
Definition MRViewportId.h:17