hook tree stat calculation to menu

This commit is contained in:
Stephen Birarda 2013-08-15 14:50:12 -07:00
parent eb4508aafb
commit 474b0465a7
4 changed files with 13 additions and 12 deletions

View file

@ -530,7 +530,7 @@ void Application::keyPressEvent(QKeyEvent* event) {
case Qt::Key_S:
if (isShifted) {
doTreeStats();
_voxels.collectStatsForTreesAndVBOs();
} else {
_myAvatar.setDriveKeys(BACK, 1);
}
@ -1161,10 +1161,6 @@ void Application::doTrueVoxelColors() {
_voxels.trueColorize();
}
void Application::doTreeStats() {
_voxels.collectStatsForTreesAndVBOs();
}
void Application::disableLowResMoving(bool disableLowResMoving) {
_myAvatar.setWantLowResMoving(!disableLowResMoving);
}

View file

@ -168,7 +168,6 @@ private slots:
void doFalseColorizeBySource();
void doFalseColorizeInView();
void doTrueVoxelColors();
void doTreeStats();
void setWantsMonochrome(bool wantsMonochrome);
void disableLowResMoving(bool disableLowResMoving);
void disableDeltaSending(bool disableDeltaSending);

View file

@ -255,7 +255,11 @@ Menu::Menu() :
updateFrustumRenderModeAction();
addActionToQMenuAndActionHash(debugMenu, MenuOption::RunTimingTests, 0, this, SLOT(runTests()));
addActionToQMenuAndActionHash(debugMenu, MenuOption::TreeStats, Qt::SHIFT | Qt::Key_S);
addActionToQMenuAndActionHash(debugMenu,
MenuOption::TreeStats,
Qt::SHIFT | Qt::Key_S,
appInstance->getVoxels(),
SLOT(collectStatsForTreesAndVBOs()));
// debugMenu->addAction("Calculate Tree Stats", this, SLOT(doTreeStats()), Qt::SHIFT | Qt::Key_S);

View file

@ -1,13 +1,13 @@
//
// Cube.h
// VoxelSystem.h
// interface
//
// Created by Philip on 12/31/12.
// Copyright (c) 2012 High Fidelity, Inc. All rights reserved.
//
#ifndef __interface__Cube__
#define __interface__Cube__
#ifndef __interface__VoxelSystem__
#define __interface__VoxelSystem__
#include "InterfaceConfig.h"
#include <glm/glm.hpp>
@ -29,6 +29,7 @@ class ProgramObject;
const int NUM_CHILDREN = 8;
class VoxelSystem : public NodeData, public VoxelNodeDeleteHook, public NodeListHook {
Q_OBJECT
public:
VoxelSystem(float treeScale = TREE_SCALE, int maxVoxels = MAX_VOXELS_PER_SYSTEM);
~VoxelSystem();
@ -81,8 +82,6 @@ public:
bool findSpherePenetration(const glm::vec3& center, float radius, glm::vec3& penetration);
bool findCapsulePenetration(const glm::vec3& start, const glm::vec3& end, float radius, glm::vec3& penetration);
void collectStatsForTreesAndVBOs();
void deleteVoxelAt(float x, float y, float z, float s);
VoxelNode* getVoxelAt(float x, float y, float z, float s) const;
@ -101,6 +100,9 @@ public:
virtual void nodeDeleted(VoxelNode* node);
virtual void nodeAdded(Node* node);
virtual void nodeKilled(Node* node);
public slots:
void collectStatsForTreesAndVBOs();
protected:
float _treeScale;