VR-Forces 4.7 Class Documentation
 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 
8 #include <vrvUtil/signalslib.h>
11 #include <vlutil/vlFilename.h>
12 
13 #include <map>
14 #include <string>
15 
16 namespace makVrv
17 {
18  class DtDe;
19  class DtUnicode;
20 }
21 
22 namespace makArchives
23 {
24  class DtPropRecord;
25  class DtTerrainRecord;
26 }
27 
28 class OGRLayer;
29 class OGRSFDriver;
30 class OGRDataSource;
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  OGRSFDriver*, const DtFilename&, makVrv::DtUnicode& sError, bool& haveSome) const;
81  virtual bool createSpeedTreeShapefile(const makArchives::DtTerrainRecord&, const PropInformationMap&, const DtFilename& relativePath,
82  OGRSFDriver*, const DtFilename&, makVrv::DtUnicode& sError, bool& haveSome) const;
83  virtual void removeSourceFiles(const DtFilename&, const std::string& type) const;
84 
85  virtual OGRDataSource* createDataSource(OGRSFDriver*, const DtFilename&, const std::string& type, makVrv::DtUnicode& sError) const;
86  virtual OGRLayer* createLayer(OGRDataSource*, 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  protected:
92  DtFilename myExportToDirectory;
95  };
96 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)