mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 04:53:28 +02:00
cleanup names and fix some warnings
This commit is contained in:
parent
35606c87ad
commit
5ffff958fe
54 changed files with 48 additions and 51 deletions
|
@ -39,4 +39,4 @@ add_subdirectory(domain-server)
|
|||
add_subdirectory(interface)
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(voxel-edit)
|
||||
add_subdirectory(SvoViewer)
|
||||
add_subdirectory(svo-viewer)
|
||||
|
|
|
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
|
|||
set(ROOT_DIR ..)
|
||||
set(MACRO_DIR ${ROOT_DIR}/cmake/macros)
|
||||
|
||||
set(TARGET_NAME SvoViewer)
|
||||
set(TARGET_NAME svo-viewer)
|
||||
project(${TARGET_NAME})
|
||||
|
||||
# setup for find modules
|
||||
|
@ -42,9 +42,9 @@ endif (WIN32)
|
|||
include(${MACRO_DIR}/IncludeGLM.cmake)
|
||||
include_glm(${TARGET_NAME} ${ROOT_DIR})
|
||||
|
||||
# create the ${TARGET_NAME}Config.h file based on GL_HEADERS above
|
||||
configure_file(${TARGET_NAME}Config.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}Config.h)
|
||||
configure_file(${TARGET_NAME}Version.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}Version.h)
|
||||
# create the ${TARGET_NAME}-config.h file based on GL_HEADERS above
|
||||
configure_file(${TARGET_NAME}-config.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}-config.h)
|
||||
configure_file(${TARGET_NAME}-version.h.in ${PROJECT_BINARY_DIR}/includes/${TARGET_NAME}-version.h)
|
||||
|
||||
# grab the implementation and header files from src dirs
|
||||
file(GLOB APPLICATION_SRCS src/*.c src/*.cpp src/*.h)
|
||||
|
@ -81,7 +81,7 @@ if (APPLE)
|
|||
# configure CMake to use a custom Info.plist
|
||||
SET_TARGET_PROPERTIES( ${this_target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST MacOSXBundleInfo.plist.in )
|
||||
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME SvoViewer)
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME svo-viewer)
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER io.highfidelity.${TARGET_NAME})
|
||||
|
||||
# set how the icon shows up in the Info.plist file
|
|
@ -4,7 +4,7 @@
|
|||
//
|
||||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include <glm/gtx/quaternion.hpp>
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
|
@ -5,7 +5,7 @@
|
|||
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include "svoviewer.h"
|
||||
|
|
@ -80,7 +80,7 @@ void SvoViewer::InitializePointRenderSystem()
|
|||
_pointVerticesCount = args.count;
|
||||
|
||||
// create the data store.
|
||||
int size = _nodeCount * sizeof(glm::vec3);
|
||||
//int size = _nodeCount * sizeof(glm::vec3);
|
||||
glBindBuffer( GL_ARRAY_BUFFER, _pointVtxBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, _nodeCount * 3, args.buffer, GL_STATIC_DRAW);
|
||||
//glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL);
|
||||
|
@ -92,7 +92,7 @@ void SvoViewer::InitializePointRenderSystem()
|
|||
_renderFlags.ptRenderDirty = false;
|
||||
_ptRenderInitialized = true;
|
||||
float elapsed = (float)(usecTimestampNow() - fstart) / 1000.f;
|
||||
qDebug("Point render intialization took %f time for %d nodes\n", elapsed, _nodeCount);
|
||||
qDebug("Point render intialization took %f time for %ld nodes\n", elapsed, _nodeCount);
|
||||
}
|
||||
|
||||
void SvoViewer::RenderTreeSystemAsPoints()
|
||||
|
@ -324,11 +324,11 @@ void SvoViewer::InitializeVoxelRenderSystem()
|
|||
glShaderSource(_geometryShader, 1, &simpleGeomShaderSrc, &simpleGeomShaderLen);
|
||||
glShaderSource(_pixelShader, 1, &simpleFragShaderSrc, &simpleFragShaderLen);
|
||||
|
||||
// TODO: this was Matt's original windows code, it doesn't compile on mac, due to type mismatches
|
||||
#ifdef WIN32
|
||||
GLchar shaderLog[1000];
|
||||
GLsizei shaderLogLength;
|
||||
GLint compiled;
|
||||
// TODO: this was Matt's original windows code, it doesn't compile on mac, due to type mismatches
|
||||
#ifdef WIN32
|
||||
glCompileShaderARB(_vertexShader);
|
||||
glGetShaderInfoLog(_vertexShader, 1000, &shaderLogLength, shaderLog);
|
||||
if (shaderLog[0] != 0) qDebug("Shaderlog v :\n %s\n", shaderLog);
|
||||
|
@ -621,7 +621,7 @@ void SvoViewer::InitializeVoxelOptRenderSystem()
|
|||
// Set up the segments. Find the number of leaves at each subtree.
|
||||
OctreeElement * rootNode = _systemTree.getRoot();
|
||||
OctreeElement* node0fromRoot = rootNode->getChildAtIndex(0); // ALL the interesting data for our test SVO is in this node! HACK!!
|
||||
int rootNumChildren = rootNode->getChildCount();
|
||||
//int rootNumChildren = rootNode->getChildCount();
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++)
|
||||
{
|
||||
OctreeElement* childNode1stOrder = node0fromRoot->getChildAtIndex(i);
|
||||
|
@ -632,7 +632,7 @@ void SvoViewer::InitializeVoxelOptRenderSystem()
|
|||
OctreeElement* childNode2ndOrder = childNode1stOrder->getChildAtIndex(j);
|
||||
if (childNode2ndOrder == NULL) continue;
|
||||
|
||||
int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
||||
//int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
||||
// Figure out how populated this child is.
|
||||
FindNumLeavesData data;
|
||||
data.numLeaves = 0;
|
|
@ -190,7 +190,7 @@ void SvoViewer::InitializeVoxelOpt2RenderSystem()
|
|||
// Set up the segments. Find the number of leaves at each subtree.
|
||||
OctreeElement * rootNode = _systemTree.getRoot();
|
||||
OctreeElement* node0fromRoot = rootNode->getChildAtIndex(0); // ALL the interesting data for our test SVO is in this node! HACK!!
|
||||
int rootNumChildren = rootNode->getChildCount();
|
||||
//int rootNumChildren = rootNode->getChildCount();
|
||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++)
|
||||
{
|
||||
OctreeElement* childNode1stOrder = node0fromRoot->getChildAtIndex(i);
|
||||
|
@ -201,7 +201,7 @@ void SvoViewer::InitializeVoxelOpt2RenderSystem()
|
|||
OctreeElement* childNode2ndOrder = childNode1stOrder->getChildAtIndex(j);
|
||||
if (childNode2ndOrder == NULL) continue;
|
||||
|
||||
int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
||||
//int num2ndOrderChildren = childNode2ndOrder->getChildCount();
|
||||
// Figure out how populated this child is.
|
||||
FindNumLeavesData data;
|
||||
data.numLeaves = 0;
|
||||
|
@ -328,7 +328,7 @@ void SvoViewer::UpdateOpt2BVFaceVisibility()
|
|||
{
|
||||
if (_currentShaderModel != RENDER_OPT_CULLED_POLYS || _voxelOptRenderInitialized != true ) return;
|
||||
|
||||
float faceParamVals[NUM_CUBE_FACES];
|
||||
//float faceParamVals[NUM_CUBE_FACES];
|
||||
glm::vec3 pos = _myCamera.getPosition();
|
||||
|
||||
for (int i = 0; i < _numSegments; i++)
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -5,13 +5,14 @@
|
|||
// Created by Andrzej Kapolka on 4/24/13.
|
||||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QPaintEngine>
|
||||
#include <QtDebug>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
#include "TextRenderer.h"
|
||||
|
||||
// the width/height of the cached glyph textures
|
|
@ -9,13 +9,14 @@
|
|||
#ifndef __interface__TextRenderer__
|
||||
#define __interface__TextRenderer__
|
||||
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QFontMetrics>
|
||||
#include <QHash>
|
||||
#include <QImage>
|
||||
#include <QVector>
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
|
||||
// a special "character" that renders as a solid block
|
||||
const char SOLID_BLOCK_CHAR = 127;
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QDesktopWidget>
|
|
@ -4,7 +4,7 @@
|
|||
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include "svoviewer.h"
|
||||
#include <QtWidgets/QApplication>
|
|
@ -31,13 +31,17 @@ SvoViewer * _globalSvoViewerObj; // Hack :: var to store global pointer since th
|
|||
SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
||||
: QApplication(argc, argv),
|
||||
_window(new QMainWindow(desktop())),
|
||||
_glWidget(new GLCanvas()),
|
||||
_width(1280),
|
||||
_height(720),
|
||||
_pixelCount(1280*720),
|
||||
_frameCount(0),
|
||||
_glWidget(new GLCanvas()),
|
||||
_nodeCount(0),
|
||||
_leafCount(0),
|
||||
_nodeCount(0),
|
||||
_pitch(0),
|
||||
_yaw(0),
|
||||
_roll(0),
|
||||
_displayOnlyPartition(NO_PARTITION),
|
||||
_frameCount(0),
|
||||
_fps(0.0),
|
||||
_lastTimeFpsUpdated(0),
|
||||
_lastTimeFrameUpdated(0),
|
||||
|
@ -48,29 +52,25 @@ SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
|||
_vertexShader(0),
|
||||
_pixelShader(0),
|
||||
_geometryShader(0),
|
||||
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
||||
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
||||
_boundaryLevelAdjust(0),
|
||||
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
|
||||
_fieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES),
|
||||
_useVoxelTextures(false),
|
||||
_pointVertices(NULL),
|
||||
_pointVerticesCount(0),
|
||||
_numSegments(0),
|
||||
_useBoundingVolumes(true),
|
||||
_numElemsDrawn(0),
|
||||
_totalPossibleElems(0),
|
||||
_viewFrustumOffset(DEFAULT_FRUSTUM_OFFSET),
|
||||
_maxVoxels(DEFAULT_MAX_VOXELS_PER_SYSTEM),
|
||||
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
||||
_boundaryLevelAdjust(0),
|
||||
//_vboShaderData(NULL),
|
||||
_mousePressed(false),
|
||||
_pitch(0),
|
||||
_yaw(0),
|
||||
_roll(0),
|
||||
_numSegments(0),
|
||||
_displayOnlyPartition(NO_PARTITION),
|
||||
_totalPossibleElems(0),
|
||||
_numElemsDrawn(0),
|
||||
_useBoundingVolumes(true)
|
||||
_fieldOfView(DEFAULT_FIELD_OF_VIEW_DEGREES)
|
||||
{
|
||||
gettimeofday(&_applicationStartupTime, NULL);
|
||||
_appStartTickCount = usecTimestampNow();
|
||||
|
||||
_globalSvoViewerObj = this;
|
||||
_mousePressed = false;
|
||||
_useVoxelTextures = false;
|
||||
|
||||
//ui.setupUi(this);
|
||||
_window->setWindowTitle("SvoViewer");
|
||||
|
@ -89,7 +89,6 @@ SvoViewer::SvoViewer(int& argc, char** argv, QWidget *parent)
|
|||
QString shaderMode;
|
||||
|
||||
QStringList argumentList = arguments();
|
||||
int argumentIndex = 0;
|
||||
|
||||
// check if this domain server should use no authentication or a custom hostname for authentication
|
||||
const QString FILE_NAME = "--file";
|
||||
|
@ -211,8 +210,8 @@ void SvoViewer::init() {
|
|||
|
||||
void SvoViewer::initializeGL()
|
||||
{
|
||||
int argc = 0;
|
||||
#ifdef WIN32
|
||||
int argc = 0;
|
||||
glutInit(&argc, 0);
|
||||
#endif
|
||||
init();
|
||||
|
@ -585,13 +584,9 @@ void SvoViewer::keyReleaseEvent(QKeyEvent* event) {}
|
|||
|
||||
void SvoViewer::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
int deltaX = event->x() - _mouseX;
|
||||
int deltaY = event->y() - _mouseY;
|
||||
_mouseX = event->x();
|
||||
_mouseY = event->y();
|
||||
|
||||
|
||||
loadViewFrustum(_myCamera, _viewFrustum);
|
||||
loadViewFrustum(_myCamera, _viewFrustum);
|
||||
}
|
||||
|
||||
void SvoViewer::mousePressEvent(QMouseEvent* event)
|
||||
|
@ -639,8 +634,8 @@ bool SvoViewer::isVisibleBV(AABoundingVolume * volume, Camera * camera, ViewFrus
|
|||
//if (pos.z >= volume->getBound(2,AABF_HIGH)) return false;
|
||||
// Project all the points into screen space.
|
||||
AA2DBoundingVolume twoDBounds;
|
||||
float xvals[2] = {9999.0, -1.0};
|
||||
float yvals[2] = {9999.0, -1.0};
|
||||
//float xvals[2] = {9999.0, -1.0};
|
||||
//float yvals[2] = {9999.0, -1.0};
|
||||
//project all bv points into screen space.
|
||||
GLdouble scr[3];
|
||||
for (int i = 0; i < 8; i++)
|
||||
|
@ -660,8 +655,8 @@ bool SvoViewer::isVisibleBV(AABoundingVolume * volume, Camera * camera, ViewFrus
|
|||
float SvoViewer::visibleAngleSubtended(AABoundingVolume * volume, Camera * camera, ViewFrustum * frustum)
|
||||
{
|
||||
AA2DBoundingVolume twoDBounds;
|
||||
float xvals[2] = {9999.0, -1.0};
|
||||
float yvals[2] = {9999.0, -1.0};
|
||||
//float xvals[2] = {9999.0, -1.0};
|
||||
//float yvals[2] = {9999.0, -1.0};
|
||||
//project all bv points into screen space.
|
||||
GLdouble scr[3];
|
||||
for (int i = 0; i < 8; i++)
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "SvoViewerConfig.h"
|
||||
#include "svo-viewer-config.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QGLWidget>
|
Loading…
Reference in a new issue