![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2006 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: intersectionRecord.h,v $ $Revision: 1.2 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef intersectionRecord_H_ 00009 #define intersectionRecord_H_ 00010 00011 // \file intersectionRecord.h 00012 // \brief DtIntersectionRecord. 00013 #include "geometry/geometryDefines.h" 00014 00015 // \brief Base class for all terrain intersection records. 00016 class DT_DLL_geometry DtIntersectionRecord 00017 { 00018 public: 00019 00020 // The type of intersection record. 00021 enum DtRecordType 00022 { 00023 // base class, simple true or false if there's an intersection 00024 BASE_TYPE = 0, 00025 // uses a chord for the intersection check, can return intersection points, normals, surfaces 00026 // not terrain implementation assumed 00027 CHORD_TYPE = 1, 00028 // uses a chord for the intersection check, can return intersection points, normals, surfaces 00029 // Gdb terrain implementation assumed and therefore can also return intersection polygons 00030 GDBCHORD_TYPE = 2, 00031 // uses a sphere for the intersection check, can return intersection points, normals, surfaces 00032 // not terrain implementation assumed 00033 SPHERE_TYPE = 3, 00034 // uses a sphere for the intersection check, can return intersection points, normals, surfaces 00035 // Gdb terrain implementation assumed and therefore can also return intersection polygons 00036 GDBSPHERE_TYPE = 4 00037 }; 00038 00039 // The Intersection Type flag indicates the kind of data requested from 00040 // a call to one of the intersect functions. Bit operators can be used on these enumerations. 00041 enum DtIntersectionType 00042 { 00043 // INT_EXISTS returns only a bool indication that an intersection was 00044 // found. 00045 INT_EXISTS = 0, 00046 00047 // INT_POINT is like INT_EXISTS, but also returns the closest intersection 00048 // point as a DtPoint, the associated "time" value, and the 00049 // surface type. 00050 INT_POINT = 0x01, 00051 00052 // INT_NORMAL is like INT_EXISTS, but also returns the normal as a 00053 // DtWorldCoordVector. 00054 INT_NORMAL = 0x02, 00055 00056 // INT_RESERVED is currently reserved for an internal intersection call. 00057 INT_RESERVED = 0x04, 00058 00059 // INT_ALL_DATA requests that all possible data be returned from the terrain node 00060 INT_ALL_DATA = 0x07 00061 }; 00062 00063 DtIntersectionRecord(); 00064 virtual ~DtIntersectionRecord(); 00065 00066 // copy constructor 00067 DtIntersectionRecord(const DtIntersectionRecord& orig); 00068 00069 // assignment operator 00070 DtIntersectionRecord& operator=(const DtIntersectionRecord& orig); 00071 00072 // clone this object 00073 virtual DtIntersectionRecord* clone() const; 00074 00075 // The type of record used for the intersection query. Returns 00076 // BASE_TYPE 00077 virtual DtRecordType type() const; 00078 00079 // debugging aid 00080 virtual void dump() const; 00081 00082 bool intersectionFound() const; 00083 void setIntersectionFound(bool arg); 00084 00085 protected: 00086 bool myIntersectionFound; 00087 00088 }; 00089 00090 inline bool DtIntersectionRecord::intersectionFound() const 00091 { 00092 return myIntersectionFound; 00093 } 00094 00095 inline void DtIntersectionRecord::setIntersectionFound(bool arg) 00096 { 00097 myIntersectionFound = arg; 00098 } 00099 #endif