From Paul Obermeier, "Please find enclosed some changed OSG header files.

The changes are more or less just beautifications
(when looked at them from the C++ view), but make
wrapping OSG with SWIG easier.
I have tested the changes with both 2.8.1-rc4 and the
current head and would appreciate to incorporate the
changes in both branches.

Here is a description of the changes:

osg/BoundingSphere:
   Use the following typedef (like used in BoundingBox)
       typedef typename VT::value_type value_type;
   instead of
       typedef typename vec_type::value_type value_type;

   SWIG reports errors on the latter construct.
   Also makes it consistent with BoundingBox.


osg/Vec4ub:
   Consistent use of "value_type" throughout the file.


osg/Vec?b:
   Consistent use of "value_type" throughout the files.

   Also changed
       typedef char value_type;
   to
       typedef signed char value_type;

   In the case of a simple "char", SWIG assumes a string.
   Using "signed char" instead of "char" does not change
   the behaviour of the class.
"
This commit is contained in:
Robert Osfield
2009-05-18 10:37:03 +00:00
parent 47c922b0e5
commit 7dead3f52d
5 changed files with 31 additions and 31 deletions

View File

@@ -29,7 +29,7 @@ class Vec2b
// Methods are defined here so that they are implicitly inlined
/** Type of Vec class.*/
typedef char value_type;
typedef signed char value_type;
/** Number of vector components. */
enum { num_components = 2 };
@@ -39,7 +39,7 @@ class Vec2b
Vec2b() { _v[0]=0; _v[1]=0; }
Vec2b(char r, char g)
Vec2b(value_type r, value_type g)
{
_v[0]=r; _v[1]=g;
}
@@ -94,8 +94,8 @@ class Vec2b
/** Unary multiply by scalar. */
inline Vec2b& operator *= (float rhs)
{
_v[0]=(char)((float)_v[0]*rhs);
_v[1]=(char)((float)_v[1]*rhs);
_v[0]=(value_type)((float)_v[0]*rhs);
_v[1]=(value_type)((float)_v[1]*rhs);
return *this;
}