MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshOrPointsObject.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include <variant>
4
5namespace MR
6{
9
10
14{
15public:
19 MRMESH_API MeshOrPointsObject( std::shared_ptr<VisualObject> vo );
20 MeshOrPointsObject( std::shared_ptr<ObjectMesh> om ) { set( std::move( om ) ); }
21 MeshOrPointsObject( std::shared_ptr<ObjectPoints> op ) { set( std::move( op ) ); }
22
24 MRMESH_API void set( std::shared_ptr<ObjectMesh> om );
27
29 MRMESH_API void set( std::shared_ptr<ObjectPoints> op );
32
33 void reset() { set( std::shared_ptr<ObjectMesh>{} ); }
34 const std::shared_ptr<VisualObject>& operator->() const { return visualObject_; }
35 const std::shared_ptr<VisualObject>& get() const { return visualObject_; }
36 bool operator==( std::shared_ptr<VisualObject> other ) const { return visualObject_ == other; }
37
40private:
41 std::variant<ObjectMesh*, ObjectPoints*> var_;
42 std::shared_ptr<VisualObject> visualObject_;
43};
44
45}
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMeshOrPoints.h:21
Definition MRObjectMesh.h:14
Definition MRObjectPoints.h:14
ObjectMesh * asObjectMesh() const
if holding ObjectMesh, return pointer to it, otherwise return nullptr
void set(std::shared_ptr< ObjectPoints > op)
set to hold ObjectPoints
ObjectPoints * asObjectPoints() const
if holding ObjectPoints, return pointer to it, otherwise return nullptr
const std::shared_ptr< VisualObject > & get() const
Definition MRMeshOrPointsObject.h:35
MeshOrPointsObject(std::shared_ptr< ObjectMesh > om)
Definition MRMeshOrPointsObject.h:20
void reset()
Definition MRMeshOrPointsObject.h:33
MeshOrPointsObject()
Definition MRMeshOrPointsObject.h:16
const std::shared_ptr< VisualObject > & operator->() const
Definition MRMeshOrPointsObject.h:34
bool operator==(std::shared_ptr< VisualObject > other) const
Definition MRMeshOrPointsObject.h:36
MeshOrPointsObject(std::shared_ptr< ObjectPoints > op)
Definition MRMeshOrPointsObject.h:21
MeshOrPoints meshOrPoints() const
get class that hold either mesh part or point cloud
void set(std::shared_ptr< ObjectMesh > om)
set to hold ObjectMesh
MeshOrPointsObject(std::shared_ptr< VisualObject > vo)
@ other
Angle, normally float. Measure in radians.
Definition MRFeatureObject.h:27
only for bindings generation
Definition MRCameraOrientationPlugin.h:8