VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
geometry
ssSphereIntersector.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2005 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
/******************************************************************************
6
** $RCSfile: ssSphereIntersector.h,v $ $Revision: 1.2 $ $State: Exp $
7
******************************************************************************/
8
#ifndef ssShpereIntersector_H_
9
#define ssSphereIntersector_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/sphere.h
"
18
#include "
geometry/point.h
"
19
21
// Note: Must use this macro to get around issues with VC 6.0 vs .Net/gcc.
22
// 6.0 complains if you use the typename qualifier outside of a class definition,
23
// but it is incorrect to not specify that the cell type is a type when using it
24
// as a template parameter.
26
#ifdef DtSPATIAL_SUB_CELL_TYPE
27
#undef DtSPATIAL_SUB_CELL_TYPE
28
#endif
29
30
#if _MSC_VER == 1200 // Visual Studio 6.0
31
#define DtSPATIAL_SUB_CELL_TYPE DtSpatialSubdivision< T >::DtSpatialSubCellType
32
#else
33
#define DtSPATIAL_SUB_CELL_TYPE typename DtSpatialSubdivision< T >::DtSpatialSubCellType
34
#endif
35
36
37
38
//
39
// The DtSsSphereIntersector is *solely* responsible for intersecting a DtSphere and a
40
// DtSpatialSubdivision together. It does not know what to do with the intersection
41
// results, nor does it rely on the specific contents of the spatial subdivision.
42
//
43
// This is one of the basic SS intersection classes provided by the toolkit.
44
//
45
template
<
typename
T>
46
class
DtSsSphereIntersector
47
{
48
public
:
49
50
// Constructor
51
DtSsSphereIntersector
();
52
53
// Destructor
54
virtual
~DtSsSphereIntersector
();
55
56
// Intersects the specified chord and spatial subdivision together.
57
// @returns A boolean indicating whether or not the chord intersected the
58
// spatial subdivision at all.
59
// @note Technically, this returns true if the chord's @b extent intersects
60
// the spatial subdivision at all. It does not do a true mathematical
61
// intersection of the chord and the SS.
62
virtual
bool
intersect
(
const
DtSphere
& sphere,
DtSpatialSubdivision< T >
& spatialSubdivision)
const
;
63
64
// Intersects the specified chord 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 chord 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
// @note Unlike the above intersection function, this function only returns
73
// true if the chord intersected the SS, not just the chord's extent. And the
74
// functor is applied to the cells in the SS in the order that the chord intersects
75
// them.
76
//
77
virtual
bool
intersect
(
const
DtSphere
& sphere,
78
DtSpatialSubdivision< T >
& spatialSubdivision,
79
DtSsFunctor<const DtSphere, DtSPATIAL_SUB_CELL_TYPE >
& functor)
const
;
80
81
private
:
82
// Copy constructor & Assignment operator - not implemented
83
DtSsSphereIntersector
(
const
DtSsSphereIntersector
& orig);
84
DtSsSphereIntersector
&
operator=
(
const
DtSsSphereIntersector
& orig);
85
86
};
87
88
#define SSSPHEREINTERSECTOR_HEADER
89
#include "geometry/ssSphereIntersector.inl"
90
#undef SSSPHEREINTERSECTOR_HEADER
91
92
#ifdef DtSPATIAL_SUB_CELL_TYPE
93
#undef DtSPATIAL_SUB_CELL_TYPE
94
#endif
95
96
#endif
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)