void Path3D::set_layer(float l)
{
- z_offs = l*track.get_track().get_type().get_appearance().get_gauge()*0.01;
+ z_offs = l*track.get_track().get_type().get_gauge()*0.01;
}
void Path3D::path_changed(unsigned p)
for(vector<TrackIter>::const_iterator i=unlinked_endpoints.begin(); i!=unlinked_endpoints.end(); ++i)
{
start_sn = (*i)->get_snap_node(i->entry());
- limit = (*i)->get_type().get_appearance().get_gauge()/10;
+ limit = (*i)->get_type().get_gauge()/10;
for(vector<TrackIter>::const_iterator j=i; ++j!=unlinked_endpoints.end(); )
{
limit(-1)
{
if(Track *track = dynamic_cast<Track *>(object->object))
- limit = track->get_type().get_appearance().get_gauge();
+ limit = track->get_type().get_gauge();
}
{
save_track(**i);
- float gauge = (*i)->get_type().get_appearance().get_gauge();
+ float gauge = (*i)->get_type().get_gauge();
unsigned n_endpoints = (*i)->get_type().get_endpoints().size();
for(unsigned j=0; j<n_endpoints; ++j)
{
if(!otrack)
return false;
- float limit = type.get_appearance().get_gauge();
+ float limit = type.get_gauge();
if(!flex && !otrack->get_flex())
limit /= 10;
limit *= limit;
Snap sn;
sn.position = position;
sn.rotation = rotation;
- float gauge = (*i)->get_type().get_appearance().get_gauge();
+ float gauge = (*i)->get_type().get_gauge();
if((*i)->snap(sn, gauge*limit, SNAP_SEGMENT))
{
float d = distance(position, sn.position);
#include <cmath>
#include <msp/geometry/union.h>
+#include "trackappearance.h"
#include "tracktype.h"
using namespace std;
autofit_preference(1)
{ }
+float TrackType::get_gauge() const
+{
+ return appearance.get_gauge();
+}
+
float TrackType::get_total_length() const
{
return get_path_length(-1);
TrackType(const ArticleNumber &, const TrackAppearance &);
const TrackAppearance &get_appearance() const { return appearance; }
+ float get_gauge() const;
float get_total_length() const;
float get_path_length(int) const;
unsigned get_paths() const;