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_ConstChildren MR_ConstChildren; // Defined in `#include <MRCMesh/MRConstChildren.h>`.
17typedef struct MR_ViewportMask MR_ViewportMask; // Defined in `#include <MRCMesh/MRViewportId.h>`.
18typedef struct MR_ViewportProperty_MR_AffineXf3f MR_ViewportProperty_MR_AffineXf3f; // Defined in `#include <MRCMesh/MRViewportProperty.h>`.
19typedef struct MR_VisualObject MR_VisualObject; // Defined in `#include <MRCMesh/MRVisualObject.h>`.
20typedef struct MR_std_set_std_string MR_std_set_std_string; // Defined in `#include <MRCMisc/std_set_std_string.h>`.
21typedef struct MR_std_shared_ptr_MR_Object MR_std_shared_ptr_MR_Object; // Defined in `#include <MRCMisc/std_shared_ptr_MR_Object.h>`.
22typedef 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>`.
23typedef struct MR_std_string MR_std_string; // Defined in `#include <MRCMisc/std_string.h>`.
24typedef 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>`.
25typedef 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>`.
26typedef struct MR_std_vector_std_string MR_std_vector_std_string; // Defined in `#include <MRCMisc/std_vector_std_string.h>`.
27
28
68
106typedef struct MR_Object MR_Object;
107
111
116
120
124
129
132
135
143
144// returns this Object as shared_ptr
145// finds it among its parent's recognized children
150
156
160
165
168MRC_API const MR_Object *MR_Object_OffsetPtr(const MR_Object *ptr, ptrdiff_t i);
169
173
178
182
188
193
198
201
204
212
213// return name of subtype for serialization purposes
216
219MRC_API const char *MR_Object_typeName(const MR_Object *_this);
220
224
229
233
238
242
246
251
256MRC_API void MR_Object_setName(MR_Object *_this, const char *name, const char *name_end);
257
264MRC_API MR_std_shared_ptr_const_MR_Object *MR_Object_find(const MR_Object *_this, const char *name, const char *name_end);
265
271MRC_API MR_std_shared_ptr_MR_Object *MR_Object_find_mut(MR_Object *_this, const char *name, const char *name_end);
272
280MRC_API const MR_AffineXf3f *MR_Object_xf(const MR_Object *_this, const MR_ViewportId *id, bool *isDef);
281
287
293
299
304
311MRC_API MR_AffineXf3f MR_Object_worldXf(const MR_Object *_this, const MR_ViewportId *id, bool *isDef);
312
318
322MRC_API void MR_Object_applyScale(MR_Object *_this, float scaleFactor);
323
329
335MRC_API bool MR_Object_globalVisibility(const MR_Object *_this, const MR_ViewportMask *viewportMask);
336
342MRC_API void MR_Object_setGlobalVisibility(MR_Object *_this, bool on, const MR_ViewportMask *viewportMask);
343
348
352
358
362
367
371
375MRC_API bool MR_Object_isAncestor(const MR_Object *_this, const MR_Object *ancestor);
376
384
389
395
401
408
413MRC_DEPRECATED_REASON("use constChildren() instead")
415
423MRC_API bool MR_Object_addChild(MR_Object *_this, MR_PassBy child_pass_by, MR_std_shared_ptr_MR_Object *child, const bool *recognizedChild);
424
432
438
442
447
452
456MRC_API bool MR_Object_select(MR_Object *_this, bool on);
457
461
466MRC_API void MR_Object_setAncillary(MR_Object *_this, bool ancillary);
467
471
476
482MRC_API void MR_Object_setVisible(MR_Object *_this, bool on, const MR_ViewportMask *viewportMask);
483
489MRC_API bool MR_Object_isVisible(const MR_Object *_this, const MR_ViewportMask *viewportMask);
490
496
502
508
512
518
524
531
538
544
552
558
564
569
575
582
590MRC_API bool MR_Object_addTag(MR_Object *_this, const char *tag, const char *tag_end);
591
598MRC_API bool MR_Object_removeTag(MR_Object *_this, const char *tag, const char *tag_end);
599
604
605// return true if model of current object equals to model (the same) of other
609MRC_API bool MR_Object_sameModels(const MR_Object *_this, const MR_Object *other);
610
611// return hash of model (or hash object pointer if object has no model)
615
616// returns this Object as shared_ptr
617// finds it among its parent's recognized children
622
623#ifdef __cplusplus
624} // extern "C"
625#endif
struct MR_VisualObject MR_VisualObject
Definition MRAddVisualPropertiesMixin.h:33
struct MR_ConstChildren MR_ConstChildren
Definition MRAddVisualPropertiesMixin.h:21
struct MR_ViewportMask MR_ViewportMask
Definition MRAddVisualPropertiesMixin.h:29
struct MR_std_shared_ptr_MR_Object MR_std_shared_ptr_MR_Object
Definition MRAddVisualPropertiesMixin.h:36
struct MR_std_set_std_string MR_std_set_std_string
Definition MRAddVisualPropertiesMixin.h:35
struct MR_ViewportProperty_MR_AffineXf3f MR_ViewportProperty_MR_AffineXf3f
Definition MRAddVisualPropertiesMixin.h:30
struct MR_ObjectChildrenHolder MR_ObjectChildrenHolder
Definition MRAddVisualPropertiesMixin.h:27
struct MR_std_shared_ptr_const_MR_Object MR_std_shared_ptr_const_MR_Object
Definition MRConstChildren.h:12
struct MR_std_vector_std_shared_ptr_MR_Object MR_std_vector_std_shared_ptr_MR_Object
Definition MRConstChildren.h:13
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_string MR_std_vector_std_string
Definition MRNesting3mfExport.h:17
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 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)
MRC_API MR_std_shared_ptr_MR_Object * MR_Object_shallowClone(const MR_Object *_this)
MRC_API size_t MR_Object_heapBytes(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 size_t MR_ObjectChildrenHolder_heapBytes(const MR_ObjectChildrenHolder *_this)
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 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 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:25
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_ConstChildren * MR_Object_constChildren(const MR_Object *_this)
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)
MRC_API size_t MR_Object_getModelHash(const MR_Object *_this)
#define MRC_DEPRECATED_REASON(str)
Definition common.h:74
MR_PassBy
Definition common.h:13
#define MRC_API
Definition include/MRCMisc/exports.h:11
Definition MRAffineXf.h:39
Definition MRBox.h:107
Definition MRViewportId.h:17