View | Details | Raw Unified | Return to bug 106117
Collapse All | Expand All

(-)Makefile (-12 / +2 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	nurbs++
8
PORTNAME=	nurbs++
9
PORTVERSION=	3.0.11
9
PORTVERSION=	3.0.11
10
PORTREVISION=	1
10
PORTREVISION=	2
11
CATEGORIES=	graphics
11
CATEGORIES=	graphics
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
13
MASTER_SITE_SUBDIR=	libnurbs
13
MASTER_SITE_SUBDIR=	libnurbs
Lines 21-34 Link Here
21
21
22
MAN1=	nurbs++-config.1
22
MAN1=	nurbs++-config.1
23
23
24
.include <bsd.port.pre.mk>
24
.include <bsd.port.mk>
25
26
.if ${OSVERSION} >= 502126
27
BROKEN=		"Does not compile with gcc 3.4.2"
28
.endif
29
30
pre-patch:
31
	@${REINPLACE_CMD} -e 's,<malloc.h>,<stdlib.h>,' \
32
		${WRKSRC}/nurbs/nurbs.cpp ${WRKSRC}/nurbs/nurbsS.cpp
33
34
.include <bsd.port.post.mk>
(-)files/patch-cvector.h (+16 lines)
Added Link Here
1
--- matrix/cvector.h.orig	Mon May 13 14:07:45 2002
2
+++ matrix/cvector.h	Thu Nov 30 23:30:00 2006
3
@@ -54,10 +54,10 @@
4
     CVector(const BasicArray<T>& v) : Vector<T>(v), index(0)  {;}
5
     virtual ~CVector() {}
6
     
7
-    T& operator[](const int i) { return x[i%sze]; }
8
-    T  operator[](const int i) const   { return x[i%sze]; }
9
+    T& operator[](const int i) { return this->x[i%this->sze]; }
10
+    T  operator[](const int i) const   { return this->x[i%this->sze]; }
11
     
12
-    void put(T v) { x[index] = v ; index = (index+1)%sze; }
13
+    void put(T v) { this->x[index] = v ; index = (index+1)%this->sze; }
14
     
15
   protected:
16
     int index ;
(-)files/patch-d_nurbsSub.cpp (+13 lines)
Added Link Here
1
--- nurbs/d_nurbsSub.cpp.orig	Mon May 13 13:11:57 2002
2
+++ nurbs/d_nurbsSub.cpp	Fri Dec  1 01:17:36 2006
3
@@ -14,8 +14,8 @@
4
   template class RenderMeshPoints<double> ;
5
 
6
   
7
-  double NurbSurface<double>::epsilon = 1e-6 ;
8
-  double SurfSample<double>::epsilon = 1e-6 ;
9
+  template <> double NurbSurface<double>::epsilon = 1e-6 ;
10
+  template <> double SurfSample<double>::epsilon = 1e-6 ;
11
 
12
   template void DrawSubdivision( NurbSurface<double> *, double tolerance );
13
   template void DrawEvaluation( NurbSurface<double> * );
(-)files/patch-f_nurbsSub.cpp (+13 lines)
Added Link Here
1
--- nurbs/f_nurbsSub.cpp.orig	Mon May 13 13:11:57 2002
2
+++ nurbs/f_nurbsSub.cpp	Fri Dec  1 01:15:08 2006
3
@@ -14,8 +14,8 @@
4
   template class RenderMeshPoints<float> ;
5
 
6
   
7
-  float NurbSurface<float>::epsilon = 1e-6 ;
8
-  float SurfSample<float>::epsilon = 1e-6 ;
9
+  template <> float NurbSurface<float>::epsilon = 1e-6 ;
10
+  template <> float SurfSample<float>::epsilon = 1e-6 ;
11
 
12
   template void DrawSubdivision( NurbSurface<float> *, float tolerance );
13
   template void DrawEvaluation( NurbSurface<float> * );
(-)files/patch-hnurbsS.cpp (+381 lines)
Added Link Here
1
--- nurbs/hnurbsS.cpp.orig	Fri May 17 11:24:21 2002
2
+++ nurbs/hnurbsS.cpp	Fri Dec  1 00:40:08 2006
3
@@ -103,11 +103,11 @@
4
   initBase() ;
5
   offset.resize(baseSurf.ctrlPnts()) ;
6
 
7
-  P = baseSurf.ctrlPnts() ;
8
-  U = baseSurf.knotU() ;
9
-  V = baseSurf.knotV() ;
10
-  degU = baseSurf.degreeU() ;
11
-  degV = baseSurf.degreeV() ;
12
+  this->P = baseSurf.ctrlPnts() ;
13
+  this->U = baseSurf.knotU() ;
14
+  this->V = baseSurf.knotV() ;
15
+  this->degU = baseSurf.degreeU() ;
16
+  this->degV = baseSurf.degreeV() ;
17
 
18
   //updateSurface() ;
19
 
20
@@ -162,11 +162,11 @@
21
   baseUpdateN = baseLevel_->modifiedN()-1 ; // Set it so that initBase will run
22
   initBase() ;
23
   offset.resize(baseSurf.ctrlPnts()) ;
24
-  P = baseSurf.ctrlPnts() ;
25
-  U = baseSurf.knotU() ;
26
-  V = baseSurf.knotV() ;
27
-  degU = baseSurf.degreeU() ;
28
-  degV = baseSurf.degreeV() ;
29
+  this->P = baseSurf.ctrlPnts() ;
30
+  this->U = baseSurf.knotU() ;
31
+  this->V = baseSurf.knotV() ;
32
+  this->degU = baseSurf.degreeU() ;
33
+  this->degV = baseSurf.degreeV() ;
34
   //updateSurface() ;
35
 
36
 }
37
@@ -200,7 +200,7 @@
38
   rU.resize(0) ;
39
   rV.resize(0) ;
40
 
41
-  offset = P ;
42
+  offset = this->P ;
43
 }
44
 
45
 /*!
46
@@ -334,11 +334,11 @@
47
   }
48
   if(baseLevel_){
49
     if(initBase()){
50
-      P = baseSurf.ctrlPnts() ;
51
-      U = baseSurf.knotU() ;
52
-      V = baseSurf.knotV() ;
53
-      degU = baseSurf.degreeU() ;
54
-      degV = baseSurf.degreeV() ;
55
+      this->P = baseSurf.ctrlPnts() ;
56
+      this->U = baseSurf.knotU() ;
57
+      this->V = baseSurf.knotV() ;
58
+      this->degU = baseSurf.degreeU() ;
59
+      this->degV = baseSurf.degreeV() ;
60
     }
61
     if(i0>=0 && j0>=0){
62
       Point_nD<T,N> vecOffset ;
63
@@ -352,13 +352,13 @@
64
 	  offset(i0,j0).y()*jvec(i0,j0) +
65
 	  offset(i0,j0).z()*kvec(i0,j0) ;
66
       }
67
-      P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
68
-      P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
69
-      P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
70
+      this->P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
71
+      this->P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
72
+      this->P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
73
     }
74
     else{
75
-      for(int i=0;i<P.rows();++i)
76
-	for(int j=0;j<P.cols();++j){
77
+      for(int i=0;i<this->P.rows();++i)
78
+	for(int j=0;j<this->P.cols();++j){
79
 	  if(offset(i,j).x() != 0 || 
80
 	     offset(i,j).y() != 0 || offset(i,j).z() || 0){
81
 	    Point_nD<T,N> vecOffset ;
82
@@ -372,20 +372,20 @@
83
 		offset(i,j).y()*jvec(i,j) +
84
 		offset(i,j).z()*kvec(i,j) ;
85
 	    }
86
-	    P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
87
-	    P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
88
-	    P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
89
+	    this->P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
90
+	    this->P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
91
+	    this->P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
92
 	  }
93
 	}
94
     }
95
   }
96
   else{
97
     if(i0>=0 && j0>=0)
98
-      P(i0,j0) = offset(i0,j0) ;
99
+      this->P(i0,j0) = offset(i0,j0) ;
100
     else{
101
-      for(int i=0;i<P.rows();++i)
102
-	for(int j=0;j<P.cols();++j){
103
-	  P(i,j) = offset(i,j) ;
104
+      for(int i=0;i<this->P.rows();++i)
105
+	for(int j=0;j<this->P.cols();++j){
106
+	  this->P(i,j) = offset(i,j) ;
107
 	}
108
     }
109
   }
110
@@ -554,17 +554,17 @@
111
       return mod ;
112
   }
113
 
114
-  if(u<knotU()[0] || u>knotU()[knotU().n()-1])
115
+  if(u<this->knotU()[0] || u>this->knotU()[this->knotU().n()-1])
116
     return -1 ;
117
-  if(v<knotV()[0] || v>knotU()[knotV().n()-1])
118
+  if(v<this->knotV()[0] || v>this->knotU()[this->knotV().n()-1])
119
     return -1 ;
120
 
121
   int su = findSpanU(u) ;
122
   int sv = findSpanV(v) ;
123
 
124
-  for(int i=0;i<=degU;++i)
125
-    for(int j=0;j<=degV;++j){
126
-      if(offset(su-degU+i,sv+degV+j) != HPoint_nD<T,N>(0,0,0,0))
127
+  for(int i=0;i<=this->degU;++i)
128
+    for(int j=0;j<=this->degV;++j){
129
+      if(offset(su-this->degU+i,sv+this->degV+j) != HPoint_nD<T,N>(0,0,0,0))
130
 	return level_ ;
131
     }
132
 
133
@@ -742,16 +742,16 @@
134
 template <class T, int N>
135
 void HNurbsSurface<T,N>::splitUV(int nu, int nv, Vector<T> &nU, Vector<T> &nV){
136
 
137
-  nU.resize(knotU().n()*nu) ;
138
-  nV.resize(knotV().n()*nv) ;
139
+  nU.resize(this->knotU().n()*nu) ;
140
+  nV.resize(this->knotV().n()*nv) ;
141
   
142
   int i,j,n ;
143
 
144
   n = 0 ; 
145
-  for(i=1;i<knotU().n();++i){
146
-    if(knotU()[i] >knotU()[i-1]){
147
-      T a = knotU()[i-1] ;
148
-      T b = knotU()[i] ;
149
+  for(i=1;i<this->knotU().n();++i){
150
+    if(this->knotU()[i] >this->knotU()[i-1]){
151
+      T a = this->knotU()[i-1] ;
152
+      T b = this->knotU()[i] ;
153
 
154
 
155
       for(j=0;j<nu;++j){
156
@@ -763,10 +763,10 @@
157
   nU.resize(n) ;
158
 
159
   n = 0 ;
160
-  for(i=1;i<knotV().n();++i){
161
-    if(knotV()[i] > knotV()[i-1]){
162
-      T a = knotV()[i-1] ;
163
-      T b = knotV()[i] ;
164
+  for(i=1;i<this->knotV().n();++i){
165
+    if(this->knotV()[i] > this->knotV()[i-1]){
166
+      T a = this->knotV()[i-1] ;
167
+      T b = this->knotV()[i] ;
168
 
169
       for(j=0;j<nv;++j){
170
 	nV[n] = a + (b-a)*T(j+1)/T(nv+1) ;
171
@@ -805,22 +805,22 @@
172
   int i,j,n ;
173
 
174
   if(su<=0)
175
-    su = degU  ;
176
+    su = this->degU  ;
177
   if(sv<=0)
178
-    sv = degV  ;
179
-  if(su>degU+1)
180
-    su = degU+1 ;
181
-  if(sv>degV+1)
182
-    sv = degV+1 ;
183
+    sv = this->degV  ;
184
+  if(su>this->degU+1)
185
+    su = this->degU+1 ;
186
+  if(sv>this->degV+1)
187
+    sv = this->degV+1 ;
188
 
189
-  nU.resize(knotU().n()*nu*su) ;
190
-  nV.resize(knotV().n()*nv*sv) ;
191
+  nU.resize(this->knotU().n()*nu*su) ;
192
+  nV.resize(this->knotV().n()*nv*sv) ;
193
   
194
   n = 0 ; 
195
-  for(i=1;i<knotU().n();++i){
196
-    if(knotU()[i] >knotU()[i-1]){
197
-      T a = knotU()[i-1] ;
198
-      T b = knotU()[i] ;
199
+  for(i=1;i<this->knotU().n();++i){
200
+    if(this->knotU()[i] >this->knotU()[i-1]){
201
+      T a = this->knotU()[i-1] ;
202
+      T b = this->knotU()[i] ;
203
 
204
 
205
       for(j=0;j<nu;++j){
206
@@ -835,10 +835,10 @@
207
   nU.resize(n) ;
208
 
209
   n = 0 ;
210
-  for(i=1;i<knotV().n();++i){
211
-    if(knotV()[i] > knotV()[i-1]){
212
-      T a = knotV()[i-1] ;
213
-      T b = knotV()[i] ;
214
+  for(i=1;i<this->knotV().n();++i){
215
+    if(this->knotV()[i] > this->knotV()[i-1]){
216
+      T a = this->knotV()[i-1] ;
217
+      T b = this->knotV()[i] ;
218
 
219
       for(j=0;j<nv;++j){
220
 	T v = a + (b-a)*T(j+1)/T(nv+1) ;
221
@@ -1014,10 +1014,10 @@
222
     if(!fin.read((char*)&du,sizeof(int))) { delete []type ; return 0 ;}
223
     if(!fin.read((char*)&dv,sizeof(int))) { delete []type ; return 0 ;}
224
     
225
-    resize(nu,nv,du,dv) ;
226
+    this->resize(nu,nv,du,dv) ;
227
     
228
-    if(!fin.read((char*)U.memory(),sizeof(T)*U.n())) { delete []type ; return 0 ;}
229
-    if(!fin.read((char*)V.memory(),sizeof(T)*V.n())) { delete []type ; return 0 ;}
230
+    if(!fin.read((char*)this->U.memory(),sizeof(T)*this->U.n())) { delete []type ; return 0 ;}
231
+    if(!fin.read((char*)this->V.memory(),sizeof(T)*this->V.n())) { delete []type ; return 0 ;}
232
     
233
     if(!r1){
234
       p = new T[3*nu*nv] ;
235
@@ -1025,10 +1025,10 @@
236
       p2 = p ;
237
       for(int i=0;i<nu;i++)
238
 	for(int j=0;j<nv;j++){
239
-	  P(i,j).x() = *(p++) ;
240
-	  P(i,j).y() = *(p++) ;
241
-	  P(i,j).z() = *(p++) ;
242
-	  P(i,j).w() = 1.0 ;
243
+	  this->P(i,j).x() = *(p++) ;
244
+	  this->P(i,j).y() = *(p++) ;
245
+	  this->P(i,j).z() = *(p++) ;
246
+	  this->P(i,j).w() = 1.0 ;
247
 	}
248
       delete []p2 ;
249
     }
250
@@ -1038,14 +1038,14 @@
251
       p2 = p ;
252
       for(int i=0;i<nu;i++)
253
 	for(int j=0;j<nv;j++){
254
-	  P(i,j).x() = *(p++) ;
255
-	  P(i,j).y() = *(p++) ;
256
-	  P(i,j).z() = *(p++) ;
257
-	  P(i,j).w() = *(p++) ;
258
+	  this->P(i,j).x() = *(p++) ;
259
+	  this->P(i,j).y() = *(p++) ;
260
+	  this->P(i,j).z() = *(p++) ;
261
+	  this->P(i,j).w() = *(p++) ;
262
 	}
263
       delete []p2 ;
264
     }
265
-    offset = P ;
266
+    offset = this->P ;
267
     this->updateSurface() ;
268
   }
269
   else { // reading the offset information
270
@@ -1144,29 +1144,29 @@
271
   if(!fout)
272
     return 0 ;
273
   if(!baseLevel_){
274
-    int prows = P.rows();
275
-    int pcols = P.cols();
276
+    int prows = this->P.rows();
277
+    int pcols = this->P.cols();
278
     char st = '0' + sizeof(T) ; 
279
     if(!fout.write((char*)&"hns4",sizeof(char)*4)) return 0 ;
280
     if(!fout.write((char*)&st,sizeof(char))) return 0 ; 
281
     if(!fout.write((char*)&prows,sizeof(int))) return 0 ;
282
     if(!fout.write((char*)&pcols,sizeof(int))) return 0 ;
283
-    if(!fout.write((char*)&degU,sizeof(int))) return 0 ;
284
-    if(!fout.write((char*)&degV,sizeof(int))) return 0 ;
285
-    if(!fout.write((char*)U.memory(),sizeof(T)*U.n())) return 0 ;
286
-    if(!fout.write((char*)V.memory(),sizeof(T)*V.n())) return 0 ;
287
+    if(!fout.write((char*)&this->degU,sizeof(int))) return 0 ;
288
+    if(!fout.write((char*)&this->degV,sizeof(int))) return 0 ;
289
+    if(!fout.write((char*)this->U.memory(),sizeof(T)*this->U.n())) return 0 ;
290
+    if(!fout.write((char*)this->V.memory(),sizeof(T)*this->V.n())) return 0 ;
291
     
292
     T *p,*p2 ;
293
-    p = new T[P.rows()*P.cols()*4] ;
294
+    p = new T[this->P.rows()*this->P.cols()*4] ;
295
     p2 = p ;
296
-    for(int i=0;i<P.rows();i++) 
297
-      for(int j=0;j<P.cols();j++){
298
+    for(int i=0;i<this->P.rows();i++) 
299
+      for(int j=0;j<this->P.cols();j++){
300
 	*p = offset(i,j).x() ; p++ ;
301
 	*p = offset(i,j).y() ; p++ ;
302
 	*p = offset(i,j).z() ; p++ ;
303
 	*p = offset(i,j).w() ; p++ ;
304
       }
305
-    if(!fout.write((char*)p2,sizeof(T)*P.rows()*P.cols()*4)) return 0 ;
306
+    if(!fout.write((char*)p2,sizeof(T)*this->P.rows()*this->P.cols()*4)) return 0 ;
307
     delete []p2 ;
308
   }
309
   else{
310
@@ -1282,7 +1282,7 @@
311
   int i,j ;
312
   j = 0 ;
313
   for(i=0;i<X.n();++i){
314
-    if(X[i]>=U[0] && X[i]<=U[U.n()-1]){
315
+    if(X[i]>=this->U[0] && X[i]<=this->U[this->U.n()-1]){
316
       Xu[j] = X[i] ;
317
       ++j ;
318
     }
319
@@ -1294,7 +1294,7 @@
320
       nextLevel_->refineKnotU(Xu) ;
321
     }
322
     
323
-    NurbsSurface<T,N> osurf(degU,degV,U,V,offset) ;
324
+    NurbsSurface<T,N> osurf(this->degU,this->degV,this->U,this->V,offset) ;
325
     
326
     osurf.refineKnotU(Xu) ;
327
     
328
@@ -1324,7 +1324,7 @@
329
   int i,j ;
330
   j = 0 ;
331
   for(i=0;i<X.n();++i){
332
-    if(X[i]>=V[0] && X[i]<=V[V.n()-1]){
333
+    if(X[i]>=this->V[0] && X[i]<=this->V[this->V.n()-1]){
334
       Xv[j] = X[i] ;
335
       ++j ;
336
     }
337
@@ -1336,7 +1336,7 @@
338
       nextLevel_->refineKnotV(Xv) ;
339
     }
340
     
341
-    NurbsSurface<T,N> osurf(degU,degV,U,V,offset) ;
342
+    NurbsSurface<T,N> osurf(this->degU,this->degV,this->U,this->V,offset) ;
343
     
344
     osurf.refineKnotV(Xv) ;
345
     
346
@@ -1370,26 +1370,26 @@
347
 */
