MeshLib C++ Docs
Loading...
Searching...
No Matches

Object that is parent of all scene. More...

#include <MRMesh/MRSceneRoot.h>

Inheritance diagram for MR::SceneRootObject:

Public Member Functions

 SceneRootObject ()
 SceneRootObject (SceneRootObject &&) noexcept=default
SceneRootObjectoperator= (SceneRootObject &&) noexcept=default
 SceneRootObject (ProtectedStruct, const SceneRootObject &obj)
virtual const char * typeName () const override
virtual std::string className () const override
virtual std::string classNameInPlural () const override
virtual void setAncillary (bool) override
virtual bool select (bool) override
 selects the object, returns true if value changed, otherwise returns false
virtual void setName (std::string) override
virtual std::shared_ptr< Objectclone () const override
 clones current object only, without parent and/or children
std::shared_ptr< SceneRootObjectcloneRoot () const
 same as clone but returns correct type
Public Member Functions inherited from MR::Object
 Object ()=default
 Object (Object &&) noexcept=default
Objectoperator= (Object &&) noexcept=default
virtual ~Object ()=default
template<typename T>
T * asType ()
template<typename T>
const T * asType () const
const std::string & name () const
std::shared_ptr< const Objectfind (const std::string_view &name) const
 finds a direct child by name
std::shared_ptr< Objectfind (const std::string_view &name)
template<typename T>
std::shared_ptr< const T > find () const
 finds a direct child by type
template<typename T>
std::shared_ptr< T > find ()
template<typename T>
std::shared_ptr< const T > find (const std::string_view &name) const
 finds a direct child by name and type
template<typename T>
std::shared_ptr< T > find (const std::string_view &name)
const AffineXf3f & xf (ViewportId id={}, bool *isDef=nullptr) const
virtual void setXf (const AffineXf3f &xf, ViewportId id={})
virtual void resetXf (ViewportId id={})
 forgets specific transform in given viewport (or forgets all specific transforms for {} input)
const ViewportProperty< AffineXf3f > & xfsForAllViewports () const
 returns xfs for all viewports, combined into a single object
virtual void setXfsForAllViewports (ViewportProperty< AffineXf3f > xf)
 modifies xfs for all viewports at once
AffineXf3f worldXf (ViewportId id={}, bool *isDef=nullptr) const
void setWorldXf (const AffineXf3f &xf, ViewportId id={})
virtual void applyScale (float scaleFactor)
 scale object size (all point positions)
ViewportMask globalVisibilityMask () const
 returns all viewports where this object is visible together with all its parents
bool globalVisibility (ViewportMask viewportMask=ViewportMask::any()) const
 returns true if this object is visible together with all its parents in any of given viewports
void setGlobalVisibility (bool on, ViewportMask viewportMask=ViewportMask::any())
 if true sets all predecessors visible, otherwise sets this object invisible
bool isLocked () const
 object properties lock for UI
virtual void setLocked (bool on)
bool isParentLocked () const
virtual void setParentLocked (bool lock)
const Objectparent () const
 returns parent object in the tree
Objectparent ()
bool isAncestor (const Object *ancestor) const
 return true if given object is ancestor of this one, false otherwise
ObjectfindCommonAncestor (Object &other)
const ObjectfindCommonAncestor (const Object &other) const
virtual bool detachFromParent ()
const std::vector< std::shared_ptr< Object > > & children ()
 an object can hold other sub-objects
const std::vector< std::shared_ptr< const Object > > & children () const
virtual bool addChild (std::shared_ptr< Object > child, bool recognizedChild=true)
virtual bool addChildBefore (std::shared_ptr< Object > newChild, const std::shared_ptr< Object > &existingChild)
bool removeChild (const std::shared_ptr< Object > &child)
 returns false if it was not child of this
virtual bool removeChild (Object *child)
virtual void removeAllChildren ()
 detaches all recognized children from this, keeping all unrecognized ones
void sortChildren ()
 sort recognized children by name
virtual bool isSelected () const
bool isAncillary () const
bool isGlobalAncillary () const
 returns true if the object or any of its ancestors are ancillary
void setVisible (bool on, ViewportMask viewportMask=ViewportMask::all())
 sets the object visible in the viewports specified by the mask (by default in all viewports)
bool isVisible (ViewportMask viewportMask=ViewportMask::any()) const
 checks whether the object is visible in any of the viewports specified by the mask (by default in any viewport)
virtual void setVisibilityMask (ViewportMask viewportMask)
 specifies object visibility as bitmask of viewports
virtual ViewportMask visibilityMask () const
 gets object visibility as bitmask of viewports
