source: GTP/trunk/Lib/Vis/Preprocessing/src/KdIntersectable.h @ 1139

Revision 1139, 1.3 KB checked in by mattausch, 18 years ago (diff)
Line 
1#ifndef __KDINTERSECTABLE_H
2#define __KDINTERSECTABLE_H
3
4#include "AxisAlignedBox3.h"
5#include "Intersectable.h"
6
7
8namespace GtpVisibilityPreprocessor {
9
10struct VssRayContainer;
11class KdNode;
12
13/**
14        Wrapper for Kd nodes for use in a PVS.
15*/
16class KdIntersectable: public Intersectable
17{
18public:
19        KdIntersectable(KdNode *node);
20
21        /** Returns 'mesh' associated with this instance.
22        */
23        KdNode *GetNode() const;
24
25        /** See get.
26        */
27        void SetNode(KdNode *node);
28
29
30        //-- inherited functions from Intersectable
31
32        AxisAlignedBox3 GetBox() const;
33       
34        int CastRay(Ray &ray);
35       
36        bool IsConvex() const;
37        bool IsWatertight() const;
38        float IntersectionComplexity();
39 
40        int NumberOfFaces() const;
41        int Type() const;
42
43        int GetRandomSurfacePoint(GtpVisibilityPreprocessor::Vector3 &point,
44                                                          GtpVisibilityPreprocessor::Vector3 &normal);
45
46        int GetRandomVisibleSurfacePoint(GtpVisibilityPreprocessor::Vector3 &point,
47                                                                         GtpVisibilityPreprocessor::Vector3 &normal,
48                                                                         const GtpVisibilityPreprocessor::Vector3 &viewpoint,
49                                                                         const int maxTries);
50 
51        ostream &Describe(ostream &s);
52       
53
54        /** Pointer to kd leaf object that was hit during ray casting.
55        */
56        Intersectable *mHitObject;
57
58protected:
59       
60        KdNode *mNode;
61};
62
63
64}
65
66#endif
Note: See TracBrowser for help on using the repository browser.