From 176270f6395645098eec3b59a2135491b63ac2d1 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 2 Mar 2014 16:51:40 -0800 Subject: [PATCH] more VoxelSystem vs VoxelTree cleanup --- interface/src/VoxelImporter.cpp | 6 +++--- interface/src/VoxelSystem.cpp | 28 ---------------------------- interface/src/VoxelSystem.h | 5 ----- libraries/octree/src/Octree.h | 3 --- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/interface/src/VoxelImporter.cpp b/interface/src/VoxelImporter.cpp index 3949ee96d2..2daafedcbb 100644 --- a/interface/src/VoxelImporter.cpp +++ b/interface/src/VoxelImporter.cpp @@ -143,11 +143,11 @@ void ImportTask::run() { // Then we call the righ method for the job if (_filename.endsWith(".png", Qt::CaseInsensitive)) { - voxelSystem->readFromSquareARGB32Pixels(_filename.toLocal8Bit().data()); + voxelSystem->getTree()->readFromSquareARGB32Pixels(_filename.toLocal8Bit().data()); } else if (_filename.endsWith(".svo", Qt::CaseInsensitive)) { - voxelSystem->readFromSVOFile(_filename.toLocal8Bit().data()); + voxelSystem->getTree()->readFromSVOFile(_filename.toLocal8Bit().data()); } else if (_filename.endsWith(".schematic", Qt::CaseInsensitive)) { - voxelSystem->readFromSchematicFile(_filename.toLocal8Bit().data()); + voxelSystem->getTree()->readFromSchematicFile(_filename.toLocal8Bit().data()); } else { // We should never get here. qDebug() << "[ERROR] Invalid file extension." << endl; diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 28fb34d089..499b0d7212 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -524,34 +524,6 @@ void VoxelSystem::initVoxelMemory() { _readArraysLock.unlock(); } -void VoxelSystem::writeToSVOFile(const char* filename, VoxelTreeElement* element) const { - _tree->writeToSVOFile(filename, element); -} - -bool VoxelSystem::readFromSVOFile(const char* filename) { - bool result = _tree->readFromSVOFile(filename); - if (result) { - setupNewVoxelsForDrawing(); - } - return result; -} - -bool VoxelSystem::readFromSquareARGB32Pixels(const char *filename) { - bool result = _tree->readFromSquareARGB32Pixels(filename); - if (result) { - setupNewVoxelsForDrawing(); - } - return result; -} - -bool VoxelSystem::readFromSchematicFile(const char* filename) { - bool result = _tree->readFromSchematicFile(filename); - if (result) { - setupNewVoxelsForDrawing(); - } - return result; -} - int VoxelSystem::parseData(const QByteArray& packet) { bool showTimingDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); PerformanceWarning warn(showTimingDetails, "VoxelSystem::parseData()",showTimingDetails); diff --git a/interface/src/VoxelSystem.h b/interface/src/VoxelSystem.h index e956393c87..f0d78d82c2 100644 --- a/interface/src/VoxelSystem.h +++ b/interface/src/VoxelSystem.h @@ -67,11 +67,6 @@ public: ViewFrustum* getLastCulledViewFrustum() { return &_lastCulledViewFrustum; } - void writeToSVOFile(const char* filename, VoxelTreeElement* element) const; - bool readFromSVOFile(const char* filename); - bool readFromSquareARGB32Pixels(const char* filename); - bool readFromSchematicFile(const char* filename); - void setMaxVoxels(int maxVoxels); long int getMaxVoxels() const { return _maxVoxels; } unsigned long getVoxelMemoryUsageRAM() const { return _memoryUsageRAM; } diff --git a/libraries/octree/src/Octree.h b/libraries/octree/src/Octree.h index 8e7f9b0b23..807de85607 100644 --- a/libraries/octree/src/Octree.h +++ b/libraries/octree/src/Octree.h @@ -235,9 +235,6 @@ public: // these will read/write files that match the wireformat, excluding the 'V' leading void writeToSVOFile(const char* filename, OctreeElement* node = NULL); bool readFromSVOFile(const char* filename); - // reads voxels from square image with alpha as a Y-axis - bool readFromSquareARGB32Pixels(const char *filename); - bool readFromSchematicFile(const char* filename); // Octree does not currently handle its own locking, caller must use these to lock/unlock void lockForRead() { lock.lockForRead(); }