mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 06:48:35 -05:00
Started cleanup of RenderableStars class
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user