348
 template <class T, int N>
349
 int HNurbsSurface<T,N>::movePointOffset(T u, T v, const Point_nD<T,N>& delta){
350
-  P = offset ; 
351
+  this->P = offset ; 
352
 
353
   // by definition the offset has w = 0 , but this isn't valid for
354
   // the control points, increasing the w by 1, will generate a valid surface
355
   if(baseLevel_)
356
-    for(int i=0;i<P.rows();++i)
357
-      for(int j=0;j<P.cols();++j){
358
-	P(i,j).w() += T(1) ; 
359
+    for(int i=0;i<this->P.rows();++i)
360
+      for(int j=0;j<this->P.cols();++j){
361
+	this->P(i,j).w() += T(1) ; 
362
       }
363
 
364
   if(NurbsSurface<T,N>::movePoint(u,v,delta)){
365
-    offset = P ;
366
+    offset = this->P ;
367
     // need to reset the offset weights
368
     if(baseLevel_)
369
-      for(int i=0;i<P.rows();++i)
370
-	for(int j=0;j<P.cols();++j){
371
-	  P(i,j).w() -= T(1) ; 
372
+      for(int i=0;i<this->P.rows();++i)
373
+	for(int j=0;j<this->P.cols();++j){
374
+	  this->P(i,j).w() -= T(1) ; 
375
       }
376
     
377
-    P = baseSurf.ctrlPnts() ; 
378
+    this->P = baseSurf.ctrlPnts() ; 
379
     updateSurface() ; 
380
     return 1 ;
381
   }
(-)files/patch-hnurbsS_sp.cpp (+406 lines)
Added Link Here
1
--- nurbs/hnurbsS_sp.cpp.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/hnurbsS_sp.cpp	Fri Dec  1 01:01:28 2006
3
@@ -43,7 +43,7 @@
4
 */
5
 template <class T, int N>
6
 void HNurbsSurfaceSP<T,N>::updateMaxU() {
7
-  if(degU>3){
8
+  if(this->degU>3){
9
 #ifdef USE_EXCEPTION
10
     throw NurbsError();
11
 #else
12
@@ -53,12 +53,12 @@
13
 #endif
14
   }
15
   else{
16
-    maxU.resize(P.rows()) ;
17
-    maxAtU_.resize(P.rows()) ;
18
-    for(int i=0;i<P.rows();++i){
19
-      if(!maxInfluence(i,U,degU,maxAtU_[i]))
20
+    maxU.resize(this->P.rows()) ;
21
+    maxAtU_.resize(this->P.rows()) ;
22
+    for(int i=0;i<this->P.rows();++i){
23
+      if(!maxInfluence(i,this->U,this->degU,maxAtU_[i]))
24
 	cerr << "Problem in maxInfluence U!\n" ;
25
-      maxU[i] = nurbsBasisFun(maxAtU_[i],i,degU,U) ;
26
+      maxU[i] = nurbsBasisFun(maxAtU_[i],i,this->degU,this->U) ;
27
     }
28
     
29
   }
30
@@ -78,7 +78,7 @@
31
 */
32
 template <class T, int N>
33
 void HNurbsSurfaceSP<T,N>::updateMaxV() {
34
-  if(degV>3){
35
+  if(this->degV>3){
36
 #ifdef USE_EXCEPTION
37
     throw NurbsError();
38
 #else
39
@@ -88,12 +88,12 @@
40
 #endif
41
   }
42
   else{
43
-    maxV.resize(P.cols()) ;
44
-    maxAtV_.resize(P.cols()) ;
45
-    for(int i=0;i<P.cols();++i){
46
-      if(!maxInfluence(i,V,degV,maxAtV_[i]))
47
+    maxV.resize(this->P.cols()) ;
48
+    maxAtV_.resize(this->P.cols()) ;
49
+    for(int i=0;i<this->P.cols();++i){
50
+      if(!maxInfluence(i,this->V,this->degV,maxAtV_[i]))
51
 	cerr << "Problem in maxInfluence V!\n" ;
52
-      maxV[i] = nurbsBasisFun(maxAtV_[i],i,degV,V) ;
53
+      maxV[i] = nurbsBasisFun(maxAtV_[i],i,this->degV,this->V) ;
54
     }
55
     
56
   }
57
@@ -113,18 +113,18 @@
58
 */
59
 template <class T, int N>
60
 void HNurbsSurfaceSP<T,N>::modSurfCPby(int i, int j, const HPoint_nD<T,N>& a) {
61
-  offset(i,j) +=  a / (maxU[i]*maxV[j]) ; 
62
-  if(baseLevel_){
63
+  this->offset(i,j) +=  a / (maxU[i]*maxV[j]) ; 
64
+  if(this->baseLevel_){
65
     Point_nD<T,N> vecOffset ; 
66
-    vecOffset = offset(i,j).x()*ivec(i,j) +
67
-      offset(i,j).y()*jvec(i,j) +
68
-      offset(i,j).z()*kvec(i,j) ;
69
-    P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
70
-    P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
71
-    P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
72
+    vecOffset = this->offset(i,j).x()*this->ivec(i,j) +
73
+      this->offset(i,j).y()*this->jvec(i,j) +
74
+      this->offset(i,j).z()*this->kvec(i,j) ;
75
+    this->P(i,j).x() = this->baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
76
+    this->P(i,j).y() = this->baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
77
+    this->P(i,j).z() = this->baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
78
   }
79
   else
80
-    P(i,j) = offset(i,j) ; 
81
+    this->P(i,j) = this->offset(i,j) ; 
82
 }
83
 
84
 /*!
85
@@ -151,24 +151,24 @@
86
 void HNurbsSurfaceSP<T,N>::modOnlySurfCPby(int i, int j, const HPoint_nD<T,N>& a){
87
   int k ; 
88
 
89
-  P = offset ; 
90
+  this->P = this->offset ; 
91
 
92
   // by definition the offset has w = 0 , but this isn't valid for
93
   // the control points, increasing the w by 1, will generate a valid surface
94
-  if(baseLevel_)
95
-    for(k=0;k<P.rows();++k)
96
-      for(int l=0;l<P.cols();++l)
97
-	P(k,l).w() += T(1) ; 
98
+  if(this->baseLevel_)
99
+    for(k=0;k<this->P.rows();++k)
100
+      for(int l=0;l<this->P.cols();++l)
101
+	this->P(k,l).w() += T(1) ; 
102
 
103
   int sizeU, sizeV ;
104
 
105
-  sizeU = 2*degU+3 ; 
106
-  if(i-degU-1<0) sizeU += i-degU-1 ; 
107
-  if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
108
-
109
-  sizeV = 2*degV+3 ;
110
-  if(j-degV-1<0) sizeV += j-degV-1 ; 
111
-  if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
112
+  sizeU = 2*this->degU+3 ; 
113
+  if(i-this->degU-1<0) sizeU += i-this->degU-1 ; 
114
+  if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
115
+
116
+  sizeV = 2*this->degV+3 ;
117
+  if(j-this->degV-1<0) sizeV += j-this->degV-1 ; 
118
+  if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
119
   
120
   Vector<T> u(sizeU) ;
121
   Vector<T> v(sizeV) ;
122
@@ -179,16 +179,16 @@
123
   int n=0;
124
   int nu = 0 ;
125
   int nv = 0 ; 
126
-  for(k=i-degU-1;k<=i+degU+1;++k){
127
+  for(k=i-this->degU-1;k<=i+this->degU+1;++k){
128
     if(k<0)
129
       continue ;
130
-    if(k>=P.rows())
131
+    if(k>=this->P.rows())
132
       break ; 
133
     nv = 0 ;
134
-    for(int l=j-degV-1;l<=j+degV+1;++l){
135
+    for(int l=j-this->degV-1;l<=j+this->degV+1;++l){
136
       if(l<0)
137
 	continue ;
138
-      if(l>=P.cols())
139
+      if(l>=this->P.cols())
140
 	break ; 
141
       if( k == i && j==l){
142
 	pts[n].x() = a.x() ; 
143
@@ -216,12 +216,12 @@
144
   pv.resize(n) ; 
145
 
146
   if(NurbsSurface<T,N>::movePoint(u,v,pts,pu,pv)){
147
-    offset = P ; 
148
+    this->offset = this->P ; 
149
     // an offset shouldn't have a weight value.
150
-    if(baseLevel_)
151
-      for(k=0;k<P.rows();++k)
152
-	for(int l=0;l<P.cols();++l)
153
-	  offset(k,l).w() -= T(1) ; 
154
+    if(this->baseLevel_)
155
+      for(k=0;k<this->P.rows();++k)
156
+	for(int l=0;l<this->P.cols();++l)
157
+	  this->offset(k,l).w() -= T(1) ; 
158
   }
159
   updateSurface(); 
160
 }
161
@@ -262,7 +262,7 @@
162
 HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel(int n, int s) {
163
   HNurbsSurfaceSP<T,N> *newLevel ;
164
 
165
-  if(nextLevel_)
166
+  if(this->nextLevel_)
167
     return 0 ;
168
 
169
   Vector<T> newU,newV ;
170
@@ -289,7 +289,7 @@
171
 HNurbsSurfaceSP<T,N>* HNurbsSurfaceSP<T,N>::addLevel() {
172
   HNurbsSurfaceSP<T,N> *newLevel ;
173
 
174
-  if(nextLevel_)
175
+  if(this->nextLevel_)
176
     return 0 ;
177
 
178
   newLevel = new HNurbsSurfaceSP<T,N>(this) ;
179
@@ -311,23 +311,23 @@
180
   levelP = nS.nextLevel() ;
181
 
182
   NurbsSurface<T,N>::operator=(nS) ;
183
-  rU = nS.rU ;
184
-  rV = nS.rV ;
185
-  offset = nS.offset ;
186
+  this->rU = nS.rU ;
187
+  this->rV = nS.rV ;
188
+  this->offset = nS.offset ;
189
 
190
   updateMaxUV() ; 
191
 
192
-  firstLevel_ = this ;
193
+  this->firstLevel_ = this ;
194
 
195
   if(levelP){
196
     HNurbsSurfaceSP<T,N> *newLevel ;
197
     newLevel =  new HNurbsSurfaceSP<T,N>(this) ; 
198
     newLevel->copy(*levelP) ;
199
-    nextLevel_ = newLevel ;
200
-    lastLevel_ = nextLevel_->lastLevel() ;
201
+    this->nextLevel_ = newLevel ;
202
+    this->lastLevel_ = this->nextLevel_->lastLevel() ;
203
   }
204
   else{
205
-    lastLevel_ = this ;
206
+    this->lastLevel_ = this ;
207
   }
208
 
209
 }
210
@@ -349,55 +349,55 @@
211
 template <class T, int N>
212
 void HNurbsSurfaceSP<T,N>::updateSurface(int i0, int j0){
213
   if(i0>=0 && j0>=0){
214
-    if(offset(i0,j0).x()==0.0 && offset(i0,j0).y()==0.0 && offset(i0,j0).z()==0.0)
215
+    if(this->offset(i0,j0).x()==0.0 && this->offset(i0,j0).y()==0.0 && this->offset(i0,j0).z()==0.0)
216
       return ;
217
   }
218
-  if(baseLevel_){
219
-    if(initBase()){
220
-      P = baseSurf.ctrlPnts() ;
221
-      U = baseSurf.knotU() ;
222
-      V = baseSurf.knotV() ;
223
-      degU = baseSurf.degreeU() ;
224
-      degV = baseSurf.degreeV() ;
225
+  if(this->baseLevel_){
226
+    if(this->initBase()){
227
+      this->P = this->baseSurf.ctrlPnts() ;
228
+      this->U = this->baseSurf.knotU() ;
229
+      this->V = this->baseSurf.knotV() ;
230
+      this->degU = this->baseSurf.degreeU() ;
231
+      this->degV = this->baseSurf.degreeV() ;
232
       updateMaxUV() ; 
233
     }
234
     if(i0>=0 && j0>=0){
235
       Point_nD<T,N> vecOffset ;
236
-      vecOffset = offset(i0,j0).x()*ivec(i0,j0) +
237
-	offset(i0,j0).y()*jvec(i0,j0) +
238
-	offset(i0,j0).z()*kvec(i0,j0) ;
239
-      P(i0,j0).x() = baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
240
-      P(i0,j0).y() = baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
241
-      P(i0,j0).z() = baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
242
+      vecOffset = this->offset(i0,j0).x()*this->ivec(i0,j0) +
243
+	this->offset(i0,j0).y()*this->jvec(i0,j0) +
244
+	this->offset(i0,j0).z()*this->kvec(i0,j0) ;
245
+      this->P(i0,j0).x() = this->baseSurf.ctrlPnts()(i0,j0).x()+vecOffset.x() ;
246
+      this->P(i0,j0).y() = this->baseSurf.ctrlPnts()(i0,j0).y()+vecOffset.y() ;
247
+      this->P(i0,j0).z() = this->baseSurf.ctrlPnts()(i0,j0).z()+vecOffset.z() ;
248
     }
249
     else{
250
-      for(int i=0;i<P.rows();++i)
251
-	for(int j=0;j<P.cols();++j){
252
-	  if(offset(i,j).x() != 0 || 
253
-	     offset(i,j).y() != 0 || offset(i,j).z() || 0){
254
+      for(int i=0;i<this->P.rows();++i)
255
+	for(int j=0;j<this->P.cols();++j){
256
+	  if(this->offset(i,j).x() != 0 || 
257
+	     this->offset(i,j).y() != 0 || this->offset(i,j).z() || 0){
258
 	    Point_nD<T,N> vecOffset ;
259
-	    vecOffset = offset(i,j).x()*ivec(i,j) +
260
-	      offset(i,j).y()*jvec(i,j) +
261
-	      offset(i,j).z()*kvec(i,j) ;
262
-	    P(i,j).x() = baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
263
-	    P(i,j).y() = baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
264
-	    P(i,j).z() = baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
265
+	    vecOffset = this->offset(i,j).x()*this->ivec(i,j) +
266
+	      this->offset(i,j).y()*this->jvec(i,j) +
267
+	      this->offset(i,j).z()*this->kvec(i,j) ;
268
+	    this->P(i,j).x() = this->baseSurf.ctrlPnts()(i,j).x()+vecOffset.x() ;
269
+	    this->P(i,j).y() = this->baseSurf.ctrlPnts()(i,j).y()+vecOffset.y() ;
270
+	    this->P(i,j).z() = this->baseSurf.ctrlPnts()(i,j).z()+vecOffset.z() ;
271
 	  }
272
 	}
273
     }
274
   }
275
   else{
276
     if(i0>=0 && j0>=0)
277
-      P(i0,j0) = offset(i0,j0) ;
278
+      this->P(i0,j0) = this->offset(i0,j0) ;
279
     else{
280
-      for(int i=0;i<P.rows();++i)
281
-	for(int j=0;j<P.cols();++j){
282
-	  P(i,j) = offset(i,j) ;
283
+      for(int i=0;i<this->P.rows();++i)
284
+	for(int j=0;j<this->P.cols();++j){
285
+	  this->P(i,j) = this->offset(i,j) ;
286
 	}
287
     }
288
   }
289
 
290
-  ++updateN ;
291
+  ++(this->updateN) ;
292
 }
293
 
294
 /*!
295
@@ -413,7 +413,7 @@
296
   if(!okMax())
297
     updateMaxUV() ; 
298
   if(upLevel>=0){
299
-    if(level()<=upLevel){
300
+    if(this->level()<=upLevel){
301
       this->updateSurface() ;
302
     }
303
   }
304
@@ -421,9 +421,9 @@
305
     this->updateSurface() ;
306
   }
307
 
308
-  if(upLevel>level() || upLevel<0){
309
-    if(nextLevel_)
310
-      ((HNurbsSurfaceSP<T,N>*)nextLevel_)->updateLevels(upLevel) ;
311
+  if(upLevel>this->level() || upLevel<0){
312
+    if(this->nextLevel_)
313
+      ((HNurbsSurfaceSP<T,N>*)this->nextLevel_)->updateLevels(upLevel) ;
314
   }
315
 }
316
 
317
@@ -458,10 +458,10 @@
318
     if(!fin.read((char*)&du,sizeof(int))) { delete []type ; return 0 ;}
319
     if(!fin.read((char*)&dv,sizeof(int))) { delete []type ; return 0 ;}
320
     
321
-    resize(nu,nv,du,dv) ;
322
+    this->resize(nu,nv,du,dv) ;
323
     
324
-    if(!fin.read((char*)U.memory(),sizeof(T)*U.n())) { delete []type ; return 0 ;}
325
-    if(!fin.read((char*)V.memory(),sizeof(T)*V.n())) { delete []type ; return 0 ;}
326
+    if(!fin.read((char*)this->U.memory(),sizeof(T)*this->U.n())) { delete []type ; return 0 ;}
327
+    if(!fin.read((char*)this->V.memory(),sizeof(T)*this->V.n())) { delete []type ; return 0 ;}
328
     
329
     if(!r1){
330
       p = new T[3*nu*nv] ;
331
@@ -469,10 +469,10 @@
332
       p2 = p ;
333
       for(int i=0;i<nu;i++)
334
 	for(int j=0;j<nv;j++){
335
-	  P(i,j).x() = *(p++) ;
336
-	  P(i,j).y() = *(p++) ;
337
-	  P(i,j).z() = *(p++) ;
338
-	  P(i,j).w() = 1.0 ;
339
+	  this->P(i,j).x() = *(p++) ;
340
+	  this->P(i,j).y() = *(p++) ;
341
+	  this->P(i,j).z() = *(p++) ;
342
+	  this->P(i,j).w() = 1.0 ;
343
 	}
344
       delete []p2 ;
345
     }
346
@@ -482,26 +482,26 @@
347
       p2 = p ;
348
       for(int i=0;i<nu;i++)
349
 	for(int j=0;j<nv;j++){
350
-	  P(i,j).x() = *(p++) ;
351
-	  P(i,j).y() = *(p++) ;
352
-	  P(i,j).z() = *(p++) ;
353
-	  P(i,j).w() = *(p++) ;
354
+	  this->P(i,j).x() = *(p++) ;
355
+	  this->P(i,j).y() = *(p++) ;
356
+	  this->P(i,j).z() = *(p++) ;
357
+	  this->P(i,j).w() = *(p++) ;
358
 	}
359
       delete []p2 ;
360
     }
361
-    offset = P ;
362
+    this->offset = this->P ;
363
     this->updateSurface() ;
364
   }
365
   else { // reading the offset information
366
     int ru,rv ;
367
     if(!fin.read((char*)&ru,sizeof(int))) { delete []type ; return 0 ;}
368
     if(!fin.read((char*)&rv,sizeof(int))) { delete []type ; return 0 ;}
369
-    rU.resize(ru) ;
370
-    rV.resize(rv) ;
371
-    if(rU.n()>0)
372
-      if(!fin.read((char*)rU.memory(),sizeof(T)*rU.n())) { delete []type ; return 0 ;}
373
-    if(rV.n()>0)
374
-      if(!fin.read((char*)rV.memory(),sizeof(T)*rV.n())) { delete []type ; return 0 ;}
375
+    this->rU.resize(ru) ;
376
+    this->rV.resize(rv) ;
377
+    if(this->rU.n()>0)
378
+      if(!fin.read((char*)this->rU.memory(),sizeof(T)*this->rU.n())) { delete []type ; return 0 ;}
379
+    if(this->rV.n()>0)
380
+      if(!fin.read((char*)this->rV.memory(),sizeof(T)*this->rV.n())) { delete []type ; return 0 ;}
381
     
382
     if(!fin.read((char*)&nu,sizeof(int))) { delete []type ; return 0 ;}
383
     if(!fin.read((char*)&nv,sizeof(int))) { delete []type ; return 0 ;}
384
@@ -509,16 +509,16 @@
385
     p = new T[4*nu*nv] ;
386
     if(!fin.read((char*)p,sizeof(T)*4*nu*nv)) { delete []type ; return 0 ;}
387
     p2 = p ;
388
-    offset.resize(nu,nv) ;
389
+    this->offset.resize(nu,nv) ;
390
     for(int i=0;i<nu;i++)
391
       for(int j=0;j<nv;j++){
392
-	offset(i,j).x() = *(p++) ;
393
-	offset(i,j).y() = *(p++) ;
394
-	offset(i,j).z() = *(p++) ;
395
-	offset(i,j).w() = *(p++) ;
396
+	this->offset(i,j).x() = *(p++) ;
397
+	this->offset(i,j).y() = *(p++) ;
398
+	this->offset(i,j).z() = *(p++) ;
399
+	this->offset(i,j).w() = *(p++) ;
400
       }
401
     delete []p2 ;    
402
-    --baseUpdateN ;
403
+    --(this->baseUpdateN) ;
404
     this->updateSurface() ;
405
   }
406
 
(-)files/patch-image.cpp (+98 lines)
Added Link Here
1
--- image/image.cpp.orig	Mon May 13 14:07:45 2002
2
+++ image/image.cpp	Thu Nov 30 23:57:14 2006
3
@@ -55,9 +55,9 @@
4
 void MatrixImage<T>::drawLine(int i1, int j1, int i2, int j2, T color){
5
   int i,j ;
6
   double mx,b ;
7
-  if(i1<0 || j1<0 || i1>rows() || j1>=cols()  ){
8
+  if(i1<0 || j1<0 || i1>this->rows() || j1>=this->cols()  ){
9
 #ifdef USE_EXCEPTION
10
-    throw OutOfBound2D(i1,j1,0,rows()-1,0,cols()-1) ;
11
+    throw OutOfBound2D(i1,j1,0,this->rows()-1,0,this->cols()-1) ;
12
 #else
13
     Error error("MatrixImage<T>::drawLine") ;
14
     error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
15
@@ -65,9 +65,9 @@
16
 #endif
17
     return ;
18
   }
19
-  if(i2 <0 || j2<0 || i2>rows() || j2>=cols() ){
20
+  if(i2 <0 || j2<0 || i2>this->rows() || j2>=this->cols() ){
21
 #ifdef USE_EXCEPTION
22
-    throw OutOfBound2D(i2,j2,0,rows()-1,0,cols()-1) ;
23
+    throw OutOfBound2D(i2,j2,0,this->rows()-1,0,this->cols()-1) ;
24
 #else
25
     Error error("MatrixImage<T>::drawLine") ;
26
     error << "Error in drawing line\n Invalid index ("<< i1 << ", " << j1 << ") to ( " << i2 << ", " << j2 << ") \n" ;
27
@@ -79,7 +79,7 @@
28
   // check if line is vertical
29
   if(j1==j2){
30
     for(i=minimum(i1,i2);i<=maximum(i1,i2);i++)
31
-     operator()(i,j1) = color ;
32
+     this->operator()(i,j1) = color ;
33
     return ;
34
   }
35
   mx = (double)(i1-i2)/(double)(j1-j2) ;
36
@@ -88,13 +88,13 @@
37
     if(i1>i2){
38
       for(i=i1;i>=i2;i--){
39
 	j = int(((double)i-b)/mx) ;
40
-	operator()(i,j) = color ;
41
+	this->operator()(i,j) = color ;
42
       }
43
     }
44
     else{
45
       for(i=i1;i<=i2;i++){
46
 	j = (int)((i-b)/mx) ;
47
-	operator()(i,j) = color ;
48
+	this->operator()(i,j) = color ;
49
       }
50
     }
51
   }
52
@@ -102,13 +102,13 @@
53
     if(j1>j2){
54
       for(j=j1;j>=j2;j--){
55
 	i = (int)(mx*j+b) ;
56
-	operator()(i,j) = color ;
57
+	this->operator()(i,j) = color ;
58
       }
59
     }
60
     else{
61
       for(j=j1;j<=j2;j++){
62
 	i = (int)(mx*j+b) ;
63
-	operator()(i,j) = color ;
64
+	this->operator()(i,j) = color ;
65
       }
66
     }
67
   }
68
@@ -133,9 +133,9 @@
69
 void MatrixImage<T>::drawPoint(int i, int j, double r , T color){
70
   for(int y=i-int(ceil(r)) ; y<i+int(ceil(r)) ; y++)
71
     for(int x = j-int(ceil(r)) ; x<j+int(ceil(r)) ; x++){
72
-      if(y>=0 && y<rows() && x>=0 && x<cols()){
73
+      if(y>=0 && y<this->rows() && x>=0 && x<this->cols()){
74
 	if( ((y-i)*(y-i)+(x-j)*(x-j))<= r*r)
75
-	  operator()(y,x) = color ;
76
+	  this->operator()(y,x) = color ;
77
       }
78
     }
79
 }
80
@@ -153,14 +153,14 @@
81
 */
82
 template <class T>
83
 void MatrixImage<T>::store(Matrix<T>& a){
84
-  if(a.rows() != rows() || a.cols() != cols()) {
85
-    a.resize(rows(),cols()) ;
86
+  if(a.rows() != this->rows() || a.cols() != this->cols()) {
87
+    a.resize(this->rows(),this->cols()) ;
88
   }
89
   T *aptr, *bptr ;
90
   int size,i ;
91
   aptr = &a(0,0)-1 ;
92
-  bptr = m-1 ;
93
-  size = cols()*rows() ;
94
+  bptr = this->m-1 ;
95
+  size = this->cols()*this->rows() ;
96
   for(i=0;i<size;i++)
97
     *(++aptr) = *(++bptr) ;  
98
 }
(-)files/patch-list.h (+10 lines)
Added Link Here
1
--- matrix/list.h.orig	Mon May 13 14:07:45 2002
2
+++ matrix/list.h	Fri Dec  1 00:21:47 2006
3
@@ -89,6 +89,7 @@
4
   int resetMode() const { return reset_mode ; }
5
   void setResetMode(ListResetMode a ) { reset_mode = a ; }
6
 
7
+  BasicList<T> const &by_ref() { return *this ; }
8
 protected:
9
   BasicNode<T> *first_,*last_ ;
10
   int n ;
(-)files/patch-matrix.cpp (+377 lines)
Added Link Here
1
--- matrix/matrix.cpp.orig	Mon May 13 14:07:45 2002
2
+++ matrix/matrix.cpp	Thu Nov 30 23:43:36 2006
3
@@ -54,19 +54,19 @@
4
   if ( this == &a )
5
     return *this;
6
   
7
-  if ( a.rows() != rows() || a.cols() != cols() ){
8
+  if ( a.rows() != this->rows() || a.cols() != this->cols() ){
9
     resize(a.rows(),a.cols()) ;
10
   }
11
   
12
-  int sze = rows()*cols() ;
13
+  int sze = this->rows()*this->cols() ;
14
   T *ptr, *aptr ;
15
-  ptr = m-1 ;
16
+  ptr = this->m-1 ;
17
   aptr = a.m-1 ;
18
   
19
   for (i = sze; i > 0; --i)
20
     *(++ptr) = *(++aptr) ;
21
   
22
-  by_columns = a.by_columns;
23
+  this->by_columns = a.by_columns;
24
   
25
   return *this;
26
 }
27
@@ -100,10 +100,10 @@
28
 {
29
   int rwz,coz,i,j;
30
   
31
-  if ( rows() % a.rows() != 0 || cols() % a.cols() != 0 || rows() < a.rows() || cols() < a.cols() )
32
+  if ( this->rows() % a.rows() != 0 || this->cols() % a.cols() != 0 || this->rows() < a.rows() || this->cols() < a.cols() )
33
     {
34
 #ifdef USE_EXCEPTION
35
-      throw WrongSize2D(rows(),cols(),a.rows(),a.cols()) ;
36
+      throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols()) ;
37
 #else
38
       Error error("Matrix<T>::submatrix");
39
       error << "Matrix and submatrix incommensurate" ;
40
@@ -111,10 +111,10 @@
41
 #endif
42
     }
43
   
44
-  if ( sr >= rows()/a.rows() || sr < 0 || sc >= cols()/a.cols() || sc < 0 )
45
+  if ( sr >= this->rows()/a.rows() || sr < 0 || sc >= this->cols()/a.cols() || sc < 0 )
46
     {
47
 #ifdef USE_EXCEPTION
48
-      throw OutOfBound2D(sr,sc,0,rows()/a.rows()-1,0,cols()/a.cols()-1) ;
49
+      throw OutOfBound2D(sr,sc,0,this->rows()/a.rows()-1,0,this->cols()/a.cols()-1) ;
50
 #else
51
       Error error("Matrix<T>::submatrix");
52
       error << "Submatrix location out of bounds.\nrowblock " << sr << ", " << rows()/a.rows() << " colblock " << sc << ", " << a.cols() << endl ;
53
@@ -133,7 +133,7 @@
54
   aptr = a.m - 1;
55
   for ( i = a.rows()-1; i >= 0; --i )
56
     {
57
-      ptr = &m[(i+rwz)*cols()+coz]-1 ;
58
+      ptr = &this->m[(i+rwz)*this->cols()+coz]-1 ;
59
       for ( j = a.cols(); j > 0; --j)
60
 	*(++ptr) = *(++aptr) ;
61
     }  
62
@@ -159,7 +159,7 @@
63
   // Assign matrix a to this matrix at (i,j)
64
   int i, j;
65
   
66
-  if ( (rw + a.rows()) > rows() || ( cl + a.cols()) > cols()) {
67
+  if ( (rw + a.rows()) > this->rows() || ( cl + a.cols()) > this->cols()) {
68
 #ifdef USE_EXCEPTION
69
     throw MatrixErr();
70
 #else
71
@@ -177,7 +177,7 @@
72
   T *pptr,*aptr ;
73
   aptr = a.m-1 ;
74
   for ( i = 0; i<a.rows(); ++i) {
75
-    pptr = &m[(i+rw)*cols()+cl]-1 ;
76
+    pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
77
     for ( j = 0; j < a.cols(); ++j)
78
       *(++pptr) = *(++aptr);
79
   }
80
@@ -208,7 +208,7 @@
81
 Matrix<T> Matrix<T>::get(int rw, int cl, int nr, int nc) const
82
 {
83
   Matrix<T> getmat(nr,nc) ;
84
-  if ( (rw+nr) > rows() || (cl+nc) > cols()) {
85
+  if ( (rw+nr) > this->rows() || (cl+nc) > this->cols()) {
86
 #ifdef USE_EXCEPTION
87
     throw MatrixErr();
88
 #else
89
@@ -228,7 +228,7 @@
90
   T *pptr,*aptr ;
91
   aptr = getmat.m-1;
92
   for (i = 0; i < nr; ++i) {
93
-    pptr = &m[(i+rw)*cols()+cl]-1 ;
94
+    pptr = &this->m[(i+rw)*this->cols()+cl]-1 ;
95
     for ( j = 0; j < nc; ++j)
96
       *(++aptr) = *(++pptr) ;
97
   }
98
@@ -252,11 +252,11 @@
99
   double sum, maxsum;
100
   int init=0 ;
101
   T *pptr ;
102
-  pptr = m-1 ;
103
+  pptr = this->m-1 ;
104
   maxsum = 0 ; // Silence the warning message
105
-  for(i=0;i<rows();++i){
106
+  for(i=0;i<this->rows();++i){
107
     sum = 0 ;
108
-    for ( j = 0; j < cols(); ++j) 
109
+    for ( j = 0; j < this->cols(); ++j) 
110
       sum += *(++pptr) ;
111
     if(init)
112
       maxsum = (maxsum>sum) ? maxsum : sum;
113
@@ -285,12 +285,12 @@
114
 {
115
   int i, iend;
116
   
117
-  iend = rows();
118
-  if ( iend > cols() )
119
-    iend = cols();
120
+  iend = this->rows();
121
+  if ( iend > this->cols() )
122
+    iend = this->cols();
123
   
124
   for (i = iend-1; i >=0; --i)
125
-    elem(i,i) = a;
126
+    this->elem(i,i) = a;
127
 
128
 }
129
 
130
@@ -308,10 +308,10 @@
131
 template <class T>
132
 Vector<T> Matrix<T>::getDiag(){
133
   int i, iend;
134
-  Vector<T> vec(minimum(rows(),cols())) ;
135
-  iend = minimum(rows(),cols());
136
+  Vector<T> vec(minimum(this->rows(),this->cols())) ;
137
+  iend = minimum(this->rows(),this->cols());
138
   for (i = iend-1; i >=0; --i)
139
-      vec[i] = elem(i,i);
140
+      vec[i] = this->elem(i,i);
141
   return vec ;
142
 }
143
 
144
@@ -328,8 +328,8 @@
145
 Matrix<T>& Matrix<T>::operator+=(double a)
146
 {
147
   T *p1 ;
148
-  p1 = m-1 ;
149
-  const int size = rows()*cols() ;
150
+  p1 = this->m-1 ;
151
+  const int size = this->rows()*this->cols() ;
152
   for(int i=size; i>0; --i)
153
     *(++p1) += a ;  
154
   return *this ;
155
@@ -348,8 +348,8 @@
156
 Matrix<T>& Matrix<T>::operator-=(double a)
157
 {
158
   T *p1 ;
159
-  p1 = m-1 ;
160
-  const int size = rows()*cols() ;
161
+  p1 = this->m-1 ;
162
+  const int size = this->rows()*this->cols() ;
163
   for(int i=size; i>0; --i)
164
     *(++p1) -= a ;  
165
   return *this ;
166
@@ -368,8 +368,8 @@
167
 Matrix<T>& Matrix<T>::operator*=(double a)
168
 {
169
   T *p1 ;
170
-  p1 = m-1 ;
171
-  const int size = rows()*cols() ;
172
+  p1 = this->m-1 ;
173
+  const int size = this->rows()*this->cols() ;
174
   for(int i=size; i>0; --i)
175
     *(++p1) *= a ;  
176
   return *this ;
177
@@ -388,8 +388,8 @@
178
 Matrix<T>& Matrix<T>::operator/=(double a)
179
 {
180
   T *p1 ;
181
-  p1 = m-1 ;
182
-  const int size = rows()*cols() ;
183
+  p1 = this->m-1 ;
184
+  const int size = this->rows()*this->cols() ;
185
   for(int i=size; i>0; --i)
186
     *(++p1) /= a ;  
187
   return *this ;
188
@@ -408,15 +408,15 @@
189
 template <class T> 
190
 Matrix<T>& Matrix<T>::operator+=(const Matrix<T> &a)
191
 {
192
-  if ( a.rows() != rows() || a.cols() != cols() )
193
+  if ( a.rows() != this->rows() || a.cols() != this->cols() )
194
     {
195
 #ifdef USE_EXCEPTION
196
-      throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
197
+      throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
198
 #else
199
       Error error("Matrix<T>::operator+=") ;
200
-      if ( rows() != a.rows() )
201
+      if ( this->rows() != a.rows() )
202
 	error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
203
-      if ( cols() != a.cols())
204
+      if ( this->cols() != a.cols())
205
 	error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
206
       error.fatal() ;
207
 #endif
208
@@ -425,8 +425,8 @@
209
   int i, sze ;
210
   T *aptr,*sptr ;
211
   aptr = a.m - 1 ;
212
-  sptr = m - 1 ;
213
-  sze = rows()*cols() ;
214
+  sptr = this->m - 1 ;
215
+  sze = this->rows()*this->cols() ;
216
   for (i = sze; i > 0; --i){
217
       *(++sptr) += *(++aptr) ;
218
   }
219
@@ -468,16 +468,16 @@
220
 template <class T> 
221
 Matrix<T>& Matrix<T>::operator-=(const Matrix<T> &a)
222
 {
223
-  if ( a.rows() != rows() || a.cols() != cols() )
224
+  if ( a.rows() != this->rows() || a.cols() != this->cols() )
225
     {
226
 #ifdef USE_EXCEPTION
227
-      throw WrongSize2D(rows(),cols(),a.rows(),a.cols());
228
+      throw WrongSize2D(this->rows(),this->cols(),a.rows(),a.cols());
229
 #else
230
       Error error("Matrix<T>::operator-=") ;
231
-      if ( rows() != a.rows() )
232
-	error << "Matrices are of diferent size, a.rows() = " << rows() << " and b.rows() = " << a.rows() << endl ;
233
-      if ( cols() != a.cols())
234
-	error << "Matrices are of diferent size, a.cols() = " << cols() << " and b.cols() = " << a.cols() << endl ;
235
+      if ( this->rows() != a.rows() )
236
+	error << "Matrices are of diferent size, a.rows() = " << this->rows() << " and b.rows() = " << a.rows() << endl ;
237
+      if ( this->cols() != a.cols())
238
+	error << "Matrices are of diferent size, a.cols() = " << this->cols() << " and b.cols() = " << a.cols() << endl ;
239
       error.fatal() ;
240
 #endif
241
     }
242
@@ -485,8 +485,8 @@
243
   int i, size;
244
   T *aptr,*sptr ;
245
   aptr = a.m - 1 ;
246
-  sptr = m - 1 ;
247
-  size = rows()*cols() ;
248
+  sptr = this->m - 1 ;
249
+  size = this->rows()*this->cols() ;
250
   for (i = size; i > 0; --i){
251
       *(++sptr) -= *(++aptr) ;
252
   }
253
@@ -742,14 +742,14 @@
254
 template <class T>
255
 T Matrix<T>::trace() const
256
 {
257
-  int size = rows();
258
+  int size = this->rows();
259
   T sum = (T)0;
260
   
261
-  if ( size > cols() )
262
-    size = cols();
263
+  if ( size > this->cols() )
264
+    size = this->cols();
265
   
266
   for (int d = 0; d < size; ++d)
267
-    sum += elem(d,d) ;
268
+    sum += this->elem(d,d) ;
269
   
270
   return sum;
271
 }
272
@@ -770,12 +770,12 @@
273
 template <class T>
274
 Matrix<T> Matrix<T>::herm() const
275
 {
276
-  int i, j, r = cols(), c = rows();
277
+  int i, j, r = this->cols(), c = this->rows();
278
   Matrix<T> adj(r,c);
279
   
280
   for (i = 0; i < r; ++i)
281
     for (j = 0; j < c; ++j)
282
-      adj.elem(i,j) = elem(j,i) ;
283
+      adj.elem(i,j) = this->elem(j,i) ;
284
 
285
   return adj;
286
 
287
@@ -794,11 +794,11 @@
288
 template <class T>
289
 Matrix<T> Matrix<T>::flop() const
290
 {					
291
-  Matrix<T> f(rows(),cols()) ;
292
-  for(int i=rows()-1;i>=0;--i)
293
-    for(int j=cols()-1;j>=0;--j)
294
+  Matrix<T> f(this->rows(),this->cols()) ;
295
+  for(int i=this->rows()-1;i>=0;--i)
296
+    for(int j=this->cols()-1;j>=0;--j)
297
       {
298
-	f(i,j) = elem(i,cols()-j-1);
299
+	f(i,j) = this->elem(i,this->cols()-j-1);
300
       }
301
   return f; 
302
 }
303
@@ -817,13 +817,13 @@
304
 {					
305
   // same as hermitian for real Matrix<T>
306
   int i, j;
307
-  const int& r = cols();
308
-  const int& c = rows();
309
+  const int& r = this->cols();
310
+  const int& c = this->rows();
311
   Matrix<T> adj(r,c);
312
   
313
   for (i = r-1; i >=0; --i)
314
     for (j = c-1; j >=0; --j)
315
-      adj.elem(i,j) = elem(j,i) ;
316
+      adj.elem(i,j) = this->elem(j,i) ;
317
   
318
   
319
   return adj; 
320
@@ -844,7 +844,7 @@
321
 int Matrix<T>::read(char* filename) {
322
   ifstream fin(filename) ;
323
   if(!fin) {
324
-    resize(1,1) ;
325
+    this->resize(1,1) ;
326
     return 0 ;
327
   }
328
   int r,c ;
329
@@ -855,8 +855,8 @@
330
   if(r) return 0 ;
331
   if(!fin.read((char*)&r,sizeof(int))) return 0 ;
332
   if(!fin.read((char*)&c,sizeof(int))) return 0 ;
333
-  resize(r,c) ;
334
-  if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
335
+  this->resize(r,c) ;
336
+  if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
337
 
338
   delete []type ;
339
   return 1 ;
340
@@ -877,11 +877,11 @@
341
 int Matrix<T>::read(char* filename,int r, int c) {
342
   ifstream fin(filename) ;
343
   if(!fin) {
344
-    resize(1,1) ;
345
+    this->resize(1,1) ;
346
     return 0 ;
347
   }
348
-  resize(r,c) ;
349
-  if(!fin.read((char*)m,sizeof(T)*r*c)) return 0 ;
350
+  this->resize(r,c) ;
351
+  if(!fin.read((char*)this->m,sizeof(T)*r*c)) return 0 ;
352
 
353
   return 1 ;
354
 }
355
@@ -904,11 +904,11 @@
356
   if(!fout)
357
     return 0 ;
358
   int r,c ;
359
-  r = rows() ; c = cols() ;
360
+  r = this->rows() ; c = this->cols() ;
361
   if(!fout.write((char*)&"matrix",sizeof(char)*6)) return 0 ;
362
   if(!fout.write((char*)&r,sizeof(int))) return 0 ;
363
   if(!fout.write((char*)&c,sizeof(int))) return 0 ;
364
-  if(!fout.write((char*)m,sizeof(T)*r*c)) return 0 ;
365
+  if(!fout.write((char*)this->m,sizeof(T)*r*c)) return 0 ;
366
   return 1;
367
 }
368
 
369
@@ -927,7 +927,7 @@
370
   ofstream fout(filename) ;
371
   if(!fout)
372
     return 0 ;
373
-  if(!fout.write((char*)m,sizeof(T)*rows()*cols())) return 0 ;
374
+  if(!fout.write((char*)this->m,sizeof(T)*this->rows()*this->cols())) return 0 ;
375
   return 1;
376
 }
377
 
(-)files/patch-matrixMat.cpp (+119 lines)
Added Link Here
1
--- numerical/matrixMat.cpp.orig	Mon May 13 14:07:45 2002
2
+++ numerical/matrixMat.cpp	Thu Nov 30 23:54:37 2006
3
@@ -48,9 +48,9 @@
4
 template <class T>
5
 LUMatrix<T>& LUMatrix<T>::operator=(const LUMatrix<T>& a){
6
   resize(a.rows(),a.cols()) ;
7
-  for(int i=0;i<rows();++i)
8
-    for(int j=0;j<cols();++j)
9
-      elem(i,j) = a(i,j) ;
10
+  for(int i=0;i<this->rows();++i)
11
+    for(int j=0;j<this->cols();++j)
12
+      this->elem(i,j) = a(i,j) ;
13
   pivot_ = a.pivot_ ;
14
   return *this ;
15
 }
16
@@ -90,7 +90,7 @@
17
   //	lu = a;	 must do it by copying or LUFACT will be recursively called !
18
   for(i=0;i<n;++i)
19
     for(j=0;j<n;++j)
20
-      elem(i,j) = a(i,j) ;
21
+      this->elem(i,j) = a(i,j) ;
22
 
23
   errval = 0;
24
   nm1 = n - 1;
25
@@ -129,24 +129,24 @@
26
 	    }
27
 	  pivot_[k] = l;
28
 
29
-	  if ( elem(l,k) != 0.0 )
30
+	  if ( this->elem(l,k) != 0.0 )
31
 	    {			// nonsingular pivot found 
32
 	      if (l != k ){	// interchange needed 
33
 		for (i = k; i < n; i++)
34
 		  {
35
-		    t = elem(l,i) ;
36
-		    elem(l,i) = elem(k,i) ;
37
-		    elem(k,i) = t ; 
38
+		    t = this->elem(l,i) ;
39
+		    this->elem(l,i) = this->elem(k,i) ;
40
+		    this->elem(k,i) = t ; 
41
 		  }
42
 		sign = -sign ;
43
 	      }
44
-	      q =  elem(k,k);	/* scale row */
45
+	      q =  this->elem(k,k);	/* scale row */
46
 	      for (i = kp1; i < n; i++)
47
 		{
48
-		  t = - elem(i,k)/q;
49
-		  elem(i,k) = t;
50
+		  t = - this->elem(i,k)/q;
51
+		  this->elem(i,k) = t;
52
 		  for (j = kp1; j < n; j++)
53
-		    elem(i,j) += t * elem(k,j);
54
+		    this->elem(i,j) += t * this->elem(k,j);
55
 		}
56
 	    }
57
 	  else		/* pivot singular */
58
@@ -156,7 +156,7 @@
59
     }
60
   
61
   pivot_[nm1] = nm1;
62
-  if (elem(nm1,nm1) == 0.0)
63
+  if (this->elem(nm1,nm1) == 0.0)
64
     errval = nm1;  
65
   return *this;
66
 }
67
@@ -196,9 +196,9 @@
68
 */
69
 template <class T>
70
 T LUMatrix<T>::determinant(){
71
-  T det = elem(0,0) ;
72
-  for(int i=1;i<rows();++i)
73
-    det *= elem(i,i) ;
74
+  T det = this->elem(0,0) ;
75
+  for(int i=1;i<this->rows();++i)
76
+    det *= this->elem(i,i) ;
77
   return det * (T)sign ;
78
 }
79
 
80
@@ -253,18 +253,18 @@
81
   T ten;
82
   int i, j, k, l, kb, kp1, nm1, n, coln;
83
 
84
-  if ( rows() != cols() )
85
+  if ( this->rows() != this->cols() )
86
     {
87
 #ifdef USE_EXCEPTION
88
-    throw WrongSize2D(rows(),cols(),0,0) ;
89
+    throw WrongSize2D(this->rows(),this->cols(),0,0) ;
90
 #else
91
       Error error("invm");
92
-      error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
93
+      error << "matrix inverse, not square: " << this->rows() << " by " << this->cols() << endl;
94
       error.fatal();
95
 #endif
96
     }
97
 
98
-  n = coln = rows();
99
+  n = coln = this->rows();
100
 
101
 
102
   inv = *this ;
103
@@ -338,13 +338,13 @@
104
 template <class T>
105
 Matrix<T> LUMatrix<T>::inverse() 
106
 {
107
-  if ( rows() != cols() )
108
+  if ( this->rows() != this->cols() )
109
     {
110
 #ifdef USE_EXCEPTION
111
-      throw WrongSize2D(rows(),cols(),0,0) ;
112
+      throw WrongSize2D(this->rows(),this->cols(),0,0) ;
113
 #else
114
       Error error("invm");
115
-      error << "matrix inverse, not square: " << rows() << " by " << cols() << endl;
116
+      error << "matrix inverse, not square: " << this->rows() << " by " << this->cols() << endl;
117
       error.fatal();
118
 #endif
119
     }
(-)files/patch-matrixRT.cpp (+213 lines)
Added Link Here
1
--- nurbs/matrixRT.cpp.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/matrixRT.cpp	Fri Dec  1 00:43:46 2006
3
@@ -51,13 +51,13 @@
4
   // *this = C.translate(x,y,z)*B.rotate(ax,ay,az) ;
5
   rotate(ax,ay,az) ;
6
 #ifdef COLUMN_ORDER
7
-  m[12] = x ;
8
-  m[13] = y ;
9
-  m[14] = z ;  
10
+  this->m[12] = x ;
11
+  this->m[13] = y ;
12
+  this->m[14] = z ;  
13
 #else
14
-  m[3] = x ;
15
-  m[7] = y ;
16
-  m[11] = z ;
17
+  this->m[3] = x ;
18
+  this->m[7] = y ;
19
+  this->m[11] = z ;
20
 #endif
21
 }
22
 
23
@@ -71,8 +71,8 @@
24
  */
25
 template <class T>
26
 MatrixRT<T>::MatrixRT() : Matrix<T>(4,4) {
27
-  reset(0) ;
28
-  diag(1.0) ;
29
+  this->reset(0) ;
30
+  this->diag(1.0) ;
31
 }
32
 
33
 /*!
34
@@ -144,33 +144,33 @@
35
   t10 = cos(ax);
36
   t13 = t4*t6;
37
 #ifdef COLUMN_ORDER
38
-  m[0] = t1*t2;
39
-  m[4] = -t4*t2;
40
-  m[8] = t6;
41
-  m[12] = 0 ;
42
-  m[1] = t7*t8+t4*t10;
43
-  m[5] = -t13*t8+t1*t10;
44
-  m[9] = -t2*t8;
45
-  m[13] = 0 ;
46
-  m[2] = -t7*t10+t4*t8;
47
-  m[6] = t13*t10+t1*t8;
48
-  m[10] = t2*t10;
49
-  m[14] = m[3] = m[7] = m[11] = 0.0 ;
50
-  m[15] = 1.0 ;
51
+  this->m[0] = t1*t2;
52
+  this->m[4] = -t4*t2;
53
+  this->m[8] = t6;
54
+  this->m[12] = 0 ;
55
+  this->m[1] = t7*t8+t4*t10;
56
+  this->m[5] = -t13*t8+t1*t10;
57
+  this->m[9] = -t2*t8;
58
+  this->m[13] = 0 ;
59
+  this->m[2] = -t7*t10+t4*t8;
60
+  this->m[6] = t13*t10+t1*t8;
61
+  this->m[10] = t2*t10;
62
+  this->m[14] = m[3] = m[7] = m[11] = 0.0 ;
63
+  this->m[15] = 1.0 ;
64
 #else
65
-  m[0] = t1*t2;
66
-  m[1] = -t4*t2;
67
-  m[2] = t6;
68
-  m[3] = 0 ;
69
-  m[4] = t7*t8+t4*t10;
70
-  m[5] = -t13*t8+t1*t10;
71
-  m[6] = -t2*t8;
72
-  m[7] = 0 ;
73
-  m[8] = -t7*t10+t4*t8;
74
-  m[9] = t13*t10+t1*t8;
75
-  m[10] = t2*t10;
76
-  m[11] = m[12] = m[13] = m[14] = 0 ;
77
-  m[15] = 1.0 ;
78
+  this->m[0] = t1*t2;
79
+  this->m[1] = -t4*t2;
80
+  this->m[2] = t6;
81
+  this->m[3] = 0 ;
82
+  this->m[4] = t7*t8+t4*t10;
83
+  this->m[5] = -t13*t8+t1*t10;
84
+  this->m[6] = -t2*t8;
85
+  this->m[7] = 0 ;
86
+  this->m[8] = -t7*t10+t4*t8;
87
+  this->m[9] = t13*t10+t1*t8;
88
+  this->m[10] = t2*t10;
89
+  this->m[11] = this->m[12] = this->m[13] = this->m[14] = 0 ;
90
+  this->m[15] = 1.0 ;
91
 #endif
92
   return *this ;
93
 }
94
@@ -203,33 +203,33 @@
95
   t9 = (T)sin((double)ax);
96
   t17 = t4*t7;
97
 #ifdef COLUMN_ORDER
98
-  m[0] = t1*t2;
99
-  m[4] = -t4*t5+t8*t9;
100
-  m[8] = t4*t9+t8*t5;
101
-  m[12] = 0.0 ;
102
-  m[1] = t4*t2;
103
-  m[5] = t1*t5+t17*t9;
104
-  m[9] = -t1*t9+t17*t5;
105
-  m[13] = 0.0 ;
106
-  m[2] = -t7;
107
-  m[6] = t2*t9;
108
-  m[10] = t2*t5;
109
-  m[14] = m[3] = m[7] = m[11] = 0 ;
110
-  m[15] = 1.0 ;
111
+  this->m[0] = t1*t2;
112
+  this->m[4] = -t4*t5+t8*t9;
113
+  this->m[8] = t4*t9+t8*t5;
114
+  this->m[12] = 0.0 ;
115
+  this->m[1] = t4*t2;
116
+  this->m[5] = t1*t5+t17*t9;
117
+  this->m[9] = -t1*t9+t17*t5;
118
+  this->m[13] = 0.0 ;
119
+  this->m[2] = -t7;
120
+  this->m[6] = t2*t9;
121
+  this->m[10] = t2*t5;
122
+  this->m[14] = m[3] = m[7] = m[11] = 0 ;
123
+  this->m[15] = 1.0 ;
124
 #else
125
-  m[0] = t1*t2;
126
-  m[1] = -t4*t5+t8*t9;
127
-  m[2] = t4*t9+t8*t5;
128
-  m[3] = 0.0 ;
129
-  m[4] = t4*t2;
130
-  m[5] = t1*t5+t17*t9;
131
-  m[6] = -t1*t9+t17*t5;
132
-  m[7] = 0.0 ;
133
-  m[8] = -t7;
134
-  m[9] = t2*t9;
135
-  m[10] = t2*t5;
136
-  m[11] = m[12] = m[13] = m[14] = 0 ;
137
-  m[15] = 1.0 ;
138
+  this->m[0] = t1*t2;
139
+  this->m[1] = -t4*t5+t8*t9;
140
+  this->m[2] = t4*t9+t8*t5;
141
+  this->m[3] = 0.0 ;
142
+  this->m[4] = t4*t2;
143
+  this->m[5] = t1*t5+t17*t9;
144
+  this->m[6] = -t1*t9+t17*t5;
145
+  this->m[7] = 0.0 ;
146
+  this->m[8] = -t7;
147
+  this->m[9] = t2*t9;
148
+  this->m[10] = t2*t5;
149
+  this->m[11] = this->m[12] = this->m[13] = this->m[14] = 0 ;
150
+  this->m[15] = 1.0 ;
151
 #endif
152
   return *this ;
153
 }
154
@@ -245,16 +245,16 @@
155
  */
156
 template <class T>
157
 MatrixRT<T>& MatrixRT<T>::translate(T x, T y, T z){
158
-  reset(0) ;
159
-  diag(1.0) ;
160
+  this->reset(0) ;
161
+  this->diag(1.0) ;
162
 #ifdef COLUMN_ORDER
163
-  m[12] = x ;
164
-  m[13] = y ;
165
-  m[14] = z ;
166
+  this->m[12] = x ;
167
+  this->m[13] = y ;
168
+  this->m[14] = z ;
169
 #else
170
-  m[3] = x ;
171
-  m[7] = y ;
172
-  m[11] = z ;
173
+  this->m[3] = x ;
174
+  this->m[7] = y ;
175
+  this->m[11] = z ;
176
 #endif
177
   return *this ;
178
 }
179
@@ -271,11 +271,11 @@
180
  */
181
 template <class T>
182
 MatrixRT<T>& MatrixRT<T>::scale(T x, T y, T z){
183
-  reset(0) ;
184
-  m[0] = x ;
185
-  m[5] = y ;
186
-  m[10] = z ;
187
-  m[15] = 1.0 ;
188
+  this->reset(0) ;
189
+  this->m[0] = x ;
190
+  this->m[5] = y ;
191
+  this->m[10] = z ;
192
+  this->m[15] = 1.0 ;
193
   return *this ;
194
 }
195
 
196
@@ -416,7 +416,7 @@
197
     error.fatal() ;
198
   }
199
   T *a,*b ;
200
-  a = m-1 ;
201
+  a = this->m-1 ;
202
   b = M[0] - 1 ;
203
   for(int i=0;i<16;++i){
204
     *(++a) = *(++b) ;
205
@@ -435,7 +435,7 @@
206
 template <class T>
207
 MatrixRT<T>& MatrixRT<T>::operator=(const MatrixRT<T>& M) {
208
   T *a,*b ;
209
-  a = m-1 ;
210
+  a = this->m-1 ;
211
   b = M.m - 1 ;
212
   for(int i=0;i<16;++i){
213
     *(++a) = *(++b) ;
(-)files/patch-nurbs.cpp (+42 lines)
Added Link Here
1
--- nurbs/nurbs.cpp.orig	Fri May 24 10:25:49 2002
2
+++ nurbs/nurbs.cpp	Fri Dec  1 00:22:20 2006
3
@@ -28,7 +28,7 @@
4
 #include <nurbsS.h>
5
 #include "integrate.h"
6
 
7
-#include <malloc.h>
8
+#include <stdlib.h>
9
 
10
 /*!
11
  */
12
@@ -391,9 +391,9 @@
13
   T du,dv ;
14
   // compute a coarse distance for the curve
15
   Point_nD<T,N> a,b,c ;
16
-  a = pointAt(0.0) ;
17
-  b = pointAt(0.5) ;
18
-  c = pointAt(1.0) ;
19
+  a = this->pointAt(0.0) ;
20
+  b = this->pointAt(0.5) ;
21
+  c = this->pointAt(1.0) ;
22
 
23
   T distance = norm(b-a) + norm(c-b) ;
24
 
25
@@ -5202,7 +5202,7 @@
26
 */
27
 template <class T, int N>
28
 BasicList<Point_nD<T,N> > NurbsCurve<T,N>::tesselate(T tolerance,BasicList<T> *uk) const {
29
-  BasicList<Point_nD<T,N> > list,list2 ;
30
+  BasicList<Point_nD<T,N> > list, list2 ;
31
 
32
   NurbsCurveArray<T,N> ca ;
33
   decompose(ca) ;
34
@@ -5249,7 +5249,7 @@
35
   }
36
   else{
37
     for(int i=0;i<ca.n();++i){
38
-      list2 = ca[i].tesselate(tolerance,uk) ;
39
+      list2 = ca[i].tesselate(tolerance,uk).by_ref() ;
40
 
41
       // remove the last point from the list to elliminate
42
       list.erase((BasicNode<Point_nD<T,N> >*)list.last()) ;
(-)files/patch-nurbsS.cpp (+68 lines)
Added Link Here
1
--- nurbs/nurbsS.cpp.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/nurbsS.cpp	Fri Dec  1 00:32:26 2006
3
@@ -30,7 +30,7 @@
4
 #include "integrate.h"
5
 
6
 #ifdef USING_VCC
7
-#include <malloc.h>
8
+#include <stdlib.h>
9
 #endif
10
 
11
 /*!
12
@@ -3762,12 +3762,12 @@
13
   // we use and angle of 36 to view the object
14
   // and position the rest according to this.
15
   Point_nD<T,N> minP, maxP ;
16
-  minP.x() = extremum(1,coordX) ;
17
-  minP.y() = extremum(1,coordY) ;
18
-  minP.z() = extremum(1,coordZ) ;
19
-  maxP.x() = extremum(0,coordX) ;
20
-  maxP.y() = extremum(0,coordY) ;
21
-  maxP.z() = extremum(0,coordZ) ;
22
+  minP.x() = this->extremum(1,coordX) ;
23
+  minP.y() = this->extremum(1,coordY) ;
24
+  minP.z() = this->extremum(1,coordZ) ;
25
+  maxP.x() = this->extremum(0,coordX) ;
26
+  maxP.y() = this->extremum(0,coordY) ;
27
+  maxP.z() = this->extremum(0,coordZ) ;
28
 
29
   Point_nD<T,N> lookAt  ;
30
   lookAt.x() = (minP.x()+maxP.x())/2.0 ;
31
@@ -3860,12 +3860,12 @@
32
   // we use and angle of 36 to view the object
33
   // and position the rest according to this.
34
   Point_nD<T,N> minP, maxP ;
35
-  minP.x() = extremum(1,coordX) ;
36
-  minP.y() = extremum(1,coordY) ;
37
-  minP.z() = extremum(1,coordZ) ;
38
-  maxP.x() = extremum(0,coordX) ;
39
-  maxP.y() = extremum(0,coordY) ;
40
-  maxP.z() = extremum(0,coordZ) ;
41
+  minP.x() = this->extremum(1,coordX) ;
42
+  minP.y() = this->extremum(1,coordY) ;
43
+  minP.z() = this->extremum(1,coordZ) ;
44
+  maxP.x() = this->extremum(0,coordX) ;
45
+  maxP.y() = this->extremum(0,coordY) ;
46
+  maxP.z() = this->extremum(0,coordZ) ;
47
 
48
   Point_nD<T,N> lookAt  ;
49
   lookAt.x() = (minP.x()+maxP.x())/2.0 ;
50
@@ -4045,12 +4045,12 @@
51
   }
52
 
53
   Point_nD<T,N> minP, maxP ;
54
-  minP.x() = extremum(1,coordX) ;
55
-  minP.y() = extremum(1,coordY) ;
56
-  minP.z() = extremum(1,coordZ) ;
57
-  maxP.x() = extremum(0,coordX) ;
58
-  maxP.y() = extremum(0,coordY) ;
59
-  maxP.z() = extremum(0,coordZ) ;
60
+  minP.x() = this->extremum(1,coordX) ;
61
+  minP.y() = this->extremum(1,coordY) ;
62
+  minP.z() = this->extremum(1,coordZ) ;
63
+  maxP.x() = this->extremum(0,coordX) ;
64
+  maxP.y() = this->extremum(0,coordY) ;
65
+  maxP.z() = this->extremum(0,coordZ) ;
66
 
67
   Point_nD<T,N> lookAt  ;
68
   lookAt.x() = (minP.x()+maxP.x())/2.0 ;
(-)files/patch-nurbsS_sp.cpp (+196 lines)
Added Link Here
1
--- nurbs/nurbsS_sp.cpp.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/nurbsS_sp.cpp	Fri Dec  1 00:52:04 2006
3
@@ -43,7 +43,7 @@
4
 */
5
 template <class T, int N>
6
 void NurbsSurfaceSP<T,N>::updateMaxU() {
7
-  if(degU>3){
8
+  if(this->degU>3){
9
 #ifdef USE_EXCEPTION
10
     throw NurbsInputError();
11
 #else
12
@@ -53,12 +53,12 @@
13
 #endif
14
   }
15
   else{
16
-    maxU.resize(P.rows()) ;
17
-    maxAtU_.resize(P.rows()) ;
18
-    for(int i=0;i<P.rows();++i){
19
-      if(!maxInfluence(i,U,degU,maxAtU_[i]))
20
+    maxU.resize(this->P.rows()) ;
21
+    maxAtU_.resize(this->P.rows()) ;
22
+    for(int i=0;i<this->P.rows();++i){
23
+      if(!maxInfluence(i,this->U,this->degU,maxAtU_[i]))
24
 	cerr << "Problem in maxInfluence U!\n" ;
25
-      maxU[i] = nurbsBasisFun(maxAtU_[i],i,degU,U) ;
26
+      maxU[i] = nurbsBasisFun(maxAtU_[i],i,this->degU,this->U) ;
27
     }
28
     
29
   }
30
@@ -78,7 +78,7 @@
31
 */
32
 template <class T, int N>
33
 void NurbsSurfaceSP<T,N>::updateMaxV() {
34
-  if(degV>3){
35
+  if(this->degV>3){
36
 #ifdef USE_EXCEPTION
37
     throw NurbsInputError();
38
 #else
39
@@ -88,12 +88,12 @@
40
 #endif
41
   }
42
   else{
43
-    maxV.resize(P.cols()) ;
44
-    maxAtV_.resize(P.cols()) ;
45
-    for(int i=0;i<P.cols();++i){
46
-      if(!maxInfluence(i,V,degV,maxAtV_[i]))
47
+    maxV.resize(this->P.cols()) ;
48
+    maxAtV_.resize(this->P.cols()) ;
49
+    for(int i=0;i<this->P.cols();++i){
50
+      if(!maxInfluence(i,this->V,this->degV,maxAtV_[i]))
51
 	cerr << "Problem in maxInfluence V!\n" ;
52
-      maxV[i] = nurbsBasisFun(maxAtV_[i],i,degV,V) ;
53
+      maxV[i] = nurbsBasisFun(maxAtV_[i],i,this->degV,this->V) ;
54
     }
55
     
56
   }
57
@@ -124,11 +124,11 @@
58
 NurbsSurfaceSP<T,N> NurbsSurfaceSP<T,N>::generateParallel(T d) const {
59
   NurbsSurfaceSP<T,N> p(*this) ;
60
 
61
-  Vector< Point_nD<T,N> > offset(P.rows()*P.cols()) ;
62
-  Vector<T> ur(P.rows()*P.cols()) ;
63
-  Vector<T> vr(P.rows()*P.cols()) ;
64
-  Vector_INT Du(P.rows()*P.cols()) ;
65
-  Vector_INT Dv(P.rows()*P.cols()) ;
66
+  Vector< Point_nD<T,N> > offset(this->P.rows()*this->P.cols()) ;
67
+  Vector<T> ur(this->P.rows()*this->P.cols()) ;
68
+  Vector<T> vr(this->P.rows()*this->P.cols()) ;
69
+  Vector_INT Du(this->P.rows()*this->P.cols()) ;
70
+  Vector_INT Dv(this->P.rows()*this->P.cols()) ;
71
 
72
   Du.reset(0) ;
73
   Dv.reset(0) ;
74
@@ -137,8 +137,8 @@
75
 
76
   no = 0 ;
77
 
78
-  for(i=0;i<P.rows();++i)
79
-    for(j=0;j<P.cols();++j){
80
+  for(i=0;i<this->P.rows();++i)
81
+    for(j=0;j<this->P.cols();++j){
82
       Point_nD<T,N> norm ;
83
       norm = normal(maxAtU_[i],maxAtV_[j]) ;
84
       if(norm.x() == T(0) && 
85
@@ -155,19 +155,19 @@
86
 	  norm /= T(2) ;
87
 	  ok = 1 ;
88
 	}
89
-	if(i==P.rows()-1 && j==P.cols()-1){
90
+	if(i==this->P.rows()-1 && j==this->P.cols()-1){
91
 	  norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
92
 	  norm += normal(maxAtU_[i],maxAtV_[j]-delta) ;
93
 	  norm /= T(2) ;
94
 	  ok = 1 ;
95
 	}
96
-	if(i==0 && j==P.cols()-1){
97
+	if(i==0 && j==this->P.cols()-1){
98
 	  norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
99
 	  norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
100
 	  norm /= T(2) ;
101
 	  ok = 1 ;
102
 	}
103
-	if(i==P.rows()-1 && j==0){
104
+	if(i==this->P.rows()-1 && j==0){
105
 	  norm = normal(maxAtU_[i]-delta,maxAtV_[j]) ;
106
 	  norm += normal(maxAtU_[i],maxAtV_[j]+delta) ;
107
 	  norm /= T(2) ;
108
@@ -178,7 +178,7 @@
109
 	  while(norm.x() == T(0) && 
110
 	     norm.y() == T(0) &&
111
 	     norm.z() == T(0)){
112
-	    if( nt*d >(U[U.n()-1]-U[0])){
113
+	    if( nt*d >(this->U[this->U.n()-1]-this->U[0])){
114
 #ifdef USE_EXCEPTION
115
 	      throw NurbsComputationError();
116
 #else
117
@@ -188,12 +188,12 @@
118
 #endif
119
 	    }
120
 	    T u1,u2,v1,v2 ;
121
-	    if(i==0 || i==P.rows()-1){
122
+	    if(i==0 || i==this->P.rows()-1){
123
 	      u1 = u2 = maxAtU_[i] ;
124
 	      v1 = maxAtV_[j]+ nt*delta ;
125
 	      v2 = maxAtV_[j]- nt*delta ;
126
-	      if(v1>V[V.n()-1]) v1 = V[V.n()-1] ;
127
-	      if(v2<V[0]) v2 = V[0] ;
128
+	      if(v1>this->V[this->V.n()-1]) v1 = this->V[this->V.n()-1] ;
129
+	      if(v2<this->V[0]) v2 = this->V[0] ;
130
 	      norm = normal(u1,v1);
131
 	      norm += normal(u2,v2) ;
132
 	      norm /= 2 ; 
133
@@ -202,8 +202,8 @@
134
 	      u1 = maxAtU_[i]- nt*delta ;
135
 	      u2 = maxAtU_[i]+ nt*delta ;
136
 	      v1 = v2 = maxAtV_[j] ;
137
-	      if(u1 < U[0]) u1 = U[0] ;
138
-	      if(u2 > U[U.n()-1]) u2 = U[U.n()-1] ;
139
+	      if(u1 < this->U[0]) u1 = this->U[0] ;
140
+	      if(u2 > this->U[this->U.n()-1]) u2 = this->U[this->U.n()-1] ;
141
 
142
 	      T u3,v3 ;
143
 	      u3 = maxAtU_[i] ;
144
@@ -212,8 +212,8 @@
145
 	      else
146
 		v3 = maxAtV_[j]- nt*delta ;
147
 
148
-	      if(v3<V[0]) v3 = V[0] ;
149
-	      if(v3>V[V.n()-1]) v3 = V[V.n()-1] ;
150
+	      if(v3<this->V[0]) v3 = this->V[0] ;
151
+	      if(v3>this->V[this->V.n()-1]) v3 = this->V[this->V.n()-1] ;
152
 
153
 	      norm = normal(u1,v1);
154
 	      norm += normal(u2,v2) ;
155
@@ -263,13 +263,13 @@
156
 
157
   int sizeU, sizeV ;
158
 
159
-  sizeU = 2*degU+3 ; 
160
-  if(i-degU-1<0) sizeU += i-degU-1 ; 
161
-  if(i+degU+1>=P.rows()) sizeU -= i+degU+1-P.rows() ;
162
-
163
-  sizeV = 2*degV+3 ;
164
-  if(j-degV-1<0) sizeV += j-degV-1 ; 
165
-  if(j+degV+1>=P.cols()) sizeV -= j+degV+1-P.cols() ;
166
+  sizeU = 2*this->degU+3 ; 
167
+  if(i-this->degU-1<0) sizeU += i-this->degU-1 ; 
168
+  if(i+this->degU+1>=this->P.rows()) sizeU -= i+this->degU+1-this->P.rows() ;
169
+
170
+  sizeV = 2*this->degV+3 ;
171
+  if(j-this->degV-1<0) sizeV += j-this->degV-1 ; 
172
+  if(j+this->degV+1>=this->P.cols()) sizeV -= j+this->degV+1-this->P.cols() ;
173
   
174
   Vector<T> u(sizeU) ;
175
   Vector<T> v(sizeV) ;
176
@@ -280,16 +280,16 @@
177
   int n=0;
178
   int nu = 0 ;
179
   int nv = 0 ; 
180
-  for(int k=i-degU-1;k<=i+degU+1;++k){
181
+  for(int k=i-this->degU-1;k<=i+this->degU+1;++k){
182
     if(k<0)
183
       continue ;
184
-    if(k>=P.rows())
185
+    if(k>=this->P.rows())
186
       break ; 
187
     nv = 0 ;
188
-    for(int l=j-degV-1;l<=j+degV+1;++l){
189
+    for(int l=j-this->degV-1;l<=j+this->degV+1;++l){
190
       if(l<0)
191
 	continue ;
192
-      if(l>=P.cols())
193
+      if(l>=this->P.cols())
194
 	break ; 
195
       if( k == i && j==l){
196
 	pts[n].x() = a.x() ; 
(-)files/patch-nurbsS_sp.h (+11 lines)
Added Link Here
1
--- nurbs/nurbsS_sp.h.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/nurbsS_sp.h	Fri Dec  1 00:48:44 2006
3
@@ -78,7 +78,7 @@
4
 
5
 
6
   void modSurfCPby(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point by a value
7
-    { P(i,j) +=  a / (maxU[i]*maxV[j]) ;  }
8
+    { this->P(i,j) +=  a / (maxU[i]*maxV[j]) ;  }
9
   void modSurfCP(int i, int j, const HPoint_nD<T,N>& a) //!< Moves a surface point to a value
10
     { modSurfCPby(i,j,a-surfP(i,j)) ;  }
11
 
(-)files/patch-nurbsSub.cpp (+20 lines)
Added Link Here
1
--- nurbs/nurbsSub.cpp.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/nurbsSub.cpp	Fri Dec  1 01:04:05 2006
3
@@ -904,7 +904,7 @@
4
   
5
   /* Allocate storage for the grid of points generated */
6
   
7
-  CHECK( pts = new (SurfSample<T>*)[Granularity+1]);
8
+  CHECK( pts = new SurfSample<T>* [Granularity+1]);
9
   CHECK( pts[0] = new SurfSample<T>[(Granularity+1)*(Granularity+1)]);
10
   
11
   for (i = 1; i <= Granularity; i++)
12
@@ -983,7 +983,7 @@
13
   
14
   if (! *alpha)	/* Must allocate alpha */
15
     {
16
-      CHECK( *alpha = new (T*)[k+1]);
17
+      CHECK( *alpha = new T* [k+1]);
18
       for (i = 0; i <= k; i++)
19
 	CHECK( (*alpha)[i] = new T[(m + n + 1)]);
20
     }
(-)files/patch-nurbs_sp.cpp (+62 lines)
Added Link Here
1
--- nurbs/nurbs_sp.cpp.orig	Mon May 13 14:07:46 2002
2
+++ nurbs/nurbs_sp.cpp	Fri Dec  1 00:46:20 2006
3
@@ -41,7 +41,7 @@
4
 */
5
 template <class T, int N>
6
 void NurbsCurveSP<T,N>::updateMaxU() {
7
-  if(deg_>3){
8
+  if(this->deg_>3){
9
 #ifdef USE_EXCEPTION
10
     throw NurbsInputError();
11
 #else
12
@@ -51,10 +51,10 @@
13
 #endif
14
   }
15
   else{
16
-    maxU.resize(P.n()) ;
17
-    maxAt_.resize(P.n()) ;
18
-    for(int i=0;i<P.n();++i){
19
-      if(!maxInfluence(i,U,deg_,maxAt_[i]))
20
+    maxU.resize(this->P.n()) ;
21
+    maxAt_.resize(this->P.n()) ;
22
+    for(int i=0;i<this->P.n();++i){
23
+      if(!maxInfluence(i,this->U,this->deg_,maxAt_[i]))
24
 	cerr << "Problem in maxInfluence U!\n" ;
25
       if(i>0)
26
 	if(maxAt_[i]<maxAt_[i-1]){
27
@@ -63,13 +63,13 @@
28
 #else
29
 	  Error error("Error updating maxU");
30
 	  error << "HUGE ERROR!\n" ;
31
-	  error << "Knot = " << U << endl ;
32
+	  error << "Knot = " << this->U << endl ;
33
 	  error << " i = " << i << endl ;
34
-	  error << " deg = " << deg_ << endl ;
35
+	  error << " deg = " << this->deg_ << endl ;
36
 	  error.fatal() ; 
37
 #endif
38
 	}
39
-      maxU[i] = basisFun(maxAt_[i],i,deg_) ;
40
+      maxU[i] = basisFun(maxAt_[i],i,this->deg_) ;
41
     }
42
     
43
   }
44
@@ -96,14 +96,14 @@
45
 */
46
 template <class T, int N>
47
 void NurbsCurveSP<T,N>::modOnlySurfCPby(int i, const HPoint_nD<T,N>& a){
48
-  Vector<T> u(2*deg_+3) ;
49
-  Vector< Point_nD<T,N> > pts(2*deg_+3) ; 
50
+  Vector<T> u(2*this->deg_+3) ;
51
+  Vector< Point_nD<T,N> > pts(2*this->deg_+3) ; 
52
 
53
   int n=0;
54
-  for(int j=i-deg_-1;j<=i+deg_+1;++j){
55
+  for(int j=i-this->deg_-1;j<=i+this->deg_+1;++j){
56
     if(j<0)
57
       continue ;
58
-    if(j>=P.n())
59
+    if(j>=this->P.n())
60
       break ; 
61
     u[n] = maxAt_[j] ;
62
     if( j == i){
(-)files/patch-nurbs_sp.h (+11 lines)
Added Link Here
1
--- nurbs/nurbs_sp.h.orig	Fri May 17 11:24:21 2002
2
+++ nurbs/nurbs_sp.h	Fri Dec  1 00:45:10 2006
3
@@ -72,7 +72,7 @@
4
   int read(ifstream &fin) ;
5
 
6
   void modSurfCPby(int i, const HPoint_nD<T,N>& a) 
7
-    { P[i] +=  a / maxU[i] ;  }
8
+    { this->P[i] +=  a / maxU[i] ;  }
9
   void modSurfCP(int i, const HPoint_nD<T,N>& a) 
10
     { modSurfCPby(i,a-surfP(i)) ;  }
11
 
(-)files/patch-vector.cpp (+255 lines)
Added Link Here
1
--- matrix/vector.cpp.orig	Mon May 13 14:07:45 2002
2
+++ matrix/vector.cpp	Thu Nov 30 23:49:51 2006
3
@@ -51,16 +51,16 @@
4
   if(this==&b)
5
     return *this ;
6
 
7
-  if ( n() != b.n())
8
+  if ( this->n() != b.n())
9
     {
10
       resize(b.n()) ;
11
     }
12
 
13
-  sze = b.n() ;
14
+  this->sze = b.n() ;
15
   T *pa, *pb ;
16
-  pa = x-1 ;
17
+  pa = this->x-1 ;
18
   pb = b.x-1 ;
19
-  for(int i=n();i>0;--i){
20
+  for(int i=this->n();i>0;--i){
21
     *(++pa) = *(++pb) ;
22
   }
23
   return *this;
24
@@ -79,13 +79,13 @@
25
 template <class T>
26
 Vector<T>& Vector<T>::operator=(const BasicArray<T> &b)
27
 {
28
-  if ( size() != b.size())
29
+  if ( this->size() != b.size())
30
     {
31
       resize(b.size()) ;
32
     }
33
   T *ptr ;
34
-  ptr = x - 1 ;
35
-  for(int i=size()-1;i>=0;--i)
36
+  ptr = this->x - 1 ;
37
+  for(int i=this->size()-1;i>=0;--i)
38
      *(++ptr) = b[i] ;
39
 
40
   return *this;
41
@@ -105,9 +105,9 @@
42
 template <class T>
43
 T Vector<T>::operator=(const T d)
44
 {
45
-  const int sz = size(); 
46
+  const int sz = this->size(); 
47
   T *ptr ;
48
-  ptr = x-1 ;
49
+  ptr = this->x-1 ;
50
   for (int i = sz; i > 0; --i)
51
     *(++ptr) = d ;
52
 
53
@@ -130,19 +130,19 @@
54
 template <class T>
55
 Vector<T>& Vector<T>::operator+=(const Vector<T> &a)
56
 {
57
-  if ( a.size() != size())
58
+  if ( a.size() != this->size())
59
     {
60
 #ifdef USE_EXCEPTION
61
-      throw WrongSize(size(),a.size()) ;
62
+      throw WrongSize(this->size(),a.size()) ;
63
 #else
64
       Error error("Vector<T>::operator+=(Vector<T>&)");
65
-      error << "Vector<T> a += Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
66
+      error << "Vector<T> a += Vector<T> b different sizes, a = " << this->size() << ", b = " << a.size() ;
67
       error.fatal() ;
68
 #endif
69
     }
70
-  const int sz = size();
71
+  const int sz = this->size();
72
   T *ptr,*aptr ;
73
-  ptr = x-1 ;
74
+  ptr = this->x-1 ;
75
   aptr = a.x-1 ;
76
   for (int i = sz; i >0; --i)
77
     *(++ptr) += *(++aptr) ;
78
@@ -165,20 +165,20 @@
79
 template <class T>
80
 Vector<T>& Vector<T>::operator-=(const Vector<T> &a)
81
 {
82
-  if ( a.size() != size())
83
+  if ( a.size() != this->size())
84
     {
85
 #ifdef USE_EXCEPTION
86
-      throw WrongSize(size(),a.size()) ;
87
+      throw WrongSize(this->size(),a.size()) ;
88
 #else
89
       Error error("Vector<T>::operator-=(Vector<T>&)");
90
-      error << "Vector<T> a -= Vector<T> b different sizes, a = " << size() << ", b = " << a.size() ;
91
+      error << "Vector<T> a -= Vector<T> b different sizes, a = " << this->size() << ", b = " << a.size() ;
92
       error.fatal() ;
93
 #endif
94
     }
95
   
96
-  const int sz = size(); 
97
+  const int sz = this->size(); 
98
   T *ptr,*aptr ;
99
-  ptr = x-1 ;
100
+  ptr = this->x-1 ;
101
   aptr = a.x-1 ;
102
   for (int i = sz; i > 0; --i)
103
     *(++ptr) -= *(++aptr) ;
104
@@ -391,7 +391,7 @@
105
     }
106
 
107
   T *aptr,*bptr ;
108
-  aptr = &x[i]-1 ;
109
+  aptr = &this->x[i]-1 ;
110
   bptr = b.x-1 ;
111
   for ( int j = b.rows(); j > 0; --j)
112
       *(++aptr) = *(++bptr) ;
113
@@ -429,7 +429,7 @@
114
 
115
   Vector<T> subvec(l) ;
116
   T *aptr, *bptr ;
117
-  aptr = &x[i] - 1 ;
118
+  aptr = &this->x[i] - 1 ;
119
   bptr = subvec.x -1 ;
120
   for ( int j = l; j > 0; --j)
121
     *(++bptr) = *(++aptr) ;
122
@@ -449,12 +449,12 @@
123
 */
124
 template <class T>
125
 int Vector<T>::minIndex() const {
126
-  T min = x[0] ;
127
+  T min = this->x[0] ;
128
   int index = 0 ;
129
 
130
-  for(int i=1;i<n();i++){
131
-    if(x[i]<=min){
132
-      min = x[i] ;
133
+  for(int i=1;i<this->n();i++){
134
+    if(this->x[i]<=min){
135
+      min = this->x[i] ;
136
       index = i ;
137
     }
138
   }
139
@@ -523,12 +523,12 @@
140
   T a ;
141
   T *v1,*v2  ;
142
 
143
-  ir = sze-1 ;
144
+  ir = this->sze-1 ;
145
   l = 0 ;
146
   
147
   while(1){
148
     if(ir-l<M){ // perform an insertion sort when the array is small enough
149
-      v1 = &x[l] ;
150
+      v1 = &this->x[l] ;
151
       for(j=l+1;j<=ir;++j){
152
 	a = *(++v1) ;
153
 	v2 = v1 ;
154
@@ -547,31 +547,31 @@
155
     }
156
     else{
157
       k=(l+ir) >> 1 ;
158
-      swap(x[k],x[l+1]) ;
159
-      if(x[l+1] > x[ir]){
160
-	swap(x[l+1],x[ir]) ;
161
+      swap(this->x[k],this->x[l+1]) ;
162
+      if(this->x[l+1] > this->x[ir]){
163
+	swap(this->x[l+1],this->x[ir]) ;
164
       }
165
-      if(x[l]> x[ir]){
166
-	swap(x[l],x[ir]) ;
167
+      if(this->x[l]> this->x[ir]){
168
+	swap(this->x[l],this->x[ir]) ;
169
       }
170
-      if(x[l+1] > x[l]){
171
-	swap(x[l+1],x[l]) ;
172
+      if(this->x[l+1] > this->x[l]){
173
+	swap(this->x[l+1],this->x[l]) ;
174
       }
175
       i=l+1 ;
176
       j=ir ;
177
-      a=x[l] ;
178
-      v1 = &x[i] ;
179
-      v2 = &x[j] ;
180
+      a=this->x[l] ;
181
+      v1 = &this->x[i] ;
182
+      v2 = &this->x[j] ;
183
       while(1){
184
 	while(*v1 < a) { ++i ; ++v1 ; }
185
 	while(*v2 > a) { --j ; --v2 ; }
186
 	if(j<i) break ;
187
 	if(*v1 == *v2)  // both are equal to a...
188
 	  break ;
189
-	swap(x[i],x[j]) ;
190
+	swap(this->x[i],this->x[j]) ;
191
       }
192
-      x[l] = x[j] ;
193
-      x[j] = a ;
194
+      this->x[l] = this->x[j] ;
195
+      this->x[j] = a ;
196
       jstack += 2 ;
197
       if(jstack>=Nstack){
198
 	istack.resize(istack.n()+Nstack) ; // increase the vector size
199
@@ -618,10 +618,10 @@
200
   int jstack=0;
201
   T a ;
202
 
203
-  ir = sze-1 ;
204
+  ir = this->sze-1 ;
205
   l = 0 ;
206
   
207
-  index.resize(sze) ;
208
+  index.resize(this->sze) ;
209
   for(i=0;i<index.n();++i)
210
     index[i] = i ;
211
 
212
@@ -629,9 +629,9 @@
213
     if(ir-l<M){ // perform an insertion sort when the array is small enough
214
       for(j=l+1;j<=ir;++j){
215
 	indext = index[j] ;
216
-	a = x[indext] ;
217
+	a = this->x[indext] ;
218
 	for(i=j-1;i>=0;--i){
219
-	  if(x[index[i]] <= a) break ;
220
+	  if(this->x[index[i]] <= a) break ;
221
 	  index[i+1] = index[i] ;
222
 	}
223
 	index[i+1] = indext ;
224
@@ -643,24 +643,24 @@
225
     else{
226
       k=(l+ir) >> 1 ;
227
       swap(index[k],index[l+1]) ;
228
-      if(x[index[l+1]] > x[index[ir]]){
229
+      if(this->x[index[l+1]] > this->x[index[ir]]){
230
 	swap(index[l+1],index[ir]) ;
231
       }
232
-      if(x[index[l]]> x[index[ir]]){
233
+      if(this->x[index[l]]> this->x[index[ir]]){
234
 	swap(index[l],index[ir]) ;
235
       }
236
-      if(x[index[l+1]] > x[index[l]]){
237
+      if(this->x[index[l+1]] > this->x[index[l]]){
238
 	swap(index[l+1],index[l]) ;
239
       }
240
       i=l+1 ;
241
       j=ir ;
242
       indext = index[l] ;
243
-      a=x[indext] ;
244
+      a=this->x[indext] ;
245
       while(1){
246
-	while(x[index[i]] < a) { ++i ; }
247
-	while(x[index[j]] > a) { --j ; }
248
+	while(this->x[index[i]] < a) { ++i ; }
249
+	while(this->x[index[j]] > a) { --j ; }
250
 	if(j<i) break ;
251
-	if(x[index[i]] == x[index[j]])
252
+	if(this->x[index[i]] == this->x[index[j]])
253
 	  break ;
254
 	swap(index[i],index[j]) ;
255
       }
(-)files/patch-vector.h (+11 lines)
Added Link Here
1
--- matrix/vector.h.orig	Mon May 13 14:07:45 2002
2
+++ matrix/vector.h	Thu Nov 30 23:29:02 2006
3
@@ -69,7 +69,7 @@
4
   {
5
   public:
6
     int rows() const //!< a reference to the size of the vector
7
-      { return sze ;}
8
+      { return this->sze ;}
9
     Vector() : BasicArray<T>(1) {} //!< Basic constructor
10
     Vector(const int r) : BasicArray<T>(r) {}
11
     Vector(const Vector<T>& v) : BasicArray<T>(v) {}

Return to bug 106117