![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1999 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: vectorDataFactory.h,v $ $Revision: 1.9 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef vectorDataFactory_H_ 00009 #define vectorDataFactory_H_ 00010 00011 // 00012 // \file vectorDataFactory.h 00013 // \brief Contains the DtVectorDataFactory class declaration. 00014 // 00015 00016 #include "terrainDbFactory/terrainDbFactoryDefines.h" 00017 #include <vlutil/vlFilename.h> 00018 #include <vlutil/vlList.h> 00019 #include <map> 00020 00021 class DtTdbMetafileFactory; 00022 class DtTerrainDatabase; 00023 class DtVectorDataReader; 00024 00025 00026 // 00027 // Instances of this class used as factories to create the vector data metafile 00028 // records used when loading supported vector files through .map files. The metafile 00029 // records are created from entries in the .map terrain files, and are used to 00030 // initialize the vector data importer initializers. 00031 class DT_DLL_terrainDbFactory DtVectorDataFactory 00032 { 00033 public: 00034 00035 typedef DtVectorDataReader* (*DtVectorDataCreator)(); 00036 typedef std::map<DtString, DtVectorDataCreator> DtVectorDataCreatorContainer; 00037 00038 00039 // constructor 00040 DtVectorDataFactory(DtTdbMetafileFactory* factory); 00041 00042 // copy constructor 00043 DtVectorDataFactory(const DtVectorDataFactory& orig); 00044 00045 // assignment operator 00046 const DtVectorDataFactory& operator=(const DtVectorDataFactory& orig); 00047 00048 // Destructor: deletes factory and any entries on the factory. 00049 virtual ~DtVectorDataFactory(); 00050 00051 // registers vector data creators 00052 // register a creator for: 00053 // dfad 00054 // dfd 00055 // shape 00056 // vpf 00057 virtual void init(); 00058 00059 virtual void setMetafileFactory(DtTdbMetafileFactory* factory); 00060 virtual const DtTdbMetafileFactory* metafileFactory() const; 00061 virtual DtTdbMetafileFactory* metafileFactory(); 00062 00063 // Add a creator function to the factory. 00064 virtual void registerVectorDataCreator(const DtString &type, DtVectorDataCreator fcn); 00065 00066 // creator functions callers 00067 virtual DtVectorDataReader* createVectorDataReader(const DtString &type); 00068 00069 // loading functions 00070 virtual bool loadVectorData(const DtFilename& fileName, 00071 DtTerrainDatabase* terrain, const DtList& searchPaths); 00072 00073 static DtVectorDataFactory* create(); 00074 00075 protected: 00076 00077 DtVectorDataFactory(); 00078 00079 virtual bool loadVectorData(const DtFilename& fileName, DtTerrainDatabase* terrain); 00080 00081 DtVectorDataCreatorContainer myVectorCreators; 00082 DtTdbMetafileFactory* myTdbMetafileFactory; 00083 }; 00084 00085 #endif