MeshLib C++ Docs
Loading...
Searching...
No Matches
MRObjectMesh.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace MR
6{
9
10
13class MRMESH_CLASS ObjectMesh : public ObjectMeshHolder
14{
15public:
16 ObjectMesh() = default;
17
18 ObjectMesh( ObjectMesh&& ) noexcept = default;
19 ObjectMesh& operator = ( ObjectMesh&& ) noexcept = default;
20
21 constexpr static const char* StaticTypeName() noexcept { return "ObjectMesh"; }
22 virtual const char* typeName() const override { return StaticTypeName(); }
23
24 constexpr static const char* StaticClassName() noexcept { return "Mesh"; }
25 virtual std::string className() const override { return StaticClassName(); }
26
27 constexpr static const char* StaticClassNameInPlural() noexcept { return "Meshes"; }
28 virtual std::string classNameInPlural() const override { return StaticClassNameInPlural(); }
29
31 virtual const std::shared_ptr< Mesh > & varMesh() { return data_.mesh; }
32
34 MRMESH_API virtual void setMesh( std::shared_ptr< Mesh > mesh );
37 MRMESH_API virtual std::shared_ptr< Mesh > updateMesh( std::shared_ptr< Mesh > mesh );
38
39 MRMESH_API virtual std::vector<std::string> getInfoLines() const override;
40
41 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
42 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
43
46
50 MRMESH_API MeshIntersectionResult worldRayIntersection( const Line3f& worldRay, const FaceBitSet* region = nullptr ) const;
51
52protected:
53 ObjectMesh( const ObjectMesh& other ) = default;
54
56 MRMESH_API virtual void swapBase_( Object& other ) override;
57
58 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
59};
60
63{
65 const std::vector<AffineXf3f>* overrideXfs{ nullptr };
66};
67
69[[nodiscard]] MRMESH_API std::shared_ptr<ObjectMesh> merge( const std::vector<std::shared_ptr<ObjectMesh>>& objsMesh, const ObjectMeshMergeOptions& options = {} );
70
73[[nodiscard]] MRMESH_API std::shared_ptr<ObjectMesh> cloneRegion( const std::shared_ptr<ObjectMesh>& objMesh, const FaceBitSet& region, bool copyTexture = true );
74
75}
Definition MRObjectMeshHolder.h:35
Definition MRObjectMesh.h:14
named object in the data model
Definition MRObject.h:62
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
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
virtual std::string classNameInPlural() const override
Definition MRObjectMesh.h:28
static constexpr const char * StaticClassName() noexcept
Definition MRObjectMesh.h:24
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:27
const std::vector< AffineXf3f > * overrideXfs
if not nullptr: merged object will take overridden transform for each object
Definition MRObjectMesh.h:65
virtual MRMESH_API std::shared_ptr< Mesh > updateMesh(std::shared_ptr< Mesh > mesh)
virtual const std::shared_ptr< Mesh > & varMesh()
returns variable mesh, if const mesh is needed use mesh() instead
Definition MRObjectMesh.h:31
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
ObjectMesh(ProtectedStruct, const ObjectMesh &obj)
Definition MRObjectMesh.h:45
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:25
virtual const char * typeName() const override
Definition MRObjectMesh.h:22
ObjectMesh(const ObjectMesh &other)=default
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshIntersect.h:18
options to better control MR::merge function
Definition MRObjectMesh.h:63
Definition MRObject.h:284