History

printf/pringLog cleanup

ZappoMan committed 13 years ago

Commit 7c180c81 parent ff996c94 files · +11 −52Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+6−35
@@ -372,13 +372,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, bool down, void* extraDa · 371 unmodified lines
372372 newColor[0] = randomColorValue(150);
373373 newColor[1] = randomColorValue(150);
374374 newColor[1] = randomColorValue(150);
375−
376− //printf("randomize color node %d was %x,%x,%x NOW %x,%x,%x\n",
377− // _nodeCount,node->getTrueColor()[0],node->getTrueColor()[1],node->getTrueColor()[2],
378− // newColor[0],newColor[1],newColor[2]);
379375 node->setColor(newColor);
380− } else {
381− //printf("not randomizing color node of %d since it has no color\n",_nodeCount);
382376 }
383377 return true;
384378 }
@@ -386,7 +380,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, bool down, void* extraDa · 1 unmodified line
386380 void VoxelSystem::randomizeVoxelColors() {
387381 _nodeCount = 0;
388382 tree->recurseTreeWithOperation(randomColorOperation);
389− printf("setting randomized true color for %d nodes\n",_nodeCount);
383+ printLog("setting randomized true color for %d nodes\n",_nodeCount);
390384 setupNewVoxelsForDrawing();
391385 }
392386
@@ -403,10 +397,6 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, bool down, void* · 10 unmodified lines
403397 unsigned char newR = randomColorValue(150);
404398 unsigned char newG = randomColorValue(150);
405399 unsigned char newB = randomColorValue(150);
406−
407− printf("randomize FALSE color node %d was %x,%x,%x NOW %x,%x,%x\n",
408− _nodeCount,node->getTrueColor()[0],node->getTrueColor()[1],node->getTrueColor()[2],
409− newR,newG,newB);
410400 node->setFalseColor(newR,newG,newB);
411401
412402 return true; // keep going!
@@ -415,7 +405,7 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, bool down, void* · 2 unmodified lines
415405 void VoxelSystem::falseColorizeRandom() {
416406 _nodeCount = 0;
417407 tree->recurseTreeWithOperation(falseColorizeRandomOperation);
418− printf("setting randomized false color for %d nodes\n",_nodeCount);
408+ printLog("setting randomized false color for %d nodes\n",_nodeCount);
419409 setupNewVoxelsForDrawing();
420410 }
421411
@@ -428,14 +418,13 @@ bool VoxelSystem::trueColorizeOperation(VoxelNode* node, bool down, void* extraD · 6 unmodified lines
428418
429419 _nodeCount++;
430420 node->setFalseColored(false);
431− //printf("setting true color for node %d\n",_nodeCount);
432421 return true;
433422 }
434423
435424 void VoxelSystem::trueColorize() {
436425 _nodeCount = 0;
437426 tree->recurseTreeWithOperation(trueColorizeOperation);
438− printf("setting true color for %d nodes\n",_nodeCount);
427+ printLog("setting true color for %d nodes\n",_nodeCount);
439428 setupNewVoxelsForDrawing();
440429 }
441430
@@ -459,9 +448,6 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 17 unmodified lines
459448 unsigned char newR = 255;
460449 unsigned char newG = 0;
461450 unsigned char newB = 0;
462−
463− //printf("voxel OUTSIDE view - FALSE colorizing node %d TRUE color is %x,%x,%x \n",
464− // _nodeCount,node->getTrueColor()[0],node->getTrueColor()[1],node->getTrueColor()[2]);
465451 node->setFalseColor(newR,newG,newB);
466452 }
467453 }
@@ -472,15 +458,13 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 4 unmodified lines
472458 void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) {
473459 _nodeCount = 0;
474460 tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)viewFrustum);
475− printf("setting in view false color for %d nodes\n",_nodeCount);
461+ printLog("setting in view false color for %d nodes\n",_nodeCount);
476462 setupNewVoxelsForDrawing();
477463 }
478464
479465 // Will false colorize voxels based on distance from view
480466 bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool down, void* extraData) {
481467
482− //printf("falseColorizeDistanceFromViewOperation() down=%s\n",(down ? "TRUE" : "FALSE"));
483−
484468 // we do our operations on the way up!
485469 if (down) {
486470 return true;
@@ -505,10 +489,6 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 18 unmodified lines
505489 float halfUnitForVoxel = powf(0.5, *node->octalCode) * (0.5 * TREE_SCALE);
506490 glm::vec3 viewerPosition = viewFrustum->getPosition();
507491
508− //printf("halfUnitForVoxel=%f\n",halfUnitForVoxel);
509− //printf("viewer.x=%f y=%f z=%f \n", viewerPosition.x, viewerPosition.y, viewerPosition.z);
510− //printf("node.x=%f y=%f z=%f \n", nodePosition.x, nodePosition.y, nodePosition.z);
511−
512492 float distance = sqrtf(powf(viewerPosition.x - nodePosition.x - halfUnitForVoxel, 2) +
513493 powf(viewerPosition.y - nodePosition.y - halfUnitForVoxel, 2) +
514494 powf(viewerPosition.z - nodePosition.z - halfUnitForVoxel, 2));
@@ -526,12 +506,7 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 11 unmodified lines
526506 unsigned char newR = (colorBand*(gradientOver/colorBands))+(maxColor-gradientOver);
527507 unsigned char newG = 0;
528508 unsigned char newB = 0;
529− //printf("Setting color down=%s distance=%f min=%f max=%f distanceRatio=%f color=%d \n",
530− // (down ? "TRUE" : "FALSE"), distance, _minDistance, _maxDistance, distanceRatio, (int)newR);
531−
532509 node->setFalseColor(newR,newG,newB);
533− } else {
534− //printf("voxel not colored, don't consider it - down=%s\n",(down ? "TRUE" : "FALSE"));
535510 }
536511 return true; // keep going!
537512 }
@@ -549,8 +524,6 @@ bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, bool down, · 11 unmodified lines
549524 return true;
550525 }
551526
552− //printf("getDistanceFromViewRangeOperation() down=%s\n",(down ? "TRUE" : "FALSE"));
553−
554527 ViewFrustum* viewFrustum = (ViewFrustum*) extraData;
555528
556529 // only do this for truly colored voxels...
@@ -577,11 +550,9 @@ bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, bool down, · 20 unmodified lines
577550 // on way down, calculate the range of distances
578551 if (distance > _maxDistance) {
579552 _maxDistance = distance;
580− //printf("new maxDistance=%f down=%s\n",_maxDistance, (down ? "TRUE" : "FALSE"));
581553 }
582554 if (distance < _minDistance) {
583555 _minDistance = distance;
584− //printf("new minDistance=%f down=%s\n",_minDistance, (down ? "TRUE" : "FALSE"));
585556 }
586557
587558 _nodeCount++;
@@ -595,11 +566,11 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) { · 7 unmodified lines
595566 _maxDistance = 0.0;
596567 _minDistance = FLT_MAX;
597568 tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation,(void*)viewFrustum);
598− printf("determining distance range for %d nodes\n",_nodeCount);
569+ printLog("determining distance range for %d nodes\n",_nodeCount);
599570
600571 _nodeCount = 0;
601572
602573 tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation,(void*)viewFrustum);
603− printf("setting in distance false color for %d nodes\n",_nodeCount);
574+ printLog("setting in distance false color for %d nodes\n",_nodeCount);
604575 setupNewVoxelsForDrawing();
605576 }