MeshLib
 
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* TypeName() noexcept { return "ObjectMesh"; }
19 virtual const char* typeName() const override { return TypeName(); }
20
22 virtual const std::shared_ptr< Mesh > & varMesh() { return mesh_; }
23
25 MRMESH_API virtual void setMesh( std::shared_ptr< Mesh > mesh );
28 MRMESH_API virtual std::shared_ptr< Mesh > updateMesh( std::shared_ptr< Mesh > mesh );
29
30 MRMESH_API virtual std::vector<std::string> getInfoLines() const override;
31 virtual std::string getClassName() const override { return "Mesh"; }
32
33 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
34 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
35
36 MRMESH_API virtual void setDirtyFlags( uint32_t mask, bool invalidateCaches = true ) override;
37
40
44 MRMESH_API MeshIntersectionResult worldRayIntersection( const Line3f& worldRay, const FaceBitSet* region = nullptr ) const;
45
47 using MeshChangedSignal = Signal<void( uint32_t mask )>;
49
50protected:
51 ObjectMesh( const ObjectMesh& other ) = default;
52
54 MRMESH_API virtual void swapBase_( Object& other ) override;
57 MRMESH_API virtual void swapSignals_( Object& other ) override;
58
59 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
60};
61
63[[nodiscard]] MRMESH_API std::shared_ptr<ObjectMesh> merge( const std::vector<std::shared_ptr<ObjectMesh>>& objsMesh );
64
67[[nodiscard]] MRMESH_API std::shared_ptr<ObjectMesh> cloneRegion( const std::shared_ptr<ObjectMesh>& objMesh, const FaceBitSet& region, bool copyTexture = true );
68
69}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Definition MRDotNet/MRBitSet.h:39
Definition MRObjectMeshHolder.h:30
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 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
virtual MRMESH_API std::shared_ptr< Mesh > updateMesh(std::shared_ptr< Mesh > mesh)
MeshChangedSignal meshChangedSignal
Definition MRObjectMesh.h:48
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:22
virtual std::string getClassName() const override
return human readable name of subclass
Definition MRObjectMesh.h:31
ObjectMesh(ProtectedStruct, const ObjectMesh &obj)
Definition MRObjectMesh.h:39
virtual MRMESH_API void setMesh(std::shared_ptr< Mesh > mesh)
sets given mesh to this, resets selection and creases
virtual const char * typeName() const override
Definition MRObjectMesh.h:19
ObjectMesh(const ObjectMesh &other)=default
named object in the data model
Definition MRObject.h:60
Definition MRCameraOrientationPlugin.h:7
MRMESH_API std::shared_ptr< ObjectMesh > cloneRegion(const std::shared_ptr< ObjectMesh > &objMesh, const FaceBitSet &region, bool copyTexture=true)
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:17
Definition MRObject.h:246