PLaSK library
Loading...
Searching...
No Matches
plask::BoundingBoxCache< dims > Struct Template Reference

Lazy cache of object bounding box. More...

#include <plask/geometry/utils.hpp>

Public Types

typedef Primitive< dims >::Box BoundingBoxT
 

Public Member Functions

const BoundingBoxToperator() ()
 Get bounding box of connected object.
 
void onObjectChanged (const GeometryObject::Event &evt)
 Refresh bounding box cache.
 
void setObject (GeometryObjectD< dims > *object)
 Set object for which bounding box should be cached.
 
void setObject (GeometryObjectD< dims > &object)
 Set object for which bounding box should be cached.
 
void setObject (shared_ptr< GeometryObjectD< dims > > object)
 Set object for which bounding box should be cached.
 
GeometryObjectD< dims > * getObject () const
 Get object for which bounding box is cached.
 
 BoundingBoxCache (GeometryObjectD< dims > *object=0)
 Construct bounding box cache connected with given object.
 
 BoundingBoxCache (GeometryObjectD< dims > &object)
 Construct bounding box cache connected with given object.
 
 BoundingBoxCache (shared_ptr< GeometryObjectD< dims > > object)
 Construct bounding box cache connected with given object.
 
 ~BoundingBoxCache ()
 

Detailed Description

template<int dims>
struct plask::BoundingBoxCache< dims >

Lazy cache of object bounding box.

Definition at line 30 of file utils.hpp.

Member Typedef Documentation

◆ BoundingBoxT

template<int dims>
typedef Primitive<dims>::Box plask::BoundingBoxCache< dims >::BoundingBoxT

Definition at line 32 of file utils.hpp.

Constructor & Destructor Documentation

◆ BoundingBoxCache() [1/3]

template<int dims>
plask::BoundingBoxCache< dims >::BoundingBoxCache ( GeometryObjectD< dims > *  object = 0)
inline

Construct bounding box cache connected with given object.

Parameters
objectobject for which bounding box should be cached, can be nullptr (typically you should later call setObject in such cache)

Definition at line 97 of file utils.hpp.

◆ BoundingBoxCache() [2/3]

template<int dims>
plask::BoundingBoxCache< dims >::BoundingBoxCache ( GeometryObjectD< dims > &  object)
inline

Construct bounding box cache connected with given object.

Parameters
objectobject for which bounding box should be cached

Definition at line 105 of file utils.hpp.

◆ BoundingBoxCache() [3/3]

template<int dims>
plask::BoundingBoxCache< dims >::BoundingBoxCache ( shared_ptr< GeometryObjectD< dims > >  object)
inline

Construct bounding box cache connected with given object.

Parameters
objectobject for which bounding box should be cached

Definition at line 113 of file utils.hpp.

◆ ~BoundingBoxCache()

template<int dims>
plask::BoundingBoxCache< dims >::~BoundingBoxCache ( )
inline

Definition at line 117 of file utils.hpp.

Member Function Documentation

◆ getObject()

template<int dims>
GeometryObjectD< dims > * plask::BoundingBoxCache< dims >::getObject ( ) const
inline

Get object for which bounding box is cached.

Returns
object for which bounding box is cached or nullptr if bounding box is not cached, for any object

Definition at line 89 of file utils.hpp.

◆ onObjectChanged()

template<int dims>
void plask::BoundingBoxCache< dims >::onObjectChanged ( const GeometryObject::Event evt)

Refresh bounding box cache.

Called by object changed signal.

Parameters
evt

Definition at line 36 of file utils.cpp.

◆ operator()()

Get bounding box of connected object.

Read it from cache if it's possible or update cache.

Returns
bounding box of connected object
Exceptions
Exceptionif no object is connected

Definition at line 25 of file utils.cpp.

◆ setObject() [1/3]

template<int dims>
void plask::BoundingBoxCache< dims >::setObject ( GeometryObjectD< dims > &  object)
inline

Set object for which bounding box should be cached.

Parameters
objectobject for which bounding box should be cached

Definition at line 73 of file utils.hpp.

◆ setObject() [2/3]

template<int dims>
void plask::BoundingBoxCache< dims >::setObject ( GeometryObjectD< dims > *  object)

Set object for which bounding box should be cached.

Parameters
objectobject for which bounding box should be cached, can be nullptr to disconnect

Definition at line 47 of file utils.cpp.

◆ setObject() [3/3]

template<int dims>
void plask::BoundingBoxCache< dims >::setObject ( shared_ptr< GeometryObjectD< dims > >  object)
inline

Set object for which bounding box should be cached.

Parameters
objectobject for which bounding box should be cached

Definition at line 81 of file utils.hpp.


The documentation for this struct was generated from the following files: