revert removal of extraneous newlines

This commit is contained in:
Stephen Birarda 2013-07-16 12:46:32 -07:00
parent 063094f96c
commit 1b48d4f0fc
22 changed files with 197 additions and 196 deletions

View file

@ -215,7 +215,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
{
_applicationStartupTime = startup_time;
_window->setWindowTitle("Interface");
qDebug("Interface Startup:");
qDebug("Interface Startup:\n");
qInstallMsgHandler(messageHandler);
@ -240,7 +240,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
// Handle Local Domain testing with the --local command line
if (cmdOptionExists(argc, constArgv, "--local")) {
qDebug("Local Domain MODE!");
qDebug("Local Domain MODE!\n");
NodeList::getInstance()->setDomainIPToLocalhost();
}
@ -304,7 +304,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
}
void Application::initializeGL() {
qDebug( "Created Display Window." );
qDebug( "Created Display Window.\n" );
// initialize glut for shape drawing; Qt apparently initializes it on OS X
#ifndef __APPLE__
@ -319,10 +319,10 @@ void Application::initializeGL() {
_viewFrustumOffsetCamera.setFarClip(500.0 * TREE_SCALE);
initDisplay();
qDebug( "Initialized Display." );
qDebug( "Initialized Display.\n" );
init();
qDebug( "Init() complete." );
qDebug( "Init() complete.\n" );
// Check to see if the user passed in a command line option for randomizing colors
bool wantColorRandomizer = !arguments().contains("--NoColorRandomizer");
@ -331,13 +331,13 @@ void Application::initializeGL() {
// Voxel File. If so, load it now.
if (!_voxelsFilename.isEmpty()) {
_voxels.loadVoxelsFile(_voxelsFilename.constData(), wantColorRandomizer);
qDebug("Local Voxel File loaded.");
qDebug("Local Voxel File loaded.\n");
}
// create thread for receipt of data via UDP
if (_enableNetworkThread) {
pthread_create(&_networkReceiveThread, NULL, networkReceive, NULL);
qDebug("Network receive thread created.");
qDebug("Network receive thread created.\n");
}
// call terminate before exiting
@ -358,7 +358,7 @@ void Application::initializeGL() {
float startupTime = (usecTimestampNow() - usecTimestamp(&_applicationStartupTime)) / 1000000.0;
_justStarted = false;
char title[50];
sprintf(title, "Interface: %4.2f seconds", startupTime);
sprintf(title, "Interface: %4.2f seconds\n", startupTime);
qDebug("%s", title);
_window->setWindowTitle(title);
@ -1453,7 +1453,7 @@ void Application::importVoxels() {
if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {
QImage pngImage = QImage(fileName);
if (pngImage.height() != pngImage.width()) {
qDebug("ERROR: Bad PNG size: height != width.");
qDebug("ERROR: Bad PNG size: height != width.\n");
return;
}
@ -1765,7 +1765,7 @@ void Application::init() {
_audio.setJitterBufferSamples(_audioJitterBufferSamples);
}
qDebug("Loaded settings.");
qDebug("Loaded settings.\n");
sendAvatarVoxelURLMessage(_myAvatar.getVoxels()->getVoxelURL());
@ -2778,7 +2778,7 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) {
// render the coverage map on screen
void Application::renderCoverageMapV2() {
//qDebug("renderCoverageMap()");
//qDebug("renderCoverageMap()\n");
glDisable(GL_LIGHTING);
glLineWidth(2.0);
@ -2823,7 +2823,7 @@ void Application::renderCoverageMapsV2Recursively(CoverageMapV2* map) {
// render the coverage map on screen
void Application::renderCoverageMap() {
//qDebug("renderCoverageMap()");
//qDebug("renderCoverageMap()\n");
glDisable(GL_LIGHTING);
glLineWidth(2.0);
@ -3154,7 +3154,7 @@ void Application::eyedropperVoxelUnderCursor() {
}
void Application::goHome() {
qDebug("Going Home!");
qDebug("Going Home!\n");
_myAvatar.setPosition(START_LOCATION);
}

View file

@ -152,11 +152,11 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
// If not enough audio has arrived to start playback, keep waiting
//
#ifdef SHOW_AUDIO_DEBUG
qDebug("%i,%i,%i,%i",
_packetsReceivedThisPlayback,
ringBuffer->diffLastWriteNextOutput(),
PACKET_LENGTH_SAMPLES,
_jitterBufferSamples);
qDebug("%i,%i,%i,%i\n",
_packetsReceivedThisPlayback,
ringBuffer->diffLastWriteNextOutput(),
PACKET_LENGTH_SAMPLES,
_jitterBufferSamples);
#endif
} else if (ringBuffer->isStarted() && ringBuffer->diffLastWriteNextOutput() == 0) {
//
@ -169,7 +169,7 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
_packetsReceivedThisPlayback = 0;
_wasStarved = 10; // Frames for which to render the indication that the system was starved.
#ifdef SHOW_AUDIO_DEBUG
qDebug("Starved, remaining samples = %d",
qDebug("Starved, remaining samples = %d\n",
ringBuffer->diffLastWriteNextOutput());
#endif
@ -180,10 +180,10 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
if (!ringBuffer->isStarted()) {
ringBuffer->setStarted(true);
#ifdef SHOW_AUDIO_DEBUG
qDebug("starting playback %0.1f msecs delayed, jitter = %d, pkts recvd: %d",
(usecTimestampNow() - usecTimestamp(&_firstPacketReceivedTime))/1000.0,
_jitterBufferSamples,
_packetsReceivedThisPlayback);
qDebug("starting playback %0.1f msecs delayed, jitter = %d, pkts recvd: %d \n",
(usecTimestampNow() - usecTimestamp(&_firstPacketReceivedTime))/1000.0,
_jitterBufferSamples,
_packetsReceivedThisPlayback);
#endif
}
@ -300,8 +300,8 @@ int Audio::audioCallback (const void* inputBuffer,
static void outputPortAudioError(PaError error) {
if (error != paNoError) {
qDebug("-- portaudio termination error --");
qDebug("PortAudio error (%d): %s", error, Pa_GetErrorText(error));
qDebug("-- portaudio termination error --\n");
qDebug("PortAudio error (%d): %s\n", error, Pa_GetErrorText(error));
}
}
@ -350,7 +350,7 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples) :
outputParameters.device = Pa_GetDefaultOutputDevice();
if (inputParameters.device == -1 || outputParameters.device == -1) {
qDebug("Audio: Missing device.");
qDebug("Audio: Missing device.\n");
outputPortAudioError(Pa_Terminate());
return;
}
@ -385,12 +385,12 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples) :
outputPortAudioError(Pa_StartStream(_stream));
// Uncomment these lines to see the system-reported latency
//qDebug("Default low input, output latency (secs): %0.4f, %0.4f",
//qDebug("Default low input, output latency (secs): %0.4f, %0.4f\n",
// Pa_GetDeviceInfo(Pa_GetDefaultInputDevice())->defaultLowInputLatency,
// Pa_GetDeviceInfo(Pa_GetDefaultOutputDevice())->defaultLowOutputLatency);
const PaStreamInfo* streamInfo = Pa_GetStreamInfo(_stream);
qDebug("Started audio with reported latency msecs In/Out: %.0f, %.0f", streamInfo->inputLatency * 1000.f,
qDebug("Started audio with reported latency msecs In/Out: %.0f, %.0f\n", streamInfo->inputLatency * 1000.f,
streamInfo->outputLatency * 1000.f);
gettimeofday(&_lastReceiveTime, NULL);
@ -651,7 +651,7 @@ inline void Audio::eventuallySendRecvPing(int16_t* inputLeft, int16_t* outputLef
// As of the next frame, we'll be recoding PING_FRAMES_TO_RECORD from
// the mic (pointless to start now as we can't record unsent audio).
_isSendingEchoPing = false;
qDebug("Send audio ping");
qDebug("Send audio ping\n");
} else if (_pingFramesToRecord > 0) {
@ -665,7 +665,7 @@ inline void Audio::eventuallySendRecvPing(int16_t* inputLeft, int16_t* outputLef
if (_pingFramesToRecord == 0) {
_pingAnalysisPending = true;
qDebug("Received ping echo");
qDebug("Received ping echo\n");
}
}
}
@ -689,25 +689,25 @@ inline void Audio::analyzePing() {
// Determine extrema
int botAt = findExtremum(_echoSamplesLeft, PING_SAMPLES_TO_ANALYZE, -1);
if (botAt == -1) {
qDebug("Audio Ping: Minimum not found.");
qDebug("Audio Ping: Minimum not found.\n");
return;
}
int topAt = findExtremum(_echoSamplesLeft, PING_SAMPLES_TO_ANALYZE, 1);
if (topAt == -1) {
qDebug("Audio Ping: Maximum not found.");
qDebug("Audio Ping: Maximum not found.\n");
return;
}
// Determine peak amplitude - warn if low
int ampli = (_echoSamplesLeft[topAt] - _echoSamplesLeft[botAt]) / 2;
if (ampli < PING_MIN_AMPLI) {
qDebug("Audio Ping unreliable - low amplitude %d.", ampli);
qDebug("Audio Ping unreliable - low amplitude %d.\n", ampli);
}
// Determine period - warn if doesn't look like our signal
int halfPeriod = abs(topAt - botAt);
if (abs(halfPeriod-PING_HALF_PERIOD) > PING_MAX_PERIOD_DIFFERENCE) {
qDebug("Audio Ping unreliable - peak distance %d vs. %d", halfPeriod, PING_HALF_PERIOD);
qDebug("Audio Ping unreliable - peak distance %d vs. %d\n", halfPeriod, PING_HALF_PERIOD);
}
// Ping is sent:
@ -748,7 +748,7 @@ inline void Audio::analyzePing() {
int delay = (botAt + topAt) / 2 + PING_PERIOD;
qDebug("\n| Audio Ping results:\n+----- ---- --- - - - - -\n"
qDebug("\n| Audio Ping results:\n+----- ---- --- - - - - -\n\n"
"Delay = %d samples (%d ms)\nPeak amplitude = %d\n\n",
delay, (delay * 1000) / int(SAMPLE_RATE), ampli);
}

View file

@ -93,7 +93,7 @@ const Mode MODES[] = {
void AvatarVoxelSystem::cycleMode() {
_mode = (_mode + 1) % (sizeof(MODES) / sizeof(MODES[0]));
qDebug("Voxeltar bind mode %d.", _mode);
qDebug("Voxeltar bind mode %d.\n", _mode);
// rebind
QUrl url = _voxelURL;
@ -255,7 +255,7 @@ void AvatarVoxelSystem::handleVoxelDownloadProgress(qint64 bytesReceived, qint64
}
void AvatarVoxelSystem::handleVoxelReplyError() {
qDebug("%s", _voxelReply->errorString().toAscii().constData());
qDebug("%s\n", _voxelReply->errorString().toAscii().constData());
_voxelReply->disconnect(this);
_voxelReply->deleteLater();

View file

@ -100,7 +100,7 @@ void SerialInterface::initializePort(char* portname) {
qDebug("Opening SerialUSB %s: ", portname);
if (_serialDescriptor == -1) {
qDebug("Failed.");
qDebug("Failed.\n");
return;
}
@ -134,7 +134,7 @@ void SerialInterface::initializePort(char* portname) {
mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL | INV_XYZ_COMPASS);
}
qDebug("Connected.");
qDebug("Connected.\n");
resetSerial();
_active = true;
@ -373,7 +373,7 @@ void SerialInterface::readData(float deltaTime) {
gettimeofday(&now, NULL);
if (diffclock(&lastGoodRead, &now) > NO_READ_MAXIMUM_MSECS) {
qDebug("No data - Shutting down SerialInterface.");
qDebug("No data - Shutting down SerialInterface.\n");
resetSerial();
}
} else {

View file

@ -38,7 +38,7 @@ void Transmitter::checkForLostTransmitter() {
int msecsSinceLast = diffclock(_lastReceivedPacket, &now);
if (msecsSinceLast > TIME_TO_ASSUME_LOST_MSECS) {
resetLevels();
qDebug("Transmitter signal lost.");
qDebug("Transmitter signal lost.\n");
}
}
}
@ -93,12 +93,12 @@ void Transmitter::processIncomingData(unsigned char* packetData, int numBytes) {
_estimatedRotation.y *= (1.f - DECAY_RATE * DELTA_TIME);
if (!_isConnected) {
qDebug("Transmitter Connected.");
qDebug("Transmitter Connected.\n");
_isConnected = true;
_estimatedRotation *= 0.0;
}
} else {
qDebug("Transmitter packet read error, %d bytes.", numBytes);
qDebug("Transmitter packet read error, %d bytes.\n", numBytes);
}
}

View file

@ -451,7 +451,7 @@ void renderOrientationDirections(glm::vec3 position, const glm::quat& orientatio
bool closeEnoughForGovernmentWork(float a, float b) {
float distance = std::abs(a-b);
//qDebug("closeEnoughForGovernmentWork() a=%1.10f b=%1.10f distance=%1.10f",a,b,distance);
//qDebug("closeEnoughForGovernmentWork() a=%1.10f b=%1.10f distance=%1.10f\n",a,b,distance);
return (distance < 0.00001f);
}
@ -469,7 +469,7 @@ void runTimingTests() {
gettimeofday(&endTime, NULL);
}
elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("gettimeofday() usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("gettimeofday() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// Random number generation
gettimeofday(&startTime, NULL);
@ -478,7 +478,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("rand() stored in array usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("rand() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// Random number generation using randFloat()
gettimeofday(&startTime, NULL);
@ -487,7 +487,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("randFloat() stored in array usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("randFloat() stored in array usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// PowF function
fTest = 1145323.2342f;
@ -497,7 +497,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("powf(f, 0.5) usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("powf(f, 0.5) usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
// Vector Math
float distance;
@ -510,7 +510,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("vector math usecs: %f [%f msecs total for %d tests]",
qDebug("vector math usecs: %f [%f msecs total for %d tests]\n",
1000.0f * elapsedMsecs / (float) numTests, elapsedMsecs, numTests);
// Vec3 test
@ -524,7 +524,7 @@ void runTimingTests() {
}
gettimeofday(&endTime, NULL);
elapsedMsecs = diffclock(&startTime, &endTime);
qDebug("vec3 assign and dot() usecs: %f", 1000.0f * elapsedMsecs / (float) numTests);
qDebug("vec3 assign and dot() usecs: %f\n", 1000.0f * elapsedMsecs / (float) numTests);
}

View file

@ -144,16 +144,16 @@ int VoxelSystem::parseData(unsigned char* sourceBuffer, int numBytes) {
int commandLength = strlen(command); // commands are null terminated strings
int totalLength = 1+commandLength+1;
qDebug("got Z message len(%d)= %s", numBytes, command);
qDebug("got Z message len(%d)= %s\n", numBytes, command);
while (totalLength <= numBytes) {
if (0==strcmp(command,(char*)"erase all")) {
qDebug("got Z message == erase all");
qDebug("got Z message == erase all\n");
_tree->eraseAllVoxels();
_voxelsInReadArrays = _voxelsInWriteArrays = 0; // better way to do this??
}
if (0==strcmp(command,(char*)"add scene")) {
qDebug("got Z message == add scene - NOT SUPPORTED ON INTERFACE");
qDebug("got Z message == add scene - NOT SUPPORTED ON INTERFACE\n");
}
totalLength += commandLength+1;
}
@ -708,7 +708,7 @@ bool VoxelSystem::randomColorOperation(VoxelNode* node, void* extraData) {
void VoxelSystem::randomizeVoxelColors() {
_nodeCount = 0;
_tree->recurseTreeWithOperation(randomColorOperation);
qDebug("setting randomized true color for %d nodes", _nodeCount);
qDebug("setting randomized true color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -722,7 +722,7 @@ bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, void* extraData)
void VoxelSystem::falseColorizeRandom() {
_nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeRandomOperation);
qDebug("setting randomized false color for %d nodes", _nodeCount);
qDebug("setting randomized false color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -736,7 +736,7 @@ void VoxelSystem::trueColorize() {
PerformanceWarning warn(true, "trueColorize()",true);
_nodeCount = 0;
_tree->recurseTreeWithOperation(trueColorizeOperation);
qDebug("setting true color for %d nodes", _nodeCount);
qDebug("setting true color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -756,7 +756,7 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData)
void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) {
_nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)viewFrustum);
qDebug("setting in view false color for %d nodes", _nodeCount);
qDebug("setting in view false color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -806,10 +806,10 @@ void VoxelSystem::falseColorizeDistanceFromView(ViewFrustum* viewFrustum) {
_maxDistance = 0.0;
_minDistance = FLT_MAX;
_tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation,(void*)viewFrustum);
qDebug("determining distance range for %d nodes", _nodeCount);
qDebug("determining distance range for %d nodes\n", _nodeCount);
_nodeCount = 0;
_tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation,(void*)viewFrustum);
qDebug("setting in distance false color for %d nodes", _nodeCount);
qDebug("setting in distance false color for %d nodes\n", _nodeCount);
setupNewVoxelsForDrawing();
}
@ -921,7 +921,7 @@ void VoxelSystem::removeOutOfView() {
}
bool showRemoveDebugDetails = false;
if (showRemoveDebugDetails) {
qDebug("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d ",
qDebug("removeOutOfView() scanned=%ld removed=%ld inside=%ld intersect=%ld outside=%ld _removedVoxels.count()=%d \n",
args.nodesScanned, args.nodesRemoved, args.nodesInside,
args.nodesIntersect, args.nodesOutside, _removedVoxels.count()
);
@ -987,7 +987,7 @@ bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, void*
void VoxelSystem::falseColorizeRandomEveryOther() {
falseColorizeRandomEveryOtherArgs args;
_tree->recurseTreeWithOperation(falseColorizeRandomEveryOtherOperation,&args);
qDebug("randomized false color for every other node: total %ld, colorable %ld, colored %ld",
qDebug("randomized false color for every other node: total %ld, colorable %ld, colored %ld\n",
args.totalNodes, args.colorableNodes, args.coloredNodes);
setupNewVoxelsForDrawing();
}
@ -1048,7 +1048,7 @@ bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* ex
unsigned long nodeIndex = node->getBufferIndex();
if (args->hasIndexFound[nodeIndex]) {
args->duplicateVBOIndex++;
qDebug("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s ", nodeIndex,
qDebug("duplicateVBO found... index=%ld, isDirty=%s, shouldRender=%s \n", nodeIndex,
debug::valueOf(node->isDirty()), debug::valueOf(node->getShouldRender()));
} else {
args->hasIndexFound[nodeIndex] = true;
@ -1083,13 +1083,13 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
args.expectedMax = _voxelsInWriteArrays;
_tree->recurseTreeWithOperation(collectStatsForTreesAndVBOsOperation,&args);
qDebug("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld ",
qDebug("Local Voxel Tree Statistics:\n total nodes %ld \n leaves %ld \n dirty %ld \n colored %ld \n shouldRender %ld \n",
args.totalNodes, args.leafNodes, args.dirtyNodes, args.coloredNodes, args.shouldRenderNodes);
qDebug(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld ", debug::valueOf(_voxelsDirty),
qDebug(" _voxelsDirty=%s \n _voxelsInWriteArrays=%ld \n minDirty=%ld \n maxDirty=%ld \n", debug::valueOf(_voxelsDirty),
_voxelsInWriteArrays, minDirty, maxDirty);
qDebug(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld ",
qDebug(" inVBO %ld \n nodesInVBOOverExpectedMax %ld \n duplicateVBOIndex %ld \n nodesInVBONotShouldRender %ld \n",
args.nodesInVBO, args.nodesInVBOOverExpectedMax, args.duplicateVBOIndex, args.nodesInVBONotShouldRender);
glBufferIndex minInVBO = GLBUFFER_INDEX_UNKNOWN;
@ -1102,7 +1102,7 @@ void VoxelSystem::collectStatsForTreesAndVBOs() {
}
}
qDebug(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld ",
qDebug(" minInVBO=%ld \n maxInVBO=%ld \n _voxelsInWriteArrays=%ld \n _voxelsInReadArrays=%ld \n",
minInVBO, maxInVBO, _voxelsInWriteArrays, _voxelsInReadArrays);
}
@ -1127,7 +1127,7 @@ void VoxelSystem::createVoxel(float x, float y, float z, float s,
unsigned char red, unsigned char green, unsigned char blue, bool destructive) {
pthread_mutex_lock(&_treeLock);
//qDebug("VoxelSystem::createVoxel(%f,%f,%f,%f)",x,y,z,s);
//qDebug("VoxelSystem::createVoxel(%f,%f,%f,%f)\n",x,y,z,s);
_tree->createVoxel(x, y, z, s, red, green, blue, destructive);
setupNewVoxelsForDrawing();
@ -1253,9 +1253,9 @@ bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, void* extraDat
args->occludedVoxels++;
} else if (result == STORED) {
args->notOccludedVoxels++;
//qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****");
//qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
} else if (result == DOESNT_FIT) {
//qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****");
//qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
}
}
return true; // keep going!
@ -1288,7 +1288,7 @@ void VoxelSystem::falseColorizeOccluded() {
_tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedOperation, position, (void*)&args);
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",
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",
position.x, position.y,
args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,
@ -1374,9 +1374,9 @@ bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, void* extraD
args->occludedVoxels++;
} else if (result == V2_STORED) {
args->notOccludedVoxels++;
//qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****");
//qDebug("***** falseColorizeOccludedOperation() NODE is STORED *****\n");
} else if (result == V2_DOESNT_FIT) {
//qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****");
//qDebug("***** falseColorizeOccludedOperation() NODE DOESNT_FIT???? *****\n");
}
delete voxelPolygon; // V2 maps don't store polygons, so we're always in charge of freeing
}
@ -1413,7 +1413,7 @@ void VoxelSystem::falseColorizeOccludedV2() {
_tree->recurseTreeWithOperationDistanceSorted(falseColorizeOccludedV2Operation, position, (void*)&args);
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",
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",
position.x, position.y,
args.totalVoxels, args.coloredVoxels, args.occludedVoxels,
args.notOccludedVoxels, args.outOfView, args.subtreeVoxelsSkipped,

View file

@ -156,7 +156,7 @@ void Webcam::setFrame(const Mat& frame, int format, const Mat& depth, const Rota
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, _frameWidth = image.width, _frameHeight = image.height, 0, format,
GL_UNSIGNED_BYTE, image.imageData);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qDebug("Capturing video at %dx%d.", _frameWidth, _frameHeight);
qDebug("Capturing video at %dx%d.\n", _frameWidth, _frameHeight);
} else {
glBindTexture(GL_TEXTURE_2D, _frameTextureID);
@ -172,7 +172,7 @@ void Webcam::setFrame(const Mat& frame, int format, const Mat& depth, const Rota
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, _depthWidth = depthImage.width, _depthHeight = depthImage.height, 0,
GL_LUMINANCE, GL_UNSIGNED_BYTE, depthImage.imageData);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qDebug("Capturing depth at %dx%d.", _depthWidth, _depthHeight);
qDebug("Capturing depth at %dx%d.\n", _depthWidth, _depthHeight);
} else {
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
@ -330,26 +330,26 @@ static glm::quat xnToGLM(const XnMatrix3X3& matrix) {
}
static void XN_CALLBACK_TYPE newUser(UserGenerator& generator, XnUserID id, void* cookie) {
qDebug("Found user %d.", id);
qDebug("Found user %d.\n", id);
generator.GetSkeletonCap().RequestCalibration(id, false);
}
static void XN_CALLBACK_TYPE lostUser(UserGenerator& generator, XnUserID id, void* cookie) {
qDebug("Lost user %d.", id);
qDebug("Lost user %d.\n", id);
}
static void XN_CALLBACK_TYPE calibrationStarted(SkeletonCapability& capability, XnUserID id, void* cookie) {
qDebug("Calibration started for user %d.", id);
qDebug("Calibration started for user %d.\n", id);
}
static void XN_CALLBACK_TYPE calibrationCompleted(SkeletonCapability& capability,
XnUserID id, XnCalibrationStatus status, void* cookie) {
if (status == XN_CALIBRATION_STATUS_OK) {
qDebug("Calibration completed for user %d.", id);
qDebug("Calibration completed for user %d.\n", id);
capability.StartTracking(id);
} else {
qDebug("Calibration failed to user %d.", id);
qDebug("Calibration failed to user %d.\n", id);
capability.RequestCalibration(id, true);
}
}
@ -438,7 +438,7 @@ void FrameGrabber::grabFrame() {
// make sure it's in the format we expect
if (image->nChannels != 3 || image->depth != IPL_DEPTH_8U || image->dataOrder != IPL_DATA_ORDER_PIXEL ||
image->origin != 0) {
qDebug("Invalid webcam image format.");
qDebug("Invalid webcam image format.\n");
return;
}
frame = image;
@ -485,7 +485,7 @@ bool FrameGrabber::init() {
// load our face cascade
switchToResourcesParentIfRequired();
if (_faceCascade.empty() && !_faceCascade.load("resources/haarcascades/haarcascade_frontalface_alt.xml")) {
qDebug("Failed to load Haar cascade for face tracking.");
qDebug("Failed to load Haar cascade for face tracking.\n");
return false;
}
@ -513,7 +513,7 @@ bool FrameGrabber::init() {
// next, an ordinary webcam
if ((_capture = cvCaptureFromCAM(-1)) == 0) {
qDebug("Failed to open webcam.");
qDebug("Failed to open webcam.\n");
return false;
}
const int IDEAL_FRAME_WIDTH = 320;

View file

@ -24,8 +24,8 @@ int main(int argc, const char * argv[]) {
gettimeofday(&startup_time, NULL);
Application app(argc, const_cast<char**>(argv), startup_time);
qDebug( "Created QT Application." );
qDebug( "Created QT Application.\n" );
int exitCode = app.exec();
qDebug("Normal exit.");
qDebug("Normal exit.\n");
return exitCode;
}

View file

@ -38,12 +38,12 @@ namespace starfield {
if (! UrlReader::readUrl(url, *this, cacheFile))
{
qDebug("%s:%d: %s",
qDebug("%s:%d: %s\n",
_urlStr, _lineNo, getError());
return false;
}
qDebug("Loaded %u stars.", _recordsRead);
qDebug("Loaded %u stars.\n", _recordsRead);
return true;
}
@ -63,7 +63,7 @@ namespace starfield {
_vertices->clear();
_vertices->reserve(_limit);
// qDebug("Stars.cpp: loader begin %s", url);
// qDebug("Stars.cpp: loader begin %s\n", url);
}
size_t transfer(char* input, size_t bytes) {
@ -103,7 +103,7 @@ namespace starfield {
} else {
qDebug("Stars.cpp:%d: Bad input from %s",
qDebug("Stars.cpp:%d: Bad input from %s\n",
_lineNo, _urlStr);
}
@ -128,7 +128,7 @@ namespace starfield {
// remember the brightness at its top
if (_recordsRead == _limit) {
// qDebug("Stars.cpp: vertex limit reached -> heap mode");
// qDebug("Stars.cpp: vertex limit reached -> heap mode\n");
make_heap(
_vertices->begin(), _vertices->end(),

View file

@ -275,12 +275,13 @@ void NodeList::sendDomainServerCheckIn() {
sockaddr_in tempAddress;
memcpy(&tempAddress.sin_addr, pHostInfo->h_addr_list[0], pHostInfo->h_length);
strcpy(_domainIP, inet_ntoa(tempAddress.sin_addr));
qDebug("Domain Server: %s", _domainHostname);
qDebug("Domain Server: %s\n", _domainHostname);
} else {
qDebug("Failed domain server lookup\n");
}
} else if (!printedDomainServerIP) {
qDebug("Domain Server IP: %s", _domainIP);
qDebug("Domain Server IP: %s\n", _domainIP);
printedDomainServerIP = true;
}
@ -419,7 +420,7 @@ void NodeList::addNodeToList(Node* newNode) {
++_numNodes;
qDebug() << "Added" << *newNode;
qDebug() << "Added " << *newNode;
}
unsigned NodeList::broadcastToNodes(unsigned char *broadcastData, size_t dataBytes, const char* nodeTypes, int numNodeTypes) {

View file

@ -25,12 +25,12 @@ int numberOfThreeBitSectionsInCode(unsigned char * octalCode) {
void printOctalCode(unsigned char * octalCode) {
if (!octalCode) {
qDebug("NULL");
qDebug("NULL\n");
} else {
for (int i = 0; i < bytesRequiredForCodeLength(*octalCode); i++) {
outputBits(octalCode[i],false);
}
qDebug("");
qDebug("\n");
}
}

View file

@ -29,7 +29,7 @@ bool packetVersionMatch(unsigned char* packetHeader) {
if (packetHeader[1] == versionForPacketType(packetHeader[0])) {
return true;
} else {
qDebug("There is a packet version mismatch for packet with header %c", packetHeader[0]);
qDebug("There is a packet version mismatch for packet with header %c\n", packetHeader[0]);
return false;
}
}

View file

@ -59,7 +59,7 @@ PerfStat::~PerfStat() {
}
if (wantDebugOut) {
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%d us:%d ue:%d t:%ld s:%ld e:%ld",
qDebug("PerfStats: %s elapsed:%f average:%lf count:%ld total:%lf ut:%d us:%d ue:%d t:%ld s:%ld e:%ld\n",
this->group.c_str(),elapsed,average,count,totalTime,
(end.tv_usec-start.tv_usec),start.tv_usec,end.tv_usec,
(end.tv_sec-start.tv_sec),start.tv_sec,end.tv_sec
@ -111,12 +111,12 @@ PerformanceWarning::~PerformanceWarning() {
if ((_alwaysDisplay || _renderWarningsOn) && elapsedmsec > 1) {
if (elapsedmsec > 1000) {
double elapsedsec = (end - _start) / 1000000.0;
qDebug("%s%s took %lf seconds", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedsec);
qDebug("%s%s took %lf seconds\n", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedsec);
} else {
qDebug("%s%s took %lf milliseconds", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedmsec);
qDebug("%s%s took %lf milliseconds\n", (_alwaysDisplay ? "" : "WARNING!"), _message, elapsedmsec);
}
} else if (_alwaysDisplay) {
qDebug("%s took %lf milliseconds", _message, elapsedmsec);
qDebug("%s took %lf milliseconds\n", _message, elapsedmsec);
}
};

View file

@ -65,7 +65,7 @@ void outputBufferBits(unsigned char* buffer, int length, bool withNewLine) {
outputBits(buffer[i], false);
}
if (withNewLine) {
qDebug("");
qDebug("\n");
}
}
@ -82,7 +82,7 @@ void outputBits(unsigned char byte, bool withNewLine) {
qDebug(" ] ");
if (withNewLine) {
qDebug("");
qDebug("\n");
}
}
@ -386,11 +386,11 @@ void printVoxelCode(unsigned char* voxelCode) {
unsigned int voxelSizeInOctets = (voxelSizeInBits/3);
unsigned int voxelBufferSize = voxelSizeInBytes+1+3; // 1 for size, 3 for color
qDebug("octets=%d",octets);
qDebug("voxelSizeInBits=%d",voxelSizeInBits);
qDebug("voxelSizeInBytes=%d",voxelSizeInBytes);
qDebug("voxelSizeInOctets=%d",voxelSizeInOctets);
qDebug("voxelBufferSize=%d",voxelBufferSize);
qDebug("octets=%d\n",octets);
qDebug("voxelSizeInBits=%d\n",voxelSizeInBits);
qDebug("voxelSizeInBytes=%d\n",voxelSizeInBytes);
qDebug("voxelSizeInOctets=%d\n",voxelSizeInOctets);
qDebug("voxelBufferSize=%d\n",voxelBufferSize);
for(int i=0;i<voxelBufferSize;i++) {
qDebug("i=%d ",i);

View file

@ -124,7 +124,7 @@ UDPSocket::UDPSocket(int listeningPort) : listeningPort(listeningPort), blocking
handle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (handle <= 0) {
qDebug("Failed to create socket.");
qDebug("Failed to create socket.\n");
return;
}
@ -137,7 +137,7 @@ UDPSocket::UDPSocket(int listeningPort) : listeningPort(listeningPort), blocking
bind_address.sin_port = htons((uint16_t) listeningPort);
if (bind(handle, (const sockaddr*) &bind_address, sizeof(sockaddr_in)) < 0) {
qDebug("Failed to bind socket to port %d.", listeningPort);
qDebug("Failed to bind socket to port %d.\n", listeningPort);
return;
}
@ -154,7 +154,7 @@ UDPSocket::UDPSocket(int listeningPort) : listeningPort(listeningPort), blocking
tv.tv_usec = 500000;
setsockopt(handle, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof tv);
qDebug("Created UDP socket listening on port %d.", listeningPort);
qDebug("Created UDP socket listening on port %d.\n", listeningPort);
}
UDPSocket::~UDPSocket() {
@ -234,7 +234,7 @@ int UDPSocket::send(sockaddr* destAddress, const void* data, size_t byteLength)
0, (sockaddr *) destAddress, sizeof(sockaddr_in));
if (sent_bytes != byteLength) {
qDebug("Failed to send packet: %s", strerror(errno));
qDebug("Failed to send packet: %s\n", strerror(errno));
return false;
}

View file

@ -63,7 +63,7 @@ CoverageMap::CoverageMap(BoundingBox boundingBox, bool isRoot, bool managePolygo
{
_mapCount++;
init();
//qDebug("CoverageMap created... _mapCount=%d",_mapCount);
//qDebug("CoverageMap created... _mapCount=%d\n",_mapCount);
};
CoverageMap::~CoverageMap() {
@ -71,19 +71,19 @@ CoverageMap::~CoverageMap() {
};
void CoverageMap::printStats() {
qDebug("CoverageMap::printStats()...");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d",_mapCount);
qDebug("_checkMapRootCalls=%d",_checkMapRootCalls);
qDebug("_notAllInView=%d",_notAllInView);
qDebug("_maxPolygonsUsed=%d",CoverageRegion::_maxPolygonsUsed);
qDebug("_totalPolygons=%d",CoverageRegion::_totalPolygons);
qDebug("_occlusionTests=%d",CoverageRegion::_occlusionTests);
qDebug("_regionSkips=%d",CoverageRegion::_regionSkips);
qDebug("_tooSmallSkips=%d",CoverageRegion::_tooSmallSkips);
qDebug("_regionFullSkips=%d",CoverageRegion::_regionFullSkips);
qDebug("_outOfOrderPolygon=%d",CoverageRegion::_outOfOrderPolygon);
qDebug("_clippedPolygons=%d",CoverageRegion::_clippedPolygons);
qDebug("CoverageMap::printStats()...\n");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d\n",_mapCount);
qDebug("_checkMapRootCalls=%d\n",_checkMapRootCalls);
qDebug("_notAllInView=%d\n",_notAllInView);
qDebug("_maxPolygonsUsed=%d\n",CoverageRegion::_maxPolygonsUsed);
qDebug("_totalPolygons=%d\n",CoverageRegion::_totalPolygons);
qDebug("_occlusionTests=%d\n",CoverageRegion::_occlusionTests);
qDebug("_regionSkips=%d\n",CoverageRegion::_regionSkips);
qDebug("_tooSmallSkips=%d\n",CoverageRegion::_tooSmallSkips);
qDebug("_regionFullSkips=%d\n",CoverageRegion::_regionFullSkips);
qDebug("_outOfOrderPolygon=%d\n",CoverageRegion::_outOfOrderPolygon);
qDebug("_clippedPolygons=%d\n",CoverageRegion::_clippedPolygons);
}
void CoverageMap::erase() {
@ -102,7 +102,7 @@ void CoverageMap::erase() {
}
if (_isRoot && wantDebugging) {
qDebug("CoverageMap last to be deleted...");
qDebug("CoverageMap last to be deleted...\n");
printStats();
CoverageRegion::_maxPolygonsUsed = 0;
@ -187,7 +187,7 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
if (_isRoot) {
_checkMapRootCalls++;
//qDebug("CoverageMap::checkMap()... storeIt=%s", debug::valueOf(storeIt));
//qDebug("CoverageMap::checkMap()... storeIt=%s\n", debug::valueOf(storeIt));
//polygon->printDebugDetails();
}
@ -196,7 +196,7 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
// not in view, then we just discard it with a DOESNT_FIT, this saves us time checking values later.
if (!polygon->getAllInView()) {
_notAllInView++;
//qDebug("CoverageMap2::checkMap()... V2_OCCLUDED");
//qDebug("CoverageMap2::checkMap()... V2_OCCLUDED\n");
return DOESNT_FIT;
}
@ -243,9 +243,9 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
/*
if (result == STORED)
qDebug("CoverageMap2::checkMap()... STORED");
qDebug("CoverageMap2::checkMap()... STORED\n");
else
qDebug("CoverageMap2::checkMap()... OCCLUDED");
qDebug("CoverageMap2::checkMap()... OCCLUDED\n");
*/
return result;
@ -268,16 +268,16 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
/*
switch (result) {
case STORED:
qDebug("checkMap() = STORED");
qDebug("checkMap() = STORED\n");
break;
case NOT_STORED:
qDebug("checkMap() = NOT_STORED");
qDebug("checkMap() = NOT_STORED\n");
break;
case OCCLUDED:
qDebug("checkMap() = OCCLUDED");
qDebug("checkMap() = OCCLUDED\n");
break;
default:
qDebug("checkMap() = ????? ");
qDebug("checkMap() = ????? \n");
break;
}
*/
@ -290,27 +290,27 @@ CoverageMapStorageResult CoverageMap::checkMap(VoxelProjectedPolygon* polygon, b
// any of our child bounding boxes, so we should add it here.
if (storeIt) {
if (polygon->getBoundingBox().area() > CoverageMap::MINIMUM_POLYGON_AREA_TO_STORE) {
//qDebug("storing polygon of area: %f",polygon->getBoundingBox().area());
//qDebug("storing polygon of area: %f\n",polygon->getBoundingBox().area());
if (storeIn->getPolygonCount() < MAX_POLYGONS_PER_REGION) {
storeIn->storeInArray(polygon);
//qDebug("CoverageMap2::checkMap()... STORED");
//qDebug("CoverageMap2::checkMap()... STORED\n");
return STORED;
} else {
CoverageRegion::_regionFullSkips++;
//qDebug("CoverageMap2::checkMap()... NOT_STORED");
//qDebug("CoverageMap2::checkMap()... NOT_STORED\n");
return NOT_STORED;
}
} else {
CoverageRegion::_tooSmallSkips++;
//qDebug("CoverageMap2::checkMap()... NOT_STORED");
//qDebug("CoverageMap2::checkMap()... NOT_STORED\n");
return NOT_STORED;
}
} else {
//qDebug("CoverageMap2::checkMap()... NOT_STORED");
//qDebug("CoverageMap2::checkMap()... NOT_STORED\n");
return NOT_STORED;
}
}
//qDebug("CoverageMap2::checkMap()... DOESNT_FIT");
//qDebug("CoverageMap2::checkMap()... DOESNT_FIT\n");
return DOESNT_FIT;
}
@ -341,8 +341,8 @@ void CoverageRegion::erase() {
/**
if (_polygonCount) {
qDebug("CoverageRegion::erase()...");
qDebug("_polygonCount=%d",_polygonCount);
qDebug("CoverageRegion::erase()...\n");
qDebug("_polygonCount=%d\n",_polygonCount);
_myBoundingBox.printDebugDetails(getRegionName());
//for (int i = 0; i < _polygonCount; i++) {
// qDebug("_polygons[%d]=",i);
@ -393,7 +393,7 @@ void CoverageRegion::growPolygonArray() {
_polygonDistances = newDistances;
_polygonSizes = newSizes;
_polygonArraySize = _polygonArraySize + DEFAULT_GROW_SIZE;
//qDebug("CoverageMap::growPolygonArray() _polygonArraySize=%d...",_polygonArraySize);
//qDebug("CoverageMap::growPolygonArray() _polygonArraySize=%d...\n",_polygonArraySize);
}
const char* CoverageRegion::getRegionName() const {
@ -438,7 +438,7 @@ bool CoverageRegion::mergeItemsInArray(VoxelProjectedPolygon* seed, bool seedInA
_totalPolygons--;
}
//qDebug("_polygonCount=%d",_polygonCount);
//qDebug("_polygonCount=%d\n",_polygonCount);
// clean up
if (_managePolygons) {
@ -486,7 +486,7 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
// insertion point in this array, and shift the array accordingly
float area = polygon->getBoundingBox().area();
float reverseArea = 4.0f - area;
//qDebug("store by size area=%f reverse area=%f", area, reverseArea);
//qDebug("store by size area=%f reverse area=%f\n", area, reverseArea);
_polygonCount = insertIntoSortedArrays((void*)polygon, reverseArea, IGNORED,
(void**)_polygons, _polygonSizes, IGNORED,
_polygonCount, _polygonArraySize);
@ -500,10 +500,10 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
// Debugging and Optimization Tuning code.
if (_polygonCount > _maxPolygonsUsed) {
_maxPolygonsUsed = _polygonCount;
//qDebug("CoverageRegion new _maxPolygonsUsed reached=%d region=%s",_maxPolygonsUsed, getRegionName());
//qDebug("CoverageRegion new _maxPolygonsUsed reached=%d region=%s\n",_maxPolygonsUsed, getRegionName());
//_myBoundingBox.printDebugDetails("map._myBoundingBox");
} else {
//qDebug("CoverageRegion::storeInArray() _polygonCount=%d region=%s",_polygonCount, getRegionName());
//qDebug("CoverageRegion::storeInArray() _polygonCount=%d region=%s\n",_polygonCount, getRegionName());
}
}

View file

@ -61,7 +61,7 @@ CoverageMapV2::CoverageMapV2(BoundingBox boundingBox, bool isRoot, bool isCovere
{
_mapCount++;
init();
//qDebug("CoverageMapV2 created... _mapCount=%d",_mapCount);
//qDebug("CoverageMapV2 created... _mapCount=%d\n",_mapCount);
};
CoverageMapV2::~CoverageMapV2() {
@ -78,11 +78,11 @@ void CoverageMapV2::erase() {
}
if (_isRoot && wantDebugging) {
qDebug("CoverageMapV2 last to be deleted...");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d",_mapCount);
qDebug("_checkMapRootCalls=%d",_checkMapRootCalls);
qDebug("_notAllInView=%d",_notAllInView);
qDebug("CoverageMapV2 last to be deleted...\n");
qDebug("MINIMUM_POLYGON_AREA_TO_STORE=%f\n",MINIMUM_POLYGON_AREA_TO_STORE);
qDebug("_mapCount=%d\n",_mapCount);
qDebug("_checkMapRootCalls=%d\n",_checkMapRootCalls);
qDebug("_notAllInView=%d\n",_notAllInView);
_mapCount = 0;
_checkMapRootCalls = 0;
_notAllInView = 0;

View file

@ -322,40 +322,40 @@ bool ViewFrustum::matches(const ViewFrustum& compareTo, bool debug) const {
testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation);
if (!result && debug) {
qDebug("ViewFrustum::matches()... result=%s", debug::valueOf(result));
qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f",
qDebug("ViewFrustum::matches()... result=%s\n", debug::valueOf(result));
qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f\n",
(testMatches(compareTo._position,_position) ? "MATCHES " : "NO MATCH"),
compareTo._position.x, compareTo._position.y, compareTo._position.z,
_position.x, _position.y, _position.z );
qDebug("%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f",
qDebug("%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f\n",
(testMatches(compareTo._direction, _direction) ? "MATCHES " : "NO MATCH"),
compareTo._direction.x, compareTo._direction.y, compareTo._direction.z,
_direction.x, _direction.y, _direction.z );
qDebug("%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f",
qDebug("%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f\n",
(testMatches(compareTo._up, _up) ? "MATCHES " : "NO MATCH"),
compareTo._up.x, compareTo._up.y, compareTo._up.z,
_up.x, _up.y, _up.z );
qDebug("%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f",
qDebug("%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f\n",
(testMatches(compareTo._right, _right) ? "MATCHES " : "NO MATCH"),
compareTo._right.x, compareTo._right.y, compareTo._right.z,
_right.x, _right.y, _right.z );
qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f",
qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f\n",
(testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"),
compareTo._fieldOfView, _fieldOfView);
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f\n",
(testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"),
compareTo._aspectRatio, _aspectRatio);
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f",
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f\n",
(testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"),
compareTo._nearClip, _nearClip);
qDebug("%s -- compareTo._farClip=%f _farClip=%f",
qDebug("%s -- compareTo._farClip=%f _farClip=%f\n",
(testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"),
compareTo._farClip, _farClip);
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f\n",
(testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z,
_eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z);
qDebug("%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f",
qDebug("%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f\n",
(testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetOrientation.x, compareTo._eyeOffsetOrientation.y,
compareTo._eyeOffsetOrientation.z, compareTo._eyeOffsetOrientation.w,
@ -418,17 +418,17 @@ void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom
}
void ViewFrustum::printDebugDetails() const {
qDebug("ViewFrustum::printDebugDetails()... ");
qDebug("_position=%f,%f,%f", _position.x, _position.y, _position.z );
qDebug("_direction=%f,%f,%f", _direction.x, _direction.y, _direction.z );
qDebug("_up=%f,%f,%f", _up.x, _up.y, _up.z );
qDebug("_right=%f,%f,%f", _right.x, _right.y, _right.z );
qDebug("_fieldOfView=%f", _fieldOfView);
qDebug("_aspectRatio=%f", _aspectRatio);
qDebug("_nearClip=%f", _nearClip);
qDebug("_farClip=%f", _farClip);
qDebug("_eyeOffsetPosition=%f,%f,%f", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
qDebug("_eyeOffsetOrientation=%f,%f,%f,%f", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
qDebug("ViewFrustum::printDebugDetails()... \n");
qDebug("_position=%f,%f,%f\n", _position.x, _position.y, _position.z );
qDebug("_direction=%f,%f,%f\n", _direction.x, _direction.y, _direction.z );
qDebug("_up=%f,%f,%f\n", _up.x, _up.y, _up.z );
qDebug("_right=%f,%f,%f\n", _right.x, _right.y, _right.z );
qDebug("_fieldOfView=%f\n", _fieldOfView);
qDebug("_aspectRatio=%f\n", _aspectRatio);
qDebug("_nearClip=%f\n", _nearClip);
qDebug("_farClip=%f\n", _farClip);
qDebug("_eyeOffsetPosition=%f,%f,%f\n", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
qDebug("_eyeOffsetOrientation=%f,%f,%f,%f\n", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
_eyeOffsetOrientation.w );
}

View file

@ -259,7 +259,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
// if no child, child isn't a leaf, or child doesn't have a color
if (!_children[i] || _children[i]->isStagedForDeletion() || !_children[i]->isLeaf() || !_children[i]->isColored()) {
allChildrenMatch=false;
//qDebug("SADNESS child missing or not colored! i=%d",i);
//qDebug("SADNESS child missing or not colored! i=%d\n",i);
break;
} else {
if (i==0) {
@ -276,7 +276,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
if (allChildrenMatch) {
//qDebug("allChildrenMatch: pruning tree");
//qDebug("allChildrenMatch: pruning tree\n");
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
delete _children[i]; // delete all the child nodes
_children[i]=NULL; // set it to NULL
@ -310,13 +310,13 @@ void VoxelNode::printDebugDetails(const char* label) const {
}
}
qDebug("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isColored=%s (%d,%d,%d,%d) isDirty=%s shouldRender=%s children=", label,
qDebug("%s - Voxel at corner=(%f,%f,%f) size=%f\n isLeaf=%s isColored=%s (%d,%d,%d,%d) isDirty=%s shouldRender=%s\n children=", label,
_box.getCorner().x, _box.getCorner().y, _box.getCorner().z, _box.getSize().x,
debug::valueOf(isLeaf()), debug::valueOf(isColored()), getColor()[0], getColor()[1], getColor()[2], getColor()[3],
debug::valueOf(isDirty()), debug::valueOf(getShouldRender()));
outputBits(childBits, false);
qDebug(" octalCode=");
qDebug("\n octalCode=");
printOctalCode(_octalCode);
}

View file

@ -95,7 +95,7 @@ void BoundingBox::printDebugDetails(const char* label) const {
} else {
qDebug("BoundingBox");
}
qDebug("\n _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]",
qDebug("\n _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]\n",
debug::valueOf(_set), corner.x, corner.y, size.x, size.y, corner.x, corner.y, corner.x+size.x, corner.y+size.y);
}

View file

@ -157,7 +157,7 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseV
if (childNode) {
// chance to optimize, doesn't need to be actual distance!! Could be distance squared
float distanceSquared = childNode->distanceSquareToPoint(point);
//qDebug("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...", i, point.x, point.y, center.x, center.y, distance);
//qDebug("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...\n", i, point.x, point.y, center.x, center.y, distance);
//childNode->printDebugDetails("");
currentCount = insertIntoSortedArrays((void*)childNode, distanceSquared, i,
(void**)&sortedChildren, (float*)&distancesToChildren,
@ -168,7 +168,7 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseV
for (int i = 0; i < currentCount; i++) {
VoxelNode* childNode = sortedChildren[i];
if (childNode) {
//qDebug("recurseNodeWithOperationDistanceSorted() PROCESSING child[%d] distance=%f...", i, distancesToChildren[i]);
//qDebug("recurseNodeWithOperationDistanceSorted() PROCESSING child[%d] distance=%f...\n", i, distancesToChildren[i]);
//childNode->printDebugDetails("");
recurseNodeWithOperationDistanceSorted(childNode, operation, point, extraData);
}
@ -460,7 +460,7 @@ void VoxelTree::deleteVoxelCodeFromTreeRecursion(VoxelNode* node, void* extraDat
// isn't a colored leaf, and the child branch doesn't exist, so there's nothing to do below and
// we can safely return, ending the recursion and unwinding
if (!childNode) {
//qDebug("new___deleteVoxelCodeFromTree() child branch doesn't exist, but parent is not a leaf, just unwind");
//qDebug("new___deleteVoxelCodeFromTree() child branch doesn't exist, but parent is not a leaf, just unwind\n");
return;
}
@ -548,7 +548,7 @@ void VoxelTree::readCodeColorBufferToTreeRecursion(VoxelNode* node, void* extraD
}
} else {
if (!node->isLeaf()) {
qDebug("WARNING! operation would require deleting children, add Voxel ignored! ");
qDebug("WARNING! operation would require deleting children, add Voxel ignored!\n ");
}
}
@ -688,7 +688,7 @@ void VoxelTree::loadVoxelsFile(const char* fileName, bool wantColorRandomizer) {
int totalBytesRead = 0;
if(file.is_open()) {
qDebug("loading file...");
qDebug("loading file...\n");
bool bail = false;
while (!file.eof() && !bail) {
file.get(octets);
@ -713,14 +713,14 @@ void VoxelTree::loadVoxelsFile(const char* fileName, bool wantColorRandomizer) {
file.get(colorRead);
blue = (unsigned char)colorRead;
qDebug("voxel color from file red:%d, green:%d, blue:%d ",red,green,blue);
qDebug("voxel color from file red:%d, green:%d, blue:%d \n",red,green,blue);
vCount++;
int colorRandomizer = wantColorRandomizer ? randIntInRange (-5, 5) : 0;
voxelData[lengthInBytes+1] = std::max(0,std::min(255,red + colorRandomizer));
voxelData[lengthInBytes+2] = std::max(0,std::min(255,green + colorRandomizer));
voxelData[lengthInBytes+3] = std::max(0,std::min(255,blue + colorRandomizer));
qDebug("voxel color after rand red:%d, green:%d, blue:%d",
qDebug("voxel color after rand red:%d, green:%d, blue:%d\n",
voxelData[lengthInBytes+1], voxelData[lengthInBytes+2], voxelData[lengthInBytes+3]);
//printVoxelCode(voxelData);
@ -821,7 +821,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
if (debug) {
int percentComplete = 100 * (thisRadius/radius);
qDebug("percentComplete=%d",percentComplete);
qDebug("percentComplete=%d\n",percentComplete);
}
for (float theta=0.0; theta <= 2 * M_PI; theta += angleDelta) {
@ -837,7 +837,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
// 2) In all modes, we will use our "outer" color to draw the voxels. Otherwise we will use the average color
if (lastLayer) {
if (false && debug) {
qDebug("adding candy shell: theta=%f phi=%f thisRadius=%f radius=%f",
qDebug("adding candy shell: theta=%f phi=%f thisRadius=%f radius=%f\n",
theta, phi, thisRadius,radius);
}
switch (mode) {
@ -861,7 +861,7 @@ void VoxelTree::createSphere(float radius, float xc, float yc, float zc, float v
green = (unsigned char)std::min(255, std::max(0, (int)(g1 + ((g2 - g1) * gradient))));
blue = (unsigned char)std::min(255, std::max(0, (int)(b1 + ((b2 - b1) * gradient))));
if (debug) {
qDebug("perlin=%f gradient=%f color=(%d,%d,%d)",perlin, gradient, red, green, blue);
qDebug("perlin=%f gradient=%f color=(%d,%d,%d)\n",perlin, gradient, red, green, blue);
}
} break;
}
@ -1178,7 +1178,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
if (childNode) {
// chance to optimize, doesn't need to be actual distance!! Could be distance squared
//float distanceSquared = childNode->distanceSquareToPoint(point);
//qDebug("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...", i, point.x, point.y, center.x, center.y, distance);
//qDebug("recurseNodeWithOperationDistanceSorted() CHECKING child[%d] point=%f,%f center=%f,%f distance=%f...\n", i, point.x, point.y, center.x, center.y, distance);
//childNode->printDebugDetails("");
float distance = params.viewFrustum ? childNode->distanceToCamera(*params.viewFrustum) : 0;
@ -1434,7 +1434,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(VoxelNode* node, unsigned char* outp
bool VoxelTree::readFromSVOFile(const char* fileName) {
std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate);
if(file.is_open()) {
qDebug("loading file %s...", fileName);
qDebug("loading file %s...\n", fileName);
// get file length....
unsigned long fileLength = file.tellg();
@ -1462,14 +1462,14 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
std::stringstream ss;
int err = retrieveData(fileName, ss);
if (err && ss.get() != TAG_Compound) {
qDebug("[ERROR] Invalid schematic file.");
qDebug("[ERROR] Invalid schematic file.\n");
return false;
}
ss.get();
TagCompound schematics(ss);
if (!schematics.getBlocksId() || !schematics.getBlocksData()) {
qDebug("[ERROR] Invalid schematic file.");
qDebug("[ERROR] Invalid schematic file.\n");
return false;
}
@ -1532,7 +1532,7 @@ bool VoxelTree::readFromSchematicFile(const char *fileName) {
}
}
qDebug("Created %d voxels from minecraft import.", count);
qDebug("Created %d voxels from minecraft import.\n", count);
return true;
}
@ -1542,7 +1542,7 @@ void VoxelTree::writeToSVOFile(const char* fileName, VoxelNode* node) const {
std::ofstream file(fileName, std::ios::out|std::ios::binary);
if(file.is_open()) {
qDebug("saving to file %s...", fileName);
qDebug("saving to file %s...\n", fileName);
VoxelNodeBag nodeBag;
// If we were given a specific node, start from there, otherwise start from root