Public Member Functions | |
CoarseOp (HDF5OrthoReader &orthoReader, HDF5OrthoWriter &orthoWriter, unsigned nX, unsigned nY, unsigned nZ) | |
virtual void | processDataSet (hid_t dataset) |
virtual void | processAtt (hid_t att) |
virtual void | processGroup (hid_t grp) |
Private Attributes | |
HDF5OrthoReader & | orthoReader |
HDF5OrthoWriter & | orthoWriter |
unsigned | nX |
unsigned | nY |
unsigned | nZ |
Definition at line 2151 of file mainapp.cpp.
CoarseOp::CoarseOp | ( | HDF5OrthoReader & | orthoReader, | |
HDF5OrthoWriter & | orthoWriter, | |||
unsigned | nX, | |||
unsigned | nY, | |||
unsigned | nZ | |||
) | [inline] |
Definition at line 2158 of file mainapp.cpp.
02159 :orthoReader(orthoReader),orthoWriter(orthoWriter),nX(nX),nY(nY),nZ(nZ) 02160 { 02161 02162 }
virtual void CoarseOp::processAtt | ( | hid_t | att | ) | [inline, virtual] |
Implements HDF5Operator.
Definition at line 2208 of file mainapp.cpp.
02209 { 02210 char str[1000]; 02211 char str2[1000]; 02212 02213 H5Iget_name(att,str,1000); 02214 H5Aget_name(att,1000,str2); 02215 02216 ArrayString strLst=StringFunctions::tokenize(str,"/"); 02217 if (strLst.size() == 0) 02218 return; 02219 if (strLst[0] == "Triangulations") 02220 { 02221 printf("Ignoring Attribute %s/%s\n",str,str2); 02222 return; 02223 } 02224 02225 02226 02227 string attValue=orthoReader.readAtt(str,str2); 02228 printf("Coping attribute %s/%s = %s\n",str,str2,attValue.c_str()); 02229 orthoWriter.setAtt(str,str2,attValue); 02230 }
virtual void CoarseOp::processDataSet | ( | hid_t | dataset | ) | [inline, virtual] |
Implements HDF5Operator.
Definition at line 2164 of file mainapp.cpp.
02165 { 02166 char dataSetName[1000]; 02167 02168 H5Iget_name(dataset,dataSetName,1000); 02169 02170 ArrayString strLst=StringFunctions::tokenize(dataSetName,"/"); 02171 if (strLst.size() == 0) 02172 return; 02173 if (strLst[0] == "Triangulations") 02174 { 02175 printf("Ignoring dataset %s\n",dataSetName); 02176 return; 02177 } 02178 02179 02180 printf("Coping DataSet %s\n",dataSetName); 02181 static VecDouble v; 02182 02183 //v := DataSet data 02184 orthoReader.readScalars(v,dataSetName); 02185 02186 //Get the triangulation of the dataset 02187 std::string triaName = orthoReader.readAtt(dataSetName,"Triangulation"); 02188 if (triaName.empty()) 02189 throw new Exception("Error processing DataSet %s, Attribute \"Triangulation\" is missing\n",dataSetName); 02190 if (!orthoWriter.existTriaInformation(triaName)) 02191 { 02192 //Write the mesh data in the coarser form into the output hdf5 file 02193 printf("===============Reading Mesh %s...",triaName.c_str()); 02194 OrthoMesh &mesh = orthoReader.getMesh(triaName); 02195 printf("Ok\n"); 02196 printf("===============Writing Mesh %s...",triaName.c_str()); 02197 orthoWriter.writeCoarseMesh(triaName,mesh,nX,nY,nZ); 02198 printf("Ok\n"); 02199 02200 } 02201 //write the dataset 02202 printf("===============Writing DataSet %s...",dataSetName); 02203 orthoWriter.writeDataSet(v,dataSetName,triaName); 02204 printf("Ok\n"); 02205 02206 02207 }
virtual void CoarseOp::processGroup | ( | hid_t | grp | ) | [inline, virtual] |
Implements HDF5Operator.
Definition at line 2232 of file mainapp.cpp.
02233 { 02234 char str[1000]; 02235 H5Iget_name(grp,str,1000); 02236 ArrayString strLst=StringFunctions::tokenize(str,"/"); 02237 if (strLst.size() == 0) 02238 return; 02239 if (strLst[0] != "Triangulations") 02240 { 02241 printf("Creating Group %s\n",str); 02242 orthoWriter.createGroup(str); 02243 } 02244 }
unsigned CoarseOp::nX [private] |
Definition at line 2156 of file mainapp.cpp.
unsigned CoarseOp::nY [private] |
Definition at line 2156 of file mainapp.cpp.
unsigned CoarseOp::nZ [private] |
Definition at line 2156 of file mainapp.cpp.
HDF5OrthoReader& CoarseOp::orthoReader [private] |
Definition at line 2154 of file mainapp.cpp.
HDF5OrthoWriter& CoarseOp::orthoWriter [private] |
Definition at line 2155 of file mainapp.cpp.