1 #ifndef GlobeEngine_Streamlines_h
2 #define GlobeEngine_Streamlines_h
6 #include <vmmlib/vmmlib.hpp>
20 void loadTextures(std::vector<std::vector<std::string>> _fileList, vmml::Vector3s _dim);
23 return this->streamlineTextures;
31 this->streamlineInteractionInfo = _info;
35 return this->multilineGeometry;
41 void drawFrame(std::shared_ptr<ge::Camera> _cam);
49 std::vector<std::vector<std::shared_ptr<Texture3Drgb>>> streamlineTextures;
51 std::shared_ptr<geData::MultiLineObject> multilineGeometry;
52 std::shared_ptr<ge::Shader> programForMultiLineObject;
54 bool cmpf(
float A,
float B,
float epsilon = 0.005f)
56 return (
fabs(A - B) < epsilon);
61 return floor(f + 0.5);
64 int getIndex(vmml::Vector3f pos)
66 int dim_x = this->dimensions.x();
67 int dim_y = this->dimensions.y();
68 int dim_z = this->dimensions.z();
70 int x = round(pos.x());
71 int y = round(pos.y());
72 int z = round(pos.z());
75 if (x < 0 || x > dim_x - 1 || y < 0 || y > dim_y - 1 || z < 0 || z > dim_z - 1)
81 index = x + dim_x * (y + dim_y * z);
87 vmml::Vector3f map (vmml::Vector3f val)
89 float x = -18.0 + (val.x() * 36.0) / float(this->dimensions.x() - 1);
90 float y = -18.0 + (val.y() * 36.0) / float(this->dimensions.y() - 1);
91 float z = 4.0 - (val.z() * 8.0) / float(this->dimensions.z() - 1);
92 return vmml::Vector3f(x, z, y);
95 float euclideanDistance(vmml::Vector3f _point1, vmml::Vector3f _point2)
97 float x =
std::pow(_point1.x() - _point2.x(), 2);
98 float y =
std::pow(_point1.y() - _point2.y(), 2);
99 float z =
std::pow(_point1.z() - _point2.z(), 2);
105 vmml::Vector3s dimensions;
Streamlines()
Definition: Streamlines.cpp:5
void updatePolylines()
Definition: Streamlines.cpp:111
~Streamlines()
Definition: Streamlines.h:18
expr pow(half base, half exp)
Definition: Half.h:2231
std::vector< std::vector< std::shared_ptr< Texture3Drgb > > > getStreamlinesTextures()
Definition: Streamlines.h:22
void setTextureHandle(int _i, int _j)
Definition: Streamlines.h:26
void setInteractionInfo(gePlanetaryViewer::StreamlinesInteractionInfo _info)
Definition: Streamlines.h:30
half fabs(half arg)
Definition: Half.h:2061
void setTextureHandle(GLint _unit, const std::shared_ptr< ge::TextureHandle > _handle)
Definition: Composition.cpp:79
void loadTextures(std::vector< std::vector< std::string >> _fileList, vmml::Vector3s _dim)
Definition: Streamlines.cpp:16
Definition: PlanetaryViewerSceneBlueprint.h:47
std::shared_ptr< geData::MultiLineObject > getMultilineGeometry()
Definition: Streamlines.h:34
void drawFrame(std::shared_ptr< ge::Camera > _cam)
Definition: Streamlines.cpp:10
Definition: AvalancheTrainingSimulationEngine.h:28
Definition: Composition.h:23
Definition: Streamlines.h:13
expr sqrt(half arg)
Definition: Half.h:2206
half floor(half arg)
Definition: Half.h:2385