VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtIntersectorCache Class Reference

the Intersector Cache class. Use to store intersection and intersection results. Can only be used to cache intersection results (line or point)

Public Member Functions

 DtIntersectorCache ()
 
virtual ~DtIntersectorCache ()
 
void setCacheLimit (int)
 
int cacheLimit () const
 
virtual bool cachedPointResult (DtIntersector::IntersectProperties p, DtIntersector::DynamicOceanProperties op, double x, double y, double z, DtIntersector::DtIntersections &)
 
virtual void addCachedPointResult (DtIntersector::IntersectProperties p, DtIntersector::DynamicOceanProperties op, double x, double y, double z, const DtIntersector::DtIntersections &)
 
virtual bool cachedLineResult (DtIntersector::IntersectProperties p, DtIntersector::DynamicOceanProperties op, double x, double y, double z, double end_x, double end_y, double end_z, DtIntersector::DtIntersections &)
 
virtual void addCachedLineResult (DtIntersector::IntersectProperties p, DtIntersector::DynamicOceanProperties op, double x, double y, double z, double end_x, double end_y, double end_z, const DtIntersector::DtIntersections &)
 
virtual void clear ()
 

Protected Types

typedef std::pair
< DtIntersector::DtIntersections,
int
PointInformation
 
typedef boost::unordered_map
< std::size_t,
PointInformation
PointCache
 
typedef std::vector< std::size_t > KeyVector
 
typedef std::map< int, KeyVectorCacheEntries
 

Protected Member Functions

virtual void addToCache (const DtIntersectorCacheKey &)
 
virtual void updateCache (PointCache::iterator &)
 
virtual void removeFromCache ()
 

Protected Attributes

PointCache myPointCache
 
CacheEntries myCacheEntries
 
unsigned int myCacheLimit
 
unsigned int myTotalCacheSize
 

Member Typedef Documentation

In a single point cache, there is only one map that contains all possible end points.

typedef boost::unordered_map<std::size_t, PointInformation> makVrv::DtIntersectorCache::PointCache
protected
typedef std::vector<std::size_t> makVrv::DtIntersectorCache::KeyVector
protected

Use the ordered map to ensure least used gets taken away first.

Constructor & Destructor Documentation

makVrv::DtIntersectorCache::DtIntersectorCache ( )

CTOR.

virtual makVrv::DtIntersectorCache::~DtIntersectorCache ( )
virtual

DTOR.

Member Function Documentation

void makVrv::DtIntersectorCache::setCacheLimit ( int  )

Sets the number of items than can be in the cache at any given time. 0 or less means that there is no limit.

int makVrv::DtIntersectorCache::cacheLimit ( ) const
virtual bool makVrv::DtIntersectorCache::cachedPointResult ( DtIntersector::IntersectProperties  p,
DtIntersector::DynamicOceanProperties  op,
double  x,
double  y,
double  z,
DtIntersector::DtIntersections  
)
virtual

Retrieve the cache results of a single point intersection test.

virtual void makVrv::DtIntersectorCache::addCachedPointResult ( DtIntersector::IntersectProperties  p,
DtIntersector::DynamicOceanProperties  op,
double  x,
double  y,
double  z,
const DtIntersector::DtIntersections  
)
virtual

Add the results of a single point intersection text.

virtual bool makVrv::DtIntersectorCache::cachedLineResult ( DtIntersector::IntersectProperties  p,
DtIntersector::DynamicOceanProperties  op,
double  x,
double  y,
double  z,
double  end_x,
double  end_y,
double  end_z,
DtIntersector::DtIntersections  
)
virtual

Retrieve cached results of a line intersection test.

virtual void makVrv::DtIntersectorCache::addCachedLineResult ( DtIntersector::IntersectProperties  p,
DtIntersector::DynamicOceanProperties  op,
double  x,
double  y,
double  z,
double  end_x,
double  end_y,
double  end_z,
const DtIntersector::DtIntersections  
)
virtual

Add results of a line intersection test.

virtual void makVrv::DtIntersectorCache::clear ( )
virtual

Clear out all results.

virtual void makVrv::DtIntersectorCache::addToCache ( const DtIntersectorCacheKey )
protectedvirtual
virtual void makVrv::DtIntersectorCache::updateCache ( PointCache::iterator &  )
protectedvirtual
virtual void makVrv::DtIntersectorCache::removeFromCache ( )
protectedvirtual

Removes least used item from cache.

Member Data Documentation

PointCache makVrv::DtIntersectorCache::myPointCache
protected
CacheEntries makVrv::DtIntersectorCache::myCacheEntries
protected
unsigned int makVrv::DtIntersectorCache::myCacheLimit
protected
unsigned int makVrv::DtIntersectorCache::myTotalCacheSize
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)