-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature-IO-improvements
- Loading branch information
Showing
48 changed files
with
1,254 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
### Directories ### | ||
build/* | ||
_build/* | ||
output/* | ||
output_llg/* | ||
output_gneb/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef VFRENDERING_GLYPH_RENDERER_HXX | ||
#define VFRENDERING_GLYPH_RENDERER_HXX | ||
|
||
#include <VFRendering/VectorFieldRenderer.hxx> | ||
|
||
namespace VFRendering { | ||
class GlyphRenderer : public VectorFieldRenderer { | ||
public: | ||
|
||
GlyphRenderer(const View& view, const VectorField& vf); | ||
virtual ~GlyphRenderer(); | ||
virtual void update(bool keep_geometry) override; | ||
virtual void draw(float aspect_ratio) override; | ||
virtual void optionsHaveChanged(const std::vector<int>& changed_options) override; | ||
void setGlyph(const std::vector<glm::vec3>& positions, const std::vector<glm::vec3>& normals, const std::vector<std::uint16_t>& indices); | ||
|
||
private: | ||
void updateShaderProgram(); | ||
void updateVertexData(); | ||
void initialize(); | ||
|
||
bool m_is_initialized = false; | ||
std::vector<glm::vec3> m_positions; | ||
std::vector<glm::vec3> m_normals; | ||
std::vector<std::uint16_t> m_indices; | ||
unsigned int m_program = 0; | ||
unsigned int m_vao = 0; | ||
unsigned int m_position_vbo = 0; | ||
unsigned int m_normal_vbo = 0; | ||
unsigned int m_ibo = 0; | ||
unsigned int m_instance_position_vbo = 0; | ||
unsigned int m_instance_direction_vbo = 0; | ||
unsigned int m_num_indices = 0; | ||
unsigned int m_num_instances = 0; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef VFRENDERING_SPHERE_RENDERER_HXX | ||
#define VFRENDERING_SPHERE_RENDERER_HXX | ||
|
||
#include <VFRendering/GlyphRenderer.hxx> | ||
|
||
namespace VFRendering { | ||
class SphereRenderer : public GlyphRenderer { | ||
public: | ||
enum Option { | ||
SPHERE_RADIUS = 800, | ||
LEVEL_OF_DETAIL | ||
}; | ||
|
||
SphereRenderer(const View& view, const VectorField& vf); | ||
virtual void optionsHaveChanged(const std::vector<int>& changed_options) override; | ||
}; | ||
|
||
namespace Utilities { | ||
template<> | ||
struct Options::Option<SphereRenderer::Option::SPHERE_RADIUS> { | ||
float default_value = 0.2f; | ||
}; | ||
|
||
|
||
template<> | ||
struct Options::Option<SphereRenderer::Option::LEVEL_OF_DETAIL> { | ||
unsigned int default_value = 2; | ||
}; | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef VFRENDERING_VECTORFIELD_HXX | ||
#define VFRENDERING_VECTORFIELD_HXX | ||
|
||
#include <array> | ||
#include <memory> | ||
|
||
#include <glm/glm.hpp> | ||
|
||
#include <VFRendering/Options.hxx> | ||
#include <VFRendering/FPSCounter.hxx> | ||
#include <VFRendering/Utilities.hxx> | ||
#include <VFRendering/Geometry.hxx> | ||
|
||
namespace VFRendering { | ||
|
||
class VectorField { | ||
public: | ||
|
||
VectorField(const Geometry& geometry, const std::vector<glm::vec3>& vectors); | ||
virtual ~VectorField(); | ||
|
||
void update(const Geometry& geometry, const std::vector<glm::vec3>& vectors); | ||
void updateGeometry(const Geometry& geometry); | ||
void updateVectors(const std::vector<glm::vec3>& vectors); | ||
|
||
const std::vector<glm::vec3>& positions() const; | ||
const std::vector<glm::vec3>& directions() const; | ||
const std::vector<std::array<Geometry::index_type, 3>>& surfaceIndices() const; | ||
const std::vector<std::array<Geometry::index_type, 4>>& volumeIndices() const; | ||
|
||
unsigned long geometryUpdateId() const; | ||
unsigned long vectorsUpdateId() const; | ||
|
||
private: | ||
Geometry m_geometry; | ||
std::vector<glm::vec3> m_vectors; | ||
unsigned long m_geometry_update_id = 0; | ||
unsigned long m_vectors_update_id = 0; | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef VFRENDERING_VECTORFIELD_RENDERER_HXX | ||
#define VFRENDERING_VECTORFIELD_RENDERER_HXX | ||
|
||
#include <vector> | ||
|
||
#include <glm/glm.hpp> | ||
|
||
#include <VFRendering/View.hxx> | ||
#include <VFRendering/VectorField.hxx> | ||
#include <VFRendering/RendererBase.hxx> | ||
|
||
namespace VFRendering { | ||
class VectorFieldRenderer : public RendererBase { | ||
public: | ||
|
||
VectorFieldRenderer(const View& view, const VectorField& vf); | ||
|
||
virtual ~VectorFieldRenderer() {}; | ||
virtual void updateIfNecessary(); | ||
|
||
protected: | ||
const std::vector<glm::vec3>& positions() const; | ||
const std::vector<glm::vec3>& directions() const; | ||
const std::vector<std::array<Geometry::index_type, 3>>& surfaceIndices() const; | ||
const std::vector<std::array<Geometry::index_type, 4>>& volumeIndices() const; | ||
|
||
private: | ||
const VectorField& m_vf; | ||
unsigned long m_geometry_update_id = 0; | ||
unsigned long m_vectors_update_id = 0; | ||
}; | ||
|
||
} | ||
|
||
#endif |
6 changes: 3 additions & 3 deletions
6
VFRendering/include/VFRendering/VectorSphereRenderer.hxx
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.