...
 
Commits (2)
...@@ -159,6 +159,7 @@ set( HDR ...@@ -159,6 +159,7 @@ set( HDR
src/IO/TraVisToClient.h src/IO/TraVisToClient.h
forms/Settings.h forms/Settings.h
src/SaxParser.h src/SaxParser.h
src/train.h
src/Debug.h src/Debug.h
src/Frame.h src/Frame.h
src/InteractorStyle.h src/InteractorStyle.h
......
...@@ -57,8 +57,7 @@ int OutputHandler::GetErrors() ...@@ -57,8 +57,7 @@ int OutputHandler::GetErrors()
void OutputHandler::Write(const string& str) void OutputHandler::Write(const string& str)
{ {
if (this != NULL) cout << str << endl;
cout << str << endl;
} }
void OutputHandler::ProgressBar(double TotalPeds, double NowPeds) void OutputHandler::ProgressBar(double TotalPeds, double NowPeds)
...@@ -157,10 +156,10 @@ FileHandler::~FileHandler() ...@@ -157,10 +156,10 @@ FileHandler::~FileHandler()
void FileHandler::Write(const string& str) void FileHandler::Write(const string& str)
{ {
if (this != NULL) { // if (this != NULL) {
_pfp << str << endl; _pfp << str << endl;
_pfp.flush(); _pfp.flush();
} // }
if (str.find("ERROR") != string::npos) if (str.find("ERROR") != string::npos)
{ {
......
...@@ -808,8 +808,15 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName) ...@@ -808,8 +808,15 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName)
} }
SyncData* dataset=NULL; SyncData* dataset=NULL;
extern_trajectories_firstSet.clearFrames(); extern_trajectories_firstSet.clearFrames();
vtkSmartPointer<vtkSphereSource> org = vtkSphereSource::New();
org->SetRadius(10);
// extern_mysphere = org;
switch(groupID) { switch(groupID) {
case 1: case 1:
Debug::Messages("handling first set"); Debug::Messages("handling first set");
...@@ -855,6 +862,8 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName) ...@@ -855,6 +862,8 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName)
else if(fileName.endsWith(".txt",Qt::CaseInsensitive)) else if(fileName.endsWith(".txt",Qt::CaseInsensitive))
{ {
QString source_file= wd + QDir::separator() + SaxParser::extractSourceFileTXT(fileName); QString source_file= wd + QDir::separator() + SaxParser::extractSourceFileTXT(fileName);
QString ttt_file= wd + QDir::separator() + SaxParser::extractTrainTimeTableFileTXT(fileName);
QString tt_file= wd + QDir::separator() + SaxParser::extractTrainTypeFileTXT(fileName);
QString goal_file=wd + QDir::separator() + SaxParser::extractGoalFileTXT(fileName); QString goal_file=wd + QDir::separator() + SaxParser::extractGoalFileTXT(fileName);
QFileInfo check_file(source_file); QFileInfo check_file(source_file);
if( !(check_file.exists() && check_file.isFile()) ) if( !(check_file.exists() && check_file.isFile()) )
...@@ -864,7 +873,7 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName) ...@@ -864,7 +873,7 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName)
else else
Debug::Messages("INFO: MainWindow::addPedestrianGroup: source name: <%s>", source_file.toStdString().c_str()); Debug::Messages("INFO: MainWindow::addPedestrianGroup: source name: <%s>", source_file.toStdString().c_str());
check_file = source_file; check_file = goal_file;
if( !(check_file.exists() && check_file.isFile()) ) if( !(check_file.exists() && check_file.isFile()) )
{ {
Debug::Messages("WARNING: MainWindow::addPedestrianGroup: goal name: <%s> not found!", goal_file.toStdString().c_str()); Debug::Messages("WARNING: MainWindow::addPedestrianGroup: goal name: <%s> not found!", goal_file.toStdString().c_str());
...@@ -873,6 +882,25 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName) ...@@ -873,6 +882,25 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName)
Debug::Messages("INFO: MainWindow::addPedestrianGroup: goal name: <%s>", goal_file.toStdString().c_str()); Debug::Messages("INFO: MainWindow::addPedestrianGroup: goal name: <%s>", goal_file.toStdString().c_str());
check_file = ttt_file;
if( !(check_file.exists() && check_file.isFile()) )
{
Debug::Messages("WARNING: MainWindow::addPedestrianGroup: ttt name: <%s> not found!", ttt_file.toStdString().c_str());
}
else
Debug::Messages("INFO: MainWindow::addPedestrianGroup: ttt name: <%s>", ttt_file.toStdString().c_str());
check_file = tt_file;
if( !(check_file.exists() && check_file.isFile()) )
{
Debug::Messages("WARNING: MainWindow::addPedestrianGroup: tt name: <%s> not found!", tt_file.toStdString().c_str());
}
else
Debug::Messages("INFO: MainWindow::addPedestrianGroup: tt name: <%s>", tt_file.toStdString().c_str());
// ------ parsing sources // ------ parsing sources
QFile file(source_file); QFile file(source_file);
QXmlInputSource source(&file); QXmlInputSource source(&file);
...@@ -881,14 +909,30 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName) ...@@ -881,14 +909,30 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName)
reader.setContentHandler(&handler); reader.setContentHandler(&handler);
reader.parse(source); reader.parse(source);
file.close(); file.close();
// -----
// // ---- parsing goals
// -----
QFile file2(goal_file); QFile file2(goal_file);
QXmlInputSource source2(&file2); QXmlInputSource source2(&file2);
reader.parse(source2); reader.parse(source2);
file2.close(); file2.close();
// ----- // parsing trains
// // ---- parsing goals // train type
// ----- std::map<int, std::shared_ptr<TrainTimeTable> > trainTimeTable;
std::map<std::string, std::shared_ptr<TrainType> > trainTypes;
SaxParser::LoadTrainType(tt_file.toStdString(), trainTypes);
extern_trainTypes = trainTypes;
bool ret = SaxParser::LoadTrainTimetable(ttt_file.toStdString(), trainTimeTable);
if(!ret) std::cout << "hmmm\n";
extern_trainTimeTables = trainTimeTable;
for(auto tab: trainTimeTable)
std::cout << "tab: " << tab.first << "\n";
for(auto tab: trainTypes)
std::cout << "type: " << tab.first << "\n";
if(false==SaxParser::ParseTxtFormat(fileName, dataset,&frameRate)) if(false==SaxParser::ParseTxtFormat(fileName, dataset,&frameRate))
return false; return false;
......
This diff is collapsed.
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
#include <vector> #include <vector>
#include "SyncData.h" #include "SyncData.h"
#include"geometry/GeometryFactory.h" #include"geometry/GeometryFactory.h"
#include "tinyxml/tinyxml.h"
#include "general/Macros.h"
#include "train.h"
...@@ -90,6 +96,14 @@ public: ...@@ -90,6 +96,14 @@ public:
/// parse a vtk file /// parse a vtk file
static bool ParseGradientFieldVTK(QString fileName, GeometryFactory& geoFac); static bool ParseGradientFieldVTK(QString fileName, GeometryFactory& geoFac);
/// Trains
static bool LoadTrainTimetable(std::string filename, std::map<int, std::shared_ptr<TrainTimeTable> > & trainTimeTables);
static std::shared_ptr<TrainTimeTable> parseTrainTimeTableNode(TiXmlElement * e);
static std::shared_ptr<TrainType> parseTrainTypeNode(TiXmlElement * e);
static QString extractTrainTypeFileTXT(QString &filename);
static QString extractTrainTimeTableFileTXT(QString &filename);
static bool LoadTrainType(std::string Filename, std::map<std::string, std::shared_ptr<TrainType> > & trainTypes);
private: private:
//clear the mo //clear the mo
......
...@@ -138,6 +138,17 @@ Frame* SyncData::getFrame( int i) ...@@ -138,6 +138,17 @@ Frame* SyncData::getFrame( int i)
} }
vtkSmartPointer<vtkSphereSource> SyncData::getTTT()
{
return _ttt;
}
void SyncData::setTTT(vtkSmartPointer<vtkSphereSource> s)
{
_ttt = s;
}
Frame* SyncData::getNextFrame() Frame* SyncData::getNextFrame()
{ {
...@@ -193,8 +204,8 @@ Frame* SyncData::getNextFrame() ...@@ -193,8 +204,8 @@ Frame* SyncData::getNextFrame()
/*** /***
* This method is for convenience only. * This method is for convenience only.
* The normal way to get the previous frame is: * The normal way to get the previous frame is:
* 1. either set the variable extern_update_step to a negative value; * 1. either set the variable extern_update_step to a negative value;
* 2. using the function getFrame(int frameNumber). one may first get * 2. using the function getFrame(int frameNumber). one may first get
* the current framecursor position using getFrameCursor() * the current framecursor position using getFrameCursor()
*/ */
//Frame* SyncData::getPreviousFrame() //Frame* SyncData::getPreviousFrame()
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <map> #include <map>
#include <vtkSmartPointer.h>
#include <vtkSphereSource.h>
class QObject; class QObject;
class QStringList; class QStringList;
...@@ -84,6 +85,9 @@ public: ...@@ -84,6 +85,9 @@ public:
/// return the frame at position i /// return the frame at position i
Frame* getFrame(int i); Frame* getFrame(int i);
vtkSmartPointer<vtkSphereSource> getTTT();
void setTTT(vtkSmartPointer<vtkSphereSource> s);
/// return a pointer to the next frame /// return a pointer to the next frame
Frame* getNextFrame(); Frame* getNextFrame();
...@@ -166,6 +170,8 @@ private: ...@@ -166,6 +170,8 @@ private:
//std::vector<Frame*> _frames; //std::vector<Frame*> _frames;
std::map <int, Frame*> _frames; std::map <int, Frame*> _frames;
//std::map<int, std::unique_ptr<Frame> > _frames; //std::map<int, std::unique_ptr<Frame> > _frames;
vtkSmartPointer<vtkSphereSource> _ttt;
}; };
#endif /* SYNCDATA_H_ */ #endif /* SYNCDATA_H_ */
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
#include <vtkWindowToImageFilter.h> #include <vtkWindowToImageFilter.h>
#include <vtkActor.h> #include <vtkActor.h>
#include <vtkLightKit.h> #include <vtkLightKit.h>
#include <vtkPolyLine.h>
#include "geometry/FacilityGeometry.h" #include "geometry/FacilityGeometry.h"
#include "geometry/GeometryFactory.h" #include "geometry/GeometryFactory.h"
...@@ -140,7 +140,7 @@ void ThreadVisualisation::slotSetFrameRate(float fps) ...@@ -140,7 +140,7 @@ void ThreadVisualisation::slotSetFrameRate(float fps)
void ThreadVisualisation::run() void ThreadVisualisation::run()
{ {
// std::cout << "RUN " << _runningTime << "\n"; std::cout << "RUN " << _runningTime << "\n";
//deactivate the output windows //deactivate the output windows
vtkObject::GlobalWarningDisplayOff(); vtkObject::GlobalWarningDisplayOff();
...@@ -180,59 +180,83 @@ void ThreadVisualisation::run() ...@@ -180,59 +180,83 @@ void ThreadVisualisation::run()
//renderer->AddActor(axis); //renderer->AddActor(axis);
//add big circle at null point //add big circle at null point
{ // {
vtkSphereSource* org = vtkSphereSource::New(); // vtkSphereSource* org = vtkSphereSource::New();
org->SetRadius(300); // org->SetRadius(10);
// vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New(); // mapper->SetInputConnection(org->GetOutputPort());
mapper->SetInputConnection(org->GetOutputPort()); // org->Delete();
org->Delete(); // //------
// // create actor
// create actor // vtkActor* actor = vtkActor::New();
vtkActor* actor = vtkActor::New(); // actor->SetMapper(mapper);
actor->SetMapper(mapper); // mapper->Delete();
mapper->Delete(); // actor->GetProperty()->SetColor(.1,.10,0.0);
actor->GetProperty()->SetColor(.90,.90,0.0); // _renderer->AddActor(actor);
actor->Delete(); // actor->Delete();
//renderer->AddActor(actor); // mysphere;
} // //
//add another big circle at null point // }
{ // {
vtkSphereSource* org = vtkSphereSource::New(); // vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
org->SetRadius(300); // mapper->SetInputConnection(extern_mysphere->GetOutputPort());
//org->SetCenter(50,80,0); // //------
// // create actor
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New(); // vtkActor* actor = vtkActor::New();
mapper->SetInputConnection(org->GetOutputPort()); // actor->SetMapper(mapper);
org->Delete(); // mapper->Delete();
// actor->GetProperty()->SetColor(.1,.10,0.0);
// create actor // _renderer->AddActor(actor);
vtkActor* actor = vtkActor::New(); // actor->Delete();
actor->SetMapper(mapper); // //
mapper->Delete(); // }
actor->GetProperty()->SetColor(.90,.90,0.0);
actor->SetPosition(5000,8000,0); // {
actor->Delete(); // // Train
//renderer->AddActor(actor); // double p0[3] = {1.0*100, 4.0*100, 0.0};
} // double p1[3] = {3.0*100, 4.0*100, 0.0};
// double p2[3] = {3.0*100, 5.0*100, 0.0};
// double p3[3] = {1.0*100, 5.0*100, 0.0};
// Create a real circle, not a sphere // double p4[3] = {1.0*100, 4.0*100, 0.0};
{ // // Create a vtkPoints object and store the points in it
VTK_CREATE(vtkRegularPolygonSource, polygonSource); // VTK_CREATE(vtkPoints, points);
polygonSource->GeneratePolygonOff();
polygonSource->SetNumberOfSides(50); // points->InsertNextPoint(p0);
polygonSource->SetRadius(1000); // points->InsertNextPoint(p1);
polygonSource->SetCenter(0,0,0); // points->InsertNextPoint(p2);
polygonSource->Update(); // points->InsertNextPoint(p3);
// points->InsertNextPoint(p4);
VTK_CREATE(vtkPolyDataMapper,mapper);
mapper->SetInputConnection(polygonSource->GetOutputPort()); // VTK_CREATE(vtkPolyLine, polyLine);
VTK_CREATE(vtkActor,actor);
actor->GetProperty()->SetColor(180.0/255,180.0/255.0,180.0/255.0); // polyLine->GetPointIds()->SetNumberOfIds(5);
actor->SetMapper(mapper); // for(unsigned int i = 0; i < 5; i++)
//renderer->AddActor(actor); // {
} // polyLine->GetPointIds()->SetId(i,i);
// }
// // Create a cell array to store the lines in and add the lines to it
// VTK_CREATE(vtkCellArray, cells);
// cells->InsertNextCell(polyLine);
// // Create a polydata to store everything in
// VTK_CREATE(vtkPolyData, polyData);
// // Add the points to the dataset
// polyData->SetPoints(points);
// // Add the lines to the dataset
// polyData->SetLines(cells);
// VTK_CREATE(vtkPolyDataMapper, mapper);
// mapper->SetInputData(polyData);
// VTK_CREATE(vtkActor, actor);
// actor->SetMapper(mapper);
// actor->GetProperty()->SetColor(.1,.10,0.0);
// _renderer->AddActor(actor);
// }
// Create the render window // Create the render window
_renderWindow = vtkRenderWindow::New(); _renderWindow = vtkRenderWindow::New();
...@@ -302,6 +326,10 @@ void ThreadVisualisation::run() ...@@ -302,6 +326,10 @@ void ThreadVisualisation::run()
renderingTimer->setTextActor(_runningTime); renderingTimer->setTextActor(_runningTime);
_renderWinInteractor->AddObserver(vtkCommand::TimerEvent,renderingTimer); _renderWinInteractor->AddObserver(vtkCommand::TimerEvent,renderingTimer);
//create the necessary connections //create the necessary connections
QObject::connect(renderingTimer, SIGNAL(signalRunningTime(unsigned long )), QObject::connect(renderingTimer, SIGNAL(signalRunningTime(unsigned long )),
this->parent(), SLOT(slotRunningTime(unsigned long ))); this->parent(), SLOT(slotRunningTime(unsigned long )));
...@@ -311,8 +339,7 @@ void ThreadVisualisation::run() ...@@ -311,8 +339,7 @@ void ThreadVisualisation::run()
QObject::connect(renderingTimer, SIGNAL(signalRenderingTime(int)), QObject::connect(renderingTimer, SIGNAL(signalRenderingTime(int)),
this->parent(), SLOT(slotRenderingTime(int))); this->parent(), SLOT(slotRenderingTime(int)));
// std::cout << "timer " << timer << "\n"; std::cout << "timer " << timer << "\n";
// Create my interactor style // Create my interactor style
InteractorStyle* style = InteractorStyle::New(); InteractorStyle* style = InteractorStyle::New();
_renderWinInteractor->SetInteractorStyle( style ); _renderWinInteractor->SetInteractorStyle( style );
...@@ -586,7 +613,7 @@ void ThreadVisualisation::initGlyphs3D() ...@@ -586,7 +613,7 @@ void ThreadVisualisation::initGlyphs3D()
//importer->GetRenderWindow()->GetInteractor()->Start(); //importer->GetRenderWindow()->GetInteractor()->Start();
////collect all the elements from the 3ds ////collect all the elements from the 3ds
vtkActorCollection* collection=importer->GetRenderer()->GetActors(); vtkActorCollection* collection=importer->GetRenderer()x->GetActors();
vtkActor *actorCharlie= collection->GetLastActor(); vtkActor *actorCharlie= collection->GetLastActor();
actorCharlie->InitPathTraversal(); actorCharlie->InitPathTraversal();
vtkMapper *mapperCharlie=actorCharlie->GetMapper(); vtkMapper *mapperCharlie=actorCharlie->GetMapper();
......
...@@ -74,6 +74,8 @@ extern vtkActor* extern_glyphs_pedestrians_actor_2D; ...@@ -74,6 +74,8 @@ extern vtkActor* extern_glyphs_pedestrians_actor_2D;
extern vtkActor* extern_glyphs_pedestrians_actor_3D; extern vtkActor* extern_glyphs_pedestrians_actor_3D;
extern SyncData extern_trajectories_firstSet; extern SyncData extern_trajectories_firstSet;
// extern vtkSmartPointer<vtkSphereSource> extern_mysphere;
class ThreadVisualisation :public QThread { class ThreadVisualisation :public QThread {
Q_OBJECT Q_OBJECT
......
This diff is collapsed.
...@@ -52,6 +52,8 @@ class vtkFFMPEGWriter; ...@@ -52,6 +52,8 @@ class vtkFFMPEGWriter;
#include <vtkTensorGlyph.h> #include <vtkTensorGlyph.h>
#include <vtkSmartPointer.h> #include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h> #include <vtkPolyDataMapper.h>
#include <vtkLineSource.h>
#include "train.h"
class SyncData; class SyncData;
class QObject; class QObject;
...@@ -89,6 +91,9 @@ extern PointPlotter* extern_trail_plotter; ...@@ -89,6 +91,9 @@ extern PointPlotter* extern_trail_plotter;
extern SyncData extern_trajectories_firstSet; extern SyncData extern_trajectories_firstSet;
extern SyncData mysphere;
extern std::map<std::string, std::shared_ptr<TrainType> > extern_trainTypes;
extern std::map<int, std::shared_ptr<TrainTimeTable> > extern_trainTimeTables;
//states if the datasets are loaded. //states if the datasets are loaded.
extern bool extern_first_dataset_loaded; extern bool extern_first_dataset_loaded;
...@@ -126,6 +131,8 @@ public: ...@@ -126,6 +131,8 @@ public:
void SetRenderTimerId(int tid); void SetRenderTimerId(int tid);
void setTextActor(vtkTextActor* runningTime); void setTextActor(vtkTextActor* runningTime);
vtkSmartPointer<vtkPolyData> train(double x1, double y1, double x2, double y2);
vtkSmartPointer<vtkLineSource> door(double x1, double y1, double x2, double y2);
private: private:
///updates system global changes, like fullscreen, ffw and soone ///updates system global changes, like fullscreen, ffw and soone
......
...@@ -46,10 +46,9 @@ ...@@ -46,10 +46,9 @@
#include <vtkSmartPointer.h> #include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h> #include <vtkPolyDataMapper.h>
#include "train.h"
#define VTK_CREATE(type, name) \ #define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New() vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
//external variables //external variables
/// define the speed/rate/pace at which the trajectories are displayed. /// define the speed/rate/pace at which the trajectories are displayed.
...@@ -84,6 +83,9 @@ double extern_scale_pedestrian=0.1; ...@@ -84,6 +83,9 @@ double extern_scale_pedestrian=0.1;
// At most three pedestrians groups can be loaded // At most three pedestrians groups can be loaded
///The first pedestrian group ///The first pedestrian group
Pedestrian** extern_pedestrians_firstSet=NULL; Pedestrian** extern_pedestrians_firstSet=NULL;
vtkSmartPointer<vtkSphereSource> extern_mysphere=nullptr;
std::map<std::string, std::shared_ptr<TrainType> > extern_trainTypes;
std::map<int, std::shared_ptr<TrainTimeTable> > extern_trainTimeTables;
//vtkSmartPointer<vtkTensorGlyph> extern_glyphs_pedestrians=NULL; //vtkSmartPointer<vtkTensorGlyph> extern_glyphs_pedestrians=NULL;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* *
* *
**/ **/
#ifndef _MACROS_H #ifndef _MACROS_H
#define _MACROS_H #define _MACROS_H
...@@ -39,9 +39,15 @@ ...@@ -39,9 +39,15 @@
#include <iostream> #include <iostream>
enum RoomState {
ROOM_CLEAN=0,
ROOM_SMOKED=1
};
#ifndef M_PI #ifndef M_PI
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
//fix for osx/linux/win //fix for osx/linux/win
#define _isnan(x) std::isnan(x) #define _isnan(x) std::isnan(x)
...@@ -89,11 +95,6 @@ ...@@ -89,11 +95,6 @@
#define LIST_EMPTY -1 #define LIST_EMPTY -1
enum RoomState {
ROOM_CLEAN=0,
ROOM_SMOKED=1
};
enum AgentType { enum AgentType {
MALE=0, MALE=0,
FEMALE, FEMALE,
......
...@@ -82,6 +82,35 @@ Building::Building(const std::string& filename, const std::string& rootDir, Rout ...@@ -82,6 +82,35 @@ Building::Building(const std::string& filename, const std::string& rootDir, Rout
} }
#endif #endif
// bool Building::AddTrainType(std::shared_ptr<TrainType> TT)
// {
// if (_trainTypes.count(TT->type)!=0) {
// // Log->Write("WARNING: Duplicate type for train found [%s]",TT->type);
// }
// _trainTypes[TT->type] = TT;
// return true;
// }
// bool Building::AddTrainTimeTable(std::shared_ptr<TrainTimeTable> TTT)
// {
// if (_trainTimeTables.count(TTT->id)!=0) {
// Log->Write("WARNING: Duplicate id for train time table found [%d]",TTT->id);
// exit(EXIT_FAILURE);
// }
// _trainTimeTables[TTT->id] = TTT;
// return true;
// }
// const std::map<std::string, std::shared_ptr<TrainType> >& Building::GetTrainTypes() const
// {
// return _trainTypes;
// }
// const std::map<int, std::shared_ptr<TrainTimeTable> >& Building::GetTrainTimeTables() const
// {
// return _trainTimeTables;
// }
Building::~Building() Building::~Building()
{ {
// //
......
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
#include "Obstacle.h" #include "Obstacle.h"
#include "Goal.h" #include "Goal.h"
#include "../tinyxml/tinyxml.h" #include "../tinyxml/tinyxml.h"
// train schedules: Trains get deleted and added.
class RoutingEngine; class RoutingEngine;
class Pedestrian; class Pedestrian;
class Transition; class Transition;
...@@ -67,6 +73,8 @@ private: ...@@ -67,6 +73,8 @@ private:
std::map<int, Hline*> _hLines; std::map<int, Hline*> _hLines;
std::map<int, Goal*>_goals; std::map<int, Goal*>_goals;
/// pedestrians pathway /// pedestrians pathway
bool _savePathway; bool _savePathway;
std::ofstream _pathWayStream; std::ofstream _pathWayStream;
...@@ -101,6 +109,9 @@ public: ...@@ -101,6 +109,9 @@ public:
Transition* GetTransition(int id) ; Transition* GetTransition(int id) ;
Transition* ParseTransitionNode(TiXmlElement * xTrans); Transition* ParseTransitionNode(TiXmlElement * xTrans);
/** /**
* Not implemented * Not implemented
*/ */
......
...@@ -578,7 +578,7 @@ void FacilityGeometry::addObstacles(vtkPolyData* polygonPolyData ) ...@@ -578,7 +578,7 @@ void FacilityGeometry::addObstacles(vtkPolyData* polygonPolyData )
void FacilityGeometry::addRectangle(double x1, double y1, double x2, double y2, double z, double color1, double color2, string text) void FacilityGeometry::addRectangle(double x1, double y1, double x2, double y2, double z, double color1, double color2, string text)
{ {
//if(z!=1)return; //if(z!=1)return;
const double cellSize=40; //cm const double cellSize=10; //cm
// const int dimX=(x2-x1)/cellSize+1; // const int dimX=(x2-x1)/cellSize+1;
// const int dimY=(y2-y1)/cellSize+1; // const int dimY=(y2-y1)/cellSize+1;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* *
* *
**/ **/
#ifndef _ROOM_H #ifndef _ROOM_H
#define _ROOM_H #define _ROOM_H
...@@ -165,4 +165,3 @@ public: ...@@ -165,4 +165,3 @@ public:
}; };
#endif /* _ROOM_H */ #endif /* _ROOM_H */
#ifndef TRAIN_VAR_H_
#define TRAIN_VAR_H_ 1
#include "geometry/Point.h"
#include "geometry/Transition.h"
struct TrainTimeTable
{
int id;
std::string type;
int rid; // room id
int sid; // subroom id
double tin; // arrival time
double tout; //leaving time
Point pstart; // track start
Point pend; // track end
Point tstart; // train start
Point tend; // train end
int pid; // Platform id
bool arrival;
bool departure;
};
struct TrainType
{
std::string type;
int nmax; // agents_max
float len; //length
std::vector<Transition> doors;
};
#endif /* TRAIN_H_ */