VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
geometry
ssExtentIntersector.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2005 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
/******************************************************************************
6
** $RCSfile: ssExtentIntersector.h,v $ $Revision: 1.8 $ $State: Exp $
7
******************************************************************************/
8
#ifndef ssExtentIntersector_H_
9
#define ssExtentIntersector_H_
10
11
#include <vlutil/vlConfig.h>
12
#include <vlutil/vlPrint.h>
13
14
#include "
geometry/spatialSubdivision.h
"
15
#include "
geometry/ssFunctor.h
"
16
17
#include "
geometry/chord.h
"
18
#include "
geometry/point.h
"
19
#include "
geometry/plane.h
"
20
#include "
geometry/extent.h
"
21
23
// Note: Must use this macro to get around issues with VC 6.0 vs .Net/gcc.
24
// 6.0 complains if you use the typename qualifier outside of a class definition,
25
// but it is incorrect to not specify that the cell type is a type when using it
26
// as a template parameter.
28
#ifdef DtSPATIAL_SUB_CELL_TYPE
29
#undef DtSPATIAL_SUB_CELL_TYPE
30
#endif
31
32
#if _MSC_VER == 1200 // Visual Studio 6.0
33
#define DtSPATIAL_SUB_CELL_TYPE DtSpatialSubdivision< T >::DtSpatialSubCellType
34
#else
35
#define DtSPATIAL_SUB_CELL_TYPE typename DtSpatialSubdivision< T >::DtSpatialSubCellType
36
#endif
37
38
39
40
//
41
// The DtSsExtentIntersector is *solely* responsible for intersecting a DtExtent and a
42
// DtSpatialSubdivision together.
43
// It does not know what to do with the intersection results, other than apply the
44
// functor, nor does it rely on the specific contents of the spatial subdivision.
45
//
46
// This is one of the basic SS intersection classes provided by the toolkit.
47
//
48
template
<
typename
T>
49
class
DtSsExtentIntersector
50
{
51
public
:
52
53
// Constructor
54
DtSsExtentIntersector
();
55
56
// Destructor
57
virtual
~DtSsExtentIntersector
();
58
59
// Intersects the specified extent and spatial subdivision together.
60
// @returns A boolean indicating whether or not the extent intersected the
61
// spatial subdivision at all.
62
virtual
bool
intersect
(
const
DtExtent
& extent,
DtSpatialSubdivision< T >
& spatialSubdivision)
const
;
63
64
// Intersects the specified extent and spatial subdivision together. Applies
65
// the functor to the intersection results, in order, until the functor
66
// is done processing (returns true).
67
//
68
// @returns A boolean indicating whether or not the extent intersected the
69
// spatial subdivision or not. Has nothing to do with the functor's success
70
// or failure in its own processing.
71
//
72
virtual
bool
intersect
(
const
DtExtent
& extent,
73
DtSpatialSubdivision< T >
& spatialSubdivision,
74
DtSsFunctor<const DtExtent, DtSPATIAL_SUB_CELL_TYPE >
& functor)
const
;
75
76
// This is provided to account for functors that take the template parameter
77
// to the spatial subdivision as the first parameter (such as insertion functors)
78
// rather than the intersection primitive, such as intersection functors
79
//
80
// @note All objects to intersect passed to this function @b must support the
81
// expandExtent() function, so the intersector can determine the extent to use
82
// for performing the intersection.
83
virtual
bool
intersect
(T& objectToIntersect,
84
DtSpatialSubdivision< T >
& spatialSubdivision,
85
DtSsFunctor<T, DtSPATIAL_SUB_CELL_TYPE >
& functor)
const
;
86
87
// Provides the minimum and maximum indices (X,Y,Z) of the cells comprising
88
// the intersection of the extent and the spatial subdivision.
89
//
90
// @returns a boolean indicating whether or not there is an intersection.
91
// @note If there is no intersection, the index values are undetermined.
92
virtual
bool
getIndices
(
const
DtExtent
& extent,
93
const
DtSpatialSubdivision< T >
& spatialSubdivision,
int
& minXIndex,
94
int
& minYIndex,
int
& minZIndex,
int
& maxXIndex,
int
& maxYIndex,
int
& maxZIndex)
const
;
95
96
private
:
97
// Copy constructor & Assignment operator - not implemented
98
DtSsExtentIntersector
(
const
DtSsExtentIntersector
& orig);
99
DtSsExtentIntersector
&
operator=
(
const
DtSsExtentIntersector
& orig);
100
101
private
:
102
103
};
104
105
// Include the inline code
106
#define SSEXTENTINTERSECTOR_HEADER
107
#include "geometry/ssExtentIntersector.inl"
108
#undef SSEXTENTINTERSECTOR_HEADER
109
110
#ifdef DtSPATIAL_SUB_CELL_TYPE
111
#undef DtSPATIAL_SUB_CELL_TYPE
112
#endif
113
114
#endif
115
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)