MeshLib Documentation
Loading...
Searching...
No Matches
MRObjectPoints.h
Go to the documentation of this file.
1#pragma once
3
4namespace MR
5{
6struct RenderParams;
7
11{
12public:
13 ObjectPoints() = default;
14 MRMESH_API explicit ObjectPoints( const ObjectMesh& objMesh, bool saveNormals = true );
15 ObjectPoints& operator = ( ObjectPoints&& ) = default;
16 ObjectPoints( ObjectPoints&& ) = default;
17
18 constexpr static const char* TypeName() noexcept { return "ObjectPoints"; }
19 virtual const char* typeName() const override { return TypeName(); }
20
22 virtual const std::shared_ptr<PointCloud>& varPointCloud() { return points_; }
23
24 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
25 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
26
27 virtual void setPointCloud( const std::shared_ptr<PointCloud>& pointCloud ) { points_ = pointCloud; setDirtyFlags( DIRTY_ALL ); }
30 MRMESH_API virtual void swapPointCloud( std::shared_ptr< PointCloud >& points );
31
34
35 MRMESH_API virtual std::vector<std::string> getInfoLines() const override;
36 virtual std::string getClassName() const override { return "Points"; }
37
38 MRMESH_API virtual void setDirtyFlags( uint32_t mask, bool invalidateCaches = true ) override;
39
41 using ChangedSignal = Signal<void( uint32_t mask )>;
44
45protected:
46 ObjectPoints( const ObjectPoints& other ) = default;
47
49 MRMESH_API virtual void swapBase_( Object& other ) override;
52 MRMESH_API virtual void swapSignals_( Object& other ) override;
53
54 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
55};
56
58[[nodiscard]] MRMESH_API std::shared_ptr<ObjectPoints> merge( const std::vector<std::shared_ptr<ObjectPoints>>& objsPoints );
59
62[[nodiscard]] MRMESH_API std::shared_ptr<ObjectPoints> cloneRegion( const std::shared_ptr<ObjectPoints>& objPoints, const VertBitSet& region );
63
67[[nodiscard]] MRMESH_API std::shared_ptr<ObjectPoints> pack( const ObjectPoints& pts, Reorder reorder, VertBitSet* newValidVerts = nullptr, const ProgressCallback & cb = {} );
68
69} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Definition MRObjectMesh.h:11
Definition MRObjectPointsHolder.h:18
Definition MRObjectPoints.h:11
virtual MRMESH_API std::shared_ptr< Object > shallowClone() const override
ObjectPoints(const ObjectPoints &other)=default
static constexpr const char * TypeName() noexcept
Definition MRObjectPoints.h:18
ObjectPoints(ProtectedStruct, const ObjectPoints &obj)
Definition MRObjectPoints.h:33
virtual MRMESH_API void setDirtyFlags(uint32_t mask, bool invalidateCaches=true) override
virtual MRMESH_API void serializeFields_(Json::Value &root) const override
ObjectPoints()=default
ChangedSignal normalsChangedSignal
Definition MRObjectPoints.h:43
virtual MRMESH_API void swapBase_(Object &other) override
swaps this object with other
virtual MRMESH_API std::vector< std::string > getInfoLines() const override
return several info lines that can better describe the object in the UI
virtual std::string getClassName() const override
return human readable name of subclass
Definition MRObjectPoints.h:36
virtual const std::shared_ptr< PointCloud > & varPointCloud()
returns variable point cloud, if const point cloud is needed use pointCloud() instead
Definition MRObjectPoints.h:22
ObjectPoints(ObjectPoints &&)=default
virtual void setPointCloud(const std::shared_ptr< PointCloud > &pointCloud)
Definition MRObjectPoints.h:27
ChangedSignal pointsChangedSignal
Definition MRObjectPoints.h:42
virtual MRMESH_API std::shared_ptr< Object > clone() const override
virtual MRMESH_API void swapPointCloud(std::shared_ptr< PointCloud > &points)
virtual MRMESH_API void swapSignals_(Object &other) override
MRMESH_API ObjectPoints(const ObjectMesh &objMesh, bool saveNormals=true)
virtual const char * typeName() const override
Definition MRObjectPoints.h:19
named object in the data model
Definition MRObject.h:60
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
@ DIRTY_ALL
Definition MRVisualObject.h:109
Definition MRCameraOrientationPlugin.h:8
MRMESH_API std::shared_ptr< ObjectMesh > cloneRegion(const std::shared_ptr< ObjectMesh > &objMesh, const FaceBitSet &region, bool copyTexture=true)
MRMESH_API std::shared_ptr< ObjectPoints > pack(const ObjectPoints &pts, Reorder reorder, VertBitSet *newValidVerts=nullptr, const ProgressCallback &cb={})
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
Reorder
determines how points to be ordered
Definition MRMesh/MRMeshFwd.h:593
Definition MRObject.h:246