virtual bool getRedrawFlag (ViewportMask) const
 this method virtual because others data model types could have dirty flags or something
void resetRedrawFlag () const
std::shared_ptr< ObjectcloneTree () const
 clones all tree of this object (except ancillary and unrecognized children)
std::shared_ptr< ObjectshallowCloneTree () const
virtual std::shared_ptr< ObjectshallowClone () const
virtual std::vector< std::string > getInfoLines () const
 return several info lines that can better describe object in the UI
MR_BIND_IGNORE Expected< std::vector< std::future< Expected< void > > > > serializeRecursive (const std::filesystem::path &path, Json::Value &root, int childId) const
Expected< void > deserializeRecursive (const std::filesystem::path &path, const Json::Value &root, ProgressCallback progressCb={}, int *objCounter=nullptr)
void swap (Object &other)
virtual Box3f getWorldBox (ViewportId={}) const
 returns bounding box of this object in world coordinates for default or specific viewport
Box3f getWorldTreeBox (ViewportId={}) const
 returns bounding box of this object and all children visible in given (or default) viewport in world coordinates
virtual bool hasVisualRepresentation () const
 does the object have any visual representation (visible points, triangles, edges, etc.), no considering child objects
virtual bool hasModel () const
const std::set< std::string > & tags () const
bool addTag (std::string tag)
bool removeTag (const std::string &tag)
virtual size_t heapBytes () const
 returns the amount of memory this object occupies on heap
virtual bool sameModels (const Object &other) const
 return true if model of current object equals to model (the same) of other
virtual size_t getModelHash () const
 return hash of model (or hash object pointer if object has no model)
 Object (ProtectedStruct, const Object &obj)
Public Member Functions inherited from MR::ObjectChildrenHolder
 ObjectChildrenHolder ()=default
 ObjectChildrenHolder (const ObjectChildrenHolder &) noexcept
ObjectChildrenHolderoperator= (const ObjectChildrenHolder &) noexcept
 ObjectChildrenHolder (ObjectChildrenHolder &&) noexcept
ObjectChildrenHolderoperator= (ObjectChildrenHolder &&) noexcept
 ~ObjectChildrenHolder ()
std::shared_ptr< ObjectgetSharedPtr () const
size_t heapBytes () const

Static Public Member Functions

static constexpr const char * StaticTypeName () noexcept
static constexpr const char * StaticClassName () noexcept
static constexpr const char * StaticClassNameInPlural () noexcept
static constexpr const char * RootName () noexcept
Static Public Member Functions inherited from MR::Object
static constexpr const char * StaticTypeName () noexcept
 return name of subtype for serialization purposes
static constexpr const char * StaticClassName () noexcept
 return human readable name of subclass
static constexpr const char * StaticClassNameInPlural () noexcept
 return human readable name of subclass in plural form

Protected Member Functions

 SceneRootObject (const SceneRootObject &other)=default
virtual void serializeFields_ (Json::Value &root) const override
void deserializeFields_ (const Json::Value &root) override
Protected Member Functions inherited from MR::Object
 Object (const Object &obj)=default
 user should not be able to call copy implicitly, use clone() function instead
virtual void swapBase_ (Object &other)
 swaps whole object (signals too)
virtual void swapSignals_ (Object &other)
virtual Expected< std::future< Expected< void > > > serializeModel_ (const std::filesystem::path &path) const
virtual Expected< void > deserializeModel_ (const std::filesystem::path &path, ProgressCallback progressCb={})
 Reads model from file.
virtual Expected< void > setSharedModel_ (const Object &other)
 shares model from other object
void sendWorldXfChangedSignal_ ()
virtual void onWorldXfChanged_ ()
 Emits worldXfChangedSignal, but derived classes can add additional behavior to it.

Additional Inherited Members

Public Types inherited from MR::Object
using XfChangedSignal = Signal<void()>
Public Attributes inherited from MR::Object
XfChangedSignal worldXfChangedSignal
Protected Attributes inherited from MR::Object
std::string name_
ViewportProperty< AffineXf3f > xf_
ViewportMask visibilityMask_ = ViewportMask::all()
bool locked_ = false
 Prefer to not read directly. Use the getter, as it can be overridden.
bool parentLocked_ = false
bool selected_ { false }
bool ancillary_ { false }
bool needRedraw_ {false}
std::set< std::string > tags_
Protected Attributes inherited from MR::ObjectChildrenHolder
ObjectChildrenHolderparent_ = nullptr
std::vector< std::shared_ptr< Object > > children_
std::vector< std::weak_ptr< Object > > bastards_
 recognized ones

Detailed Description

Object that is parent of all scene.


The documentation for this class was generated from the following file: