History

integrates logging for interface

tosh committed 13 years ago

Commit 349e89a1 parent e78101713 files · +96 −89Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 13 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+13−11
@@ -17,6 +17,8 @@ · 16 unmodified lines
1717 #include <PacketHeaders.h>
1818 #include <OctalCode.h>
1919 #include <pthread.h>
20+#include "Log.h"
21+
2022 #include "VoxelSystem.h"
2123
2224 const int MAX_VOXELS_PER_SYSTEM = 250000;
@@ -136,15 +138,15 @@ void VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 113 unmodified lines
136138 int commandLength = strlen(command); // commands are null terminated strings
137139 int totalLength = 1+commandLength+1;
138140
139− printf("got Z message len(%d)= %s\n", numBytes, command);
141+ printLog("got Z message len(%d)= %s\n", numBytes, command);
140142
141143 while (totalLength <= numBytes) {
142144 if (0==strcmp(command,(char*)"erase all")) {
143− printf("got Z message == erase all\n");
145+ printLog("got Z message == erase all\n");
144146 tree->eraseAllVoxels();
145147 }
146148 if (0==strcmp(command,(char*)"add scene")) {
147− printf("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
149+ printLog("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
148150 }
149151 totalLength += commandLength+1;
150152 }
@@ -194,14 +196,14 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode, float nodePosition[3]) { · 43 unmodified lines
194196 float viewerZ = swapXandZ ? viewerPosition[0] : viewerPosition[2];
195197
196198 // debugging code.
197− //printf("treeToArrays() halfUnitForVoxel=%f\n",halfUnitForVoxel);
198− //printf("treeToArrays() viewerPosition {x,y,z or [0],[1],[2]} ={%f,%f,%f}\n",
199− // viewerPosition[0],viewerPosition[1],viewerPosition[2]);
200− //printf("treeToArrays() nodePosition {x,y,z or [0],[1],[2]} = {%f,%f,%f}\n",
201− // nodePosition[0],nodePosition[1],nodePosition[2]);
199+ //printLog("treeToArrays() halfUnitForVoxel=%f\n",halfUnitForVoxel);
200+ //printLog("treeToArrays() viewerPosition {x,y,z or [0],[1],[2]} ={%f,%f,%f}\n",
201+ // viewerPosition[0],viewerPosition[1],viewerPosition[2]);
202+ //printLog("treeToArrays() nodePosition {x,y,z or [0],[1],[2]} = {%f,%f,%f}\n",
203+ // nodePosition[0],nodePosition[1],nodePosition[2]);
202204 //float* vertices = firstVertexForCode(currentNode->octalCode);
203− //printf("treeToArrays() firstVerticesForCode(currentNode->octalCode)={x,y,z or [0],[1],[2]} = {%f,%f,%f}\n",
204− // vertices[0],vertices[1],vertices[2]);
205+ //printLog("treeToArrays() firstVerticesForCode(currentNode->octalCode)={x,y,z or [0],[1],[2]} = {%f,%f,%f}\n",
206+ // vertices[0],vertices[1],vertices[2]);
205207 //delete []vertices;
206208
207209 float distanceToVoxelCenter = sqrtf(powf(viewerX - nodePosition[0] - halfUnitForVoxel, 2) +
@@ -209,7 +211,7 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode, float nodePosition[3]) { · 1 unmodified line
209211 powf(viewerZ - nodePosition[2] - halfUnitForVoxel, 2));
210212
211213 int boundaryPosition = boundaryDistanceForRenderLevel(*currentNode->octalCode + 1);
212− //printf("treeToArrays() distanceToVoxelCenter=%f boundaryPosition=%d\n",distanceToVoxelCenter,boundaryPosition);
214+ //printLog("treeToArrays() distanceToVoxelCenter=%f boundaryPosition=%d\n",distanceToVoxelCenter,boundaryPosition);
213215
214216 bool alwaysDraw = false; // XXXBHG - temporary debug code. Flip this to true to disable LOD blurring
215217