Commit 3fbe6879 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

* Prohibit DataContainer from storing DataHandles with empty name

* Introducing sigslot::signal::has_connections() to check whether a signal has listeners
* Fixed default OpenGL texture wrapping

Conflicts:
	modules/pipelinefactory.h
parent f1e61d6b
......@@ -25,6 +25,7 @@
#include "datacontainer.h"
#include "tgt/assert.h"
#include "tgt/logmanager.h"
#include "core/datastructures/abstractdata.h"
namespace campvis {
......@@ -41,14 +42,27 @@ namespace campvis {
}
DataHandle DataContainer::addData(const std::string& name, AbstractData* data) {
if (name.empty()) {
LERROR("Tried to add data with empty name to DataContainer.");
return DataHandle(0);
}
tgtAssert(data != 0, "The Data must not be 0.");
tgtAssert(!name.empty(), "The data's name must not be empty.");
DataHandle dh(data);
addDataHandle(name, dh);
return dh;
}
void DataContainer::addDataHandle(const std::string& name, const DataHandle& dh) {
if (name.empty()) {
LERROR("Tried to add data with empty name to DataContainer.");
return;
}
tgtAssert(dh.getData() != 0, "The data in the DataHandle must not be 0!");
tgtAssert(!name.empty(), "The data's name must not be empty.");
{
//tbb::spin_mutex::scoped_lock lock(_localMutex);
tbb::concurrent_unordered_map<std::string, DataHandle>::iterator it = _handles.find(name);
......
......@@ -186,7 +186,7 @@ namespace campvis {
}
_texture->uploadTexture();
_texture->setWrapping(tgt::Texture::CLAMP);
_texture->setWrapping(tgt::Texture::CLAMP_TO_EDGE);
if (isInteger && isSigned) {
// restore default
......
......@@ -458,6 +458,11 @@ namespace sigslot {
++it;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -555,6 +560,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
......@@ -654,6 +664,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -753,6 +768,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -854,6 +874,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -957,6 +982,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -1060,6 +1090,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -1162,6 +1197,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......@@ -1265,6 +1305,11 @@ namespace sigslot {
it = itNext;
}
}
bool has_connections() const
{
return !m_connected_slots.empty();
}
protected:
connections_list m_connected_slots;
......
Supports Markdown
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