Support layer and interaction transparancy. Refs #1

This commit is contained in:
2018-04-05 16:08:58 +02:00
parent 21fdc45e65
commit 3e4452ca3a
12 changed files with 114 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <vector>
#include "utils.hpp"
namespace fmri
{
@@ -19,10 +20,25 @@ namespace fmri
virtual void render() = 0;
virtual const std::vector<float>& nodePositions() const;
private:
static float getAlpha();
protected:
std::vector<float> nodePositions_;
template<Ordering Order>
void initNodePositions(size_t n, float spacing);
template<typename It>
void patchTransparancy(It begin, It end)
{
if constexpr (std::tuple_size<Color>::value >= 4) {
const auto alpha = getAlpha();
for (; begin != end; ++begin) {
Color &color = *begin;
color[3] = alpha;
}
}
}
};
}