updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / nurbs++ / libnurbs.patch
blob47473c584aa9017cc3d182e0375f3a4b3614cecb
1 diff -rNup nurbs++-3.0.11/image/color.cpp nurbs++-3.0.11_mod/image/color.cpp
2 --- nurbs++-3.0.11/image/color.cpp 2002-05-14 00:07:45.000000000 +0300
3 +++ nurbs++-3.0.11_mod/image/color.cpp 2007-06-21 03:32:20.000000000 +0300
4 @@ -50,7 +50,7 @@ namespace PLib {
5 Color blackColor(0,0,0) ;
6 */
8 - double
9 + template<>double
10 Matrix<Color>::norm(void) {
11 #ifdef USE_EXCEPTION
12 throw MatrixErr();
13 @@ -63,7 +63,7 @@ namespace PLib {
16 #ifndef USING_VCC
17 - int Matrix<Color>::read(char* filename,int r, int c) {
18 + template<>int Matrix<Color>::read(char* filename,int r, int c) {
19 ifstream fin(filename) ;
20 if(!fin) {
21 resize(1,1) ;
22 @@ -89,7 +89,7 @@ namespace PLib {
24 #endif
26 - int Vector<Color>::minIndex() const {
27 + template<>int Vector<Color>::minIndex() const {
28 #ifdef USE_EXCEPTION
29 throw MatrixErr() ;
30 #else
31 diff -rNup nurbs++-3.0.11/image/image.cpp nurbs++-3.0.11_mod/image/image.cpp
32 --- nurbs++-3.0.11/image/image.cpp 2002-05-14 00:07:45.000000000 +0300
33 +++ nurbs++-3.0.11_mod/image/image.cpp 2007-06-21 03:40:46.000000000 +0300
34 @@ -55,9 +55,9 @@ template <class T>
35 void MatrixImage<T>::drawLine(int i1, int j1, int i2, int j2, T color){
36 int i,j ;
37 double mx,b ;
38 - if(i1<0 || j1<0 || i1>rows() || j1>=cols() ){
39 + if(i1<0 || j1<0 || i1>this->rows() || j1>=this->cols() ){
40 #ifdef USE_EXCEPTION
41 - throw OutOfBound2D(i1,j1,0,rows()-1,0,cols()-1) ;
42 + throw OutOfBound2D(i1,j1,0,this->rows()-1,0,this->cols()-1) ;
43 #else
44 Error error("MatrixImage<T>::drawLine") ;
45 error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
46 @@ -65,9 +65,9 @@ void MatrixImage<T>::drawLine(int i1, in
47 #endif
48 return ;
50 - if(i2 <0 || j2<0 || i2>rows() || j2>=cols() ){
51 + if(i2 <0 || j2<0 || i2>this->rows() || j2>=this->cols() ){
52 #ifdef USE_EXCEPTION
53 - throw OutOfBound2D(i2,j2,0,rows()-1,0,cols()-1) ;
54 + throw OutOfBound2D(i2,j2,0,this->rows()-1,0,this->cols()-1) ;
55 #else
56 Error error("MatrixImage<T>::drawLine") ;
57 error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
58 @@ -79,7 +79,7 @@ void MatrixImage<T>::drawLine(int i1, in
59 // check if line is vertical
60 if(j1==j2){
61 for(i=minimum(i1,i2);i<=maximum(i1,i2);i++)
62 - operator()(i,j1) = color ;
63 + this->operator()(i,j1) = color ;
64 return ;
66 mx = (double)(i1-i2)/(double)(j1-j2) ;
67 @@ -88,13 +88,13 @@ void MatrixImage<T>::drawLine(int i1, in
68 if(i1>i2){
69 for(i=i1;i>=i2;i--){
70 j = int(((double)i-b)/mx) ;
71 - operator()(i,j) = color ;
72 + this->operator()(i,j) = color ;
75 else{
76 for(i=i1;i<=i2;i++){
77 j = (int)((i-b)/mx) ;
78 - operator()(i,j) = color ;
79 + this->operator()(i,j) = color ;
83 @@ -102,13 +102,13 @@ void MatrixImage<T>::drawLine(int i1, in
84 if(j1>j2){
85 for(j=j1;j>=j2;j--){
86 i = (int)(mx*j+b) ;
87 - operator()(i,j) = color ;
88 + this->operator()(i,j) = color ;
91 else{
92 for(j=j1;j<=j2;j++){
93 i = (int)(mx*j+b) ;
94 - operator()(i,j) = color ;
95 + this->operator()(i,j) = color ;
99 @@ -133,9 +133,9 @@ template <class T>
100 void MatrixImage<T>::drawPoint(int i, int j, double r , T color){
101 for(int y=i-int(ceil(r)) ; y<i+int(ceil(r)) ; y++)
102 for(int x = j-int(ceil(r)) ; x<j+int(ceil(r)) ; x++){
103 - if(y>=0 && y<rows() && x>=0 && x<cols()){
104 + if(y>=0 && y<this->rows() && x>=0 && x<this->cols()){
105 if( ((y-i)*(y-i)+(x-j)*(x-j))<= r*r)
106 - operator()(y,x) = color ;
107 + this->operator()(y,x) = color ;
111 @@ -153,14 +153,14 @@ void MatrixImage<T>::drawPoint(int i, in
113 template <class T>
114 void MatrixImage<T>::store(Matrix<T>& a){
115 - if(a.rows() != rows() || a.cols() != cols()) {
116 - a.resize(rows(),cols()) ;
117 + if(a.rows() != this->rows() || a.cols() != this->cols()) {
118 + a.resize(this->rows(),this->cols()) ;
120 T *aptr, *bptr ;
121 int size,i ;
122 aptr = &a(0,0)-1 ;
123 - bptr = m-1 ;
124 - size = cols()*rows() ;
125 + bptr = this->m-1 ;
126 + size = this->cols()*this->rows() ;
127 for(i=0;i<size;i++)
128 *(++aptr) = *(++bptr) ;
131 diff -rNup nurbs++-3.0.11/matrix/barray2d_uchar.cpp nurbs++-3.0.11_mod/matrix/barray2d_uchar.cpp
132 --- nurbs++-3.0.11/matrix/barray2d_uchar.cpp 2002-05-14 00:07:45.000000000 +0300
133 +++ nurbs++-3.0.11_mod/matrix/barray2d_uchar.cpp 2007-06-21 03:05:10.000000000 +0300
134 @@ -27,7 +27,7 @@
136 namespace PLib {
138 -ostream&
139 +template<>ostream&
140 Basic2DArray<unsigned char>::print(ostream& os) const
142 int i, j;
143 diff -rNup nurbs++-3.0.11/matrix/barray_complex.cpp nurbs++-3.0.11_mod/matrix/barray_complex.cpp
144 --- nurbs++-3.0.11/matrix/barray_complex.cpp 2002-05-14 00:07:45.000000000 +0300
145 +++ nurbs++-3.0.11_mod/matrix/barray_complex.cpp 2007-06-21 03:20:37.000000000 +0300
146 @@ -27,7 +27,7 @@
148 namespace PLib {
150 -ostream&
151 +template<>ostream&
152 BasicArray<Complex>::print(ostream& os) const{
153 const int iend = size();
155 diff -rNup nurbs++-3.0.11/matrix/cvector.h nurbs++-3.0.11_mod/matrix/cvector.h
156 --- nurbs++-3.0.11/matrix/cvector.h 2002-05-14 00:07:45.000000000 +0300
157 +++ nurbs++-3.0.11_mod/matrix/cvector.h 2007-06-20 23:23:45.000000000 +0300
158 @@ -54,10 +54,10 @@ namespace PLib {
159 CVector(const BasicArray<T>& v) : Vector<T>(v), index(0) {;}
160 virtual ~CVector() {}
162 - T& operator[](const int i) { return x[i%sze]; }
163 - T operator[](const int i) const { return x[i%sze]; }
164 + T& operator[](const int i) { return this->x[i%this->sze]; }
165 + T operator[](const int i) const { return this->x[i%this->sze]; }
167 - void put(T v) { x[index] = v ; index = (index+1)%sze; }
168 + void put(T v) { this->x[index] = v ; index = (index+1)%this->sze; }
170 protected:
171 int index ;
172 diff -rNup nurbs++-3.0.11/matrix/list.h nurbs++-3.0.11_mod/matrix/list.h
173 --- nurbs++-3.0.11/matrix/list.h 2002-05-14 00:07:45.000000000 +0300
174 +++ nurbs++-3.0.11_mod/matrix/list.h 2007-06-21 11:46:19.000000000 +0300
175 @@ -56,7 +56,7 @@ class BasicList: public BasicNode<T>
177 public:
178 BasicList() ;
179 - BasicList(BasicList<T>& a) ;
180 + BasicList(const BasicList<T>& a) ;
181 ~BasicList() { reset() ; }
184 @@ -125,7 +125,7 @@ BasicList<T>::BasicList(): BasicNode<T>
185 Modified by:
186 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
187 template <class T>
188 -BasicList<T>::BasicList(BasicList<T>& a): BasicNode<T>() {
189 +BasicList<T>::BasicList(const BasicList<T>& a): BasicNode<T>() {
190 first_ = last_ = 0 ;
191 current = first_ ;
192 *this = a ;
193 diff -rNup nurbs++-3.0.11/matrix/matrix_char.cpp nurbs++-3.0.11_mod/matrix/matrix_char.cpp
194 --- nurbs++-3.0.11/matrix/matrix_char.cpp 2002-05-14 00:07:45.000000000 +0300
195 +++ nurbs++-3.0.11_mod/matrix/matrix_char.cpp 2007-06-21 03:09:46.000000000 +0300
196 @@ -27,7 +27,7 @@
198 namespace PLib {
200 - Matrix<char>&
201 + template<>Matrix<char>&
202 Matrix<char>::operator*=(double a)
204 char *p1 ;
205 @@ -40,7 +40,7 @@ namespace PLib {
206 return *this ;
209 - Matrix<char>&
210 + template<>Matrix<char>&
211 Matrix<char>::operator+=(double a)
213 char *p1 ;
214 @@ -51,7 +51,7 @@ namespace PLib {
215 return *this ;
218 - Matrix<char>&
219 + template<>Matrix<char>&
220 Matrix<char>::operator-=(double a)
222 char *p1 ;
223 @@ -62,7 +62,7 @@ namespace PLib {
224 return *this ;
227 - Matrix<char>&
228 + template<>Matrix<char>&
229 Matrix<char>::operator/=(double a)
231 char *p1 ;
232 diff -rNup nurbs++-3.0.11/matrix/matrix_complex.cpp nurbs++-3.0.11_mod/matrix/matrix_complex.cpp
233 --- nurbs++-3.0.11/matrix/matrix_complex.cpp 2002-05-24 20:25:49.000000000 +0300
234 +++ nurbs++-3.0.11_mod/matrix/matrix_complex.cpp 2007-06-21 03:21:12.000000000 +0300
235 @@ -27,7 +27,7 @@
237 namespace PLib {
239 - double Matrix<Complex>::norm(void){
240 + template<>double Matrix<Complex>::norm(void){
241 int i,j ;
242 double sumR, sumI, maxsum;
243 int init=0 ;
244 diff -rNup nurbs++-3.0.11/matrix/matrix.cpp nurbs++-3.0.11_mod/matrix/matrix.cpp
245 --- nurbs++-3.0.11/matrix/matrix.cpp 2002-05-14 00:07:45.000000000 +0300
246 +++ nurbs++-3.0.11_mod/matrix/matrix.cpp 2007-06-22 00:52:04.000000000 +0300
247 @@ -54,19 +54,19 @@ Matrix<T>& Matrix<T>::operator=(const Ma
248 if ( this == &a )
249 return *this;
251 - if ( a.rows() != rows() || a.cols() != cols() ){
252 + if ( a.rows() != this->rows() || a.cols() != this->cols() ){
253 resize(a.rows(),a.cols()) ;
256 - int sze = rows()*cols() ;
257 + int sze = this->rows()*this->cols() ;
258 T *ptr, *aptr ;
259 - ptr = m-1 ;
260 + ptr = this->m-1 ;
261 aptr = a.m-1 ;
263 for (i = sze; i > 0; --i)
264 *(++ptr) = *(++aptr) ;
266 - by_columns = a.by_columns;
267 + this->by_columns = a.by_columns;
269 return *this;
271 @@ -100,10 +100,10 @@ void Matrix<T>::submatrix(int sr, int sc
273 int rwz,coz,i,j;
275 - if ( rows() % a.rows() != 0 || cols() % a.cols() != 0 || rows() < a.rows() || cols() < a.cols() )
276 + if ( this->rows() % a.rows() != 0 || this->cols() % a.cols() != 0 || this->rows() < a.rows() || this->cols() < a.cols() )
278 #ifdef USE_EXCEPTION
279 - throw WrongSize2D(rows(),cols(),a.rows(),a.cols()) ;
280 + throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols()) ;
281 #else
282 Error error("Matrix<T>::submatrix");
283 error << "Matrix and submatrix incommensurate" ;
284 @@ -111,13 +111,13 @@ void Matrix<T>::submatrix(int sr, int sc
285 #endif
288 - if ( sr >= rows()/a.rows() || sr < 0 || sc >= cols()/a.cols() || sc < 0 )
289 + if ( sr >= this->rows()/a.rows() || sr < 0 || sc >= this->cols()/a.cols() || sc < 0 )
291 #ifdef USE_EXCEPTION
292 - throw OutOfBound2D(sr,sc,0,rows()/a.rows()-1,0,cols()/a.cols()-1) ;
293 + throw OutOfBound2D(sr,sc,0,this->rows()/a.rows()-1,0,this->cols()/a.cols()-1) ;
294 #else
295 Error error("Matrix<T>::submatrix");
296 - error << "Submatrix location out of bounds.\nrowblock " << sr << ", " << rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
297 + error << "Submatrix location out of bounds.\nrowblock " << sr << ", " << this->rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
298 error.fatal() ;
299 #endif
301 @@ -127,13 +127,13 @@ void Matrix<T>::submatrix(int sr, int sc
302 #ifdef COLUMN_ORDER
303 for ( i = a.rows()-1; i >= 0; --i )
304 for(j=a.cols()-1;j>=0;--j)
305 - elem(i+rwz,j+coz) = a(i,j) ;
306 + this->elem(i+rwz,j+coz) = a(i,j) ;
307 #else
308 T *ptr, *aptr ;
309 aptr = a.m - 1;
310 for ( i = a.rows()-1; i >= 0; --i )
312 - ptr = &m[(i+rwz)*cols()+coz]-1 ;
313 + ptr = &this->m[(i+rwz)*this->cols()+coz]-1 ;
314 for ( j = a.cols(); j > 0; --j)
315 *(++ptr) = *(++aptr) ;
317 @@ -159,7 +159,7 @@ void Matrix<T>::as(int rw, int cl, Matri
318 // Assign matrix a to this matrix at (i,j)
319 int i, j;
321 - if ( (rw + a.rows()) > rows() || ( cl + a.cols()) > cols()) {
322 + if ( (rw + a.rows()) > this->rows() || ( cl + a.cols()) > this->cols()) {
323 #ifdef USE_EXCEPTION
324 throw MatrixErr();
325 #else
326 @@ -172,12 +172,12 @@ void Matrix<T>::as(int rw, int cl, Matri
327 #ifdef COLUMN_ORDER
328 for(i=0;i<a.rows();++i)
329 for(j=0;j<a.cols();++j)
330 - elem(i+rw,j+cl) = a(i,j) ;
331 + this->elem(i+rw,j+cl) = a(i,j) ;
332 #else
333 T *pptr,*aptr ;
334 aptr = a.m-1 ;
335 for ( i = 0; i<a.rows(); ++i) {
336 - pptr = &m[(i+rw)*cols()+cl]-1 ;
337 + pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
338 for ( j = 0; j < a.cols(); ++j)
339 *(++pptr) = *(++aptr);
341 @@ -208,7 +208,7 @@ template <class T>
342 Matrix<T> Matrix<T>::get(int rw, int cl, int nr, int nc) const
344 Matrix<T> getmat(nr,nc) ;
345 - if ( (rw+nr) > rows() || (cl+nc) > cols()) {
346 + if ( (rw+nr) > this->rows() || (cl+nc) > this->cols()) {
347 #ifdef USE_EXCEPTION
348 throw MatrixErr();
349 #else
350 @@ -223,12 +223,12 @@ Matrix<T> Matrix<T>::get(int rw, int cl,
351 #ifdef COLUMN_ORDER
352 for(i=0;i<nr;++i)
353 for(j=0;j<nc;++j)
354 - getmat(i,j) = elem(i+rw,j+cl) ;
355 + getmat(i,j) = this->elem(i+rw,j+cl) ;
356 #else
357 T *pptr,*aptr ;
358 aptr = getmat.m-1;
359 for (i = 0; i < nr; ++i) {
360 - pptr = &m[(i+rw)*cols()+cl]-1 ;
361 + pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
362 for ( j = 0; j < nc; ++j)
363 *(++aptr) = *(++pptr) ;
365 @@ -252,11 +252,11 @@ double Matrix<T>::norm(void){
366 double sum, maxsum;
367 int init=0 ;
368 T *pptr ;
369 - pptr = m-1 ;
370 + pptr = this->m-1 ;
371 maxsum = 0 ; // Silence the warning message
372 - for(i=0;i<rows();++i){
373 + for(i=0;i<this->rows();++i){
374 sum = 0 ;
375 - for ( j = 0; j < cols(); ++j)
376 + for ( j = 0; j < this->cols(); ++j)
377 sum += *(++pptr) ;
378 if(init)
379 maxsum = (maxsum>sum) ? maxsum : sum;
380 @@ -285,12 +285,12 @@ void Matrix<T>::diag(const T a)
382 int i, iend;
384 - iend = rows();
385 - if ( iend > cols() )
386 - iend = cols();
387 + iend = this->rows();
388 + if ( iend > this->cols() )
389 + iend = this->cols();
391 for (i = iend-1; i >=0; --i)
392 - elem(i,i) = a;
393 + this->elem(i,i) = a;
397 @@ -308,10 +308,10 @@ void Matrix<T>::diag(const T a)
398 template <class T>
399 Vector<T> Matrix<T>::getDiag(){
400 int i, iend;
401 - Vector<T> vec(minimum(rows(),cols())) ;
402 - iend = minimum(rows(),cols());
403 + Vector<T> vec(minimum(this->rows(),this->cols())) ;
404 + iend = minimum(this->rows(),this->cols());
405 for (i = iend-1; i >=0; --i)
406 - vec[i] = elem(i,i);
407 + vec[i] = this->elem(i,i);
408 return vec ;
411 @@ -328,8 +328,8 @@ template <class T>
412 Matrix<T>& Matrix<T>::operator+=(double a)
414 T *p1 ;
415 - p1 = m-1 ;
416 - const int size = rows()*cols() ;
417 + p1 = this->m-1 ;
418 + const int size = this->rows()*this->cols() ;
419 for(int i=size; i>0; --i)
420 *(++p1) += a ;
421 return *this ;
422 @@ -348,8 +348,8 @@ template <class T>
423 Matrix<T>& Matrix<T>::operator-=(double a)
425 T *p1 ;
426 - p1 = m-1 ;
427 - const int size = rows()*cols() ;
428 + p1 = this->m-1 ;
429 + const int size = this->rows()*this->cols() ;
430 for(int i=size; i>0; --i)
431 *(++p1) -= a ;
432 return *this ;
433 @@ -368,8 +368,8 @@ template <class T>
434 Matrix<T>& Matrix<T>::operator*=(double a)
436 T *p1 ;
437 - p1 = m-1 ;
438 - const int size = rows()*cols() ;
439 + p1 = this->m-1 ;
440 + const int size = this->rows()*this->cols() ;
441 for(int i=size; i>0; --i)
442 *(++p1) *= a ;
443 return *this ;
444 @@ -388,8 +388,8 @@ template <class T>
445 Matrix<T>& Matrix<T>::operator/=(double a)
447 T *p1 ;
448 - p1 = m-1 ;
449 - const int size = rows()*cols() ;
450 + p1 = this->m-1 ;
451 + const int size = this->rows()*this->cols() ;
452 for(int i=size; i>0; --i)
453 *(++p1) /= a ;
454 return *this ;
455 @@ -408,16 +408,16 @@ Matrix<T>& Matrix<T>::operator/=(double
456 template <class T>
457 Matrix<T>& Matrix<T>::operator+=(const Matrix<T> &a)
459 - if ( a.rows() != rows() || a.cols() != cols() )
460 + if ( a.rows() != this->rows() || a.cols() != this->cols() )
462 #ifdef USE_EXCEPTION
463 - throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
464 + throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
465 #else
466 Error error("Matrix<T>::operator+=") ;
467 - if ( rows() != a.rows() )
468 - error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
469 + if ( this->rows() != a.rows() )
470 + error << "Matrices are of diferent size, a.rows() = " << this->rows() << " and b.rows() = " << a.rows() << endl ;
471 if ( cols() != a.cols())
472 - error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
473 + error << "Matrices are of diferent size, a.cols() = " << this->cols() << " and b.cols() = " << a.cols() << endl ;
474 error.fatal() ;
475 #endif
477 @@ -425,8 +425,8 @@ Matrix<T>& Matrix<T>::operator+=(const M
478 int i, sze ;
479 T *aptr,*sptr ;
480 aptr = a.m - 1 ;
481 - sptr = m - 1 ;
482 - sze = rows()*cols() ;
483 + sptr = this->m - 1 ;
484 + sze = this->rows()*this->cols() ;
485 for (i = sze; i > 0; --i){
486 *(++sptr) += *(++aptr) ;
488 @@ -468,16 +468,16 @@ Matrix<T> operator+(const Matrix<T> &a,c
489 template <class T>
490 Matrix<T>& Matrix<T>::operator-=(const Matrix<T> &a)
492 - if ( a.rows() != rows() || a.cols() != cols() )
493 + if ( a.rows() != this->rows() || a.cols() != this->cols() )
495 #ifdef USE_EXCEPTION
496 - throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
497 + throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
498 #else
499 Error error("Matrix<T>::operator-=") ;
500 - if ( rows() != a.rows() )
501 - error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
502 + if ( this->rows() != a.rows() )
503 + error << "Matrices are of diferent size, a.rows() = " << this->rows() << " and b.rows() = " << a.rows() << endl ;
504 if ( cols() != a.cols())
505 - error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
506 + error << "Matrices are of diferent size, a.cols() = " << this->cols() << " and b.cols() = " << a.cols() << endl ;
507 error.fatal() ;
508 #endif
510 @@ -485,8 +485,8 @@ Matrix<T>& Matrix<T>::operator-=(const M
511 int i, size;
512 T *aptr,*sptr ;
513 aptr = a.m - 1 ;
514 - sptr = m - 1 ;
515 - size = rows()*cols() ;
516 + sptr = this->m - 1 ;
517 + size = this->rows()*this->cols() ;
518 for (i = size; i > 0; --i){
519 *(++sptr) -= *(++aptr) ;
521 @@ -742,14 +742,14 @@ Matrix<T> comm(const Matrix<T> &a,const
522 template <class T>
523 T Matrix<T>::trace() const
525 - int size = rows();
526 + int size = this->rows();
527 T sum = (T)0;
529 - if ( size > cols() )
530 - size = cols();
531 + if ( size > this->cols() )
532 + size = this->cols();
534 for (int d = 0; d < size; ++d)
535 - sum += elem(d,d) ;
536 + sum += this->elem(d,d) ;
538 return sum;
540 @@ -770,12 +770,12 @@ T Matrix<T>::trace() const
541 template <class T>
542 Matrix<T> Matrix<T>::herm() const
544 - int i, j, r = cols(), c = rows();
545 + int i, j, r = this->cols(), c = this->rows();
546 Matrix<T> adj(r,c);
548 for (i = 0; i < r; ++i)
549 for (j = 0; j < c; ++j)
550 - adj.elem(i,j) = elem(j,i) ;
551 + adj.elem(i,j) = this->elem(j,i) ;
553 return adj;
555 @@ -794,11 +794,11 @@ Matrix<T> Matrix<T>::herm() const
556 template <class T>
557 Matrix<T> Matrix<T>::flop() const
559 - Matrix<T> f(rows(),cols()) ;
560 - for(int i=rows()-1;i>=0;--i)
561 - for(int j=cols()-1;j>=0;--j)
562 + Matrix<T> f(this->rows(),this->cols()) ;
563 + for(int i=this->rows()-1;i>=0;--i)
564 + for(int j=this->cols()-1;j>=0;--j)
566 - f(i,j) = elem(i,cols()-j-1);
567 + f(i,j) = elem(i,this->cols()-j-1);
569 return f;
571 @@ -817,13 +817,13 @@ Matrix<T> Matrix<T>::transpose() const
573 // same as hermitian for real Matrix<T>
574 int i, j;
575 - const int& r = cols();
576 - const int& c = rows();
577 + const int& r = this->cols();
578 + const int& c = this->rows();
579 Matrix<T> adj(r,c);
581 for (i = r-1; i >=0; --i)
582 for (j = c-1; j >=0; --j)
583 - adj.elem(i,j) = elem(j,i) ;
584 + adj.elem(i,j) = this->elem(j,i) ;
587 return adj;
588 @@ -844,7 +844,7 @@ template <class T>
589 int Matrix<T>::read(char* filename) {
590 ifstream fin(filename) ;
591 if(!fin) {
592 - resize(1,1) ;
593 + this->resize(1,1) ;
594 return 0 ;
596 int r,c ;
597 @@ -855,8 +855,8 @@ int Matrix<T>::read(char* filename) {
598 if(r) return 0 ;
599 if(!fin.read((char*)&r,sizeof(int))) return 0 ;
600 if(!fin.read((char*)&c,sizeof(int))) return 0 ;
601 - resize(r,c) ;
602 - if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
603 + this->resize(r,c) ;
604 + if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
606 delete []type ;
607 return 1 ;
608 @@ -877,11 +877,11 @@ template <class T>
609 int Matrix<T>::read(char* filename,int r, int c) {
610 ifstream fin(filename) ;
611 if(!fin) {
612 - resize(1,1) ;
613 + this->resize(1,1) ;
614 return 0 ;
616 - resize(r,c) ;
617 - if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
618 + this->resize(r,c) ;
619 + if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
621 return 1 ;
623 @@ -904,11 +904,11 @@ int Matrix<T>::write(char* filename) {
624 if(!fout)
625 return 0 ;
626 int r,c ;
627 - r = rows() ; c = cols() ;
628 + r = this->rows() ; c = this->cols() ;
629 if(!fout.write((char*)&"matrix",sizeof(char)*6)) return 0 ;
630 if(!fout.write((char*)&r,sizeof(int))) return 0 ;
631 if(!fout.write((char*)&c,sizeof(int))) return 0 ;
632 - if(!fout.write((char*)m,sizeof(T)*r*c)) return 0 ;
633 + if(!fout.write((char*)this->m,sizeof(T)*r*c)) return 0 ;
634 return 1;
637 @@ -927,7 +927,7 @@ int Matrix<T>::writeRaw(char* filename)
638 ofstream fout(filename) ;
639 if(!fout)
640 return 0 ;
641 - if(!fout.write((char*)m,sizeof(T)*rows()*cols())) return 0 ;
642 + if(!fout.write((char*)this->m,sizeof(T)*this->rows()*this->cols())) return 0 ;
643 return 1;
646 diff -rNup nurbs++-3.0.11/matrix/matrix_double.cpp nurbs++-3.0.11_mod/matrix/matrix_double.cpp
647 --- nurbs++-3.0.11/matrix/matrix_double.cpp 2002-05-14 00:07:45.000000000 +0300
648 +++ nurbs++-3.0.11_mod/matrix/matrix_double.cpp 2007-06-21 03:03:25.000000000 +0300
649 @@ -27,7 +27,7 @@
651 namespace PLib {
653 - void Matrix<double>::qSort(){
654 + template<>void Matrix<double>::qSort(){
655 qsort((char*)m,rows()*cols(),sizeof(double),compareDouble) ;
658 diff -rNup nurbs++-3.0.11/matrix/matrix_float.cpp nurbs++-3.0.11_mod/matrix/matrix_float.cpp
659 --- nurbs++-3.0.11/matrix/matrix_float.cpp 2002-05-14 00:07:45.000000000 +0300
660 +++ nurbs++-3.0.11_mod/matrix/matrix_float.cpp 2007-06-21 03:00:43.000000000 +0300
661 @@ -27,7 +27,7 @@
663 namespace PLib {
665 - void Matrix<float>::qSort(){
666 + template<>void Matrix<float>::qSort(){
667 qsort((char*)m,rows()*cols(),sizeof(float),compareFloat) ;
670 diff -rNup nurbs++-3.0.11/matrix/matrix_hpoint.cpp nurbs++-3.0.11_mod/matrix/matrix_hpoint.cpp
671 --- nurbs++-3.0.11/matrix/matrix_hpoint.cpp 2002-05-14 00:07:45.000000000 +0300
672 +++ nurbs++-3.0.11_mod/matrix/matrix_hpoint.cpp 2007-06-21 03:19:15.000000000 +0300
673 @@ -27,7 +27,7 @@
675 namespace PLib {
677 - double
678 + template<>double
679 Matrix<HPoint3Df>::norm(void) {
680 int i,j ;
681 double sumX, sumY, sumZ, sumW, maxsum;
682 @@ -58,7 +58,7 @@ namespace PLib {
686 - double
687 + template<>double
688 Matrix<HPoint3Dd>::norm(void) {
689 int i,j ;
690 double sumX, sumY, sumZ, sumW, maxsum;
691 @@ -89,7 +89,7 @@ namespace PLib {
695 - double
696 + template<>double
697 Matrix<HPoint2Df>::norm(void) {
698 int i,j ;
699 double sumX, sumY, sumZ, sumW, maxsum;
700 @@ -119,7 +119,7 @@ namespace PLib {
701 return sqrt(maxsum);
704 - double
705 + template<>double
706 Matrix<HPoint2Dd>::norm(void) {
707 int i,j ;
708 double sumX, sumY, sumZ, sumW, maxsum;
709 diff -rNup nurbs++-3.0.11/matrix/matrix_int.cpp nurbs++-3.0.11_mod/matrix/matrix_int.cpp
710 --- nurbs++-3.0.11/matrix/matrix_int.cpp 2002-05-14 00:07:45.000000000 +0300
711 +++ nurbs++-3.0.11_mod/matrix/matrix_int.cpp 2007-06-21 01:43:35.000000000 +0300
712 @@ -29,11 +29,11 @@
714 namespace PLib {
716 - void Matrix<int>::qSort(){
717 + template <>void Matrix<int>::qSort(){
718 qsort((char*)m,rows()*cols(),sizeof(int),compareInt) ;
721 - Matrix<int>&
722 + template <>Matrix<int>&
723 Matrix<int>::operator*=(double a)
725 int *p1 ;
726 @@ -46,7 +46,7 @@ namespace PLib {
727 return *this ;
730 - Matrix<int>&
731 + template <>Matrix<int>&
732 Matrix<int>::operator+=(double a)
734 int *p1 ;
735 @@ -57,7 +57,7 @@ namespace PLib {
736 return *this ;
739 - Matrix<int>&
740 + template <>Matrix<int>&
741 Matrix<int>::operator-=(double a)
743 int *p1 ;
744 @@ -68,7 +68,7 @@ namespace PLib {
745 return *this ;
748 - Matrix<int>&
749 + template <>Matrix<int>&
750 Matrix<int>::operator/=(double a)
752 int *p1 ;
753 diff -rNup nurbs++-3.0.11/matrix/matrix_point.cpp nurbs++-3.0.11_mod/matrix/matrix_point.cpp
754 --- nurbs++-3.0.11/matrix/matrix_point.cpp 2002-05-14 00:07:45.000000000 +0300
755 +++ nurbs++-3.0.11_mod/matrix/matrix_point.cpp 2007-06-21 03:15:29.000000000 +0300
756 @@ -27,7 +27,7 @@
758 namespace PLib {
760 - double
761 + template<>double
762 Matrix<Point3Df>::norm(void) {
763 int i,j ;
764 double sumX, sumY, sumZ, maxsum;
765 @@ -55,7 +55,7 @@ namespace PLib {
766 return sqrt(maxsum);
769 - double
770 + template<>double
771 Matrix<Point3Dd>::norm(void) {
772 int i,j ;
773 double sumX, sumY, sumZ, maxsum;
774 @@ -83,7 +83,7 @@ namespace PLib {
775 return sqrt(maxsum);
778 - double
779 + template<>double
780 Matrix<Point2Df>::norm(void) {
781 int i,j ;
782 double sumX, sumY, sumZ, maxsum;
783 @@ -111,7 +111,7 @@ namespace PLib {
784 return sqrt(maxsum);
787 - double
788 + template<>double
789 Matrix<Point2Dd>::norm(void) {
790 int i,j ;
791 double sumX, sumY, sumZ, maxsum;
792 diff -rNup nurbs++-3.0.11/matrix/matrix_uchar.cpp nurbs++-3.0.11_mod/matrix/matrix_uchar.cpp
793 --- nurbs++-3.0.11/matrix/matrix_uchar.cpp 2002-05-14 00:07:45.000000000 +0300
794 +++ nurbs++-3.0.11_mod/matrix/matrix_uchar.cpp 2007-06-21 03:06:59.000000000 +0300
795 @@ -27,7 +27,7 @@
797 namespace PLib {
799 - Matrix<unsigned char>&
800 + template<>Matrix<unsigned char>&
801 Matrix<unsigned char>::operator*=(double a)
803 unsigned char *p1 ;
804 @@ -40,7 +40,7 @@ namespace PLib {
805 return *this ;
808 - Matrix<unsigned char>&
809 + template<>Matrix<unsigned char>&
810 Matrix<unsigned char>::operator+=(double a)
812 unsigned char *p1 ;
813 @@ -52,7 +52,7 @@ namespace PLib {
817 - Matrix<unsigned char>&
818 + template<>Matrix<unsigned char>&
819 Matrix<unsigned char>::operator-=(double a)
821 unsigned char *p1 ;
822 @@ -64,7 +64,7 @@ namespace PLib {
826 - Matrix<unsigned char>&
827 + template<>Matrix<unsigned char>&
828 Matrix<unsigned char>::operator/=(double a)
830 unsigned char *p1 ;
831 diff -rNup nurbs++-3.0.11/matrix/point_nd.h nurbs++-3.0.11_mod/matrix/point_nd.h
832 --- nurbs++-3.0.11/matrix/point_nd.h 2002-05-14 00:07:45.000000000 +0300
833 +++ nurbs++-3.0.11_mod/matrix/point_nd.h 2007-06-22 11:48:07.000000000 +0300
834 @@ -143,6 +143,7 @@ namespace PLib {
835 Point_nD() { x() = y() = 0 ;}
836 Point_nD(T a) { x() = y() = a ;}
837 Point_nD(T X, T Y) {x()=X ; y()=Y ; }
838 +// Point_nD(T X, T Y, T Z) {x()=X ; y()=Y ; } // <------ Added to compile correctly
839 Point_nD(const Point_nD<T,2>& a) { memcpy((void*)data,(void*)a.data,2*sizeof(T));}
841 inline T& x() { return data[0] ; }
842 diff -rNup nurbs++-3.0.11/matrix/vector.cpp nurbs++-3.0.11_mod/matrix/vector.cpp
843 --- nurbs++-3.0.11/matrix/vector.cpp 2002-05-14 00:07:45.000000000 +0300
844 +++ nurbs++-3.0.11_mod/matrix/vector.cpp 2007-06-21 02:55:29.000000000 +0300
845 @@ -51,16 +51,16 @@ template <class T> Vector<T>& Vector<T>:
846 if(this==&b)
847 return *this ;
849 - if ( n() != b.n())
850 + if ( this->n() != b.n())
852 resize(b.n()) ;
855 - sze = b.n() ;
856 + this->sze = b.n() ;
857 T *pa, *pb ;
858 - pa = x-1 ;
859 + pa = this->x-1 ;
860 pb = b.x-1 ;
861 - for(int i=n();i>0;--i){
862 + for(int i=this->n();i>0;--i){
863 *(++pa) = *(++pb) ;
865 return *this;
866 @@ -79,13 +79,13 @@ template <class T> Vector<T>& Vector<T>:
867 template <class T>
868 Vector<T>& Vector<T>::operator=(const BasicArray<T> &b)
870 - if ( size() != b.size())
871 + if ( this->size() != b.size())
873 resize(b.size()) ;
875 T *ptr ;
876 - ptr = x - 1 ;
877 - for(int i=size()-1;i>=0;--i)
878 + ptr = this->x - 1 ;
879 + for(int i=this->size()-1;i>=0;--i)
880 *(++ptr) = b[i] ;
882 return *this;
883 @@ -105,9 +105,9 @@ Vector<T>& Vector<T>::operator=(const Ba
884 template <class T>
885 T Vector<T>::operator=(const T d)
887 - const int sz = size();
888 + const int sz = this->size();
889 T *ptr ;
890 - ptr = x-1 ;
891 + ptr = this->x-1 ;
892 for (int i = sz; i > 0; --i)
893 *(++ptr) = d ;
895 @@ -130,19 +130,19 @@ T Vector<T>::operator=(const T d)
896 template <class T>
897 Vector<T>& Vector<T>::operator+=(const Vector<T> &a)
899 - if ( a.size() != size())
900 + if ( a.size() != this->size())
902 #ifdef USE_EXCEPTION
903 - throw WrongSize(size(),a.size()) ;
904 + throw WrongSize(this->size(),a.size()) ;
905 #else
906 Error error("Vector<T>::operator+=(Vector<T>&)");
907 error << "Vector<T> a += Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
908 error.fatal() ;
909 #endif
911 - const int sz = size();
912 + const int sz = this->size();
913 T *ptr,*aptr ;
914 - ptr = x-1 ;
915 + ptr = this->x-1 ;
916 aptr = a.x-1 ;
917 for (int i = sz; i >0; --i)
918 *(++ptr) += *(++aptr) ;
919 @@ -165,10 +165,10 @@ Vector<T>& Vector<T>::operator+=(const V
920 template <class T>
921 Vector<T>& Vector<T>::operator-=(const Vector<T> &a)
923 - if ( a.size() != size())
924 + if ( a.size() != this->size())
926 #ifdef USE_EXCEPTION
927 - throw WrongSize(size(),a.size()) ;
928 + throw WrongSize(this->size(),a.size()) ;
929 #else
930 Error error("Vector<T>::operator-=(Vector<T>&)");
931 error << "Vector<T> a -= Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
932 @@ -176,9 +176,9 @@ Vector<T>& Vector<T>::operator-=(const V
933 #endif
936 - const int sz = size();
937 + const int sz = this->size();
938 T *ptr,*aptr ;
939 - ptr = x-1 ;
940 + ptr = this->x-1 ;
941 aptr = a.x-1 ;
942 for (int i = sz; i > 0; --i)
943 *(++ptr) -= *(++aptr) ;
944 @@ -391,7 +391,7 @@ void Vector<T>::as(int i, const Vector<T
947 T *aptr,*bptr ;
948 - aptr = &x[i]-1 ;
949 + aptr = &this->x[i]-1 ;
950 bptr = b.x-1 ;
951 for ( int j = b.rows(); j > 0; --j)
952 *(++aptr) = *(++bptr) ;
953 @@ -429,7 +429,7 @@ Vector<T> Vector<T>::get(int i, int l)
955 Vector<T> subvec(l) ;
956 T *aptr, *bptr ;
957 - aptr = &x[i] - 1 ;
958 + aptr = &this->x[i] - 1 ;
959 bptr = subvec.x -1 ;
960 for ( int j = l; j > 0; --j)
961 *(++bptr) = *(++aptr) ;
962 @@ -449,12 +449,12 @@ Vector<T> Vector<T>::get(int i, int l)
964 template <class T>
965 int Vector<T>::minIndex() const {
966 - T min = x[0] ;
967 + T min = this->x[0] ;
968 int index = 0 ;
970 - for(int i=1;i<n();i++){
971 - if(x[i]<=min){
972 - min = x[i] ;
973 + for(int i=1;i<this->n();i++){
974 + if(this->x[i]<=min){
975 + min = this->x[i] ;
976 index = i ;
979 @@ -523,12 +523,12 @@ void Vector<T>::qSort(int M){
980 T a ;
981 T *v1,*v2 ;
983 - ir = sze-1 ;
984 + ir = this->sze-1 ;
985 l = 0 ;
987 while(1){
988 if(ir-l<M){ // perform an insertion sort when the array is small enough
989 - v1 = &x[l] ;
990 + v1 = &this->x[l] ;
991 for(j=l+1;j<=ir;++j){
992 a = *(++v1) ;
993 v2 = v1 ;
994 @@ -547,31 +547,31 @@ void Vector<T>::qSort(int M){
996 else{
997 k=(l+ir) >> 1 ;
998 - swap(x[k],x[l+1]) ;
999 - if(x[l+1] > x[ir]){
1000 - swap(x[l+1],x[ir]) ;
1001 + swap(this->x[k],this->x[l+1]) ;
1002 + if(this->x[l+1] > this->x[ir]){
1003 + swap(this->x[l+1],this->x[ir]) ;
1005 - if(x[l]> x[ir]){
1006 - swap(x[l],x[ir]) ;
1007 + if(this->x[l]> this->x[ir]){
1008 + swap(this->x[l],this->x[ir]) ;
1010 - if(x[l+1] > x[l]){
1011 - swap(x[l+1],x[l]) ;
1012 + if(this->x[l+1] > this->x[l]){
1013 + swap(this->x[l+1],this->x[l]) ;
1015 i=l+1 ;
1016 j=ir ;
1017 - a=x[l] ;
1018 - v1 = &x[i] ;
1019 - v2 = &x[j] ;
1020 + a=this->x[l] ;
1021 + v1 = &this->x[i] ;
1022 + v2 = &this->x[j] ;
1023 while(1){
1024 while(*v1 < a) { ++i ; ++v1 ; }
1025 while(*v2 > a) { --j ; --v2 ; }
1026 if(j<i) break ;
1027 if(*v1 == *v2) // both are equal to a...
1028 break ;
1029 - swap(x[i],x[j]) ;
1030 + swap(this->x[i],this->x[j]) ;
1032 - x[l] = x[j] ;
1033 - x[j] = a ;
1034 + this->x[l] = this->x[j] ;
1035 + this->x[j] = a ;
1036 jstack += 2 ;
1037 if(jstack>=Nstack){
1038 istack.resize(istack.n()+Nstack) ; // increase the vector size
1039 @@ -618,10 +618,10 @@ void Vector<T>::sortIndex(Vector<int>& i
1040 int jstack=0;
1041 T a ;
1043 - ir = sze-1 ;
1044 + ir = this->sze-1 ;
1045 l = 0 ;
1047 - index.resize(sze) ;
1048 + index.resize(this->sze) ;
1049 for(i=0;i<index.n();++i)
1050 index[i] = i ;
1052 @@ -629,9 +629,9 @@ void Vector<T>::sortIndex(Vector<int>& i
1053 if(ir-l<M){ // perform an insertion sort when the array is small enough
1054 for(j=l+1;j<=ir;++j){
1055 indext = index[j] ;
1056 - a = x[indext] ;
1057 + a = this->x[indext] ;
1058 for(i=j-1;i>=0;--i){
1059 - if(x[index[i]] <= a) break ;
1060 + if(this->x[index[i]] <= a) break ;
1061 index[i+1] = index[i] ;
1063 index[i+1] = indext ;
1064 @@ -643,24 +643,24 @@ void Vector<T>::sortIndex(Vector<int>& i
1065 else{
1066 k=(l+ir) >> 1 ;
1067 swap(index[k],index[l+1]) ;
1068 - if(x[index[l+1]] > x[index[ir]]){
1069 + if(this->x[index[l+1]] > this->x[index[ir]]){
1070 swap(index[l+1],index[ir]) ;
1072 - if(x[index[l]]> x[index[ir]]){
1073 + if(this->x[index[l]]> this->x[index[ir]]){
1074 swap(index[l],index[ir]) ;
1076 - if(x[index[l+1]] > x[index[l]]){
1077 + if(this->x[index[l+1]] > this->x[index[l]]){
1078 swap(index[l+1],index[l]) ;
1080 i=l+1 ;
1081 j=ir ;
1082 indext = index[l] ;
1083 - a=x[indext] ;
1084 + a=this->x[indext] ;
1085 while(1){
1086 - while(x[index[i]] < a) { ++i ; }
1087 - while(x[index[j]] > a) { --j ; }
1088 + while(this->x[index[i]] < a) { ++i ; }
1089 + while(this->x[index[j]] > a) { --j ; }
1090 if(j<i) break ;
1091 - if(x[index[i]] == x[index[j]])
1092 + if(this->x[index[i]] == this->x[index[j]])
1093 break ;
1094 swap(index[i],index[j]) ;
1096 diff -rNup nurbs++-3.0.11/matrix/vector_double.cpp nurbs++-3.0.11_mod/matrix/vector_double.cpp
1097 --- nurbs++-3.0.11/matrix/vector_double.cpp 2002-05-14 00:07:45.000000000 +0300
1098 +++ nurbs++-3.0.11_mod/matrix/vector_double.cpp 2007-06-21 03:04:05.000000000 +0300
1099 @@ -27,7 +27,7 @@
1101 namespace PLib {
1103 - void Vector<double>::qSortStd(){
1104 + template<>void Vector<double>::qSortStd(){
1105 qsort((char*)memory(),n(),sizeof(float),compareDouble) ;
1108 diff -rNup nurbs++-3.0.11/matrix/vector_float.cpp nurbs++-3.0.11_mod/matrix/vector_float.cpp
1109 --- nurbs++-3.0.11/matrix/vector_float.cpp 2002-05-14 00:07:45.000000000 +0300
1110 +++ nurbs++-3.0.11_mod/matrix/vector_float.cpp 2007-06-21 03:01:22.000000000 +0300
1111 @@ -27,7 +27,7 @@
1113 namespace PLib {
1115 - void Vector<float>::qSortStd(){
1116 + template<>void Vector<float>::qSortStd(){
1117 qsort((char*)memory(),n(),sizeof(float),compareFloat) ;
1120 diff -rNup nurbs++-3.0.11/matrix/vector.h nurbs++-3.0.11_mod/matrix/vector.h
1121 --- nurbs++-3.0.11/matrix/vector.h 2002-05-14 00:07:45.000000000 +0300
1122 +++ nurbs++-3.0.11_mod/matrix/vector.h 2007-06-20 23:33:04.000000000 +0300
1123 @@ -69,7 +69,7 @@ namespace PLib {
1125 public:
1126 int rows() const //!< a reference to the size of the vector
1127 - { return sze ;}
1128 + { return this->sze ;}
1129 Vector() : BasicArray<T>(1) {} //!< Basic constructor
1130 Vector(const int r) : BasicArray<T>(r) {}
1131 Vector(const Vector<T>& v) : BasicArray<T>(v) {}
1132 diff -rNup nurbs++-3.0.11/matrix/vector_int.cpp nurbs++-3.0.11_mod/matrix/vector_int.cpp
1133 --- nurbs++-3.0.11/matrix/vector_int.cpp 2002-05-14 00:07:45.000000000 +0300
1134 +++ nurbs++-3.0.11_mod/matrix/vector_int.cpp 2007-06-21 02:59:52.000000000 +0300
1135 @@ -27,7 +27,7 @@
1137 namespace PLib {
1139 - void Vector<int>::qSortStd(){
1140 + template<>void Vector<int>::qSortStd(){
1141 qsort((char*)memory(),n(),sizeof(int),compareInt) ;
1144 diff -rNup nurbs++-3.0.11/numerical/matrixMat.cpp nurbs++-3.0.11_mod/numerical/matrixMat.cpp
1145 --- nurbs++-3.0.11/numerical/matrixMat.cpp 2002-05-14 00:07:45.000000000 +0300
1146 +++ nurbs++-3.0.11_mod/numerical/matrixMat.cpp 2007-06-21 03:28:42.000000000 +0300
1147 @@ -48,9 +48,9 @@ namespace PLib {
1148 template <class T>
1149 LUMatrix<T>& LUMatrix<T>::operator=(const LUMatrix<T>& a){
1150 resize(a.rows(),a.cols()) ;
1151 - for(int i=0;i<rows();++i)
1152 - for(int j=0;j<cols();++j)
1153 - elem(i,j) = a(i,j) ;
1154 + for(int i=0;i<this->rows();++i)
1155 + for(int j=0;j<this->cols();++j)
1156 + this->elem(i,j) = a(i,j) ;
1157 pivot_ = a.pivot_ ;
1158 return *this ;
1160 @@ -90,7 +90,7 @@ LUMatrix<T>& LUMatrix<T>::decompose(cons
1161 // lu = a; must do it by copying or LUFACT will be recursively called !
1162 for(i=0;i<n;++i)
1163 for(j=0;j<n;++j)
1164 - elem(i,j) = a(i,j) ;
1165 + this->elem(i,j) = a(i,j) ;
1167 errval = 0;
1168 nm1 = n - 1;
1169 @@ -129,24 +129,24 @@ LUMatrix<T>& LUMatrix<T>::decompose(cons
1171 pivot_[k] = l;
1173 - if ( elem(l,k) != 0.0 )
1174 + if ( this->elem(l,k) != 0.0 )
1175 { // nonsingular pivot found
1176 if (l != k ){ // interchange needed
1177 for (i = k; i < n; i++)
1179 - t = elem(l,i) ;
1180 - elem(l,i) = elem(k,i) ;
1181 - elem(k,i) = t ;
1182 + t = this->elem(l,i) ;
1183 + this->elem(l,i) = this->elem(k,i) ;
1184 + this->elem(k,i) = t ;
1186 sign = -sign ;
1188 - q = elem(k,k); /* scale row */
1189 + q = this->elem(k,k); /* scale row */
1190 for (i = kp1; i < n; i++)
1192 - t = - elem(i,k)/q;
1193 - elem(i,k) = t;
1194 + t = - this->elem(i,k)/q;
1195 + this->elem(i,k) = t;
1196 for (j = kp1; j < n; j++)
1197 - elem(i,j) += t * elem(k,j);
1198 + this->elem(i,j) += t * this->elem(k,j);
1201 else /* pivot singular */
1202 @@ -156,7 +156,7 @@ LUMatrix<T>& LUMatrix<T>::decompose(cons
1205 pivot_[nm1] = nm1;
1206 - if (elem(nm1,nm1) == 0.0)
1207 + if (this->elem(nm1,nm1) == 0.0)
1208 errval = nm1;
1209 return *this;
1211 @@ -196,9 +196,9 @@ Matrix<T> LUMatrix::operator Matrix()
1213 template <class T>
1214 T LUMatrix<T>::determinant(){
1215 - T det = elem(0,0) ;
1216 - for(int i=1;i<rows();++i)
1217 - det *= elem(i,i) ;
1218 + T det = this->elem(0,0) ;
1219 + for(int i=1;i<this->rows();++i)
1220 + det *= this->elem(i,i) ;
1221 return det * (T)sign ;
1224 @@ -253,10 +253,10 @@ void LUMatrix<T>::inverseIn(Matrix<T>& i
1225 T ten;
1226 int i, j, k, l, kb, kp1, nm1, n, coln;
1228 - if ( rows() != cols() )
1229 + if ( this->rows() != this->cols() )
1231 #ifdef USE_EXCEPTION
1232 - throw WrongSize2D(rows(),cols(),0,0) ;
1233 + throw WrongSize2D(this->rows(),this->cols(),0,0) ;
1234 #else
1235 Error error("invm");
1236 error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
1237 @@ -264,7 +264,7 @@ void LUMatrix<T>::inverseIn(Matrix<T>& i
1238 #endif
1241 - n = coln = rows();
1242 + n = coln = this->rows();
1245 inv = *this ;
1246 @@ -338,10 +338,10 @@ void LUMatrix<T>::inverseIn(Matrix<T>& i
1247 template <class T>
1248 Matrix<T> LUMatrix<T>::inverse()
1250 - if ( rows() != cols() )
1251 + if ( this->rows() != this->cols() )
1253 #ifdef USE_EXCEPTION
1254 - throw WrongSize2D(rows(),cols(),0,0) ;
1255 + throw WrongSize2D(this->rows(),this->cols(),0,0) ;
1256 #else
1257 Error error("invm");
1258 error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
1259 diff -rNup nurbs++-3.0.11/nurbs/d_nurbs.cpp nurbs++-3.0.11_mod/nurbs/d_nurbs.cpp
1260 --- nurbs++-3.0.11/nurbs/d_nurbs.cpp 2002-05-13 23:11:57.000000000 +0300
1261 +++ nurbs++-3.0.11_mod/nurbs/d_nurbs.cpp 2007-06-21 17:05:59.000000000 +0300
1262 @@ -10,7 +10,7 @@ Point_nD<double,2> NurbsCurve<double,2>:
1263 return firstDn(u) ;
1266 -void NurbsCurve<double,2>::makeCircle(const Point_nD<double,2>& O, double r, double as, double ae){
1267 +template<>void NurbsCurve<double,2>::makeCircle(const Point_nD<double,2>& O, double r, double as, double ae){
1268 makeCircle(O,Point_nD<double,2>(1,0),Point_nD<double,2>(0,1),r,as,ae) ;
1271 diff -rNup nurbs++-3.0.11/nurbs/d_nurbsSub.cpp nurbs++-3.0.11_mod/nurbs/d_nurbsSub.cpp
1272 --- nurbs++-3.0.11/nurbs/d_nurbsSub.cpp 2002-05-13 23:11:57.000000000 +0300
1273 +++ nurbs++-3.0.11_mod/nurbs/d_nurbsSub.cpp 2007-06-21 17:14:55.000000000 +0300
1274 @@ -14,8 +14,8 @@ namespace PLib {
1275 template class RenderMeshPoints<double> ;
1278 - double NurbSurface<double>::epsilon = 1e-6 ;
1279 - double SurfSample<double>::epsilon = 1e-6 ;
1280 + template<>double NurbSurface<double>::epsilon = 1e-6 ;
1281 + template<>double SurfSample<double>::epsilon = 1e-6 ;
1283 template void DrawSubdivision( NurbSurface<double> *, double tolerance );
1284 template void DrawEvaluation( NurbSurface<double> * );
1285 diff -rNup nurbs++-3.0.11/nurbs/d_surface.cpp nurbs++-3.0.11_mod/nurbs/d_surface.cpp
1286 --- nurbs++-3.0.11/nurbs/d_surface.cpp 2002-05-16 19:44:49.000000000 +0300
1287 +++ nurbs++-3.0.11_mod/nurbs/d_surface.cpp 2007-06-22 00:18:18.000000000 +0300
1288 @@ -1,5 +1,8 @@
1289 #include "surface.cpp"
1291 +template class BasicList<PLib::InterPoint<double,2> >;
1292 +template class BasicList<PLib::InterPoint<double,3> >;
1294 namespace PLib {
1296 template <>
1297 @@ -25,8 +28,8 @@ namespace PLib {
1298 template class InterPoint<double,2> ;
1299 template class InterPoint<double,3> ;
1301 - template class BasicList<InterPoint<double,2> > ;
1302 - template class BasicList<InterPoint<double,3> > ;
1303 +// template class BasicList<InterPoint<double,2> > ;
1304 +// template class BasicList<InterPoint<double,3> > ;
1306 template class ParaSurface<double,2> ;
1307 template class ParaSurface<double,3> ;
1308 @@ -34,6 +37,6 @@ namespace PLib {
1309 template void intersectSurfaces(const ParaSurface<double,2>&, const ParaSurface<double,2>&, BasicList<InterPoint<double,2> >&, int, double, double, double, double) ;
1310 template void intersectSurfaces(const ParaSurface<double,3>&, const ParaSurface<double,3>&, BasicList<InterPoint<double,3> >&, int, double, double, double, double) ;
1312 -#endif
1313 +#endif
1316 diff -rNup nurbs++-3.0.11/nurbs/f_nurbsSub.cpp nurbs++-3.0.11_mod/nurbs/f_nurbsSub.cpp
1317 --- nurbs++-3.0.11/nurbs/f_nurbsSub.cpp 2002-05-13 23:11:57.000000000 +0300
1318 +++ nurbs++-3.0.11_mod/nurbs/f_nurbsSub.cpp 2007-06-21 16:25:07.000000000 +0300
1319 @@ -14,8 +14,8 @@ namespace PLib {
1320 template class RenderMeshPoints<float> ;
1323 - float NurbSurface<float>::epsilon = 1e-6 ;
1324 - float SurfSample<float>::epsilon = 1e-6 ;
1325 + template<>float NurbSurface<float>::epsilon = 1e-6 ;
1326 + template<>float SurfSample<float>::epsilon = 1e-6 ;
1328 template void DrawSubdivision( NurbSurface<float> *, float tolerance );
1329 template void DrawEvaluation( NurbSurface<float> * );
1330 diff -rNup nurbs++-3.0.11/nurbs/f_surface.cpp nurbs++-3.0.11_mod/nurbs/f_surface.cpp
1331 --- nurbs++-3.0.11/nurbs/f_surface.cpp 2002-05-16 19:44:49.000000000 +0300
1332 +++ nurbs++-3.0.11_mod/nurbs/f_surface.cpp 2007-06-22 00:16:07.000000000 +0300
1333 @@ -1,5 +1,8 @@
1334 #include "surface.cpp"
1336 +template class BasicList<PLib::InterPoint<float,2> > ;
1337 +template class BasicList<PLib::InterPoint<float,3> > ;
1339 namespace PLib {
1341 template <>
1342 @@ -25,8 +28,8 @@ namespace PLib {
1343 template class InterPoint<float,2> ;
1344 template class InterPoint<float,3> ;
1346 - template class BasicList<InterPoint<float,2> > ;
1347 - template class BasicList<InterPoint<float,3> > ;
1348 +// template class BasicList<InterPoint<float,2> > ;
1349 +// template class BasicList<InterPoint<float,3> > ;
1351 template class ParaSurface<float,2> ;
1352 template class ParaSurface<float,3> ;
1353 @@ -38,3 +41,4 @@ namespace PLib {
1354 #endif
1358 diff -rNup nurbs++-3.0.11/nurbs/hnurbsS.cpp nurbs++-3.0.11_mod/nurbs/hnurbsS.cpp
1359 --- nurbs++-3.0.11/nurbs/hnurbsS.cpp 2002-05-17 21:24:21.000000000 +0300
1360 +++ nurbs++-3.0.11_mod/nurbs/hnurbsS.cpp 2007-06-21 14:32:13.000000000 +0300
1361 @@ -103,11 +103,11 @@ HNurbsSurface<T,N>::HNurbsSurface(HNurbs
1362 initBase() ;
1363 offset.resize(baseSurf.ctrlPnts()) ;
1365 - P = baseSurf.ctrlPnts() ;
1366 - U = baseSurf.knotU() ;
1367 - V = baseSurf.knotV() ;
1368 - degU = baseSurf.degreeU() ;
1369 - degV = baseSurf.degreeV() ;
1370 + this->P = baseSurf.ctrlPnts() ;
1371 + this->U = baseSurf.knotU() ;
1372 + this->V = baseSurf.knotV() ;
1373 + this->degU = baseSurf.degreeU() ;
1374 + this->degV = baseSurf.degreeV() ;
1376 //updateSurface() ;
1378 @@ -162,11 +162,11 @@ HNurbsSurface<T,N>::HNurbsSurface(HNurbs
1379 baseUpdateN = baseLevel_->modifiedN()-1 ; // Set it so that initBase will run
1380 initBase() ;
1381 offset.resize(baseSurf.ctrlPnts()) ;
1382 - P = baseSurf.ctrlPnts() ;
1383 - U = baseSurf.knotU() ;
1384 - V = baseSurf.knotV() ;
1385 - degU = baseSurf.degreeU() ;
1386 - degV = baseSurf.degreeV() ;
1387 + this->P = baseSurf.ctrlPnts() ;
1388 + this->U = baseSurf.knotU() ;
1389 + this->V = baseSurf.knotV() ;
1390 + this->degU = baseSurf.degreeU() ;
1391 + this->degV = baseSurf.degreeV() ;
1392 //updateSurface() ;
1395 @@ -200,7 +200,7 @@ HNurbsSurface<T,N>::HNurbsSurface(const
1396 rU.resize(0) ;
1397 rV.resize(0) ;
1399 - offset = P ;
1400 + offset = this->P ;
1404 @@ -334,11 +334,11 @@ void HNurbsSurface<T,N>::updateSurface(i
1406 if(baseLevel_){
1407 if(initBase()){
1408 - P = baseSurf.ctrlPnts() ;
1409 - U = baseSurf.knotU() ;
1410 - V = baseSurf.knotV() ;
1411 - degU = baseSurf.degreeU() ;
1412 - degV = baseSurf.degreeV() ;
1413 + this->P = baseSurf.ctrlPnts() ;
1414 + this->U = baseSurf.knotU() ;
1415 + this->V = baseSurf.knotV() ;
1416 + this->degU = baseSurf.degreeU() ;
1417 + this->degV = baseSurf.degreeV() ;
1419 if(i0>=0 && j0>=0){
1420 Point_nD<T,N> vecOffset ;
1421 @@ -352,13 +352,13 @@ void HNurbsSurface<T,N>::updateSurface(i
1422 offset(i0,j0).y()*jvec(i0,j0) +
1423 offset(i0,j0).z()*kvec(i0,j0) ;
1425 - P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
1426 - P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
1427 - P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
1428 + this->P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
1429 + this->P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
1430 + this->P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
1432 else{
1433 - for(int i=0;i<P.rows();++i)
1434 - for(int j=0;j<P.cols();++j){
1435 + for(int i=0;i<this->P.rows();++i)
1436 + for(int j=0;j<this->P.cols();++j){
1437 if(offset(i,j).x() != 0 ||
1438 offset(i,j).y() != 0 || offset(i,j).z() || 0){
1439 Point_nD<T,N> vecOffset ;
1440 @@ -372,20 +372,20 @@ void HNurbsSurface<T,N>::updateSurface(i
1441 offset(i,j).y()*jvec(i,j) +
1442 offset(i,j).z()*kvec(i,j) ;
1444 - P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
1445 - P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
1446 - P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
1447 + this->P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
1448 + this->P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
1449 + this->P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
1454 else{
1455 if(i0>=0 && j0>=0)
1456 - P(i0,j0) = offset(i0,j0) ;
1457 + this->P(i0,j0) = offset(i0,j0) ;
1458 else{
1459 - for(int i=0;i<P.rows();++i)
1460 - for(int j=0;j<P.cols();++j){
1461 - P(i,j) = offset(i,j) ;
1462 + for(int i=0;i<this->P.rows();++i)
1463 + for(int j=0;j<this->P.cols();++j){
1464 + this->P(i,j) = offset(i,j) ;
1468 @@ -554,17 +554,17 @@ int HNurbsSurface<T,N>::modifies(T u, T
1469 return mod ;
1472 - if(u<knotU()[0] || u>knotU()[knotU().n()-1])
1473 + if(u<this->knotU()[0] || u>this->knotU()[this->knotU().n()-1])
1474 return -1 ;
1475 - if(v<knotV()[0] || v>knotU()[knotV().n()-1])
1476 + if(v<this->knotV()[0] || v>this->knotU()[this->knotV().n()-1])
1477 return -1 ;
1479 int su = findSpanU(u) ;
1480 int sv = findSpanV(v) ;
1482 - for(int i=0;i<=degU;++i)
1483 - for(int j=0;j<=degV;++j){
1484 - if(offset(su-degU+i,sv+degV+j) != HPoint_nD<T,N>(0,0,0,0))
1485 + for(int i=0;i<=this->degU;++i)
1486 + for(int j=0;j<=this->degV;++j){
1487 + if(offset(su-this->degU+i,sv+this->degV+j) != HPoint_nD<T,N>(0,0,0,0))
1488 return level_ ;
1491 @@ -742,16 +742,16 @@ void HNurbsSurface<T,N>::updateLevels(in
1492 template <class T, int N>
1493 void HNurbsSurface<T,N>::splitUV(int nu, int nv, Vector<T> &nU, Vector<T> &nV){
1495 - nU.resize(knotU().n()*nu) ;
1496 - nV.resize(knotV().n()*nv) ;
1497 + nU.resize(this->knotU().n()*nu) ;
1498 + nV.resize(this->knotV().n()*nv) ;
1500 int i,j,n ;
1502 n = 0 ;
1503 - for(i=1;i<knotU().n();++i){
1504 - if(knotU()[i] >knotU()[i-1]){
1505 - T a = knotU()[i-1] ;
1506 - T b = knotU()[i] ;
1507 + for(i=1;i<this->knotU().n();++i){
1508 + if(this->knotU()[i] >this->knotU()[i-1]){
1509 + T a = this->knotU()[i-1] ;
1510 + T b = this->knotU()[i] ;
1513 for(j=0;j<nu;++j){
1514 @@ -763,10 +763,10 @@ void HNurbsSurface<T,N>::splitUV(int nu,
1515 nU.resize(n) ;
1517 n = 0 ;
1518 - for(i=1;i<knotV().n();++i){
1519 - if(knotV()[i] > knotV()[i-1]){
1520 - T a = knotV()[i-1] ;
1521 - T b = knotV()[i] ;
1522 + for(i=1;i<this->knotV().n();++i){
1523 + if(this->knotV()[i] > this->knotV()[i-1]){
1524 + T a = this->knotV()[i-1] ;
1525 + T b = this->knotV()[i] ;
1527 for(j=0;j<nv;++j){
1528 nV[n] = a + (b-a)*T(j+1)/T(nv+1) ;
1529 @@ -805,22 +805,22 @@ void HNurbsSurface<T,N>::splitUV(int nu,
1530 int i,j,n ;
1532 if(su<=0)
1533 - su = degU ;
1534 + su = this->degU ;
1535 if(sv<=0)
1536 - sv = degV ;
1537 - if(su>degU+1)
1538 - su = degU+1 ;
1539 - if(sv>degV+1)
1540 - sv = degV+1 ;
1541 + sv = this->degV ;
1542 + if(su>this->degU+1)
1543 + su = this->degU+1 ;
1544 + if(sv>this->degV+1)
1545 + sv = this->degV+1 ;
1547 - nU.resize(knotU().n()*nu*su) ;
1548 - nV.resize(knotV().n()*nv*sv) ;
1549 + nU.resize(this->knotU().n()*nu*su) ;
1550 + nV.resize(this->knotV().n()*nv*sv) ;
1552 n = 0 ;
1553 - for(i=1;i<knotU().n();++i){
1554 - if(knotU()[i] >knotU()[i-1]){
1555 - T a = knotU()[i-1] ;
1556 - T b = knotU()[i] ;
1557 + for(i=1;i<this->knotU().n();++i){
1558 + if(this->knotU()[i] >this->knotU()[i-1]){
1559 + T a = this->knotU()[i-1] ;
1560 + T b = this->knotU()[i] ;
1563 for(j=0;j<nu;++j){
1564 @@ -835,10 +835,10 @@ void HNurbsSurface<T,N>::splitUV(int nu,
1565 nU.resize(n) ;
1567 n = 0 ;
1568 - for(i=1;i<knotV().n();++i){
1569 - if(knotV()[i] > knotV()[i-1]){
1570 - T a = knotV()[i-1] ;
1571 - T b = knotV()[i] ;
1572 + for(i=1;i<this->knotV().n();++i){
1573 + if(this->knotV()[i] > this->knotV()[i-1]){
1574 + T a = this->knotV()[i-1] ;
1575 + T b = this->knotV()[i] ;
1577 for(j=0;j<nv;++j){
1578 T v = a + (b-a)*T(j+1)/T(nv+1) ;
1579 @@ -1014,10 +1014,10 @@ int HNurbsSurface<T,N>::read(ifstream &f
1580 if(!fin.read((char*)&du,sizeof(int))) { delete []type ; return 0 ;}
1581 if(!fin.read((char*)&dv,sizeof(int))) { delete []type ; return 0 ;}
1583 - resize(nu,nv,du,dv) ;
1584 + this->resize(nu,nv,du,dv) ;
1586 - if(!fin.read((char*)U.memory(),sizeof(T)*U.n())) { delete []type ; return 0 ;}
1587 - if(!fin.read((char*)V.memory(),sizeof(T)*V.n())) { delete []type ; return 0 ;}
1588 + if(!fin.read((char*)this->U.memory(),sizeof(T)*this->U.n())) { delete []type ; return 0 ;}
1589 + if(!fin.read((char*)this->V.memory(),sizeof(T)*this->V.n())) { delete []type ; return 0 ;}
1591 if(!r1){
1592 p = new T[3*nu*nv] ;
1593 @@ -1025,10 +1025,10 @@ int HNurbsSurface<T,N>::read(ifstream &f
1594 p2 = p ;
1595 for(int i=0;i<nu;i++)
1596 for(int j=0;j<nv;j++){
1597 - P(i,j).x() = *(p++) ;
1598 - P(i,j).y() = *(p++) ;
1599 - P(i,j).z() = *(p++) ;
1600 - P(i,j).w() = 1.0 ;
1601 + this->P(i,j).x() = *(p++) ;
1602 + this->P(i,j).y() = *(p++) ;
1603 + this->P(i,j).z() = *(p++) ;
1604 + this->P(i,j).w() = 1.0 ;
1606 delete []p2 ;
1608 @@ -1038,14 +1038,14 @@ int HNurbsSurface<T,N>::read(ifstream &f
1609 p2 = p ;
1610 for(int i=0;i<nu;i++)
1611 for(int j=0;j<nv;j++){
1612 - P(i,j).x() = *(p++) ;
1613 - P(i,j).y() = *(p++) ;
1614 - P(i,j).z() = *(p++) ;
1615 - P(i,j).w() = *(p++) ;
1616 + this->P(i,j).x() = *(p++) ;
1617 + this->P(i,j).y() = *(p++) ;
1618 + this->P(i,j).z() = *(p++) ;
1619 + this->P(i,j).w() = *(p++) ;
1621 delete []p2 ;
1623 - offset = P ;
1624 + offset = this->P ;
1625 this->updateSurface() ;
1627 else { // reading the offset information
1628 @@ -1144,29 +1144,29 @@ int HNurbsSurface<T,N>::write(ofstream &
1629 if(!fout)
1630 return 0 ;
1631 if(!baseLevel_){
1632 - int prows = P.rows();
1633 - int pcols = P.cols();
1634 + int prows = this->P.rows();
1635 + int pcols = this->P.cols();
1636 char st = '0' + sizeof(T) ;
1637 if(!fout.write((char*)&"hns4",sizeof(char)*4)) return 0 ;
1638 if(!fout.write((char*)&st,sizeof(char))) return 0 ;
1639 if(!fout.write((char*)&prows,sizeof(int))) return 0 ;
1640 if(!fout.write((char*)&pcols,sizeof(int))) return 0 ;
1641 - if(!fout.write((char*)&degU,sizeof(int))) return 0 ;
1642 - if(!fout.write((char*)&degV,sizeof(int))) return 0 ;
1643 - if(!fout.write((char*)U.memory(),sizeof(T)*U.n())) return 0 ;
1644 - if(!fout.write((char*)V.memory(),sizeof(T)*V.n())) return 0 ;
1645 + if(!fout.write((char*)&this->degU,sizeof(int))) return 0 ;
1646 + if(!fout.write((char*)&this->degV,sizeof(int))) return 0 ;
1647 + if(!fout.write((char*)this->U.memory(),sizeof(T)*this->U.n())) return 0 ;
1648 + if(!fout.write((char*)this->V.memory(),sizeof(T)*this->V.n())) return 0 ;
1650 T *p,*p2 ;
1651 - p = new T[P.rows()*P.cols()*4] ;
1652 + p = new T[this->P.rows()*this->P.cols()*4] ;
1653 p2 = p ;
1654 - for(int i=0;i<P.rows();i++)
1655 - for(int j=0;j<P.cols();j++){
1656 + for(int i=0;i<this->P.rows();i++)
1657 + for(int j=0;j<this->P.cols();j++){
1658 *p = offset(i,j).x() ; p++ ;
1659 *p = offset(i,j).y() ; p++ ;
1660 *p = offset(i,j).z() ; p++ ;
1661 *p = offset(i,j).w() ; p++ ;
1663 - if(!fout.write((char*)p2,sizeof(T)*P.rows()*P.cols()*4)) return 0 ;
1664 + if(!fout.write((char*)p2,sizeof(T)*this->P.rows()*this->P.cols()*4)) return 0 ;
1665 delete []p2 ;
1667 else{
1668 @@ -1282,7 +1282,7 @@ void HNurbsSurface<T,N>::refineKnotU(con
1669 int i,j ;
1670 j = 0 ;
1671 for(i=0;i<X.n();++i){
1672 - if(X[i]>=U[0] && X[i]<=U[U.n()-1]){
1673 + if(X[i]>=this->U[0] && X[i]<=this->U[this->U.n()-1]){
1674 Xu[j] = X[i] ;
1675 ++j ;
1677 @@ -1294,7 +1294,7 @@ void HNurbsSurface<T,N>::refineKnotU(con
1678 nextLevel_->refineKnotU(Xu) ;
1681 - NurbsSurface<T,N> osurf(degU,degV,U,V,offset) ;
1682 + NurbsSurface<T,N> osurf(this->degU,this->degV,this->U,this->V,offset) ;
1684 osurf.refineKnotU(Xu) ;
1686 @@ -1324,7 +1324,7 @@ void HNurbsSurface<T,N>::refineKnotV(con
1687 int i,j ;
1688 j = 0 ;
1689 for(i=0;i<X.n();++i){
1690 - if(X[i]>=V[0] && X[i]<=V[V.n()-1]){
1691 + if(X[i]>=this->V[0] && X[i]<=this->V[this->V.n()-1]){
1692 Xv[j] = X[i] ;
1693 ++j ;
1695 @@ -1336,7 +1336,7 @@ void HNurbsSurface<T,N>::refineKnotV(con
1696 nextLevel_->refineKnotV(Xv) ;
1699 - NurbsSurface<T,N> osurf(degU,degV,U,V,offset) ;
1700 + NurbsSurface<T,N> osurf(this->degU,this->degV,this->U,this->V,offset) ;
1702 osurf.refineKnotV(Xv) ;
1704 @@ -1370,26 +1370,26 @@ void HNurbsSurface<T,N>::refineKnotV(con
1706 template <class T, int N>
1707 int HNurbsSurface<T,N>::movePointOffset(T u, T v, const Point_nD<T,N>& delta){
1708 - P = offset ;
1709 + this->P = offset ;
1711 // by definition the offset has w = 0 , but this isn't valid for
1712 // the control points, increasing the w by 1, will generate a valid surface
1713 if(baseLevel_)
1714 - for(int i=0;i<P.rows();++i)
1715 - for(int j=0;j<P.cols();++j){
1716 - P(i,j).w() += T(1) ;
1717 + for(int i=0;i<this->P.rows();++i)
1718 + for(int j=0;j<this->P.cols();++j){
1719 + this->P(i,j).w() += T(1) ;
1722 if(NurbsSurface<T,N>::movePoint(u,v,delta)){
1723 - offset = P ;
1724 + offset = this->P ;
1725 // need to reset the offset weights
1726 if(baseLevel_)
1727 - for(int i=0;i<P.rows();++i)
1728 - for(int j=0;j<P.cols();++j){
1729 - P(i,j).w() -= T(1) ;
1730 + for(int i=0;i<this->P.rows();++i)
1731 + for(int j=0;j<this->P.cols();++j){
1732 + this->P(i,j).w() -= T(1) ;
1735 - P = baseSurf.ctrlPnts() ;
1736 + this->P = baseSurf.ctrlPnts() ;
1737 updateSurface() ;
1738 return 1 ;
1740 diff -rNup nurbs++-3.0.11/nurbs/hnurbsS_sp.cpp nurbs++-3.0.11_mod/nurbs/hnurbsS_sp.cpp
1741 --- nurbs++-3.0.11/nurbs/hnurbsS_sp.cpp 2002-05-14 00:07:46.000000000 +0300
1742 +++ nurbs++-3.0.11_mod/nurbs/hnurbsS_sp.cpp 2007-06-21 16:17:57.000000000 +0300
1743 @@ -43,7 +43,7 @@ namespace PLib {
1745 template <class T, int N>
1746 void HNurbsSurfaceSP<T,N>::updateMaxU() {
1747 - if(degU>3){
1748 + if(this->degU>3){
1749 #ifdef USE_EXCEPTION
1750 throw NurbsError();
1751 #else
1752 @@ -53,12 +53,12 @@ void HNurbsSurfaceSP<T,N>::updateMaxU()
1753 #endif
1755 else{
1756 - maxU.resize(P.rows()) ;
1757 - maxAtU_.resize(P.rows()) ;
1758 - for(int i=0;i<P.rows();++i){
1759 - if(!maxInfluence(i,U,degU,maxAtU_[i]))
1760 + maxU.resize(this->P.rows()) ;
1761 + maxAtU_.resize(this->P.rows()) ;
1762 + for(int i=0;i<this->P.rows();++i){
1763 + if(!maxInfluence(i,this->U,this->degU,maxAtU_[i]))
1764 cerr << "Problem in maxInfluence U!\n" ;
1765 - maxU[i] = nurbsBasisFun(maxAtU_[i],i,degU,U) ;
1766 + maxU[i] = nurbsBasisFun(maxAtU_[i],i,this->degU,this->U) ;
1770 @@ -78,7 +78,7 @@ void HNurbsSurfaceSP<T,N>::updateMaxU()
1772 template <class T, int N>
1773 void HNurbsSurfaceSP<T,N>::updateMaxV() {
1774 - if(degV>3){
1775 + if(this->degV>3){
1776 #ifdef USE_EXCEPTION
1777 throw NurbsError();
1778 #else
1779 @@ -88,12 +88,12 @@ void HNurbsSurfaceSP<T,N>::updateMaxV()
1780 #endif
1782 else{
1783 - maxV.resize(P.cols()) ;
1784 - maxAtV_.resize(P.cols()) ;
1785 - for(int i=0;i<P.cols();++i){
1786 - if(!maxInfluence(i,V,degV,maxAtV_[i]))
1787 + maxV.resize(this->P.cols()) ;
1788 + maxAtV_.resize(this->P.cols()) ;
1789 + for(int i=0;i<this->P.cols();++i){
1790 + if(!maxInfluence(i,this->V,this->degV,maxAtV_[i]))
1791 cerr << "Problem in maxInfluence V!\n" ;
1792 - maxV[i] = nurbsBasisFun(maxAtV_[i],i,degV,V) ;
1793 + maxV[i] = nurbsBasisFun(maxAtV_[i],i,this->degV,this->V) ;
1797 @@ -113,18 +113,18 @@ void HNurbsSurfaceSP<T,N>::updateMaxV()
1799 template <class T, int N>
1800 void HNurbsSurfaceSP<T,N>::modSurfCPby(int i, int j, const HPoint_nD<T,N>& a) {
1801 - offset(i,j) += a / (maxU[i]*maxV[j]) ;
1802 - if(baseLevel_){
1803 + this->offset(i,j) += a / (maxU[i]*maxV[j]) ;
1804 + if(this->baseLevel_){
1805 Point_nD<T,N> vecOffset ;
1806 - vecOffset = offset(i,j).x()*ivec(i,j) +
1807 - offset(i,j).y()*jvec(i,j) +
1808 - offset(i,j).z()*kvec(i,j) ;
1809 - P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
1810 - P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
1811 - P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
1812 + vecOffset = this->offset(i,j).x()*this->ivec(i,j) +
1813 + this->offset(i,j).y()*this->jvec(i,j) +
1814 + this->offset(i,j).z()*this->kvec(i,j) ;
1815 + this->P(i,j).x() = this->baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
1816 + this->P(i,j).y() = this->baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
1817 + this->P(i,j).z() = this->baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
1819 else
1820 - P(i,j) = offset(i,j) ;
1821 + this->P(i,j) = this->offset(i,j) ;
1825 @@ -151,24 +151,24 @@ template <class T, int N>
1826 void HNurbsSurfaceSP<T,N>::modOnlySurfCPby(int i, int j, const HPoint_nD<T,N>& a){
1827 int k ;
1829 - P = offset ;
1830 + this->P = this->offset ;
1832 // by definition the offset has w = 0 , but this isn't valid for
1833 // the control points, increasing the w by 1, will generate a valid surface
1834 - if(baseLevel_)
1835 - for(k=0;k<P.rows();++k)
1836 - for(int l=0;l<P.cols();++l)
1837 - P(k,l).w() += T(1) ;
1838 + if(this->baseLevel_)
1839 + for(k=0;k<this->P.rows();++k)
1840 + for(int l=0;l<this->P.cols();++l)
1841 + this->P(k,l).w() += T(1) ;
1843 int sizeU, sizeV ;
1845 - sizeU = 2*degU+3 ;
1846 - if(i-degU-1<0) sizeU += i-degU-1 ;
1847 - if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
1849 - sizeV = 2*degV+3 ;
1850 - if(j-degV-1<0) sizeV += j-degV-1 ;
1851 - if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
1852 + sizeU = 2*this->degU+3 ;
1853 + if(i-this->degU-1<0) sizeU += i-this->degU-1 ;
1854 + if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
1856 + sizeV = 2*this->degV+3 ;
1857 + if(j-this->degV-1<0) sizeV += j-this->degV-1 ;
1858 + if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
1860 Vector<T> u(sizeU) ;
1861 Vector<T> v(sizeV) ;
1862 @@ -179,16 +179,16 @@ void HNurbsSurfaceSP<T,N>::modOnlySurfCP
1863 int n=0;
1864 int nu = 0 ;
1865 int nv = 0 ;
1866 - for(k=i-degU-1;k<=i+degU+1;++k){
1867 + for(k=i-this->degU-1;k<=i+this->degU+1;++k){
1868 if(k<0)
1869 continue ;
1870 - if(k>=P.rows())
1871 + if(k>=this->P.rows())
1872 break ;
1873 nv = 0 ;
1874 - for(int l=j-degV-1;l<=j+degV+1;++l){
1875 + for(int l=j-this->degV-1;l<=j+this->degV+1;++l){
1876 if(l<0)
1877 continue ;
1878 - if(l>=P.cols())
1879 + if(l>=this->P.cols())
1880 break ;
1881 if( k == i && j==l){
1882 pts[n].x() = a.x() ;
1883 @@ -216,12 +216,12 @@ void HNurbsSurfaceSP<T,N>::modOnlySurfCP
1884 pv.resize(n) ;
1886 if(NurbsSurface<T,N>::movePoint(u,v,pts,pu,pv)){
1887 - offset = P ;
1888 + this->offset = this->P ;
1889 // an offset shouldn't have a weight value.
1890 - if(baseLevel_)
1891 - for(k=0;k<P.rows();++k)
1892 - for(int l=0;l<P.cols();++l)
1893 - offset(k,l).w() -= T(1) ;
1894 + if(this->baseLevel_)
1895 + for(k=0;k<this->P.rows();++k)
1896 + for(int l=0;l<this->P.cols();++l)
1897 + this->offset(k,l).w() -= T(1) ;
1899 updateSurface();
1901 @@ -262,7 +262,7 @@ template <class T, int N>
1902 HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel(int n, int s) {
1903 HNurbsSurfaceSP<T,N> *newLevel ;
1905 - if(nextLevel_)
1906 + if(this->nextLevel_)
1907 return 0 ;
1909 Vector<T> newU,newV ;
1910 @@ -289,7 +289,7 @@ template <class T, int N>
1911 HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel() {
1912 HNurbsSurfaceSP<T,N> *newLevel ;
1914 - if(nextLevel_)
1915 + if(this->nextLevel_)
1916 return 0 ;
1918 newLevel = new HNurbsSurfaceSP<T,N>(this) ;
1919 @@ -311,23 +311,23 @@ void HNurbsSurfaceSP<T,N>::copy(const HN
1920 levelP = nS.nextLevel() ;
1922 NurbsSurface<T,N>::operator=(nS) ;
1923 - rU = nS.rU ;
1924 - rV = nS.rV ;
1925 - offset = nS.offset ;
1926 + this->rU = nS.rU ;
1927 + this->rV = nS.rV ;
1928 + this->offset = nS.offset ;
1930 updateMaxUV() ;
1932 - firstLevel_ = this ;
1933 + this->firstLevel_ = this ;
1935 if(levelP){
1936 HNurbsSurfaceSP<T,N> *newLevel ;
1937 newLevel = new HNurbsSurfaceSP<T,N>(this) ;
1938 newLevel->copy(*levelP) ;
1939 - nextLevel_ = newLevel ;
1940 - lastLevel_ = nextLevel_->lastLevel() ;
1941 + this->nextLevel_ = newLevel ;
1942 + this->lastLevel_ = this->nextLevel_->lastLevel() ;
1944 else{
1945 - lastLevel_ = this ;
1946 + this->lastLevel_ = this ;
1950 @@ -349,55 +349,55 @@ void HNurbsSurfaceSP<T,N>::copy(const HN
1951 template <class T, int N>
1952 void HNurbsSurfaceSP<T,N>::updateSurface(int i0, int j0){
1953 if(i0>=0 && j0>=0){
1954 - if(offset(i0,j0).x()==0.0 && offset(i0,j0).y()==0.0 && offset(i0,j0).z()==0.0)
1955 + if(this->offset(i0,j0).x()==0.0 && this->offset(i0,j0).y()==0.0 && this->offset(i0,j0).z()==0.0)
1956 return ;
1958 - if(baseLevel_){
1959 - if(initBase()){
1960 - P = baseSurf.ctrlPnts() ;
1961 - U = baseSurf.knotU() ;
1962 - V = baseSurf.knotV() ;
1963 - degU = baseSurf.degreeU() ;
1964 - degV = baseSurf.degreeV() ;
1965 + if(this->baseLevel_){
1966 + if(this->initBase()){
1967 + this->P = this->baseSurf.ctrlPnts() ;
1968 + this->U = this->baseSurf.knotU() ;
1969 + this->V = this->baseSurf.knotV() ;
1970 + this->degU = this->baseSurf.degreeU() ;
1971 + this->degV = this->baseSurf.degreeV() ;
1972 updateMaxUV() ;
1974 if(i0>=0 && j0>=0){
1975 Point_nD<T,N> vecOffset ;
1976 - vecOffset = offset(i0,j0).x()*ivec(i0,j0) +
1977 - offset(i0,j0).y()*jvec(i0,j0) +
1978 - offset(i0,j0).z()*kvec(i0,j0) ;
1979 - P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
1980 - P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
1981 - P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
1982 + vecOffset = this->offset(i0,j0).x()*this->ivec(i0,j0) +
1983 + this->offset(i0,j0).y()*this->jvec(i0,j0) +
1984 + this->offset(i0,j0).z()*this->kvec(i0,j0) ;
1985 + this->P(i0,j0).x() = this->baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
1986 + this->P(i0,j0).y() = this->baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
1987 + this->P(i0,j0).z() = this->baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
1989 else{
1990 - for(int i=0;i<P.rows();++i)
1991 - for(int j=0;j<P.cols();++j){
1992 - if(offset(i,j).x() != 0 ||
1993 - offset(i,j).y() != 0 || offset(i,j).z() || 0){
1994 + for(int i=0;i<this->P.rows();++i)
1995 + for(int j=0;j<this->P.cols();++j){
1996 + if(this->offset(i,j).x() != 0 ||
1997 + this->offset(i,j).y() != 0 || this->offset(i,j).z() || 0){
1998 Point_nD<T,N> vecOffset ;
1999 - vecOffset = offset(i,j).x()*ivec(i,j) +
2000 - offset(i,j).y()*jvec(i,j) +
2001 - offset(i,j).z()*kvec(i,j) ;
2002 - P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
2003 - P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
2004 - P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
2005 + vecOffset = this->offset(i,j).x()*this->ivec(i,j) +
2006 + this->offset(i,j).y()*this->jvec(i,j) +
2007 + this->offset(i,j).z()*this->kvec(i,j) ;
2008 + this->P(i,j).x() = this->baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
2009 + this->P(i,j).y() = this->baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
2010 + this->P(i,j).z() = this->baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
2015 else{
2016 if(i0>=0 && j0>=0)
2017 - P(i0,j0) = offset(i0,j0) ;
2018 + this->P(i0,j0) = this->offset(i0,j0) ;
2019 else{
2020 - for(int i=0;i<P.rows();++i)
2021 - for(int j=0;j<P.cols();++j){
2022 - P(i,j) = offset(i,j) ;
2023 + for(int i=0;i<this->P.rows();++i)
2024 + for(int j=0;j<this->P.cols();++j){
2025 + this->P(i,j) = this->offset(i,j) ;
2030 - ++updateN ;
2031 + ++this->updateN ;
2035 @@ -413,7 +413,7 @@ void HNurbsSurfaceSP<T,N>::updateLevels(
2036 if(!okMax())
2037 updateMaxUV() ;
2038 if(upLevel>=0){
2039 - if(level()<=upLevel){
2040 + if(this->level()<=upLevel){
2041 this->updateSurface() ;
2044 @@ -421,9 +421,9 @@ void HNurbsSurfaceSP<T,N>::updateLevels(
2045 this->updateSurface() ;
2048 - if(upLevel>level() || upLevel<0){
2049 - if(nextLevel_)
2050 - ((HNurbsSurfaceSP<T,N>*)nextLevel_)->updateLevels(upLevel) ;
2051 + if(upLevel>this->level() || upLevel<0){
2052 + if(this->nextLevel_)
2053 + ((HNurbsSurfaceSP<T,N>*)this->nextLevel_)->updateLevels(upLevel) ;
2057 @@ -458,10 +458,10 @@ int HNurbsSurfaceSP<T,N>::read(ifstream
2058 if(!fin.read((char*)&du,sizeof(int))) { delete []type ; return 0 ;}
2059 if(!fin.read((char*)&dv,sizeof(int))) { delete []type ; return 0 ;}
2061 - resize(nu,nv,du,dv) ;
2062 + this->resize(nu,nv,du,dv) ;
2064 - if(!fin.read((char*)U.memory(),sizeof(T)*U.n())) { delete []type ; return 0 ;}
2065 - if(!fin.read((char*)V.memory(),sizeof(T)*V.n())) { delete []type ; return 0 ;}
2066 + if(!fin.read((char*)this->U.memory(),sizeof(T)*this->U.n())) { delete []type ; return 0 ;}
2067 + if(!fin.read((char*)this->V.memory(),sizeof(T)*this->V.n())) { delete []type ; return 0 ;}
2069 if(!r1){
2070 p = new T[3*nu*nv] ;
2071 @@ -469,10 +469,10 @@ int HNurbsSurfaceSP<T,N>::read(ifstream
2072 p2 = p ;
2073 for(int i=0;i<nu;i++)
2074 for(int j=0;j<nv;j++){
2075 - P(i,j).x() = *(p++) ;
2076 - P(i,j).y() = *(p++) ;
2077 - P(i,j).z() = *(p++) ;
2078 - P(i,j).w() = 1.0 ;
2079 + this->P(i,j).x() = *(p++) ;
2080 + this->P(i,j).y() = *(p++) ;
2081 + this->P(i,j).z() = *(p++) ;
2082 + this->P(i,j).w() = 1.0 ;
2084 delete []p2 ;
2086 @@ -482,26 +482,26 @@ int HNurbsSurfaceSP<T,N>::read(ifstream
2087 p2 = p ;
2088 for(int i=0;i<nu;i++)
2089 for(int j=0;j<nv;j++){
2090 - P(i,j).x() = *(p++) ;
2091 - P(i,j).y() = *(p++) ;
2092 - P(i,j).z() = *(p++) ;
2093 - P(i,j).w() = *(p++) ;
2094 + this->P(i,j).x() = *(p++) ;
2095 + this->P(i,j).y() = *(p++) ;
2096 + this->P(i,j).z() = *(p++) ;
2097 + this->P(i,j).w() = *(p++) ;
2099 delete []p2 ;
2101 - offset = P ;
2102 + this->offset = this->P ;
2103 this->updateSurface() ;
2105 else { // reading the offset information
2106 int ru,rv ;
2107 if(!fin.read((char*)&ru,sizeof(int))) { delete []type ; return 0 ;}
2108 if(!fin.read((char*)&rv,sizeof(int))) { delete []type ; return 0 ;}
2109 - rU.resize(ru) ;
2110 - rV.resize(rv) ;
2111 - if(rU.n()>0)
2112 - if(!fin.read((char*)rU.memory(),sizeof(T)*rU.n())) { delete []type ; return 0 ;}
2113 - if(rV.n()>0)
2114 - if(!fin.read((char*)rV.memory(),sizeof(T)*rV.n())) { delete []type ; return 0 ;}
2115 + this->rU.resize(ru) ;
2116 + this->rV.resize(rv) ;
2117 + if(this->rU.n()>0)
2118 + if(!fin.read((char*)this->rU.memory(),sizeof(T)*this->rU.n())) { delete []type ; return 0 ;}
2119 + if(this->rV.n()>0)
2120 + if(!fin.read((char*)this->rV.memory(),sizeof(T)*this->rV.n())) { delete []type ; return 0 ;}
2122 if(!fin.read((char*)&nu,sizeof(int))) { delete []type ; return 0 ;}
2123 if(!fin.read((char*)&nv,sizeof(int))) { delete []type ; return 0 ;}
2124 @@ -509,16 +509,16 @@ int HNurbsSurfaceSP<T,N>::read(ifstream
2125 p = new T[4*nu*nv] ;
2126 if(!fin.read((char*)p,sizeof(T)*4*nu*nv)) { delete []type ; return 0 ;}
2127 p2 = p ;
2128 - offset.resize(nu,nv) ;
2129 + this->offset.resize(nu,nv) ;
2130 for(int i=0;i<nu;i++)
2131 for(int j=0;j<nv;j++){
2132 - offset(i,j).x() = *(p++) ;
2133 - offset(i,j).y() = *(p++) ;
2134 - offset(i,j).z() = *(p++) ;
2135 - offset(i,j).w() = *(p++) ;
2136 + this->offset(i,j).x() = *(p++) ;
2137 + this->offset(i,j).y() = *(p++) ;
2138 + this->offset(i,j).z() = *(p++) ;
2139 + this->offset(i,j).w() = *(p++) ;
2141 delete []p2 ;
2142 - --baseUpdateN ;
2143 + --this->baseUpdateN ;
2144 this->updateSurface() ;
2147 diff -rNup nurbs++-3.0.11/nurbs/matrixRT.cpp nurbs++-3.0.11_mod/nurbs/matrixRT.cpp
2148 --- nurbs++-3.0.11/nurbs/matrixRT.cpp 2002-05-14 00:07:46.000000000 +0300
2149 +++ nurbs++-3.0.11_mod/nurbs/matrixRT.cpp 2007-06-22 00:59:00.000000000 +0300
2150 @@ -51,13 +51,13 @@ MatrixRT<T>::MatrixRT(T ax, T ay, T az,
2151 // *this = C.translate(x,y,z)*B.rotate(ax,ay,az) ;
2152 rotate(ax,ay,az) ;
2153 #ifdef COLUMN_ORDER
2154 - m[12] = x ;
2155 - m[13] = y ;
2156 - m[14] = z ;
2157 + this->m[12] = x ;
2158 + this->m[13] = y ;
2159 + this->m[14] = z ;
2160 #else
2161 - m[3] = x ;
2162 - m[7] = y ;
2163 - m[11] = z ;
2164 + this->m[3] = x ;
2165 + this->m[7] = y ;
2166 + this->m[11] = z ;
2167 #endif
2170 @@ -71,8 +71,8 @@ MatrixRT<T>::MatrixRT(T ax, T ay, T az,
2172 template <class T>
2173 MatrixRT<T>::MatrixRT() : Matrix<T>(4,4) {
2174 - reset(0) ;
2175 - diag(1.0) ;
2176 + this->reset(0) ;
2177 + this->diag(1.0) ;
2181 @@ -144,33 +144,33 @@ MatrixRT<T>& MatrixRT<T>::rotate(T ax,T
2182 t10 = cos(ax);
2183 t13 = t4*t6;
2184 #ifdef COLUMN_ORDER
2185 - m[0] = t1*t2;
2186 - m[4] = -t4*t2;
2187 - m[8] = t6;
2188 - m[12] = 0 ;
2189 - m[1] = t7*t8+t4*t10;
2190 - m[5] = -t13*t8+t1*t10;
2191 - m[9] = -t2*t8;
2192 - m[13] = 0 ;
2193 - m[2] = -t7*t10+t4*t8;
2194 - m[6] = t13*t10+t1*t8;
2195 - m[10] = t2*t10;
2196 - m[14] = m[3] = m[7] = m[11] = 0.0 ;
2197 - m[15] = 1.0 ;
2198 + this->m[0] = t1*t2;
2199 + this->m[4] = -t4*t2;
2200 + this->m[8] = t6;
2201 + this->m[12] = 0 ;
2202 + this->m[1] = t7*t8+t4*t10;
2203 + this->m[5] = -t13*t8+t1*t10;
2204 + this->m[9] = -t2*t8;
2205 + this->m[13] = 0 ;
2206 + this->m[2] = -t7*t10+t4*t8;
2207 + this->m[6] = t13*t10+t1*t8;
2208 + this->m[10] = t2*t10;
2209 + this->m[14] = this->m[3] = this->m[7] = this->m[11] = 0.0 ;
2210 + this->m[15] = 1.0 ;
2211 #else
2212 - m[0] = t1*t2;
2213 - m[1] = -t4*t2;
2214 - m[2] = t6;
2215 - m[3] = 0 ;
2216 - m[4] = t7*t8+t4*t10;
2217 - m[5] = -t13*t8+t1*t10;
2218 - m[6] = -t2*t8;
2219 - m[7] = 0 ;
2220 - m[8] = -t7*t10+t4*t8;
2221 - m[9] = t13*t10+t1*t8;
2222 - m[10] = t2*t10;
2223 - m[11] = m[12] = m[13] = m[14] = 0 ;
2224 - m[15] = 1.0 ;
2225 + this->m[0] = t1*t2;
2226 + this->m[1] = -t4*t2;
2227 + this->m[2] = t6;
2228 + this->m[3] = 0 ;
2229 + this->m[4] = t7*t8+t4*t10;
2230 + this->m[5] = -t13*t8+t1*t10;
2231 + this->m[6] = -t2*t8;
2232 + this->m[7] = 0 ;
2233 + this->m[8] = -t7*t10+t4*t8;
2234 + this->m[9] = t13*t10+t1*t8;
2235 + this->m[10] = t2*t10;
2236 + this->m[11] = this->m[12] = this->m[13] = this->m[14] = 0 ;
2237 + this->m[15] = 1.0 ;
2238 #endif
2239 return *this ;
2241 @@ -203,33 +203,33 @@ MatrixRT<T>& MatrixRT<T>::rotateXYZ(T ax
2242 t9 = (T)sin((double)ax);
2243 t17 = t4*t7;
2244 #ifdef COLUMN_ORDER
2245 - m[0] = t1*t2;
2246 - m[4] = -t4*t5+t8*t9;
2247 - m[8] = t4*t9+t8*t5;
2248 - m[12] = 0.0 ;
2249 - m[1] = t4*t2;
2250 - m[5] = t1*t5+t17*t9;
2251 - m[9] = -t1*t9+t17*t5;
2252 - m[13] = 0.0 ;
2253 - m[2] = -t7;
2254 - m[6] = t2*t9;
2255 - m[10] = t2*t5;
2256 - m[14] = m[3] = m[7] = m[11] = 0 ;
2257 - m[15] = 1.0 ;
2258 + this->m[0] = t1*t2;
2259 + this->m[4] = -t4*t5+t8*t9;
2260 + this->m[8] = t4*t9+t8*t5;
2261 + this->m[12] = 0.0 ;
2262 + this->m[1] = t4*t2;
2263 + this->m[5] = t1*t5+t17*t9;
2264 + this->m[9] = -t1*t9+t17*t5;
2265 + this->m[13] = 0.0 ;
2266 + this->m[2] = -t7;
2267 + this->m[6] = t2*t9;
2268 + this->m[10] = t2*t5;
2269 + this->m[14] = this->m[3] = this->m[7] = this->m[11] = 0 ;
2270 + this->m[15] = 1.0 ;
2271 #else
2272 - m[0] = t1*t2;
2273 - m[1] = -t4*t5+t8*t9;
2274 - m[2] = t4*t9+t8*t5;
2275 - m[3] = 0.0 ;
2276 - m[4] = t4*t2;
2277 - m[5] = t1*t5+t17*t9;
2278 - m[6] = -t1*t9+t17*t5;
2279 - m[7] = 0.0 ;
2280 - m[8] = -t7;
2281 - m[9] = t2*t9;
2282 - m[10] = t2*t5;
2283 - m[11] = m[12] = m[13] = m[14] = 0 ;
2284 - m[15] = 1.0 ;
2285 + this->m[0] = t1*t2;
2286 + this->m[1] = -t4*t5+t8*t9;
2287 + this->m[2] = t4*t9+t8*t5;
2288 + this->m[3] = 0.0 ;
2289 + this->m[4] = t4*t2;
2290 + this->m[5] = t1*t5+t17*t9;
2291 + this->m[6] = -t1*t9+t17*t5;
2292 + this->m[7] = 0.0 ;
2293 + this->m[8] = -t7;
2294 + this->m[9] = t2*t9;
2295 + this->m[10] = t2*t5;
2296 + this->m[11] = this->m[12] = this->m[13] = this->m[14] = 0 ;
2297 + this->m[15] = 1.0 ;
2298 #endif
2299 return *this ;
2301 @@ -245,16 +245,16 @@ MatrixRT<T>& MatrixRT<T>::rotateXYZ(T ax
2303 template <class T>
2304 MatrixRT<T>& MatrixRT<T>::translate(T x, T y, T z){
2305 - reset(0) ;
2306 - diag(1.0) ;
2307 + this->reset(0) ;
2308 + this->diag(1.0) ;
2309 #ifdef COLUMN_ORDER
2310 - m[12] = x ;
2311 - m[13] = y ;
2312 - m[14] = z ;
2313 + this->m[12] = x ;
2314 + this->m[13] = y ;
2315 + this->m[14] = z ;
2316 #else
2317 - m[3] = x ;
2318 - m[7] = y ;
2319 - m[11] = z ;
2320 + this->m[3] = x ;
2321 + this->m[7] = y ;
2322 + this->m[11] = z ;
2323 #endif
2324 return *this ;
2326 @@ -271,11 +271,11 @@ MatrixRT<T>& MatrixRT<T>::translate(T x,
2328 template <class T>
2329 MatrixRT<T>& MatrixRT<T>::scale(T x, T y, T z){
2330 - reset(0) ;
2331 - m[0] = x ;
2332 - m[5] = y ;
2333 - m[10] = z ;
2334 - m[15] = 1.0 ;
2335 + this->reset(0) ;
2336 + this->m[0] = x ;
2337 + this->m[5] = y ;
2338 + this->m[10] = z ;
2339 + this->m[15] = 1.0 ;
2340 return *this ;
2343 @@ -416,7 +416,7 @@ MatrixRT<T>& MatrixRT<T>::operator=(cons
2344 error.fatal() ;
2346 T *a,*b ;
2347 - a = m-1 ;
2348 + a = this->m-1 ;
2349 b = M[0] - 1 ;
2350 for(int i=0;i<16;++i){
2351 *(++a) = *(++b) ;
2352 @@ -435,7 +435,7 @@ MatrixRT<T>& MatrixRT<T>::operator=(cons
2353 template <class T>
2354 MatrixRT<T>& MatrixRT<T>::operator=(const MatrixRT<T>& M) {
2355 T *a,*b ;
2356 - a = m-1 ;
2357 + a = this->m-1 ;
2358 b = M.m - 1 ;
2359 for(int i=0;i<16;++i){
2360 *(++a) = *(++b) ;
2361 diff -rNup nurbs++-3.0.11/nurbs/nurbs.cpp nurbs++-3.0.11_mod/nurbs/nurbs.cpp
2362 --- nurbs++-3.0.11/nurbs/nurbs.cpp 2002-05-24 20:25:49.000000000 +0300
2363 +++ nurbs++-3.0.11_mod/nurbs/nurbs.cpp 2007-06-21 16:34:33.000000000 +0300
2364 @@ -391,9 +391,9 @@ NurbsSurface<T,3> NurbsCurve<T,N>::drawA
2365 T du,dv ;
2366 // compute a coarse distance for the curve
2367 Point_nD<T,N> a,b,c ;
2368 - a = pointAt(0.0) ;
2369 - b = pointAt(0.5) ;
2370 - c = pointAt(1.0) ;
2371 + a = this->pointAt(0.0) ;
2372 + b = this->pointAt(0.5) ;
2373 + c = this->pointAt(1.0) ;
2375 T distance = norm(b-a) + norm(c-b) ;
2377 @@ -3438,8 +3438,9 @@ void NurbsCurve<T,N>::makeCircle(const P
2378 \date 25 July, 1997
2380 template <class T, int N>
2381 -void NurbsCurve<T,N>::makeCircle(const Point_nD<T,N>& O, T r, double as, double ae){
2382 - makeCircle(O,Point_nD<T,N>(1,0,0),Point_nD<T,N>(0,1,0),r,as,ae) ;
2383 +void NurbsCurve<T,N>::makeCircle(const Point_nD<T,N>& O, T r, double as, double ae)
2385 + makeCircle(O,Point_nD<T,N>(1,0,0),Point_nD<T,N>(0,1,0),r,as,ae) ;
2389 diff -rNup nurbs++-3.0.11/nurbs/nurbsGL.cpp nurbs++-3.0.11_mod/nurbs/nurbsGL.cpp
2390 --- nurbs++-3.0.11/nurbs/nurbsGL.cpp 2002-05-14 00:07:46.000000000 +0300
2391 +++ nurbs++-3.0.11_mod/nurbs/nurbsGL.cpp 2007-06-22 02:55:52.000000000 +0300
2392 @@ -3908,23 +3908,28 @@ void NurbsSubSurfaceGL::drawSubdivisionG
2393 drawSubdivision(tolerance) ;
2396 +} // end namespace
2400 #ifdef NO_IMPLICIT_TEMPLATES
2402 -template class std::list<NurbsCurve_2Df*> ;
2403 -template class std::list<NurbsCurve_2Df*>::iterator ;
2404 +template class std::list<PLib::NurbsCurve_2Df*> ;
2405 +//template class std::list<NurbsCurve_2Df*>::iterator ; <----- redifination
2407 -template class RenderMeshGL<float> ;
2408 +template class PLib::RenderMeshGL<float> ;
2410 template class std::allocator<PLib::NurbsCurve<float, 2> *>;
2412 -template void std::_List_base<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::clear(void);
2413 +template void std::_List_base<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_clear(void);
2415 +//template void std::list<PLib::NurbsCurve_2Df*>::clear(void); <-------- redifination
2417 -template void std::list<NurbsCurve_2Df*>::clear(void);
2418 +/*template void std::list<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_insert_dispatch<std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *> >(std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *&, PLib::NurbsCurve<float, 2> **>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float,
2419 +2> *const &, PLib::NurbsCurve<float, 2> *const *>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *>, __false_type);*/
2421 -template void std::list<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_insert_dispatch<std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *> >(std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *&, PLib::NurbsCurve<float, 2> **>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float,
2422 -2> *const &, PLib::NurbsCurve<float, 2> *const *>, std::_List_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *>, __false_type);
2424 +template void std::list<PLib::NurbsCurve<float, 2> *, std::allocator<PLib::NurbsCurve<float, 2> *> >::_M_insert_dispatch<std::_List_iterator<PLib::NurbsCurve<float, 2> *> >(std::_List_iterator<PLib::NurbsCurve<float, 2> *>, std::_List_iterator<PLib::NurbsCurve<float, 2> *>, std::_List_iterator<PLib::NurbsCurve<float, 2> *>, __false_type);
2427 template void list<PLib::NurbsCurve<float, 2> *, __default_alloc_template<0, 0> >::insert<__list_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *> >(__list_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *&, PLib::NurbsCurve<float, 2> **>, __list_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *>, __list_iterator<PLib::NurbsCurve<float, 2> *, PLib::NurbsCurve<float, 2> *const &, PLib::NurbsCurve<float, 2> *const *>) ;
2428 @@ -3953,7 +3958,7 @@ template void list<PLib::NurbsCurve<floa
2430 #endif
2432 -} // end namespace
2433 +//} // end namespace
2435 #endif
2437 diff -rNup nurbs++-3.0.11/nurbs/nurbsS.cpp nurbs++-3.0.11_mod/nurbs/nurbsS.cpp
2438 --- nurbs++-3.0.11/nurbs/nurbsS.cpp 2002-05-14 00:07:46.000000000 +0300
2439 +++ nurbs++-3.0.11_mod/nurbs/nurbsS.cpp 2007-06-21 12:04:42.000000000 +0300
2440 @@ -3762,12 +3762,12 @@ int NurbsSurface<T,N>::writePOVRAY(const
2441 // we use and angle of 36 to view the object
2442 // and position the rest according to this.
2443 Point_nD<T,N> minP, maxP ;
2444 - minP.x() = extremum(1,coordX) ;
2445 - minP.y() = extremum(1,coordY) ;
2446 - minP.z() = extremum(1,coordZ) ;
2447 - maxP.x() = extremum(0,coordX) ;
2448 - maxP.y() = extremum(0,coordY) ;
2449 - maxP.z() = extremum(0,coordZ) ;
2450 + minP.x() = this->extremum(1,coordX) ;
2451 + minP.y() = this->extremum(1,coordY) ;
2452 + minP.z() = this->extremum(1,coordZ) ;
2453 + maxP.x() = this->extremum(0,coordX) ;
2454 + maxP.y() = this->extremum(0,coordY) ;
2455 + maxP.z() = this->extremum(0,coordZ) ;
2457 Point_nD<T,N> lookAt ;
2458 lookAt.x() = (minP.x()+maxP.x())/2.0 ;
2459 @@ -3860,12 +3860,12 @@ int NurbsSurface<T,N>::writePOVRAY(T tol
2460 // we use and angle of 36 to view the object
2461 // and position the rest according to this.
2462 Point_nD<T,N> minP, maxP ;
2463 - minP.x() = extremum(1,coordX) ;
2464 - minP.y() = extremum(1,coordY) ;
2465 - minP.z() = extremum(1,coordZ) ;
2466 - maxP.x() = extremum(0,coordX) ;
2467 - maxP.y() = extremum(0,coordY) ;
2468 - maxP.z() = extremum(0,coordZ) ;
2469 + minP.x() = this->extremum(1,coordX) ;
2470 + minP.y() = this->extremum(1,coordY) ;
2471 + minP.z() = this->extremum(1,coordZ) ;
2472 + maxP.x() = this->extremum(0,coordX) ;
2473 + maxP.y() = this->extremum(0,coordY) ;
2474 + maxP.z() = this->extremum(0,coordZ) ;
2476 Point_nD<T,N> lookAt ;
2477 lookAt.x() = (minP.x()+maxP.x())/2.0 ;
2478 @@ -4045,12 +4045,12 @@ int NurbsSurface<T,N>::writeRIB(const ch
2481 Point_nD<T,N> minP, maxP ;
2482 - minP.x() = extremum(1,coordX) ;
2483 - minP.y() = extremum(1,coordY) ;
2484 - minP.z() = extremum(1,coordZ) ;
2485 - maxP.x() = extremum(0,coordX) ;
2486 - maxP.y() = extremum(0,coordY) ;
2487 - maxP.z() = extremum(0,coordZ) ;
2488 + minP.x() = this->extremum(1,coordX) ;
2489 + minP.y() = this->extremum(1,coordY) ;
2490 + minP.z() = this->extremum(1,coordZ) ;
2491 + maxP.x() = this->extremum(0,coordX) ;
2492 + maxP.y() = this->extremum(0,coordY) ;
2493 + maxP.z() = this->extremum(0,coordZ) ;
2495 Point_nD<T,N> lookAt ;
2496 lookAt.x() = (minP.x()+maxP.x())/2.0 ;
2497 diff -rNup nurbs++-3.0.11/nurbs/nurbs_sp.cpp nurbs++-3.0.11_mod/nurbs/nurbs_sp.cpp
2498 --- nurbs++-3.0.11/nurbs/nurbs_sp.cpp 2002-05-14 00:07:46.000000000 +0300
2499 +++ nurbs++-3.0.11_mod/nurbs/nurbs_sp.cpp 2007-06-21 14:49:51.000000000 +0300
2500 @@ -41,7 +41,7 @@ namespace PLib {
2502 template <class T, int N>
2503 void NurbsCurveSP<T,N>::updateMaxU() {
2504 - if(deg_>3){
2505 + if(this->deg_>3){
2506 #ifdef USE_EXCEPTION
2507 throw NurbsInputError();
2508 #else
2509 @@ -51,10 +51,10 @@ void NurbsCurveSP<T,N>::updateMaxU() {
2510 #endif
2512 else{
2513 - maxU.resize(P.n()) ;
2514 - maxAt_.resize(P.n()) ;
2515 - for(int i=0;i<P.n();++i){
2516 - if(!maxInfluence(i,U,deg_,maxAt_[i]))
2517 + maxU.resize(this->P.n()) ;
2518 + maxAt_.resize(this->P.n()) ;
2519 + for(int i=0;i<this->P.n();++i){
2520 + if(!maxInfluence(i,this->U,this->deg_,maxAt_[i]))
2521 cerr << "Problem in maxInfluence U!\n" ;
2522 if(i>0)
2523 if(maxAt_[i]<maxAt_[i-1]){
2524 @@ -69,7 +69,7 @@ void NurbsCurveSP<T,N>::updateMaxU() {
2525 error.fatal() ;
2526 #endif
2528 - maxU[i] = basisFun(maxAt_[i],i,deg_) ;
2529 + maxU[i] = basisFun(maxAt_[i],i,this->deg_) ;
2533 @@ -96,14 +96,14 @@ void NurbsCurveSP<T,N>::updateMaxU() {
2535 template <class T, int N>
2536 void NurbsCurveSP<T,N>::modOnlySurfCPby(int i, const HPoint_nD<T,N>& a){
2537 - Vector<T> u(2*deg_+3) ;
2538 - Vector< Point_nD<T,N> > pts(2*deg_+3) ;
2539 + Vector<T> u(2*this->deg_+3) ;
2540 + Vector< Point_nD<T,N> > pts(2*this->deg_+3) ;
2542 int n=0;
2543 - for(int j=i-deg_-1;j<=i+deg_+1;++j){
2544 + for(int j=i-this->deg_-1;j<=i+this->deg_+1;++j){
2545 if(j<0)
2546 continue ;
2547 - if(j>=P.n())
2548 + if(j>=this->P.n())
2549 break ;
2550 u[n] = maxAt_[j] ;
2551 if( j == i){
2552 diff -rNup nurbs++-3.0.11/nurbs/nurbs_sp.h nurbs++-3.0.11_mod/nurbs/nurbs_sp.h
2553 --- nurbs++-3.0.11/nurbs/nurbs_sp.h 2002-05-17 21:24:21.000000000 +0300
2554 +++ nurbs++-3.0.11_mod/nurbs/nurbs_sp.h 2007-06-21 14:44:44.000000000 +0300
2555 @@ -72,7 +72,7 @@ public:
2556 int read(ifstream &fin) ;
2558 void modSurfCPby(int i, const HPoint_nD<T,N>& a)
2559 - { P[i] += a / maxU[i] ; }
2560 + { this->P[i] += a / maxU[i] ; }
2561 void modSurfCP(int i, const HPoint_nD<T,N>& a)
2562 { modSurfCPby(i,a-surfP(i)) ; }
2564 diff -rNup nurbs++-3.0.11/nurbs/nurbsS_sp.cpp nurbs++-3.0.11_mod/nurbs/nurbsS_sp.cpp
2565 --- nurbs++-3.0.11/nurbs/nurbsS_sp.cpp 2002-05-14 00:07:46.000000000 +0300
2566 +++ nurbs++-3.0.11_mod/nurbs/nurbsS_sp.cpp 2007-06-21 15:39:07.000000000 +0300
2567 @@ -43,7 +43,7 @@ namespace PLib {
2569 template <class T, int N>
2570 void NurbsSurfaceSP<T,N>::updateMaxU() {
2571 - if(degU>3){
2572 + if(this->degU>3){
2573 #ifdef USE_EXCEPTION
2574 throw NurbsInputError();
2575 #else
2576 @@ -53,12 +53,12 @@ void NurbsSurfaceSP<T,N>::updateMaxU() {
2577 #endif
2579 else{
2580 - maxU.resize(P.rows()) ;
2581 - maxAtU_.resize(P.rows()) ;
2582 - for(int i=0;i<P.rows();++i){
2583 - if(!maxInfluence(i,U,degU,maxAtU_[i]))
2584 + maxU.resize(this->P.rows()) ;
2585 + maxAtU_.resize(this->P.rows()) ;
2586 + for(int i=0;i<this->P.rows();++i){
2587 + if(!maxInfluence(i,this->U,this->degU,maxAtU_[i]))
2588 cerr << "Problem in maxInfluence U!\n" ;
2589 - maxU[i] = nurbsBasisFun(maxAtU_[i],i,degU,U) ;
2590 + maxU[i] = nurbsBasisFun(maxAtU_[i],i,this->degU,this->U) ;
2594 @@ -78,7 +78,7 @@ void NurbsSurfaceSP<T,N>::updateMaxU() {
2596 template <class T, int N>
2597 void NurbsSurfaceSP<T,N>::updateMaxV() {
2598 - if(degV>3){
2599 + if(this->degV>3){
2600 #ifdef USE_EXCEPTION
2601 throw NurbsInputError();
2602 #else
2603 @@ -88,12 +88,12 @@ void NurbsSurfaceSP<T,N>::updateMaxV() {
2604 #endif
2606 else{
2607 - maxV.resize(P.cols()) ;
2608 - maxAtV_.resize(P.cols()) ;
2609 - for(int i=0;i<P.cols();++i){
2610 - if(!maxInfluence(i,V,degV,maxAtV_[i]))
2611 + maxV.resize(this->P.cols()) ;
2612 + maxAtV_.resize(this->P.cols()) ;
2613 + for(int i=0;i<this->P.cols();++i){
2614 + if(!maxInfluence(i,this->V,this->degV,maxAtV_[i]))
2615 cerr << "Problem in maxInfluence V!\n" ;
2616 - maxV[i] = nurbsBasisFun(maxAtV_[i],i,degV,V) ;
2617 + maxV[i] = nurbsBasisFun(maxAtV_[i],i,this->degV,this->V) ;
2621 @@ -124,11 +124,11 @@ template <class T, int N>
2622 NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>::generateParallel(T d) const {
2623 NurbsSurfaceSP<T,N> p(*this) ;
2625 - Vector< Point_nD<T,N> > offset(P.rows()*P.cols()) ;
2626 - Vector<T> ur(P.rows()*P.cols()) ;
2627 - Vector<T> vr(P.rows()*P.cols()) ;
2628 - Vector_INT Du(P.rows()*P.cols()) ;
2629 - Vector_INT Dv(P.rows()*P.cols()) ;
2630 + Vector< Point_nD<T,N> > offset(this->P.rows()*this->P.cols()) ;
2631 + Vector<T> ur(this->P.rows()*this->P.cols()) ;
2632 + Vector<T> vr(this->P.rows()*this->P.cols()) ;
2633 + Vector_INT Du(this->P.rows()*this->P.cols()) ;
2634 + Vector_INT Dv(this->P.rows()*this->P.cols()) ;
2636 Du.reset(0) ;
2637 Dv.reset(0) ;
2638 @@ -137,8 +137,8 @@ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>:
2640 no = 0 ;
2642 - for(i=0;i<P.rows();++i)
2643 - for(j=0;j<P.cols();++j){
2644 + for(i=0;i<this->P.rows();++i)
2645 + for(j=0;j<this->P.cols();++j){
2646 Point_nD<T,N> norm ;
2647 norm = normal(maxAtU_[i],maxAtV_[j]) ;
2648 if(norm.x() == T(0) &&
2649 @@ -155,19 +155,19 @@ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>:
2650 norm /= T(2) ;
2651 ok = 1 ;
2653 - if(i==P.rows()-1 && j==P.cols()-1){
2654 + if(i==this->P.rows()-1 && j==this->P.cols()-1){
2655 norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
2656 norm += normal(maxAtU_[i],maxAtV_[j]-delta) ;
2657 norm /= T(2) ;
2658 ok = 1 ;
2660 - if(i==0 && j==P.cols()-1){
2661 + if(i==0 && j==this->P.cols()-1){
2662 norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
2663 norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
2664 norm /= T(2) ;
2665 ok = 1 ;
2667 - if(i==P.rows()-1 && j==0){
2668 + if(i==this->P.rows()-1 && j==0){
2669 norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
2670 norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
2671 norm /= T(2) ;
2672 @@ -178,7 +178,7 @@ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>:
2673 while(norm.x() == T(0) &&
2674 norm.y() == T(0) &&
2675 norm.z() == T(0)){
2676 - if( nt*d >(U[U.n()-1]-U[0])){
2677 + if( nt*d >(this->U[this->U.n()-1]-this->U[0])){
2678 #ifdef USE_EXCEPTION
2679 throw NurbsComputationError();
2680 #else
2681 @@ -188,12 +188,12 @@ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>:
2682 #endif
2684 T u1,u2,v1,v2 ;
2685 - if(i==0 || i==P.rows()-1){
2686 + if(i==0 || i==this->P.rows()-1){
2687 u1 = u2 = maxAtU_[i] ;
2688 v1 = maxAtV_[j]+ nt*delta ;
2689 v2 = maxAtV_[j]- nt*delta ;
2690 - if(v1>V[V.n()-1]) v1 = V[V.n()-1] ;
2691 - if(v2<V[0]) v2 = V[0] ;
2692 + if(v1>this->V[this->V.n()-1]) v1 = this->V[this->V.n()-1] ;
2693 + if(v2<this->V[0]) v2 = this->V[0] ;
2694 norm = normal(u1,v1);
2695 norm += normal(u2,v2) ;
2696 norm /= 2 ;
2697 @@ -202,8 +202,8 @@ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>:
2698 u1 = maxAtU_[i]- nt*delta ;
2699 u2 = maxAtU_[i]+ nt*delta ;
2700 v1 = v2 = maxAtV_[j] ;
2701 - if(u1 < U[0]) u1 = U[0] ;
2702 - if(u2 > U[U.n()-1]) u2 = U[U.n()-1] ;
2703 + if(u1 < this->U[0]) u1 = this->U[0] ;
2704 + if(u2 > this->U[this->U.n()-1]) u2 = this->U[this->U.n()-1] ;
2706 T u3,v3 ;
2707 u3 = maxAtU_[i] ;
2708 @@ -212,8 +212,8 @@ NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>:
2709 else
2710 v3 = maxAtV_[j]- nt*delta ;
2712 - if(v3<V[0]) v3 = V[0] ;
2713 - if(v3>V[V.n()-1]) v3 = V[V.n()-1] ;
2714 + if(v3<this->V[0]) v3 = this->V[0] ;
2715 + if(v3>this->V[this->V.n()-1]) v3 = this->V[this->V.n()-1] ;
2717 norm = normal(u1,v1);
2718 norm += normal(u2,v2) ;
2719 @@ -263,13 +263,13 @@ void NurbsSurfaceSP<T,N>::modOnlySurfCPb
2721 int sizeU, sizeV ;
2723 - sizeU = 2*degU+3 ;
2724 - if(i-degU-1<0) sizeU += i-degU-1 ;
2725 - if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
2727 - sizeV = 2*degV+3 ;
2728 - if(j-degV-1<0) sizeV += j-degV-1 ;
2729 - if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
2730 + sizeU = 2*this->degU+3 ;
2731 + if(i-this->degU-1<0) sizeU += i-this->degU-1 ;
2732 + if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
2734 + sizeV = 2*this->degV+3 ;
2735 + if(j-this->degV-1<0) sizeV += j-this->degV-1 ;
2736 + if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
2738 Vector<T> u(sizeU) ;
2739 Vector<T> v(sizeV) ;
2740 @@ -280,16 +280,16 @@ void NurbsSurfaceSP<T,N>::modOnlySurfCPb
2741 int n=0;
2742 int nu = 0 ;
2743 int nv = 0 ;
2744 - for(int k=i-degU-1;k<=i+degU+1;++k){
2745 + for(int k=i-this->degU-1;k<=i+this->degU+1;++k){
2746 if(k<0)
2747 continue ;
2748 - if(k>=P.rows())
2749 + if(k>=this->P.rows())
2750 break ;
2751 nv = 0 ;
2752 - for(int l=j-degV-1;l<=j+degV+1;++l){
2753 + for(int l=j-this->degV-1;l<=j+this->degV+1;++l){
2754 if(l<0)
2755 continue ;
2756 - if(l>=P.cols())
2757 + if(l>=this->P.cols())
2758 break ;
2759 if( k == i && j==l){
2760 pts[n].x() = a.x() ;
2761 diff -rNup nurbs++-3.0.11/nurbs/nurbsS_sp.h nurbs++-3.0.11_mod/nurbs/nurbsS_sp.h
2762 --- nurbs++-3.0.11/nurbs/nurbsS_sp.h 2002-05-14 00:07:46.000000000 +0300
2763 +++ nurbs++-3.0.11_mod/nurbs/nurbsS_sp.h 2007-06-21 14:51:54.000000000 +0300
2764 @@ -78,7 +78,7 @@ public:
2767 void modSurfCPby(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point by a value
2768 - { P(i,j) += a / (maxU[i]*maxV[j]) ; }
2769 + { this->P(i,j) += a / (maxU[i]*maxV[j]) ; }
2770 void modSurfCP(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point to a value
2771 { modSurfCPby(i,j,a-surfP(i,j)) ; }
2773 diff -rNup nurbs++-3.0.11/nurbs/nurbsSub.cpp nurbs++-3.0.11_mod/nurbs/nurbsSub.cpp
2774 --- nurbs++-3.0.11/nurbs/nurbsSub.cpp 2002-05-14 00:07:46.000000000 +0300
2775 +++ nurbs++-3.0.11_mod/nurbs/nurbsSub.cpp 2007-06-21 16:23:08.000000000 +0300
2776 @@ -904,7 +904,7 @@ DrawEvaluation( NurbSurface<T> * n )
2778 /* Allocate storage for the grid of points generated */
2780 - CHECK( pts = new (SurfSample<T>*)[Granularity+1]);
2781 + CHECK( pts = new SurfSample<T>*[Granularity+1]);
2782 CHECK( pts[0] = new SurfSample<T>[(Granularity+1)*(Granularity+1)]);
2784 for (i = 1; i <= Granularity; i++)
2785 @@ -983,7 +983,7 @@ CalcAlpha( T * ukv, T * wkv, int m, int
2787 if (! *alpha) /* Must allocate alpha */
2789 - CHECK( *alpha = new (T*)[k+1]);
2790 + CHECK( *alpha = new T*[k+1]);
2791 for (i = 0; i <= k; i++)
2792 CHECK( (*alpha)[i] = new T[(m + n + 1)]);