Started cleanup of RenderableStars class

This commit is contained in:
Alexander Bock
2014-11-25 19:15:59 +01:00
parent fdca1c0b3b
commit b4f6070642
5 changed files with 288 additions and 207 deletions

View File

@@ -33,10 +33,9 @@
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
namespace openspace {
namespace openspace{
class RenderableStars : public Renderable{
class RenderableStars : public Renderable {
public:
RenderableStars(const ghoul::Dictionary& dictionary);
~RenderableStars();
@@ -47,12 +46,34 @@ public:
void render(const RenderData& data) override;
void update(const UpdateData& data) override;
protected:
private:
class DataSource {
public:
const std::vector<float>& data() const;
virtual bool loadData() = 0;
protected:
std::vector<float> _data;
};
class SpeckDataSource : public DataSource {
public:
SpeckDataSource(const ghoul::Dictionary& dictionary);
bool loadData() override;
private:
bool readSpeckFile();
bool loadCachedFile(const std::string& file);
bool saveCachedFile(const std::string& file) const;
std::string _file;
};
void loadTexture();
private:
std::ifstream& skipToLine(std::ifstream& file, unsigned int num);
bool readSpeckFile(const std::string& path);
void generateBufferObjects(const void* data);
properties::StringProperty _colorTexturePath;
@@ -64,6 +85,8 @@ private:
std::string _speckPath;
DataSource* _source;
//GLint vertsToDraw;
GLuint _vboID;

View File

@@ -88,8 +88,13 @@ namespace modelgeometry {
} // namespace modelgeometry
namespace renderablestars {
const std::string keySpeckFile = "SpeckFile";
const std::string keyPathModule = "ModulePath";
const std::string keyDataSource = "DataSource";
const std::string keyTexture = "Texture";
namespace datasource {
const std::string keyType = "Type";
const std::string keyFile = "File";
} // namespace datasource
} // namespace renderablestars
namespace renderablevolumegl {