Files Classes Functions Hierarchy
00001 #ifndef MESHPATCHPTR_H 00002 #define MESHPATCHPTR_H 00003 00004 #include <print.h> 00005 00018 template< typename T > 00019 class meshpatchptr 00020 { 00021 public: 00022 00024 T * pt; 00025 00028 uint * index; 00029 00031 uintc columns; 00032 00034 void indexSet(uint * pi) 00035 { for (uint k=0; k<columns; ++k) index[k] = pi[k]; } 00036 00038 T const operator () (uintc i, uintc j) const 00039 { return pt[ index[i+columns*j] ]; } 00041 T & operator () (uintc i, uintc j) 00042 { return pt[ index[i+columns*j] ]; } 00043 00046 meshpatchptr( T * pt_, uintc columns_) 00047 : pt(pt_), index(new uint[columns_]), columns(columns_) {} 00048 00050 ~meshpatchptr() 00051 { delete[] index; } 00052 00053 }; 00054 00055 #endif 00056 00057
1.5.8