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 );
26 MRMESH_API ObjectMesh* asObjectMesh() const;
27
29 MRMESH_API void set( std::shared_ptr<ObjectPoints> op );
31 MRMESH_API ObjectPoints* asObjectPoints() const;
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
39 MRMESH_API MeshOrPoints meshOrPoints() const;
40private:
41 std::variant<ObjectMesh*, ObjectPoints*> var_;
42 std::shared_ptr<VisualObject> visualObject_;
43};
44
45}
Definition MRMeshOrPointsObject.h:14
Definition MRMeshOrPoints.h:21
Definition MRObjectMesh.h:14
Definition MRObjectPoints.h:14
MRMESH_API void set(std::shared_ptr< ObjectMesh > om)
set to hold ObjectMesh
MRMESH_API void set(std::shared_ptr< ObjectPoints > op)
set to hold ObjectPoints
const std::shared_ptr< VisualObject > & get() const
Definition MRMeshOrPointsObject.h:35
MeshOrPointsObject(std::shared_ptr< ObjectMesh > om)
Definition MRMeshOrPointsObject.h:20
MRMESH_API MeshOrPointsObject(std::shared_ptr< VisualObject > vo)
void reset()
Definition MRMeshOrPointsObject.h:33
MeshOrPointsObject()
Definition MRMeshOrPointsObject.h:16
MRMESH_API MeshOrPoints meshOrPoints() const
get class that hold either mesh part or point cloud
const std::shared_ptr< VisualObject > & operator->() const
Definition MRMeshOrPointsObject.h:34
bool operator==(std::shared_ptr< VisualObject > other) const
Definition MRMeshOrPointsObject.h:36
MRMESH_API ObjectMesh * asObjectMesh() const
if holding ObjectMesh, return pointer to it, otherwise return nullptr
MeshOrPointsObject(std::shared_ptr< ObjectPoints > op)
Definition MRMeshOrPointsObject.h:21
MRMESH_API ObjectPoints * asObjectPoints() const
if holding ObjectPoints, return pointer to it, otherwise return nullptr
@ other
Angle, normally float. Measure in radians.
only for bindings generation
Definition MRCameraOrientationPlugin.h:8