-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
#include <msp/gl/meshbuilder.h>
#include <msp/gl/technique.h>
#include <msp/gl/texture2d.h>
const GL::Object *VehicleType3D::get_fixed_axle_object(unsigned i) const
{
if(i>=axle_objects[0].size())
- throw InvalidParameterValue("Axle index out of range");
+ throw out_of_range("VehicleType3D::get_fixed_axle_object");
return axle_objects[0][i];
}
const GL::Object *VehicleType3D::get_bogie_object(unsigned i) const
{
if(i>=bogie_objects.size())
- throw InvalidParameterValue("Bogie index out of range");
+ throw out_of_range("VehicleType3D::get_bogie_object");
return bogie_objects[i];
}
const GL::Object *VehicleType3D::get_bogie_axle_object(unsigned i, unsigned j) const
{
if(i>=bogie_objects.size())
- throw InvalidParameterValue("Bogie index out of range");
+ throw out_of_range("VehicleType3D::get_bogie_axle_object");
if(j>=axle_objects[i+1].size())
- throw InvalidParameterValue("Axle index out of range");
+ throw out_of_range("VehicleType3D::get_bogie_axle_object");
return axle_objects[i+1][j];
}
const GL::Object *VehicleType3D::get_rod_object(unsigned i) const
{
if(i>=rod_objects.size())
- throw InvalidParameterValue("Rod index out of range");
+ throw out_of_range("VehicleType3D::get_rod_object");
return rod_objects[i];
}
string kind = name.substr(1, colon-1);
map<string, string> params;
- params["length"] = lexical_cast(type.get_length()*1000);
- params["width"] = lexical_cast(type.get_width()*1000);
- params["height"] = lexical_cast(type.get_height()*1000);
+ params["length"] = lexical_cast<string>(type.get_length()*1000);
+ params["width"] = lexical_cast<string>(type.get_width()*1000);
+ params["height"] = lexical_cast<string>(type.get_height()*1000);
if(colon!=string::npos)
{
string::size_type start = colon+1;
}
}
else
- return catalogue.get<GL::Object>(name);
+ return &catalogue.get<GL::Object>(name);
}
return ptr;
}