66 FILE *in=
fopen(regFile,
"r");
67 if (in==NULL)
return "Couldn't open input .reg file";
72 for (
int axis=0;axis<3;axis++)
75 if (1!=fscanf(in,
"%d",&dimArr[axis]))
76 return "Couldn't read block dimension";
77 if (1!=fscanf(in,
"%lf",&m))
return "Couldn't read block min";
79 if (1!=fscanf(in,
"%lf",&m))
return "Couldn't read block max";
85 blockDim dim(dimArr[0],dimArr[1],dimArr[2]);
93 for (
int axis=0;axis<3;axis++) {
94 double scl=i[axis]/(float)(dim[axis]-1);
95 v[axis]=min[axis]+scl*(max[axis]-min[axis]);
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
int fclose(std::FILE *file)
Close a file, and check for possible errors.
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
const char * read_reg(const char *regFile, blockConsumer &dest)
virtual vector3d * allocateBlock(blockDim &dim)
#define BLOCKSPAN_FOR(i, span)
virtual void freeBlock(vector3d *blk)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
virtual const char * consume(const blockDim &dim, vector3d *locs)=0
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.