VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
terrainReaderFactory.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2003 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: terrainReaderFactory.h,v $ $Revision: 1.11 $ $State: Exp $
7 *******************************************************************************/
8 #ifndef terrainReaderFactory_H_
9 #define terrainReaderFactory_H_
10 
11 //
12 // \file terrainReaderFactory.h
13 // \brief Contains the DtTerrainReaderFactory class declaration and related typedefs.
14 //
15 
17 #include <vlutil/vlConfig.h>
18 #include <map>
19 #include <vlutil/vlString.h>
20 #include <vlutil/vlFilename.h>
21 #include <vlutil/vlList.h>
22 
23 class DtTerrainDatabase;
24 class DtTerrainReader;
25 class DtMetafileRecord;
27 
28 //
29 // DtTerrainReaderFactory contains a container of DtTerrainFactoryEntry creators,
30 // indexed by the DtString type that represents the type of file able to load.
31 // It is used to dynamically create the type of terrain reader that is desired.
33 {
34 public:
35  typedef DtTerrainReader* (*DtTerrainReaderCreatorFcn)();
36  typedef std::map<DtString, DtTerrainReaderCreatorFcn> DtTerrainReaderCreatorContainer;
37 
38 
39 private:
40  // Default constructor not available
42 
43 public:
44  // constructor
46 
47  // copy constructor
49 
50  // assignment operator
51  const DtTerrainReaderFactory& operator=(const DtTerrainReaderFactory& orig);
52 
53  // Destructor: deletes factory and any entries on the factory.
54  virtual ~DtTerrainReaderFactory();
55 
56  virtual void setMetafileFactory(DtTdbMetafileFactory* factory);
57  virtual DtTdbMetafileFactory* metafileFactory();
58  virtual const DtTdbMetafileFactory* metafileFactory() const;
59 
60  // Registers all the default terrain readers with the factory.
61  virtual void init();
62 
63  // Registers a creator associated with the specified type with the factory.
64  virtual void registerTerrainReaderCreator(const DtString &type,
65  DtTerrainReaderCreatorFcn fcn);
66 
67  // \return A DtTerrainReader of the specified type, OR 0 if the type is unknown.
68  virtual DtTerrainReader* createTerrainReader(const DtString &type);
69 
70  static DtTerrainReaderFactory* create();
71 
72  virtual bool loadTerrain(const DtFilename& fileName, DtTerrainDatabase* terrain,
73  const DtList& searchPaths);
74 
75 protected:
76 
77  virtual bool loadTerrain(const DtFilename& fileName, DtTerrainDatabase* terrain);
78 
81 };
82 
83 #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)