VR-Forces 4.6 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 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)