mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:49:12 +02:00
remove dead VoxelSceneStats class and clean up Voxel Stats to be OctreeStats
This commit is contained in:
parent
cfa618d694
commit
7fb872c1d7
6 changed files with 77 additions and 77 deletions
|
@ -60,7 +60,7 @@
|
||||||
#include <PerfStat.h>
|
#include <PerfStat.h>
|
||||||
#include <ResourceCache.h>
|
#include <ResourceCache.h>
|
||||||
#include <UUID.h>
|
#include <UUID.h>
|
||||||
#include <VoxelSceneStats.h>
|
#include <OctreeSceneStats.h>
|
||||||
#include <LocalVoxelsList.h>
|
#include <LocalVoxelsList.h>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
@ -1825,9 +1825,9 @@ void Application::updateDialogs(float deltaTime) {
|
||||||
bandwidthDialog->update();
|
bandwidthDialog->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
VoxelStatsDialog* voxelStatsDialog = Menu::getInstance()->getVoxelStatsDialog();
|
OctreeStatsDialog* octreeStatsDialog = Menu::getInstance()->getOctreeStatsDialog();
|
||||||
if (voxelStatsDialog) {
|
if (octreeStatsDialog) {
|
||||||
voxelStatsDialog->update();
|
octreeStatsDialog->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2733,9 +2733,9 @@ void Application::displayStats() {
|
||||||
unsigned long totalNodes = 0;
|
unsigned long totalNodes = 0;
|
||||||
unsigned long totalInternal = 0;
|
unsigned long totalInternal = 0;
|
||||||
unsigned long totalLeaves = 0;
|
unsigned long totalLeaves = 0;
|
||||||
for(NodeToVoxelSceneStatsIterator i = _octreeServerSceneStats.begin(); i != _octreeServerSceneStats.end(); i++) {
|
for(NodeToOctreeSceneStatsIterator i = _octreeServerSceneStats.begin(); i != _octreeServerSceneStats.end(); i++) {
|
||||||
//const QUuid& uuid = i->first;
|
//const QUuid& uuid = i->first;
|
||||||
VoxelSceneStats& stats = i->second;
|
OctreeSceneStats& stats = i->second;
|
||||||
serverCount++;
|
serverCount++;
|
||||||
if (_statsExpanded) {
|
if (_statsExpanded) {
|
||||||
if (serverCount > 1) {
|
if (serverCount > 1) {
|
||||||
|
@ -3288,11 +3288,11 @@ void Application::nodeKilled(SharedNodePointer node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// also clean up scene stats for that server
|
// also clean up scene stats for that server
|
||||||
_voxelSceneStatsLock.lockForWrite();
|
_octreeSceneStatsLock.lockForWrite();
|
||||||
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
||||||
_octreeServerSceneStats.erase(nodeUUID);
|
_octreeServerSceneStats.erase(nodeUUID);
|
||||||
}
|
}
|
||||||
_voxelSceneStatsLock.unlock();
|
_octreeSceneStatsLock.unlock();
|
||||||
|
|
||||||
} else if (node->getType() == NodeType::ParticleServer) {
|
} else if (node->getType() == NodeType::ParticleServer) {
|
||||||
QUuid nodeUUID = node->getUUID();
|
QUuid nodeUUID = node->getUUID();
|
||||||
|
@ -3319,11 +3319,11 @@ void Application::nodeKilled(SharedNodePointer node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// also clean up scene stats for that server
|
// also clean up scene stats for that server
|
||||||
_voxelSceneStatsLock.lockForWrite();
|
_octreeSceneStatsLock.lockForWrite();
|
||||||
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
||||||
_octreeServerSceneStats.erase(nodeUUID);
|
_octreeServerSceneStats.erase(nodeUUID);
|
||||||
}
|
}
|
||||||
_voxelSceneStatsLock.unlock();
|
_octreeSceneStatsLock.unlock();
|
||||||
|
|
||||||
} else if (node->getType() == NodeType::AvatarMixer) {
|
} else if (node->getType() == NodeType::AvatarMixer) {
|
||||||
// our avatar mixer has gone away - clear the hash of avatars
|
// our avatar mixer has gone away - clear the hash of avatars
|
||||||
|
@ -3338,12 +3338,12 @@ void Application::trackIncomingVoxelPacket(const QByteArray& packet, const Share
|
||||||
QUuid nodeUUID = sendingNode->getUUID();
|
QUuid nodeUUID = sendingNode->getUUID();
|
||||||
|
|
||||||
// now that we know the node ID, let's add these stats to the stats for that node...
|
// now that we know the node ID, let's add these stats to the stats for that node...
|
||||||
_voxelSceneStatsLock.lockForWrite();
|
_octreeSceneStatsLock.lockForWrite();
|
||||||
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
||||||
VoxelSceneStats& stats = _octreeServerSceneStats[nodeUUID];
|
OctreeSceneStats& stats = _octreeServerSceneStats[nodeUUID];
|
||||||
stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec());
|
stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec());
|
||||||
}
|
}
|
||||||
_voxelSceneStatsLock.unlock();
|
_octreeSceneStatsLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3353,7 +3353,7 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
|
||||||
|
|
||||||
// parse the incoming stats datas stick it in a temporary object for now, while we
|
// parse the incoming stats datas stick it in a temporary object for now, while we
|
||||||
// determine which server it belongs to
|
// determine which server it belongs to
|
||||||
VoxelSceneStats temp;
|
OctreeSceneStats temp;
|
||||||
int statsMessageLength = temp.unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()), packet.size());
|
int statsMessageLength = temp.unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()), packet.size());
|
||||||
|
|
||||||
// quick fix for crash... why would voxelServer be NULL?
|
// quick fix for crash... why would voxelServer be NULL?
|
||||||
|
@ -3361,14 +3361,14 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
|
||||||
QUuid nodeUUID = sendingNode->getUUID();
|
QUuid nodeUUID = sendingNode->getUUID();
|
||||||
|
|
||||||
// now that we know the node ID, let's add these stats to the stats for that node...
|
// now that we know the node ID, let's add these stats to the stats for that node...
|
||||||
_voxelSceneStatsLock.lockForWrite();
|
_octreeSceneStatsLock.lockForWrite();
|
||||||
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
|
||||||
_octreeServerSceneStats[nodeUUID].unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()),
|
_octreeServerSceneStats[nodeUUID].unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()),
|
||||||
packet.size());
|
packet.size());
|
||||||
} else {
|
} else {
|
||||||
_octreeServerSceneStats[nodeUUID] = temp;
|
_octreeServerSceneStats[nodeUUID] = temp;
|
||||||
}
|
}
|
||||||
_voxelSceneStatsLock.unlock();
|
_octreeSceneStatsLock.unlock();
|
||||||
|
|
||||||
VoxelPositionSize rootDetails;
|
VoxelPositionSize rootDetails;
|
||||||
voxelDetailsForCode(temp.getJurisdictionRoot(), rootDetails);
|
voxelDetailsForCode(temp.getJurisdictionRoot(), rootDetails);
|
||||||
|
@ -3397,8 +3397,8 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin
|
||||||
}
|
}
|
||||||
// store jurisdiction details for later use
|
// store jurisdiction details for later use
|
||||||
// This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it
|
// This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it
|
||||||
// but VoxelSceneStats thinks it's just returning a reference to it's contents. So we need to make a copy of the
|
// but OctreeSceneStats thinks it's just returning a reference to it's contents. So we need to make a copy of the
|
||||||
// details from the VoxelSceneStats to construct the JurisdictionMap
|
// details from the OctreeSceneStats to construct the JurisdictionMap
|
||||||
JurisdictionMap jurisdictionMap;
|
JurisdictionMap jurisdictionMap;
|
||||||
jurisdictionMap.copyContents(temp.getJurisdictionRoot(), temp.getJurisdictionEndNodes());
|
jurisdictionMap.copyContents(temp.getJurisdictionRoot(), temp.getJurisdictionEndNodes());
|
||||||
(*jurisdiction)[nodeUUID] = jurisdictionMap;
|
(*jurisdiction)[nodeUUID] = jurisdictionMap;
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
#include "renderer/VoxelShader.h"
|
#include "renderer/VoxelShader.h"
|
||||||
#include "ui/BandwidthDialog.h"
|
#include "ui/BandwidthDialog.h"
|
||||||
#include "ui/ChatEntry.h"
|
#include "ui/ChatEntry.h"
|
||||||
#include "ui/VoxelStatsDialog.h"
|
#include "ui/OctreeStatsDialog.h"
|
||||||
#include "ui/RearMirrorTools.h"
|
#include "ui/RearMirrorTools.h"
|
||||||
#include "ui/LodToolsDialog.h"
|
#include "ui/LodToolsDialog.h"
|
||||||
#include "ui/LogDialog.h"
|
#include "ui/LogDialog.h"
|
||||||
|
@ -170,9 +170,9 @@ public:
|
||||||
BandwidthMeter* getBandwidthMeter() { return &_bandwidthMeter; }
|
BandwidthMeter* getBandwidthMeter() { return &_bandwidthMeter; }
|
||||||
QSettings* getSettings() { return _settings; }
|
QSettings* getSettings() { return _settings; }
|
||||||
QMainWindow* getWindow() { return _window; }
|
QMainWindow* getWindow() { return _window; }
|
||||||
NodeToVoxelSceneStats* getOcteeSceneStats() { return &_octreeServerSceneStats; }
|
NodeToOctreeSceneStats* getOcteeSceneStats() { return &_octreeServerSceneStats; }
|
||||||
void lockVoxelSceneStats() { _voxelSceneStatsLock.lockForRead(); }
|
void lockOctreeSceneStats() { _octreeSceneStatsLock.lockForRead(); }
|
||||||
void unlockVoxelSceneStats() { _voxelSceneStatsLock.unlock(); }
|
void unlockOctreeSceneStats() { _octreeSceneStatsLock.unlock(); }
|
||||||
|
|
||||||
QNetworkAccessManager* getNetworkAccessManager() { return _networkAccessManager; }
|
QNetworkAccessManager* getNetworkAccessManager() { return _networkAccessManager; }
|
||||||
GeometryCache* getGeometryCache() { return &_geometryCache; }
|
GeometryCache* getGeometryCache() { return &_geometryCache; }
|
||||||
|
@ -459,8 +459,8 @@ private:
|
||||||
|
|
||||||
NodeToJurisdictionMap _voxelServerJurisdictions;
|
NodeToJurisdictionMap _voxelServerJurisdictions;
|
||||||
NodeToJurisdictionMap _particleServerJurisdictions;
|
NodeToJurisdictionMap _particleServerJurisdictions;
|
||||||
NodeToVoxelSceneStats _octreeServerSceneStats;
|
NodeToOctreeSceneStats _octreeServerSceneStats;
|
||||||
QReadWriteLock _voxelSceneStatsLock;
|
QReadWriteLock _octreeSceneStatsLock;
|
||||||
|
|
||||||
std::vector<VoxelFade> _voxelFades;
|
std::vector<VoxelFade> _voxelFades;
|
||||||
ControllerScriptingInterface _controllerScriptingInterface;
|
ControllerScriptingInterface _controllerScriptingInterface;
|
||||||
|
|
|
@ -66,7 +66,7 @@ Menu::Menu() :
|
||||||
_faceshiftEyeDeflection(DEFAULT_FACESHIFT_EYE_DEFLECTION),
|
_faceshiftEyeDeflection(DEFAULT_FACESHIFT_EYE_DEFLECTION),
|
||||||
_frustumDrawMode(FRUSTUM_DRAW_MODE_ALL),
|
_frustumDrawMode(FRUSTUM_DRAW_MODE_ALL),
|
||||||
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
|
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
|
||||||
_voxelStatsDialog(NULL),
|
_octreeStatsDialog(NULL),
|
||||||
_lodToolsDialog(NULL),
|
_lodToolsDialog(NULL),
|
||||||
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
||||||
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
||||||
|
@ -213,7 +213,7 @@ Menu::Menu() :
|
||||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Oscilloscope, 0, true);
|
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Oscilloscope, 0, true);
|
||||||
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Bandwidth, 0, true);
|
addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Bandwidth, 0, true);
|
||||||
addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0, this, SLOT(bandwidthDetails()));
|
addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0, this, SLOT(bandwidthDetails()));
|
||||||
addActionToQMenuAndActionHash(viewMenu, MenuOption::VoxelStats, 0, this, SLOT(voxelStatsDetails()));
|
addActionToQMenuAndActionHash(viewMenu, MenuOption::OctreeStats, 0, this, SLOT(octreeStatsDetails()));
|
||||||
|
|
||||||
QMenu* developerMenu = addMenu("Developer");
|
QMenu* developerMenu = addMenu("Developer");
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ Menu::Menu() :
|
||||||
|
|
||||||
Menu::~Menu() {
|
Menu::~Menu() {
|
||||||
bandwidthDetailsClosed();
|
bandwidthDetailsClosed();
|
||||||
voxelStatsDetailsClosed();
|
octreeStatsDetailsClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::loadSettings(QSettings* settings) {
|
void Menu::loadSettings(QSettings* settings) {
|
||||||
|
@ -1033,20 +1033,20 @@ void Menu::bandwidthDetailsClosed() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::voxelStatsDetails() {
|
void Menu::octreeStatsDetails() {
|
||||||
if (!_voxelStatsDialog) {
|
if (!_octreeStatsDialog) {
|
||||||
_voxelStatsDialog = new VoxelStatsDialog(Application::getInstance()->getGLWidget(),
|
_octreeStatsDialog = new OctreeStatsDialog(Application::getInstance()->getGLWidget(),
|
||||||
Application::getInstance()->getOcteeSceneStats());
|
Application::getInstance()->getOcteeSceneStats());
|
||||||
connect(_voxelStatsDialog, SIGNAL(closed()), SLOT(voxelStatsDetailsClosed()));
|
connect(_octreeStatsDialog, SIGNAL(closed()), SLOT(octreeStatsDetailsClosed()));
|
||||||
_voxelStatsDialog->show();
|
_octreeStatsDialog->show();
|
||||||
}
|
}
|
||||||
_voxelStatsDialog->raise();
|
_octreeStatsDialog->raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::voxelStatsDetailsClosed() {
|
void Menu::octreeStatsDetailsClosed() {
|
||||||
if (_voxelStatsDialog) {
|
if (_octreeStatsDialog) {
|
||||||
delete _voxelStatsDialog;
|
delete _octreeStatsDialog;
|
||||||
_voxelStatsDialog = NULL;
|
_octreeStatsDialog = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class QSettings;
|
||||||
class BandwidthDialog;
|
class BandwidthDialog;
|
||||||
class LodToolsDialog;
|
class LodToolsDialog;
|
||||||
class MetavoxelEditor;
|
class MetavoxelEditor;
|
||||||
class VoxelStatsDialog;
|
class OctreeStatsDialog;
|
||||||
class MenuItemProperties;
|
class MenuItemProperties;
|
||||||
|
|
||||||
class Menu : public QMenuBar {
|
class Menu : public QMenuBar {
|
||||||
|
@ -73,7 +73,7 @@ public:
|
||||||
BandwidthDialog* getBandwidthDialog() const { return _bandwidthDialog; }
|
BandwidthDialog* getBandwidthDialog() const { return _bandwidthDialog; }
|
||||||
FrustumDrawMode getFrustumDrawMode() const { return _frustumDrawMode; }
|
FrustumDrawMode getFrustumDrawMode() const { return _frustumDrawMode; }
|
||||||
ViewFrustumOffset getViewFrustumOffset() const { return _viewFrustumOffset; }
|
ViewFrustumOffset getViewFrustumOffset() const { return _viewFrustumOffset; }
|
||||||
VoxelStatsDialog* getVoxelStatsDialog() const { return _voxelStatsDialog; }
|
OctreeStatsDialog* getOctreeStatsDialog() const { return _octreeStatsDialog; }
|
||||||
LodToolsDialog* getLodToolsDialog() const { return _lodToolsDialog; }
|
LodToolsDialog* getLodToolsDialog() const { return _lodToolsDialog; }
|
||||||
int getMaxVoxels() const { return _maxVoxels; }
|
int getMaxVoxels() const { return _maxVoxels; }
|
||||||
QAction* getUseVoxelShader() const { return _useVoxelShader; }
|
QAction* getUseVoxelShader() const { return _useVoxelShader; }
|
||||||
|
@ -111,7 +111,7 @@ public slots:
|
||||||
|
|
||||||
void loginForCurrentDomain();
|
void loginForCurrentDomain();
|
||||||
void bandwidthDetails();
|
void bandwidthDetails();
|
||||||
void voxelStatsDetails();
|
void octreeStatsDetails();
|
||||||
void lodTools();
|
void lodTools();
|
||||||
void loadSettings(QSettings* settings = NULL);
|
void loadSettings(QSettings* settings = NULL);
|
||||||
void saveSettings(QSettings* settings = NULL);
|
void saveSettings(QSettings* settings = NULL);
|
||||||
|
@ -135,7 +135,7 @@ private slots:
|
||||||
void goToDomainDialog();
|
void goToDomainDialog();
|
||||||
void goToLocation();
|
void goToLocation();
|
||||||
void bandwidthDetailsClosed();
|
void bandwidthDetailsClosed();
|
||||||
void voxelStatsDetailsClosed();
|
void octreeStatsDetailsClosed();
|
||||||
void lodToolsClosed();
|
void lodToolsClosed();
|
||||||
void cycleFrustumRenderMode();
|
void cycleFrustumRenderMode();
|
||||||
void runTests();
|
void runTests();
|
||||||
|
@ -187,7 +187,7 @@ private:
|
||||||
FrustumDrawMode _frustumDrawMode;
|
FrustumDrawMode _frustumDrawMode;
|
||||||
ViewFrustumOffset _viewFrustumOffset;
|
ViewFrustumOffset _viewFrustumOffset;
|
||||||
QPointer<MetavoxelEditor> _MetavoxelEditor;
|
QPointer<MetavoxelEditor> _MetavoxelEditor;
|
||||||
VoxelStatsDialog* _voxelStatsDialog;
|
OctreeStatsDialog* _octreeStatsDialog;
|
||||||
LodToolsDialog* _lodToolsDialog;
|
LodToolsDialog* _lodToolsDialog;
|
||||||
int _maxVoxels;
|
int _maxVoxels;
|
||||||
float _voxelSizeScale;
|
float _voxelSizeScale;
|
||||||
|
@ -286,7 +286,7 @@ namespace MenuOption {
|
||||||
const QString Quit = "Quit";
|
const QString Quit = "Quit";
|
||||||
const QString Voxels = "Voxels";
|
const QString Voxels = "Voxels";
|
||||||
const QString VoxelMode = "Cycle Voxel Mode";
|
const QString VoxelMode = "Cycle Voxel Mode";
|
||||||
const QString VoxelStats = "Voxel Stats";
|
const QString OctreeStats = "Voxel and Particle Statistics";
|
||||||
const QString VoxelTextures = "Voxel Textures";
|
const QString VoxelTextures = "Voxel Textures";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// VoxelStatsDialog.cpp
|
// OctreeStatsDialog.cpp
|
||||||
// interface
|
// interface
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 7/19/13.
|
// Created by Brad Hefta-Gaub on 7/19/13.
|
||||||
|
@ -14,13 +14,13 @@
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
#include <VoxelSceneStats.h>
|
#include <OctreeSceneStats.h>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
#include "ui/VoxelStatsDialog.h"
|
#include "ui/OctreeStatsDialog.h"
|
||||||
|
|
||||||
VoxelStatsDialog::VoxelStatsDialog(QWidget* parent, NodeToVoxelSceneStats* model) :
|
OctreeStatsDialog::OctreeStatsDialog(QWidget* parent, NodeToOctreeSceneStats* model) :
|
||||||
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint),
|
QDialog(parent, Qt::Window | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint),
|
||||||
_model(model) {
|
_model(model) {
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ VoxelStatsDialog::VoxelStatsDialog(QWidget* parent, NodeToVoxelSceneStats* model
|
||||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelStatsDialog::RemoveStatItem(int item) {
|
void OctreeStatsDialog::RemoveStatItem(int item) {
|
||||||
QLabel* myLabel = _labels[item];
|
QLabel* myLabel = _labels[item];
|
||||||
QWidget* automaticLabel = _form->labelForField(myLabel);
|
QWidget* automaticLabel = _form->labelForField(myLabel);
|
||||||
_form->removeWidget(myLabel);
|
_form->removeWidget(myLabel);
|
||||||
|
@ -62,7 +62,7 @@ void VoxelStatsDialog::RemoveStatItem(int item) {
|
||||||
_labels[item] = NULL;
|
_labels[item] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelStatsDialog::moreless(const QString& link) {
|
void OctreeStatsDialog::moreless(const QString& link) {
|
||||||
QStringList linkDetails = link.split("-");
|
QStringList linkDetails = link.split("-");
|
||||||
const int COMMAND_ITEM = 0;
|
const int COMMAND_ITEM = 0;
|
||||||
const int SERVER_NUMBER_ITEM = 1;
|
const int SERVER_NUMBER_ITEM = 1;
|
||||||
|
@ -80,7 +80,7 @@ void VoxelStatsDialog::moreless(const QString& link) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int VoxelStatsDialog::AddStatItem(const char* caption, unsigned colorRGBA) {
|
int OctreeStatsDialog::AddStatItem(const char* caption, unsigned colorRGBA) {
|
||||||
char strBuf[64];
|
char strBuf[64];
|
||||||
const int STATS_LABEL_WIDTH = 600;
|
const int STATS_LABEL_WIDTH = 600;
|
||||||
|
|
||||||
|
@ -109,13 +109,13 @@ int VoxelStatsDialog::AddStatItem(const char* caption, unsigned colorRGBA) {
|
||||||
return _statCount;
|
return _statCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
VoxelStatsDialog::~VoxelStatsDialog() {
|
OctreeStatsDialog::~OctreeStatsDialog() {
|
||||||
for (int i = 0; i < _statCount; i++) {
|
for (int i = 0; i < _statCount; i++) {
|
||||||
delete _labels[i];
|
delete _labels[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelStatsDialog::paintEvent(QPaintEvent* event) {
|
void OctreeStatsDialog::paintEvent(QPaintEvent* event) {
|
||||||
|
|
||||||
// Update labels
|
// Update labels
|
||||||
|
|
||||||
|
@ -171,11 +171,11 @@ void VoxelStatsDialog::paintEvent(QPaintEvent* event) {
|
||||||
unsigned long totalInternal = 0;
|
unsigned long totalInternal = 0;
|
||||||
unsigned long totalLeaves = 0;
|
unsigned long totalLeaves = 0;
|
||||||
|
|
||||||
Application::getInstance()->lockVoxelSceneStats();
|
Application::getInstance()->lockOctreeSceneStats();
|
||||||
NodeToVoxelSceneStats* sceneStats = Application::getInstance()->getOcteeSceneStats();
|
NodeToOctreeSceneStats* sceneStats = Application::getInstance()->getOcteeSceneStats();
|
||||||
for(NodeToVoxelSceneStatsIterator i = sceneStats->begin(); i != sceneStats->end(); i++) {
|
for(NodeToOctreeSceneStatsIterator i = sceneStats->begin(); i != sceneStats->end(); i++) {
|
||||||
//const QUuid& uuid = i->first;
|
//const QUuid& uuid = i->first;
|
||||||
VoxelSceneStats& stats = i->second;
|
OctreeSceneStats& stats = i->second;
|
||||||
serverCount++;
|
serverCount++;
|
||||||
|
|
||||||
// calculate server node totals
|
// calculate server node totals
|
||||||
|
@ -194,7 +194,7 @@ void VoxelStatsDialog::paintEvent(QPaintEvent* event) {
|
||||||
sendingMode << "S";
|
sendingMode << "S";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Application::getInstance()->unlockVoxelSceneStats();
|
Application::getInstance()->unlockOctreeSceneStats();
|
||||||
sendingMode << " - " << serverCount << " servers";
|
sendingMode << " - " << serverCount << " servers";
|
||||||
if (movingServerCount > 0) {
|
if (movingServerCount > 0) {
|
||||||
sendingMode << " <SCENE NOT STABLE>";
|
sendingMode << " <SCENE NOT STABLE>";
|
||||||
|
@ -221,7 +221,7 @@ void VoxelStatsDialog::paintEvent(QPaintEvent* event) {
|
||||||
|
|
||||||
this->QDialog::paintEvent(event);
|
this->QDialog::paintEvent(event);
|
||||||
}
|
}
|
||||||
void VoxelStatsDialog::showAllOctreeServers() {
|
void OctreeStatsDialog::showAllOctreeServers() {
|
||||||
int serverCount = 0;
|
int serverCount = 0;
|
||||||
|
|
||||||
showOctreeServersOfType(serverCount, NodeType::VoxelServer, "Voxel",
|
showOctreeServersOfType(serverCount, NodeType::VoxelServer, "Voxel",
|
||||||
|
@ -239,7 +239,7 @@ void VoxelStatsDialog::showAllOctreeServers() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t serverType, const char* serverTypeName,
|
void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t serverType, const char* serverTypeName,
|
||||||
NodeToJurisdictionMap& serverJurisdictions) {
|
NodeToJurisdictionMap& serverJurisdictions) {
|
||||||
|
|
||||||
QLocale locale(QLocale::English);
|
QLocale locale(QLocale::English);
|
||||||
|
@ -303,10 +303,10 @@ void VoxelStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t serv
|
||||||
|
|
||||||
// now lookup stats details for this server...
|
// now lookup stats details for this server...
|
||||||
if (_extraServerDetails[serverCount-1] != LESS) {
|
if (_extraServerDetails[serverCount-1] != LESS) {
|
||||||
Application::getInstance()->lockVoxelSceneStats();
|
Application::getInstance()->lockOctreeSceneStats();
|
||||||
NodeToVoxelSceneStats* sceneStats = Application::getInstance()->getOcteeSceneStats();
|
NodeToOctreeSceneStats* sceneStats = Application::getInstance()->getOcteeSceneStats();
|
||||||
if (sceneStats->find(nodeUUID) != sceneStats->end()) {
|
if (sceneStats->find(nodeUUID) != sceneStats->end()) {
|
||||||
VoxelSceneStats& stats = sceneStats->at(nodeUUID);
|
OctreeSceneStats& stats = sceneStats->at(nodeUUID);
|
||||||
|
|
||||||
switch (_extraServerDetails[serverCount-1]) {
|
switch (_extraServerDetails[serverCount-1]) {
|
||||||
case MOST: {
|
case MOST: {
|
||||||
|
@ -323,9 +323,9 @@ void VoxelStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t serv
|
||||||
"Encode Time: " << lastFullEncodeString.toLocal8Bit().constData() << " ms " <<
|
"Encode Time: " << lastFullEncodeString.toLocal8Bit().constData() << " ms " <<
|
||||||
"Send Time: " << lastFullSendString.toLocal8Bit().constData() << " ms ";
|
"Send Time: " << lastFullSendString.toLocal8Bit().constData() << " ms ";
|
||||||
|
|
||||||
for (int i = 0; i < VoxelSceneStats::ITEM_COUNT; i++) {
|
for (int i = 0; i < OctreeSceneStats::ITEM_COUNT; i++) {
|
||||||
VoxelSceneStats::Item item = (VoxelSceneStats::Item)(i);
|
OctreeSceneStats::Item item = (OctreeSceneStats::Item)(i);
|
||||||
VoxelSceneStats::ItemInfo& itemInfo = stats.getItemInfo(item);
|
OctreeSceneStats::ItemInfo& itemInfo = stats.getItemInfo(item);
|
||||||
extraDetails << "<br/>" << itemInfo.caption << " " << stats.getItemValue(item);
|
extraDetails << "<br/>" << itemInfo.caption << " " << stats.getItemValue(item);
|
||||||
}
|
}
|
||||||
} // fall through... since MOST has all of MORE
|
} // fall through... since MOST has all of MORE
|
||||||
|
@ -386,7 +386,7 @@ void VoxelStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t serv
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Application::getInstance()->unlockVoxelSceneStats();
|
Application::getInstance()->unlockOctreeSceneStats();
|
||||||
} else {
|
} else {
|
||||||
linkDetails << " " << " [<a href='more-" << serverCount << "'>more...</a>]";
|
linkDetails << " " << " [<a href='more-" << serverCount << "'>more...</a>]";
|
||||||
linkDetails << " " << " [<a href='most-" << serverCount << "'>most...</a>]";
|
linkDetails << " " << " [<a href='most-" << serverCount << "'>most...</a>]";
|
||||||
|
@ -397,12 +397,12 @@ void VoxelStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t serv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelStatsDialog::reject() {
|
void OctreeStatsDialog::reject() {
|
||||||
// Just regularly close upon ESC
|
// Just regularly close upon ESC
|
||||||
this->QDialog::close();
|
this->QDialog::close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelStatsDialog::closeEvent(QCloseEvent* event) {
|
void OctreeStatsDialog::closeEvent(QCloseEvent* event) {
|
||||||
this->QDialog::closeEvent(event);
|
this->QDialog::closeEvent(event);
|
||||||
emit closed();
|
emit closed();
|
||||||
}
|
}
|
|
@ -1,30 +1,30 @@
|
||||||
//
|
//
|
||||||
// VoxelStatsDialog.h
|
// OctreeStatsDialog.h
|
||||||
// interface
|
// interface
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 7/19/13.
|
// Created by Brad Hefta-Gaub on 7/19/13.
|
||||||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef __hifi__VoxelStatsDialog__
|
#ifndef __hifi__OctreeStatsDialog__
|
||||||
#define __hifi__VoxelStatsDialog__
|
#define __hifi__OctreeStatsDialog__
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
#include <VoxelSceneStats.h>
|
#include <OctreeSceneStats.h>
|
||||||
|
|
||||||
#define MAX_STATS 100
|
#define MAX_STATS 100
|
||||||
#define MAX_VOXEL_SERVERS 50
|
#define MAX_VOXEL_SERVERS 50
|
||||||
#define DEFAULT_COLOR 0
|
#define DEFAULT_COLOR 0
|
||||||
|
|
||||||
class VoxelStatsDialog : public QDialog {
|
class OctreeStatsDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
// Sets up the UI
|
// Sets up the UI
|
||||||
VoxelStatsDialog(QWidget* parent, NodeToVoxelSceneStats* model);
|
OctreeStatsDialog(QWidget* parent, NodeToOctreeSceneStats* model);
|
||||||
~VoxelStatsDialog();
|
~OctreeStatsDialog();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void closed();
|
void closed();
|
||||||
|
@ -53,7 +53,7 @@ private:
|
||||||
|
|
||||||
QFormLayout* _form;
|
QFormLayout* _form;
|
||||||
QLabel* _labels[MAX_STATS];
|
QLabel* _labels[MAX_STATS];
|
||||||
NodeToVoxelSceneStats* _model;
|
NodeToOctreeSceneStats* _model;
|
||||||
int _statCount;
|
int _statCount;
|
||||||
|
|
||||||
int _sendingMode;
|
int _sendingMode;
|
||||||
|
@ -66,5 +66,5 @@ private:
|
||||||
details _extraServerDetails[MAX_VOXEL_SERVERS];
|
details _extraServerDetails[MAX_VOXEL_SERVERS];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__interface__VoxelStatsDialog__) */
|
#endif /* defined(__interface__OctreeStatsDialog__) */
|
||||||
|
|
Loading…
Reference in a new issue