VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIntersectorCache.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtIntersectorCache.h,v $ $Revision: 1.9 $ $State: Exp $
7 ******************************************************************************/
8 
15 
16 #pragma once
17 
18 #include <vrvCore/DtIntersector.h>
20 #include <boost/unordered_map.hpp>
21 
22 #include <matrix/vlVector.h>
23 #include <map>
24 
25 namespace makVrv
26 {
32  {
33  public:
36 
38  virtual ~DtIntersectorCache();
39 
42  void setCacheLimit(int);
43  int cacheLimit() const;
44 
46  virtual bool cachedPointResult(DtIntersector::IntersectProperties p,
47  DtIntersector::DynamicOceanProperties op, double x, double y, double z,
49 
51  virtual void addCachedPointResult(
53  DtIntersector::DynamicOceanProperties op, double x, double y,
54  double z, const DtIntersector::DtIntersections&);
55 
57  virtual bool cachedLineResult(DtIntersector::IntersectProperties p,
59  double x, double y, double z, double end_x, double end_y, double end_z,
61 
63  virtual void addCachedLineResult(
65  DtIntersector::DynamicOceanProperties op, double x, double y,
66  double z, double end_x, double end_y, double end_z,
68 
70  virtual void clear();
71 
72  protected:
75  typedef std::pair<DtIntersector::DtIntersections, int> PointInformation;
76  typedef boost::unordered_map<std::size_t, PointInformation> PointCache;
77 
79  typedef std::vector<std::size_t> KeyVector;
80  typedef std::map<int, KeyVector> CacheEntries;
81 
82  virtual void addToCache(const DtIntersectorCacheKey&);
83  virtual void updateCache(PointCache::iterator&);
84 
86  virtual void removeFromCache();
87 
88  protected:
91 
92  unsigned int myCacheLimit;
93  unsigned int myTotalCacheSize;
94  };
95 }
IntersectProperties
The IntersectProperties enum is a flag set that indicates the.
Definition: DtIntersector.h:135
unsigned int myTotalCacheSize
Definition: DtIntersectorCache.h:93
std::vector< DtIntersectorResult > DtIntersections
A vector of DtIntersectionRecords.
Definition: DtIntersector.h:154
unsigned int myCacheLimit
Definition: DtIntersectorCache.h:92
std::map< int, KeyVector > CacheEntries
Definition: DtIntersectorCache.h:80
the Intersector Cache class.
Definition: DtIntersectorCache.h:31
DynamicOceanProperties
Definition: DtIntersector.h:146
Class that will be used to translate positions into a quick lookup key for cached intersections...
Definition: DtIntersectorCacheKey.h:27
std::vector< std::size_t > KeyVector
Use the ordered map to ensure least used gets taken away first.
Definition: DtIntersectorCache.h:79
boost::unordered_map< std::size_t, PointInformation > PointCache
Definition: DtIntersectorCache.h:76
Contains makVrv:DtIntersector, makVrv:DtIntersectorLineSegment, and makVrv:DtIntersectorResult classe...
PointCache myPointCache
Definition: DtIntersectorCache.h:89
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
CacheEntries myCacheEntries
Definition: DtIntersectorCache.h:90
std::pair< DtIntersector::DtIntersections, int > PointInformation
In a single point cache, there is only one map that contains all possible end points.
Definition: DtIntersectorCache.h:75

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)