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{
8
9struct MRMESH_CLASS ObjTreeTraits
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
24 [[nodiscard]] MRMESH_API explicit AABBTreeObjects( Vector<MeshOrPointsXf, ObjId> objs );
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:
39 Vector<MeshOrPointsXf, ObjId> objs_;
40 Vector<AffineXf3f, ObjId> toLocal_;
41};
42
43} // namespace MR
#define MRMESH_API
Definition MRMeshFwd.h:80
#define MRMESH_CLASS
Definition MRMeshFwd.h:87
unsafe AABBTreeObjects()
Definition MRCameraOrientationPlugin.h:8