Vis2 Line Renderer
Linedata-Renderer with transparancy
Dataset.h
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4#include <vector>
5#include <string>
6
7#include "host_structures.h"
8
14{
15
16public:
17 Dataset();
18
23 void importFromFile(std::string filename);
24
29 void fillGPUReadyBuffer(std::vector<Vertex>& newVertexBuffer, std::vector<uint32_t>& newIndexBuffer);
30
35 void fillGPUReadyBuffer(std::vector<Vertex>& newVertexBuffer, std::vector<draw_call_t>& newDrawCalls);
36
40 float getLastLoadingTime() { return mLastLoadingTime; }
41
45 float getLastPreprocessTime() { return mLastPreprocessTime; }
46
50 int getLineCount() { return this->mLineCount; }
51
55 int getPolylineCount() { return this->mPolyLineBuffer.size(); }
56
60 int getVertexCount() { return this->mVertexCount; }
61
65 float getMaxLineLength() { return this->mMaxLineLength; }
66
70 float getMaxVertexAdjacentLineLength() { return this->mMaxVertexAdjacentLineLength; }
71
75 bool isFileOpen() { return mLineCount > 0; }
76
80 glm::vec3 getDimensions() {
81 return mMaximumCoordinateBounds - mMinimumCoordinateBounds;
82 }
83
88 glm::vec2 getDataBounds() {
89 return glm::vec2(mMinDataValue, mMaxDataValue);
90 }
91
95 std::string getName() { return mName; }
96
97private:
98 std::string mName; // The name of the file
99
100 std::vector<Poly> mPolyLineBuffer; // contains the loaded polylines
101 float mLastLoadingTime = 0.0F; // stores the time it took to load the data into cpu memory
102 float mLastPreprocessTime = 0.0F; // stores the time it took to preprocess the current data in seconds
103
104 glm::vec3 mMinimumCoordinateBounds = glm::vec3(1.0F, 1.0F, 1.0F);
105 glm::vec3 mMaximumCoordinateBounds = glm::vec3(0.0F, 0.0F, 0.0F);
106 float mMinDataValue = 1.0F;
107 float mMaxDataValue = 0.0F;
108
109 int mLineCount = 0;
110 int mVertexCount = 0;
111
112 float mMaxLineLength = 0.0F;
113 float mMaxVertexAdjacentLineLength = 0.0F;
114
120 void preprocessLineData();
121
125 void initializeValues();
126
127};
128
This class represents a Line-Dataset. It furthermore offers functionality to load data of an ....
Definition: Dataset.h:14
bool isFileOpen()
returns true if a file was loaded and the polyline buffer is full
Definition: Dataset.h:75
Dataset()
Definition: Dataset.cpp:24
int getLineCount()
Returns the amount of line individual line segments inside the file
Definition: Dataset.h:50
float getMaxLineLength()
returns the length of the longest line inside the dataset.
Definition: Dataset.h:65
std::string getName()
Returns the filename of the currently loaded dataset
Definition: Dataset.h:95
float getMaxVertexAdjacentLineLength()
returns the summed up length of the vertex with the longest adjacend lines.
Definition: Dataset.h:70
int getVertexCount()
Returns the amount of singular vertices in the dataset
Definition: Dataset.h:60
float getLastPreprocessTime()
Returns the time it took to preprocess the last file in seconds
Definition: Dataset.h:45
void importFromFile(std::string filename)
Load the data of the given ".obj" file into the cpu (mPolyLine-Buffer) and starts some preprocessing ...
Definition: Dataset.cpp:29
void fillGPUReadyBuffer(std::vector< Vertex > &newVertexBuffer, std::vector< uint32_t > &newIndexBuffer)
This function fills a vertex-list and an index list. the vertices at in between points of a line get ...
Definition: Dataset.cpp:164
int getPolylineCount()
Returns the amount of connected line segments
Definition: Dataset.h:55
glm::vec3 getDimensions()
returns the dimensions of the dataset
Definition: Dataset.h:80
glm::vec2 getDataBounds()
returns the min- and maximum
Definition: Dataset.h:88
float getLastLoadingTime()
Returns the time it took to import the last file in seconds
Definition: Dataset.h:40