MeshLib C++ Docs
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{
10
11
12struct MRMESH_CLASS ObjTreeTraits
13{
14 using LeafTag = ObjTag;
15 using LeafId = ObjId;
16 using BoxT = Box3f;
17};
18
21class AABBTreeObjects : public AABBTreeBase<ObjTreeTraits>
22{
23public:
24 AABBTreeObjects() = default;
25
27 [[nodiscard]] MRMESH_API explicit AABBTreeObjects( Vector<MeshOrPointsXf, ObjId> objs );
28
30 [[nodiscard]] const MeshOrPoints & obj( ObjId oi ) const { return objs_[oi].obj; }
31
33 [[nodiscard]] const AffineXf3f & toWorld( ObjId oi ) const { return objs_[oi].xf; }
34
36 [[nodiscard]] const AffineXf3f & toLocal( ObjId oi ) const { return toLocal_[oi]; }
37
39 [[nodiscard]] const Vector<AffineXf3f, ObjId> & toLocal() const { return toLocal_; }
40
41private:
44};
45
46}
base class for most AABB-trees (except for AABBTreePoints)
Definition MRAABBTreeBase.h:15
Definition MRAABBTreeObjects.h:22
Definition MRMeshOrPoints.h:21
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
const AffineXf3f & toLocal(ObjId oi) const
gets transformation from world space to local space of given object
Definition MRAABBTreeObjects.h:36
const AffineXf3f & toWorld(ObjId oi) const
gets transformation from local space of given object to world space
Definition MRAABBTreeObjects.h:33
ObjTag LeafTag
Definition MRAABBTreeObjects.h:14
ObjId LeafId
Definition MRAABBTreeObjects.h:15
const MeshOrPoints & obj(ObjId oi) const
gets object by its id
Definition MRAABBTreeObjects.h:30
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:39
Box3f BoxT
Definition MRAABBTreeObjects.h:16
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRAABBTreeObjects.h:13