aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2015-10-21 16:34:23 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2015-10-21 16:34:23 +0000
commit25f100a96eb494b028046e8856f583888842f9f7 (patch)
tree653c1822c740431dbf2afd09e9441b12a77e717e
parent5d1c0a21d38777346b83cb86f6f45ebc8357f371 (diff)
downloadports-25f100a96eb494b028046e8856f583888842f9f7.tar.gz
ports-25f100a96eb494b028046e8856f583888842f9f7.zip
Notes
-rw-r--r--MOVED1
-rw-r--r--graphics/Makefile1
-rw-r--r--graphics/nurbs++/Makefile20
-rw-r--r--graphics/nurbs++/distinfo2
-rw-r--r--graphics/nurbs++/files/patch-cvector.h16
-rw-r--r--graphics/nurbs++/files/patch-d_nurbsSub.cpp13
-rw-r--r--graphics/nurbs++/files/patch-f_nurbsSub.cpp13
-rw-r--r--graphics/nurbs++/files/patch-hnurbsS.cpp383
-rw-r--r--graphics/nurbs++/files/patch-hnurbsS_sp.cpp412
-rw-r--r--graphics/nurbs++/files/patch-image.cpp98
-rw-r--r--graphics/nurbs++/files/patch-image_color.cpp29
-rw-r--r--graphics/nurbs++/files/patch-list.h10
-rw-r--r--graphics/nurbs++/files/patch-matrix.cpp378
-rw-r--r--graphics/nurbs++/files/patch-matrixMat.cpp119
-rw-r--r--graphics/nurbs++/files/patch-matrixRT.cpp213
-rw-r--r--graphics/nurbs++/files/patch-matrix_barray2d_uchar.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_barray_complex.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix.h11
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_char.cpp38
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_complex.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_double.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_float.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_hpoint.cpp38
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_int.cpp43
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_point.cpp38
-rw-r--r--graphics/nurbs++/files/patch-matrix_matrix_uchar.cpp38
-rw-r--r--graphics/nurbs++/files/patch-matrix_vector_double.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_vector_float.cpp11
-rw-r--r--graphics/nurbs++/files/patch-matrix_vector_int.cpp11
-rw-r--r--graphics/nurbs++/files/patch-nurbs.cpp60
-rw-r--r--graphics/nurbs++/files/patch-nurbsS.cpp86
-rw-r--r--graphics/nurbs++/files/patch-nurbsS_sp.cpp233
-rw-r--r--graphics/nurbs++/files/patch-nurbsS_sp.h20
-rw-r--r--graphics/nurbs++/files/patch-nurbsSub.cpp20
-rw-r--r--graphics/nurbs++/files/patch-nurbs_d_nurbs.cpp11
-rw-r--r--graphics/nurbs++/files/patch-nurbs_d_surface.cpp24
-rw-r--r--graphics/nurbs++/files/patch-nurbs_f_surface.cpp24
-rw-r--r--graphics/nurbs++/files/patch-nurbs_hnurbsS_sp.h15
-rw-r--r--graphics/nurbs++/files/patch-nurbs_nurbs.h13
-rw-r--r--graphics/nurbs++/files/patch-nurbs_nurbsGL.cpp11
-rw-r--r--graphics/nurbs++/files/patch-nurbs_nurbsS.h24
-rw-r--r--graphics/nurbs++/files/patch-nurbs_sp.cpp71
-rw-r--r--graphics/nurbs++/files/patch-nurbs_sp.h20
-rw-r--r--graphics/nurbs++/files/patch-vector.cpp257
-rw-r--r--graphics/nurbs++/files/patch-vector.h20
-rw-r--r--graphics/nurbs++/pkg-descr12
-rw-r--r--graphics/nurbs++/pkg-plist61
47 files changed, 2983 insertions, 1 deletions
diff --git a/MOVED b/MOVED
index 92cf32f60b0c..1e89365d9f45 100644
--- a/MOVED
+++ b/MOVED
@@ -5423,7 +5423,6 @@ multimedia/openmovieeditor||2014-02-03|Has expired: segfaults, upstream developm
french/gfaim||2014-02-04|Abandonware
math/matlab-R2012a-installer|math/matlab-installer|2014-02-04|Now it can handle any Matlab version
games/deal||2014-02-05|Abandonware
-graphics/nurbs++||2014-02-05|Broken on all supported versions
japanese/grep|textproc/gnugrep|2014-02-06|Official version properly support multi-byte, consider using textproc/gnugrep
www/comclear||2014-02-06|Netscape doesn't exist anymore
editors/openoffice-3|editors/openoffice-4|2014-02-07|OpenOffice 3 is not supported anymore
diff --git a/graphics/Makefile b/graphics/Makefile
index cebfbbd77a1b..688f57641a05 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -603,6 +603,7 @@
SUBDIR += nip2
SUBDIR += nomacs
SUBDIR += npretty
+ SUBDIR += nurbs++
SUBDIR += nvidia-texture-tools
SUBDIR += ocaml-images
SUBDIR += ocaml-lablgl
diff --git a/graphics/nurbs++/Makefile b/graphics/nurbs++/Makefile
new file mode 100644
index 000000000000..c0515f26f4a5
--- /dev/null
+++ b/graphics/nurbs++/Makefile
@@ -0,0 +1,20 @@
+# Created by: R Joseph Wright <rjoseph@mammalia.org>
+# $FreeBSD$
+
+PORTNAME= nurbs++
+PORTVERSION= 3.0.11
+PORTREVISION= 2
+CATEGORIES= graphics
+MASTER_SITES= SF/libnurbs/nurbs%2B%2B/${PORTVERSION}
+
+MAINTAINER= gahr@FreeBSD.org
+COMMENT= C++ library to manipulate and create NURBS curves and surfaces
+
+USES= libtool tar:bzip2
+GNU_CONFIGURE= yes
+USE_GCC= any
+USE_LDCONFIG= yes
+
+INSTALL_TARGET= install-strip
+
+.include <bsd.port.mk>
diff --git a/graphics/nurbs++/distinfo b/graphics/nurbs++/distinfo
new file mode 100644
index 000000000000..8f12bde5c18a
--- /dev/null
+++ b/graphics/nurbs++/distinfo
@@ -0,0 +1,2 @@
+SHA256 (nurbs++-3.0.11.tar.bz2) = 61691c401353e5c3bf70f63bc18ce07cefdc802d5abff637f02ea2c86f74fbfe
+SIZE (nurbs++-3.0.11.tar.bz2) = 391439
diff --git a/graphics/nurbs++/files/patch-cvector.h b/graphics/nurbs++/files/patch-cvector.h
new file mode 100644
index 000000000000..6f51f0f59099
--- /dev/null
+++ b/graphics/nurbs++/files/patch-cvector.h
@@ -0,0 +1,16 @@
+--- matrix/cvector.h.orig Mon May 13 14:07:45 2002
++++ matrix/cvector.h Thu Nov 30 23:30:00 2006
+@@ -54,10 +54,10 @@
+ CVector(const BasicArray<T>& v) : Vector<T>(v), index(0) {;}
+ virtual ~CVector() {}
+
+- T& operator[](const int i) { return x[i%sze]; }
+- T operator[](const int i) const { return x[i%sze]; }
++ T& operator[](const int i) { return this->x[i%this->sze]; }
++ T operator[](const int i) const { return this->x[i%this->sze]; }
+
+- void put(T v) { x[index] = v ; index = (index+1)%sze; }
++ void put(T v) { this->x[index] = v ; index = (index+1)%this->sze; }
+
+ protected:
+ int index ;
diff --git a/graphics/nurbs++/files/patch-d_nurbsSub.cpp b/graphics/nurbs++/files/patch-d_nurbsSub.cpp
new file mode 100644
index 000000000000..2a3ddc4842b5
--- /dev/null
+++ b/graphics/nurbs++/files/patch-d_nurbsSub.cpp
@@ -0,0 +1,13 @@
+--- nurbs/d_nurbsSub.cpp.orig Mon May 13 13:11:57 2002
++++ nurbs/d_nurbsSub.cpp Fri Dec 1 01:17:36 2006
+@@ -14,8 +14,8 @@
+ template class RenderMeshPoints<double> ;
+
+
+- double NurbSurface<double>::epsilon = 1e-6 ;
+- double SurfSample<double>::epsilon = 1e-6 ;
++ template <> double NurbSurface<double>::epsilon = 1e-6 ;
++ template <> double SurfSample<double>::epsilon = 1e-6 ;
+
+ template void DrawSubdivision( NurbSurface<double> *, double tolerance );
+ template void DrawEvaluation( NurbSurface<double> * );
diff --git a/graphics/nurbs++/files/patch-f_nurbsSub.cpp b/graphics/nurbs++/files/patch-f_nurbsSub.cpp
new file mode 100644
index 000000000000..afbdb35ec769
--- /dev/null
+++ b/graphics/nurbs++/files/patch-f_nurbsSub.cpp
@@ -0,0 +1,13 @@
+--- nurbs/f_nurbsSub.cpp.orig Mon May 13 13:11:57 2002
++++ nurbs/f_nurbsSub.cpp Fri Dec 1 01:15:08 2006
+@@ -14,8 +14,8 @@
+ template class RenderMeshPoints<float> ;
+
+
+- float NurbSurface<float>::epsilon = 1e-6 ;
+- float SurfSample<float>::epsilon = 1e-6 ;
++ template <> float NurbSurface<float>::epsilon = 1e-6 ;
++ template <> float SurfSample<float>::epsilon = 1e-6 ;
+
+ template void DrawSubdivision( NurbSurface<float> *, float tolerance );
+ template void DrawEvaluation( NurbSurface<float> * );
diff --git a/graphics/nurbs++/files/patch-hnurbsS.cpp b/graphics/nurbs++/files/patch-hnurbsS.cpp
new file mode 100644
index 000000000000..c49e77a858c0
--- /dev/null
+++ b/graphics/nurbs++/files/patch-hnurbsS.cpp
@@ -0,0 +1,383 @@
+--- nurbs/hnurbsS.cpp.orig Fri May 17 11:24:21 2002
++++ nurbs/hnurbsS.cpp Fri Dec 1 00:40:08 2006
+@@ -103,11 +103,11 @@
+ initBase() ;
+ offset.resize(baseSurf.ctrlPnts()) ;
+
+- P = baseSurf.ctrlPnts() ;
+- U = baseSurf.knotU() ;
+- V = baseSurf.knotV() ;
+- degU = baseSurf.degreeU() ;
+- degV = baseSurf.degreeV() ;
++ this->P = baseSurf.ctrlPnts() ;
++ this->U = baseSurf.knotU() ;
++ this->V = baseSurf.knotV() ;
++ this->degU = baseSurf.degreeU() ;
++ this->degV = baseSurf.degreeV() ;
+
+ //updateSurface() ;
+
+@@ -162,11 +162,11 @@
+ baseUpdateN = baseLevel_->modifiedN()-1 ; // Set it so that initBase will run
+ initBase() ;
+ offset.resize(baseSurf.ctrlPnts()) ;
+- P = baseSurf.ctrlPnts() ;
+- U = baseSurf.knotU() ;
+- V = baseSurf.knotV() ;
+- degU = baseSurf.degreeU() ;
+- degV = baseSurf.degreeV() ;
++ this->P = baseSurf.ctrlPnts() ;
++ this->U = baseSurf.knotU() ;
++ this->V = baseSurf.knotV() ;
++ this->degU = baseSurf.degreeU() ;
++ this->degV = baseSurf.degreeV() ;
+ //updateSurface() ;
+
+ }
+@@ -200,7 +200,7 @@
+ rU.resize(0) ;
+ rV.resize(0) ;
+
+- offset = P ;
++ offset = this->P ;
+ }
+
+ /*!
+@@ -334,11 +334,11 @@
+ }
+ if(baseLevel_){
+ if(initBase()){
+- P = baseSurf.ctrlPnts() ;
+- U = baseSurf.knotU() ;
+- V = baseSurf.knotV() ;
+- degU = baseSurf.degreeU() ;
+- degV = baseSurf.degreeV() ;
++ this->P = baseSurf.ctrlPnts() ;
++ this->U = baseSurf.knotU() ;
++ this->V = baseSurf.knotV() ;
++ this->degU = baseSurf.degreeU() ;
++ this->degV = baseSurf.degreeV() ;
+ }
+ if(i0>=0 && j0>=0){
+ Point_nD<T,N> vecOffset ;
+@@ -352,13 +352,13 @@
+ offset(i0,j0).y()*jvec(i0,j0) +
+ offset(i0,j0).z()*kvec(i0,j0) ;
+ }
+- P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
+- P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
+- P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
++ this->P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
++ this->P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
++ this->P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
+ }
+ else{
+- for(int i=0;i<P.rows();++i)
+- for(int j=0;j<P.cols();++j){
++ for(int i=0;i<this->P.rows();++i)
++ for(int j=0;j<this->P.cols();++j){
+ if(offset(i,j).x() != 0 ||
+ offset(i,j).y() != 0 || offset(i,j).z() || 0){
+ Point_nD<T,N> vecOffset ;
+@@ -372,20 +372,20 @@
+ offset(i,j).y()*jvec(i,j) +
+ offset(i,j).z()*kvec(i,j) ;
+ }
+- P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
+- P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
+- P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
++ this->P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
++ this->P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
++ this->P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
+ }
+ }
+ }
+ }
+ else{
+ if(i0>=0 && j0>=0)
+- P(i0,j0) = offset(i0,j0) ;
++ this->P(i0,j0) = offset(i0,j0) ;
+ else{
+- for(int i=0;i<P.rows();++i)
+- for(int j=0;j<P.cols();++j){
+- P(i,j) = offset(i,j) ;
++ for(int i=0;i<this->P.rows();++i)
++ for(int j=0;j<this->P.cols();++j){
++ this->P(i,j) = offset(i,j) ;
+ }
+ }
+ }
+@@ -554,17 +554,17 @@
+ return mod ;
+ }
+
+- if(u<knotU()[0] || u>knotU()[knotU().n()-1])
++ if(u<this->knotU()[0] || u>this->knotU()[this->knotU().n()-1])
+ return -1 ;
+- if(v<knotV()[0] || v>knotU()[knotV().n()-1])
++ if(v<this->knotV()[0] || v>this->knotU()[this->knotV().n()-1])
+ return -1 ;
+
+- int su = findSpanU(u) ;
+- int sv = findSpanV(v) ;
++ int su = this->findSpanU(u) ;
++ int sv = this->findSpanV(v) ;
+
+- for(int i=0;i<=degU;++i)
+- for(int j=0;j<=degV;++j){
+- if(offset(su-degU+i,sv+degV+j) != HPoint_nD<T,N>(0,0,0,0))
++ for(int i=0;i<=this->degU;++i)
++ for(int j=0;j<=this->degV;++j){
++ if(offset(su-this->degU+i,sv+this->degV+j) != HPoint_nD<T,N>(0,0,0,0))
+ return level_ ;
+ }
+
+@@ -742,16 +742,16 @@
+ template <class T, int N>
+ void HNurbsSurface<T,N>::splitUV(int nu, int nv, Vector<T> &nU, Vector<T> &nV){
+
+- nU.resize(knotU().n()*nu) ;
+- nV.resize(knotV().n()*nv) ;
++ nU.resize(this->knotU().n()*nu) ;
++ nV.resize(this->knotV().n()*nv) ;
+
+ int i,j,n ;
+
+ n = 0 ;
+- for(i=1;i<knotU().n();++i){
+- if(knotU()[i] >knotU()[i-1]){
+- T a = knotU()[i-1] ;
+- T b = knotU()[i] ;
++ for(i=1;i<this->knotU().n();++i){
++ if(this->knotU()[i] >this->knotU()[i-1]){
++ T a = this->knotU()[i-1] ;
++ T b = this->knotU()[i] ;
+
+
+ for(j=0;j<nu;++j){
+@@ -763,10 +763,10 @@
+ nU.resize(n) ;
+
+ n = 0 ;
+- for(i=1;i<knotV().n();++i){
+- if(knotV()[i] > knotV()[i-1]){
+- T a = knotV()[i-1] ;
+- T b = knotV()[i] ;
++ for(i=1;i<this->knotV().n();++i){
++ if(this->knotV()[i] > this->knotV()[i-1]){
++ T a = this->knotV()[i-1] ;
++ T b = this->knotV()[i] ;
+
+ for(j=0;j<nv;++j){
+ nV[n] = a + (b-a)*T(j+1)/T(nv+1) ;
+@@ -805,22 +805,22 @@
+ int i,j,n ;
+
+ if(su<=0)
+- su = degU ;
++ su = this->degU ;
+ if(sv<=0)
+- sv = degV ;
+- if(su>degU+1)
+- su = degU+1 ;
+- if(sv>degV+1)
+- sv = degV+1 ;
++ sv = this->degV ;
++ if(su>this->degU+1)
++ su = this->degU+1 ;
++ if(sv>this->degV+1)
++ sv = this->degV+1 ;
+
+- nU.resize(knotU().n()*nu*su) ;
+- nV.resize(knotV().n()*nv*sv) ;
++ nU.resize(this->knotU().n()*nu*su) ;
++ nV.resize(this->knotV().n()*nv*sv) ;
+
+ n = 0 ;
+- for(i=1;i<knotU().n();++i){
+- if(knotU()[i] >knotU()[i-1]){
+- T a = knotU()[i-1] ;
+- T b = knotU()[i] ;
++ for(i=1;i<this->knotU().n();++i){
++ if(this->knotU()[i] >this->knotU()[i-1]){
++ T a = this->knotU()[i-1] ;
++ T b = this->knotU()[i] ;
+
+
+ for(j=0;j<nu;++j){
+@@ -835,10 +835,10 @@
+ nU.resize(n) ;
+
+ n = 0 ;
+- for(i=1;i<knotV().n();++i){
+- if(knotV()[i] > knotV()[i-1]){
+- T a = knotV()[i-1] ;
+- T b = knotV()[i] ;
++ for(i=1;i<this->knotV().n();++i){
++ if(this->knotV()[i] > this->knotV()[i-1]){
++ T a = this->knotV()[i-1] ;
++ T b = this->knotV()[i] ;
+
+ for(j=0;j<nv;++j){
+ T v = a + (b-a)*T(j+1)/T(nv+1) ;
+@@ -1014,10 +1014,10 @@
+ if(!fin.read((char*)&du,sizeof(int))) { delete []type ; return 0 ;}
+ if(!fin.read((char*)&dv,sizeof(int))) { delete []type ; return 0 ;}
+
+- resize(nu,nv,du,dv) ;
++ this->resize(nu,nv,du,dv) ;
+
+- if(!fin.read((char*)U.memory(),sizeof(T)*U.n())) { delete []type ; return 0 ;}
+- if(!fin.read((char*)V.memory(),sizeof(T)*V.n())) { delete []type ; return 0 ;}
++ if(!fin.read((char*)this->U.memory(),sizeof(T)*this->U.n())) { delete []type ; return 0 ;}
++ if(!fin.read((char*)this->V.memory(),sizeof(T)*this->V.n())) { delete []type ; return 0 ;}
+
+ if(!r1){
+ p = new T[3*nu*nv] ;
+@@ -1025,10 +1025,10 @@
+ p2 = p ;
+ for(int i=0;i<nu;i++)
+ for(int j=0;j<nv;j++){
+- P(i,j).x() = *(p++) ;
+- P(i,j).y() = *(p++) ;
+- P(i,j).z() = *(p++) ;
+- P(i,j).w() = 1.0 ;
++ this->P(i,j).x() = *(p++) ;
++ this->P(i,j).y() = *(p++) ;
++ this->P(i,j).z() = *(p++) ;
++ this->P(i,j).w() = 1.0 ;
+ }
+ delete []p2 ;
+ }
+@@ -1038,14 +1038,14 @@
+ p2 = p ;
+ for(int i=0;i<nu;i++)
+ for(int j=0;j<nv;j++){
+- P(i,j).x() = *(p++) ;
+- P(i,j).y() = *(p++) ;
+- P(i,j).z() = *(p++) ;
+- P(i,j).w() = *(p++) ;
++ this->P(i,j).x() = *(p++) ;
++ this->P(i,j).y() = *(p++) ;
++ this->P(i,j).z() = *(p++) ;
++ this->P(i,j).w() = *(p++) ;
+ }
+ delete []p2 ;
+ }
+- offset = P ;
++ offset = this->P ;
+ this->updateSurface() ;
+ }
+ else { // reading the offset information
+@@ -1144,29 +1144,29 @@
+ if(!fout)
+ return 0 ;
+ if(!baseLevel_){
+- int prows = P.rows();
+- int pcols = P.cols();
++ int prows = this->P.rows();
++ int pcols = this->P.cols();
+ char st = '0' + sizeof(T) ;
+ if(!fout.write((char*)&"hns4",sizeof(char)*4)) return 0 ;
+ if(!fout.write((char*)&st,sizeof(char))) return 0 ;
+ if(!fout.write((char*)&prows,sizeof(int))) return 0 ;
+ if(!fout.write((char*)&pcols,sizeof(int))) return 0 ;
+- if(!fout.write((char*)&degU,sizeof(int))) return 0 ;
+- if(!fout.write((char*)&degV,sizeof(int))) return 0 ;
+- if(!fout.write((char*)U.memory(),sizeof(T)*U.n())) return 0 ;
+- if(!fout.write((char*)V.memory(),sizeof(T)*V.n())) return 0 ;
++ if(!fout.write((char*)&this->degU,sizeof(int))) return 0 ;
++ if(!fout.write((char*)&this->degV,sizeof(int))) return 0 ;
++ if(!fout.write((char*)this->U.memory(),sizeof(T)*this->U.n())) return 0 ;
++ if(!fout.write((char*)this->V.memory(),sizeof(T)*this->V.n())) return 0 ;
+
+ T *p,*p2 ;
+- p = new T[P.rows()*P.cols()*4] ;
++ p = new T[this->P.rows()*this->P.cols()*4] ;
+ p2 = p ;
+- for(int i=0;i<P.rows();i++)
+- for(int j=0;j<P.cols();j++){
++ for(int i=0;i<this->P.rows();i++)
++ for(int j=0;j<this->P.cols();j++){
+ *p = offset(i,j).x() ; p++ ;
+ *p = offset(i,j).y() ; p++ ;
+ *p = offset(i,j).z() ; p++ ;
+ *p = offset(i,j).w() ; p++ ;
+ }
+- if(!fout.write((char*)p2,sizeof(T)*P.rows()*P.cols()*4)) return 0 ;
++ if(!fout.write((char*)p2,sizeof(T)*this->P.rows()*this->P.cols()*4)) return 0 ;
+ delete []p2 ;
+ }
+ else{
+@@ -1282,7 +1282,7 @@
+ int i,j ;
+ j = 0 ;
+ for(i=0;i<X.n();++i){
+- if(X[i]>=U[0] && X[i]<=U[U.n()-1]){
++ if(X[i]>=this->U[0] && X[i]<=this->U[this->U.n()-1]){
+ Xu[j] = X[i] ;
+ ++j ;
+ }
+@@ -1294,7 +1294,7 @@
+ nextLevel_->refineKnotU(Xu) ;
+ }
+
+- NurbsSurface<T,N> osurf(degU,degV,U,V,offset) ;
++ NurbsSurface<T,N> osurf(this->degU,this->degV,this->U,this->V,offset) ;
+
+ osurf.refineKnotU(Xu) ;
+
+@@ -1324,7 +1324,7 @@
+ int i,j ;
+ j = 0 ;
+ for(i=0;i<X.n();++i){
+- if(X[i]>=V[0] && X[i]<=V[V.n()-1]){
++ if(X[i]>=this->V[0] && X[i]<=this->V[this->V.n()-1]){
+ Xv[j] = X[i] ;
+ ++j ;
+ }
+@@ -1336,7 +1336,7 @@
+ nextLevel_->refineKnotV(Xv) ;
+ }
+
+- NurbsSurface<T,N> osurf(degU,degV,U,V,offset) ;
++ NurbsSurface<T,N> osurf(this->degU,this->degV,this->U,this->V,offset) ;
+
+ osurf.refineKnotV(Xv) ;
+
+@@ -1370,26 +1370,26 @@
+ */
+ template <class T, int N>
+ int HNurbsSurface<T,N>::movePointOffset(T u, T v, const Point_nD<T,N>& delta){
+- P = offset ;
++ this->P = offset ;
+
+ // by definition the offset has w = 0 , but this isn't valid for
+ // the control points, increasing the w by 1, will generate a valid surface
+ if(baseLevel_)
+- for(int i=0;i<P.rows();++i)
+- for(int j=0;j<P.cols();++j){
+- P(i,j).w() += T(1) ;
++ for(int i=0;i<this->P.rows();++i)
++ for(int j=0;j<this->P.cols();++j){
++ this->P(i,j).w() += T(1) ;
+ }
+
+ if(NurbsSurface<T,N>::movePoint(u,v,delta)){
+- offset = P ;
++ offset = this->P ;
+ // need to reset the offset weights
+ if(baseLevel_)
+- for(int i=0;i<P.rows();++i)
+- for(int j=0;j<P.cols();++j){
+- P(i,j).w() -= T(1) ;
++ for(int i=0;i<this->P.rows();++i)
++ for(int j=0;j<this->P.cols();++j){
++ this->P(i,j).w() -= T(1) ;
+ }
+
+- P = baseSurf.ctrlPnts() ;
++ this->P = baseSurf.ctrlPnts() ;
+ updateSurface() ;
+ return 1 ;
+ }
diff --git a/graphics/nurbs++/files/patch-hnurbsS_sp.cpp b/graphics/nurbs++/files/patch-hnurbsS_sp.cpp
new file mode 100644
index 000000000000..225f1058df17
--- /dev/null
+++ b/graphics/nurbs++/files/patch-hnurbsS_sp.cpp
@@ -0,0 +1,412 @@
+--- nurbs/hnurbsS_sp.cpp.orig Mon May 13 14:07:46 2002
++++ nurbs/hnurbsS_sp.cpp Fri Dec 1 01:01:28 2006
+@@ -43,7 +43,7 @@
+ */
+ template <class T, int N>
+ void HNurbsSurfaceSP<T,N>::updateMaxU() {
+- if(degU>3){
++ if(this->degU>3){
+ #ifdef USE_EXCEPTION
+ throw NurbsError();
+ #else
+@@ -53,12 +53,12 @@
+ #endif
+ }
+ else{
+- maxU.resize(P.rows()) ;
+- maxAtU_.resize(P.rows()) ;
+- for(int i=0;i<P.rows();++i){
+- if(!maxInfluence(i,U,degU,maxAtU_[i]))
++ maxU.resize(this->P.rows()) ;
++ maxAtU_.resize(this->P.rows()) ;
++ for(int i=0;i<this->P.rows();++i){
++ if(!maxInfluence(i,this->U,this->degU,maxAtU_[i]))
+ cerr << "Problem in maxInfluence U!\n" ;
+- maxU[i] = nurbsBasisFun(maxAtU_[i],i,degU,U) ;
++ maxU[i] = nurbsBasisFun(maxAtU_[i],i,this->degU,this->U) ;
+ }
+
+ }
+@@ -78,7 +78,7 @@
+ */
+ template <class T, int N>
+ void HNurbsSurfaceSP<T,N>::updateMaxV() {
+- if(degV>3){
++ if(this->degV>3){
+ #ifdef USE_EXCEPTION
+ throw NurbsError();
+ #else
+@@ -88,12 +88,12 @@
+ #endif
+ }
+ else{
+- maxV.resize(P.cols()) ;
+- maxAtV_.resize(P.cols()) ;
+- for(int i=0;i<P.cols();++i){
+- if(!maxInfluence(i,V,degV,maxAtV_[i]))
++ maxV.resize(this->P.cols()) ;
++ maxAtV_.resize(this->P.cols()) ;
++ for(int i=0;i<this->P.cols();++i){
++ if(!maxInfluence(i,this->V,this->degV,maxAtV_[i]))
+ cerr << "Problem in maxInfluence V!\n" ;
+- maxV[i] = nurbsBasisFun(maxAtV_[i],i,degV,V) ;
++ maxV[i] = nurbsBasisFun(maxAtV_[i],i,this->degV,this->V) ;
+ }
+
+ }
+@@ -113,18 +113,18 @@
+ */
+ template <class T, int N>
+ void HNurbsSurfaceSP<T,N>::modSurfCPby(int i, int j, const HPoint_nD<T,N>& a) {
+- offset(i,j) += a / (maxU[i]*maxV[j]) ;
+- if(baseLevel_){
++ this->offset(i,j) += a / (maxU[i]*maxV[j]) ;
++ if(this->baseLevel_){
+ Point_nD<T,N> vecOffset ;
+- vecOffset = offset(i,j).x()*ivec(i,j) +
+- offset(i,j).y()*jvec(i,j) +
+- offset(i,j).z()*kvec(i,j) ;
+- P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
+- P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
+- P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
++ vecOffset = this->offset(i,j).x()*this->ivec(i,j) +
++ this->offset(i,j).y()*this->jvec(i,j) +
++ this->offset(i,j).z()*this->kvec(i,j) ;
++ this->P(i,j).x() = this->baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
++ this->P(i,j).y() = this->baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
++ this->P(i,j).z() = this->baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
+ }
+ else
+- P(i,j) = offset(i,j) ;
++ this->P(i,j) = this->offset(i,j) ;
+ }
+
+ /*!
+@@ -151,24 +151,24 @@
+ void HNurbsSurfaceSP<T,N>::modOnlySurfCPby(int i, int j, const HPoint_nD<T,N>& a){
+ int k ;
+
+- P = offset ;
++ this->P = this->offset ;
+
+ // by definition the offset has w = 0 , but this isn't valid for
+ // the control points, increasing the w by 1, will generate a valid surface
+- if(baseLevel_)
+- for(k=0;k<P.rows();++k)
+- for(int l=0;l<P.cols();++l)
+- P(k,l).w() += T(1) ;
++ if(this->baseLevel_)
++ for(k=0;k<this->P.rows();++k)
++ for(int l=0;l<this->P.cols();++l)
++ this->P(k,l).w() += T(1) ;
+
+ int sizeU, sizeV ;
+
+- sizeU = 2*degU+3 ;
+- if(i-degU-1<0) sizeU += i-degU-1 ;
+- if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
+-
+- sizeV = 2*degV+3 ;
+- if(j-degV-1<0) sizeV += j-degV-1 ;
+- if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
++ sizeU = 2*this->degU+3 ;
++ if(i-this->degU-1<0) sizeU += i-this->degU-1 ;
++ if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
++
++ sizeV = 2*this->degV+3 ;
++ if(j-this->degV-1<0) sizeV += j-this->degV-1 ;
++ if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
+
+ Vector<T> u(sizeU) ;
+ Vector<T> v(sizeV) ;
+@@ -179,16 +179,16 @@
+ int n=0;
+ int nu = 0 ;
+ int nv = 0 ;
+- for(k=i-degU-1;k<=i+degU+1;++k){
++ for(k=i-this->degU-1;k<=i+this->degU+1;++k){
+ if(k<0)
+ continue ;
+- if(k>=P.rows())
++ if(k>=this->P.rows())
+ break ;
+ nv = 0 ;
+- for(int l=j-degV-1;l<=j+degV+1;++l){
++ for(int l=j-this->degV-1;l<=j+this->degV+1;++l){
+ if(l<0)
+ continue ;
+- if(l>=P.cols())
++ if(l>=this->P.cols())
+ break ;
+ if( k == i && j==l){
+ pts[n].x() = a.x() ;
+@@ -216,12 +216,12 @@
+ pv.resize(n) ;
+
+ if(NurbsSurface<T,N>::movePoint(u,v,pts,pu,pv)){
+- offset = P ;
++ this->offset = this->P ;
+ // an offset shouldn't have a weight value.
+- if(baseLevel_)
+- for(k=0;k<P.rows();++k)
+- for(int l=0;l<P.cols();++l)
+- offset(k,l).w() -= T(1) ;
++ if(this->baseLevel_)
++ for(k=0;k<this->P.rows();++k)
++ for(int l=0;l<this->P.cols();++l)
++ this->offset(k,l).w() -= T(1) ;
+ }
+ updateSurface();
+ }
+@@ -262,12 +262,12 @@
+ HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel(int n, int s) {
+ HNurbsSurfaceSP<T,N> *newLevel ;
+
+- if(nextLevel_)
++ if(this->nextLevel_)
+ return 0 ;
+
+ Vector<T> newU,newV ;
+
+- splitUV(n,s,n,s,newU,newV) ;
++ this->splitUV(n,s,n,s,newU,newV) ;
+
+ newLevel = new HNurbsSurfaceSP<T,N>(this,newU,newV) ;
+
+@@ -289,7 +289,7 @@
+ HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel() {
+ HNurbsSurfaceSP<T,N> *newLevel ;
+
+- if(nextLevel_)
++ if(this->nextLevel_)
+ return 0 ;
+
+ newLevel = new HNurbsSurfaceSP<T,N>(this) ;
+@@ -311,23 +311,23 @@
+ levelP = nS.nextLevel() ;
+
+ NurbsSurface<T,N>::operator=(nS) ;
+- rU = nS.rU ;
+- rV = nS.rV ;
+- offset = nS.offset ;
++ this->rU = nS.rU ;
++ this->rV = nS.rV ;
++ this->offset = nS.offset ;
+
+ updateMaxUV() ;
+
+- firstLevel_ = this ;
++ this->firstLevel_ = this ;
+
+ if(levelP){
+ HNurbsSurfaceSP<T,N> *newLevel ;
+ newLevel = new HNurbsSurfaceSP<T,N>(this) ;
+ newLevel->copy(*levelP) ;
+- nextLevel_ = newLevel ;
+- lastLevel_ = nextLevel_->lastLevel() ;
++ this->nextLevel_ = newLevel ;
++ this->lastLevel_ = this->nextLevel_->lastLevel() ;
+ }
+ else{
+- lastLevel_ = this ;
++ this->lastLevel_ = this ;
+ }
+
+ }
+@@ -349,55 +349,55 @@
+ template <class T, int N>
+ void HNurbsSurfaceSP<T,N>::updateSurface(int i0, int j0){
+ if(i0>=0 && j0>=0){
+- if(offset(i0,j0).x()==0.0 && offset(i0,j0).y()==0.0 && offset(i0,j0).z()==0.0)
++ if(this->offset(i0,j0).x()==0.0 && this->offset(i0,j0).y()==0.0 && this->offset(i0,j0).z()==0.0)
+ return ;
+ }
+- if(baseLevel_){
+- if(initBase()){
+- P = baseSurf.ctrlPnts() ;
+- U = baseSurf.knotU() ;
+- V = baseSurf.knotV() ;
+- degU = baseSurf.degreeU() ;
+- degV = baseSurf.degreeV() ;
++ if(this->baseLevel_){
++ if(this->initBase()){
++ this->P = this->baseSurf.ctrlPnts() ;
++ this->U = this->baseSurf.knotU() ;
++ this->V = this->baseSurf.knotV() ;
++ this->degU = this->baseSurf.degreeU() ;
++ this->degV = this->baseSurf.degreeV() ;
+ updateMaxUV() ;
+ }
+ if(i0>=0 && j0>=0){
+ Point_nD<T,N> vecOffset ;
+- vecOffset = offset(i0,j0).x()*ivec(i0,j0) +
+- offset(i0,j0).y()*jvec(i0,j0) +
+- offset(i0,j0).z()*kvec(i0,j0) ;
+- P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
+- P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
+- P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
++ vecOffset = this->offset(i0,j0).x()*this->ivec(i0,j0) +
++ this->offset(i0,j0).y()*this->jvec(i0,j0) +
++ this->offset(i0,j0).z()*this->kvec(i0,j0) ;
++ this->P(i0,j0).x() = this->baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
++ this->P(i0,j0).y() = this->baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
++ this->P(i0,j0).z() = this->baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
+ }
+ else{
+- for(int i=0;i<P.rows();++i)
+- for(int j=0;j<P.cols();++j){
+- if(offset(i,j).x() != 0 ||
+- offset(i,j).y() != 0 || offset(i,j).z() || 0){
++ for(int i=0;i<this->P.rows();++i)
++ for(int j=0;j<this->P.cols();++j){
++ if(this->offset(i,j).x() != 0 ||
++ this->offset(i,j).y() != 0 || this->offset(i,j).z() || 0){
+ Point_nD<T,N> vecOffset ;
+- vecOffset = offset(i,j).x()*ivec(i,j) +
+- offset(i,j).y()*jvec(i,j) +
+- offset(i,j).z()*kvec(i,j) ;
+- P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
+- P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
+- P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
++ vecOffset = this->offset(i,j).x()*this->ivec(i,j) +
++ this->offset(i,j).y()*this->jvec(i,j) +
++ this->offset(i,j).z()*this->kvec(i,j) ;
++ this->P(i,j).x() = this->baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
++ this->P(i,j).y() = this->baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
++ this->P(i,j).z() = this->baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
+ }
+ }
+ }
+ }
+ else{
+ if(i0>=0 && j0>=0)
+- P(i0,j0) = offset(i0,j0) ;
++ this->P(i0,j0) = this->offset(i0,j0) ;
+ else{
+- for(int i=0;i<P.rows();++i)
+- for(int j=0;j<P.cols();++j){
+- P(i,j) = offset(i,j) ;
++ for(int i=0;i<this->P.rows();++i)
++ for(int j=0;j<this->P.cols();++j){
++ this->P(i,j) = this->offset(i,j) ;
+ }
+ }
+ }
+
+- ++updateN ;
++ ++(this->updateN) ;
+ }
+
+ /*!
+@@ -413,7 +413,7 @@
+ if(!okMax())
+ updateMaxUV() ;
+ if(upLevel>=0){
+- if(level()<=upLevel){
++ if(this->level()<=upLevel){
+ this->updateSurface() ;
+ }
+ }
+@@ -421,9 +421,9 @@
+ this->updateSurface() ;
+ }
+
+- if(upLevel>level() || upLevel<0){
+- if(nextLevel_)
+- ((HNurbsSurfaceSP<T,N>*)nextLevel_)->updateLevels(upLevel) ;
++ if(upLevel>this->level() || upLevel<0){
++ if(this->nextLevel_)
++ ((HNurbsSurfaceSP<T,N>*)this->nextLevel_)->updateLevels(upLevel) ;
+ }
+ }
+
+@@ -458,10 +458,10 @@
+ if(!fin.read((char*)&du,sizeof(int))) { delete []type ; return 0 ;}
+ if(!fin.read((char*)&dv,sizeof(int))) { delete []type ; return 0 ;}
+
+- resize(nu,nv,du,dv) ;
++ this->resize(nu,nv,du,dv) ;
+
+- if(!fin.read((char*)U.memory(),sizeof(T)*U.n())) { delete []type ; return 0 ;}
+- if(!fin.read((char*)V.memory(),sizeof(T)*V.n())) { delete []type ; return 0 ;}
++ if(!fin.read((char*)this->U.memory(),sizeof(T)*this->U.n())) { delete []type ; return 0 ;}
++ if(!fin.read((char*)this->V.memory(),sizeof(T)*this->V.n())) { delete []type ; return 0 ;}
+
+ if(!r1){
+ p = new T[3*nu*nv] ;
+@@ -469,10 +469,10 @@
+ p2 = p ;
+ for(int i=0;i<nu;i++)
+ for(int j=0;j<nv;j++){
+- P(i,j).x() = *(p++) ;
+- P(i,j).y() = *(p++) ;
+- P(i,j).z() = *(p++) ;
+- P(i,j).w() = 1.0 ;
++ this->P(i,j).x() = *(p++) ;
++ this->P(i,j).y() = *(p++) ;
++ this->P(i,j).z() = *(p++) ;
++ this->P(i,j).w() = 1.0 ;
+ }
+ delete []p2 ;
+ }
+@@ -482,26 +482,26 @@
+ p2 = p ;
+ for(int i=0;i<nu;i++)
+ for(int j=0;j<nv;j++){
+- P(i,j).x() = *(p++) ;
+- P(i,j).y() = *(p++) ;
+- P(i,j).z() = *(p++) ;
+- P(i,j).w() = *(p++) ;
++ this->P(i,j).x() = *(p++) ;
++ this->P(i,j).y() = *(p++) ;
++ this->P(i,j).z() = *(p++) ;
++ this->P(i,j).w() = *(p++) ;
+ }
+ delete []p2 ;
+ }
+- offset = P ;
++ this->offset = this->P ;
+ this->updateSurface() ;
+ }
+ else { // reading the offset information
+ int ru,rv ;
+ if(!fin.read((char*)&ru,sizeof(int))) { delete []type ; return 0 ;}
+ if(!fin.read((char*)&rv,sizeof(int))) { delete []type ; return 0 ;}
+- rU.resize(ru) ;
+- rV.resize(rv) ;
+- if(rU.n()>0)
+- if(!fin.read((char*)rU.memory(),sizeof(T)*rU.n())) { delete []type ; return 0 ;}
+- if(rV.n()>0)
+- if(!fin.read((char*)rV.memory(),sizeof(T)*rV.n())) { delete []type ; return 0 ;}
++ this->rU.resize(ru) ;
++ this->rV.resize(rv) ;
++ if(this->rU.n()>0)
++ if(!fin.read((char*)this->rU.memory(),sizeof(T)*this->rU.n())) { delete []type ; return 0 ;}
++ if(this->rV.n()>0)
++ if(!fin.read((char*)this->rV.memory(),sizeof(T)*this->rV.n())) { delete []type ; return 0 ;}
+
+ if(!fin.read((char*)&nu,sizeof(int))) { delete []type ; return 0 ;}
+ if(!fin.read((char*)&nv,sizeof(int))) { delete []type ; return 0 ;}
+@@ -509,16 +509,16 @@
+ p = new T[4*nu*nv] ;
+ if(!fin.read((char*)p,sizeof(T)*4*nu*nv)) { delete []type ; return 0 ;}
+ p2 = p ;
+- offset.resize(nu,nv) ;
++ this->offset.resize(nu,nv) ;
+ for(int i=0;i<nu;i++)
+ for(int j=0;j<nv;j++){
+- offset(i,j).x() = *(p++) ;
+- offset(i,j).y() = *(p++) ;
+- offset(i,j).z() = *(p++) ;
+- offset(i,j).w() = *(p++) ;
++ this->offset(i,j).x() = *(p++) ;
++ this->offset(i,j).y() = *(p++) ;
++ this->offset(i,j).z() = *(p++) ;
++ this->offset(i,j).w() = *(p++) ;
+ }
+ delete []p2 ;
+- --baseUpdateN ;
++ --(this->baseUpdateN) ;
+ this->updateSurface() ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-image.cpp b/graphics/nurbs++/files/patch-image.cpp
new file mode 100644
index 000000000000..cf3924fa63c1
--- /dev/null
+++ b/graphics/nurbs++/files/patch-image.cpp
@@ -0,0 +1,98 @@
+--- image/image.cpp.orig Mon May 13 14:07:45 2002
++++ image/image.cpp Thu Nov 30 23:57:14 2006
+@@ -55,9 +55,9 @@
+ void MatrixImage<T>::drawLine(int i1, int j1, int i2, int j2, T color){
+ int i,j ;
+ double mx,b ;
+- if(i1<0 || j1<0 || i1>rows() || j1>=cols() ){
++ if(i1<0 || j1<0 || i1>this->rows() || j1>=this->cols() ){
+ #ifdef USE_EXCEPTION
+- throw OutOfBound2D(i1,j1,0,rows()-1,0,cols()-1) ;
++ throw OutOfBound2D(i1,j1,0,this->rows()-1,0,this->cols()-1) ;
+ #else
+ Error error("MatrixImage<T>::drawLine") ;
+ error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
+@@ -65,9 +65,9 @@
+ #endif
+ return ;
+ }
+- if(i2 <0 || j2<0 || i2>rows() || j2>=cols() ){
++ if(i2 <0 || j2<0 || i2>this->rows() || j2>=this->cols() ){
+ #ifdef USE_EXCEPTION
+- throw OutOfBound2D(i2,j2,0,rows()-1,0,cols()-1) ;
++ throw OutOfBound2D(i2,j2,0,this->rows()-1,0,this->cols()-1) ;
+ #else
+ Error error("MatrixImage<T>::drawLine") ;
+ error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
+@@ -79,7 +79,7 @@
+ // check if line is vertical
+ if(j1==j2){
+ for(i=minimum(i1,i2);i<=maximum(i1,i2);i++)
+- operator()(i,j1) = color ;
++ this->operator()(i,j1) = color ;
+ return ;
+ }
+ mx = (double)(i1-i2)/(double)(j1-j2) ;
+@@ -88,13 +88,13 @@
+ if(i1>i2){
+ for(i=i1;i>=i2;i--){
+ j = int(((double)i-b)/mx) ;
+- operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
+ }
+ }
+ else{
+ for(i=i1;i<=i2;i++){
+ j = (int)((i-b)/mx) ;
+- operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
+ }
+ }
+ }
+@@ -102,13 +102,13 @@
+ if(j1>j2){
+ for(j=j1;j>=j2;j--){
+ i = (int)(mx*j+b) ;
+- operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
+ }
+ }
+ else{
+ for(j=j1;j<=j2;j++){
+ i = (int)(mx*j+b) ;
+- operator()(i,j) = color ;
++ this->operator()(i,j) = color ;
+ }
+ }
+ }
+@@ -133,9 +133,9 @@
+ void MatrixImage<T>::drawPoint(int i, int j, double r , T color){
+ for(int y=i-int(ceil(r)) ; y<i+int(ceil(r)) ; y++)
+ for(int x = j-int(ceil(r)) ; x<j+int(ceil(r)) ; x++){
+- if(y>=0 && y<rows() && x>=0 && x<cols()){
++ if(y>=0 && y<this->rows() && x>=0 && x<this->cols()){
+ if( ((y-i)*(y-i)+(x-j)*(x-j))<= r*r)
+- operator()(y,x) = color ;
++ this->operator()(y,x) = color ;
+ }
+ }
+ }
+@@ -153,14 +153,14 @@
+ */
+ template <class T>
+ void MatrixImage<T>::store(Matrix<T>& a){
+- if(a.rows() != rows() || a.cols() != cols()) {
+- a.resize(rows(),cols()) ;
++ if(a.rows() != this->rows() || a.cols() != this->cols()) {
++ a.resize(this->rows(),this->cols()) ;
+ }
+ T *aptr, *bptr ;
+ int size,i ;
+ aptr = &a(0,0)-1 ;
+- bptr = m-1 ;
+- size = cols()*rows() ;
++ bptr = this->m-1 ;
++ size = this->cols()*this->rows() ;
+ for(i=0;i<size;i++)
+ *(++aptr) = *(++bptr) ;
+ }
diff --git a/graphics/nurbs++/files/patch-image_color.cpp b/graphics/nurbs++/files/patch-image_color.cpp
new file mode 100644
index 000000000000..92830f043182
--- /dev/null
+++ b/graphics/nurbs++/files/patch-image_color.cpp
@@ -0,0 +1,29 @@
+--- image/color.cpp.orig 2008-02-13 22:28:08.000000000 +0100
++++ image/color.cpp 2008-02-13 22:28:56.000000000 +0100
+@@ -50,7 +50,7 @@
+ Color blackColor(0,0,0) ;
+ */
+
+- double
++ template<> double
+ Matrix<Color>::norm(void) {
+ #ifdef USE_EXCEPTION
+ throw MatrixErr();
+@@ -63,7 +63,7 @@
+ }
+
+ #ifndef USING_VCC
+- int Matrix<Color>::read(char* filename,int r, int c) {
++ template<> int Matrix<Color>::read(char* filename,int r, int c) {
+ ifstream fin(filename) ;
+ if(!fin) {
+ resize(1,1) ;
+@@ -89,7 +89,7 @@
+ }
+ #endif
+
+- int Vector<Color>::minIndex() const {
++ template<> int Vector<Color>::minIndex() const {
+ #ifdef USE_EXCEPTION
+ throw MatrixErr() ;
+ #else
diff --git a/graphics/nurbs++/files/patch-list.h b/graphics/nurbs++/files/patch-list.h
new file mode 100644
index 000000000000..2f33d10e36cb
--- /dev/null
+++ b/graphics/nurbs++/files/patch-list.h
@@ -0,0 +1,10 @@
+--- matrix/list.h.orig Mon May 13 14:07:45 2002
++++ matrix/list.h Fri Dec 1 00:21:47 2006
+@@ -89,6 +89,7 @@
+ int resetMode() const { return reset_mode ; }
+ void setResetMode(ListResetMode a ) { reset_mode = a ; }
+
++ BasicList<T> const &by_ref() { return *this ; }
+ protected:
+ BasicNode<T> *first_,*last_ ;
+ int n ;
diff --git a/graphics/nurbs++/files/patch-matrix.cpp b/graphics/nurbs++/files/patch-matrix.cpp
new file mode 100644
index 000000000000..f22724d10fbb
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix.cpp
@@ -0,0 +1,378 @@
+--- matrix/matrix.cpp.orig Mon May 13 14:07:45 2002
++++ matrix/matrix.cpp Thu Nov 30 23:43:36 2006
+@@ -54,19 +54,19 @@
+ if ( this == &a )
+ return *this;
+
+- if ( a.rows() != rows() || a.cols() != cols() ){
+- resize(a.rows(),a.cols()) ;
++ if ( a.rows() != this->rows() || a.cols() != this->cols() ){
++ this->resize(a.rows(),a.cols()) ;
+ }
+
+- int sze = rows()*cols() ;
++ int sze = this->rows()*this->cols() ;
+ T *ptr, *aptr ;
+- ptr = m-1 ;
++ ptr = this->m-1 ;
+ aptr = a.m-1 ;
+
+ for (i = sze; i > 0; --i)
+ *(++ptr) = *(++aptr) ;
+
+- by_columns = a.by_columns;
++ this->by_columns = a.by_columns;
+
+ return *this;
+ }
+@@ -100,10 +100,10 @@
+ {
+ int rwz,coz,i,j;
+
+- if ( rows() % a.rows() != 0 || cols() % a.cols() != 0 || rows() < a.rows() || cols() < a.cols() )
++ if ( this->rows() % a.rows() != 0 || this->cols() % a.cols() != 0 || this->rows() < a.rows() || this->cols() < a.cols() )
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize2D(rows(),cols(),a.rows(),a.cols()) ;
++ throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols()) ;
+ #else
+ Error error("Matrix<T>::submatrix");
+ error << "Matrix and submatrix incommensurate" ;
+@@ -111,10 +111,10 @@
+ #endif
+ }
+
+- if ( sr >= rows()/a.rows() || sr < 0 || sc >= cols()/a.cols() || sc < 0 )
++ if ( sr >= this->rows()/a.rows() || sr < 0 || sc >= this->cols()/a.cols() || sc < 0 )
+ {
+ #ifdef USE_EXCEPTION
+- throw OutOfBound2D(sr,sc,0,rows()/a.rows()-1,0,cols()/a.cols()-1) ;
++ throw OutOfBound2D(sr,sc,0,this->rows()/a.rows()-1,0,this->cols()/a.cols()-1) ;
+ #else
+ Error error("Matrix<T>::submatrix");
+ error << "Submatrix location out of bounds.\nrowblock " << sr << ", " << rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
+@@ -133,7 +133,7 @@
+ aptr = a.m - 1;
+ for ( i = a.rows()-1; i >= 0; --i )
+ {
+- ptr = &m[(i+rwz)*cols()+coz]-1 ;
++ ptr = &this->m[(i+rwz)*this->cols()+coz]-1 ;
+ for ( j = a.cols(); j > 0; --j)
+ *(++ptr) = *(++aptr) ;
+ }
+@@ -159,7 +159,7 @@
+ // Assign matrix a to this matrix at (i,j)
+ int i, j;
+
+- if ( (rw + a.rows()) > rows() || ( cl + a.cols()) > cols()) {
++ if ( (rw + a.rows()) > this->rows() || ( cl + a.cols()) > this->cols()) {
+ #ifdef USE_EXCEPTION
+ throw MatrixErr();
+ #else
+@@ -177,7 +177,7 @@
+ T *pptr,*aptr ;
+ aptr = a.m-1 ;
+ for ( i = 0; i<a.rows(); ++i) {
+- pptr = &m[(i+rw)*cols()+cl]-1 ;
++ pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
+ for ( j = 0; j < a.cols(); ++j)
+ *(++pptr) = *(++aptr);
+ }
+@@ -208,7 +208,7 @@
+ Matrix<T> Matrix<T>::get(int rw, int cl, int nr, int nc) const
+ {
+ Matrix<T> getmat(nr,nc) ;
+- if ( (rw+nr) > rows() || (cl+nc) > cols()) {
++ if ( (rw+nr) > this->rows() || (cl+nc) > this->cols()) {
+ #ifdef USE_EXCEPTION
+ throw MatrixErr();
+ #else
+@@ -228,7 +228,7 @@
+ T *pptr,*aptr ;
+ aptr = getmat.m-1;
+ for (i = 0; i < nr; ++i) {
+- pptr = &m[(i+rw)*cols()+cl]-1 ;
++ pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
+ for ( j = 0; j < nc; ++j)
+ *(++aptr) = *(++pptr) ;
+ }
+@@ -252,11 +252,11 @@
+ double sum, maxsum;
+ int init=0 ;
+ T *pptr ;
+- pptr = m-1 ;
++ pptr = this->m-1 ;
+ maxsum = 0 ; // Silence the warning message
+- for(i=0;i<rows();++i){
++ for(i=0;i<this->rows();++i){
+ sum = 0 ;
+- for ( j = 0; j < cols(); ++j)
++ for ( j = 0; j < this->cols(); ++j)
+ sum += *(++pptr) ;
+ if(init)
+ maxsum = (maxsum>sum) ? maxsum : sum;
+@@ -285,12 +285,12 @@
+ {
+ int i, iend;
+
+- iend = rows();
+- if ( iend > cols() )
+- iend = cols();
++ iend = this->rows();
++ if ( iend > this->cols() )
++ iend = this->cols();
+
+ for (i = iend-1; i >=0; --i)
+- elem(i,i) = a;
++ this->elem(i,i) = a;
+
+ }
+
+@@ -308,10 +308,10 @@
+ template <class T>
+ Vector<T> Matrix<T>::getDiag(){
+ int i, iend;
+- Vector<T> vec(minimum(rows(),cols())) ;
+- iend = minimum(rows(),cols());
++ Vector<T> vec(minimum(this->rows(),this->cols())) ;
++ iend = minimum(this->rows(),this->cols());
+ for (i = iend-1; i >=0; --i)
+- vec[i] = elem(i,i);
++ vec[i] = this->elem(i,i);
+ return vec ;
+ }
+
+@@ -328,8 +328,8 @@
+ Matrix<T>& Matrix<T>::operator+=(double a)
+ {
+ T *p1 ;
+- p1 = m-1 ;
+- const int size = rows()*cols() ;
++ p1 = this->m-1 ;
++ const int size = this->rows()*this->cols() ;
+ for(int i=size; i>0; --i)
+ *(++p1) += a ;
+ return *this ;
+@@ -348,8 +348,8 @@
+ Matrix<T>& Matrix<T>::operator-=(double a)
+ {
+ T *p1 ;
+- p1 = m-1 ;
+- const int size = rows()*cols() ;
++ p1 = this->m-1 ;
++ const int size = this->rows()*this->cols() ;
+ for(int i=size; i>0; --i)
+ *(++p1) -= a ;
+ return *this ;
+@@ -368,8 +368,8 @@
+ Matrix<T>& Matrix<T>::operator*=(double a)
+ {
+ T *p1 ;
+- p1 = m-1 ;
+- const int size = rows()*cols() ;
++ p1 = this->m-1 ;
++ const int size = this->rows()*this->cols() ;
+ for(int i=size; i>0; --i)
+ *(++p1) *= a ;
+ return *this ;
+@@ -388,8 +388,8 @@
+ Matrix<T>& Matrix<T>::operator/=(double a)
+ {
+ T *p1 ;
+- p1 = m-1 ;
+- const int size = rows()*cols() ;
++ p1 = this->m-1 ;
++ const int size = this->rows()*this->cols() ;
+ for(int i=size; i>0; --i)
+ *(++p1) /= a ;
+ return *this ;
+@@ -408,15 +408,15 @@
+ template <class T>
+ Matrix<T>& Matrix<T>::operator+=(const Matrix<T> &a)
+ {
+- if ( a.rows() != rows() || a.cols() != cols() )
++ if ( a.rows() != this->rows() || a.cols() != this->cols() )
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
++ throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
+ #else
+ Error error("Matrix<T>::operator+=") ;
+- if ( rows() != a.rows() )
++ if ( this->rows() != a.rows() )
+ error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
+- if ( cols() != a.cols())
++ if ( this->cols() != a.cols())
+ error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
+ error.fatal() ;
+ #endif
+@@ -425,8 +425,8 @@
+ int i, sze ;
+ T *aptr,*sptr ;
+ aptr = a.m - 1 ;
+- sptr = m - 1 ;
+- sze = rows()*cols() ;
++ sptr = this->m - 1 ;
++ sze = this->rows()*this->cols() ;
+ for (i = sze; i > 0; --i){
+ *(++sptr) += *(++aptr) ;
+ }
+@@ -468,16 +468,16 @@
+ template <class T>
+ Matrix<T>& Matrix<T>::operator-=(const Matrix<T> &a)
+ {
+- if ( a.rows() != rows() || a.cols() != cols() )
++ if ( a.rows() != this->rows() || a.cols() != this->cols() )
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
++ throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
+ #else
+ Error error("Matrix<T>::operator-=") ;
+- if ( rows() != a.rows() )
+- error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
+- if ( cols() != a.cols())
+- error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
++ if ( this->rows() != a.rows() )
++ error << "Matrices are of diferent size, a.rows() = " << this->rows() << " and b.rows() = " << a.rows() << endl ;
++ if ( this->cols() != a.cols())
++ error << "Matrices are of diferent size, a.cols() = " << this->cols() << " and b.cols() = " << a.cols() << endl ;
+ error.fatal() ;
+ #endif
+ }
+@@ -485,8 +485,8 @@
+ int i, size;
+ T *aptr,*sptr ;
+ aptr = a.m - 1 ;
+- sptr = m - 1 ;
+- size = rows()*cols() ;
++ sptr = this->m - 1 ;
++ size = this->rows()*this->cols() ;
+ for (i = size; i > 0; --i){
+ *(++sptr) -= *(++aptr) ;
+ }
+@@ -742,14 +742,14 @@
+ template <class T>
+ T Matrix<T>::trace() const
+ {
+- int size = rows();
++ int size = this->rows();
+ T sum = (T)0;
+
+- if ( size > cols() )
+- size = cols();
++ if ( size > this->cols() )
++ size = this->cols();
+
+ for (int d = 0; d < size; ++d)
+- sum += elem(d,d) ;
++ sum += this->elem(d,d) ;
+
+ return sum;
+ }
+@@ -770,12 +770,12 @@
+ template <class T>
+ Matrix<T> Matrix<T>::herm() const
+ {
+- int i, j, r = cols(), c = rows();
++ int i, j, r = this->cols(), c = this->rows();
+ Matrix<T> adj(r,c);
+
+ for (i = 0; i < r; ++i)
+ for (j = 0; j < c; ++j)
+- adj.elem(i,j) = elem(j,i) ;
++ adj.elem(i,j) = this->elem(j,i) ;
+
+ return adj;
+
+@@ -794,11 +794,11 @@
+ template <class T>
+ Matrix<T> Matrix<T>::flop() const
+ {
+- Matrix<T> f(rows(),cols()) ;
+- for(int i=rows()-1;i>=0;--i)
+- for(int j=cols()-1;j>=0;--j)
++ Matrix<T> f(this->rows(),this->cols()) ;
++ for(int i=this->rows()-1;i>=0;--i)
++ for(int j=this->cols()-1;j>=0;--j)
+ {
+- f(i,j) = elem(i,cols()-j-1);
++ f(i,j) = this->elem(i,this->cols()-j-1);
+ }
+ return f;
+ }
+@@ -817,13 +817,13 @@
+ {
+ // same as hermitian for real Matrix<T>
+ int i, j;
+- const int& r = cols();
+- const int& c = rows();
++ const int& r = this->cols();
++ const int& c = this->rows();
+ Matrix<T> adj(r,c);
+
+ for (i = r-1; i >=0; --i)
+ for (j = c-1; j >=0; --j)
+- adj.elem(i,j) = elem(j,i) ;
++ adj.elem(i,j) = this->elem(j,i) ;
+
+
+ return adj;
+@@ -844,7 +844,7 @@
+ int Matrix<T>::read(char* filename) {
+ ifstream fin(filename) ;
+ if(!fin) {
+- resize(1,1) ;
++ this->resize(1,1) ;
+ return 0 ;
+ }
+ int r,c ;
+@@ -855,8 +855,8 @@
+ if(r) return 0 ;
+ if(!fin.read((char*)&r,sizeof(int))) return 0 ;
+ if(!fin.read((char*)&c,sizeof(int))) return 0 ;
+- resize(r,c) ;
+- if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
++ this->resize(r,c) ;
++ if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
+
+ delete []type ;
+ return 1 ;
+@@ -877,11 +877,11 @@
+ int Matrix<T>::read(char* filename,int r, int c) {
+ ifstream fin(filename) ;
+ if(!fin) {
+- resize(1,1) ;
++ this->resize(1,1) ;
+ return 0 ;
+ }
+- resize(r,c) ;
+- if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
++ this->resize(r,c) ;
++ if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
+
+ return 1 ;
+ }
+@@ -904,11 +904,11 @@
+ if(!fout)
+ return 0 ;
+ int r,c ;
+- r = rows() ; c = cols() ;
++ r = this->rows() ; c = this->cols() ;
+ if(!fout.write((char*)&"matrix",sizeof(char)*6)) return 0 ;
+ if(!fout.write((char*)&r,sizeof(int))) return 0 ;
+ if(!fout.write((char*)&c,sizeof(int))) return 0 ;
+- if(!fout.write((char*)m,sizeof(T)*r*c)) return 0 ;
++ if(!fout.write((char*)this->m,sizeof(T)*r*c)) return 0 ;
+ return 1;
+ }
+
+@@ -927,7 +927,7 @@
+ ofstream fout(filename) ;
+ if(!fout)
+ return 0 ;
+- if(!fout.write((char*)m,sizeof(T)*rows()*cols())) return 0 ;
++ if(!fout.write((char*)this->m,sizeof(T)*this->rows()*this->cols())) return 0 ;
+ return 1;
+ }
+
diff --git a/graphics/nurbs++/files/patch-matrixMat.cpp b/graphics/nurbs++/files/patch-matrixMat.cpp
new file mode 100644
index 000000000000..e9e8b15a428b
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrixMat.cpp
@@ -0,0 +1,119 @@
+--- numerical/matrixMat.cpp.orig Mon May 13 14:07:45 2002
++++ numerical/matrixMat.cpp Thu Nov 30 23:54:37 2006
+@@ -48,9 +48,9 @@
+ template <class T>
+ LUMatrix<T>& LUMatrix<T>::operator=(const LUMatrix<T>& a){
+ resize(a.rows(),a.cols()) ;
+- for(int i=0;i<rows();++i)
+- for(int j=0;j<cols();++j)
+- elem(i,j) = a(i,j) ;
++ for(int i=0;i<this->rows();++i)
++ for(int j=0;j<this->cols();++j)
++ this->elem(i,j) = a(i,j) ;
+ pivot_ = a.pivot_ ;
+ return *this ;
+ }
+@@ -90,7 +90,7 @@
+ // lu = a; must do it by copying or LUFACT will be recursively called !
+ for(i=0;i<n;++i)
+ for(j=0;j<n;++j)
+- elem(i,j) = a(i,j) ;
++ this->elem(i,j) = a(i,j) ;
+
+ errval = 0;
+ nm1 = n - 1;
+@@ -129,24 +129,24 @@
+ }
+ pivot_[k] = l;
+
+- if ( elem(l,k) != 0.0 )
++ if ( this->elem(l,k) != 0.0 )
+ { // nonsingular pivot found
+ if (l != k ){ // interchange needed
+ for (i = k; i < n; i++)
+ {
+- t = elem(l,i) ;
+- elem(l,i) = elem(k,i) ;
+- elem(k,i) = t ;
++ t = this->elem(l,i) ;
++ this->elem(l,i) = this->elem(k,i) ;
++ this->elem(k,i) = t ;
+ }
+ sign = -sign ;
+ }
+- q = elem(k,k); /* scale row */
++ q = this->elem(k,k); /* scale row */
+ for (i = kp1; i < n; i++)
+ {
+- t = - elem(i,k)/q;
+- elem(i,k) = t;
++ t = - this->elem(i,k)/q;
++ this->elem(i,k) = t;
+ for (j = kp1; j < n; j++)
+- elem(i,j) += t * elem(k,j);
++ this->elem(i,j) += t * this->elem(k,j);
+ }
+ }
+ else /* pivot singular */
+@@ -156,7 +156,7 @@
+ }
+
+ pivot_[nm1] = nm1;
+- if (elem(nm1,nm1) == 0.0)
++ if (this->elem(nm1,nm1) == 0.0)
+ errval = nm1;
+ return *this;
+ }
+@@ -196,9 +196,9 @@
+ */
+ template <class T>
+ T LUMatrix<T>::determinant(){
+- T det = elem(0,0) ;
+- for(int i=1;i<rows();++i)
+- det *= elem(i,i) ;
++ T det = this->elem(0,0) ;
++ for(int i=1;i<this->rows();++i)
++ det *= this->elem(i,i) ;
+ return det * (T)sign ;
+ }
+
+@@ -253,18 +253,18 @@
+ T ten;
+ int i, j, k, l, kb, kp1, nm1, n, coln;
+
+- if ( rows() != cols() )
++ if ( this->rows() != this->cols() )
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize2D(rows(),cols(),0,0) ;
++ throw WrongSize2D(this->rows(),this->cols(),0,0) ;
+ #else
+ Error error("invm");
+- error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
++ error << "matrix inverse, not square: " << this->rows() << " by " << this->cols() << endl;
+ error.fatal();
+ #endif
+ }
+
+- n = coln = rows();
++ n = coln = this->rows();
+
+
+ inv = *this ;
+@@ -338,13 +338,13 @@
+ template <class T>
+ Matrix<T> LUMatrix<T>::inverse()
+ {
+- if ( rows() != cols() )
++ if ( this->rows() != this->cols() )
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize2D(rows(),cols(),0,0) ;
++ throw WrongSize2D(this->rows(),this->cols(),0,0) ;
+ #else
+ Error error("invm");
+- error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
++ error << "matrix inverse, not square: " << this->rows() << " by " << this->cols() << endl;
+ error.fatal();
+ #endif
+ }
diff --git a/graphics/nurbs++/files/patch-matrixRT.cpp b/graphics/nurbs++/files/patch-matrixRT.cpp
new file mode 100644
index 000000000000..d94ca0634f9c
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrixRT.cpp
@@ -0,0 +1,213 @@
+--- nurbs/matrixRT.cpp.orig Mon May 13 14:07:46 2002
++++ nurbs/matrixRT.cpp Fri Dec 1 00:43:46 2006
+@@ -51,13 +51,13 @@
+ // *this = C.translate(x,y,z)*B.rotate(ax,ay,az) ;
+ rotate(ax,ay,az) ;
+ #ifdef COLUMN_ORDER
+- m[12] = x ;
+- m[13] = y ;
+- m[14] = z ;
++ this->m[12] = x ;
++ this->m[13] = y ;
++ this->m[14] = z ;
+ #else
+- m[3] = x ;
+- m[7] = y ;
+- m[11] = z ;
++ this->m[3] = x ;
++ this->m[7] = y ;
++ this->m[11] = z ;
+ #endif
+ }
+
+@@ -71,8 +71,8 @@
+ */
+ template <class T>
+ MatrixRT<T>::MatrixRT() : Matrix<T>(4,4) {
+- reset(0) ;
+- diag(1.0) ;
++ this->reset(0) ;
++ this->diag(1.0) ;
+ }
+
+ /*!
+@@ -144,33 +144,33 @@
+ t10 = cos(ax);
+ t13 = t4*t6;
+ #ifdef COLUMN_ORDER
+- m[0] = t1*t2;
+- m[4] = -t4*t2;
+- m[8] = t6;
+- m[12] = 0 ;
+- m[1] = t7*t8+t4*t10;
+- m[5] = -t13*t8+t1*t10;
+- m[9] = -t2*t8;
+- m[13] = 0 ;
+- m[2] = -t7*t10+t4*t8;
+- m[6] = t13*t10+t1*t8;
+- m[10] = t2*t10;
+- m[14] = m[3] = m[7] = m[11] = 0.0 ;
+- m[15] = 1.0 ;
++ this->m[0] = t1*t2;
++ this->m[4] = -t4*t2;
++ this->m[8] = t6;
++ this->m[12] = 0 ;
++ this->m[1] = t7*t8+t4*t10;
++ this->m[5] = -t13*t8+t1*t10;
++ this->m[9] = -t2*t8;
++ this->m[13] = 0 ;
++ this->m[2] = -t7*t10+t4*t8;
++ this->m[6] = t13*t10+t1*t8;
++ this->m[10] = t2*t10;
++ this->m[14] = m[3] = m[7] = m[11] = 0.0 ;
++ this->m[15] = 1.0 ;
+ #else
+- m[0] = t1*t2;
+- m[1] = -t4*t2;
+- m[2] = t6;
+- m[3] = 0 ;
+- m[4] = t7*t8+t4*t10;
+- m[5] = -t13*t8+t1*t10;
+- m[6] = -t2*t8;
+- m[7] = 0 ;
+- m[8] = -t7*t10+t4*t8;
+- m[9] = t13*t10+t1*t8;
+- m[10] = t2*t10;
+- m[11] = m[12] = m[13] = m[14] = 0 ;
+- m[15] = 1.0 ;
++ this->m[0] = t1*t2;
++ this->m[1] = -t4*t2;
++ this->m[2] = t6;
++ this->m[3] = 0 ;
++ this->m[4] = t7*t8+t4*t10;
++ this->m[5] = -t13*t8+t1*t10;
++ this->m[6] = -t2*t8;
++ this->m[7] = 0 ;
++ this->m[8] = -t7*t10+t4*t8;
++ this->m[9] = t13*t10+t1*t8;
++ this->m[10] = t2*t10;
++ this->m[11] = this->m[12] = this->m[13] = this->m[14] = 0 ;
++ this->m[15] = 1.0 ;
+ #endif
+ return *this ;
+ }
+@@ -203,33 +203,33 @@
+ t9 = (T)sin((double)ax);
+ t17 = t4*t7;
+ #ifdef COLUMN_ORDER
+- m[0] = t1*t2;
+- m[4] = -t4*t5+t8*t9;
+- m[8] = t4*t9+t8*t5;
+- m[12] = 0.0 ;
+- m[1] = t4*t2;
+- m[5] = t1*t5+t17*t9;
+- m[9] = -t1*t9+t17*t5;
+- m[13] = 0.0 ;
+- m[2] = -t7;
+- m[6] = t2*t9;
+- m[10] = t2*t5;
+- m[14] = m[3] = m[7] = m[11] = 0 ;
+- m[15] = 1.0 ;
++ this->m[0] = t1*t2;
++ this->m[4] = -t4*t5+t8*t9;
++ this->m[8] = t4*t9+t8*t5;
++ this->m[12] = 0.0 ;
++ this->m[1] = t4*t2;
++ this->m[5] = t1*t5+t17*t9;
++ this->m[9] = -t1*t9+t17*t5;
++ this->m[13] = 0.0 ;
++ this->m[2] = -t7;
++ this->m[6] = t2*t9;
++ this->m[10] = t2*t5;
++ this->m[14] = m[3] = m[7] = m[11] = 0 ;
++ this->m[15] = 1.0 ;
+ #else
+- m[0] = t1*t2;
+- m[1] = -t4*t5+t8*t9;
+- m[2] = t4*t9+t8*t5;
+- m[3] = 0.0 ;
+- m[4] = t4*t2;
+- m[5] = t1*t5+t17*t9;
+- m[6] = -t1*t9+t17*t5;
+- m[7] = 0.0 ;
+- m[8] = -t7;
+- m[9] = t2*t9;
+- m[10] = t2*t5;
+- m[11] = m[12] = m[13] = m[14] = 0 ;
+- m[15] = 1.0 ;
++ this->m[0] = t1*t2;
++ this->m[1] = -t4*t5+t8*t9;
++ this->m[2] = t4*t9+t8*t5;
++ this->m[3] = 0.0 ;
++ this->m[4] = t4*t2;
++ this->m[5] = t1*t5+t17*t9;
++ this->m[6] = -t1*t9+t17*t5;
++ this->m[7] = 0.0 ;
++ this->m[8] = -t7;
++ this->m[9] = t2*t9;
++ this->m[10] = t2*t5;
++ this->m[11] = this->m[12] = this->m[13] = this->m[14] = 0 ;
++ this->m[15] = 1.0 ;
+ #endif
+ return *this ;
+ }
+@@ -245,16 +245,16 @@
+ */
+ template <class T>
+ MatrixRT<T>& MatrixRT<T>::translate(T x, T y, T z){
+- reset(0) ;
+- diag(1.0) ;
++ this->reset(0) ;
++ this->diag(1.0) ;
+ #ifdef COLUMN_ORDER
+- m[12] = x ;
+- m[13] = y ;
+- m[14] = z ;
++ this->m[12] = x ;
++ this->m[13] = y ;
++ this->m[14] = z ;
+ #else
+- m[3] = x ;
+- m[7] = y ;
+- m[11] = z ;
++ this->m[3] = x ;
++ this->m[7] = y ;
++ this->m[11] = z ;
+ #endif
+ return *this ;
+ }
+@@ -271,11 +271,11 @@
+ */
+ template <class T>
+ MatrixRT<T>& MatrixRT<T>::scale(T x, T y, T z){
+- reset(0) ;
+- m[0] = x ;
+- m[5] = y ;
+- m[10] = z ;
+- m[15] = 1.0 ;
++ this->reset(0) ;
++ this->m[0] = x ;
++ this->m[5] = y ;
++ this->m[10] = z ;
++ this->m[15] = 1.0 ;
+ return *this ;
+ }
+
+@@ -416,7 +416,7 @@
+ error.fatal() ;
+ }
+ T *a,*b ;
+- a = m-1 ;
++ a = this->m-1 ;
+ b = M[0] - 1 ;
+ for(int i=0;i<16;++i){
+ *(++a) = *(++b) ;
+@@ -435,7 +435,7 @@
+ template <class T>
+ MatrixRT<T>& MatrixRT<T>::operator=(const MatrixRT<T>& M) {
+ T *a,*b ;
+- a = m-1 ;
++ a = this->m-1 ;
+ b = M.m - 1 ;
+ for(int i=0;i<16;++i){
+ *(++a) = *(++b) ;
diff --git a/graphics/nurbs++/files/patch-matrix_barray2d_uchar.cpp b/graphics/nurbs++/files/patch-matrix_barray2d_uchar.cpp
new file mode 100644
index 000000000000..36c8aa860eb8
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_barray2d_uchar.cpp
@@ -0,0 +1,11 @@
+--- matrix/barray2d_uchar.cpp.orig 2008-02-13 22:18:33.000000000 +0100
++++ matrix/barray2d_uchar.cpp 2008-02-13 22:18:50.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+-ostream&
++template<> ostream&
+ Basic2DArray<unsigned char>::print(ostream& os) const
+ {
+ int i, j;
diff --git a/graphics/nurbs++/files/patch-matrix_barray_complex.cpp b/graphics/nurbs++/files/patch-matrix_barray_complex.cpp
new file mode 100644
index 000000000000..39af5c841c12
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_barray_complex.cpp
@@ -0,0 +1,11 @@
+--- matrix/barray_complex.cpp.orig 2008-02-13 22:26:03.000000000 +0100
++++ matrix/barray_complex.cpp 2008-02-13 22:26:20.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+-ostream&
++template<> ostream&
+ BasicArray<Complex>::print(ostream& os) const{
+ const int iend = size();
+
diff --git a/graphics/nurbs++/files/patch-matrix_matrix.h b/graphics/nurbs++/files/patch-matrix_matrix.h
new file mode 100644
index 000000000000..210beb2407c3
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix.h
@@ -0,0 +1,11 @@
+--- matrix/matrix.h.orig
++++ matrix/matrix.h
+@@ -75,7 +75,7 @@
+
+ Matrix<T>& operator=(const Matrix<T>&);
+ T operator=(const T v)
+- { reset((T)0);
++ { this->reset((T)0);
+ diag(v);
+ return v; }
+ void submatrix(int i, int j, Matrix<T>&);
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_char.cpp b/graphics/nurbs++/files/patch-matrix_matrix_char.cpp
new file mode 100644
index 000000000000..c1eee4075273
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_char.cpp
@@ -0,0 +1,38 @@
+--- matrix/matrix_char.cpp.orig 2008-02-13 22:21:07.000000000 +0100
++++ matrix/matrix_char.cpp 2008-02-13 22:21:42.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- Matrix<char>&
++ template<> Matrix<char>&
+ Matrix<char>::operator*=(double a)
+ {
+ char *p1 ;
+@@ -40,7 +40,7 @@
+ return *this ;
+ }
+
+- Matrix<char>&
++ template<> Matrix<char>&
+ Matrix<char>::operator+=(double a)
+ {
+ char *p1 ;
+@@ -51,7 +51,7 @@
+ return *this ;
+ }
+
+- Matrix<char>&
++ template<> Matrix<char>&
+ Matrix<char>::operator-=(double a)
+ {
+ char *p1 ;
+@@ -62,7 +62,7 @@
+ return *this ;
+ }
+
+- Matrix<char>&
++ template<> Matrix<char>&
+ Matrix<char>::operator/=(double a)
+ {
+ char *p1 ;
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_complex.cpp b/graphics/nurbs++/files/patch-matrix_matrix_complex.cpp
new file mode 100644
index 000000000000..2b85957043a1
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_complex.cpp
@@ -0,0 +1,11 @@
+--- matrix/matrix_complex.cpp.orig 2008-02-13 22:27:09.000000000 +0100
++++ matrix/matrix_complex.cpp 2008-02-13 22:27:30.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- double Matrix<Complex>::norm(void){
++ template<> double Matrix<Complex>::norm(void){
+ int i,j ;
+ double sumR, sumI, maxsum;
+ int init=0 ;
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_double.cpp b/graphics/nurbs++/files/patch-matrix_matrix_double.cpp
new file mode 100644
index 000000000000..2f9983544561
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_double.cpp
@@ -0,0 +1,11 @@
+--- matrix/matrix_double.cpp.orig 2008-02-13 22:16:31.000000000 +0100
++++ matrix/matrix_double.cpp 2008-02-13 22:16:45.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- void Matrix<double>::qSort(){
++ template<> void Matrix<double>::qSort(){
+ qsort((char*)m,rows()*cols(),sizeof(double),compareDouble) ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_float.cpp b/graphics/nurbs++/files/patch-matrix_matrix_float.cpp
new file mode 100644
index 000000000000..c60b8c8cf1a1
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_float.cpp
@@ -0,0 +1,11 @@
+--- matrix/matrix_float.cpp.orig 2008-02-13 22:14:25.000000000 +0100
++++ matrix/matrix_float.cpp 2008-02-13 22:14:45.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- void Matrix<float>::qSort(){
++ template<> void Matrix<float>::qSort(){
+ qsort((char*)m,rows()*cols(),sizeof(float),compareFloat) ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_hpoint.cpp b/graphics/nurbs++/files/patch-matrix_matrix_hpoint.cpp
new file mode 100644
index 000000000000..67eb18a33891
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_hpoint.cpp
@@ -0,0 +1,38 @@
+--- matrix/matrix_hpoint.cpp.orig 2008-02-13 22:23:41.000000000 +0100
++++ matrix/matrix_hpoint.cpp 2008-02-13 22:24:43.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- double
++ template<> double
+ Matrix<HPoint3Df>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, sumW, maxsum;
+@@ -58,7 +58,7 @@
+ }
+
+
+- double
++ template<> double
+ Matrix<HPoint3Dd>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, sumW, maxsum;
+@@ -89,7 +89,7 @@
+ }
+
+
+- double
++ template<> double
+ Matrix<HPoint2Df>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, sumW, maxsum;
+@@ -119,7 +119,7 @@
+ return sqrt(maxsum);
+ }
+
+- double
++ template<> double
+ Matrix<HPoint2Dd>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, sumW, maxsum;
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_int.cpp b/graphics/nurbs++/files/patch-matrix_matrix_int.cpp
new file mode 100644
index 000000000000..4a951646984e
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_int.cpp
@@ -0,0 +1,43 @@
+--- matrix/matrix_int.cpp.orig 2008-02-13 22:11:44.000000000 +0100
++++ matrix/matrix_int.cpp 2008-02-13 22:12:25.000000000 +0100
+@@ -29,11 +29,11 @@
+
+ namespace PLib {
+
+- void Matrix<int>::qSort(){
++ template<> void Matrix<int>::qSort(){
+ qsort((char*)m,rows()*cols(),sizeof(int),compareInt) ;
+ }
+
+- Matrix<int>&
++ template<> Matrix<int>&
+ Matrix<int>::operator*=(double a)
+ {
+ int *p1 ;
+@@ -46,7 +46,7 @@
+ return *this ;
+ }
+
+- Matrix<int>&
++ template<> Matrix<int>&
+ Matrix<int>::operator+=(double a)
+ {
+ int *p1 ;
+@@ -57,7 +57,7 @@
+ return *this ;
+ }
+
+- Matrix<int>&
++ template<> Matrix<int>&
+ Matrix<int>::operator-=(double a)
+ {
+ int *p1 ;
+@@ -68,7 +68,7 @@
+ return *this ;
+ }
+
+- Matrix<int>&
++ template<> Matrix<int>&
+ Matrix<int>::operator/=(double a)
+ {
+ int *p1 ;
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_point.cpp b/graphics/nurbs++/files/patch-matrix_matrix_point.cpp
new file mode 100644
index 000000000000..079c8eda3ab1
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_point.cpp
@@ -0,0 +1,38 @@
+--- matrix/matrix_point.cpp.orig 2008-02-13 22:22:23.000000000 +0100
++++ matrix/matrix_point.cpp 2008-02-13 22:23:16.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- double
++ template<> double
+ Matrix<Point3Df>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, maxsum;
+@@ -55,7 +55,7 @@
+ return sqrt(maxsum);
+ }
+
+- double
++ template<> double
+ Matrix<Point3Dd>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, maxsum;
+@@ -83,7 +83,7 @@
+ return sqrt(maxsum);
+ }
+
+- double
++ template<> double
+ Matrix<Point2Df>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, maxsum;
+@@ -111,7 +111,7 @@
+ return sqrt(maxsum);
+ }
+
+- double
++ template<> double
+ Matrix<Point2Dd>::norm(void) {
+ int i,j ;
+ double sumX, sumY, sumZ, maxsum;
diff --git a/graphics/nurbs++/files/patch-matrix_matrix_uchar.cpp b/graphics/nurbs++/files/patch-matrix_matrix_uchar.cpp
new file mode 100644
index 000000000000..c71fea3227fb
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_matrix_uchar.cpp
@@ -0,0 +1,38 @@
+--- matrix/matrix_uchar.cpp.orig 2008-02-13 22:39:32.000000000 +0100
++++ matrix/matrix_uchar.cpp 2008-02-13 22:40:11.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- Matrix<unsigned char>&
++ template<> Matrix<unsigned char>&
+ Matrix<unsigned char>::operator*=(double a)
+ {
+ unsigned char *p1 ;
+@@ -40,7 +40,7 @@
+ return *this ;
+ }
+
+- Matrix<unsigned char>&
++ template<> Matrix<unsigned char>&
+ Matrix<unsigned char>::operator+=(double a)
+ {
+ unsigned char *p1 ;
+@@ -52,7 +52,7 @@
+ }
+
+
+- Matrix<unsigned char>&
++ template<> Matrix<unsigned char>&
+ Matrix<unsigned char>::operator-=(double a)
+ {
+ unsigned char *p1 ;
+@@ -64,7 +64,7 @@
+ }
+
+
+- Matrix<unsigned char>&
++ template<> Matrix<unsigned char>&
+ Matrix<unsigned char>::operator/=(double a)
+ {
+ unsigned char *p1 ;
diff --git a/graphics/nurbs++/files/patch-matrix_vector_double.cpp b/graphics/nurbs++/files/patch-matrix_vector_double.cpp
new file mode 100644
index 000000000000..370dea064155
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_vector_double.cpp
@@ -0,0 +1,11 @@
+--- matrix/vector_double.cpp.orig 2008-02-13 22:17:22.000000000 +0100
++++ matrix/vector_double.cpp 2008-02-13 22:17:40.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- void Vector<double>::qSortStd(){
++ template<> void Vector<double>::qSortStd(){
+ qsort((char*)memory(),n(),sizeof(float),compareDouble) ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-matrix_vector_float.cpp b/graphics/nurbs++/files/patch-matrix_vector_float.cpp
new file mode 100644
index 000000000000..063dd1ac321c
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_vector_float.cpp
@@ -0,0 +1,11 @@
+--- matrix/vector_float.cpp.orig 2008-02-13 22:15:33.000000000 +0100
++++ matrix/vector_float.cpp 2008-02-13 22:15:51.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- void Vector<float>::qSortStd(){
++ template<> void Vector<float>::qSortStd(){
+ qsort((char*)memory(),n(),sizeof(float),compareFloat) ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-matrix_vector_int.cpp b/graphics/nurbs++/files/patch-matrix_vector_int.cpp
new file mode 100644
index 000000000000..66ebaf1998c9
--- /dev/null
+++ b/graphics/nurbs++/files/patch-matrix_vector_int.cpp
@@ -0,0 +1,11 @@
+--- matrix/vector_int.cpp.orig 2008-02-13 22:13:23.000000000 +0100
++++ matrix/vector_int.cpp 2008-02-13 22:13:39.000000000 +0100
+@@ -27,7 +27,7 @@
+
+ namespace PLib {
+
+- void Vector<int>::qSortStd(){
++ template<> void Vector<int>::qSortStd(){
+ qsort((char*)memory(),n(),sizeof(int),compareInt) ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-nurbs.cpp b/graphics/nurbs++/files/patch-nurbs.cpp
new file mode 100644
index 000000000000..237886c400e8
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs.cpp
@@ -0,0 +1,60 @@
+--- nurbs/nurbs.cpp.orig Fri May 24 10:25:49 2002
++++ nurbs/nurbs.cpp Fri Dec 1 00:22:20 2006
+@@ -28,7 +28,7 @@
+ #include <nurbsS.h>
+ #include "integrate.h"
+
+-#include <malloc.h>
++#include <stdlib.h>
+
+ /*!
+ */
+@@ -391,9 +391,9 @@
+ T du,dv ;
+ // compute a coarse distance for the curve
+ Point_nD<T,N> a,b,c ;
+- a = pointAt(0.0) ;
+- b = pointAt(0.5) ;
+- c = pointAt(1.0) ;
++ a = this->pointAt(0.0) ;
++ b = this->pointAt(0.5) ;
++ c = this->pointAt(1.0) ;
+
+ T distance = norm(b-a) + norm(c-b) ;
+
+@@ -2396,7 +2396,7 @@
+ r = c ;
+ return ;
+ }
+- c = pointAt(u) ;
++ c = this->pointAt(u) ;
+ deriveAt(u,2,Cd) ;
+ cd = Cd[1] ;
+ cdd = Cd[2] ;
+@@ -5202,7 +5202,7 @@
+ */
+ template <class T, int N>
+ BasicList<Point_nD<T,N> > NurbsCurve<T,N>::tesselate(T tolerance,BasicList<T> *uk) const {
+- BasicList<Point_nD<T,N> > list,list2 ;
++ BasicList<Point_nD<T,N> > list, list2 ;
+
+ NurbsCurveArray<T,N> ca ;
+ decompose(ca) ;
+@@ -5240,7 +5240,7 @@
+
+ for(i=0;i<n;++i){
+ u = (U[U.n()-deg_-1]-U[deg_])*T(i)/T(n-1) + U[deg_] ;
+- list.add(pointAt(u)) ;
++ list.add(this->pointAt(u)) ;
+ if(uk)
+ uk->add(u) ;
+ }
+@@ -5249,7 +5249,7 @@
+ }
+ else{
+ for(int i=0;i<ca.n();++i){
+- list2 = ca[i].tesselate(tolerance,uk) ;
++ list2 = ca[i].tesselate(tolerance,uk).by_ref() ;
+
+ // remove the last point from the list to elliminate
+ list.erase((BasicNode<Point_nD<T,N> >*)list.last()) ;
diff --git a/graphics/nurbs++/files/patch-nurbsS.cpp b/graphics/nurbs++/files/patch-nurbsS.cpp
new file mode 100644
index 000000000000..e081005bc6fc
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbsS.cpp
@@ -0,0 +1,86 @@
+--- nurbs/nurbsS.cpp.orig Mon May 13 14:07:46 2002
++++ nurbs/nurbsS.cpp Fri Dec 1 00:32:26 2006
+@@ -30,7 +30,7 @@
+ #include "integrate.h"
+
+ #ifdef USING_VCC
+-#include <malloc.h>
++#include <stdlib.h>
+ #endif
+
+ /*!
+@@ -3762,12 +3762,12 @@
+ // we use and angle of 36 to view the object
+ // and position the rest according to this.
+ Point_nD<T,N> minP, maxP ;
+- minP.x() = extremum(1,coordX) ;
+- minP.y() = extremum(1,coordY) ;
+- minP.z() = extremum(1,coordZ) ;
+- maxP.x() = extremum(0,coordX) ;
+- maxP.y() = extremum(0,coordY) ;
+- maxP.z() = extremum(0,coordZ) ;
++ minP.x() = this->extremum(1,coordX) ;
++ minP.y() = this->extremum(1,coordY) ;
++ minP.z() = this->extremum(1,coordZ) ;
++ maxP.x() = this->extremum(0,coordX) ;
++ maxP.y() = this->extremum(0,coordY) ;
++ maxP.z() = this->extremum(0,coordZ) ;
+
+ Point_nD<T,N> lookAt ;
+ lookAt.x() = (minP.x()+maxP.x())/2.0 ;
+@@ -3860,12 +3860,12 @@
+ // we use and angle of 36 to view the object
+ // and position the rest according to this.
+ Point_nD<T,N> minP, maxP ;
+- minP.x() = extremum(1,coordX) ;
+- minP.y() = extremum(1,coordY) ;
+- minP.z() = extremum(1,coordZ) ;
+- maxP.x() = extremum(0,coordX) ;
+- maxP.y() = extremum(0,coordY) ;
+- maxP.z() = extremum(0,coordZ) ;
++ minP.x() = this->extremum(1,coordX) ;
++ minP.y() = this->extremum(1,coordY) ;
++ minP.z() = this->extremum(1,coordZ) ;
++ maxP.x() = this->extremum(0,coordX) ;
++ maxP.y() = this->extremum(0,coordY) ;
++ maxP.z() = this->extremum(0,coordZ) ;
+
+ Point_nD<T,N> lookAt ;
+ lookAt.x() = (minP.x()+maxP.x())/2.0 ;
+@@ -4045,12 +4045,12 @@
+ }
+
+ Point_nD<T,N> minP, maxP ;
+- minP.x() = extremum(1,coordX) ;
+- minP.y() = extremum(1,coordY) ;
+- minP.z() = extremum(1,coordZ) ;
+- maxP.x() = extremum(0,coordX) ;
+- maxP.y() = extremum(0,coordY) ;
+- maxP.z() = extremum(0,coordZ) ;
++ minP.x() = this->extremum(1,coordX) ;
++ minP.y() = this->extremum(1,coordY) ;
++ minP.z() = this->extremum(1,coordZ) ;
++ maxP.x() = this->extremum(0,coordX) ;
++ maxP.y() = this->extremum(0,coordY) ;
++ maxP.z() = this->extremum(0,coordZ) ;
+
+ Point_nD<T,N> lookAt ;
+ lookAt.x() = (minP.x()+maxP.x())/2.0 ;
+@@ -4715,7 +4715,7 @@
+ T u,v;
+ for (u = fBu; u<fEu+fDu/2; u+=fDu)
+ for (v = fBv; v<fEv+fDv/2; v+=fDv){
+- Sp = pointAt(u,v);
++ Sp = this->pointAt(u,v);
+ Np = normal(u,v);
+ Np = (norm(Np)!=0)?Np.unitLength():Point_nD<T,N>(0.0);
+ fout << "\t" << Sp << "\t " << Np << endl;
+@@ -4829,7 +4829,7 @@
+ for (u = 0; u<1-fDu/2; u+=fDu){
+ // The change in sign and the swap of y and z coordinates is
+ // for conversion to MINC format.
+- Sp = -(T)1.0 * pointAt(u,v) ;
++ Sp = -(T)1.0 * this->pointAt(u,v) ;
+ fout << Sp.x() << ' ' << Sp.z() << ' ' << Sp.y() << endl;
+ }
+
diff --git a/graphics/nurbs++/files/patch-nurbsS_sp.cpp b/graphics/nurbs++/files/patch-nurbsS_sp.cpp
new file mode 100644
index 000000000000..cb4e4ba5a9a3
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbsS_sp.cpp
@@ -0,0 +1,233 @@
+--- nurbs/nurbsS_sp.cpp.orig Mon May 13 14:07:46 2002
++++ nurbs/nurbsS_sp.cpp Fri Dec 1 00:52:04 2006
+@@ -43,7 +43,7 @@
+ */
+ template <class T, int N>
+ void NurbsSurfaceSP<T,N>::updateMaxU() {
+- if(degU>3){
++ if(this->degU>3){
+ #ifdef USE_EXCEPTION
+ throw NurbsInputError();
+ #else
+@@ -53,12 +53,12 @@
+ #endif
+ }
+ else{
+- maxU.resize(P.rows()) ;
+- maxAtU_.resize(P.rows()) ;
+- for(int i=0;i<P.rows();++i){
+- if(!maxInfluence(i,U,degU,maxAtU_[i]))
++ maxU.resize(this->P.rows()) ;
++ maxAtU_.resize(this->P.rows()) ;
++ for(int i=0;i<this->P.rows();++i){
++ if(!maxInfluence(i,this->U,this->degU,maxAtU_[i]))
+ cerr << "Problem in maxInfluence U!\n" ;
+- maxU[i] = nurbsBasisFun(maxAtU_[i],i,degU,U) ;
++ maxU[i] = nurbsBasisFun(maxAtU_[i],i,this->degU,this->U) ;
+ }
+
+ }
+@@ -78,7 +78,7 @@
+ */
+ template <class T, int N>
+ void NurbsSurfaceSP<T,N>::updateMaxV() {
+- if(degV>3){
++ if(this->degV>3){
+ #ifdef USE_EXCEPTION
+ throw NurbsInputError();
+ #else
+@@ -88,12 +88,12 @@
+ #endif
+ }
+ else{
+- maxV.resize(P.cols()) ;
+- maxAtV_.resize(P.cols()) ;
+- for(int i=0;i<P.cols();++i){
+- if(!maxInfluence(i,V,degV,maxAtV_[i]))
++ maxV.resize(this->P.cols()) ;
++ maxAtV_.resize(this->P.cols()) ;
++ for(int i=0;i<this->P.cols();++i){
++ if(!maxInfluence(i,this->V,this->degV,maxAtV_[i]))
+ cerr << "Problem in maxInfluence V!\n" ;
+- maxV[i] = nurbsBasisFun(maxAtV_[i],i,degV,V) ;
++ maxV[i] = nurbsBasisFun(maxAtV_[i],i,this->degV,this->V) ;
+ }
+
+ }
+@@ -124,11 +124,11 @@
+ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>::generateParallel(T d) const {
+ NurbsSurfaceSP<T,N> p(*this) ;
+
+- Vector< Point_nD<T,N> > offset(P.rows()*P.cols()) ;
+- Vector<T> ur(P.rows()*P.cols()) ;
+- Vector<T> vr(P.rows()*P.cols()) ;
+- Vector_INT Du(P.rows()*P.cols()) ;
+- Vector_INT Dv(P.rows()*P.cols()) ;
++ Vector< Point_nD<T,N> > offset(this->P.rows()*this->P.cols()) ;
++ Vector<T> ur(this->P.rows()*this->P.cols()) ;
++ Vector<T> vr(this->P.rows()*this->P.cols()) ;
++ Vector_INT Du(this->P.rows()*this->P.cols()) ;
++ Vector_INT Dv(this->P.rows()*this->P.cols()) ;
+
+ Du.reset(0) ;
+ Dv.reset(0) ;
+@@ -137,10 +137,10 @@
+
+ no = 0 ;
+
+- for(i=0;i<P.rows();++i)
+- for(j=0;j<P.cols();++j){
++ for(i=0;i<this->P.rows();++i)
++ for(j=0;j<this->P.cols();++j){
+ Point_nD<T,N> norm ;
+- norm = normal(maxAtU_[i],maxAtV_[j]) ;
++ norm = this->normal(maxAtU_[i],maxAtV_[j]) ;
+ if(norm.x() == T(0) &&
+ norm.y() == T(0) &&
+ norm.z() == T(0)){
+@@ -150,26 +150,26 @@
+ // must handle the corner cases
+ int ok = 0 ;
+ if(i==0 && j==0){
+- norm = normal(maxAtU_[i]+delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
++ norm = this->normal(maxAtU_[i]+delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]+delta) ;
+ norm /= T(2) ;
+ ok = 1 ;
+ }
+- if(i==P.rows()-1 && j==P.cols()-1){
+- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]-delta) ;
++ if(i==this->P.rows()-1 && j==this->P.cols()-1){
++ norm = this->normal(maxAtU_[i]-delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]-delta) ;
+ norm /= T(2) ;
+ ok = 1 ;
+ }
+- if(i==0 && j==P.cols()-1){
+- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
++ if(i==0 && j==this->P.cols()-1){
++ norm = this->normal(maxAtU_[i]-delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]+delta) ;
+ norm /= T(2) ;
+ ok = 1 ;
+ }
+- if(i==P.rows()-1 && j==0){
+- norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
+- norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
++ if(i==this->P.rows()-1 && j==0){
++ norm = this->normal(maxAtU_[i]-delta,maxAtV_[j]) ;
++ norm += this->normal(maxAtU_[i],maxAtV_[j]+delta) ;
+ norm /= T(2) ;
+ ok = 1 ;
+ }
+@@ -178,7 +178,7 @@
+ while(norm.x() == T(0) &&
+ norm.y() == T(0) &&
+ norm.z() == T(0)){
+- if( nt*d >(U[U.n()-1]-U[0])){
++ if( nt*d >(this->U[this->U.n()-1]-this->U[0])){
+ #ifdef USE_EXCEPTION
+ throw NurbsComputationError();
+ #else
+@@ -188,22 +188,22 @@
+ #endif
+ }
+ T u1,u2,v1,v2 ;
+- if(i==0 || i==P.rows()-1){
++ if(i==0 || i==this->P.rows()-1){
+ u1 = u2 = maxAtU_[i] ;
+ v1 = maxAtV_[j]+ nt*delta ;
+ v2 = maxAtV_[j]- nt*delta ;
+- if(v1>V[V.n()-1]) v1 = V[V.n()-1] ;
+- if(v2<V[0]) v2 = V[0] ;
+- norm = normal(u1,v1);
+- norm += normal(u2,v2) ;
++ if(v1>this->V[this->V.n()-1]) v1 = this->V[this->V.n()-1] ;
++ if(v2<this->V[0]) v2 = this->V[0] ;
++ norm = this->normal(u1,v1);
++ norm += this->normal(u2,v2) ;
+ norm /= 2 ;
+ }
+ else{
+ u1 = maxAtU_[i]- nt*delta ;
+ u2 = maxAtU_[i]+ nt*delta ;
+ v1 = v2 = maxAtV_[j] ;
+- if(u1 < U[0]) u1 = U[0] ;
+- if(u2 > U[U.n()-1]) u2 = U[U.n()-1] ;
++ if(u1 < this->U[0]) u1 = this->U[0] ;
++ if(u2 > this->U[this->U.n()-1]) u2 = this->U[this->U.n()-1] ;
+
+ T u3,v3 ;
+ u3 = maxAtU_[i] ;
+@@ -212,12 +212,12 @@
+ else
+ v3 = maxAtV_[j]- nt*delta ;
+
+- if(v3<V[0]) v3 = V[0] ;
+- if(v3>V[V.n()-1]) v3 = V[V.n()-1] ;
++ if(v3<this->V[0]) v3 = this->V[0] ;
++ if(v3>this->V[this->V.n()-1]) v3 = this->V[this->V.n()-1] ;
+
+- norm = normal(u1,v1);
+- norm += normal(u2,v2) ;
+- norm += normal(u3,v3) ;
++ norm = this->normal(u1,v1);
++ norm += this->normal(u2,v2) ;
++ norm += this->normal(u3,v3) ;
+ norm /= 3 ;
+ }
+ nt *= 10.0 ;
+@@ -263,13 +263,13 @@
+
+ int sizeU, sizeV ;
+
+- sizeU = 2*degU+3 ;
+- if(i-degU-1<0) sizeU += i-degU-1 ;
+- if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
+-
+- sizeV = 2*degV+3 ;
+- if(j-degV-1<0) sizeV += j-degV-1 ;
+- if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
++ sizeU = 2*this->degU+3 ;
++ if(i-this->degU-1<0) sizeU += i-this->degU-1 ;
++ if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
++
++ sizeV = 2*this->degV+3 ;
++ if(j-this->degV-1<0) sizeV += j-this->degV-1 ;
++ if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
+
+ Vector<T> u(sizeU) ;
+ Vector<T> v(sizeV) ;
+@@ -280,16 +280,16 @@
+ int n=0;
+ int nu = 0 ;
+ int nv = 0 ;
+- for(int k=i-degU-1;k<=i+degU+1;++k){
++ for(int k=i-this->degU-1;k<=i+this->degU+1;++k){
+ if(k<0)
+ continue ;
+- if(k>=P.rows())
++ if(k>=this->P.rows())
+ break ;
+ nv = 0 ;
+- for(int l=j-degV-1;l<=j+degV+1;++l){
++ for(int l=j-this->degV-1;l<=j+this->degV+1;++l){
+ if(l<0)
+ continue ;
+- if(l>=P.cols())
++ if(l>=this->P.cols())
+ break ;
+ if( k == i && j==l){
+ pts[n].x() = a.x() ;
+@@ -316,7 +316,7 @@
+ pu.resize(n) ;
+ pv.resize(n) ;
+
+- movePoint(u,v,pts,pu,pv) ;
++ this->movePoint(u,v,pts,pu,pv) ;
+ }
+
+ } // end namespace
diff --git a/graphics/nurbs++/files/patch-nurbsS_sp.h b/graphics/nurbs++/files/patch-nurbsS_sp.h
new file mode 100644
index 000000000000..88b406007974
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbsS_sp.h
@@ -0,0 +1,20 @@
+--- nurbs/nurbsS_sp.h.orig Mon May 13 14:07:46 2002
++++ nurbs/nurbsS_sp.h Fri Dec 1 00:48:44 2006
+@@ -78,7 +78,7 @@
+
+
+ void modSurfCPby(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point by a value
+- { P(i,j) += a / (maxU[i]*maxV[j]) ; }
++ { this->P(i,j) += a / (maxU[i]*maxV[j]) ; }
+ void modSurfCP(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point to a value
+ { modSurfCPby(i,j,a-surfP(i,j)) ; }
+
+@@ -94,7 +94,7 @@
+ { return maxAtV_[i] ; }
+
+ HPoint_nD<T,N> surfP(int i,int j) const //!< the surface point for the control point at i,j
+- { return hpointAt(maxAtU_[i],maxAtV_[j]); }
++ { return this->hpointAt(maxAtU_[i],maxAtV_[j]); }
+
+ void updateMaxUV() //!< Updates both the maxU and maxV values
+ { updateMaxU() ; updateMaxV() ; }
diff --git a/graphics/nurbs++/files/patch-nurbsSub.cpp b/graphics/nurbs++/files/patch-nurbsSub.cpp
new file mode 100644
index 000000000000..9bb00ef2c301
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbsSub.cpp
@@ -0,0 +1,20 @@
+--- nurbs/nurbsSub.cpp.orig Mon May 13 14:07:46 2002
++++ nurbs/nurbsSub.cpp Fri Dec 1 01:04:05 2006
+@@ -904,7 +904,7 @@
+
+ /* Allocate storage for the grid of points generated */
+
+- CHECK( pts = new (SurfSample<T>*)[Granularity+1]);
++ CHECK( pts = new SurfSample<T>* [Granularity+1]);
+ CHECK( pts[0] = new SurfSample<T>[(Granularity+1)*(Granularity+1)]);
+
+ for (i = 1; i <= Granularity; i++)
+@@ -983,7 +983,7 @@
+
+ if (! *alpha) /* Must allocate alpha */
+ {
+- CHECK( *alpha = new (T*)[k+1]);
++ CHECK( *alpha = new T* [k+1]);
+ for (i = 0; i <= k; i++)
+ CHECK( (*alpha)[i] = new T[(m + n + 1)]);
+ }
diff --git a/graphics/nurbs++/files/patch-nurbs_d_nurbs.cpp b/graphics/nurbs++/files/patch-nurbs_d_nurbs.cpp
new file mode 100644
index 000000000000..6d67f607e307
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_d_nurbs.cpp
@@ -0,0 +1,11 @@
+--- nurbs/d_nurbs.cpp.orig 2008-02-13 22:33:03.000000000 +0100
++++ nurbs/d_nurbs.cpp 2008-02-13 22:33:32.000000000 +0100
+@@ -10,7 +10,7 @@
+ return firstDn(u) ;
+ }
+
+-void NurbsCurve<double,2>::makeCircle(const Point_nD<double,2>& O, double r, double as, double ae){
++template<> void NurbsCurve<double,2>::makeCircle(const Point_nD<double,2>& O, double r, double as, double ae){
+ makeCircle(O,Point_nD<double,2>(1,0),Point_nD<double,2>(0,1),r,as,ae) ;
+ }
+
diff --git a/graphics/nurbs++/files/patch-nurbs_d_surface.cpp b/graphics/nurbs++/files/patch-nurbs_d_surface.cpp
new file mode 100644
index 000000000000..09cd985bfe79
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_d_surface.cpp
@@ -0,0 +1,24 @@
+--- nurbs/d_surface.cpp.orig 2008-02-13 22:34:54.000000000 +0100
++++ nurbs/d_surface.cpp 2008-02-13 22:35:05.000000000 +0100
+@@ -19,21 +19,4 @@
+ cerr << "NOT DEFINED FOR 2D SURFACES.\n" ;
+ return 0;
+ }
+-
+-#ifdef NO_IMPLICIT_TEMPLATES
+-
+- template class InterPoint<double,2> ;
+- template class InterPoint<double,3> ;
+-
+- template class BasicList<InterPoint<double,2> > ;
+- template class BasicList<InterPoint<double,3> > ;
+-
+- template class ParaSurface<double,2> ;
+- template class ParaSurface<double,3> ;
+-
+- template void intersectSurfaces(const ParaSurface<double,2>&, const ParaSurface<double,2>&, BasicList<InterPoint<double,2> >&, int, double, double, double, double) ;
+- template void intersectSurfaces(const ParaSurface<double,3>&, const ParaSurface<double,3>&, BasicList<InterPoint<double,3> >&, int, double, double, double, double) ;
+-
+-#endif
+-
+ }
diff --git a/graphics/nurbs++/files/patch-nurbs_f_surface.cpp b/graphics/nurbs++/files/patch-nurbs_f_surface.cpp
new file mode 100644
index 000000000000..23fbdaeb22ee
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_f_surface.cpp
@@ -0,0 +1,24 @@
+--- nurbs/f_surface.cpp.orig 2008-02-13 22:31:09.000000000 +0100
++++ nurbs/f_surface.cpp 2008-02-13 22:31:32.000000000 +0100
+@@ -20,21 +20,4 @@
+ return 0;
+ }
+
+-#ifdef NO_IMPLICIT_TEMPLATES
+-
+- template class InterPoint<float,2> ;
+- template class InterPoint<float,3> ;
+-
+- template class BasicList<InterPoint<float,2> > ;
+- template class BasicList<InterPoint<float,3> > ;
+-
+- template class ParaSurface<float,2> ;
+- template class ParaSurface<float,3> ;
+-
+- template void intersectSurfaces(const ParaSurface<float,2>&, const ParaSurface<float,2>&, BasicList<InterPoint<float,2> >&, int, float, float, float, float) ;
+-
+- template void intersectSurfaces(const ParaSurface<float,3>&, const ParaSurface<float,3>&, BasicList<InterPoint<float,3> >&, int, float, float, float, float) ;
+-
+-#endif
+-
+ }
diff --git a/graphics/nurbs++/files/patch-nurbs_hnurbsS_sp.h b/graphics/nurbs++/files/patch-nurbs_hnurbsS_sp.h
new file mode 100644
index 000000000000..f1690656fc92
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_hnurbsS_sp.h
@@ -0,0 +1,15 @@
+--- nurbs/hnurbsS_sp.h.orig
++++ nurbs/hnurbsS_sp.h
+@@ -83,10 +83,10 @@
+ T maxAtV(int i) const { return maxAtV_[i] ; }
+
+ HPoint_nD<T,N> surfP(int i,int j) const
+- { return hpointAt(maxAtU_[i],maxAtV_[j]); }
++ { return this->hpointAt(maxAtU_[i],maxAtV_[j]); }
+
+ HPoint_nD<T,N> surfP(int i,int j, int lod) const
+- { return hpointAt(maxAtU_[i],maxAtV_[j],lod) ; }
++ { return this->hpointAt(maxAtU_[i],maxAtV_[j],lod) ; }
+
+ void updateMaxUV()
+ { updateMaxU() ; updateMaxV() ; }
diff --git a/graphics/nurbs++/files/patch-nurbs_nurbs.h b/graphics/nurbs++/files/patch-nurbs_nurbs.h
new file mode 100644
index 000000000000..93d48fd4583f
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_nurbs.h
@@ -0,0 +1,13 @@
+--- nurbs/nurbs.h.orig
++++ nurbs/nurbs.h
+@@ -105,8 +105,8 @@
+
+ // Basis functions
+ T basisFun(T u, int i, int p=-1) const ;
+- void basisFuns(T u, int span, Vector<T>& N) const ;
+- void dersBasisFuns(int n,T u, int span, Matrix<T>& N) const;
++ void basisFuns(T u, int span, Vector<T>& N_) const ;
++ void dersBasisFuns(int n,T u, int span, Matrix<T>& N_) const;
+
+ // Knot functions
+ T minKnot() const //! the minimal value for the knot vector
diff --git a/graphics/nurbs++/files/patch-nurbs_nurbsGL.cpp b/graphics/nurbs++/files/patch-nurbs_nurbsGL.cpp
new file mode 100644
index 000000000000..c9e556938b7b
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_nurbsGL.cpp
@@ -0,0 +1,11 @@
+--- nurbs/nurbsGL.cpp.orig
++++ nurbs/nurbsGL.cpp
+@@ -26,7 +26,7 @@
+ #include <nurbsGL.h>
+ #include <string.h>
+ #include <stdio.h>
+-#include <iostream.h>
++#include <iostream>
+
+ #ifdef WITH_OPENGL
+
diff --git a/graphics/nurbs++/files/patch-nurbs_nurbsS.h b/graphics/nurbs++/files/patch-nurbs_nurbsS.h
new file mode 100644
index 000000000000..b046f3d909fe
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_nurbsS.h
@@ -0,0 +1,24 @@
+--- nurbs/nurbsS.h.orig
++++ nurbs/nurbsS.h
+@@ -99,8 +99,8 @@
+ virtual HPoint_nD<T,N> operator()(T u, T v) const ;
+
+ void basisFuns(T u, T v, int spanU, int spanV, Vector<T>& Nu, Vector<T>& Nv) const ;
+- void basisFunsU(T u, int span, Vector<T>& N) const ;
+- void basisFunsV(T u, int span, Vector<T>& N) const ;
++ void basisFunsU(T u, int span, Vector<T>& N_) const ;
++ void basisFunsV(T u, int span, Vector<T>& N_) const ;
+ void dersBasisFuns(T u, T v, int dU, int dV,int uspan, int vspan,Matrix<T> & Niku, Matrix<T>& Njkv ) const ;
+
+ // Derivative functions
+@@ -135,8 +135,8 @@
+ int skinU(NurbsCurveArray<T,N>& ca, int degU);
+ void sweep(const NurbsCurve<T,N>& t, const NurbsCurve<T,N>& C, const NurbsCurve<T,N>& Sv, int K,int useAy=0, int invAz=0) ;
+ void sweep(const NurbsCurve<T,N>& t, const NurbsCurve<T,N>& C, int K,int useAy=0, int invAz=0) ;
+- void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& T, double theta) ;
+- void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& T) ;
++ void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& T_, double theta) ;
++ void makeFromRevolution(const NurbsCurve<T,N>& profile, const Point_nD<T,N>& S, const Point_nD<T,N>& T_) ;
+ void makeFromRevolution(const NurbsCurve<T,N>& profile) ;
+
+ void makeSphere(const Point_nD<T,N>& O, T r) ;
diff --git a/graphics/nurbs++/files/patch-nurbs_sp.cpp b/graphics/nurbs++/files/patch-nurbs_sp.cpp
new file mode 100644
index 000000000000..6a88fb71f4b7
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_sp.cpp
@@ -0,0 +1,71 @@
+--- nurbs/nurbs_sp.cpp.orig Mon May 13 14:07:46 2002
++++ nurbs/nurbs_sp.cpp Fri Dec 1 00:46:20 2006
+@@ -41,7 +41,7 @@
+ */
+ template <class T, int N>
+ void NurbsCurveSP<T,N>::updateMaxU() {
+- if(deg_>3){
++ if(this->deg_>3){
+ #ifdef USE_EXCEPTION
+ throw NurbsInputError();
+ #else
+@@ -51,10 +51,10 @@
+ #endif
+ }
+ else{
+- maxU.resize(P.n()) ;
+- maxAt_.resize(P.n()) ;
+- for(int i=0;i<P.n();++i){
+- if(!maxInfluence(i,U,deg_,maxAt_[i]))
++ maxU.resize(this->P.n()) ;
++ maxAt_.resize(this->P.n()) ;
++ for(int i=0;i<this->P.n();++i){
++ if(!maxInfluence(i,this->U,this->deg_,maxAt_[i]))
+ cerr << "Problem in maxInfluence U!\n" ;
+ if(i>0)
+ if(maxAt_[i]<maxAt_[i-1]){
+@@ -63,13 +63,13 @@
+ #else
+ Error error("Error updating maxU");
+ error << "HUGE ERROR!\n" ;
+- error << "Knot = " << U << endl ;
++ error << "Knot = " << this->U << endl ;
+ error << " i = " << i << endl ;
+- error << " deg = " << deg_ << endl ;
++ error << " deg = " << this->deg_ << endl ;
+ error.fatal() ;
+ #endif
+ }
+- maxU[i] = basisFun(maxAt_[i],i,deg_) ;
++ maxU[i] = this->basisFun(maxAt_[i],i,this->deg_) ;
+ }
+
+ }
+@@ -96,14 +96,14 @@
+ */
+ template <class T, int N>
+ void NurbsCurveSP<T,N>::modOnlySurfCPby(int i, const HPoint_nD<T,N>& a){
+- Vector<T> u(2*deg_+3) ;
+- Vector< Point_nD<T,N> > pts(2*deg_+3) ;
++ Vector<T> u(2*this->deg_+3) ;
++ Vector< Point_nD<T,N> > pts(2*this->deg_+3) ;
+
+ int n=0;
+- for(int j=i-deg_-1;j<=i+deg_+1;++j){
++ for(int j=i-this->deg_-1;j<=i+this->deg_+1;++j){
+ if(j<0)
+ continue ;
+- if(j>=P.n())
++ if(j>=this->P.n())
+ break ;
+ u[n] = maxAt_[j] ;
+ if( j == i){
+@@ -119,7 +119,7 @@
+ u.resize(n) ;
+ pts.resize(n) ;
+
+- movePoint(u,pts) ;
++ this->movePoint(u,pts) ;
+ }
+
+ } // end namespace
diff --git a/graphics/nurbs++/files/patch-nurbs_sp.h b/graphics/nurbs++/files/patch-nurbs_sp.h
new file mode 100644
index 000000000000..dcae1d6f768f
--- /dev/null
+++ b/graphics/nurbs++/files/patch-nurbs_sp.h
@@ -0,0 +1,20 @@
+--- nurbs/nurbs_sp.h.orig Fri May 17 11:24:21 2002
++++ nurbs/nurbs_sp.h Fri Dec 1 00:45:10 2006
+@@ -72,7 +72,7 @@
+ int read(ifstream &fin) ;
+
+ void modSurfCPby(int i, const HPoint_nD<T,N>& a)
+- { P[i] += a / maxU[i] ; }
++ { this->P[i] += a / maxU[i] ; }
+ void modSurfCP(int i, const HPoint_nD<T,N>& a)
+ { modSurfCPby(i,a-surfP(i)) ; }
+
+@@ -84,7 +84,7 @@
+ { return maxAt_[i] ; }
+
+ HPoint_nD<T,N> surfP(int i) const
+- { return hpointAt(maxAt_[i]) ; }
++ { return this->hpointAt(maxAt_[i]) ; }
+
+ void updateMaxU() ;
+
diff --git a/graphics/nurbs++/files/patch-vector.cpp b/graphics/nurbs++/files/patch-vector.cpp
new file mode 100644
index 000000000000..aaa73b94c3a9
--- /dev/null
+++ b/graphics/nurbs++/files/patch-vector.cpp
@@ -0,0 +1,257 @@
+--- matrix/vector.cpp.orig Mon May 13 14:07:45 2002
++++ matrix/vector.cpp Thu Nov 30 23:49:51 2006
+@@ -51,16 +51,16 @@
+ if(this==&b)
+ return *this ;
+
+- if ( n() != b.n())
++ if ( this->n() != b.n())
+ {
+- resize(b.n()) ;
++ this->resize(b.n()) ;
+ }
+
+- sze = b.n() ;
++ this->sze = b.n() ;
+ T *pa, *pb ;
+- pa = x-1 ;
++ pa = this->x-1 ;
+ pb = b.x-1 ;
+- for(int i=n();i>0;--i){
++ for(int i=this->n();i>0;--i){
+ *(++pa) = *(++pb) ;
+ }
+ return *this;
+@@ -79,13 +79,13 @@
+ template <class T>
+ Vector<T>& Vector<T>::operator=(const BasicArray<T> &b)
+ {
+- if ( size() != b.size())
++ if ( this->size() != b.size())
+ {
+- resize(b.size()) ;
++ this->resize(b.size()) ;
+ }
+ T *ptr ;
+- ptr = x - 1 ;
+- for(int i=size()-1;i>=0;--i)
++ ptr = this->x - 1 ;
++ for(int i=this->size()-1;i>=0;--i)
+ *(++ptr) = b[i] ;
+
+ return *this;
+@@ -105,9 +105,9 @@
+ template <class T>
+ T Vector<T>::operator=(const T d)
+ {
+- const int sz = size();
++ const int sz = this->size();
+ T *ptr ;
+- ptr = x-1 ;
++ ptr = this->x-1 ;
+ for (int i = sz; i > 0; --i)
+ *(++ptr) = d ;
+
+@@ -130,19 +130,19 @@
+ template <class T>
+ Vector<T>& Vector<T>::operator+=(const Vector<T> &a)
+ {
+- if ( a.size() != size())
++ if ( a.size() != this->size())
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize(size(),a.size()) ;
++ throw WrongSize(this->size(),a.size()) ;
+ #else
+ Error error("Vector<T>::operator+=(Vector<T>&)");
+- error << "Vector<T> a += Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
++ error << "Vector<T> a += Vector<T> b different sizes, a = " << this->size() << ", b = " << a.size() ;
+ error.fatal() ;
+ #endif
+ }
+- const int sz = size();
++ const int sz = this->size();
+ T *ptr,*aptr ;
+- ptr = x-1 ;
++ ptr = this->x-1 ;
+ aptr = a.x-1 ;
+ for (int i = sz; i >0; --i)
+ *(++ptr) += *(++aptr) ;
+@@ -165,20 +165,20 @@
+ template <class T>
+ Vector<T>& Vector<T>::operator-=(const Vector<T> &a)
+ {
+- if ( a.size() != size())
++ if ( a.size() != this->size())
+ {
+ #ifdef USE_EXCEPTION
+- throw WrongSize(size(),a.size()) ;
++ throw WrongSize(this->size(),a.size()) ;
+ #else
+ Error error("Vector<T>::operator-=(Vector<T>&)");
+- error << "Vector<T> a -= Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
++ error << "Vector<T> a -= Vector<T> b different sizes, a = " << this->size() << ", b = " << a.size() ;
+ error.fatal() ;
+ #endif
+ }
+
+- const int sz = size();
++ const int sz = this->size();
+ T *ptr,*aptr ;
+- ptr = x-1 ;
++ ptr = this->x-1 ;
+ aptr = a.x-1 ;
+ for (int i = sz; i > 0; --i)
+ *(++ptr) -= *(++aptr) ;
+@@ -391,7 +391,7 @@
+ }
+
+ T *aptr,*bptr ;
+- aptr = &x[i]-1 ;
++ aptr = &this->x[i]-1 ;
+ bptr = b.x-1 ;
+ for ( int j = b.rows(); j > 0; --j)
+ *(++aptr) = *(++bptr) ;
+@@ -429,7 +429,7 @@
+
+ Vector<T> subvec(l) ;
+ T *aptr, *bptr ;
+- aptr = &x[i] - 1 ;
++ aptr = &this->x[i] - 1 ;
+ bptr = subvec.x -1 ;
+ for ( int j = l; j > 0; --j)
+ *(++bptr) = *(++aptr) ;
+@@ -449,12 +449,12 @@
+ */
+ template <class T>
+ int Vector<T>::minIndex() const {
+- T min = x[0] ;
++ T min = this->x[0] ;
+ int index = 0 ;
+
+- for(int i=1;i<n();i++){
+- if(x[i]<=min){
+- min = x[i] ;
++ for(int i=1;i<this->n();i++){
++ if(this->x[i]<=min){
++ min = this->x[i] ;
+ index = i ;
+ }
+ }
+@@ -523,12 +523,12 @@
+ T a ;
+ T *v1,*v2 ;
+
+- ir = sze-1 ;
++ ir = this->sze-1 ;
+ l = 0 ;
+
+ while(1){
+ if(ir-l<M){ // perform an insertion sort when the array is small enough
+- v1 = &x[l] ;
++ v1 = &this->x[l] ;
+ for(j=l+1;j<=ir;++j){
+ a = *(++v1) ;
+ v2 = v1 ;
+@@ -547,31 +547,31 @@
+ }
+ else{
+ k=(l+ir) >> 1 ;
+- swap(x[k],x[l+1]) ;
+- if(x[l+1] > x[ir]){
+- swap(x[l+1],x[ir]) ;
++ swap(this->x[k],this->x[l+1]) ;
++ if(this->x[l+1] > this->x[ir]){
++ swap(this->x[l+1],this->x[ir]) ;
+ }
+- if(x[l]> x[ir]){
+- swap(x[l],x[ir]) ;
++ if(this->x[l]> this->x[ir]){
++ swap(this->x[l],this->x[ir]) ;
+ }
+- if(x[l+1] > x[l]){
+- swap(x[l+1],x[l]) ;
++ if(this->x[l+1] > this->x[l]){
++ swap(this->x[l+1],this->x[l]) ;
+ }
+ i=l+1 ;
+ j=ir ;
+- a=x[l] ;
+- v1 = &x[i] ;
+- v2 = &x[j] ;
++ a=this->x[l] ;
++ v1 = &this->x[i] ;
++ v2 = &this->x[j] ;
+ while(1){
+ while(*v1 < a) { ++i ; ++v1 ; }
+ while(*v2 > a) { --j ; --v2 ; }
+ if(j<i) break ;
+ if(*v1 == *v2) // both are equal to a...
+ break ;
+- swap(x[i],x[j]) ;
++ swap(this->x[i],this->x[j]) ;
+ }
+- x[l] = x[j] ;
+- x[j] = a ;
++ this->x[l] = this->x[j] ;
++ this->x[j] = a ;
+ jstack += 2 ;
+ if(jstack>=Nstack){
+ istack.resize(istack.n()+Nstack) ; // increase the vector size
+@@ -618,10 +618,10 @@
+ int jstack=0;
+ T a ;
+
+- ir = sze-1 ;
++ ir = this->sze-1 ;
+ l = 0 ;
+
+- index.resize(sze) ;
++ index.resize(this->sze) ;
+ for(i=0;i<index.n();++i)
+ index[i] = i ;
+
+@@ -629,9 +629,9 @@
+ if(ir-l<M){ // perform an insertion sort when the array is small enough
+ for(j=l+1;j<=ir;++j){
+ indext = index[j] ;
+- a = x[indext] ;
++ a = this->x[indext] ;
+ for(i=j-1;i>=0;--i){
+- if(x[index[i]] <= a) break ;
++ if(this->x[index[i]] <= a) break ;
+ index[i+1] = index[i] ;
+ }
+ index[i+1] = indext ;
+@@ -643,24 +643,24 @@
+ else{
+ k=(l+ir) >> 1 ;
+ swap(index[k],index[l+1]) ;
+- if(x[index[l+1]] > x[index[ir]]){
++ if(this->x[index[l+1]] > this->x[index[ir]]){
+ swap(index[l+1],index[ir]) ;
+ }
+- if(x[index[l]]> x[index[ir]]){
++ if(this->x[index[l]]> this->x[index[ir]]){
+ swap(index[l],index[ir]) ;
+ }
+- if(x[index[l+1]] > x[index[l]]){
++ if(this->x[index[l+1]] > this->x[index[l]]){
+ swap(index[l+1],index[l]) ;
+ }
+ i=l+1 ;
+ j=ir ;
+ indext = index[l] ;
+- a=x[indext] ;
++ a=this->x[indext] ;
+ while(1){
+- while(x[index[i]] < a) { ++i ; }
+- while(x[index[j]] > a) { --j ; }
++ while(this->x[index[i]] < a) { ++i ; }
++ while(this->x[index[j]] > a) { --j ; }
+ if(j<i) break ;
+- if(x[index[i]] == x[index[j]])
++ if(this->x[index[i]] == this->x[index[j]])
+ break ;
+ swap(index[i],index[j]) ;
+ }
diff --git a/graphics/nurbs++/files/patch-vector.h b/graphics/nurbs++/files/patch-vector.h
new file mode 100644
index 000000000000..4cae40004c1a
--- /dev/null
+++ b/graphics/nurbs++/files/patch-vector.h
@@ -0,0 +1,20 @@
+--- matrix/vector.h.orig Mon May 13 14:07:45 2002
++++ matrix/vector.h Thu Nov 30 23:29:02 2006
+@@ -69,7 +69,7 @@
+ {
+ public:
+ int rows() const //!< a reference to the size of the vector
+- { return sze ;}
++ { return this->sze ;}
+ Vector() : BasicArray<T>(1) {} //!< Basic constructor
+ Vector(const int r) : BasicArray<T>(r) {}
+ Vector(const Vector<T>& v) : BasicArray<T>(v) {}
+@@ -90,7 +90,7 @@
+ Vector<T> get(int i, int l);
+
+ int minIndex() const ;
+- T minimum() const { return operator[](minIndex()) ; } // returns the minimal value inside the vector
++ T minimum() const { return this->operator[](minIndex()) ; } // returns the minimal value inside the vector
+
+ void qSortStd() ;
+ void qSort(int M=7) ;
diff --git a/graphics/nurbs++/pkg-descr b/graphics/nurbs++/pkg-descr
new file mode 100644
index 000000000000..f6471dba47e5
--- /dev/null
+++ b/graphics/nurbs++/pkg-descr
@@ -0,0 +1,12 @@
+Non-Uniform Rational B-Splines (NURBS) are parametric functions which can
+represent any type of curves or surfaces. This C++ library hides the basic
+mathematics of NURBS, allowing the user to focus on the more challenging
+parts of their projects.
+
+The NURBS++ package includes a matrix library, an image manipulation
+library, a numerical library and a NURBS library.
+
+This library is copyrighted under the terms of the LGPL by its author,
+Phillipe Lavoie <lavoie@zeus.genie.uottawa.ca>.
+
+WWW: http://libnurbs.sourceforge.net/
diff --git a/graphics/nurbs++/pkg-plist b/graphics/nurbs++/pkg-plist
new file mode 100644
index 000000000000..3373ed66b7ee
--- /dev/null
+++ b/graphics/nurbs++/pkg-plist
@@ -0,0 +1,61 @@
+bin/nurbs++-config
+include/nurbs++/barray.h
+include/nurbs++/barray2d.h
+include/nurbs++/color.h
+include/nurbs++/coordinate.h
+include/nurbs++/curve.h
+include/nurbs++/cvector.h
+include/nurbs++/error.h
+include/nurbs++/filter.h
+include/nurbs++/galloc.h
+include/nurbs++/galloc2d.h
+include/nurbs++/hnurbs.h
+include/nurbs++/hnurbsS.h
+include/nurbs++/hnurbsS_sp.h
+include/nurbs++/hpoint_nd.h
+include/nurbs++/image.h
+include/nurbs++/integrate.h
+include/nurbs++/list.h
+include/nurbs++/matrix.h
+include/nurbs++/matrixMat.h
+include/nurbs++/matrixRT.h
+include/nurbs++/matrixTool.h
+include/nurbs++/matrix_global.h
+include/nurbs++/nurbs.h
+include/nurbs++/nurbsGL.h
+include/nurbs++/nurbsS.h
+include/nurbs++/nurbsS_sp.h
+include/nurbs++/nurbsSub.h
+include/nurbs++/nurbs_global.h
+include/nurbs++/nurbs_sp.h
+include/nurbs++/plib.h
+include/nurbs++/plib_config.h
+include/nurbs++/point_nd.h
+include/nurbs++/rec_filter.h
+include/nurbs++/specialType.h
+include/nurbs++/specialVcc.h
+include/nurbs++/statistic.h
+include/nurbs++/surface.h
+include/nurbs++/tri_spline.h
+include/nurbs++/vector.h
+lib/libmatrix.a
+lib/libmatrix.so
+lib/libmatrix.so.1
+lib/libmatrix.so.1.0.0
+lib/libmatrixI.a
+lib/libmatrixI.so
+lib/libmatrixI.so.1
+lib/libmatrixI.so.1.0.0
+lib/libmatrixN.a
+lib/libmatrixN.so
+lib/libmatrixN.so.1
+lib/libmatrixN.so.1.0.0
+lib/libnurbsd.a
+lib/libnurbsd.so
+lib/libnurbsd.so.0
+lib/libnurbsd.so.0.1.0
+lib/libnurbsf.a
+lib/libnurbsf.so
+lib/libnurbsf.so.0
+lib/libnurbsf.so.0.1.0
+man/man1/nurbs++-config.1.gz