#include <arrayc.h>
Collaboration diagram for GridC< Typ >:

Public Methods | |
| GridC () | |
| GridC (long l, long b, long r, long t, const Typ &bl) | |
| ~GridC () | |
| const Typ & | get (long i, long j) const |
| void | set (long n, long m, const Typ &t) |
| void | SetBlankAndClear (const Typ &bl) |
Protected Attributes | |
| Typ | m_blank |
| long | m_left |
| long | m_bottom |
| long | m_right |
| long | m_top |
| long | m_width |
| long | m_height |
| Typ ** | m_array |
| short | m_bFirstSet |
|
|||||||||
|
Definition at line 324 of file arrayc.h. References GridC< Typ >::m_array, GridC< Typ >::m_blank, GridC< Typ >::m_bottom, GridC< Typ >::m_height, GridC< Typ >::m_left, GridC< Typ >::m_right, GridC< Typ >::m_top, and GridC< Typ >::m_width.
|
|
||||||||||||||||||||||||||||
|
Definition at line 341 of file arrayc.h. References GridC< Typ >::m_array, GridC< Typ >::m_blank, GridC< Typ >::m_bottom, GridC< Typ >::m_height, GridC< Typ >::m_left, GridC< Typ >::m_right, GridC< Typ >::m_top, and GridC< Typ >::m_width.
00342 {
00343 int i,j;
00344 m_left=l;
00345 m_right=r;
00346 m_top=t;
00347 m_bottom=b;
00348 m_width=r-l+1;assert(m_width>0);
00349 m_height=t-b+1;assert(m_height>0);
00350 m_blank=bl;
00351 m_array=new Typ* [m_width];
00352 for(i=0;i<m_width;i++){
00353 m_array[i]=new Typ[m_height];
00354 for(j=0;j<m_height;j++){m_array[i][j]=m_blank;}
00355 }
00356 }
|
|
|||||||||
|
Definition at line 358 of file arrayc.h. References GridC< Typ >::m_array, and GridC< Typ >::m_width.
|
|
||||||||||||||||
|
Definition at line 365 of file arrayc.h. References GridC< Typ >::m_array, GridC< Typ >::m_blank, GridC< Typ >::m_bottom, GridC< Typ >::m_left, GridC< Typ >::m_right, and GridC< Typ >::m_top.
|
|
||||||||||||||||||||
|
Definition at line 371 of file arrayc.h. References GridC< Typ >::m_array, GridC< Typ >::m_blank, GridC< Typ >::m_bottom, GridC< Typ >::m_height, GridC< Typ >::m_left, GridC< Typ >::m_right, GridC< Typ >::m_top, and GridC< Typ >::m_width.
00371 {
00372 int i,j;
00373 if( ((n<m_left)||(n>m_right))&&(m<=m_top)&&(m>=m_bottom) ){
00374 Typ **ablage;
00375 long leftOld=m_left;
00376 //long rightOld=m_right;
00377 long widthOld=m_width;
00378 long s1,s2;
00379 ablage=m_array;
00380 if(n<m_left){m_left=n;s1=leftOld-n;s2=widthOld;}else{m_right=n;s1=0;s2=0;}
00381 m_width=m_right-m_left+1;
00382 m_array = new Typ* [m_width];
00383 for(i=0;i<widthOld;i++){m_array[i+s1]=ablage[i];}
00384 for(i=widthOld;i<m_width;i++){
00385 m_array[i]=new Typ[m_height];
00386 for(j=0;j<m_height;j++){m_array[i-s2][j]=m_blank;}
00387 }
00388 delete ablage;
00389 }else{
00390 if( ((m>m_top)||(m<m_bottom))&&(n>=m_left)&&(n<=m_right) ){
00391 long heightOld=m_height;
00392 //long topOld=m_top;
00393 long bottomOld=m_bottom;
00394 long s1,s2;
00395 if(m<m_bottom){m_bottom=m;s1=bottomOld-m;s2=heightOld;}else{m_top=m;s1=0;s2=0;}
00396 m_height=m_top-m_bottom+1;
00397 for(i=0;i<m_width;i++){
00398 Typ *ablage;
00399 ablage=m_array[i];
00400 m_array[i]= new Typ[m_height];
00401 for(j=0;j<heightOld;j++){m_array[i][j+s1]=ablage[j];}
00402 for(j=heightOld;j<m_height;j++){m_array[i][j-s2]=m_blank;}
00403 delete [] ablage;
00404 }
00405 }else{
00406 if((m>m_top)||(m<m_bottom)||(n<m_left)||(n>m_right)){
00407 long leftOld=m_left;
00408 long bottomOld=m_bottom;
00409 long widthOld=m_width;
00410 long heightOld=m_height;
00411 Typ **ablage;
00412 ablage=m_array;
00413 if(m>m_top){m_top=m;}
00414 if(m<m_bottom){m_bottom=m;}
00415 if(n<m_left){m_left=n;}
00416 if(n>m_right){m_right=n;}
00417 m_width=m_right-m_left+1;
00418 m_height=m_top-m_bottom+1;
00419 m_array = new Typ* [m_width];
00420 for(i=0;i<m_width;i++){
00421 m_array[i]=new Typ[m_height];
00422 for(j=0;j<m_height;j++){m_array[i][j]=m_blank;}
00423 }
00424 for(i=0;i<widthOld;i++){
00425 for(j=0;j<heightOld;j++){
00426 m_array[i+leftOld-m_left][j+bottomOld-m_bottom]=ablage[i][j];
00427 }
00428 }
00429 for(i=0;i<widthOld;i++){delete [] ablage[i];}
00430 delete ablage;
00431 }}}
00432 m_array[n-m_left][m-m_bottom]=t;
00433 }
|
|
||||||||||
|
Definition at line 435 of file arrayc.h. References GridC< Typ >::m_array, GridC< Typ >::m_blank, GridC< Typ >::m_height, and GridC< Typ >::m_width.
|
|
|||||
|
Definition at line 447 of file arrayc.h. Referenced by GridC< Typ >::get(), GridC< Typ >::GridC(), GridC< Typ >::set(), GridC< Typ >::SetBlankAndClear(), and GridC< Typ >::~GridC(). |
|
|||||
|
|
|
|||||
|
Definition at line 444 of file arrayc.h. Referenced by GridC< Typ >::get(), GridC< Typ >::GridC(), GridC< Typ >::set(), and GridC< Typ >::SetBlankAndClear(). |
|
|||||
|
Definition at line 445 of file arrayc.h. Referenced by GridC< Typ >::get(), GridC< Typ >::GridC(), and GridC< Typ >::set(). |
|
|||||
|
Definition at line 446 of file arrayc.h. Referenced by GridC< Typ >::GridC(), GridC< Typ >::set(), and GridC< Typ >::SetBlankAndClear(). |
|
|||||
|
Definition at line 445 of file arrayc.h. Referenced by GridC< Typ >::get(), GridC< Typ >::GridC(), and GridC< Typ >::set(). |
|
|||||
|
Definition at line 445 of file arrayc.h. Referenced by GridC< Typ >::get(), GridC< Typ >::GridC(), and GridC< Typ >::set(). |
|
|||||
|
Definition at line 445 of file arrayc.h. Referenced by GridC< Typ >::get(), GridC< Typ >::GridC(), and GridC< Typ >::set(). |
|
|||||
|
Definition at line 446 of file arrayc.h. Referenced by GridC< Typ >::GridC(), GridC< Typ >::set(), GridC< Typ >::SetBlankAndClear(), and GridC< Typ >::~GridC(). |
1.3-rc2