VR-Forces 5.0.1 Developer's Guide
 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 
12 
13 #pragma once
14 
15 #include <vrvCore/DtIntersector.h>
17 #include <boost/unordered_map.hpp>
18 
19 #include <matrix/vlVector.h>
20 #include <map>
21 
22 namespace makVrv
23 {
29  {
30  public:
33 
35  virtual ~DtIntersectorCache();
36 
39  void setCacheLimit(int);
40  int cacheLimit() const;
41 
43  virtual bool cachedPointResult(DtIntersector::IntersectProperties p,
44  DtIntersector::DynamicOceanProperties op, double x, double y, double z,
46 
48  virtual void addCachedPointResult(
50  DtIntersector::DynamicOceanProperties op, double x, double y,
51  double z, const DtIntersector::DtIntersections&);
52 
54  virtual bool cachedLineResult(DtIntersector::IntersectProperties p,
56  double x, double y, double z, double end_x, double end_y, double end_z,
58 
60  virtual void addCachedLineResult(
62  DtIntersector::DynamicOceanProperties op, double x, double y,
63  double z, double end_x, double end_y, double end_z,
65 
67  virtual void clear();
68 
69  protected:
72  typedef std::pair<DtIntersector::DtIntersections, int> PointInformation;
73  typedef boost::unordered_map<std::size_t, PointInformation> PointCache;
74 
76  typedef std::vector<std::size_t> KeyVector;
77  typedef std::map<int, KeyVector> CacheEntries;
78 
79  virtual void addToCache(const DtIntersectorCacheKey&);
80  virtual void updateCache(PointCache::iterator&);
81 
83  virtual void removeFromCache();
84 
85  protected:
88 
89  unsigned int myCacheLimit;
90  unsigned int myTotalCacheSize;
91  };
92 }
IntersectProperties
The IntersectProperties enum is a flag set that indicates the types of nodes to be considered for int...
Definition: DtIntersector.h:31
unsigned int myTotalCacheSize
Definition: DtIntersectorCache.h:90
std::vector< DtIntersectorResult > DtIntersections
A vector of DtIntersectionRecords.
Definition: DtIntersector.h:50
unsigned int myCacheLimit
Definition: DtIntersectorCache.h:89
std::map< int, KeyVector > CacheEntries
Definition: DtIntersectorCache.h:77
the Intersector Cache class. Use to store intersection and intersection results. Can only be used to ...
Definition: DtIntersectorCache.h:28
DynamicOceanProperties
Definition: DtIntersector.h:42
Class that will be used to translate positions into a quick lookup key for cached intersections...
Definition: DtIntersectorCacheKey.h:24
std::vector< std::size_t > KeyVector
Use the ordered map to ensure least used gets taken away first.
Definition: DtIntersectorCache.h:76
boost::unordered_map< std::size_t, PointInformation > PointCache
Definition: DtIntersectorCache.h:73
Contains makVrv:DtIntersector class.
PointCache myPointCache
Definition: DtIntersectorCache.h:86
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
CacheEntries myCacheEntries
Definition: DtIntersectorCache.h:87
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:72

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)