Hi guys,

seems like the MatrixTemplate changes in src/osg/Uniform.cpp broke the compile 
on OS X
with the clang++ compiler:

[  0%] Built target OpenThreads
[  0%] Building CXX object src/osg/CMakeFiles/osg.dir/Uniform.cpp.o
/Users/uli/Projects/osg/OpenSceneGraph/src/osg/Uniform.cpp: In member function 
'bool
osg::Uniform::getElement(unsigned int, osg::Matrix2&) const':
/Users/uli/Projects/osg/OpenSceneGraph/src/osg/Uniform.cpp:2149: error: 
'template<class T,
unsigned int ColN, unsigned int RowN> class osg::MatrixTemplate' used without 
template
parameters
/Users/uli/Projects/osg/OpenSceneGraph/src/osg/Uniform.cpp: In member function 
'bool
osg::Uniform::getElement(unsigned int, osg::Matrix3&) const':
/Users/uli/Projects/osg/OpenSceneGraph/src/osg/Uniform.cpp:2157: error: 
'template<class T,
unsigned int ColN, unsigned int RowN> class osg::MatrixTemplate' used without 
template
parameters
/Users/uli/Projects/osg/OpenSceneGraph/src/osg/Uniform.cpp: In member function 
'bool
osg::Uniform::getElement(unsigned int, osg::Matrix2x3&) const':
...
and so on.

The attached patch changes this:

bool Uniform::getElement( unsigned int index, osg::Matrix2& m2 ) const
{
...
    m2.MatrixTemplate::set( &((*_floatArray)[j]) );
...
}

to that:

bool Uniform::getElement( unsigned int index, osg::Matrix2& m2 ) const
{
...
    m2.base_class::set( &((*_floatArray)[j]) );
...
}

Could somebody please verify that this works on other compilers as well?

Cheers,
/ulrich
Index: src/osg/Uniform.cpp
===================================================================
--- src/osg/Uniform.cpp (revision 13057)
+++ src/osg/Uniform.cpp (working copy)
@@ -2146,7 +2146,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m2.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m2.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2154,7 +2154,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m3.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m3.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2170,7 +2170,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x3) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m2x3.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m2x3.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2178,7 +2178,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x4) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m2x4.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m2x4.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2186,7 +2186,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x2) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m3x2.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m3x2.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2194,7 +2194,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x4) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m3x4.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m3x4.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2202,7 +2202,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x2) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m4x2.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m4x2.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2210,7 +2210,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x3) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m4x3.MatrixTemplate::set( &((*_floatArray)[j]) );
+    m4x3.base_class::set( &((*_floatArray)[j]) );
     return true;
 }
 
@@ -2256,7 +2256,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m2.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m2.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2264,7 +2264,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m3.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m3.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2284,7 +2284,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x3) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m2x3.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m2x3.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2292,7 +2292,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x4) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m2x4.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m2x4.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2300,7 +2300,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x2) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m3x2.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m3x2.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2308,7 +2308,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x4) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m3x4.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m3x4.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2316,7 +2316,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x2) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m4x2.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m4x2.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
@@ -2324,7 +2324,7 @@
 {
     if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x3) ) return 
false;
     unsigned int j = index * getTypeNumComponents(getType());
-    m4x3.MatrixTemplate::set( &((*_doubleArray)[j]) );
+    m4x3.base_class::set( &((*_doubleArray)[j]) );
     return true;
 }
 
Index: include/osg/Uniform
===================================================================
--- include/osg/Uniform (revision 13057)
+++ include/osg/Uniform (working copy)
@@ -219,7 +219,7 @@
 
     public:
         Matrix3Template() { base_class::reset(); }
-        Matrix3Template( const Matrix3Template& mat ) { set(mat.ptr()); }
+        Matrix3Template( const Matrix3Template& mat ) { 
base_class::set(mat.ptr()); }
         Matrix3Template( value_type a00, value_type a10, value_type a20,
                          value_type a01, value_type a11, value_type a21,
                          value_type a02, value_type a12, value_type a22 )

Attachment: Uniform.tar.gz
Description: GNU Zip compressed data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to