MeshLib C++ Docs
Loading...
Searching...
No Matches
MRObjectPoints.h
Go to the documentation of this file.
1#pragma once
3
4namespace MR
5{
8
9struct RenderParams;
10
14{
15public:
16 ObjectPoints() = default;
19 [[deprecated( "Use ObjectPoints( objMesh, VertNormalsMode )" )]] MRMESH_API MR_BIND_IGNORE
20 ObjectPoints( const ObjectMesh& objMesh, bool saveNormals );
21 ObjectPoints& operator = ( ObjectPoints&& ) = default;
22 ObjectPoints( ObjectPoints&& ) = default;
23
24 constexpr static const char* StaticTypeName() noexcept { return "ObjectPoints"; }
25 virtual const char* typeName() const override { return StaticTypeName(); }
26
27 constexpr static const char* StaticClassName() noexcept { return _t( "Point Cloud" ); }
28 virtual std::string className() const override { return StaticClassName(); }
29
30 constexpr static const char* StaticClassNameInPlural() noexcept { return _t( "Point Clouds" ); }
31 virtual std::string classNameInPlural() const override { return StaticClassNameInPlural(); }
32
34 virtual const std::shared_ptr<PointCloud>& varPointCloud() { return points_; }
35
36 MRMESH_API virtual std::shared_ptr<Object> clone() const override;
37 MRMESH_API virtual std::shared_ptr<Object> shallowClone() const override;
38
39 virtual void setPointCloud( const std::shared_ptr<PointCloud>& pointCloud ) { points_ = pointCloud; setDirtyFlags( DIRTY_ALL ); }
42 MRMESH_API virtual void swapPointCloud( std::shared_ptr< PointCloud >& points );
43
46
47 MRMESH_API virtual std::vector<std::string> getInfoLines() const override;
48
49protected:
50 ObjectPoints( const ObjectPoints& other ) = default;
51
53 MRMESH_API virtual void swapBase_( Object& other ) override;
54
55 MRMESH_API virtual void serializeFields_( Json::Value& root ) const override;
56};
57
59[[nodiscard]] MRMESH_API std::shared_ptr<ObjectPoints> merge( const std::vector<std::shared_ptr<ObjectPoints>>& objsPoints );
60
63[[nodiscard]] MRMESH_API std::shared_ptr<ObjectPoints> cloneRegion( const std::shared_ptr<ObjectPoints>& objPoints, const VertBitSet& region );
64
68[[nodiscard]] MRMESH_API std::shared_ptr<ObjectPoints> pack( const ObjectPoints& pts, Reorder reorder, VertBitSet* newValidVerts = nullptr, const ProgressCallback & cb = {} );
69
70}
#define MRMESH_API
Definition MRMeshFwd.h:85
#define MRMESH_CLASS
Definition MRMeshFwd.h:92
#define _t(...)
Definition MRMeshFwd.h:869
Definition MRObjectMesh.h:14
Definition MRObjectPoints.h:14
named object in the data model
Definition MRObject.h:61
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:789
std::shared_ptr< ObjectPoints > pack(const ObjectPoints &pts, Reorder reorder, VertBitSet *newValidVerts=nullptr, const ProgressCallback &cb={})
const std::shared_ptr< const PointCloud > & pointCloud() const
Definition MRObjectPointsHolder.h:54
ObjectPoints(const ObjectPoints &other)=default
static constexpr const char * StaticTypeName() noexcept
Definition MRObjectPoints.h:24
virtual std::shared_ptr< Object > shallowClone() const override
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 className() const override
Definition MRObjectPoints.h:28
ObjectPoints(ProtectedStruct, const ObjectPoints &obj)
Definition MRObjectPoints.h:45
virtual std::shared_ptr< Object > clone() const override
virtual std::string classNameInPlural() const override
Definition MRObjectPoints.h:31
virtual void setDirtyFlags(uint32_t mask, bool invalidateCaches=true) override
ObjectPoints()=default
virtual void swapPointCloud(std::shared_ptr< PointCloud > &points)
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
virtual const std::shared_ptr< PointCloud > & varPointCloud()
returns variable point cloud, if const point cloud is needed use pointCloudPtr() instead
Definition MRObjectPoints.h:34
virtual void swapBase_(Object &other) override
swaps this object with other
ObjectPoints(ObjectPoints &&)=default
ObjectPoints(const ObjectMesh &objMesh, bool saveNormals)
static constexpr const char * StaticClassName() noexcept
Definition MRObjectPoints.h:27
std::shared_ptr< PointCloud > points_
Definition MRObjectPointsHolder.h:195
virtual std::vector< std::string > getInfoLines() const override
return several info lines that can better describe the object in the UI
virtual void setPointCloud(const std::shared_ptr< PointCloud > &pointCloud)
Definition MRObjectPoints.h:39
ObjectPoints(const ObjectMesh &objMesh, VertNormalsMode normals=VertNormalsMode::AreaWeighted)
makes the point cloud from the mesh vertices; if some triangles are selected, then only from the vert...
virtual void serializeFields_(Json::Value &root) const override
VertNormalsMode
which normals are given to the points of the cloud made from mesh vertices
Definition MREnums.h:70
virtual const char * typeName() const override
Definition MRObjectPoints.h:25
static constexpr const char * StaticClassNameInPlural() noexcept
Definition MRObjectPoints.h:30
Reorder
determines how points to be ordered
Definition MREnums.h:26
@ other
Angle, normally float. Measure in radians.
Definition MRFeatureObject.h:27
@ AreaWeighted
area-weighted average of the normals of incident triangles, see computePerVertNormals
Definition MREnums.h:72
@ DIRTY_ALL
Definition MRVisualObject.h:94
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRObject.h:289