Showing the changes to interface/src/VoxelSystem.cpp (1 of 4 files). Show all
Unified · Split
| @@ -372,13 +372,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, bool down, void* extraDa · 371 unmodified lines | ||
| 372 | 372 | newColor[0] = randomColorValue(150); |
| 373 | 373 | newColor[1] = randomColorValue(150); |
| 374 | 374 | 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]); | |
| 379 | 375 | node->setColor(newColor); |
| 380 | − } else { | |
| 381 | − //printf("not randomizing color node of %d since it has no color\n",_nodeCount); | |
| 382 | 376 | } |
| 383 | 377 | return true; |
| 384 | 378 | } |
| @@ -386,7 +380,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, bool down, void* extraDa · 1 unmodified line | ||
| 386 | 380 | void VoxelSystem::randomizeVoxelColors() { |
| 387 | 381 | _nodeCount = 0; |
| 388 | 382 | 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); | |
| 390 | 384 | setupNewVoxelsForDrawing(); |
| 391 | 385 | } |
| 392 | 386 | |
| @@ -403,10 +397,6 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, bool down, void* · 10 unmodified lines | ||
| 403 | 397 | unsigned char newR = randomColorValue(150); |
| 404 | 398 | unsigned char newG = randomColorValue(150); |
| 405 | 399 | 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); | |
| 410 | 400 | node->setFalseColor(newR,newG,newB); |
| 411 | 401 | |
| 412 | 402 | return true; // keep going! |
| @@ -415,7 +405,7 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, bool down, void* · 2 unmodified lines | ||
| 415 | 405 | void VoxelSystem::falseColorizeRandom() { |
| 416 | 406 | _nodeCount = 0; |
| 417 | 407 | 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); | |
| 419 | 409 | setupNewVoxelsForDrawing(); |
| 420 | 410 | } |
| 421 | 411 | |
| @@ -428,14 +418,13 @@ bool VoxelSystem::trueColorizeOperation(VoxelNode* node, bool down, void* extraD · 6 unmodified lines | ||
| 428 | 418 | |
| 429 | 419 | _nodeCount++; |
| 430 | 420 | node->setFalseColored(false); |
| 431 | − //printf("setting true color for node %d\n",_nodeCount); | |
| 432 | 421 | return true; |
| 433 | 422 | } |
| 434 | 423 | |
| 435 | 424 | void VoxelSystem::trueColorize() { |
| 436 | 425 | _nodeCount = 0; |
| 437 | 426 | tree->recurseTreeWithOperation(trueColorizeOperation); |
| 438 | − printf("setting true color for %d nodes\n",_nodeCount); | |
| 427 | + printLog("setting true color for %d nodes\n",_nodeCount); | |
| 439 | 428 | setupNewVoxelsForDrawing(); |
| 440 | 429 | } |
| 441 | 430 | |
| @@ -459,9 +448,6 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 17 unmodified lines | ||
| 459 | 448 | unsigned char newR = 255; |
| 460 | 449 | unsigned char newG = 0; |
| 461 | 450 | 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]); | |
| 465 | 451 | node->setFalseColor(newR,newG,newB); |
| 466 | 452 | } |
| 467 | 453 | } |
| @@ -472,15 +458,13 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, bool down, void* · 4 unmodified lines | ||
| 472 | 458 | void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) { |
| 473 | 459 | _nodeCount = 0; |
| 474 | 460 | 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); | |
| 476 | 462 | setupNewVoxelsForDrawing(); |
| 477 | 463 | } |
| 478 | 464 | |
| 479 | 465 | // Will false colorize voxels based on distance from view |
| 480 | 466 | bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool down, void* extraData) { |
| 481 | 467 | |
| 482 | − //printf("falseColorizeDistanceFromViewOperation() down=%s\n",(down ? "TRUE" : "FALSE")); | |
| 483 | − | |
| 484 | 468 | // we do our operations on the way up! |
| 485 | 469 | if (down) { |
| 486 | 470 | return true; |
| @@ -505,10 +489,6 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 18 unmodified lines | ||
| 505 | 489 | float halfUnitForVoxel = powf(0.5, *node->octalCode) * (0.5 * TREE_SCALE); |
| 506 | 490 | glm::vec3 viewerPosition = viewFrustum->getPosition(); |
| 507 | 491 | |
| 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 | − | |
| 512 | 492 | float distance = sqrtf(powf(viewerPosition.x - nodePosition.x - halfUnitForVoxel, 2) + |
| 513 | 493 | powf(viewerPosition.y - nodePosition.y - halfUnitForVoxel, 2) + |
| 514 | 494 | powf(viewerPosition.z - nodePosition.z - halfUnitForVoxel, 2)); |
| @@ -526,12 +506,7 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, bool d · 11 unmodified lines | ||
| 526 | 506 | unsigned char newR = (colorBand*(gradientOver/colorBands))+(maxColor-gradientOver); |
| 527 | 507 | unsigned char newG = 0; |
| 528 | 508 | 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 | − | |
| 532 | 509 | node->setFalseColor(newR,newG,newB); |
| 533 | − } else { | |
| 534 | − //printf("voxel not colored, don't consider it - down=%s\n",(down ? "TRUE" : "FALSE")); | |
| 535 | 510 | } |
| 536 | 511 | return true; // keep going! |
| 537 | 512 | } |
| @@ -549,8 +524,6 @@ bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, bool down, · 11 unmodified lines | ||
| 549 | 524 | return true; |
| 550 | 525 | } |
| 551 | 526 | |
| 552 | − //printf("getDistanceFromViewRangeOperation() down=%s\n",(down ? "TRUE" : "FALSE")); | |
| 553 | − | |
| 554 | 527 | ViewFrustum* viewFrustum = (ViewFrustum*) extraData; |
| 555 | 528 | |
| 556 | 529 | // only do this for truly colored voxels... |
| @@ -577,11 +550,9 @@ bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, bool down, · 20 unmodified lines | ||
| 577 | 550 | // on way down, calculate the range of distances |
| 578 | 551 | if (distance > _maxDistance) { |
| 579 | 552 | _maxDistance = distance; |
| 580 | − //printf("new maxDistance=%f down=%s\n",_maxDistance, (down ? "TRUE" : "FALSE")); | |
| 581 | 553 | } |
| 582 | 554 | if (distance < _minDistance) { |
| 583 | 555 | _minDistance = distance; |
| 584 | − //printf("new minDistance=%f down=%s\n",_minDistance, (down ? "TRUE" : "FALSE")); | |
| 585 | 556 | } |
| 586 | 557 | |
| 587 | 558 | _nodeCount++; |
| @@ -595,11 +566,11 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) { · 7 unmodified lines | ||
| 595 | 566 | _maxDistance = 0.0; |
| 596 | 567 | _minDistance = FLT_MAX; |
| 597 | 568 | 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); | |
| 599 | 570 | |
| 600 | 571 | _nodeCount = 0; |
| 601 | 572 | |
| 602 | 573 | 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); | |
| 604 | 575 | setupNewVoxelsForDrawing(); |
| 605 | 576 | } |