diff --git a/modules/gfx/src/entity.hh b/modules/gfx/src/entity.hh index 112a7ac4d8f5b5dbdd6db517a673b9ded7180a34..d3fe0ad928855e1c6fe41b40943a8439b50996fe 100644 --- a/modules/gfx/src/entity.hh +++ b/modules/gfx/src/entity.hh @@ -90,7 +90,7 @@ public: RenderMode::Type m, const mol::EntityView& ev); - virtual geom::AlignedCuboid GetBoundingBox(bool use_global=false) const; + virtual geom::AlignedCuboid GetBoundingBox(bool use_tf=false) const; // ProcessLimits uses the default implementation of bounding box diff --git a/modules/gfx/src/map_slab.cc b/modules/gfx/src/map_slab.cc index ae4a08629b4950c1836bd19fe2d53742e326a9ae..3af16f422257a6a1dea44aa2dd0da13bb20fd7b7 100644 --- a/modules/gfx/src/map_slab.cc +++ b/modules/gfx/src/map_slab.cc @@ -84,11 +84,12 @@ MapSlab::MapSlab(const String& name, const img::MapHandle& mh, const geom::Plane maxv_ = stat.GetMaximum(); } -geom::AlignedCuboid MapSlab::GetBoundingBox() const +geom::AlignedCuboid MapSlab::GetBoundingBox(bool use_tf) const { geom::Vec3 minc = plane_.At(-1.0,-1.0); geom::Vec3 maxc = plane_.At(1.0,1.0); - return geom::AlignedCuboid(minc,maxc); + geom::AlignedCuboid bb(minc,maxc); + return use_tf ? transform_.Apply(bb) : bb; } geom::Vec3 MapSlab::GetCenter() const diff --git a/modules/gfx/src/map_slab.hh b/modules/gfx/src/map_slab.hh index 8d27b975c3fc72bcc52d4ba5031e92b14a135e76..c38a88864a5fc129733571c2be34971ce73339fd 100644 --- a/modules/gfx/src/map_slab.hh +++ b/modules/gfx/src/map_slab.hh @@ -62,7 +62,7 @@ public: MapSlab(const String& name, const img::MapHandle& mh, const geom::Plane& p); - virtual geom::AlignedCuboid GetBoundingBox() const; + virtual geom::AlignedCuboid GetBoundingBox(bool use_tf=true) const; virtual geom::Vec3 GetCenter() const; virtual void CustomRenderGL(RenderPass pass); diff --git a/modules/gfx/src/prim_list.cc b/modules/gfx/src/prim_list.cc index e07820e6bc6c15af276b8a7012baa21b00545eb3..0c8589ea29837485a979443287b31f6be137fe74 100644 --- a/modules/gfx/src/prim_list.cc +++ b/modules/gfx/src/prim_list.cc @@ -54,7 +54,7 @@ void PrimList::Clear() this->FlagRebuild(); } -geom::AlignedCuboid PrimList::GetBoundingBox() const +geom::AlignedCuboid PrimList::GetBoundingBox(bool use_tf) const { if(points_.empty() && lines_.empty() && spheres_.empty() && cyls_.empty() && texts_.empty() && vas_.empty()) { return geom::AlignedCuboid(geom::Vec3(-1,-1,-1),geom::Vec3(1,1,1)); @@ -66,7 +66,8 @@ geom::AlignedCuboid PrimList::GetBoundingBox() const -std::numeric_limits<float>::max(), -std::numeric_limits<float>::max()); ProcessLimits(minc,maxc,geom::Transform()); - return geom::AlignedCuboid(minc,maxc); + geom::AlignedCuboid bb(minc,maxc); + return use_tf ? transform_.Apply(bb) : bb; } void PrimList::ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc, diff --git a/modules/gfx/src/prim_list.hh b/modules/gfx/src/prim_list.hh index afc999a7febc930495d2f7620c7795295293be42..80eabe333a1b9264da03f015d1f423905aa36f56 100644 --- a/modules/gfx/src/prim_list.hh +++ b/modules/gfx/src/prim_list.hh @@ -61,7 +61,7 @@ class DLLEXPORT_OST_GFX PrimList: public GfxObj /// \brief create new prim list PrimList(const String& name); - virtual geom::AlignedCuboid GetBoundingBox() const; + virtual geom::AlignedCuboid GetBoundingBox(bool use_tf=true) const; virtual void ProcessLimits(geom::Vec3& minc, geom::Vec3& maxc, const geom::Transform& tf) const;