mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 01:39:47 -05:00
Distant dependent LOD geometry. Demo purpose only.
This commit is contained in:
+30
-13
@@ -25,7 +25,8 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/../modules/globebrowsing/datastructures/chunknode.h>
|
||||
#include <modules/globebrowsing/rendering/chunklodglobe.h>
|
||||
#include <modules/globebrowsing/datastructures/chunknode.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <glm/glm.hpp>
|
||||
@@ -34,26 +35,39 @@ using namespace openspace;
|
||||
|
||||
class ChunkNodeTest : public testing::Test {};
|
||||
|
||||
/*
|
||||
TEST_F(ChunkNodeTest, Split) {
|
||||
|
||||
ghoul::Dictionary dict;
|
||||
ChunkLodGlobe chunkLodNode(dict);
|
||||
chunkLodNode.initialize();
|
||||
|
||||
BoundingRect bounds(Vec2(2, 2), Vec2(2, 2));
|
||||
auto cn = std::shared_ptr<ChunkNode>(new ChunkNode(bounds));
|
||||
ASSERT_TRUE(cn->isRoot()) << "Chunk node is root";
|
||||
ASSERT_TRUE(cn->isLeaf()) << "Chunk node is leaf";
|
||||
ChunkNode cn(chunkLodNode,bounds);
|
||||
ASSERT_TRUE(cn.isRoot()) << "Chunk node is root";
|
||||
ASSERT_TRUE(cn.isLeaf()) << "Chunk node is leaf";
|
||||
|
||||
cn->split();
|
||||
ASSERT_TRUE(cn->isRoot()) << "Chunk node is root";
|
||||
ASSERT_FALSE(cn->isLeaf()) << "Chunk node is not leaf";
|
||||
cn.split();
|
||||
ASSERT_TRUE(cn.isRoot()) << "Chunk node is root";
|
||||
ASSERT_FALSE(cn.isLeaf()) << "Chunk node is not leaf";
|
||||
|
||||
ASSERT_EQ(cn->bounds.center.x, cn->getChild(Quad::NORTH_WEST).bounds.center.x * 2);
|
||||
ASSERT_EQ(cn->bounds.center.x, cn->getChild(Quad::NORTH_EAST).bounds.center.x * 2/3);
|
||||
ASSERT_EQ(cn.bounds.center.x, cn.getChild(Quad::NORTH_WEST).bounds.center.x * 2);
|
||||
ASSERT_EQ(cn.bounds.center.x, cn.getChild(Quad::NORTH_EAST).bounds.center.x * 2/3);
|
||||
|
||||
ASSERT_EQ(cn->bounds.halfSize.x, cn->getChild(Quad::NORTH_WEST).bounds.halfSize.x * 2);
|
||||
ASSERT_EQ(cn->bounds.halfSize.y, cn->getChild(Quad::NORTH_WEST).bounds.halfSize.y * 2);
|
||||
ASSERT_EQ(cn.bounds.halfSize.x, cn.getChild(Quad::NORTH_WEST).bounds.halfSize.x * 2);
|
||||
ASSERT_EQ(cn.bounds.halfSize.y, cn.getChild(Quad::NORTH_WEST).bounds.halfSize.y * 2);
|
||||
|
||||
chunkLodNode.deinitialize();
|
||||
}
|
||||
|
||||
TEST_F(ChunkNodeTest, Merge) {
|
||||
ghoul::Dictionary dict;
|
||||
ChunkLodGlobe chunkLodNode(dict);
|
||||
chunkLodNode.initialize();
|
||||
|
||||
|
||||
BoundingRect bounds(Vec2(2, 2), Vec2(2, 2));
|
||||
ChunkNode cn(bounds);
|
||||
ChunkNode cn(chunkLodNode,bounds);
|
||||
ASSERT_TRUE(cn.isRoot()) << "Chunk node is root";
|
||||
ASSERT_TRUE(cn.isLeaf()) << "Chunk node is leaf";
|
||||
|
||||
@@ -65,4 +79,7 @@ TEST_F(ChunkNodeTest, Merge) {
|
||||
ASSERT_TRUE(cn.isRoot()) << "Chunk node is root";
|
||||
ASSERT_TRUE(cn.isLeaf()) << "Chunk node is leaf";
|
||||
|
||||
}
|
||||
chunkLodNode.deinitialize();
|
||||
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user