mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 06:19:51 -05:00
Add check for usage of ghoul_assert instead of plain old assert
Update Ghoul
This commit is contained in:
@@ -184,12 +184,12 @@ bool KameleonWrapper::open(const std::string& filename) {
|
||||
}
|
||||
|
||||
void KameleonWrapper::close() {
|
||||
if (_kameleon)
|
||||
if (_kameleon) {
|
||||
_kameleon->close();
|
||||
if (_interpolator)
|
||||
delete _interpolator;
|
||||
if (_kameleon)
|
||||
delete _kameleon;
|
||||
}
|
||||
|
||||
delete _interpolator;
|
||||
delete _kameleon;
|
||||
|
||||
_kameleon = nullptr;
|
||||
_interpolator = nullptr;
|
||||
@@ -202,8 +202,7 @@ float* KameleonWrapper::getUniformSampledValues(
|
||||
const std::string& var,
|
||||
const glm::size3_t& outDimensions)
|
||||
{
|
||||
assert(_model && _interpolator);
|
||||
assert(outDimensions.x > 0 && outDimensions.y > 0 && outDimensions.z > 0);
|
||||
ghoul_assert(_model && _interpolator, "Model and interpolator must exist");
|
||||
LINFO("Loading variable " << var << " from CDF data with a uniform sampling");
|
||||
|
||||
unsigned int size = static_cast<unsigned int>(
|
||||
@@ -384,8 +383,7 @@ float* KameleonWrapper::getUniformSliceValues(const std::string& var,
|
||||
const glm::size3_t& outDimensions,
|
||||
const float& slice)
|
||||
{
|
||||
assert(_model && _interpolator);
|
||||
assert(outDimensions.x > 0 && outDimensions.y > 0 && outDimensions.z > 0);
|
||||
ghoul_assert(_model && _interpolator, "Model and interpolator must exist");
|
||||
LINFO("Loading variable " << var << " from CDF data with a uniform sampling");
|
||||
|
||||
unsigned int size = static_cast<unsigned int>(
|
||||
@@ -517,8 +515,7 @@ float* KameleonWrapper::getUniformSampledVectorValues(const std::string& xVar,
|
||||
const std::string& zVar,
|
||||
const glm::size3_t& outDimensions)
|
||||
{
|
||||
assert(_model && _interpolator);
|
||||
assert(outDimensions.x > 0 && outDimensions.y > 0 && outDimensions.z > 0);
|
||||
ghoul_assert(_model && _interpolator, "Model and interpolator must exist");
|
||||
LINFO(
|
||||
"Loading variables " << xVar << " " << yVar << " " << zVar <<
|
||||
" from CDF data with a uniform sampling"
|
||||
@@ -597,7 +594,7 @@ KameleonWrapper::Fieldlines KameleonWrapper::getClassifiedFieldLines(
|
||||
const std::vector<glm::vec3>& seedPoints,
|
||||
float stepSize )
|
||||
{
|
||||
assert(_model && _interpolator);
|
||||
ghoul_assert(_model && _interpolator, "Model and interpolator must exist");
|
||||
LINFO(
|
||||
"Creating " << seedPoints.size() << " fieldlines from variables " <<
|
||||
xVar << " " << yVar << " " << zVar
|
||||
@@ -654,7 +651,7 @@ KameleonWrapper::Fieldlines KameleonWrapper::getFieldLines(const std::string& xV
|
||||
const std::string& yVar, const std::string& zVar,
|
||||
const std::vector<glm::vec3>& seedPoints, float stepSize, const glm::vec4& color)
|
||||
{
|
||||
assert(_model && _interpolator);
|
||||
ghoul_assert(_model && _interpolator, "Model and interpolator must exist");
|
||||
LINFO(
|
||||
"Creating " << seedPoints.size() << " fieldlines from variables " <<
|
||||
xVar << " " << yVar << " " << zVar
|
||||
@@ -744,7 +741,7 @@ KameleonWrapper::Fieldlines KameleonWrapper::getLorentzTrajectories(
|
||||
glm::vec3 KameleonWrapper::getModelBarycenterOffset() {
|
||||
// ENLIL is centered, no need for offset
|
||||
if (_type == Model::ENLIL) {
|
||||
return glm::vec3(0,0,0);
|
||||
return glm::vec3(0.f);
|
||||
}
|
||||
|
||||
glm::vec3 offset;
|
||||
@@ -770,8 +767,9 @@ glm::vec4 KameleonWrapper::getModelBarycenterOffsetScaled() {
|
||||
}
|
||||
|
||||
glm::vec3 KameleonWrapper::getModelScale() {
|
||||
if (_type == Model::ENLIL)
|
||||
return glm::vec3(1.0f, 1.0f, 1.0f);
|
||||
if (_type == Model::ENLIL) {
|
||||
return glm::vec3(1.f);
|
||||
}
|
||||
|
||||
glm::vec3 scale;
|
||||
scale.x = _xMax - _xMin;
|
||||
|
||||
@@ -170,7 +170,7 @@ void AtlasManager::addToAtlas(int firstBrickIndex, int lastBrickIndex, float* ma
|
||||
unsigned int atlasCoords = _freeAtlasCoords.back();
|
||||
_freeAtlasCoords.pop_back();
|
||||
int level = _nOtLevels - floor(log((7.0 * (float(brickIndex % _nOtNodes)) + 1.0))/log(8)) - 1;
|
||||
assert(atlasCoords <= 0x0FFFFFFF);
|
||||
ghoul_assert(atlasCoords <= 0x0FFFFFFF, "@MISSING");
|
||||
unsigned int atlasData = (level << 28) + atlasCoords;
|
||||
_brickMap.insert(std::pair<unsigned int, unsigned int>(brickIndex, atlasData));
|
||||
_nStreamedBricks++;
|
||||
|
||||
@@ -358,8 +358,8 @@ bool LocalTfBrickSelector::calculateBrickErrors() {
|
||||
for (int i = 0; i < gradients.size(); i++) {
|
||||
float x = (i + 0.5f) / tfWidth;
|
||||
float sample = histogram->interpolate(x);
|
||||
assert(sample >= 0);
|
||||
assert(gradients[i] >= 0);
|
||||
ghoul_assert(sample >= 0, "@MISSING");
|
||||
ghoul_assert(gradients[i] >= 0, "@MISSING");
|
||||
error += sample * gradients[i];
|
||||
}
|
||||
_brickErrors[brickIndex].spatial = error;
|
||||
@@ -375,8 +375,8 @@ bool LocalTfBrickSelector::calculateBrickErrors() {
|
||||
for (int i = 0; i < gradients.size(); i++) {
|
||||
float x = (i + 0.5f) / tfWidth;
|
||||
float sample = histogram->interpolate(x);
|
||||
assert(sample >= 0);
|
||||
assert(gradients[i] >= 0);
|
||||
ghoul_assert(sample >= 0, "@MISSING");
|
||||
ghoul_assert(gradients[i] >= 0, "@MISSING");
|
||||
error += sample * gradients[i];
|
||||
}
|
||||
_brickErrors[brickIndex].temporal = error;
|
||||
|
||||
@@ -187,8 +187,6 @@ RenderableMultiresVolume::RenderableMultiresVolume (const ghoul::Dictionary& dic
|
||||
, _rotation(RotationInfo, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(6.28f))
|
||||
{
|
||||
std::string name;
|
||||
//bool success = dictionary.getValue(constants::scenegraphnode::keyName, name);
|
||||
//assert(success);
|
||||
|
||||
_filename = "";
|
||||
bool success = dictionary.getValue(KeyDataSource, _filename);
|
||||
|
||||
@@ -311,7 +311,7 @@ bool SimpleTfBrickSelector::calculateBrickImportances() {
|
||||
float x = static_cast<float>(i) / static_cast<float>(tfWidth);
|
||||
float sample = histogram->interpolate(x);
|
||||
|
||||
assert(sample >= 0);
|
||||
ghoul_assert(sample >= 0, "@MISSING");
|
||||
dotProduct += sample * tf->sample(i).w;
|
||||
}
|
||||
_brickImportances[brickIndex] = dotProduct;
|
||||
|
||||
@@ -367,8 +367,8 @@ bool TfBrickSelector::calculateBrickErrors() {
|
||||
for (int i = 0; i < gradients.size(); i++) {
|
||||
float x = (i + 0.5f) / tfWidth;
|
||||
float sample = histogram->interpolate(x);
|
||||
assert(sample >= 0);
|
||||
assert(gradients[i] >= 0);
|
||||
ghoul_assert(sample >= 0, "@MISSING");
|
||||
ghoul_assert(gradients[i] >= 0, "@MISSING");
|
||||
error += sample * gradients[i];
|
||||
}
|
||||
_brickErrors[brickIndex] = error;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLEKAMELEONVOLUME___H__
|
||||
#define __OPENSPACE_MODULE_VOLUME___RENDERABLEKAMELEONVOLUME___H__
|
||||
#ifndef __OPENSPACE_MODULE_VOLUME___RENDERABLETIMEVARYINGVOLUME___H__
|
||||
#define __OPENSPACE_MODULE_VOLUME___RENDERABLETIMEVARYINGVOLUME___H__
|
||||
|
||||
#include <openspace/rendering/renderable.h>
|
||||
|
||||
@@ -106,4 +106,4 @@ private:
|
||||
} // namespace volume
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_MODULE_KAMELEONVOLUME___RENDERABLEKAMELEONVOLUME___H__
|
||||
#endif // __OPENSPACE_MODULE_VOLUME___RENDERABLETIMEVARYINGVOLUME___H__
|
||||
|
||||
Reference in New Issue
Block a user