Text archives Help
- From: knolla@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1138 - in trunk: Core/Util Model/Primitives
- Date: Mon, 3 Jul 2006 16:51:33 -0600 (MDT)
Author: knolla
Date: Mon Jul 3 16:51:32 2006
New Revision: 1138
Modified:
trunk/Core/Util/LargeFile.cc
trunk/Model/Primitives/IsosurfaceGridVolume.cc
trunk/Model/Primitives/IsosurfaceGridVolume.h
Log:
grid traversal of octree data now compiles; but a bug somewhere in
neighbor-finding
Modified: trunk/Core/Util/LargeFile.cc
==============================================================================
--- trunk/Core/Util/LargeFile.cc (original)
+++ trunk/Core/Util/LargeFile.cc Mon Jul 3 16:51:32 2006
@@ -7,11 +7,11 @@
size_t fread_big(void *ptr, size_t size, size_t nitems, FILE *stream)
{
- unsigned long chunkSize = 0x7fffffff;
- unsigned long remaining = size*nitems;
+ long chunkSize = 0x7fffffff;
+ long remaining = size*nitems;
while (remaining > 0) {
- unsigned long toRead =
remaining>chunkSize?chunkSize:remaining;
- unsigned long result;
+ long toRead = remaining>chunkSize?chunkSize:remaining;
+ long result;
if ((result = fread(ptr, toRead, 1, stream)) != 1) {
fprintf(stderr, "read error: %ld != %ld",
toRead, result);
Modified: trunk/Model/Primitives/IsosurfaceGridVolume.cc
==============================================================================
--- trunk/Model/Primitives/IsosurfaceGridVolume.cc (original)
+++ trunk/Model/Primitives/IsosurfaceGridVolume.cc Mon Jul 3 16:51:32
2006
@@ -165,9 +165,9 @@
//build the octree data from the single-res data.
double threshold = 0.0;
int max_depth = -1;
- cerr << "Building multi-resolution octree data. (var thresh = "<<
threshold << ", max depth = " << max_depth <<")...";
- octdata.make_from_single_res_data(indata, threshold, 2, 0);
- octdata.write_file(filebase);
+ cerr << "Reading multi-resolution octree data.";
+ //octdata.make_from_single_res_data(indata, threshold, 2, 0);
+ octdata.read_file(filebase);
#endif
}
@@ -354,12 +354,12 @@
#ifdef USE_OCTREE_DATA
#ifdef USE_OTD_NEIGHBOR_FIND
//neighbor find
- int index_trace[octdata.max_depth];
+ unsigned int index_trace[octdata.max_depth];
ST min_rho, max_rho, this_rho;
Vec3i child_cell(gx, gy, gz);
rhos[0]=octdata.lookup_node_trace(child_cell, 0, 0, 0,
index_trace);
int target_child = ((gx & 1) << 2) | ((gy & 1) << 1) | (gz &
1);
- OctCap& cap =
octdata.caps[0][index_trace[octdata.max_depth-1]];
+ OctCap& cap =
octdata.get_cap(index_trace[octdata.max_depth-1]);
//0,0,1
Vec3i offset(0,0,1);
if (target_child & 1)
@@ -367,39 +367,39 @@
else
rhos[1] = cap.values[target_child | 1];
//0,1,1
- offset.y = 1;
+ offset.data[1] = 1;
if (target_child & 3)
rhos[3] = octdata.lookup_neighbor<0,1,1>(child_cell,
offset, 0, depth, index_trace);
else
rhos[3] = cap.values[target_child | 3];
//1,1,1
- offset.x = 1;
+ offset.data[0] = 1;
if (target_child & 7)
rhos[7] = octdata.lookup_neighbor<1,1,1>(child_cell,
offset, 0, depth, index_trace);
else
rhos[7] = cap.values[target_child | 7];
//1,1,0
- offset.z = 0;
+ offset.data[2] = 0;
if (target_child & 6)
rhos[6] = octdata.lookup_neighbor<1,1,0>(child_cell,
offset, 0, depth, index_trace);
else
rhos[6] = cap.values[target_child | 6];
//1,0,0
- offset.y = 0;
+ offset.data[1] = 0;
if (target_child & 4)
rhos[4] = octdata.lookup_neighbor<1,0,0>(child_cell,
offset, 0, depth, index_trace);
else
rhos[4] = cap.values[target_child | 4];
//1,0,1
- offset.z = 1;
+ offset.data[2] = 1;
if (target_child & 5)
rhos[5] = octdata.lookup_neighbor<1,0,1>(child_cell,
offset, 0, depth, index_trace);
else
rhos[5] = cap.values[target_child | 5];
//0,1,0
- offset.x = 0;
- offset.y = 1;
- offset.z = 0;
+ offset.data[0] = 0;
+ offset.data[1] = 1;
+ offset.data[2] = 0;
if (target_child & 2)
rhos[2] = octdata.lookup_neighbor<0,1,0>(child_cell,
offset, 0, depth, index_trace);
else
Modified: trunk/Model/Primitives/IsosurfaceGridVolume.h
==============================================================================
--- trunk/Model/Primitives/IsosurfaceGridVolume.h (original)
+++ trunk/Model/Primitives/IsosurfaceGridVolume.h Mon Jul 3 16:51:32
2006
@@ -39,9 +39,9 @@
Vector sdiag;
int nx,ny,nz;
- #ifdef TEST_OCTDATA
- OctreeData<ST> octdata;
- #endif
+#ifdef TEST_OCTDATA
+ OctreeVolume octdata;
+#endif
BrickArray3<ST> blockdata;
ST datamin, datamax;
- [MANTA] r1138 - in trunk: Core/Util Model/Primitives, knolla, 07/03/2006
Archive powered by MHonArc 2.6.16.