diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index 6acd85bff6..c40b05a4a8 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -57,7 +57,7 @@ OctreeQueryNode::~OctreeQueryNode() { void OctreeQueryNode::nodeKilled() { _isShuttingDown = true; - nodeBag.unhookNotifications(); // if our node is shutting down, then we no longer need octree element notifications + elementBag.unhookNotifications(); // if our node is shutting down, then we no longer need octree element notifications if (_octreeSendThread) { // just tell our thread we want to shutdown, this is asynchronous, and fast, we don't need or want it to block // while the thread actually shuts down @@ -67,7 +67,7 @@ void OctreeQueryNode::nodeKilled() { void OctreeQueryNode::forceNodeShutdown() { _isShuttingDown = true; - nodeBag.unhookNotifications(); // if our node is shutting down, then we no longer need octree element notifications + elementBag.unhookNotifications(); // if our node is shutting down, then we no longer need octree element notifications if (_octreeSendThread) { // we really need to force our thread to shutdown, this is synchronous, we will block while the thread actually // shuts down because we really need it to shutdown, and it's ok if we wait for it to complete @@ -344,8 +344,8 @@ void OctreeQueryNode::dumpOutOfView() { int stillInView = 0; int outOfView = 0; OctreeElementBag tempBag; - while (!nodeBag.isEmpty()) { - OctreeElement* node = nodeBag.extract(); + while (!elementBag.isEmpty()) { + OctreeElement* node = elementBag.extract(); if (node->isInView(_currentViewFrustum)) { tempBag.insert(node); stillInView++; @@ -357,7 +357,7 @@ void OctreeQueryNode::dumpOutOfView() { while (!tempBag.isEmpty()) { OctreeElement* node = tempBag.extract(); if (node->isInView(_currentViewFrustum)) { - nodeBag.insert(node); + elementBag.insert(node); } } } diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index eb420039e6..f87c7631b3 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -54,7 +54,7 @@ public: int getMaxLevelReached() const { return _maxLevelReachedInLastSearch; } void setMaxLevelReached(int maxLevelReached) { _maxLevelReachedInLastSearch = maxLevelReached; } - OctreeElementBag nodeBag; + OctreeElementBag elementBag; CoverageMap map; ViewFrustum& getCurrentViewFrustum() { return _currentViewFrustum; } diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index 9e4dbcd347..647d8f90a9 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -328,7 +328,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus // If the current view frustum has changed OR we have nothing to send, then search against // the current view frustum for things to send. - if (viewFrustumChanged || nodeData->nodeBag.isEmpty()) { + if (viewFrustumChanged || nodeData->elementBag.isEmpty()) { // if our view has changed, we need to reset these things... if (viewFrustumChanged) { @@ -357,9 +357,9 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus int packetsJustSent = handlePacketSend(nodeData, trueBytesSent, truePacketsSent); packetsSentThisInterval += packetsJustSent; - // If we're starting a full scene, then definitely we want to empty the nodeBag + // If we're starting a full scene, then definitely we want to empty the elementBag if (isFullScene) { - nodeData->nodeBag.deleteAll(); + nodeData->elementBag.deleteAll(); } // TODO: add these to stats page @@ -371,16 +371,16 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus // This is the start of "resending" the scene. bool dontRestartSceneOnMove = false; // this is experimental if (dontRestartSceneOnMove) { - if (nodeData->nodeBag.isEmpty()) { - nodeData->nodeBag.insert(_myServer->getOctree()->getRoot()); // only in case of empty + if (nodeData->elementBag.isEmpty()) { + nodeData->elementBag.insert(_myServer->getOctree()->getRoot()); // only in case of empty } } else { - nodeData->nodeBag.insert(_myServer->getOctree()->getRoot()); // original behavior, reset on move or empty + nodeData->elementBag.insert(_myServer->getOctree()->getRoot()); // original behavior, reset on move or empty } } - // If we have something in our nodeBag, then turn them into packets and send them out... - if (!nodeData->nodeBag.isEmpty()) { + // If we have something in our elementBag, then turn them into packets and send them out... + if (!nodeData->elementBag.isEmpty()) { int bytesWritten = 0; quint64 start = usecTimestampNow(); @@ -402,8 +402,8 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus quint64 startInside = usecTimestampNow(); bool lastNodeDidntFit = false; // assume each node fits - if (!nodeData->nodeBag.isEmpty()) { - OctreeElement* subTree = nodeData->nodeBag.extract(); + if (!nodeData->elementBag.isEmpty()) { + OctreeElement* subTree = nodeData->elementBag.extract(); /* TODO: Looking for a way to prevent locking and encoding a tree that is not // going to result in any packets being sent... @@ -452,14 +452,14 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus lockWaitElapsedUsec = (float)(lockWaitEnd - lockWaitStart); quint64 encodeStart = usecTimestampNow(); - bytesWritten = _myServer->getOctree()->encodeTreeBitstream(subTree, &_packetData, nodeData->nodeBag, params); + bytesWritten = _myServer->getOctree()->encodeTreeBitstream(subTree, &_packetData, nodeData->elementBag, params); quint64 encodeEnd = usecTimestampNow(); encodeElapsedUsec = (float)(encodeEnd - encodeStart); // If after calling encodeTreeBitstream() there are no nodes left to send, then we know we've // sent the entire scene. We want to know this below so we'll actually write this content into // the packet and send it - completedScene = nodeData->nodeBag.isEmpty(); + completedScene = nodeData->elementBag.isEmpty(); // if we're trying to fill a full size packet, then we use this logic to determine if we have a DIDNT_FIT case. if (_packetData.getTargetSize() == MAX_OCTREE_PACKET_DATA_SIZE) { @@ -580,7 +580,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus // if after sending packets we've emptied our bag, then we want to remember that we've sent all // the voxels from the current view frustum - if (nodeData->nodeBag.isEmpty()) { + if (nodeData->elementBag.isEmpty()) { nodeData->updateLastKnownViewFrustum(); nodeData->setViewSent(true); nodeData->map.erase(); // It would be nice if we could save this, and only reset it when the view frustum changes diff --git a/libraries/models/src/ModelItem.cpp b/libraries/models/src/ModelItem.cpp index 312066352e..de49bf1712 100644 --- a/libraries/models/src/ModelItem.cpp +++ b/libraries/models/src/ModelItem.cpp @@ -361,7 +361,8 @@ bool ModelItem::new___appendModelData(OctreePacketData* packetData, EncodeBitstr encodedPropertyFlags = propertyFlags; int newPropertyFlagsLength = encodedPropertyFlags.length(); - packetData->updatePriorBytes(propertyFlagsOffset, (const unsigned char*)encodedPropertyFlags.constData(), encodedPropertyFlags.length()); + packetData->updatePriorBytes(propertyFlagsOffset, + (const unsigned char*)encodedPropertyFlags.constData(), encodedPropertyFlags.length()); // if the size of the PropertyFlags shrunk, we need to shift everything down to front of packet. if (newPropertyFlagsLength < oldPropertyFlagsLength) { diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp index cbdc4753dc..e4288d4af6 100644 --- a/libraries/octree/src/Octree.cpp +++ b/libraries/octree/src/Octree.cpp @@ -1649,23 +1649,23 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) { file.write(&expectedVersion, sizeof(expectedVersion)); } - OctreeElementBag nodeBag; + OctreeElementBag elementBag; // If we were given a specific element, start from there, otherwise start from root if (element) { - nodeBag.insert(element); + elementBag.insert(element); } else { - nodeBag.insert(_rootElement); + elementBag.insert(_rootElement); } OctreePacketData packetData; int bytesWritten = 0; bool lastPacketWritten = false; - while (!nodeBag.isEmpty()) { - OctreeElement* subTree = nodeBag.extract(); + while (!elementBag.isEmpty()) { + OctreeElement* subTree = elementBag.extract(); lockForRead(); // do tree locking down here so that we have shorter slices and less thread contention EncodeBitstreamParams params(INT_MAX, IGNORE_VIEW_FRUSTUM, WANT_COLOR, NO_EXISTS_BITS); - bytesWritten = encodeTreeBitstream(subTree, &packetData, nodeBag, params); + bytesWritten = encodeTreeBitstream(subTree, &packetData, elementBag, params); unlock(); // if the subTree couldn't fit, and so we should reset the packet and reinsert the element in our bag and try again @@ -1675,7 +1675,7 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElement* element) { lastPacketWritten = true; } packetData.reset(); // is there a better way to do this? could we fit more? - nodeBag.insert(subTree); + elementBag.insert(subTree); } else { lastPacketWritten = false; } @@ -1700,8 +1700,8 @@ bool Octree::countOctreeElementsOperation(OctreeElement* element, void* extraDat } void Octree::copySubTreeIntoNewTree(OctreeElement* startElement, Octree* destinationTree, bool rebaseToRoot) { - OctreeElementBag nodeBag; - nodeBag.insert(startElement); + OctreeElementBag elementBag; + elementBag.insert(startElement); int chopLevels = 0; if (rebaseToRoot) { chopLevels = numberOfThreeBitSectionsInCode(startElement->getOctalCode()); @@ -1709,12 +1709,12 @@ void Octree::copySubTreeIntoNewTree(OctreeElement* startElement, Octree* destina static OctreePacketData packetData; - while (!nodeBag.isEmpty()) { - OctreeElement* subTree = nodeBag.extract(); + while (!elementBag.isEmpty()) { + OctreeElement* subTree = elementBag.extract(); packetData.reset(); // reset the packet between usage // ask our tree to write a bitsteam EncodeBitstreamParams params(INT_MAX, IGNORE_VIEW_FRUSTUM, WANT_COLOR, NO_EXISTS_BITS, chopLevels); - encodeTreeBitstream(subTree, &packetData, nodeBag, params); + encodeTreeBitstream(subTree, &packetData, elementBag, params); // ask destination tree to read the bitstream ReadBitstreamToTreeParams args(WANT_COLOR, NO_EXISTS_BITS); destinationTree->readBitstreamToTree(packetData.getUncompressedData(), packetData.getUncompressedSize(), args); @@ -1722,20 +1722,20 @@ void Octree::copySubTreeIntoNewTree(OctreeElement* startElement, Octree* destina } void Octree::copyFromTreeIntoSubTree(Octree* sourceTree, OctreeElement* destinationElement) { - OctreeElementBag nodeBag; + OctreeElementBag elementBag; // If we were given a specific element, start from there, otherwise start from root - nodeBag.insert(sourceTree->_rootElement); + elementBag.insert(sourceTree->_rootElement); static OctreePacketData packetData; - while (!nodeBag.isEmpty()) { - OctreeElement* subTree = nodeBag.extract(); + while (!elementBag.isEmpty()) { + OctreeElement* subTree = elementBag.extract(); packetData.reset(); // reset between usage // ask our tree to write a bitsteam EncodeBitstreamParams params(INT_MAX, IGNORE_VIEW_FRUSTUM, WANT_COLOR, NO_EXISTS_BITS); - sourceTree->encodeTreeBitstream(subTree, &packetData, nodeBag, params); + sourceTree->encodeTreeBitstream(subTree, &packetData, elementBag, params); // ask destination tree to read the bitstream bool wantImportProgress = true;