tools/NavGenProj/include/NavGenProjClientInput.h Source File

NavGenProjClientInput.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 
9 
10 
11 
12 // primary contact: LASI - secondary contact: MAMU
13 #ifndef GwNavGen_NavGenProjClientInput_H
14 #define GwNavGen_NavGenProjClientInput_H
15 
16 #include "tinyxml.h"
17 #include <string>
18 #include "NavGenProj.h"
19 
20 namespace Kaim
21 {
22 
27 {
28 public:
30  {
31  Clear();
32  }
33 
34  void Clear()
35  {
36  m_fileName = "";
37  }
38 
39  void SetFileName(std::string inputFileName)
40  {
41  m_fileName = inputFileName;
42  }
43 
44  std::string FileType()
45  {
46  std::string fileType = "ClientInput";
47  return fileType;
48  }
49 
50  bool Read(TiXmlNode* node)
51  {
52  TiXmlNode* child;
53  for (child = node->FirstChild(); child != 0; child = child->NextSibling())
54  {
55  NavGenProj::GetParam(child, "filepath", m_fileName);
56 
57  //deprecated fields:
58  ReadDeprecatedParam(child);
59  }
60  return true;
61  }
62 
63  bool Write(TiXmlNode* node)
64  {
65  TiXmlNode* inputsFolderNode = NavGenProj::GetOrCreateFolderNode(node, "clientInputs");
66 
67  TiXmlElement* clientInputNode = new TiXmlElement("clientInput");
68  inputsFolderNode->LinkEndChild(clientInputNode);
69 
70  TiXmlElement* filePathNode = new TiXmlElement("filepath");
71  clientInputNode->LinkEndChild(filePathNode);
72  TiXmlText* text = new TiXmlText(m_fileName.c_str());
73  filePathNode->LinkEndChild(text);
74 
75  return true;
76  }
77 
78 private:
79  void ReadDeprecatedParam(TiXmlNode* child)
80  {
81  bool tmp;
82  if(NavGenProj::GetParam(child, "useOnlyGeometry", tmp))
83  KY_LOG_WARNING(("[useOnlyGeometry] is deprecated"));
84  if(NavGenProj::GetParam(child, "counterClockWise", tmp))
85  KY_LOG_WARNING(("[counterClockWise] is deprecated"));
86  }
87 
88 public:
89  std::string m_fileName;
90 };
91 
92 }
93 
94 
95 #endif
An instance of this class is used to represent each input geometry file in a NavGenProj.
Definition: NavGenProjClientInput.h:26
Definition: gamekitcrowddispersion.h:20