VR-Forces 4.0.4 Class Documentation
include/gdb/terrainIntersector.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: terrainIntersector.h,v $ $Revision: 1.17 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef terrainIntersector_h
00013 #define terrainIntersector_h
00014 
00015 #include "gdb/gdbDefines.h"
00016 #include "gdb/gdbNode.h"
00017 
00018 class DtTerrainDatabase;
00019 class DtPoint;
00020 class DtChord;
00021 class DtChordIntersectionRecord;
00022 class DtSphereIntersectionRecord;
00023 class DtTerrainIntersectorDescriptor;
00024 
00025 // Common place to keep all current intersector types
00026 const int DtBaseTerrainIntersectorType = 0;
00027 const int DtSpatialSubdivisionTerrainIntersectorType = 1;
00028 const int DtOpcodeTerrainIntersectorType = 2;
00029 
00030 // Abstract base class for intersectors used in a DtTerrainDatabase.
00031 // Subclasses of this interface class implement the actual intersection
00032 // methods for getting intersections with the polygonal terrain data.
00033 class DT_DLL_gdb DtTerrainIntersector
00034 {
00035 private:
00036    // Not implemented.
00037    DtTerrainIntersector();
00038    // Not implemented.
00039    DtTerrainIntersector(const DtTerrainIntersector& orig);
00040    // Not implemented.
00041    DtTerrainIntersector& operator=(const DtTerrainIntersector& orig);
00042 
00043 public:
00044    // Provide the terrain database and descriptor to instantiate a terrain intersector.
00045    // The descriptor is cloned and held internally by the intersector.
00046    DtTerrainIntersector(DtTerrainDatabase* db,
00047       const DtTerrainIntersectorDescriptor* descriptor);
00048    virtual ~DtTerrainIntersector();
00049 
00050    // Called for first time init
00051    virtual bool init() = 0;
00052 
00053    // Called when something has changed about the underlying terrain database and the intersector
00054    // needs to be reinitialized
00055    virtual bool reinitialize() = 0;
00056 
00057    // \return The total number of bytes of memory used by this intersector
00058    // and any of its internal indexing into the terrain.
00059    virtual unsigned int memoryUsage() const = 0;
00060 
00061    virtual int terrainIntersectorType() const = 0;
00062 
00063    virtual bool chordIntersect(const DtChord& chord,
00064       DtChordIntersectionRecord& record,
00065       DtGdbNode::DtIntersectRecordType irtFlag = DtGdbNode::IRT_ALL_DATA_TERRAIN) const = 0;
00066 
00067    virtual bool allIntersectsAlongChord(const DtChord& chord,
00068       DtChordIntersectRecordList& intList,
00069       DtGdbNode::DtIntersectRecordType irtFlag = DtGdbNode::IRT_ALL_DATA_TERRAIN) const = 0;
00070 
00071    virtual bool sphereIntersect(const DtSphere& sphere, DtSphereIntersectionRecord& record,
00072       DtGdbNode::DtIntersectRecordType irtFlag = DtGdbNode::IRT_ALL_DATA_TERRAIN) const = 0;
00073 
00074    virtual DtTerrainDatabase* terrainDatabase() const { return myTerrainDatabase; };
00075    virtual DtTerrainDatabase* terrainDatabase() { return myTerrainDatabase; };
00076 
00077    // \return A pointer to the descriptor used by this intersector.
00078    virtual const DtTerrainIntersectorDescriptor* descriptor() const;
00079 
00080    // Called to return information about this intersector.  Calls down to the descriptor to return the information
00081    virtual void intersectorInformation(DtString& name, DtString& properties) const;
00082 
00083 protected:
00084    DtTerrainDatabase*   myTerrainDatabase;
00085    DtTerrainIntersectorDescriptor* myDescriptor;
00086 };
00087 
00088 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)