History

switch calls to printLog to QDebug

Stephen Birarda committed 13 years ago

Commit afe49bc1 parent d38955a54 files · +416 −451Browse files

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

Unified · Split

interface/src/VoxelSystem.cpp+32−29
@@ -5,28 +5,31 @@ · 4 unmodified lines
55 // Created by Philip on 12/31/12.
66 // Copyright (c) 2012 High Fidelity, Inc. All rights reserved.
77 //
8+
89 #ifdef _WIN32
910 #define _timeval_
1011 #define _USE_MATH_DEFINES
1112 #endif
13+
1214 #include <cstring>
1315 #include <cmath>
1416 #include <iostream> // to load voxels from file
1517 #include <fstream> // to load voxels from file
18+#include <pthread.h>
19+
1620 #include <glm/gtc/random.hpp>
17−#include <SharedUtil.h>
21+
22+#include <OctalCode.h>
1823 #include <PacketHeaders.h>
1924 #include <PerfStat.h>
20−#include <OctalCode.h>
21−#include <pthread.h>
25+#include <SharedUtil.h>
26+
2227 #include "Application.h"
23−#include "Log.h"
24−#include "VoxelConstants.h"
2528 #include "CoverageMap.h"
2629 #include "CoverageMapV2.h"
2730 #include "InterfaceConfig.h"
2831 #include "renderer/ProgramObject.h"
29−
32+#include "VoxelConstants.h"
3033 #include "VoxelSystem.h"
3134
3235 float identityVertices[] = { 0,0,0, 1,0,0, 1,1,0, 0,1,0, 0,0,1, 1,0,1, 1,1,1, 0,1,1,
@@ -141,16 +144,16 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) { · 108 unmodified lines
141144 int commandLength = strlen(command); // commands are null terminated strings
142145 int totalLength = 1+commandLength+1;
143146
144− printLog("got Z message len(%d)= %s\n", numBytes, command);
147+ qDebug("got Z message len(%d)= %s\n", numBytes, command);
145148
146149 while (totalLength <= numBytes) {
147150 if (0==strcmp(command,(char*)"erase all")) {
148− printLog("got Z message == erase all\n");
151+ qDebug("got Z message == erase all\n");
149152 _tree->eraseAllVoxels();
150153 _voxelsInReadArrays = _voxelsInWriteArrays = 0; // better way to do this??
151154 }
152155 if (0==strcmp(command,(char*)"add scene")) {
153− printLog("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
156+ qDebug("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
154157 }
155158 totalLength += commandLength+1;
156159 }
@@ -705,7 +708,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, void* extraData) { · 548 unmodified lines
705708 void VoxelSystem::randomizeVoxelColors() {
706709 _nodeCount = 0;
707710 _tree->recurseTreeWithOperation(randomColorOperation);
708− printLog("setting randomized true color for %d nodes\n", _nodeCount);
711+ qDebug("setting randomized true color for %d nodes\n", _nodeCount);
709712 setupNewVoxelsForDrawing();
710713 }
711714
@@ -719,7 +722,7 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, void* extraData) · 7 unmodified lines
719722 void VoxelSystem::falseColorizeRandom() {
720723 _nodeCount = 0;
721724 _tree->recurseTreeWithOperation(falseColorizeRandomOperation);
722− printLog("setting randomized false color for %d nodes\n", _nodeCount);
725+ qDebug("setting randomized false color for %d nodes\n", _nodeCount);
723726 setupNewVoxelsForDrawing();
724727 }
725728
@@ -733,7 +736,7 @@ void VoxelSystem::trueColorize() { · 7 unmodified lines
733736 PerformanceWarning warn(true, "trueColorize()",true);
734737 _nodeCount = 0;
735738 _tree->recurseTreeWithOperation(trueColorizeOperation);
736− printLog("setting true color for %d nodes\n", _nodeCount);
739+ qDebug("setting true color for %d nodes\n", _nodeCount);
737740 setupNewVoxelsForDrawing();
738741 }
739742
@@ -753,7 +756,7 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData) · 13 unmodified lines
753756 void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) {
754757 _nodeCount = 0;
755758 _tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)viewFrustum);
756− printLog("setting in view false color for %d nodes\n", _nodeCount);
759+ qDebug("setting in view false color for %d nodes\n", _nodeCount);
757760 setupNewVoxelsForDrawing();
758761 }
759762
@@ -803,10 +806,10 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) { · 43 unmodified lines
803806 _maxDistance = 0.0;
804807 _minDistance = FLT_MAX;
805808 _tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation,(void*)viewFrustum);
806− printLog("determining distance range for %d nodes\n", _nodeCount);
809+ qDebug("determining distance range for %d nodes\n", _nodeCount);
807810 _nodeCount = 0;
808811 _tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation,(void*)viewFrustum);
809− printLog("setting in distance false color for %d nodes\n", _nodeCount);
812+ qDebug("setting in distance false color for %d nodes\n", _nodeCount);
810813 setupNewVoxelsForDrawing();
811814 }
812815
@@ -918,7 +921,7 @@ void VoxelSystem::removeOutOfView() { · 105 unmodified lines
918921 }
919922 bool showRemoveDebugDetails = false;
920923 if (showRemoveDebugDetails) {
921− printLog("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d \n",
924+ qDebug("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d \n",
922925 args.nodesScanned, args.nodesRemoved, args.nodesInside,
923926 args.nodesIntersect, args.nodesOutside, _removedVoxels.count()
924927 );
@@ -984,7 +987,7 @@ bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, void* · 59 unmodified lines
984987 void VoxelSystem::falseColorizeRandomEveryOther() {
985988 falseColorizeRandomEveryOtherArgs args;
986989 _tree->recurseTreeWithOperation(falseColorizeRandomEveryOtherOperation,&args);
987− printLog("randomized false color for every other node: total %ld, colorable %ld, colored %ld\n",
990+ qDebug("randomized false color for every other node: total %ld, colorable %ld, colored %ld\n",
988991 args.totalNodes, args.colorableNodes, args.coloredNodes);
989992 setupNewVoxelsForDrawing();
990993 }
@@ -1045,7 +1048,7 @@ bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* ex · 54 unmodified lines
10451048 unsigned long nodeIndex = node->getBufferIndex();
10461049 if (args->hasIndexFound[nodeIndex]) {
10471050 args->duplicateVBOIndex++;
1048− printLog("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s \n", nodeIndex,
1051+ qDebug("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s \n", nodeIndex,
10491052 debug::valueOf(node->isDirty()), debug::valueOf(node->getShouldRender()));
10501053 } else {
10511054 args->hasIndexFound[nodeIndex] = true;
@@ -1080,13 +1083,13 @@ void VoxelSystem::collectStatsForTreesAndVBOs() { · 28 unmodified lines
10801083 args.expectedMax = _voxelsInWriteArrays;
10811084 _tree->recurseTreeWithOperation(collectStatsForTreesAndVBOsOperation,&args);
10821085
1083− printLog("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld \n",
1086+ qDebug("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld \n",
10841087 args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
10851088
1086− printLog(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld \n", debug::valueOf(_voxelsDirty),
1089+ qDebug(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld \n", debug::valueOf(_voxelsDirty),
10871090 _voxelsInWriteArrays, minDirty, maxDirty);
10881091
1089− printLog(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld \n",
1092+ qDebug(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld \n",
10901093 args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender);
10911094
10921095 glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
@@ -1099,7 +1102,7 @@ void VoxelSystem::collectStatsForTreesAndVBOs() { · 6 unmodified lines
10991102 }
11001103 }
11011104
1102− printLog(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld \n",
1105+ qDebug(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld \n",
11031106 minInVBO, maxInVBO, _voxelsInWriteArrays, _voxelsInReadArrays);
11041107
11051108 }
@@ -1124,7 +1127,7 @@ void VoxelSystem::createVoxel(float x, float y, float z, float s, · 18 unmodified lines
11241127 unsigned char red, unsigned char green, unsigned char blue, bool destructive) {
11251128 pthread_mutex_lock(&_treeLock);
11261129
1127− //printLog("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);
1130+ //qDebug("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);
11281131 _tree->createVoxel(x, y, z, s, red, green, blue, destructive);
11291132 setupNewVoxelsForDrawing();
11301133
@@ -1250,9 +1253,9 @@ bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, void* extraDat · 119 unmodified lines
12501253 args->occludedVoxels++;
12511254 } else if (result == STORED) {
12521255 args->notOccludedVoxels++;
1253− //printLog("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
1256+ //qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
12541257 } else if (result == DOESNT_FIT) {
1255− //printLog("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
1258+ //qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
12561259 }
12571260 }
12581261 return true; // keep going!
@@ -1285,7 +1288,7 @@ void VoxelSystem::falseColorizeOccluded() { · 26 unmodified lines
12851288
12861289 _tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedOperation, position, (void*)&args);
12871290
1288− printLog("falseColorizeOccluded()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
1291+ qDebug("falseColorizeOccluded()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
12891292 position.x, position.y,
12901293 args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
12911294 args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,
@@ -1371,9 +1374,9 @@ bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, void* extraD · 79 unmodified lines
13711374 args->occludedVoxels++;
13721375 } else if (result == V2_STORED) {
13731376 args->notOccludedVoxels++;
1374− //printLog("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
1377+ //qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
13751378 } else if (result == V2_DOESNT_FIT) {
1376− //printLog("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
1379+ //qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
13771380 }
13781381 delete voxelPolygon; // V2 maps don't store polygons, so we're always in charge of freeing
13791382 }
@@ -1410,7 +1413,7 @@ void VoxelSystem::falseColorizeOccludedV2() { · 30 unmodified lines
14101413
14111414 _tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedV2Operation, position, (void*)&args);
14121415
1413− printLog("falseColorizeOccludedV2()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
1416+ qDebug("falseColorizeOccludedV2()\n position=(%f,%f)\n total=%ld\n colored=%ld\n occluded=%ld\n notOccluded=%ld\n outOfView=%ld\n subtreeVoxelsSkipped=%ld\n stagedForDeletion=%ld\n nonLeaves=%ld\n nonLeavesOutOfView=%ld\n nonLeavesOccluded=%ld\n pointInside_calls=%ld\n occludes_calls=%ld\n intersects_calls=%ld\n",
14141417 position.x, position.y,
14151418 args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
14161419 args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t