Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 26, 2008, 1:54:15 AM (16 years ago)
Author:
rgrieder
Message:

Merged the changes in Convert.h from core3 branch back.
If it doesn't work, feel free to revert. I have however more or less checked every possible conversion on gcc (tardis) and msvc with a script.

Location:
code/branches/objecthierarchy/src/util
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/util

  • code/branches/objecthierarchy/src/util/MathConvert.h

    r2015 r2016  
    4747// Vector2 to std::string
    4848template <>
    49 struct ConverterExplicit<std::string, orxonox::Vector2>
     49struct ConverterExplicit<orxonox::Vector2, std::string>
    5050{
    5151    static bool convert(std::string* output, const orxonox::Vector2& input)
     
    6363// Vector3 to std::string
    6464template <>
    65 struct ConverterExplicit<std::string, orxonox::Vector3>
     65struct ConverterExplicit<orxonox::Vector3, std::string>
    6666{
    6767    static bool convert(std::string* output, const orxonox::Vector3& input)
     
    7979// Vector4 to std::string
    8080template <>
    81 struct ConverterExplicit<std::string, orxonox::Vector4>
     81struct ConverterExplicit<orxonox::Vector4, std::string>
    8282{
    8383    static bool convert(std::string* output, const orxonox::Vector4& input)
     
    9595// Quaternion to std::string
    9696template <>
    97 struct ConverterExplicit<std::string, orxonox::Quaternion>
     97struct ConverterExplicit<orxonox::Quaternion, std::string>
    9898{
    9999    static bool convert(std::string* output, const orxonox::Quaternion& input)
     
    111111// ColourValue to std::string
    112112template <>
    113 struct ConverterExplicit<std::string, orxonox::ColourValue>
     113struct ConverterExplicit<orxonox::ColourValue, std::string>
    114114{
    115115    static bool convert(std::string* output, const orxonox::ColourValue& input)
     
    131131
    132132// std::string to Vector2
    133 template <> struct _UtilExport ConverterFallback<orxonox::Vector2,     std::string>
     133template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector2>
    134134{ static bool convert(orxonox::Vector2*     output, const std::string& input); };
    135135// std::string to Vector3
    136 template <> struct _UtilExport ConverterFallback<orxonox::Vector3,     std::string>
     136template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector3>
    137137{ static bool convert(orxonox::Vector3*     output, const std::string& input); };
    138138// std::string to Vector4
    139 template <> struct _UtilExport ConverterFallback<orxonox::Vector4,     std::string>
     139template <> struct _UtilExport ConverterFallback<std::string, orxonox::Vector4>
    140140{ static bool convert(orxonox::Vector4*     output, const std::string& input); };
    141141// std::string to Quaternion
    142 template <> struct _UtilExport ConverterFallback<orxonox::Quaternion,  std::string>
     142template <> struct _UtilExport ConverterFallback<std::string, orxonox::Quaternion>
    143143{ static bool convert(orxonox::Quaternion*  output, const std::string& input); };
    144144// std::string to ColourValue
    145 template <> struct _UtilExport ConverterFallback<orxonox::ColourValue, std::string>
     145template <> struct _UtilExport ConverterFallback<std::string, orxonox::ColourValue>
    146146{ static bool convert(orxonox::ColourValue* output, const std::string& input); };
    147147
     
    153153// From Radian
    154154template <class ToType>
    155 struct ConverterFallback<ToType, orxonox::Radian>
     155struct ConverterFallback<orxonox::Radian, ToType>
    156156{
    157157    static bool convert(ToType* output, const orxonox::Radian& input)
    158158    {
    159         return convertValue<ToType, Ogre::Real>(output, input.valueRadians());
     159        return convertValue<Ogre::Real, ToType>(output, input.valueRadians());
    160160    }
    161161};
     
    163163// From Degree
    164164template <class ToType>
    165 struct ConverterFallback<ToType, orxonox::Degree>
     165struct ConverterFallback<orxonox::Degree, ToType>
    166166{
    167167    static bool convert(ToType* output, const orxonox::Degree& input)
    168168    {
    169         return convertValue<ToType, Ogre::Real>(output, input.valueDegrees());
     169        return convertValue<Ogre::Real, ToType>(output, input.valueDegrees());
    170170    }
    171171};
     
    173173// To Radian
    174174template <class FromType>
    175 struct ConverterFallback<orxonox::Radian, FromType>
     175struct ConverterFallback<FromType, orxonox::Radian>
    176176{
    177177    static bool convert(orxonox::Radian* output, const FromType& input)
     
    190190// To Degree
    191191template <class FromType>
    192 struct ConverterFallback<orxonox::Degree, FromType>
     192struct ConverterFallback<FromType, orxonox::Degree>
    193193{
    194194    static bool convert(orxonox::Degree* output, const FromType& input)
Note: See TracChangeset for help on using the changeset viewer.