Waterflow
Visualize water in terrain
src/xml/testing.cpp
00001 #include "xmlParsing.h"
00002 
00003 int main()
00004 {
00005   float tw, r;
00006   std::vector<int> pos1, pos2;
00007   std::vector<float> ndirec;
00008   std::vector<FlowSource*> sfv = loadFlows("xgconsole.xml");
00009   FlowSource first = *sfv[0];
00010   for(int i = 0; i < 12; i++){
00011     std::cout << "Pressure: " << first.getPressure() << std::endl;
00012     ndirec = first.getNormal();
00013     std::cout << "Normal given by xyz: ";
00014     for (auto j = ndirec.begin(); j != ndirec.end(); ++j){
00015       std::cout << *j << ' ';
00016     }
00017     std::cout << std::endl;
00018     first.update();
00019   }
00020 
00021   pos1 = sfv[0]->getPosition();
00022   pos2 = sfv[1]->getPosition();
00023   tw = sfv[0]->getWaterLeft();
00024   r = sfv[0]->getRadius();
00025   std::cout << "Postion given by xyz: ";
00026   for (auto i = pos1.begin(); i != pos1.end(); ++i){
00027     std::cout << *i << ' ';
00028   }
00029   std::cout << std::endl;
00030   std::cout << "Postion given by xyz: ";
00031   for (auto i = pos2.begin(); i != pos2.end(); ++i){
00032     std::cout << *i << ' ';
00033   }
00034   std::cout << std::endl;
00035   std::cout << "TotWater: " << tw << std::endl;
00036   std::cout << "Radius: " << r << std::endl;
00037   deleteAllFlows(sfv);
00038   std::cout << "Delete succesfull" << std::endl;
00039   return 1;
00040 }
 All Classes Files Functions Variables Enumerations