Commit 8abced32 authored by schultezub's avatar schultezub
Browse files

Fixing GCC compatibility

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@489 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 1779f044
......@@ -140,7 +140,7 @@ namespace campvis {
for (size_t i = 1; i < numBuckets; ++i) {
xr = static_cast<float>(i) / static_cast<float>(numBuckets);
yr = (_logScale
? std::max(0.f, log(static_cast<float>(ih->getNumElements(i))) / maxFilling)
? std::max(0.f, static_cast<float>(log(static_cast<float>(ih->getNumElements(i)))) / maxFilling)
: static_cast<float>(ih->getNumElements(i)) / maxFilling);
glVertex2f(xl, 0.f);
......@@ -204,7 +204,7 @@ namespace campvis {
TFGeometry1D* g = _selectedGeometry->getGeometry();
std::vector<TFGeometry1D::KeyPoint>& kpts = g->getKeyPoints();
TFGeometry1D::KeyPoint kp(static_cast<float>(e->x()) / static_cast<float>(_canvas->width()), tgt::col4(255));
std::vector<TFGeometry1D::KeyPoint>::const_iterator lb = std::upper_bound(kpts.begin(), kpts.end(), kp);
std::vector<TFGeometry1D::KeyPoint>::iterator lb = std::upper_bound(kpts.begin(), kpts.end(), kp);
if (lb != kpts.end()) {
kp._color = lb->_color;
}
......
......@@ -38,7 +38,7 @@
#include "application/gui/properties/tfgeometrymanipulator.h"
#include "core/classification/geometry2dtransferfunction.h"
#include "core/classification/TFGeometry2D.h"
#include "core/classification/tfgeometry2d.h"
#include "core/datastructures/imagerepresentationlocal.h"
#include "core/properties/transferfunctionproperty.h"
#include "core/tools/opengljobprocessor.h"
......
......@@ -56,7 +56,7 @@ namespace campvis {
/**
* Pure virtual Destructor
*/
virtual ~AbstractTFGeometryManipulator() = 0 {};
virtual ~AbstractTFGeometryManipulator() {};
/**
* Sets the new viewport size.
......
......@@ -121,7 +121,7 @@ namespace campvis {
template<class T>
campvis::GenericGeometryTransferFunction<T>::~GenericGeometryTransferFunction() {
for (std::vector<T*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
for (typename std::vector<T*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
(*it)->s_changed.disconnect(this);
delete *it;
}
......@@ -161,7 +161,7 @@ namespace campvis {
void campvis::GenericGeometryTransferFunction<T>::removeGeometry(T* geometry) {
{
tbb::mutex::scoped_lock lock(_localMutex);
for (std::vector<T*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
for (typename std::vector<T*>::iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
if (*it == geometry) {
_geometries.erase(it);
break;
......@@ -233,7 +233,7 @@ namespace campvis {
glLoadIdentity();
for (std::vector<T*>::const_iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
for (typename std::vector<T*>::const_iterator it = _geometries.begin(); it != _geometries.end(); ++it) {
(*it)->render();
}
......
......@@ -82,7 +82,7 @@ namespace campvis {
void DataContainer::removeData(const std::string& name) {
tbb::spin_mutex::scoped_lock lock(_localMutex);
std::map<std::string, DataHandle>::const_iterator it = _handles.find(name);
std::map<std::string, DataHandle>::iterator it = _handles.find(name);
if (it != _handles.end()) {
_handles.erase(it);
}
......
......@@ -63,7 +63,7 @@ namespace campvis {
const std::string& url,
WeaklyTypedPointer::BaseType type,
size_t offset = 0,
EndianHelper::Endianness endianness = EndianHelper::LITTLE_ENDIAN,
EndianHelper::Endianness endianness = EndianHelper::IS_LITTLE_ENDIAN,
const tgt::svec3& stride = tgt::svec3::zero
);
......@@ -127,7 +127,7 @@ namespace campvis {
const std::string& url,
WeaklyTypedPointer::BaseType type,
size_t offset = 0,
EndianHelper::Endianness endianness = EndianHelper::LITTLE_ENDIAN,
EndianHelper::Endianness endianness = EndianHelper::IS_LITTLE_ENDIAN,
const tgt::svec3& stride = tgt::svec3::zero
);
......
......@@ -210,7 +210,7 @@ namespace campvis {
_texture = new tgt::Texture(
reinterpret_cast<GLubyte*>(data->getImageData()),
_size,
this->getSize(),
TypeTraits<BASETYPE, NUMCHANNELS>::glFormat,
TypeTraits<BASETYPE, NUMCHANNELS>::glInternalFormat,
TypeTraits<BASETYPE, NUMCHANNELS>::glDataType,
......
......@@ -51,7 +51,7 @@ namespace campvis {
/**
* Pure virtual Destructor
*/
virtual ~AbstractProcessorDecorator() = 0 {};
virtual ~AbstractProcessorDecorator() {};
/**
* Gets called by the processor during initialization to let the decorator
......
......@@ -220,7 +220,7 @@ namespace campvis {
tgtAssert(prop != 0, "Shared property must not be 0!");
if (NumericProperty<T>* tmp = dynamic_cast< NumericProperty<T>* >(prop)) {
AbstractProperty::addSharedProperty(prop);
tmp->setValue(getValue());
tmp->setValue(GenericProperty<T>::getValue());
return;
}
tgtAssert(false, "Shared property must be of the same type as this property!");
......@@ -244,25 +244,25 @@ namespace campvis {
template<typename T>
void campvis::NumericProperty<T>::setMinValue(const T& value) {
_minValue = value;
setValue(validateValue(_value));
this->setValue(validateValue(this->_value));
s_minMaxChanged(this);
}
template<typename T>
void campvis::NumericProperty<T>::setMaxValue(const T& value) {
_maxValue = value;
setValue(validateValue(_value));
this->setValue(validateValue(this->_value));
s_minMaxChanged(this);
}
template<typename T>
void campvis::NumericProperty<T>::increment() {
setValue(_value + T(1));
this->setValue(this->_value + T(1));
}
template<typename T>
void campvis::NumericProperty<T>::decrement() {
setValue(_value - T(1));
this->setValue(this->_value - T(1));
}
}
......
......@@ -57,7 +57,7 @@ namespace campvis {
/**
* Pure virtual destructor.
*/
virtual ~AbstractOptionProperty() = 0 {};
virtual ~AbstractOptionProperty() {};
/**
* Returns all Options als pair of std::strings.
......@@ -189,7 +189,7 @@ namespace campvis {
template<typename T>
std::vector< std::pair<std::string, std::string> > campvis::GenericOptionProperty<T>::getOptionsAsPairOfStrings() const {
std::vector< std::pair<std::string, std::string> > toReturn;
for (std::vector< GenericOption<T> >::const_iterator it = _options.begin(); it != _options.end(); ++it) {
for (typename std::vector< GenericOption<T> >::const_iterator it = _options.begin(); it != _options.end(); ++it) {
toReturn.push_back(std::make_pair(it->_id, it->_title));
}
return toReturn;
......
......@@ -27,7 +27,7 @@
//
// ================================================================================================
#include "TransferFunctionProperty.h"
#include "transferfunctionproperty.h"
namespace campvis {
......
......@@ -100,8 +100,8 @@ namespace campvis {
struct EndianHelper {
/// Type of Endianness
enum Endianness {
LITTLE_ENDIAN, ///< little endian
BIG_ENDIAN ///< big endian
IS_LITTLE_ENDIAN, ///< little endian
IS_BIG_ENDIAN ///< big endian
};
/**
......@@ -113,7 +113,7 @@ namespace campvis {
uint32_t i;
char c[4];
} bint = {0x01020304};
return (bint.c[0] == 1) ? BIG_ENDIAN : LITTLE_ENDIAN;
return (bint.c[0] == 1) ? IS_BIG_ENDIAN : IS_LITTLE_ENDIAN;
}
/**
......@@ -129,4 +129,4 @@ namespace campvis {
};
}
#endif
\ No newline at end of file
#endif
......@@ -43,7 +43,7 @@ namespace campvis {
/**
* Pure virtual destructor.
*/
virtual ~AbstractJob() = 0 {};
virtual ~AbstractJob() {};
/**
* Executes the job, to be overwritten by subclasses.
......
......@@ -146,7 +146,7 @@ namespace campvis {
*/
void notifyObservers(const T& args) const {
tbb::spin_mutex::scoped_lock lock(_localMutex);
for (std::set< GenericObserver<T>* >::iterator it = _observers.begin(); it != _observers.end(); ++it) {
for (typename std::set< GenericObserver<T>* >::iterator it = _observers.begin(); it != _observers.end(); ++it) {
(*it)->onNotify(args);
}
};
......
......@@ -38,20 +38,21 @@ namespace campvis {
Runnable::Runnable()
: _stopExecution()
, _thread()
, _thread(0)
{
_stopExecution = false;
}
Runnable::~Runnable() {
stop();
delete _thread;
}
void Runnable::stop() {
_stopExecution = true;
try {
if (_thread.joinable())
_thread.join();
if (_thread->joinable())
_thread->join();
}
catch(std::exception& e) {
LERRORC("CAMPVis.core.tools.Runnable", "Caught exception during _thread.join: " << e.what());
......@@ -59,7 +60,7 @@ namespace campvis {
}
void Runnable::start() {
_thread = std::thread(&invokeThread, this);
_thread = new std::thread(&invokeThread, this);
}
}
......@@ -78,7 +78,7 @@ namespace campvis {
/// Runnables are not copyable
Runnable& operator =(Runnable const&);
std::thread _thread; ///< Thread of the Runnable
std::thread* _thread; ///< Thread of the Runnable
};
}
......
......@@ -163,7 +163,7 @@ namespace campvis {
return "";
std::stringstream s;
s << tokens[0];
for (std::vector<T>::size_type i = 1; i < tokens.size(); ++i)
for (typename std::vector<T>::size_type i = 1; i < tokens.size(); ++i)
s << delimiter << tokens[i];
return s.str();
}
......
......@@ -278,20 +278,18 @@ namespace {
* \tparam ISFLOAT Flag whether base type is floating point or integer
* \tparam ISSIGNED Flag whether base type is signed or not (ignored when ISFLOAT == true)
*/
template<bool ISFLOAT, bool ISSIGNED>
template<typename T, bool ISFLOAT, bool ISSIGNED>
struct TypeNormalizerHelper {};
/**
* Template specialization for floating point types - no normalization needed.
*/
template<bool ISSIGNED>
struct TypeNormalizerHelper<true, ISSIGNED> {
template<typename T>
template<typename T, bool ISSIGNED>
struct TypeNormalizerHelper<T, true, ISSIGNED> {
static float normalizeToFloat(T value) {
return static_cast<float>(value);
}
template<typename T>
static T denormalizeFromFloat(float value) {
return static_cast<T>(value);
};
......@@ -300,14 +298,12 @@ namespace {
/**
* Template specialization for unsigned integer types, map from [0, max] to [0.0, 1.0]
*/
template<>
struct TypeNormalizerHelper<false, false> {
template<typename T>
template<typename T>
struct TypeNormalizerHelper<T, false, false> {
static float normalizeToFloat(T value) {
return static_cast<float>(value) / std::numeric_limits<T>::max();
}
template<typename T>
static T denormalizeFromFloat(float value) {
value = tgt::clamp(value, 0.0f, 1.0f);
return static_cast<T>(value * std::numeric_limits<T>::max());
......@@ -317,9 +313,8 @@ namespace {
/**
* Template specialization for unsigned integer types, map from [min, max] to [0.0, 1.0]
*/
template<>
struct TypeNormalizerHelper<false, true> {
template<typename T>
template<typename T>
struct TypeNormalizerHelper<T, false, true> {
static float normalizeToFloat(T value) {
if (value >= 0)
return (static_cast<float>(value) / std::numeric_limits<T>::max()) * .5f + .5f;
......@@ -327,7 +322,6 @@ namespace {
return (static_cast<float>(value) / -std::numeric_limits<T>::min()) * .5f + .5f;
}
template<typename T>
static T denormalizeFromFloat(float value) {
value = (tgt::clamp(value, 0.0f, 1.0f) - .5f) * 2.f;
if(value >= 0.0f)
......@@ -413,7 +407,7 @@ namespace {
*/
template<typename T>
static float normalizeToFloat(T value) {
return TypeNormalizerHelper<TypeTraitsHelperPerBasetype<T>::isFloat, TypeTraitsHelperPerBasetype<T>::isSigned>::normalizeToFloat<T>(value);
return TypeNormalizerHelper<T, TypeTraitsHelperPerBasetype<T>::isFloat, TypeTraitsHelperPerBasetype<T>::isSigned>::normalizeToFloat(value);
};
/**
......@@ -428,7 +422,7 @@ namespace {
*/
template<typename T>
static T denormalizeFromFloat(float value) {
return TypeNormalizerHelper<TypeTraitsHelperPerBasetype<T>::isFloat, TypeTraitsHelperPerBasetype<T>::isSigned>::denormalizeFromFloat<T>(value);
return TypeNormalizerHelper<T, TypeTraitsHelperPerBasetype<T>::isFloat, TypeTraitsHelperPerBasetype<T>::isSigned>::denormalizeFromFloat(value);
}
};
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
namespace tgt {
BufferObject::BufferObject(TargetType target, UsageType usage)
BufferObject::BufferObject(TargetType target, UsageType usage) throw (tgt::Exception)
: _id(0)
, _targetType(target)
, _usageType(usage)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment