Global pass over the coding style

This commit is contained in:
Alexander Bock
2024-06-12 14:51:25 +02:00
parent 46fea0a047
commit 866aad2187
23 changed files with 103 additions and 78 deletions

View File

@@ -76,7 +76,8 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo HighlightLineWidthInfo = {
"HighlightLineWidth",
"Highlight Line Width",
"The width of the highlighted grid lines. The larger number, the thicker the lines.",
"The width of the highlighted grid lines. The larger number, the thicker the "
"lines.",
openspace::properties::Property::Visibility::User
};

View File

@@ -492,8 +492,8 @@ void RenderableInterpolatedPoints::initializeBufferData() {
LDEBUG(std::format("Generating Vertex Buffer Object id '{}'", _vbo));
}
const int attibutesPerPoint = nAttributesPerPoint();
const unsigned int bufferSize = attibutesPerPoint * _nDataPoints * sizeof(float);
const int attibsPerPoint = nAttributesPerPoint();
const unsigned int bufferSize = attibsPerPoint * _nDataPoints * sizeof(float);
// Allocate the memory for the buffer (we will want to upload the data quite often)
glBindVertexArray(_vao);
@@ -502,31 +502,31 @@ void RenderableInterpolatedPoints::initializeBufferData() {
int offset = 0;
offset = bufferVertexAttribute("in_position0", 3, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_position1", 3, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_position0", 3, attibsPerPoint, offset);
offset = bufferVertexAttribute("in_position1", 3, attibsPerPoint, offset);
if (useSplineInterpolation()) {
offset = bufferVertexAttribute("in_position_before", 3, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_position_after", 3, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_position_before", 3, attibsPerPoint, offset);
offset = bufferVertexAttribute("in_position_after", 3, attibsPerPoint, offset);
}
if (hasColorData()) {
offset = bufferVertexAttribute("in_colorParameter0", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_colorParameter1", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_colorParameter0", 1, attibsPerPoint, offset);
offset = bufferVertexAttribute("in_colorParameter1", 1, attibsPerPoint, offset);
}
if (hasSizeData()) {
offset = bufferVertexAttribute("in_scalingParameter0", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_scalingParameter1", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_scalingParameter0", 1, attibsPerPoint, offset);
offset = bufferVertexAttribute("in_scalingParameter1", 1, attibsPerPoint, offset);
}
if (useOrientationData()) {
offset = bufferVertexAttribute("in_orientation0", 4, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_orientation1", 4, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_orientation0", 4, attibsPerPoint, offset);
offset = bufferVertexAttribute("in_orientation1", 4, attibsPerPoint, offset);
}
if (_hasSpriteTexture) {
offset = bufferVertexAttribute("in_textureLayer", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_textureLayer", 1, attibsPerPoint, offset);
}
glBindVertexArray(0);

View File

@@ -189,13 +189,14 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo UseOrientationDataInfo = {
"UseOrientationData",
"Use Orientation Data",
"If true, the orientation data in the dataset is included when rendering the points, "
"if there is any. To see the rotation, you also need to set the \"Orientation "
"Render Option\" to \"Fixed Rotation\".",
"If true, the orientation data in the dataset is included when rendering the "
"points, if there is any. To see the rotation, you also need to set the "
"\"Orientation Render Option\" to \"Fixed Rotation\".",
openspace::properties::Property::Visibility::AdvancedUser
};
constexpr openspace::properties::Property::PropertyInfo OrientationRenderOptionInfo = {
constexpr openspace::properties::Property::PropertyInfo OrientationRenderOptionInfo =
{
"OrientationRenderOption",
"Orientation Render Option",
"Controls how the planes for the points will be oriented. \"Camera View "
@@ -1116,7 +1117,14 @@ void RenderablePointCloud::generateArrayTextures() {
unsigned int layer = 0;
for (const size_t& i : textureListIndices) {
ghoul::opengl::Texture* texture = _textures[i].get();
fillAndUploadTextureLayer(arrayIndex, layer, i, res, useAlpha, texture->pixelData());
fillAndUploadTextureLayer(
arrayIndex,
layer,
i,
res,
useAlpha,
texture->pixelData()
);
layer++;
// At this point we don't need the keep the texture data around anymore. If
@@ -1451,7 +1459,7 @@ int RenderablePointCloud::nAttributesPerPoint() const {
}
int RenderablePointCloud::bufferVertexAttribute(const std::string& name, GLint nValues,
int nAttributesPerPoint, int offset) const
int nAttributesPerPoint, int offset) const
{
GLint attrib = _program->attributeLocation(name);
glEnableVertexAttribArray(attrib);
@@ -1493,25 +1501,25 @@ void RenderablePointCloud::updateBufferData() {
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, size * sizeof(float), slice.data(), GL_STATIC_DRAW);
const int attibutesPerPoint = nAttributesPerPoint();
const int attibsPerPoint = nAttributesPerPoint();
int offset = 0;
offset = bufferVertexAttribute("in_position", 3, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_position", 3, attibsPerPoint, offset);
if (hasColorData()) {
offset = bufferVertexAttribute("in_colorParameter", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_colorParameter", 1, attibsPerPoint, offset);
}
if (hasSizeData()) {
offset = bufferVertexAttribute("in_scalingParameter", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_scalingParameter", 1, attibsPerPoint, offset);
}
if (useOrientationData()) {
offset = bufferVertexAttribute("in_orientation", 4, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_orientation", 4, attibsPerPoint, offset);
}
if (_hasSpriteTexture) {
offset = bufferVertexAttribute("in_textureLayer", 1, attibutesPerPoint, offset);
offset = bufferVertexAttribute("in_textureLayer", 1, attibsPerPoint, offset);
}
glBindVertexArray(0);
@@ -1543,7 +1551,8 @@ void RenderablePointCloud::updateSpriteTexture() {
initializeSingleTexture();
// Note that these are usually set when the data slice initialized. However,
// we want to avoid reinitializing the data, and here we know that all points
// will be rendered using the same texture array and hence the data can stay fixed
// will be rendered using the same texture array and hence the data can stay
// fixed
_textureArrays.front().nPoints = _nDataPoints;
_textureArrays.front().startOffset = 0;
_dataIsDirty = false;

View File

@@ -130,9 +130,9 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo ModelScaleInfo = {
"ModelScale",
"Model Scale",
"The scale of the model. If a numeric value is provided in the asset file, the scale "
"will be that exact value. If instead a unit name is provided, this "
"is the value that that name represents. For example 'Centimeter' becomes 0.01.",
"The scale of the model. If a numeric value is provided in the asset file, the "
"scale will be that exact value. If instead a unit name is provided, this is the "
"value that that name represents. For example 'Centimeter' becomes 0.01.",
openspace::properties::Property::Visibility::AdvancedUser
};

View File

@@ -196,7 +196,7 @@ private:
UniformCache(opacity, modelViewTransform, projectionTransform, color, useLineFade,
lineLength, lineFadeAmount, vertexSortingMethod, idOffset, nVertices, stride,
pointSize, renderPhase, useSplitRenderMode, floatingOffset, numberOfUniqueVertices
) _uniformCache;
) _uniformCache;
#else
UniformCache(opacity, modelViewTransform, projectionTransform, color, useLineFade,
lineLength, lineFadeAmount, vertexSortingMethod, idOffset, nVertices, stride,

View File

@@ -82,7 +82,7 @@ private:
properties::IntProperty _timeStampSubsamplingFactor;
/// Determines whether the full trail should be rendered or the future trail removed
properties::BoolProperty _renderFullTrail;
/// Determines how many vertices around the object that will be
/// Determines how many vertices around the object that will be
/// replaced during full trail rendering
properties::IntProperty _numberOfReplacementPoints;
@@ -114,7 +114,7 @@ private:
/// Contains all timestamps corresponding to the positions in _vertexArray
std::vector<double> _timeVector;
/// Keeps track of all double precision vertices of trails
std::vector<TrailVBOLayout<double>> _dVertexArray;