MeshLib C++ Docs
Loading...
Searching...
No Matches
MRObjectMesh.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace MR
6{
7
11{
12public:
13 ObjectMesh() = default;
14
15 ObjectMesh( ObjectMesh&& ) noexcept = default;
16 ObjectMesh& operator = ( ObjectMesh&& ) noexcept = default;
17
18 constexpr static const char* StaticTypeName() noexcept { return "ObjectMesh"; }
19 virtual const char* typeName() const override { return StaticTypeName(); }
20
21 constexpr static const char* StaticClassName() noexcept { return "Mesh"; }
22 virtual std::string className() const override { return StaticClassName(); }
23
24 constexpr static const char* StaticClassNameInPlural() noexcept { return "Meshes"; }
25 virtual std::string classNameInPlural() const override { return StaticClassNameInPlural(); }
26
28 virtual const std::shared_ptr< Mesh > & varMesh() { return data_.mesh; }
29
31 MRMESH_API virtual void setMesh( std::shared_ptr< Mesh > mesh );
34 MRMESH_API virtual std::shared_ptr< Mesh > updateMesh( std::shared_ptr< Mesh > mesh );
35
36 MRMESH_API virtual std::vector<std::string> getInfoLines() const override;
37
38 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
39 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
40
41 MRMESH_API virtual void setDirtyFlags( uint32_t mask, bool invalidateCaches = true ) override;
42
45
49 MRMESH_API MeshIntersectionResult worldRayIntersection( const Line3f& worldRay, const FaceBitSet* region = nullptr ) const;
50
52 using MeshChangedSignal = Signal<void( uint32_t mask )>;
54
55protected:
56 ObjectMesh( const ObjectMesh& other ) = default;
57
59 MRMESH_API virtual void swapBase_( Object& other ) override;
62 MRMESH_API virtual void swapSignals_( Object& other ) override;
63
64 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
65};
66
69{
71 const std::vector<AffineXf3f>* overrideXfs{ nullptr };
72};
73
75[[nodiscard]] MRMESH_API std::shared_ptr<ObjectMesh> merge( const std::vector<std::shared_ptr<ObjectMesh>>& objsMesh, const ObjectMeshMergeOptions& options = {} );
76
79[[nodiscard]] MRMESH_API std::shared_ptr<ObjectMesh> cloneRegion( const std::shared_ptr<ObjectMesh>& objMesh, const FaceBitSet& region, bool copyTexture = true );
80
81}
#define MRMESH_API
Definition MRMeshFwd.h:80
#define MRMESH_CLASS
Definition MRMeshFwd.h:87
Definition MRObjectMeshHolder.h:32
Definition MRObjectMesh.h:11
virtual MRMESH_API void serializeFields_(Json::Value &root) const override
virtual MRMESH_API std::vector< std::string > getInfoLines() const override
return several info lines that can better describe the object in the UI
virtual MRMESH_API std::shared_ptr< Object > clone() const override
ObjectMesh(ObjectMesh &&) noexcept=default
virtual std::string classNameInPlural() const override
Definition MRObjectMesh.h:25
static constexpr const char * StaticClassName() noexcept
Definition MRObjectMesh.h:21
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
MRMESH_API MeshIntersectionResult worldRayIntersection(const Line3f &worldRay, const FaceBitSet *region=nullptr) const
virtual MRMESH_API void swapBase_(Object &other) override
swaps this object with other
ObjectMesh()=default
static constexpr const char * StaticClassNameInPlural() noexcept
Definition MRObjectMesh.h:24
virtual MRMESH_API std::shared_ptr< Mesh > updateMesh(std::shared_ptr< Mesh > mesh)
MeshChangedSignal meshChangedSignal
Definition MRObjectMesh.h:53
virtual MRMESH_API void setDirtyFlags(uint32_t mask, bool invalidateCaches=true) override
virtual MRMESH_API void swapSignals_(Object &other) override
virtual const std::shared_ptr< Mesh > & varMesh()
returns variable mesh, if const mesh is needed use mesh() instead
Definition MRObjectMesh.h:28
ObjectMesh(ProtectedStruct, const ObjectMesh &obj)
Definition MRObjectMesh.h:44
virtual MRMESH_API void setMesh(std::shared_ptr< Mesh > mesh)
sets given mesh to this, resets selection and creases
virtual std::string className() const override
Definition MRObjectMesh.h:22
virtual const char * typeName() const override
Definition MRObjectMesh.h:19
ObjectMesh(const ObjectMesh &other)=default
named object in the data model
Definition MRObject.h:62
Definition MRCameraOrientationPlugin.h:8
MRMESH_API std::shared_ptr< ObjectLines > cloneRegion(const std::shared_ptr< ObjectLines > &objLines, const UndirectedEdgeBitSet &region)
constructs new ObjectLines containing the region of data from input object
MRMESH_API std::shared_ptr< ObjectLines > merge(const std::vector< std::shared_ptr< ObjectLines > > &objsLines)
constructs new ObjectLines containing the union of valid data from all input objects
Definition MRMeshIntersect.h:18
options to better control MR::merge function
Definition MRObjectMesh.h:69
const std::vector< AffineXf3f > * overrideXfs
if not nullptr: merged object will take overridden transform for each object
Definition MRObjectMesh.h:71
Definition MRObject.h:284