VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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/vrvCore.h>
19 #include <vrvCore/DtIntersector.h>
21 #include <boost/unordered_map.hpp>
22 
23 #include <matrix/vlVector.h>
24 #include <map>
25 
26 namespace makVrv
27 {
33  {
34  public:
37 
39  virtual ~DtIntersectorCache();
40 
43  void setCacheLimit(int);
44  int cacheLimit() const;
45 
47  virtual bool cachedPointResult(DtIntersector::IntersectProperties p,
48  DtIntersector::DynamicOceanProperties op, double x, double y, double z,
50 
52  virtual void addCachedPointResult(
54  DtIntersector::DynamicOceanProperties op, double x, double y,
55  double z, const DtIntersector::DtIntersections&);
56 
58  virtual bool cachedLineResult(DtIntersector::IntersectProperties p,
60  double x, double y, double z, double end_x, double end_y, double end_z,
62 
64  virtual void addCachedLineResult(
66  DtIntersector::DynamicOceanProperties op, double x, double y,
67  double z, double end_x, double end_y, double end_z,
69 
71  virtual void clear();
72 
73  protected:
76  typedef std::pair<DtIntersector::DtIntersections, int> PointInformation;
77  typedef boost::unordered_map<std::size_t, PointInformation> PointCache;
78 
80  typedef std::vector<std::size_t> KeyVector;
81  typedef std::map<int, KeyVector> CacheEntries;
82 
83  virtual void addToCache(const DtIntersectorCacheKey&);
84  virtual void updateCache(PointCache::iterator&);
85 
87  virtual void removeFromCache();
88 
89  protected:
92 
93  unsigned int myCacheLimit;
94  unsigned int myTotalCacheSize;
95  };
96 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)