VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrvCore
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
>
20
#include <
vrvCore/DtIntersectorCacheKey.h
>
21
#include <boost/unordered_map.hpp>
22
23
#include <matrix/vlVector.h>
24
#include <map>
25
26
namespace
makVrv
27
{
32
class
DT_DLL_VRVCORE
DtIntersectorCache
33
{
34
public
:
36
DtIntersectorCache
();
37
39
virtual
~
DtIntersectorCache
();
40
43
void
setCacheLimit(
int
);
44
int
cacheLimit()
const
;
45
47
virtual
bool
cachedPointResult(
DtIntersector::IntersectProperties
,
48
double
x,
double
y,
double
z,
49
DtIntersector::DtIntersections
&);
50
52
virtual
void
addCachedPointResult(
53
const
DtIntersector::IntersectProperties
&,
double
x,
double
y,
54
double
z,
const
DtIntersector::DtIntersections
&);
55
57
virtual
bool
cachedLineResult(
DtIntersector::IntersectProperties
,
58
double
x,
double
y,
double
z,
double
end_x,
double
end_y,
double
end_z,
59
DtIntersector::DtIntersections
&);
60
62
virtual
void
addCachedLineResult(
63
const
DtIntersector::IntersectProperties
&,
double
x,
double
y,
64
double
z,
double
end_x,
double
end_y,
double
end_z,
65
const
DtIntersector::DtIntersections
&);
66
68
virtual
void
clear();
69
70
protected
:
73
typedef
std::pair<DtIntersector::DtIntersections, int>
PointInformation
;
74
typedef
boost::unordered_map<std::size_t, PointInformation>
PointCache
;
75
77
typedef
std::vector<std::size_t>
KeyVector
;
78
typedef
std::map<int, KeyVector>
CacheEntries
;
79
80
virtual
void
addToCache(
const
DtIntersectorCacheKey
&);
81
virtual
void
updateCache(PointCache::iterator&);
82
84
virtual
void
removeFromCache();
85
86
protected
:
87
PointCache
myPointCache
;
88
CacheEntries
myCacheEntries
;
89
90
unsigned
int
myCacheLimit
;
91
unsigned
int
myTotalCacheSize
;
92
};
93
}
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)