Waterflow
Visualize water in terrain
|
00001 00002 00003 #ifndef XMLPARSING_H 00004 #define XMLPARSING_H 00005 #include "pugixml.h" 00006 #include "flowSource.h" 00007 #include <fstream> 00008 #include <iostream> 00009 #include <sstream> 00010 #include <string> 00011 00014 struct Flood_Fill_data{ 00016 Flood_Fill_data(int, int, float); 00017 int x; 00018 int z; 00019 float height; 00020 }; 00021 00024 struct init_Data_struct { 00026 init_Data_struct(const char* XMLfile); 00027 std::string data_filename; 00028 std::string height_save_path; 00029 std::string height_load_path; 00030 std::string velocity_save_path; 00031 std::string velocity_load_path; 00032 std::vector<FlowSource*> Flowsources; 00033 std::vector<Flood_Fill_data*> FFData; 00034 }; 00035 00039 std::vector<float> fStrToVector(std::string str); 00040 00044 std::vector<int> iStrToVector(std::string str); 00045 00050 void parsePressure(FlowSource* obj, pugi::xml_node pres, pugi::xml_node time); 00051 00055 void parsePosition(FlowSource* obj, pugi::xml_node node); 00056 00061 void parseNormal(FlowSource* obj, pugi::xml_node norm, pugi::xml_node time); 00062 00066 void parseTotalWater(FlowSource* obj, pugi::xml_node node); 00067 00071 void parseRadius(FlowSource* obj, pugi::xml_node node); 00072 00078 std::vector<FlowSource*> loadFlows(const char* xmlFile); 00079 00080 00085 bool flowChange(std::vector<FlowSource*> flows, float dt); 00086 00090 std::string loadMapPath(const char* xmlFile); 00091 00095 std::string loadVelSavePath(const char* xmlFile); 00096 00100 std::string loadHeightSavePath(const char* xmlFile); 00101 00105 std::string loadVelLoadPath(const char* xmlFile); 00106 00110 std::string loadHeightLoadPath(const char* xmlFile); 00111 00115 std::vector<Flood_Fill_data*> loadFFData(const char* xmlFile); 00116 00119 void deleteAllFlows(std::vector<FlowSource*> srces); 00120 00121 #endif