MeshLib
 
Loading...
Searching...
No Matches
MRAABBTreeObjects.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRAABBTreeBase.h"
4#include "MRMeshOrPoints.h"
5
6namespace MR
7{
8
10{
11 using LeafTag = ObjTag;
12 using LeafId = ObjId;
13 using BoxT = Box3f;
14};
15
18class AABBTreeObjects : public AABBTreeBase<ObjTreeTraits>
19{
20public:
21 AABBTreeObjects() = default;
22
25
27 [[nodiscard]] const MeshOrPoints & obj( ObjId oi ) const { return objs_[oi].obj; }
28
30 [[nodiscard]] const AffineXf3f & toWorld( ObjId oi ) const { return objs_[oi].xf; }
31
33 [[nodiscard]] const AffineXf3f & toLocal( ObjId oi ) const { return toLocal_[oi]; }
34
36 [[nodiscard]] const Vector<AffineXf3f, ObjId> & toLocal() const { return toLocal_; }
37
38private:
41};
42
43} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
base class for most AABB-trees (except for AABBTreePoints)
Definition MRAABBTreeBase.h:12
Definition MRAABBTreeObjects.h:19
const AffineXf3f & toLocal(ObjId oi) const
gets transformation from world space to local space of given object
Definition MRAABBTreeObjects.h:33
const AffineXf3f & toWorld(ObjId oi) const
gets transformation from local space of given object to world space
Definition MRAABBTreeObjects.h:30
const MeshOrPoints & obj(ObjId oi) const
gets object by its id
Definition MRAABBTreeObjects.h:27
AABBTreeObjects()=default
MRMESH_API AABBTreeObjects(Vector< MeshOrPointsXf, ObjId > objs)
creates tree for given set of objects each with its own transformation
const Vector< AffineXf3f, ObjId > & toLocal() const
gets mapping: objId -> its transformation from world space to local space
Definition MRAABBTreeObjects.h:36
Definition MRMesh/MRMeshOrPoints.h:17
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
Definition MRCameraOrientationPlugin.h:7
class MRMESH_CLASS ObjTag
Definition MRMesh/MRMeshFwd.h:68
Box< Vector3f > Box3f
Definition MRDotNet/MRMeshFwd.h:26
Definition MRAABBTreeObjects.h:10
ObjTag LeafTag
Definition MRAABBTreeObjects.h:11
ObjId LeafId
Definition MRAABBTreeObjects.h:12