split out octree logging

This commit is contained in:
Seth Alves 2015-04-06 17:04:49 -07:00
parent 8bd77fbcc7
commit 91861e9e5a
14 changed files with 299 additions and 284 deletions

View file

@ -15,6 +15,7 @@
#include <SharedUtil.h>
#include "OctreeLogging.h"
#include "CoverageMap.h"
int CoverageMap::_mapCount = 0;
@ -73,19 +74,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);
qCDebug(octree, "CoverageMap::printStats()...");
qCDebug(octree, "MINIMUM_POLYGON_AREA_TO_STORE=%f",MINIMUM_POLYGON_AREA_TO_STORE);
qCDebug(octree, "_mapCount=%d",_mapCount);
qCDebug(octree, "_checkMapRootCalls=%d",_checkMapRootCalls);
qCDebug(octree, "_notAllInView=%d",_notAllInView);
qCDebug(octree, "_maxPolygonsUsed=%d",CoverageRegion::_maxPolygonsUsed);
qCDebug(octree, "_totalPolygons=%d",CoverageRegion::_totalPolygons);
qCDebug(octree, "_occlusionTests=%d",CoverageRegion::_occlusionTests);
qCDebug(octree, "_regionSkips=%d",CoverageRegion::_regionSkips);
qCDebug(octree, "_tooSmallSkips=%d",CoverageRegion::_tooSmallSkips);
qCDebug(octree, "_regionFullSkips=%d",CoverageRegion::_regionFullSkips);
qCDebug(octree, "_outOfOrderPolygon=%d",CoverageRegion::_outOfOrderPolygon);
qCDebug(octree, "_clippedPolygons=%d",CoverageRegion::_clippedPolygons);
}
void CoverageMap::erase() {
@ -104,7 +105,7 @@ void CoverageMap::erase() {
}
if (_isRoot && wantDebugging) {
qDebug("CoverageMap last to be deleted...");
qCDebug(octree, "CoverageMap last to be deleted...");
printStats();
CoverageRegion::_maxPolygonsUsed = 0;
@ -235,9 +236,9 @@ CoverageMapStorageResult CoverageMap::checkMap(OctreeProjectedPolygon* polygon,
/*
if (result == STORED)
qDebug("CoverageMap2::checkMap()... STORED\n");
qCDebug(octree, "CoverageMap2::checkMap()... STORED\n");
else
qDebug("CoverageMap2::checkMap()... OCCLUDED\n");
qCDebug(octree, "CoverageMap2::checkMap()... OCCLUDED\n");
*/
return result;
@ -260,16 +261,16 @@ CoverageMapStorageResult CoverageMap::checkMap(OctreeProjectedPolygon* polygon,
/*
switch (result) {
case STORED:
qDebug("checkMap() = STORED\n");
qCDebug(octree, "checkMap() = STORED\n");
break;
case NOT_STORED:
qDebug("checkMap() = NOT_STORED\n");
qCDebug(octree, "checkMap() = NOT_STORED\n");
break;
case OCCLUDED:
qDebug("checkMap() = OCCLUDED\n");
qCDebug(octree, "checkMap() = OCCLUDED\n");
break;
default:
qDebug("checkMap() = ????? \n");
qCDebug(octree, "checkMap() = ????? \n");
break;
}
*/
@ -327,11 +328,11 @@ void CoverageRegion::erase() {
/**
if (_polygonCount) {
qDebug("CoverageRegion::erase()...\n");
qDebug("_polygonCount=%d\n",_polygonCount);
qCDebug(octree, "CoverageRegion::erase()...\n");
qCDebug(octree, "_polygonCount=%d\n",_polygonCount);
_myBoundingBox.printDebugDetails(getRegionName());
//for (int i = 0; i < _polygonCount; i++) {
// qDebug("_polygons[%d]=",i);
// qCDebug(octree, "_polygons[%d]=",i);
// _polygons[i]->getBoundingBox().printDebugDetails();
//}
}
@ -538,4 +539,4 @@ CoverageMapStorageResult CoverageRegion::checkRegion(OctreeProjectedPolygon* pol
}
}
return result;
}
}

View file

@ -16,6 +16,7 @@
#include <SharedUtil.h>
#include "OctreeLogging.h"
#include "CoverageMapV2.h"
int CoverageMapV2::_mapCount = 0;
@ -80,11 +81,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);
qCDebug(octree, "CoverageMapV2 last to be deleted...");
qCDebug(octree, "MINIMUM_POLYGON_AREA_TO_STORE=%f",MINIMUM_POLYGON_AREA_TO_STORE);
qCDebug(octree, "_mapCount=%d",_mapCount);
qCDebug(octree, "_checkMapRootCalls=%d",_checkMapRootCalls);
qCDebug(octree, "_notAllInView=%d",_notAllInView);
_mapCount = 0;
_checkMapRootCalls = 0;
_notAllInView = 0;
@ -247,4 +248,4 @@ void CoverageMapV2::recurseMap(const OctreeProjectedPolygon* polygon, bool store
}
// normal exit case... return...
}
}

View file

@ -17,6 +17,7 @@
#include <PacketHeaders.h>
#include <OctalCode.h>
#include "OctreeLogging.h"
#include "JurisdictionMap.h"
@ -148,12 +149,12 @@ void myDebugPrintOctalCode(const unsigned char* octalCode, bool withNewLine) {
JurisdictionMap::JurisdictionMap(const char* rootHexCode, const char* endNodesHexCodes) {
qDebug("JurisdictionMap::JurisdictionMap(const char* rootHexCode=[%p] %s, const char* endNodesHexCodes=[%p] %s)",
qCDebug(octree, "JurisdictionMap::JurisdictionMap(const char* rootHexCode=[%p] %s, const char* endNodesHexCodes=[%p] %s)",
rootHexCode, rootHexCode, endNodesHexCodes, endNodesHexCodes);
_rootOctalCode = hexStringToOctalCode(QString(rootHexCode));
qDebug("JurisdictionMap::JurisdictionMap() _rootOctalCode=%p octalCode=", _rootOctalCode);
qCDebug(octree, "JurisdictionMap::JurisdictionMap() _rootOctalCode=%p octalCode=", _rootOctalCode);
myDebugPrintOctalCode(_rootOctalCode, true);
QString endNodesHexStrings(endNodesHexCodes);
@ -165,13 +166,13 @@ JurisdictionMap::JurisdictionMap(const char* rootHexCode, const char* endNodesHe
unsigned char* endNodeOctcode = hexStringToOctalCode(endNodeHexString);
qDebug("JurisdictionMap::JurisdictionMap() endNodeList(%d)=%s",
qCDebug(octree, "JurisdictionMap::JurisdictionMap() endNodeList(%d)=%s",
i, endNodeHexString.toLocal8Bit().constData());
//printOctalCode(endNodeOctcode);
_endNodes.push_back(endNodeOctcode);
qDebug("JurisdictionMap::JurisdictionMap() endNodeOctcode=%p octalCode=", endNodeOctcode);
qCDebug(octree, "JurisdictionMap::JurisdictionMap() endNodeOctcode=%p octalCode=", endNodeOctcode);
myDebugPrintOctalCode(endNodeOctcode, true);
}
@ -212,7 +213,7 @@ bool JurisdictionMap::readFromFile(const char* filename) {
QString settingsFile(filename);
QSettings settings(settingsFile, QSettings::IniFormat);
QString rootCode = settings.value("root","00").toString();
qDebug() << "rootCode=" << rootCode;
qCDebug(octree) << "rootCode=" << rootCode;
_rootOctalCode = hexStringToOctalCode(rootCode);
printOctalCode(_rootOctalCode);
@ -223,7 +224,7 @@ bool JurisdictionMap::readFromFile(const char* filename) {
foreach (const QString &childKey, childKeys) {
QString childValue = settings.value(childKey).toString();
values.insert(childKey, childValue);
qDebug() << childKey << "=" << childValue;
qCDebug(octree) << childKey << "=" << childValue;
unsigned char* octcode = hexStringToOctalCode(childValue);
printOctalCode(octcode);
@ -237,11 +238,11 @@ bool JurisdictionMap::readFromFile(const char* filename) {
void JurisdictionMap::displayDebugDetails() const {
QString rootNodeValue = octalCodeToHexString(_rootOctalCode);
qDebug() << "root:" << rootNodeValue;
qCDebug(octree) << "root:" << rootNodeValue;
for (size_t i = 0; i < _endNodes.size(); i++) {
QString value = octalCodeToHexString(_endNodes[i]);
qDebug() << "End node[" << i << "]: " << rootNodeValue;
qCDebug(octree) << "End node[" << i << "]: " << rootNodeValue;
}
}

View file

@ -46,6 +46,7 @@
#include "OctreeElementBag.h"
#include "Octree.h"
#include "ViewFrustum.h"
#include "OctreeLogging.h"
QVector<QString> PERSIST_EXTENSIONS = {"svo", "json"};
@ -89,7 +90,7 @@ void Octree::recurseElementWithOperation(OctreeElement* element, RecurseOctreeOp
= LogHandler::getInstance().addRepeatedMessageRegex(
"Octree::recurseElementWithOperation\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qDebug() << "Octree::recurseElementWithOperation() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
qCDebug(octree) << "Octree::recurseElementWithOperation() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return;
}
@ -111,7 +112,7 @@ void Octree::recurseElementWithPostOperation(OctreeElement* element, RecurseOctr
= LogHandler::getInstance().addRepeatedMessageRegex(
"Octree::recurseElementWithPostOperation\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qDebug() << "Octree::recurseElementWithPostOperation() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
qCDebug(octree) << "Octree::recurseElementWithPostOperation() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return;
}
@ -141,7 +142,7 @@ void Octree::recurseElementWithOperationDistanceSorted(OctreeElement* element, R
= LogHandler::getInstance().addRepeatedMessageRegex(
"Octree::recurseElementWithOperationDistanceSorted\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qDebug() << "Octree::recurseElementWithOperationDistanceSorted() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
qCDebug(octree) << "Octree::recurseElementWithOperationDistanceSorted() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return;
}
@ -182,7 +183,7 @@ bool Octree::recurseElementWithOperator(OctreeElement* element, RecurseOctreeOpe
= LogHandler::getInstance().addRepeatedMessageRegex(
"Octree::recurseElementWithOperator\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qDebug() << "Octree::recurseElementWithOperator() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
qCDebug(octree) << "Octree::recurseElementWithOperator() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return false;
}
@ -251,7 +252,7 @@ OctreeElement* Octree::createMissingElement(OctreeElement* lastParentElement, co
= LogHandler::getInstance().addRepeatedMessageRegex(
"Octree::createMissingElement\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qDebug() << "Octree::createMissingElement() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
qCDebug(octree) << "Octree::createMissingElement() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return lastParentElement;
}
int indexOfNewChild = branchIndexWithDescendant(lastParentElement->getOctalCode(), codeToReach);
@ -283,13 +284,13 @@ int Octree::readElementData(OctreeElement* destinationElement, const unsigned ch
const unsigned char ALL_CHILDREN_ASSUMED_TO_EXIST = 0xFF;
if ((size_t)bytesLeftToRead < sizeof(unsigned char)) {
qDebug() << "UNEXPECTED: readElementData() only had " << bytesLeftToRead << " bytes. "
qCDebug(octree) << "UNEXPECTED: readElementData() only had " << bytesLeftToRead << " bytes. "
"Not enough for meaningful data.";
return bytesAvailable; // assume we read the entire buffer...
}
if (destinationElement->getScale() < SCALE_AT_DANGEROUSLY_DEEP_RECURSION) {
qDebug() << "UNEXPECTED: readElementData() destination element is unreasonably small ["
qCDebug(octree) << "UNEXPECTED: readElementData() destination element is unreasonably small ["
<< destinationElement->getScale() << " meters] "
<< " Discarding " << bytesAvailable << " remaining bytes.";
return bytesAvailable; // assume we read the entire buffer...
@ -331,7 +332,7 @@ int Octree::readElementData(OctreeElement* destinationElement, const unsigned ch
if (bytesLeftToRead < bytesForMasks) {
if (bytesLeftToRead > 0) {
qDebug() << "UNEXPECTED: readElementDataFromBuffer() only had " << bytesLeftToRead << " bytes before masks. "
qCDebug(octree) << "UNEXPECTED: readElementDataFromBuffer() only had " << bytesLeftToRead << " bytes before masks. "
"Not enough for meaningful data.";
}
return bytesAvailable; // assume we read the entire buffer...
@ -414,14 +415,14 @@ void Octree::readBitstreamToTree(const unsigned char * bitstream, unsigned long
);
qDebug() << "UNEXPECTED: parsing of the octal code would make UNREASONABLY_DEEP_RECURSION... "
qCDebug(octree) << "UNEXPECTED: parsing of the octal code would make UNREASONABLY_DEEP_RECURSION... "
"numberOfThreeBitSectionsInStream:" << numberOfThreeBitSectionsInStream <<
"This buffer is corrupt. Returning.";
return;
}
if (numberOfThreeBitSectionsInStream == OVERFLOWED_OCTCODE_BUFFER) {
qDebug() << "UNEXPECTED: parsing of the octal code would overflow the buffer. "
qCDebug(octree) << "UNEXPECTED: parsing of the octal code would overflow the buffer. "
"This buffer is corrupt. Returning.";
return;
}
@ -605,7 +606,7 @@ void Octree::processRemoveOctreeElementsBitstream(const unsigned char* bitstream
int codeLength = numberOfThreeBitSectionsInCode(voxelCode, maxSize);
if (codeLength == OVERFLOWED_OCTCODE_BUFFER) {
qDebug("WARNING! Got remove voxel bitstream that would overflow buffer in numberOfThreeBitSectionsInCode(),"
qCDebug(octree, "WARNING! Got remove voxel bitstream that would overflow buffer in numberOfThreeBitSectionsInCode(),"
" bailing processing of packet!");
break;
}
@ -616,7 +617,7 @@ void Octree::processRemoveOctreeElementsBitstream(const unsigned char* bitstream
voxelCode += voxelDataSize;
atByte += voxelDataSize;
} else {
qDebug("WARNING! Got remove voxel bitstream that would overflow buffer, bailing processing!");
qCDebug(octree, "WARNING! Got remove voxel bitstream that would overflow buffer, bailing processing!");
break;
}
}
@ -636,7 +637,7 @@ void Octree::reaverageOctreeElements(OctreeElement* startElement) {
recursionCount++;
}
if (recursionCount > UNREASONABLY_DEEP_RECURSION) {
qDebug("Octree::reaverageOctreeElements()... bailing out of UNREASONABLY_DEEP_RECURSION");
qCDebug(octree, "Octree::reaverageOctreeElements()... bailing out of UNREASONABLY_DEEP_RECURSION");
recursionCount--;
return;
}
@ -1004,7 +1005,7 @@ int Octree::encodeTreeBitstream(OctreeElement* element,
// you can't call this without a valid element
if (!element) {
qDebug("WARNING! encodeTreeBitstream() called with element=NULL");
qCDebug(octree, "WARNING! encodeTreeBitstream() called with element=NULL");
params.stopReason = EncodeBitstreamParams::NULL_NODE;
return bytesWritten;
}
@ -1100,7 +1101,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
// you can't call this without a valid element
if (!element) {
qDebug("WARNING! encodeTreeBitstreamRecursion() called with element=NULL");
qCDebug(octree, "WARNING! encodeTreeBitstreamRecursion() called with element=NULL");
params.stopReason = EncodeBitstreamParams::NULL_NODE;
return bytesAtThisLevel;
}
@ -1541,16 +1542,16 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
}
if (!mustIncludeAllChildData() && !continueThisLevel) {
qDebug() << "WARNING UNEXPECTED CASE: reached end of child element data loop with continueThisLevel=FALSE";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: reached end of child element data loop with continueThisLevel=FALSE";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
if (continueThisLevel && actualChildrenDataBits != childrenDataBits) {
// repair the child data mask
continueThisLevel = packetData->updatePriorBitMask(childDataBitsPlaceHolder, actualChildrenDataBits);
if (!continueThisLevel) {
qDebug() << "WARNING UNEXPECTED CASE: Failed to update childDataBitsPlaceHolder";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Failed to update childDataBitsPlaceHolder";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
}
@ -1565,8 +1566,8 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
params.stats->existsBitsWritten();
}
} else {
qDebug() << "WARNING UNEXPECTED CASE: Failed to append childrenExistInTreeBits";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Failed to append childrenExistInTreeBits";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
}
@ -1580,8 +1581,8 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
params.stats->existsInPacketBitsWritten();
}
} else {
qDebug() << "WARNING UNEXPECTED CASE: Failed to append childrenExistInPacketBits";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Failed to append childrenExistInPacketBits";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
}
@ -1697,8 +1698,8 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
// repair the child exists mask
continueThisLevel = packetData->updatePriorBitMask(childExistsPlaceHolder, childrenExistInPacketBits);
if (!continueThisLevel) {
qDebug() << "WARNING UNEXPECTED CASE: Failed to update childExistsPlaceHolder";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Failed to update childExistsPlaceHolder";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
// If this is the last of the child exists bits, then we're actually be rolling out the entire tree
@ -1708,10 +1709,10 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
if (!continueThisLevel) {
if (wantDebug) {
qDebug() << " WARNING line:" << __LINE__;
qDebug() << " breaking the child recursion loop with continueThisLevel=false!!!";
qDebug() << " AFTER attempting to updatePriorBitMask() for empty sub tree....";
qDebug() << " IS THIS ACCEPTABLE!!!!";
qCDebug(octree) << " WARNING line:" << __LINE__;
qCDebug(octree) << " breaking the child recursion loop with continueThisLevel=false!!!";
qCDebug(octree) << " AFTER attempting to updatePriorBitMask() for empty sub tree....";
qCDebug(octree) << " IS THIS ACCEPTABLE!!!!";
}
break; // can't continue...
}
@ -1743,8 +1744,8 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
// now that all slices are back in the correct order, copy them to the correct output buffer
continueThisLevel = packetData->updatePriorBytes(firstRecursiveSliceOffset, &tempReshuffleBuffer[0], allSlicesSize);
if (!continueThisLevel) {
qDebug() << "WARNING UNEXPECTED CASE: Failed to update recursive slice!!!";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Failed to update recursive slice!!!";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
}
} // end keepDiggingDeeper
@ -1766,7 +1767,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
if (partOfRootFit) {
continueThisLevel = packetData->endLevel(rootDataLevelKey);
if (!continueThisLevel) {
qDebug() << " UNEXPECTED ROOT ELEMENT -- could not packetData->endLevel(rootDataLevelKey) -- line:" << __LINE__;
qCDebug(octree) << " UNEXPECTED ROOT ELEMENT -- could not packetData->endLevel(rootDataLevelKey) -- line:" << __LINE__;
}
} else {
packetData->discardLevel(rootDataLevelKey);
@ -1791,8 +1792,8 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
}
if (!continueThisLevel) {
qDebug() << "WARNING UNEXPECTED CASE: Something failed in packing ROOT data";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Something failed in packing ROOT data";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
}
@ -1805,8 +1806,8 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
packetData->discardLevel(thisLevelKey);
if (!mustIncludeAllChildData()) {
qDebug() << "WARNING UNEXPECTED CASE: Something failed in attempting to pack this element";
qDebug() << "This is not expected!!!! -- continueThisLevel=FALSE....";
qCDebug(octree) << "WARNING UNEXPECTED CASE: Something failed in attempting to pack this element";
qCDebug(octree) << "This is not expected!!!! -- continueThisLevel=FALSE....";
}
}
@ -1815,9 +1816,9 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
// added back to the element bag.
if (!continueThisLevel) {
if (!mustIncludeAllChildData()) {
qDebug() << "WARNING UNEXPECTED CASE - Something failed in attempting to pack this element.";
qDebug() << " If the datatype requires all child data, then this might happen. Otherwise" ;
qDebug() << " this is an unexpected case and we should research a potential logic error." ;
qCDebug(octree) << "WARNING UNEXPECTED CASE - Something failed in attempting to pack this element.";
qCDebug(octree) << " If the datatype requires all child data, then this might happen. Otherwise" ;
qCDebug(octree) << " this is an unexpected case and we should research a potential logic error." ;
}
bag.insert(element);
@ -1864,7 +1865,7 @@ bool Octree::readFromFile(const char* fileName) {
emit importSize(1.0f, 1.0f, 1.0f);
emit importProgress(0);
qDebug() << "Loading file" << qFileName << "...";
qCDebug(octree) << "Loading file" << qFileName << "...";
fileOk = readFromStream(fileLength, fileInputStream);
@ -1891,7 +1892,7 @@ bool Octree::readFromURL(const QString& urlString) {
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
QNetworkReply* reply = networkAccessManager.get(request);
qDebug() << "Downloading svo at" << qPrintable(urlString);
qCDebug(octree) << "Downloading svo at" << qPrintable(urlString);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
@ -1916,10 +1917,10 @@ bool Octree::readFromStream(unsigned long streamLength, QDataStream& inputStream
device->ungetChar(firstChar);
if (firstChar == (char) PacketTypeEntityData) {
qDebug() << "Reading from SVO Stream length:" << streamLength;
qCDebug(octree) << "Reading from SVO Stream length:" << streamLength;
return readSVOFromStream(streamLength, inputStream);
} else {
qDebug() << "Reading from JSON Stream length:" << streamLength;
qCDebug(octree) << "Reading from JSON Stream length:" << streamLength;
return readJSONFromStream(streamLength, inputStream);
}
}
@ -1965,28 +1966,28 @@ bool Octree::readSVOFromStream(unsigned long streamLength, QDataStream& inputStr
dataAt += sizeof(gotVersion);
dataLength -= sizeof(gotVersion);
fileOk = true;
qDebug("SVO file version match. Expected: %d Got: %d",
qCDebug(octree, "SVO file version match. Expected: %d Got: %d",
versionForPacketType(expectedDataPacketType()), gotVersion);
hasBufferBreaks = versionHasSVOfileBreaks(gotVersion);
} else {
qDebug("SVO file version mismatch. Expected: %d Got: %d",
qCDebug(octree, "SVO file version mismatch. Expected: %d Got: %d",
versionForPacketType(expectedDataPacketType()), gotVersion);
}
} else {
qDebug() << "SVO file type mismatch. Expected: " << nameForPacketType(expectedType)
qCDebug(octree) << "SVO file type mismatch. Expected: " << nameForPacketType(expectedType)
<< " Got: " << nameForPacketType(gotType);
}
} else {
qDebug() << " NOTE: this file type does not include type and version information.";
qCDebug(octree) << " NOTE: this file type does not include type and version information.";
fileOk = true; // assume the file is ok
}
if (hasBufferBreaks) {
qDebug() << " this version includes buffer breaks";
qCDebug(octree) << " this version includes buffer breaks";
} else {
qDebug() << " this version does not include buffer breaks";
qCDebug(octree) << " this version does not include buffer breaks";
}
if (fileOk) {
@ -2022,13 +2023,13 @@ bool Octree::readSVOFromStream(unsigned long streamLength, QDataStream& inputStr
remainingLength -= sizeof(chunkLength);
if (chunkLength > remainingLength) {
qDebug() << "UNEXPECTED chunk size of:" << chunkLength
qCDebug(octree) << "UNEXPECTED chunk size of:" << chunkLength
<< "greater than remaining length:" << remainingLength;
break;
}
if (chunkLength > MAX_CHUNK_LENGTH) {
qDebug() << "UNEXPECTED chunk size of:" << chunkLength
qCDebug(octree) << "UNEXPECTED chunk size of:" << chunkLength
<< "greater than MAX_CHUNK_LENGTH:" << MAX_CHUNK_LENGTH;
break;
}
@ -2078,7 +2079,7 @@ void Octree::writeToFile(const char* fileName, OctreeElement* element, QString p
} else if (persistAsFileType == "json") {
writeToJSONFile(cFileName, element);
} else {
qDebug() << "unable to write octree to file of type" << persistAsFileType;
qCDebug(octree) << "unable to write octree to file of type" << persistAsFileType;
}
}
@ -2086,7 +2087,7 @@ void Octree::writeToJSONFile(const char* fileName, OctreeElement* element) {
QFile persistFile(fileName);
QVariantMap entityDescription;
qDebug("Saving to file %s...", fileName);
qCDebug(octree, "Saving to file %s...", fileName);
OctreeElement* top;
if (element) {
@ -2107,7 +2108,7 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) {
std::ofstream file(fileName, std::ios::out|std::ios::binary);
if(file.is_open()) {
qDebug("Saving to file %s...", fileName);
qCDebug(octree, "Saving to file %s...", fileName);
PacketType expectedType = expectedDataPacketType();
PacketVersion expectedVersion = versionForPacketType(expectedType);
@ -2118,14 +2119,14 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) {
// if so, read the first byte of the file and see if it matches the expected version code
file.write(reinterpret_cast<char*>(&expectedType), sizeof(expectedType));
file.write(&expectedVersion, sizeof(expectedVersion));
qDebug() << "SVO file type: " << nameForPacketType(expectedType) << " version: " << (int)expectedVersion;
qCDebug(octree) << "SVO file type: " << nameForPacketType(expectedType) << " version: " << (int)expectedVersion;
hasBufferBreaks = versionHasSVOfileBreaks(expectedVersion);
}
if (hasBufferBreaks) {
qDebug() << " this version includes buffer breaks";
qCDebug(octree) << " this version includes buffer breaks";
} else {
qDebug() << " this version does not include buffer breaks";
qCDebug(octree) << " this version does not include buffer breaks";
}

View file

@ -15,6 +15,7 @@
#include <OctalCode.h>
#include <PacketHeaders.h>
#include "OctreeLogging.h"
#include "OctreeEditPacketSender.h"
const int OctreeEditPacketSender::DEFAULT_MAX_PENDING_MESSAGES = PacketSender::DEFAULT_PACKETS_PER_SECOND;
@ -119,7 +120,7 @@ void OctreeEditPacketSender::queuePacketToNode(const QUuid& nodeUUID, unsigned c
quint64 queuedAt = usecTimestampNow();
quint64 transitTime = queuedAt - createdAt;
qDebug() << "OctreeEditPacketSender::queuePacketToNode() queued " << buffer[0] <<
qCDebug(octree) << "OctreeEditPacketSender::queuePacketToNode() queued " << buffer[0] <<
" - command to node bytes=" << length <<
" satoshiCost=" << satoshiCost <<
" sequence=" << sequence <<

View file

@ -26,6 +26,7 @@
#include "OctreeConstants.h"
#include "OctreeElement.h"
#include "Octree.h"
#include "OctreeLogging.h"
#include "SharedUtil.h"
quint64 OctreeElement::_octreeMemoryUsage = 0;
@ -282,7 +283,7 @@ void OctreeElement::auditChildren(const char* label) const {
OctreeElement* testChildNew = getChildAtIndex(childIndex);
OctreeElement* testChildOld = _childrenArray[childIndex];
qDebug("child at index %d... testChildOld=%p testChildNew=%p %s",
qCebug("child at index %d... testChildOld=%p testChildNew=%p %s",
childIndex, testChildOld, testChildNew ,
((testChildNew != testChildOld) ? " DOES NOT MATCH <<<< BAD <<<<" : " - OK ")
);
@ -435,7 +436,7 @@ OctreeElement* OctreeElement::getChildAtIndex(int childIndex) const {
if (externalIndex < childCount && externalIndex >= 0) {
result = _children.external[externalIndex];
} else {
qDebug("getChildAtIndex() attempt to access external client out of "
qCDebug(octree, "getChildAtIndex() attempt to access external client out of "
"bounds externalIndex=%d <<<<<<<<<< WARNING!!!", externalIndex);
}
break;
@ -446,7 +447,7 @@ OctreeElement* OctreeElement::getChildAtIndex(int childIndex) const {
}
#ifdef HAS_AUDIT_CHILDREN
if (result != _childrenArray[childIndex]) {
qDebug("getChildAtIndex() case:%s result<%p> != _childrenArray[childIndex]<%p> <<<<<<<<<< WARNING!!!",
qCDebug(octree, "getChildAtIndex() case:%s result<%p> != _childrenArray[childIndex]<%p> <<<<<<<<<< WARNING!!!",
caseStr, result,_childrenArray[childIndex]);
}
#endif // def HAS_AUDIT_CHILDREN
@ -1119,7 +1120,7 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
_externalChildrenMemoryUsage += newChildCount * sizeof(OctreeElement*);
} else {
//assert(false);
qDebug("THIS SHOULD NOT HAPPEN previousChildCount == %d && newChildCount == %d",previousChildCount, newChildCount);
qCDebug(octree, "THIS SHOULD NOT HAPPEN previousChildCount == %d && newChildCount == %d",previousChildCount, newChildCount);
}
// check to see if we could store these 4 children locally
@ -1163,7 +1164,7 @@ bool OctreeElement::safeDeepDeleteChildAtIndex(int childIndex, int recursionCoun
= LogHandler::getInstance().addRepeatedMessageRegex(
"OctreeElement::safeDeepDeleteChildAtIndex\\(\\) reached DANGEROUSLY_DEEP_RECURSION, bailing!");
qDebug() << "OctreeElement::safeDeepDeleteChildAtIndex() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
qCDebug(octree) << "OctreeElement::safeDeepDeleteChildAtIndex() reached DANGEROUSLY_DEEP_RECURSION, bailing!";
return deleteApproved;
}
OctreeElement* childToDelete = getChildAtIndex(childIndex);
@ -1398,7 +1399,7 @@ OctreeElement* OctreeElement::getOrCreateChildElementAt(float x, float y, float
float halfOurScale = ourScale / 2.0f;
if(s > ourScale) {
qDebug("UNEXPECTED -- OctreeElement::getOrCreateChildElementAt() s=[%f] > ourScale=[%f] ", s, ourScale);
qCDebug(octree, "UNEXPECTED -- OctreeElement::getOrCreateChildElementAt() s=[%f] > ourScale=[%f] ", s, ourScale);
}
if (s > halfOurScale) {
@ -1521,11 +1522,11 @@ int OctreeElement::getMyChildContaining(const AACube& cube) const {
// TODO: consider changing this to assert()
if (cubeScale > ourScale) {
qDebug() << "UNEXPECTED -- OctreeElement::getMyChildContaining() -- (cubeScale > ourScale)";
qDebug() << " cube=" << cube;
qDebug() << " elements AACube=" << _cube;
qDebug() << " cubeScale=" << cubeScale;
qDebug() << " ourScale=" << ourScale;
qCDebug(octree) << "UNEXPECTED -- OctreeElement::getMyChildContaining() -- (cubeScale > ourScale)";
qCDebug(octree) << " cube=" << cube;
qCDebug(octree) << " elements AACube=" << _cube;
qCDebug(octree) << " cubeScale=" << cubeScale;
qCDebug(octree) << " ourScale=" << ourScale;
assert(false);
}
@ -1553,7 +1554,7 @@ int OctreeElement::getMyChildContaining(const AABox& box) const {
// TODO: consider changing this to assert()
if(boxLargestScale > ourScale) {
qDebug("UNEXPECTED -- OctreeElement::getMyChildContaining() "
qCDebug(octree, "UNEXPECTED -- OctreeElement::getMyChildContaining() "
"boxLargestScale=[%f] > ourScale=[%f] ", boxLargestScale, ourScale);
}

View file

@ -11,6 +11,7 @@
#include <NodeList.h>
#include "OctreeLogging.h"
#include "OctreeHeadlessViewer.h"
OctreeHeadlessViewer::OctreeHeadlessViewer() :
@ -41,16 +42,16 @@ void OctreeHeadlessViewer::queryOctree() {
bool wantExtraDebugging = false;
if (wantExtraDebugging) {
qDebug() << "OctreeHeadlessViewer::queryOctree() _jurisdictionListener=" << _jurisdictionListener;
qDebug() << "---------------";
qDebug() << "_jurisdictionListener=" << _jurisdictionListener;
qDebug() << "Jurisdictions...";
qCDebug(octree) << "OctreeHeadlessViewer::queryOctree() _jurisdictionListener=" << _jurisdictionListener;
qCDebug(octree) << "---------------";
qCDebug(octree) << "_jurisdictionListener=" << _jurisdictionListener;
qCDebug(octree) << "Jurisdictions...";
jurisdictions.lockForRead();
for (NodeToJurisdictionMapIterator i = jurisdictions.begin(); i != jurisdictions.end(); ++i) {
qDebug() << i.key() << ": " << &i.value();
qCDebug(octree) << i.key() << ": " << &i.value();
}
jurisdictions.unlock();
qDebug() << "---------------";
qCDebug(octree) << "---------------";
}
// These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
@ -115,7 +116,7 @@ void OctreeHeadlessViewer::queryOctree() {
});
if (wantExtraDebugging) {
qDebug("Servers: total %d, in view %d, unknown jurisdiction %d",
qCDebug(octree, "Servers: total %d, in view %d, unknown jurisdiction %d",
totalServers, inViewServers, unknownJurisdictionServers);
}
@ -136,7 +137,7 @@ void OctreeHeadlessViewer::queryOctree() {
}
if (wantExtraDebugging) {
qDebug("perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
qCDebug(octree, "perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
}
auto nodeList = DependencyManager::get<NodeList>();
@ -157,7 +158,7 @@ void OctreeHeadlessViewer::queryOctree() {
jurisdictions.unlock();
unknownView = true; // assume it's in view
if (wantExtraDebugging) {
qDebug() << "no known jurisdiction for node " << *node << ", assume it's visible.";
qCDebug(octree) << "no known jurisdiction for node " << *node << ", assume it's visible.";
}
} else {
const JurisdictionMap& map = (jurisdictions)[nodeUUID];
@ -179,7 +180,7 @@ void OctreeHeadlessViewer::queryOctree() {
} else {
jurisdictions.unlock();
if (wantExtraDebugging) {
qDebug() << "Jurisdiction without RootCode for node " << *node << ". That's unusual!";
qCDebug(octree) << "Jurisdiction without RootCode for node " << *node << ". That's unusual!";
}
}
}
@ -187,11 +188,11 @@ void OctreeHeadlessViewer::queryOctree() {
if (inView) {
_octreeQuery.setMaxOctreePacketsPerSecond(perServerPPS);
if (wantExtraDebugging) {
qDebug() << "inView for node " << *node << ", give it budget of " << perServerPPS;
qCDebug(octree) << "inView for node " << *node << ", give it budget of " << perServerPPS;
}
} else if (unknownView) {
if (wantExtraDebugging) {
qDebug() << "no known jurisdiction for node " << *node << ", give it budget of "
qCDebug(octree) << "no known jurisdiction for node " << *node << ", give it budget of "
<< perUnknownServer << " to send us jurisdiction.";
}
@ -205,11 +206,11 @@ void OctreeHeadlessViewer::queryOctree() {
_octreeQuery.setCameraNearClip(0.1f);
_octreeQuery.setCameraFarClip(0.1f);
if (wantExtraDebugging) {
qDebug() << "Using 'minimal' camera position for node" << *node;
qCDebug(octree) << "Using 'minimal' camera position for node" << *node;
}
} else {
if (wantExtraDebugging) {
qDebug() << "Using regular camera position for node" << *node;
qCDebug(octree) << "Using regular camera position for node" << *node;
}
}
_octreeQuery.setMaxOctreePacketsPerSecond(perUnknownServer);

View file

@ -12,6 +12,7 @@
#include <GLMHelpers.h>
#include <PerfStat.h>
#include "OctreeLogging.h"
#include "OctreePacketData.h"
bool OctreePacketData::_debug = false;
@ -65,12 +66,12 @@ bool OctreePacketData::append(const unsigned char* data, int length) {
const bool wantDebug = false;
if (wantDebug && !success) {
qDebug() << "OctreePacketData::append(const unsigned char* data, int length) FAILING....";
qDebug() << " length=" << length;
qDebug() << " _bytesAvailable=" << _bytesAvailable;
qDebug() << " _bytesInUse=" << _bytesInUse;
qDebug() << " _targetSize=" << _targetSize;
qDebug() << " _bytesReserved=" << _bytesReserved;
qCDebug(octree) << "OctreePacketData::append(const unsigned char* data, int length) FAILING....";
qCDebug(octree) << " length=" << length;
qCDebug(octree) << " _bytesAvailable=" << _bytesAvailable;
qCDebug(octree) << " _bytesInUse=" << _bytesInUse;
qCDebug(octree) << " _targetSize=" << _targetSize;
qCDebug(octree) << " _bytesReserved=" << _bytesReserved;
}
return success;
}
@ -176,7 +177,7 @@ const unsigned char* OctreePacketData::getFinalizedData() {
if (_dirty) {
if (_debug) {
qDebug("getFinalizedData() _compressedBytes=%d _bytesInUse=%d",_compressedBytes, _bytesInUse);
qCDebug(octree, "getFinalizedData() _compressedBytes=%d _bytesInUse=%d",_compressedBytes, _bytesInUse);
}
compressContent();
}
@ -190,7 +191,7 @@ int OctreePacketData::getFinalizedSize() {
if (_dirty) {
if (_debug) {
qDebug("getFinalizedSize() _compressedBytes=%d _bytesInUse=%d",_compressedBytes, _bytesInUse);
qCDebug(octree, "getFinalizedSize() _compressedBytes=%d _bytesInUse=%d",_compressedBytes, _bytesInUse);
}
compressContent();
}
@ -241,7 +242,7 @@ void OctreePacketData::discardLevel(LevelDetails key) {
_totalBytesOfColor -= reduceBytesOfColor;
if (_debug) {
qDebug("discardLevel() BEFORE _dirty=%s bytesInLevel=%d _compressedBytes=%d _bytesInUse=%d",
qCDebug(octree, "discardLevel() BEFORE _dirty=%s bytesInLevel=%d _compressedBytes=%d _bytesInUse=%d",
debug::valueOf(_dirty), bytesInLevel, _compressedBytes, _bytesInUse);
}
@ -253,7 +254,7 @@ void OctreePacketData::discardLevel(LevelDetails key) {
_bytesReserved = key._bytesReservedAtStart;
if (_debug) {
qDebug("discardLevel() AFTER _dirty=%s bytesInLevel=%d _compressedBytes=%d _bytesInUse=%d",
qCDebug(octree, "discardLevel() AFTER _dirty=%s bytesInLevel=%d _compressedBytes=%d _bytesInUse=%d",
debug::valueOf(_dirty), bytesInLevel, _compressedBytes, _bytesInUse);
}
}
@ -263,9 +264,9 @@ bool OctreePacketData::endLevel(LevelDetails key) {
// reserved bytes should be the same value as when the level started
if (_bytesReserved != key._bytesReservedAtStart) {
qDebug() << "WARNING: endLevel() called but some reserved bytes not used.";
qDebug() << " current bytesReserved:" << _bytesReserved;
qDebug() << " start level bytesReserved:" << key._bytesReservedAtStart;
qCDebug(octree) << "WARNING: endLevel() called but some reserved bytes not used.";
qCDebug(octree) << " current bytesReserved:" << _bytesReserved;
qCDebug(octree) << " start level bytesReserved:" << key._bytesReservedAtStart;
}
return success;
@ -499,13 +500,13 @@ void OctreePacketData::loadFinalizedContent(const unsigned char* data, int lengt
}
} else {
if (_debug) {
qDebug("OctreePacketData::loadCompressedContent()... length = 0, nothing to do...");
qCDebug(octree, "OctreePacketData::loadCompressedContent()... length = 0, nothing to do...");
}
}
}
void OctreePacketData::debugContent() {
qDebug("OctreePacketData::debugContent()... COMPRESSED DATA.... size=%d",_compressedBytes);
qCDebug(octree, "OctreePacketData::debugContent()... COMPRESSED DATA.... size=%d",_compressedBytes);
int perline=0;
for (int i = 0; i < _compressedBytes; i++) {
printf("%.2x ",_compressed[i]);
@ -517,7 +518,7 @@ void OctreePacketData::debugContent() {
}
printf("\n");
qDebug("OctreePacketData::debugContent()... UNCOMPRESSED DATA.... size=%d",_bytesInUse);
qCDebug(octree, "OctreePacketData::debugContent()... UNCOMPRESSED DATA.... size=%d",_bytesInUse);
perline=0;
for (int i = 0; i < _bytesInUse; i++) {
printf("%.2x ",_uncompressed[i]);

View file

@ -26,6 +26,7 @@
#include <SharedUtil.h>
#include <PathUtils.h>
#include "OctreeLogging.h"
#include "OctreePersistThread.h"
const int OctreePersistThread::DEFAULT_PERSIST_INTERVAL = 1000 * 30; // every 30 seconds
@ -54,7 +55,7 @@ OctreePersistThread::OctreePersistThread(Octree* tree, const QString& filename,
void OctreePersistThread::parseSettings(const QJsonObject& settings) {
if (settings["backups"].isArray()) {
const QJsonArray& backupRules = settings["backups"].toArray();
qDebug() << "BACKUP RULES:";
qCDebug(octree) << "BACKUP RULES:";
foreach (const QJsonValue& value, backupRules) {
@ -77,10 +78,10 @@ void OctreePersistThread::parseSettings(const QJsonObject& settings) {
count = countVal.toInt();
}
qDebug() << " Name:" << obj["Name"].toString();
qDebug() << " format:" << obj["format"].toString();
qDebug() << " interval:" << interval;
qDebug() << " count:" << count;
qCDebug(octree) << " Name:" << obj["Name"].toString();
qCDebug(octree) << " format:" << obj["format"].toString();
qCDebug(octree) << " interval:" << interval;
qCDebug(octree) << " count:" << count;
BackupRule newRule = { obj["Name"].toString(), interval, obj["format"].toString(), count, 0};
@ -89,15 +90,15 @@ void OctreePersistThread::parseSettings(const QJsonObject& settings) {
if (newRule.lastBackup > 0) {
quint64 now = usecTimestampNow();
quint64 sinceLastBackup = now - newRule.lastBackup;
qDebug() << " lastBackup:" << qPrintable(formatUsecTime(sinceLastBackup)) << "ago";
qCDebug(octree) << " lastBackup:" << qPrintable(formatUsecTime(sinceLastBackup)) << "ago";
} else {
qDebug() << " lastBackup: NEVER";
qCDebug(octree) << " lastBackup: NEVER";
}
_backupRules << newRule;
}
} else {
qDebug() << "BACKUP RULES: NONE";
qCDebug(octree) << "BACKUP RULES: NONE";
}
}
@ -122,7 +123,7 @@ bool OctreePersistThread::process() {
if (!_initialLoadComplete) {
quint64 loadStarted = usecTimestampNow();
qDebug() << "loading Octrees from file: " << _filename << "...";
qCDebug(octree) << "loading Octrees from file: " << _filename << "...";
bool persistantFileRead;
@ -135,7 +136,7 @@ bool OctreePersistThread::process() {
QString lockFileName = _filename + ".lock";
std::ifstream lockFile(qPrintable(lockFileName), std::ios::in|std::ios::binary|std::ios::ate);
if(lockFile.is_open()) {
qDebug() << "WARNING: Octree lock file detected at startup:" << lockFileName
qCDebug(octree) << "WARNING: Octree lock file detected at startup:" << lockFileName
<< "-- Attempting to restore from previous backup file.";
// This is where we should attempt to find the most recent backup and restore from
@ -143,9 +144,9 @@ bool OctreePersistThread::process() {
restoreFromMostRecentBackup();
lockFile.close();
qDebug() << "Loading Octree... lock file closed:" << lockFileName;
qCDebug(octree) << "Loading Octree... lock file closed:" << lockFileName;
remove(qPrintable(lockFileName));
qDebug() << "Loading Octree... lock file removed:" << lockFileName;
qCDebug(octree) << "Loading Octree... lock file removed:" << lockFileName;
}
persistantFileRead = _tree->readFromFile(qPrintable(_filename.toLocal8Bit()));
@ -157,23 +158,23 @@ bool OctreePersistThread::process() {
_loadTimeUSecs = loadDone - loadStarted;
_tree->clearDirtyBit(); // the tree is clean since we just loaded it
qDebug("DONE loading Octrees from file... fileRead=%s", debug::valueOf(persistantFileRead));
qCDebug(octree, "DONE loading Octrees from file... fileRead=%s", debug::valueOf(persistantFileRead));
unsigned long nodeCount = OctreeElement::getNodeCount();
unsigned long internalNodeCount = OctreeElement::getInternalNodeCount();
unsigned long leafNodeCount = OctreeElement::getLeafNodeCount();
qDebug("Nodes after loading scene %lu nodes %lu internal %lu leaves", nodeCount, internalNodeCount, leafNodeCount);
qCDebug(octree, "Nodes after loading scene %lu nodes %lu internal %lu leaves", nodeCount, internalNodeCount, leafNodeCount);
bool wantDebug = false;
if (wantDebug) {
double usecPerGet = (double)OctreeElement::getGetChildAtIndexTime()
/ (double)OctreeElement::getGetChildAtIndexCalls();
qDebug() << "getChildAtIndexCalls=" << OctreeElement::getGetChildAtIndexCalls()
qCDebug(octree) << "getChildAtIndexCalls=" << OctreeElement::getGetChildAtIndexCalls()
<< " getChildAtIndexTime=" << OctreeElement::getGetChildAtIndexTime() << " perGet=" << usecPerGet;
double usecPerSet = (double)OctreeElement::getSetChildAtIndexTime()
/ (double)OctreeElement::getSetChildAtIndexCalls();
qDebug() << "setChildAtIndexCalls=" << OctreeElement::getSetChildAtIndexCalls()
qCDebug(octree) << "setChildAtIndexCalls=" << OctreeElement::getSetChildAtIndexCalls()
<< " setChildAtIndexTime=" << OctreeElement::getSetChildAtIndexTime() << " perSet=" << usecPerSet;
}
@ -224,47 +225,47 @@ bool OctreePersistThread::process() {
void OctreePersistThread::aboutToFinish() {
qDebug() << "Persist thread about to finish...";
qCDebug(octree) << "Persist thread about to finish...";
persist();
qDebug() << "Persist thread done with about to finish...";
qCDebug(octree) << "Persist thread done with about to finish...";
}
void OctreePersistThread::persist() {
if (_tree->isDirty()) {
_tree->lockForWrite();
{
qDebug() << "pruning Octree before saving...";
qCDebug(octree) << "pruning Octree before saving...";
_tree->pruneTree();
qDebug() << "DONE pruning Octree before saving...";
qCDebug(octree) << "DONE pruning Octree before saving...";
}
_tree->unlock();
qDebug() << "persist operation calling backup...";
qCDebug(octree) << "persist operation calling backup...";
backup(); // handle backup if requested
qDebug() << "persist operation DONE with backup...";
qCDebug(octree) << "persist operation DONE with backup...";
// create our "lock" file to indicate we're saving.
QString lockFileName = _filename + ".lock";
std::ofstream lockFile(qPrintable(lockFileName), std::ios::out|std::ios::binary);
if(lockFile.is_open()) {
qDebug() << "saving Octree lock file created at:" << lockFileName;
qCDebug(octree) << "saving Octree lock file created at:" << lockFileName;
_tree->writeToFile(qPrintable(_filename), NULL, _persistAsFileType);
time(&_lastPersistTime);
_tree->clearDirtyBit(); // tree is clean after saving
qDebug() << "DONE saving Octree to file...";
qCDebug(octree) << "DONE saving Octree to file...";
lockFile.close();
qDebug() << "saving Octree lock file closed:" << lockFileName;
qCDebug(octree) << "saving Octree lock file closed:" << lockFileName;
remove(qPrintable(lockFileName));
qDebug() << "saving Octree lock file removed:" << lockFileName;
qCDebug(octree) << "saving Octree lock file removed:" << lockFileName;
}
}
}
void OctreePersistThread::restoreFromMostRecentBackup() {
qDebug() << "Restoring from most recent backup...";
qCDebug(octree) << "Restoring from most recent backup...";
QString mostRecentBackupFileName;
QDateTime mostRecentBackupTime;
@ -273,20 +274,20 @@ void OctreePersistThread::restoreFromMostRecentBackup() {
// If we found a backup file, restore from that file.
if (recentBackup) {
qDebug() << "BEST backup file:" << mostRecentBackupFileName << " last modified:" << mostRecentBackupTime.toString();
qCDebug(octree) << "BEST backup file:" << mostRecentBackupFileName << " last modified:" << mostRecentBackupTime.toString();
qDebug() << "Removing old file:" << _filename;
qCDebug(octree) << "Removing old file:" << _filename;
remove(qPrintable(_filename));
qDebug() << "Restoring backup file " << mostRecentBackupFileName << "...";
qCDebug(octree) << "Restoring backup file " << mostRecentBackupFileName << "...";
bool result = QFile::copy(mostRecentBackupFileName, _filename);
if (result) {
qDebug() << "DONE restoring backup file " << mostRecentBackupFileName << "to" << _filename << "...";
qCDebug(octree) << "DONE restoring backup file " << mostRecentBackupFileName << "to" << _filename << "...";
} else {
qDebug() << "ERROR while restoring backup file " << mostRecentBackupFileName << "to" << _filename << "...";
qCDebug(octree) << "ERROR while restoring backup file " << mostRecentBackupFileName << "to" << _filename << "...";
}
} else {
qDebug() << "NO BEST backup file found.";
qCDebug(octree) << "NO BEST backup file found.";
}
}
@ -346,7 +347,7 @@ void OctreePersistThread::rollOldBackupVersions(const BackupRule& rule) {
if (rule.extensionFormat.contains("%N")) {
if (rule.maxBackupVersions > 0) {
qDebug() << "Rolling old backup versions for rule" << rule.name << "...";
qCDebug(octree) << "Rolling old backup versions for rule" << rule.name << "...";
for(int n = rule.maxBackupVersions - 1; n > 0; n--) {
QString backupExtensionN = rule.extensionFormat;
QString backupExtensionNplusOne = rule.extensionFormat;
@ -359,18 +360,18 @@ void OctreePersistThread::rollOldBackupVersions(const BackupRule& rule) {
QFile backupFileN(backupFilenameN);
if (backupFileN.exists()) {
qDebug() << "rolling backup file " << backupFilenameN << "to" << backupFilenameNplusOne << "...";
qCDebug(octree) << "rolling backup file " << backupFilenameN << "to" << backupFilenameNplusOne << "...";
int result = rename(qPrintable(backupFilenameN), qPrintable(backupFilenameNplusOne));
if (result == 0) {
qDebug() << "DONE rolling backup file " << backupFilenameN << "to" << backupFilenameNplusOne << "...";
qCDebug(octree) << "DONE rolling backup file " << backupFilenameN << "to" << backupFilenameNplusOne << "...";
} else {
qDebug() << "ERROR in rolling backup file " << backupFilenameN << "to" << backupFilenameNplusOne << "...";
qCDebug(octree) << "ERROR in rolling backup file " << backupFilenameN << "to" << backupFilenameNplusOne << "...";
}
}
}
qDebug() << "Done rolling old backup versions...";
qCDebug(octree) << "Done rolling old backup versions...";
} else {
qDebug() << "Rolling backups for rule" << rule.name << "."
qCDebug(octree) << "Rolling backups for rule" << rule.name << "."
<< " Max Rolled Backup Versions less than 1 [" << rule.maxBackupVersions << "]."
<< " No need to roll backups...";
}
@ -379,7 +380,7 @@ void OctreePersistThread::rollOldBackupVersions(const BackupRule& rule) {
void OctreePersistThread::backup() {
qDebug() << "backup operation wantBackup:" << _wantBackup;
qCDebug(octree) << "backup operation wantBackup:" << _wantBackup;
if (_wantBackup) {
quint64 now = usecTimestampNow();
@ -390,11 +391,11 @@ void OctreePersistThread::backup() {
quint64 SECS_TO_USECS = 1000 * 1000;
quint64 intervalToBackup = rule.interval * SECS_TO_USECS;
qDebug() << "Checking [" << rule.name << "] - Time since last backup [" << sinceLastBackup << "] " <<
qCDebug(octree) << "Checking [" << rule.name << "] - Time since last backup [" << sinceLastBackup << "] " <<
"compared to backup interval [" << intervalToBackup << "]...";
if (sinceLastBackup > intervalToBackup) {
qDebug() << "Time since last backup [" << sinceLastBackup << "] for rule [" << rule.name
qCDebug(octree) << "Time since last backup [" << sinceLastBackup << "] for rule [" << rule.name
<< "] exceeds backup interval [" << intervalToBackup << "] doing backup now...";
struct tm* localTime = localtime(&_lastPersistTime);
@ -417,25 +418,25 @@ void OctreePersistThread::backup() {
if (rule.maxBackupVersions > 0) {
QFile persistFile(_filename);
if (persistFile.exists()) {
qDebug() << "backing up persist file " << _filename << "to" << backupFileName << "...";
qCDebug(octree) << "backing up persist file " << _filename << "to" << backupFileName << "...";
bool result = QFile::copy(_filename, backupFileName);
if (result) {
qDebug() << "DONE backing up persist file...";
qCDebug(octree) << "DONE backing up persist file...";
rule.lastBackup = now; // only record successful backup in this case.
} else {
qDebug() << "ERROR in backing up persist file...";
qCDebug(octree) << "ERROR in backing up persist file...";
}
} else {
qDebug() << "persist file " << _filename << " does not exist. " <<
qCDebug(octree) << "persist file " << _filename << " does not exist. " <<
"nothing to backup for this rule ["<< rule.name << "]...";
}
} else {
qDebug() << "This backup rule" << rule.name
qCDebug(octree) << "This backup rule" << rule.name
<< " has Max Rolled Backup Versions less than 1 [" << rule.maxBackupVersions << "]."
<< " There are no backups to be done...";
}
} else {
qDebug() << "Backup not needed for this rule ["<< rule.name << "]...";
qCDebug(octree) << "Backup not needed for this rule ["<< rule.name << "]...";
}
}
}

View file

@ -15,6 +15,7 @@
#include "GeometryUtil.h"
#include "SharedUtil.h"
#include "OctreeLogging.h"
#include "OctreeProjectedPolygon.h"
@ -94,7 +95,7 @@ void BoundingBox::explandToInclude(const BoundingBox& box) {
void BoundingBox::printDebugDetails(const char* label) const {
qDebug("%s _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]",
qCDebug(octree, "%s _set=%s\n corner=%f,%f size=%f,%f\n bounds=[(%f,%f) to (%f,%f)]",
(label ? label : "BoundingBox"),
debug::valueOf(_set), corner.x, corner.y, size.x, size.y, corner.x, corner.y, corner.x+size.x, corner.y+size.y);
}
@ -263,12 +264,12 @@ bool OctreeProjectedPolygon::pointInside(const glm::vec2& point, bool* matchesVe
}
void OctreeProjectedPolygon::printDebugDetails() const {
qDebug("OctreeProjectedPolygon..."
qCDebug(octree, "OctreeProjectedPolygon..."
" minX=%f maxX=%f minY=%f maxY=%f", getMinX(), getMaxX(), getMinY(), getMaxY());
qDebug(" vertex count=%d distance=%f", getVertexCount(), getDistance());
qCDebug(octree, " vertex count=%d distance=%f", getVertexCount(), getDistance());
for (int i = 0; i < getVertexCount(); i++) {
glm::vec2 point = getVertex(i);
qDebug(" vertex[%d] = %f, %f ", i, point.x, point.y);
qCDebug(octree, " vertex[%d] = %f, %f ", i, point.x, point.y);
}
}

View file

@ -15,6 +15,7 @@
#include <SharedUtil.h>
#include <PerfStat.h>
#include <RenderArgs.h>
#include "OctreeLogging.h"
#include "OctreeRenderer.h"
OctreeRenderer::OctreeRenderer() :
@ -49,11 +50,11 @@ void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const Shar
bool extraDebugging = false;
if (extraDebugging) {
qDebug() << "OctreeRenderer::processDatagram()";
qCDebug(octree) << "OctreeRenderer::processDatagram()";
}
if (!_tree) {
qDebug() << "OctreeRenderer::processDatagram() called before init, calling init()...";
qCDebug(octree) << "OctreeRenderer::processDatagram() called before init, calling init()...";
this->init();
}
@ -94,7 +95,7 @@ void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const Shar
unsigned int dataBytes = packetLength - (numBytesPacketHeader + OCTREE_PACKET_EXTRA_HEADERS_SIZE);
if (extraDebugging) {
qDebug("OctreeRenderer::processDatagram() ... Got Packet Section"
qCDebug(octree, "OctreeRenderer::processDatagram() ... Got Packet Section"
" color:%s compressed:%s sequence: %u flight:%d usec size:%u data:%u",
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
sequence, flightTime, packetLength, dataBytes);
@ -123,7 +124,7 @@ void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const Shar
OctreePacketData packetData(packetIsCompressed);
packetData.loadFinalizedContent(dataAt, sectionLength);
if (extraDebugging) {
qDebug("OctreeRenderer::processDatagram() ... Got Packet Section"
qCDebug(octree, "OctreeRenderer::processDatagram() ... Got Packet Section"
" color:%s compressed:%s sequence: %u flight:%d usec size:%u data:%u"
" subsection:%d sectionLength:%d uncompressed:%d",
debug::valueOf(packetIsColored), debug::valueOf(packetIsCompressed),
@ -131,11 +132,11 @@ void OctreeRenderer::processDatagram(const QByteArray& dataByteArray, const Shar
packetData.getUncompressedSize());
}
if (extraDebugging) {
qDebug() << "OctreeRenderer::processDatagram() ******* START _tree->readBitstreamToTree()...";
qCDebug(octree) << "OctreeRenderer::processDatagram() ******* START _tree->readBitstreamToTree()...";
}
_tree->readBitstreamToTree(packetData.getUncompressedData(), packetData.getUncompressedSize(), args);
if (extraDebugging) {
qDebug() << "OctreeRenderer::processDatagram() ******* END _tree->readBitstreamToTree()...";
qCDebug(octree) << "OctreeRenderer::processDatagram() ******* END _tree->readBitstreamToTree()...";
}
_tree->unlock();

View file

@ -19,6 +19,7 @@
#include "OctreePacketData.h"
#include "OctreeElement.h"
#include "OctreeLogging.h"
#include "OctreeSceneStats.h"
@ -630,51 +631,51 @@ int OctreeSceneStats::unpackFromMessage(const unsigned char* sourceBuffer, int a
void OctreeSceneStats::printDebugDetails() {
qDebug() << "\n------------------------------";
qDebug() << "OctreeSceneStats:";
qDebug() << "start: " << _start;
qDebug() << "end: " << _end;
qDebug() << "elapsed: " << _elapsed;
qDebug() << "encoding: " << _totalEncodeTime;
qDebug();
qDebug() << "full scene: " << debug::valueOf(_isFullScene);
qDebug() << "moving: " << debug::valueOf(_isMoving);
qDebug();
qDebug() << "packets: " << _packets;
qDebug() << "bytes: " << _bytes;
qDebug();
qDebug() << "total elements: " << _totalElements;
qDebug() << "internal: " << _totalInternal;
qDebug() << "leaves: " << _totalLeaves;
qDebug() << "traversed: " << _traversed;
qDebug() << "internal: " << _internal;
qDebug() << "leaves: " << _leaves;
qDebug() << "skipped distance: " << _skippedDistance;
qDebug() << "internal: " << _internalSkippedDistance;
qDebug() << "leaves: " << _leavesSkippedDistance;
qDebug() << "skipped out of view: " << _skippedOutOfView;
qDebug() << "internal: " << _internalSkippedOutOfView;
qDebug() << "leaves: " << _leavesSkippedOutOfView;
qDebug() << "skipped was in view: " << _skippedWasInView;
qDebug() << "internal: " << _internalSkippedWasInView;
qDebug() << "leaves: " << _leavesSkippedWasInView;
qDebug() << "skipped no change: " << _skippedNoChange;
qDebug() << "internal: " << _internalSkippedNoChange;
qDebug() << "leaves: " << _leavesSkippedNoChange;
qDebug() << "skipped occluded: " << _skippedOccluded;
qDebug() << "internal: " << _internalSkippedOccluded;
qDebug() << "leaves: " << _leavesSkippedOccluded;
qDebug();
qDebug() << "color sent: " << _colorSent;
qDebug() << "internal: " << _internalColorSent;
qDebug() << "leaves: " << _leavesColorSent;
qDebug() << "Didn't Fit: " << _didntFit;
qDebug() << "internal: " << _internalDidntFit;
qDebug() << "leaves: " << _leavesDidntFit;
qDebug() << "color bits: " << _colorBitsWritten;
qDebug() << "exists bits: " << _existsBitsWritten;
qDebug() << "in packet bit: " << _existsInPacketBitsWritten;
qDebug() << "trees removed: " << _treesRemoved;
qCDebug(octree) << "\n------------------------------";
qCDebug(octree) << "OctreeSceneStats:";
qCDebug(octree) << "start: " << _start;
qCDebug(octree) << "end: " << _end;
qCDebug(octree) << "elapsed: " << _elapsed;
qCDebug(octree) << "encoding: " << _totalEncodeTime;
qCDebug(octree);
qCDebug(octree) << "full scene: " << debug::valueOf(_isFullScene);
qCDebug(octree) << "moving: " << debug::valueOf(_isMoving);
qCDebug(octree);
qCDebug(octree) << "packets: " << _packets;
qCDebug(octree) << "bytes: " << _bytes;
qCDebug(octree);
qCDebug(octree) << "total elements: " << _totalElements;
qCDebug(octree) << "internal: " << _totalInternal;
qCDebug(octree) << "leaves: " << _totalLeaves;
qCDebug(octree) << "traversed: " << _traversed;
qCDebug(octree) << "internal: " << _internal;
qCDebug(octree) << "leaves: " << _leaves;
qCDebug(octree) << "skipped distance: " << _skippedDistance;
qCDebug(octree) << "internal: " << _internalSkippedDistance;
qCDebug(octree) << "leaves: " << _leavesSkippedDistance;
qCDebug(octree) << "skipped out of view: " << _skippedOutOfView;
qCDebug(octree) << "internal: " << _internalSkippedOutOfView;
qCDebug(octree) << "leaves: " << _leavesSkippedOutOfView;
qCDebug(octree) << "skipped was in view: " << _skippedWasInView;
qCDebug(octree) << "internal: " << _internalSkippedWasInView;
qCDebug(octree) << "leaves: " << _leavesSkippedWasInView;
qCDebug(octree) << "skipped no change: " << _skippedNoChange;
qCDebug(octree) << "internal: " << _internalSkippedNoChange;
qCDebug(octree) << "leaves: " << _leavesSkippedNoChange;
qCDebug(octree) << "skipped occluded: " << _skippedOccluded;
qCDebug(octree) << "internal: " << _internalSkippedOccluded;
qCDebug(octree) << "leaves: " << _leavesSkippedOccluded;
qCDebug(octree);
qCDebug(octree) << "color sent: " << _colorSent;
qCDebug(octree) << "internal: " << _internalColorSent;
qCDebug(octree) << "leaves: " << _leavesColorSent;
qCDebug(octree) << "Didn't Fit: " << _didntFit;
qCDebug(octree) << "internal: " << _internalDidntFit;
qCDebug(octree) << "leaves: " << _leavesDidntFit;
qCDebug(octree) << "color bits: " << _colorBitsWritten;
qCDebug(octree) << "exists bits: " << _existsBitsWritten;
qCDebug(octree) << "in packet bit: " << _existsInPacketBitsWritten;
qCDebug(octree) << "trees removed: " << _treesRemoved;
}
OctreeSceneStats::ItemInfo OctreeSceneStats::_ITEMS[] = {
@ -845,10 +846,10 @@ void OctreeSceneStats::trackIncomingOctreePacket(const QByteArray& packet,
qint64 flightTime = arrivedAt - sentAt + nodeClockSkewUsec;
if (wantExtraDebugging) {
qDebug() << "sentAt:" << sentAt << " usecs";
qDebug() << "arrivedAt:" << arrivedAt << " usecs";
qDebug() << "nodeClockSkewUsec:" << nodeClockSkewUsec << " usecs";
qDebug() << "flightTime:" << flightTime << " usecs";
qCDebug(octree) << "sentAt:" << sentAt << " usecs";
qCDebug(octree) << "arrivedAt:" << arrivedAt << " usecs";
qCDebug(octree) << "nodeClockSkewUsec:" << nodeClockSkewUsec << " usecs";
qCDebug(octree) << "flightTime:" << flightTime << " usecs";
}
// Guard against possible corrupted packets... with bad timestamps
@ -859,7 +860,7 @@ void OctreeSceneStats::trackIncomingOctreePacket(const QByteArray& packet,
= LogHandler::getInstance().addRepeatedMessageRegex(
"ignoring unreasonable packet... flightTime: -?\\d+ nodeClockSkewUsec: -?\\d+ usecs");
qDebug() << "ignoring unreasonable packet... flightTime:" << flightTime
qCDebug(octree) << "ignoring unreasonable packet... flightTime:" << flightTime
<< "nodeClockSkewUsec:" << nodeClockSkewUsec << "usecs";;
return; // ignore any packets that are unreasonable
}

View file

@ -13,6 +13,8 @@
//
#include "Plane.h"
#include "OctreeLogging.h"
#include <QtCore/QDebug>
@ -63,6 +65,6 @@ float Plane::distance(const glm::vec3 &point) const {
}
void Plane::print() const {
qDebug("Plane - point (x=%f y=%f z=%f) normal (x=%f y=%f z=%f) d=%f",
qCDebug(octree, "Plane - point (x=%f y=%f z=%f) normal (x=%f y=%f z=%f) d=%f",
_point.x, _point.y, _point.z, _normal.x, _normal.y, _normal.z, _dCoefficient);
}

View file

@ -21,6 +21,7 @@
#include "GLMHelpers.h"
#include "SharedUtil.h"
#include "ViewFrustum.h"
#include "OctreeLogging.h"
#include "OctreeConstants.h"
using namespace std;
@ -432,43 +433,43 @@ 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",
qCDebug(octree, "ViewFrustum::matches()... result=%s", debug::valueOf(result));
qCDebug(octree, "%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f",
(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",
qCDebug(octree, "%s -- compareTo._direction=%f,%f,%f _direction=%f,%f,%f",
(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",
qCDebug(octree, "%s -- compareTo._up=%f,%f,%f _up=%f,%f,%f",
(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",
qCDebug(octree, "%s -- compareTo._right=%f,%f,%f _right=%f,%f,%f",
(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",
qCDebug(octree, "%s -- compareTo._fieldOfView=%f _fieldOfView=%f",
(testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"),
compareTo._fieldOfView, _fieldOfView);
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
qCDebug(octree, "%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
(testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"),
compareTo._aspectRatio, _aspectRatio);
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f",
qCDebug(octree, "%s -- compareTo._nearClip=%f _nearClip=%f",
(testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"),
compareTo._nearClip, _nearClip);
qDebug("%s -- compareTo._farClip=%f _farClip=%f",
qCDebug(octree, "%s -- compareTo._farClip=%f _farClip=%f",
(testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"),
compareTo._farClip, _farClip);
qDebug("%s -- compareTo._focalLength=%f _focalLength=%f",
qCDebug(octree, "%s -- compareTo._focalLength=%f _focalLength=%f",
(testMatches(compareTo._focalLength, _focalLength) ? "MATCHES " : "NO MATCH"),
compareTo._focalLength, _focalLength);
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
qCDebug(octree, "%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
(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",
qCDebug(octree, "%s -- compareTo._eyeOffsetOrientation=%f,%f,%f,%f _eyeOffsetOrientation=%f,%f,%f,%f",
(testMatches(compareTo._eyeOffsetOrientation, _eyeOffsetOrientation) ? "MATCHES " : "NO MATCH"),
compareTo._eyeOffsetOrientation.x, compareTo._eyeOffsetOrientation.y,
compareTo._eyeOffsetOrientation.z, compareTo._eyeOffsetOrientation.w,
@ -514,46 +515,46 @@ bool ViewFrustum::isVerySimilar(const ViewFrustum& compareTo, bool debug) const
if (!result && debug) {
qDebug("ViewFrustum::isVerySimilar()... result=%s\n", debug::valueOf(result));
qDebug("%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f",
qCDebug(octree, "ViewFrustum::isVerySimilar()... result=%s\n", debug::valueOf(result));
qCDebug(octree, "%s -- compareTo._position=%f,%f,%f _position=%f,%f,%f",
(testMatches(compareTo._position,_position, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
compareTo._position.x, compareTo._position.y, compareTo._position.z,
_position.x, _position.y, _position.z );
qDebug("%s -- positionDistance=%f",
qCDebug(octree, "%s -- positionDistance=%f",
(testMatches(0,positionDistance, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
positionDistance);
qDebug("%s -- angleOrientation=%f",
qCDebug(octree, "%s -- angleOrientation=%f",
(testMatches(0, angleOrientation, ORIENTATION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
angleOrientation);
qDebug("%s -- compareTo._fieldOfView=%f _fieldOfView=%f",
qCDebug(octree, "%s -- compareTo._fieldOfView=%f _fieldOfView=%f",
(testMatches(compareTo._fieldOfView, _fieldOfView) ? "MATCHES " : "NO MATCH"),
compareTo._fieldOfView, _fieldOfView);
qDebug("%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
qCDebug(octree, "%s -- compareTo._aspectRatio=%f _aspectRatio=%f",
(testMatches(compareTo._aspectRatio, _aspectRatio) ? "MATCHES " : "NO MATCH"),
compareTo._aspectRatio, _aspectRatio);
qDebug("%s -- compareTo._nearClip=%f _nearClip=%f",
qCDebug(octree, "%s -- compareTo._nearClip=%f _nearClip=%f",
(testMatches(compareTo._nearClip, _nearClip) ? "MATCHES " : "NO MATCH"),
compareTo._nearClip, _nearClip);
qDebug("%s -- compareTo._farClip=%f _farClip=%f",
qCDebug(octree, "%s -- compareTo._farClip=%f _farClip=%f",
(testMatches(compareTo._farClip, _farClip) ? "MATCHES " : "NO MATCH"),
compareTo._farClip, _farClip);
qDebug("%s -- compareTo._focalLength=%f _focalLength=%f",
qCDebug(octree, "%s -- compareTo._focalLength=%f _focalLength=%f",
(testMatches(compareTo._focalLength, _focalLength) ? "MATCHES " : "NO MATCH"),
compareTo._focalLength, _focalLength);
qDebug("%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
qCDebug(octree, "%s -- compareTo._eyeOffsetPosition=%f,%f,%f _eyeOffsetPosition=%f,%f,%f",
(testMatches(compareTo._eyeOffsetPosition, _eyeOffsetPosition, POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
compareTo._eyeOffsetPosition.x, compareTo._eyeOffsetPosition.y, compareTo._eyeOffsetPosition.z,
_eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z);
qDebug("%s -- eyeOffsetpositionDistance=%f",
qCDebug(octree, "%s -- eyeOffsetpositionDistance=%f",
(testMatches(0,eyeOffsetpositionDistance, EYEOFFSET_POSITION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
eyeOffsetpositionDistance);
qDebug("%s -- angleEyeOffsetOrientation=%f",
qCDebug(octree, "%s -- angleEyeOffsetOrientation=%f",
(testMatches(0, angleEyeOffsetOrientation, ORIENTATION_SIMILAR_ENOUGH) ? "IS SIMILAR ENOUGH " : "IS NOT SIMILAR ENOUGH"),
angleEyeOffsetOrientation);
}
@ -631,19 +632,19 @@ 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("_keyHoleRadius=%f", _keyholeRadius);
qDebug("_nearClip=%f", _nearClip);
qDebug("_farClip=%f", _farClip);
qDebug("_focalLength=%f", _focalLength);
qDebug("_eyeOffsetPosition=%f,%f,%f", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
qDebug("_eyeOffsetOrientation=%f,%f,%f,%f", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
qCDebug(octree, "ViewFrustum::printDebugDetails()...");
qCDebug(octree, "_position=%f,%f,%f", _position.x, _position.y, _position.z );
qCDebug(octree, "_direction=%f,%f,%f", _direction.x, _direction.y, _direction.z );
qCDebug(octree, "_up=%f,%f,%f", _up.x, _up.y, _up.z );
qCDebug(octree, "_right=%f,%f,%f", _right.x, _right.y, _right.z );
qCDebug(octree, "_fieldOfView=%f", _fieldOfView);
qCDebug(octree, "_aspectRatio=%f", _aspectRatio);
qCDebug(octree, "_keyHoleRadius=%f", _keyholeRadius);
qCDebug(octree, "_nearClip=%f", _nearClip);
qCDebug(octree, "_farClip=%f", _farClip);
qCDebug(octree, "_focalLength=%f", _focalLength);
qCDebug(octree, "_eyeOffsetPosition=%f,%f,%f", _eyeOffsetPosition.x, _eyeOffsetPosition.y, _eyeOffsetPosition.z );
qCDebug(octree, "_eyeOffsetOrientation=%f,%f,%f,%f", _eyeOffsetOrientation.x, _eyeOffsetOrientation.y, _eyeOffsetOrientation.z,
_eyeOffsetOrientation.w );
}