VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
propShapefileCreateHandler.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2018 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #pragma once
7 
10 #include <vlutil/vlFilename.h>
11 
12 #include <map>
13 #include <string>
14 
15 namespace makVrv
16 {
17  class DtDe;
18  class DtUnicode;
19 }
20 
21 namespace makArchives
22 {
23  class DtPropRecord;
24  class DtTerrainRecord;
25  class DtPropSettingsRecord;
26 }
27 
28 class OGRLayer;
29 class GDALDriver;
30 class GDALDataset;
31 
32 namespace makVrf
33 {
36  {
37  public:
40 
43 
44  static DtPropShapefileCreateHandler& instance(makVrv::DtDe& de);
45  static void registerInstance(makVrv::DtDe& de, DtPropShapefileCreateHandler*);
46 
49  virtual const DtFilename& exportTo() const;
50  virtual void setExportToDirectory(const DtFilename&);
51 
53  virtual const DtFilename& propInformationFilename() const;
54  virtual void setPropInformationFilename(const DtFilename&);
55 
58  virtual bool exportPropsToShapefile(const std::string&, makVrv::DtUnicode& sError, DtString& filesCreated) const;
59 
60  protected:
61  typedef struct PropInformation
62  {
63  double length;
64  double width;
65  double height;
66  int fidCode;
68 
69  typedef std::map<std::string, PropInformation> PropInformationMap;
70 
71  virtual PropInformationMap readPropInformation(const DtFilename&) const;
72 
73  virtual void addPropRecords(const std::vector<makArchives::DtPropRecord>& propRecords, OGRLayer* poLayer,
74  const PropInformationMap& propInformationMap, const DtFilename& dataRoot, bool forSpeedTree) const;
75 
76  virtual DtFilename modelDefinitionFilename(const std::string& modelDefinition, const DtFilename& dataRoot,
77  bool& isSpeedtree) const;
78 
79  virtual bool createBuildingsShapefile(const makArchives::DtTerrainRecord&, const PropInformationMap&, const DtFilename& relativePath,
80  GDALDriver*, const DtFilename&, makVrv::DtUnicode& sError, bool& haveSome) const;
81  virtual bool createSpeedTreeShapefile(const makArchives::DtTerrainRecord&, const PropInformationMap&, const DtFilename& relativePath,
82  GDALDriver*, const DtFilename&, makVrv::DtUnicode& sError, bool& haveSome) const;
83  virtual void removeSourceFiles(const DtFilename&, const std::string& type) const;
84 
85  virtual GDALDataset* createDataSource(GDALDriver*, const DtFilename&, const std::string& type, makVrv::DtUnicode& sError) const;
86  virtual OGRLayer* createLayer(GDALDataset*, bool forSpeedTree, makVrv::DtUnicode& sError) const;
87 
88  virtual bool hasBuildings(const makArchives::DtTerrainRecord& terrainRecord, const DtFilename&) const;
89  virtual bool hasSpeedTrees(const makArchives::DtTerrainRecord& terrainRecord, const DtFilename&) const;
90 
91  virtual bool hasBuildings(const makArchives::DtPropSettingsRecord& records, const DtFilename& dataRoot) const;
92  virtual bool hasSpeedTrees(const makArchives::DtPropSettingsRecord& records, const DtFilename& dataRoot) const;
93 
94  protected:
95  DtFilename myExportToDirectory;
98  };
99 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
int fidCode
Definition: propShapefileCreateHandler.h:66
Handler for looking at all the props in the system and translating them into shapefile point features...
Definition: propShapefileCreateHandler.h:35
DtFilename myExportToDirectory
Definition: propShapefileCreateHandler.h:95
DtFilename myPropInformationFilename
Definition: propShapefileCreateHandler.h:96
#define DT_DLL_VRFGUICORE
Contains DLL export macros.
Definition: vrfGuiCore.h:25
double width
Definition: propShapefileCreateHandler.h:64
A DtPropSettingsRecord contains the information to restore settings for all scene props...
Definition: DtPropSettingsRecord.h:20
Contains makVrv::DtVirtualBaseClass class.
Record of a VR-Vantage terrain Contains: Terrain coordinate system Terrain patches Feature layers Ter...
Definition: DtTerrainRecord.h:29
Definition: propShapefileCreateHandler.h:61
makVrv::DtDe & myDe
Definition: propShapefileCreateHandler.h:97
double length
Definition: propShapefileCreateHandler.h:63
std::map< std::string, PropInformation > PropInformationMap
Definition: propShapefileCreateHandler.h:69
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
double height
Definition: propShapefileCreateHandler.h:65

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)