]> git.tdb.fi Git - r2c2.git/commitdiff
Rename various get_axle functions to get_fixed_axle
authorMikko Rasa <tdb@tdb.fi>
Wed, 16 Mar 2011 10:13:49 +0000 (10:13 +0000)
committerMikko Rasa <tdb@tdb.fi>
Wed, 16 Mar 2011 10:13:49 +0000 (10:13 +0000)
source/3d/axle.cpp
source/3d/vehicle.cpp
source/3d/vehicletype.cpp
source/3d/vehicletype.h
source/libr2c2/vehicle.cpp
source/libr2c2/vehicle.h
source/libr2c2/vehicletype.cpp
source/libr2c2/vehicletype.h

index 2da94b992764b4caf47e6595270cd2d07effb398..c8a6dd573091d743c126449ec2d2db43e95920db 100644 (file)
@@ -16,10 +16,10 @@ using namespace Msp;
 namespace R2C2 {
 
 Axle3D::Axle3D(const Vehicle3D &v, unsigned a):
-       GL::ObjectInstance(*v.get_type().get_axle_object(a)),
+       GL::ObjectInstance(*v.get_type().get_fixed_axle_object(a)),
        vehicle(v.get_vehicle()),
        bogie(0),
-       axle(vehicle.get_axle(a))
+       axle(vehicle.get_fixed_axle(a))
 { }
 
 Axle3D::Axle3D(const Vehicle3D &v, unsigned b, unsigned a):
index 42ac924783d156dec0b8eab1a20670ecd2d55450..8e3da138cf4388c2a7b556fb5bc09490daa85bff 100644 (file)
@@ -26,9 +26,9 @@ Vehicle3D::Vehicle3D(Layout3D &l, Vehicle &v):
        vehicle(v),
        type(layout.get_catalogue().get_vehicle(vehicle.get_type()))
 {
-       unsigned n_axles = vehicle.get_type().get_axles().size();
+       unsigned n_axles = vehicle.get_type().get_fixed_axles().size();
        for(unsigned i=0; i<n_axles; ++i)
-               if(type.get_axle_object(i))
+               if(type.get_fixed_axle_object(i))
                {
                        Axle3D *a = new Axle3D(*this, i);
                        axles.push_back(a);
index 27fb883a985241ef12b66ea8a4e56d5cff9f91b3..162b2c42110a4cd1d67100e43c5fe04e01124ee2 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -39,7 +39,7 @@ VehicleType3D::VehicleType3D(Catalogue3D &c, const VehicleType &t):
 {
        body_object = get_object(type.get_object());
 
-       const vector<VehicleType::Axle> &axles = type.get_axles();
+       const vector<VehicleType::Axle> &axles = type.get_fixed_axles();
        for(vector<VehicleType::Axle>::const_iterator i=axles.begin(); i!=axles.end(); ++i)
                axle_objects[0].push_back(get_object(i->object));
 
@@ -63,7 +63,7 @@ VehicleType3D::~VehicleType3D()
                delete i->second;
 }
 
-const GL::Object *VehicleType3D::get_axle_object(unsigned i) const
+const GL::Object *VehicleType3D::get_fixed_axle_object(unsigned i) const
 {
        if(i>=axle_objects[0].size())
                throw InvalidParameterValue("Axle index out of range");
index 8be9f3aa5bad5e79a6640982aea8b289d121852e..f65a1d6f66ad8395efd7e8a0caaf47e017a1d956 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -32,7 +32,7 @@ public:
        ~VehicleType3D();
 
        const Msp::GL::Object *get_body_object() const { return body_object; }
-       const Msp::GL::Object *get_axle_object(unsigned) const;
+       const Msp::GL::Object *get_fixed_axle_object(unsigned) const;
        const Msp::GL::Object *get_bogie_object(unsigned) const;
        const Msp::GL::Object *get_bogie_axle_object(unsigned, unsigned) const;
        const Msp::GL::Object *get_rod_object(unsigned) const;
index 2c31ba19f189467ad07233dc0ff600e87fe6643e..b7355c6a6e2fab2bd73caaeafafd4881ce989b2d 100644 (file)
@@ -29,7 +29,7 @@ Vehicle::Vehicle(Layout &l, const VehicleType &t):
        front_sensor(0),
        back_sensor(0)
 {
-       axles.assign(type.get_axles().begin(), type.get_axles().end());
+       axles.assign(type.get_fixed_axles().begin(), type.get_fixed_axles().end());
        bogies.assign(type.get_bogies().begin(), type.get_bogies().end());
        rods.assign(type.get_rods().begin(), type.get_rods().end());
 
@@ -125,6 +125,13 @@ void Vehicle::advance(float d)
        propagate_position();
 }
 
+const Vehicle::Axle &Vehicle::get_fixed_axle(unsigned i) const
+{
+       if(i>=axles.size())
+               throw InvalidParameterValue("Axle index out of range");
+       return axles[i];
+}
+
 const Vehicle::Bogie &Vehicle::get_bogie(unsigned i) const
 {
        if(i>=bogies.size())
@@ -132,13 +139,6 @@ const Vehicle::Bogie &Vehicle::get_bogie(unsigned i) const
        return bogies[i];
 }
 
-const Vehicle::Axle &Vehicle::get_axle(unsigned i) const
-{
-       if(i>=axles.size())
-               throw InvalidParameterValue("Axle index out of range");
-       return axles[i];
-}
-
 const Vehicle::Axle &Vehicle::get_bogie_axle(unsigned i, unsigned j) const
 {
        if(i>=bogies.size())
@@ -290,7 +290,7 @@ void Vehicle::update_rods()
                        i->position = i->type->pivot_point;
                else if(i->type->pivot==VehicleType::Rod::AXLE)
                {
-                       const Axle &axle = get_axle(i->type->pivot_index);
+                       const Axle &axle = get_fixed_axle(i->type->pivot_index);
                        float c = cos(axle.angle);
                        float s = sin(axle.angle);
                        const Vector &pp = i->type->pivot_point;
index b9c36d95d1e42bdbd6b06b5bc655138ac8ab3fb2..ce56666f473f93f0222d3b209c292e6cf712fafb 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -101,7 +101,7 @@ public:
        float get_offset() const { return track_pos.offs; }
        const Vector &get_position() const { return position; }
        float get_direction() const { return direction; }
-       const Axle &get_axle(unsigned) const;
+       const Axle &get_fixed_axle(unsigned) const;
        const Bogie &get_bogie(unsigned) const;
        const Axle &get_bogie_axle(unsigned, unsigned) const;
        const Rod &get_rod(unsigned) const;
index 7b355ac105230458f5a5856abfb7677d687cc1de..52dc7b0f45edf2f99fd9fc0257ef3bbb982fbbda 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -27,7 +27,7 @@ unsigned VehicleType::get_max_function() const
        return (--functions.end())->first;
 }
 
-const VehicleType::Axle &VehicleType::get_axle(unsigned i) const
+const VehicleType::Axle &VehicleType::get_fixed_axle(unsigned i) const
 {
        if(i>=axles.size())
                throw InvalidParameterValue("Axle index out of range");
index 97942af02c2381eec34e4fc5fb1fd5a11dd47379..461a3bec535198931f1a74604d2618c6c533f91e 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -153,8 +153,8 @@ public:
        float get_length() const { return length; }
        float get_width() const { return width; }
        float get_height() const { return height; }
-       const AxleArray &get_axles() const { return axles; }
-       const Axle &get_axle(unsigned) const;
+       const AxleArray &get_fixed_axles() const { return axles; }
+       const Axle &get_fixed_axle(unsigned) const;
        const BogieArray &get_bogies() const { return bogies; }
        const Bogie &get_bogie(unsigned) const;
        const Axle &get_bogie_axle(unsigned, unsigned) const;