mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 20:44:14 +02:00
quiet some debugging
This commit is contained in:
parent
b244e78af4
commit
f16a48e187
7 changed files with 218 additions and 207 deletions
|
@ -379,26 +379,26 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
|||
if (propertyCount > 0) {
|
||||
int endOfEntityItemData = packetData->getUncompressedByteOffset();
|
||||
|
||||
qDebug() << "Entity Properties THIS ROUND... entityID:" << getEntityItemID();
|
||||
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_MODEL_URL);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_PAGED_PROPERTY)
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_CUSTOM_PROPERTIES_INCLUDED);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_POSITION);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_RADIUS);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ROTATION);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_MASS);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_VELOCITY);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_GRAVITY);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_DAMPING);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_LIFETIME);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_SCRIPT);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_COLOR);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_URL);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_FPS);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_FRAME_INDEX);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_PLAYING);
|
||||
|
||||
if (wantDebug) {
|
||||
qDebug() << "Entity Properties THIS ROUND... entityID:" << getEntityItemID();
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_MODEL_URL);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_PAGED_PROPERTY)
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_CUSTOM_PROPERTIES_INCLUDED);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_POSITION);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_RADIUS);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ROTATION);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_MASS);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_VELOCITY);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_GRAVITY);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_DAMPING);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_LIFETIME);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_SCRIPT);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_COLOR);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_URL);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_FPS);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_FRAME_INDEX);
|
||||
DEBUG_PROPERTY(propertyFlags, PROP_ANIMATION_PLAYING);
|
||||
}
|
||||
|
||||
|
||||
encodedPropertyFlags = propertyFlags;
|
||||
|
@ -409,7 +409,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
|||
// if the size of the PropertyFlags shrunk, we need to shift everything down to front of packet.
|
||||
if (newPropertyFlagsLength < oldPropertyFlagsLength) {
|
||||
|
||||
qDebug() << "PACKET SHIFTING!!! <<<<<<<<<<<<<<<< ";
|
||||
//qDebug() << "PACKET SHIFTING!!! <<<<<<<<<<<<<<<< ";
|
||||
|
||||
int oldSize = packetData->getUncompressedSize();
|
||||
const unsigned char* modelItemData = packetData->getUncompressedData(propertyFlagsOffset + oldPropertyFlagsLength);
|
||||
|
@ -433,31 +433,30 @@ qDebug() << "PACKET SHIFTING!!! <<<<<<<<<<<<<<<< ";
|
|||
if (appendState != OctreeElement::COMPLETED) {
|
||||
// add this item into our list for the next appendElementData() pass
|
||||
|
||||
qDebug() << "Entity Partially encoded... entityID:" << getEntityItemID();
|
||||
|
||||
#define DEBUG_PROPERTY(y, x) if (y.getHasProperty(x)) { qDebug() << " " #x; }
|
||||
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_MODEL_URL);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_PAGED_PROPERTY)
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_CUSTOM_PROPERTIES_INCLUDED);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_POSITION);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_RADIUS);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ROTATION);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_MASS);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_VELOCITY);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_GRAVITY);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_DAMPING);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_LIFETIME);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_SCRIPT);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_COLOR);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_URL);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_FPS);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_FRAME_INDEX);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_PLAYING);
|
||||
|
||||
if (wantDebug) {
|
||||
qDebug() << "Entity Partially encoded... entityID:" << getEntityItemID();
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_MODEL_URL);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_PAGED_PROPERTY)
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_CUSTOM_PROPERTIES_INCLUDED);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_POSITION);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_RADIUS);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ROTATION);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_MASS);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_VELOCITY);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_GRAVITY);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_DAMPING);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_LIFETIME);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_SCRIPT);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_COLOR);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_URL);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_FPS);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_FRAME_INDEX);
|
||||
DEBUG_PROPERTY(propertiesDidntFit, PROP_ANIMATION_PLAYING);
|
||||
}
|
||||
|
||||
entityTreeElementExtraEncodeData->entities.insert(getEntityItemID(), propertiesDidntFit);
|
||||
} else {
|
||||
qDebug() << "Entity COMPLETED... entityID:" << getEntityItemID();
|
||||
//qDebug() << "Entity COMPLETED... entityID:" << getEntityItemID();
|
||||
}
|
||||
|
||||
return appendState;
|
||||
|
@ -553,29 +552,31 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
|||
memcpy(&lastEditedFromBuffer, dataAt, sizeof(lastEditedFromBuffer));
|
||||
dataAt += sizeof(lastEditedFromBuffer);
|
||||
bytesRead += sizeof(lastEditedFromBuffer);
|
||||
|
||||
qDebug() << "data from server **************** ";
|
||||
qDebug() << " entityItemID=" << getEntityItemID();
|
||||
qDebug() << " now=" << usecTimestampNow();
|
||||
qDebug() << " getLastEdited();=" << getLastEdited();
|
||||
qDebug() << " _lastEditedRemote=" << _lastEditedRemote;
|
||||
qDebug() << " _lastEditedLocal=" << _lastEditedLocal;
|
||||
qDebug() << " lastEditedFromBuffer=" << lastEditedFromBuffer << " (BEFORE clockskew adjust)";
|
||||
qDebug() << " clockSkew=" << clockSkew;
|
||||
lastEditedFromBufferAdjusted = lastEditedFromBuffer - clockSkew;
|
||||
qDebug() << " lastEditedFromBufferAdjusted=" << lastEditedFromBufferAdjusted << " (AFTER clockskew adjust)";
|
||||
|
||||
if (wantDebug) {
|
||||
qDebug() << "data from server **************** ";
|
||||
qDebug() << " entityItemID=" << getEntityItemID();
|
||||
qDebug() << " now=" << usecTimestampNow();
|
||||
qDebug() << " getLastEdited();=" << getLastEdited();
|
||||
qDebug() << " _lastEditedRemote=" << _lastEditedRemote;
|
||||
qDebug() << " _lastEditedLocal=" << _lastEditedLocal;
|
||||
qDebug() << " lastEditedFromBuffer=" << lastEditedFromBuffer << " (BEFORE clockskew adjust)";
|
||||
qDebug() << " clockSkew=" << clockSkew;
|
||||
qDebug() << " lastEditedFromBufferAdjusted=" << lastEditedFromBufferAdjusted << " (AFTER clockskew adjust)";
|
||||
}
|
||||
|
||||
|
||||
// If we've changed our local tree more recently than the new data from this packet
|
||||
// then we will not be changing our values, instead we just read and skip the data
|
||||
if (_lastEditedLocal > lastEditedFromBufferAdjusted) {
|
||||
overwriteLocalData = false;
|
||||
if (true || wantDebug) {
|
||||
if (wantDebug) {
|
||||
qDebug() << "IGNORING old data from server!!! ****************";
|
||||
}
|
||||
} else {
|
||||
|
||||
if (true || wantDebug) {
|
||||
if (wantDebug) {
|
||||
qDebug() << "USING NEW data from server!!! ****************";
|
||||
}
|
||||
|
||||
|
|
|
@ -70,37 +70,51 @@ void EntityTreeElement::initializeExtraEncodeData(EncodeBitstreamParams& params)
|
|||
OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData;
|
||||
assert(extraEncodeData); // EntityTrees always require extra encode data on their encoding passes
|
||||
|
||||
const bool wantDebug = false;
|
||||
|
||||
// Check to see if this element yet has encode data... if it doesn't create it
|
||||
if (!extraEncodeData->contains(this)) {
|
||||
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData = new EntityTreeElementExtraEncodeData();
|
||||
|
||||
qDebug() << "EntityTreeElement::initializeExtraEncodeData()... ";
|
||||
qDebug() << " element:" << getAACube();
|
||||
entityTreeElementExtraEncodeData->elementCompleted = (_entityItems->size() == 0);
|
||||
qDebug() << " elementCompleted:" << entityTreeElementExtraEncodeData->elementCompleted << "[ _entityItems->size()=" << _entityItems->size() <<" ]";
|
||||
qDebug() << " --- initialize this element's child element state ---";
|
||||
|
||||
if (wantDebug) {
|
||||
qDebug() << "EntityTreeElement::initializeExtraEncodeData()... ";
|
||||
qDebug() << " element:" << getAACube();
|
||||
qDebug() << " elementCompleted:" << entityTreeElementExtraEncodeData->elementCompleted << "[ _entityItems->size()=" << _entityItems->size() <<" ]";
|
||||
qDebug() << " --- initialize this element's child element state ---";
|
||||
}
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
EntityTreeElement* child = getChildAtIndex(i);
|
||||
if (!child) {
|
||||
entityTreeElementExtraEncodeData->childCompleted[i] = true; // if no child exists, it is completed
|
||||
qDebug() << " childCompleted[" << i <<"]= true -- completed";
|
||||
if (wantDebug) {
|
||||
qDebug() << " childCompleted[" << i <<"]= true -- completed";
|
||||
}
|
||||
} else {
|
||||
if (child->hasEntities()) {
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= false -- HAS ENTITIES NEEDS ENCODING";
|
||||
entityTreeElementExtraEncodeData->childCompleted[i] = false; // HAS ENTITIES NEEDS ENCODING
|
||||
if (wantDebug) {
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= false -- HAS ENTITIES NEEDS ENCODING";
|
||||
}
|
||||
} else {
|
||||
entityTreeElementExtraEncodeData->childCompleted[i] = true; // if the child doesn't have enities, it is completed
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= true -- doesn't have entities";
|
||||
if (wantDebug) {
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= true -- doesn't have entities";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << " --- initialize this element's entities state ---";
|
||||
if (wantDebug) {
|
||||
qDebug() << " --- initialize this element's entities state ---";
|
||||
}
|
||||
for (uint16_t i = 0; i < _entityItems->size(); i++) {
|
||||
EntityItem* entity = (*_entityItems)[i];
|
||||
entityTreeElementExtraEncodeData->entities.insert(entity->getEntityItemID(), entity->getEntityProperties(params));
|
||||
}
|
||||
|
||||
// TODO: some of these inserts might be redundant!!!
|
||||
qDebug() << " ADDING encode data (" << __LINE__ << ") for element " << getAACube() << " data=" << entityTreeElementExtraEncodeData;
|
||||
//qDebug() << " ADDING encode data (" << __LINE__ << ") for element " << getAACube() << " data=" << entityTreeElementExtraEncodeData;
|
||||
extraEncodeData->insert(this, entityTreeElementExtraEncodeData);
|
||||
}
|
||||
}
|
||||
|
@ -125,52 +139,27 @@ bool EntityTreeElement::shouldIncludeChild(int childIndex, EncodeBitstreamParams
|
|||
return false;
|
||||
}
|
||||
|
||||
bool EntityTreeElement::shouldRecurseSubtree(OctreeElement* parent, EncodeBitstreamParams& params, OctreeElementBag* bag) const {
|
||||
qDebug() << "EntityTreeElement::shouldRecurseSubtree()... ????????????????????????";
|
||||
qDebug() << " element:" << getAACube();
|
||||
|
||||
OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData;
|
||||
assert(extraEncodeData); // EntityTrees always require extra encode data on their encoding passes
|
||||
|
||||
if (extraEncodeData->contains(this)) {
|
||||
EntityTreeElementExtraEncodeData* entityTreeElementExtraEncodeData
|
||||
= static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(this));
|
||||
qDebug() << " this element encode data:" << entityTreeElementExtraEncodeData;
|
||||
} else {
|
||||
qDebug() << " this element encode data: MISSING!!!";
|
||||
}
|
||||
|
||||
qDebug() << " parent:" << parent->getAACube();
|
||||
if (extraEncodeData->contains(parent)) {
|
||||
EntityTreeElementExtraEncodeData* parentExtraEncodeData
|
||||
= static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(parent));
|
||||
qDebug() << " parent encode data:" << parentExtraEncodeData;
|
||||
} else {
|
||||
qDebug() << " parent encode data: MISSING!!!";
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void EntityTreeElement::updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const {
|
||||
OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData;
|
||||
assert(extraEncodeData); // EntityTrees always require extra encode data on their encoding passes
|
||||
|
||||
qDebug() << "EntityTreeElement::updateEncodedData()... ";
|
||||
qDebug() << " element:" << getAACube();
|
||||
qDebug() << " child:" << childIndex << getChildAtIndex(childIndex)->getAACube();
|
||||
switch(childAppendState) {
|
||||
case OctreeElement::NONE:
|
||||
qDebug() << " childAppendState: NONE";
|
||||
break;
|
||||
case OctreeElement::PARTIAL:
|
||||
qDebug() << " childAppendState: PARTIAL";
|
||||
break;
|
||||
case OctreeElement::COMPLETED:
|
||||
qDebug() << " childAppendState: COMPLETED";
|
||||
break;
|
||||
const bool wantDebug = false;
|
||||
|
||||
if (wantDebug) {
|
||||
qDebug() << "EntityTreeElement::updateEncodedData()... ";
|
||||
qDebug() << " element:" << getAACube();
|
||||
qDebug() << " child:" << childIndex << getChildAtIndex(childIndex)->getAACube();
|
||||
switch(childAppendState) {
|
||||
case OctreeElement::NONE:
|
||||
qDebug() << " childAppendState: NONE";
|
||||
break;
|
||||
case OctreeElement::PARTIAL:
|
||||
qDebug() << " childAppendState: PARTIAL";
|
||||
break;
|
||||
case OctreeElement::COMPLETED:
|
||||
qDebug() << " childAppendState: COMPLETED";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (extraEncodeData->contains(this)) {
|
||||
|
@ -180,10 +169,15 @@ void EntityTreeElement::updateEncodedData(int childIndex, AppendState childAppen
|
|||
|
||||
if (childAppendState == OctreeElement::COMPLETED) {
|
||||
entityTreeElementExtraEncodeData->childCompleted[childIndex] = true;
|
||||
qDebug() << " SETTING childCompleted[" << childIndex << "] = true - " << getChildAtIndex(childIndex)->getAACube();
|
||||
if (wantDebug) {
|
||||
qDebug() << " SETTING childCompleted[" << childIndex << "] = true - "
|
||||
<< getChildAtIndex(childIndex)->getAACube();
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << " encode data:" << entityTreeElementExtraEncodeData;
|
||||
if (wantDebug) {
|
||||
qDebug() << " encode data:" << entityTreeElementExtraEncodeData;
|
||||
}
|
||||
} else {
|
||||
assert(false); // this shouldn't happen!
|
||||
}
|
||||
|
@ -193,7 +187,7 @@ void EntityTreeElement::updateEncodedData(int childIndex, AppendState childAppen
|
|||
|
||||
|
||||
void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params, OctreeElementBag* bag) const {
|
||||
const bool wantDebug = true;
|
||||
const bool wantDebug = false;
|
||||
OctreeElementExtraEncodeData* extraEncodeData = params.extraEncodeData;
|
||||
assert(extraEncodeData); // EntityTrees always require extra encode data on their encoding passes
|
||||
assert(extraEncodeData->contains(this));
|
||||
|
@ -236,37 +230,46 @@ void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params, Oct
|
|||
EntityTreeElementExtraEncodeData* childExtraEncodeData
|
||||
= static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(childElement));
|
||||
|
||||
// If the child element is not complete, then it should be in the bag for re-encoding
|
||||
if (!thisExtraEncodeData->childCompleted[i]) {
|
||||
if (bag->contains(childElement)) {
|
||||
qDebug() << " GOOD this element's child["<< i << "] " << childElement->getAACube() << " was not complete, but it's in the bag!!";
|
||||
} else {
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i << "] " << childElement->getAACube() << " was not complete, AND IT'S NOT IN THE BAG!!";
|
||||
}
|
||||
}
|
||||
|
||||
if (wantDebug) {
|
||||
// If the child element is not complete, then it should be in the bag for re-encoding
|
||||
if (!thisExtraEncodeData->childCompleted[i]) {
|
||||
if (bag->contains(childElement)) {
|
||||
qDebug() << " GOOD this element's child["<< i << "] "
|
||||
<< childElement->getAACube() << " was not complete, but it's in the bag!!";
|
||||
} else {
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i << "] "
|
||||
<< childElement->getAACube() << " was not complete, AND IT'S NOT IN THE BAG!!";
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << " child[" << i <<"] has extra data";
|
||||
qDebug() << " child:" << childElement->getAACube();
|
||||
qDebug() << " encode data (child):" << childExtraEncodeData;
|
||||
// If we're completing THIS element then ALL of our child elements must have been able to add their element data
|
||||
if (childExtraEncodeData->elementCompleted) {
|
||||
qDebug() << " GOOD this element's child["<< i << "] " << childElement->getAACube() << " element data was complete!!";
|
||||
qDebug() << " GOOD this element's child["<< i << "] "
|
||||
<< childElement->getAACube() << " element data was complete!!";
|
||||
} else {
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i << "] " << childElement->getAACube() << " element data was NOT COMPLETE!!";
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i << "] "
|
||||
<< childElement->getAACube() << " element data was NOT COMPLETE!!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (int ii = 0; ii < NUMBER_OF_CHILDREN; ii++) {
|
||||
if (!childExtraEncodeData->childCompleted[ii]) {
|
||||
OctreeElement* grandChild = childElement->getChildAtIndex(ii);
|
||||
if (bag->contains(childElement)) {
|
||||
qDebug() << " GOOD this element's child["<< i << "]'s child["<< ii << "] " << grandChild->getAACube()
|
||||
<< " was not complete, but the child " << childElement->getAACube() << " is in the bag!!";
|
||||
} else {
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i << "]'s child["<< ii << "] " << grandChild->getAACube()
|
||||
<< " was not complete, AND THE CHILD " << childElement->getAACube() << " IS NOT IN THE BAG!!";
|
||||
if (wantDebug) {
|
||||
OctreeElement* grandChild = childElement->getChildAtIndex(ii);
|
||||
if (bag->contains(childElement)) {
|
||||
qDebug() << " GOOD this element's child["<< i << "]'s child["<< ii << "] " << grandChild->getAACube()
|
||||
<< " was not complete, but the child " << childElement->getAACube()
|
||||
<< " is in the bag!!";
|
||||
} else {
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i
|
||||
<< "]'s child["<< ii << "] " << grandChild->getAACube()
|
||||
<< " was not complete, AND THE CHILD " << childElement->getAACube()
|
||||
<< " IS NOT IN THE BAG!!";
|
||||
}
|
||||
}
|
||||
|
||||
isThisChildReallyComplete = false;
|
||||
|
@ -274,21 +277,23 @@ void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params, Oct
|
|||
}
|
||||
|
||||
if (isThisChildReallyComplete) {
|
||||
/*
|
||||
qDebug() << " REMOVE CHILD EXTRA DATA....";
|
||||
qDebug() << " DELETING -- CHILD EXTRA DATA....";
|
||||
qDebug() << " REMOVING encode data (" << __LINE__ << ") for element " << childElement->getAACube() << " data=" << childExtraEncodeData;
|
||||
if (wantDebug) {
|
||||
qDebug() << " REMOVE CHILD EXTRA DATA....";
|
||||
qDebug() << " DELETING -- CHILD EXTRA DATA....";
|
||||
qDebug() << " REMOVING encode data (" << __LINE__ << ") for element "
|
||||
<< childElement->getAACube() << " data=" << childExtraEncodeData;
|
||||
}
|
||||
extraEncodeData->remove(childElement);
|
||||
delete childExtraEncodeData;
|
||||
*/
|
||||
}
|
||||
} else {
|
||||
qDebug() << " ******* WARNING ********* this element's child["<< i << "] " << childElement->getAACube() << " didn't have extra encode data ------ UNEXPECTED!!!!!";
|
||||
if (wantDebug) {
|
||||
qDebug() << "******* WARNING ********* this element's child["<< i << "] "
|
||||
<< childElement->getAACube() << " didn't have extra encode data ------ UNEXPECTED!!!!!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "------------------------------------------------------------------------------------";
|
||||
}
|
||||
|
||||
OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData* packetData,
|
||||
|
@ -314,27 +319,40 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
|||
} else {
|
||||
// if there wasn't one already, then create one
|
||||
entityTreeElementExtraEncodeData = new EntityTreeElementExtraEncodeData();
|
||||
|
||||
qDebug() << "EntityTreeElement::appendElementData()... ENCODE DATA MISSING, SETTING IT UP NOW ";
|
||||
qDebug() << " element:" << getAACube();
|
||||
entityTreeElementExtraEncodeData->elementCompleted = (_entityItems->size() == 0);
|
||||
qDebug() << " elementCompleted:" << entityTreeElementExtraEncodeData->elementCompleted << "[ _entityItems->size()=" << _entityItems->size() <<" ]";
|
||||
qDebug() << " --- initialize child elements state ---";
|
||||
|
||||
if (wantDebug) {
|
||||
qDebug() << "EntityTreeElement::appendElementData()... ENCODE DATA MISSING, SETTING IT UP NOW ";
|
||||
qDebug() << " element:" << getAACube();
|
||||
qDebug() << " elementCompleted:" << entityTreeElementExtraEncodeData->elementCompleted
|
||||
<< "[ _entityItems->size()=" << _entityItems->size() <<" ]";
|
||||
qDebug() << " --- initialize child elements state ---";
|
||||
}
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||
EntityTreeElement* child = getChildAtIndex(i);
|
||||
if (!child) {
|
||||
entityTreeElementExtraEncodeData->childCompleted[i] = true; // if no child exists, it is completed
|
||||
qDebug() << " childCompleted[" << i <<"]= true -- completed";
|
||||
if (wantDebug) {
|
||||
qDebug() << " childCompleted[" << i <<"]= true -- completed";
|
||||
}
|
||||
} else {
|
||||
if (child->hasEntities()) {
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= false -- HAS ENTITIES NEEDS ENCODING";
|
||||
entityTreeElementExtraEncodeData->childCompleted[i] = false;
|
||||
if (wantDebug) {
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube()
|
||||
<< "= false -- HAS ENTITIES NEEDS ENCODING";
|
||||
}
|
||||
} else {
|
||||
entityTreeElementExtraEncodeData->childCompleted[i] = true; // if the child doesn't have enities, it is completed
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= true -- doesn't have entities";
|
||||
if (wantDebug) {
|
||||
qDebug() << " childCompleted[" << i <<"] " << child->getAACube() << "= true -- doesn't have entities";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << " --- initialize this element's entities state ---";
|
||||
if (wantDebug) {
|
||||
qDebug() << " --- initialize this element's entities state ---";
|
||||
}
|
||||
for (uint16_t i = 0; i < _entityItems->size(); i++) {
|
||||
EntityItem* entity = (*_entityItems)[i];
|
||||
entityTreeElementExtraEncodeData->entities.insert(entity->getEntityItemID(), entity->getEntityProperties(params));
|
||||
|
@ -570,7 +588,7 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
|||
|
||||
} else {
|
||||
// TODO: some of these inserts might be redundant!!!
|
||||
qDebug() << " ADDING encode data (" << __LINE__ << ") for element " << getAACube() << " data=" << entityTreeElementExtraEncodeData;
|
||||
//qDebug() << " ADDING encode data (" << __LINE__ << ") for element " << getAACube() << " data=" << entityTreeElementExtraEncodeData;
|
||||
extraEncodeData->insert(this, entityTreeElementExtraEncodeData);
|
||||
|
||||
if (wantDebug) {
|
||||
|
@ -606,7 +624,7 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
|||
}
|
||||
|
||||
// TODO: some of these inserts might be redundant!!!
|
||||
qDebug() << " ADDING encode data (" << __LINE__ << ") for element " << getAACube() << " data=" << entityTreeElementExtraEncodeData;
|
||||
//qDebug() << " ADDING encode data (" << __LINE__ << ") for element " << getAACube() << " data=" << entityTreeElementExtraEncodeData;
|
||||
extraEncodeData->insert(this, entityTreeElementExtraEncodeData);
|
||||
if (wantDebug) {
|
||||
qDebug() << " RE INSERT OUR EXTRA DATA....";
|
||||
|
|
|
@ -110,7 +110,6 @@ public:
|
|||
virtual void debugExtraEncodeData(EncodeBitstreamParams& params) const;
|
||||
virtual void initializeExtraEncodeData(EncodeBitstreamParams& params) const;
|
||||
virtual bool shouldIncludeChild(int childIndex, EncodeBitstreamParams& params) const;
|
||||
virtual bool shouldRecurseSubtree(OctreeElement* parent, EncodeBitstreamParams& params, OctreeElementBag* bag) const;
|
||||
virtual void updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const;
|
||||
virtual void elementEncodeComplete(EncodeBitstreamParams& params, OctreeElementBag* bag) const;
|
||||
|
||||
|
|
|
@ -142,13 +142,13 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
|||
dataAt += modelURLLength;
|
||||
bytesRead += modelURLLength;
|
||||
|
||||
qDebug() << "ModelEntityItem::readEntitySubclassDataFromBuffer().... EntityID: " << getEntityItemID() << " --- PROP_MODEL_URL:" << modelURLString;
|
||||
//qDebug() << "ModelEntityItem::readEntitySubclassDataFromBuffer().... EntityID: " << getEntityItemID() << " --- PROP_MODEL_URL:" << modelURLString;
|
||||
|
||||
if (overwriteLocalData) {
|
||||
setModelURL(modelURLString);
|
||||
qDebug() << " setModelURL(modelURLString)=" << getModelURL();
|
||||
//qDebug() << " setModelURL(modelURLString)=" << getModelURL();
|
||||
} else {
|
||||
qDebug() << " WARNING >>>>>>>>>>> IGNORING NEW DATA!!!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";
|
||||
//qDebug() << " WARNING >>>>>>>>>>> IGNORING NEW DATA!!!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
|||
successPropertyFits = packetData->appendValue(getModelURL());
|
||||
if (successPropertyFits) {
|
||||
|
||||
qDebug() << "ModelEntityItem::appendSubclassData().... EntityID: " << getEntityItemID() << " --- PROP_MODEL_URL:" << getModelURL();
|
||||
//qDebug() << "ModelEntityItem::appendSubclassData().... EntityID: " << getEntityItemID() << " --- PROP_MODEL_URL:" << getModelURL();
|
||||
|
||||
propertyFlags |= PROP_MODEL_URL;
|
||||
propertiesDidntFit -= PROP_MODEL_URL;
|
||||
|
|
|
@ -10,17 +10,11 @@ http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/newInvader16x16-lar
|
|||
|
||||
-- this appears to be related to clock skew!!!
|
||||
-- need to determine "when to deleted extra data" --
|
||||
|
||||
2) edits not being sent???
|
||||
|
||||
|
||||
|
||||
When encoding ----
|
||||
if the parent node gets pulled from the bag first... things go ok
|
||||
if the child node gets pulled first --
|
||||
and it encodes the grandchildren ---
|
||||
THEN -- it seems like things break:
|
||||
1) the parent node will encode the children -- OK
|
||||
2) then will attempt to recurse into the children..
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -952,7 +952,7 @@ int Octree::encodeTreeBitstream(OctreeElement* element,
|
|||
// If the octalcode couldn't fit, then we can return, because no nodes below us will fit...
|
||||
if (!roomForOctalCode) {
|
||||
bag.insert(element);
|
||||
qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
//qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||
return bytesWritten;
|
||||
}
|
||||
|
@ -1013,7 +1013,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
|
||||
// The append state of this level/element.
|
||||
OctreeElement::AppendState elementAppendState = OctreeElement::COMPLETED; // assume the best
|
||||
if (element != _rootElement) {
|
||||
if (wantDebug && element != _rootElement) {
|
||||
qDebug() << "TOP OF Octree::encodeTreeBitstreamRecursion().... elementAppendState = OctreeElement::COMPLETED ----";
|
||||
if (element) {
|
||||
qDebug() << " element=" << element->getAACube();
|
||||
|
@ -1030,7 +1030,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
if (!element) {
|
||||
qDebug("WARNING! encodeTreeBitstreamRecursion() called with element=NULL");
|
||||
params.stopReason = EncodeBitstreamParams::NULL_NODE;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -1042,7 +1042,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
// If we've reached our max Search Level, then stop searching.
|
||||
if (currentEncodeLevel >= params.maxEncodeLevel) {
|
||||
params.stopReason = EncodeBitstreamParams::TOO_DEEP;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -1052,7 +1052,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
// but once we're in our own jurisdiction, then we need to make sure we're not below it.
|
||||
if (JurisdictionMap::BELOW == params.jurisdictionMap->isMyJurisdiction(element->getOctalCode(), CHECK_NODE_ONLY)) {
|
||||
params.stopReason = EncodeBitstreamParams::OUT_OF_JURISDICTION;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
}
|
||||
|
@ -1071,7 +1071,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
params.stats->skippedDistance(element);
|
||||
}
|
||||
params.stopReason = EncodeBitstreamParams::LOD_SKIP;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -1090,7 +1090,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
params.stats->skippedOutOfView(element);
|
||||
}
|
||||
params.stopReason = EncodeBitstreamParams::OUT_OF_VIEW;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -1131,7 +1131,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
params.stats->skippedWasInView(element);
|
||||
}
|
||||
params.stopReason = EncodeBitstreamParams::WAS_IN_VIEW;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -1143,8 +1143,10 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
params.stats->skippedNoChange(element);
|
||||
}
|
||||
params.stopReason = EncodeBitstreamParams::NO_CHANGE;
|
||||
if (element != _rootElement) {
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
if (wantDebug) {
|
||||
if (element != _rootElement) {
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
}
|
||||
}
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
@ -1166,7 +1168,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
params.stats->skippedOccluded(element);
|
||||
}
|
||||
params.stopReason = EncodeBitstreamParams::OCCLUDED;
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
} else {
|
||||
|
@ -1211,12 +1213,12 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
|
||||
// If we can't reserve our minimum bytes then we can discard this level and return as if none of this level fits
|
||||
if (!continueThisLevel) {
|
||||
qDebug() << " .....COULDN'T RESERVE MINIMUM BYTES.....";
|
||||
//qDebug() << " .....COULDN'T RESERVE MINIMUM BYTES.....";
|
||||
packetData->discardLevel(thisLevelKey);
|
||||
qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
//qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||
bag.insert(element);
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -1444,7 +1446,7 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
// to be completed.
|
||||
LevelDetails childDataLevelKey = packetData->startLevel();
|
||||
|
||||
qDebug() << "Octree::encodeTreeBitstreamRecursion().... calling childElement->appendElementData()... child:" << childElement->getAACube();
|
||||
//qDebug() << "Octree::encodeTreeBitstreamRecursion().... calling childElement->appendElementData()... child:" << childElement->getAACube();
|
||||
OctreeElement::AppendState childAppendState = childElement->appendElementData(packetData, params);
|
||||
|
||||
// allow our tree subclass to do any additional bookkeeping it needs to do with encoded data state
|
||||
|
@ -1466,8 +1468,8 @@ qDebug() << "Octree::encodeTreeBitstreamRecursion().... calling childElement->ap
|
|||
packetData->discardLevel(childDataLevelKey);
|
||||
elementAppendState = OctreeElement::PARTIAL;
|
||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||
qDebug() << "Octree::encodeTreeBitstreamRecursion().... at least one child didn't fit elementAppendState = OctreeElement::PARTIAL ----";
|
||||
qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
//qDebug() << "Octree::encodeTreeBitstreamRecursion().... at least one child didn't fit elementAppendState = OctreeElement::PARTIAL ----";
|
||||
//qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
}
|
||||
|
||||
// If this child was partially appended, then consider this element to be partially appended
|
||||
|
@ -1478,8 +1480,8 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
}
|
||||
elementAppendState = OctreeElement::PARTIAL;
|
||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||
qDebug() << "Octree::encodeTreeBitstreamRecursion().... at least one child WAS PARTIAL elementAppendState = OctreeElement::PARTIAL ----";
|
||||
qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
//qDebug() << "Octree::encodeTreeBitstreamRecursion().... at least one child WAS PARTIAL elementAppendState = OctreeElement::PARTIAL ----";
|
||||
//qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
}
|
||||
|
||||
int bytesAfterChild = packetData->getUncompressedSize();
|
||||
|
@ -1491,11 +1493,13 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
params.stats->colorSent(childElement);
|
||||
}
|
||||
} else {
|
||||
qDebug() << "Octree::encodeTreeBitstreamRecursion().... DIDN'T ATTEMPT TO appendElementData() for child[" << i << "]";
|
||||
if (childElement) {
|
||||
qDebug() << " childElement=" << childElement->getAACube();
|
||||
} else {
|
||||
qDebug() << " childElement=NULL";
|
||||
if (wantDebug) {
|
||||
qDebug() << "Octree::encodeTreeBitstreamRecursion().... DIDN'T ATTEMPT TO appendElementData() for child[" << i << "]";
|
||||
if (childElement) {
|
||||
qDebug() << " childElement=" << childElement->getAACube();
|
||||
} else {
|
||||
qDebug() << " childElement=NULL";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1613,10 +1617,8 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
// recursing, by returning TRUE in recurseChildrenWithData().
|
||||
|
||||
if (recurseChildrenWithData() || !params.viewFrustum || !oneAtBit(childrenDataBits, originalIndex)) {
|
||||
if (childElement->shouldRecurseSubtree(element, params, &bag)) {
|
||||
childTreeBytesOut = encodeTreeBitstreamRecursion(childElement, packetData, bag, params,
|
||||
thisLevel, nodeLocationThisView);
|
||||
}
|
||||
childTreeBytesOut = encodeTreeBitstreamRecursion(childElement, packetData, bag, params,
|
||||
thisLevel, nodeLocationThisView);
|
||||
}
|
||||
|
||||
// remember this for reshuffling
|
||||
|
@ -1726,7 +1728,7 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
int bytesBeforeChild = packetData->getUncompressedSize();
|
||||
|
||||
// release the bytes we reserved...
|
||||
qDebug() << "RELEASING previously reserved " << minimumRequiredRootDataBytes() << " bytes for root -- line:" << __LINE__;
|
||||
//qDebug() << "RELEASING previously reserved " << minimumRequiredRootDataBytes() << " bytes for root -- line:" << __LINE__;
|
||||
packetData->releaseReservedBytes(minimumRequiredRootDataBytes());
|
||||
|
||||
LevelDetails rootDataLevelKey = packetData->startLevel();
|
||||
|
@ -1746,8 +1748,6 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
if (!allOfRootFit) {
|
||||
elementAppendState = OctreeElement::PARTIAL;
|
||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||
qDebug() << "Octree::encodeTreeBitstreamRecursion().... ROOT DATA WAS PARTIAL OR DIDN'T FIT elementAppendState = OctreeElement::PARTIAL ----";
|
||||
qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
}
|
||||
|
||||
// do we really ever NOT want to continue this level???
|
||||
|
@ -1802,7 +1802,7 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
}
|
||||
|
||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||
qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
//qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" << __LINE__;
|
||||
bytesAtThisLevel = 0; // didn't fit
|
||||
} else {
|
||||
|
||||
|
@ -1812,7 +1812,7 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
// and assume that the appendElementData() has stored any required state data
|
||||
// in the params extraEncodeData
|
||||
if (elementAppendState == OctreeElement::PARTIAL) {
|
||||
if (true || wantDebug) {
|
||||
if (wantDebug) {
|
||||
qDebug() << "(elementAppendState == OctreeElement::PARTIAL) ...";
|
||||
qDebug() << " RE INSERT THIS(parent) element into bag";
|
||||
qDebug() << " element:" << element->getAACube();
|
||||
|
@ -1824,19 +1824,19 @@ qDebug() << "params.stopReason = EncodeBitstreamParams::DIDNT_FIT --- line:" <<
|
|||
|
||||
// If our element is completed let the element know so it can do any cleanup it of extra wants
|
||||
if (elementAppendState == OctreeElement::COMPLETED) {
|
||||
if (true || wantDebug) {
|
||||
if (wantDebug) {
|
||||
qDebug() << "*********************************************************************************************************";
|
||||
qDebug() << "(elementAppendState == OctreeElement::COMPLETED)";
|
||||
qDebug() << " calling element->elementEncodeComplete(params)";
|
||||
qDebug() << " element=" << element->getAACube();
|
||||
}
|
||||
element->elementEncodeComplete(params, &bag);
|
||||
if (true || wantDebug) {
|
||||
if (wantDebug) {
|
||||
qDebug() << "*********************************************************************************************************";
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
//qDebug() << "encodeTreeBitstreamRecursion() --- returning from line: " << __LINE__;
|
||||
return bytesAtThisLevel;
|
||||
}
|
||||
|
||||
|
@ -2023,17 +2023,17 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) {
|
|||
params.extraEncodeData = &extraEncodeData;
|
||||
|
||||
while (!elementBag.isEmpty()) {
|
||||
qDebug() << "WRITING SVO ---- START LOOP ---------------";
|
||||
//qDebug() << "WRITING SVO ---- START LOOP ---------------";
|
||||
OctreeElement* subTree = elementBag.extract();
|
||||
qDebug() << "WRITING SVO subTree=" << subTree->getAACube();
|
||||
//qDebug() << "WRITING SVO subTree=" << subTree->getAACube();
|
||||
|
||||
lockForRead(); // do tree locking down here so that we have shorter slices and less thread contention
|
||||
bytesWritten = encodeTreeBitstream(subTree, &packetData, elementBag, params);
|
||||
unlock();
|
||||
|
||||
qDebug() << "WRITING SVO subTree=" << subTree->getAACube() << " bytesWritten=" << bytesWritten;
|
||||
qDebug() << "WRITING SVO subTree=" << subTree->getAACube() << " params.stopReason=" << params.getStopReason();
|
||||
qDebug() << "WRITING SVO subTree=" << subTree->getAACube() << " packetData.hasContent()=" << packetData.hasContent();
|
||||
//qDebug() << "WRITING SVO subTree=" << subTree->getAACube() << " bytesWritten=" << bytesWritten;
|
||||
//qDebug() << "WRITING SVO subTree=" << subTree->getAACube() << " params.stopReason=" << params.getStopReason();
|
||||
//qDebug() << "WRITING SVO subTree=" << subTree->getAACube() << " packetData.hasContent()=" << packetData.hasContent();
|
||||
|
||||
// if the subTree couldn't fit, and so we should reset the packet and reinsert the element in our bag and try again
|
||||
if (bytesWritten == 0 && (params.stopReason == EncodeBitstreamParams::DIDNT_FIT)) {
|
||||
|
@ -2045,16 +2045,16 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) {
|
|||
file.write((const char*)&bufferSize, sizeof(bufferSize));
|
||||
}
|
||||
file.write((const char*)packetData.getFinalizedData(), packetData.getFinalizedSize());
|
||||
qDebug() << "WRITING SVO actually writing to the file bufferSize:" << packetData.getFinalizedSize();
|
||||
//qDebug() << "WRITING SVO actually writing to the file bufferSize:" << packetData.getFinalizedSize();
|
||||
lastPacketWritten = true;
|
||||
}
|
||||
packetData.reset(); // is there a better way to do this? could we fit more?
|
||||
qDebug() << "WRITING SVO INSERT SUBTREE FOR ANOTHER GO ... subTree=" << subTree->getAACube();
|
||||
//qDebug() << "WRITING SVO INSERT SUBTREE FOR ANOTHER GO ... subTree=" << subTree->getAACube();
|
||||
elementBag.insert(subTree);
|
||||
} else {
|
||||
lastPacketWritten = false;
|
||||
}
|
||||
qDebug() << "WRITING SVO ---- END LOOP ---------------";
|
||||
//qDebug() << "WRITING SVO ---- END LOOP ---------------";
|
||||
}
|
||||
|
||||
if (!lastPacketWritten) {
|
||||
|
@ -2065,10 +2065,10 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) {
|
|||
file.write((const char*)&bufferSize, sizeof(bufferSize));
|
||||
}
|
||||
file.write((const char*)packetData.getFinalizedData(), packetData.getFinalizedSize());
|
||||
qDebug() << "WRITING SVO actually writing to the file bufferSize:" << packetData.getFinalizedSize();
|
||||
//qDebug() << "WRITING SVO actually writing to the file bufferSize:" << packetData.getFinalizedSize();
|
||||
}
|
||||
}
|
||||
qDebug() << "WRITING SVO CLOSING FILE";
|
||||
//qDebug() << "WRITING SVO CLOSING FILE";
|
||||
file.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ public:
|
|||
virtual void debugExtraEncodeData(EncodeBitstreamParams& params) const { }
|
||||
virtual void initializeExtraEncodeData(EncodeBitstreamParams& params) const { }
|
||||
virtual bool shouldIncludeChild(int childIndex, EncodeBitstreamParams& params) const { return true; }
|
||||
virtual bool shouldRecurseSubtree(OctreeElement* parent, EncodeBitstreamParams& params, OctreeElementBag* bag) const { return true; }
|
||||
|
||||
virtual void updateEncodedData(int childIndex, AppendState childAppendState, EncodeBitstreamParams& params) const { }
|
||||
virtual void elementEncodeComplete(EncodeBitstreamParams& params, OctreeElementBag* bag) const { }
|
||||
|
|
Loading…
Reference in a new issue