+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
#ifndef MARKLIN_TRACKPART_H_
#define MARKLIN_TRACKPART_H_
#include <msp/datafile/loader.h>
#include "endpoint.h"
+#include "geometry.h"
namespace Marklin {
struct TrackPart
{
- class Loader: public Msp::DataFile::Loader
+ class Loader: public Msp::DataFile::BasicLoader<TrackPart>
{
- private:
- TrackPart ∂
-
public:
Loader(TrackPart &);
- TrackPart &get_object() { return part; }
private:
virtual void finish();
-
void start(float, float, float);
};
- float x, y;
- float dir;
- float length;
- float radius;
- unsigned route;
- bool dead_end;
+ Point pos;
+ float dir;
+ float length;
+ float radius;
+ unsigned path;
+ bool dead_end;
TrackPart();
- void collect_endpoints(std::vector<Endpoint> &);
+ void collect_endpoints(std::vector<Endpoint> &) const;
+ Point get_point(float) const;
};
} // namespace Marklin