Commit b0fc5120 authored by Matthias Möller's avatar Matthias Möller

fix deprecated warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17259 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 63f6a833
......@@ -99,43 +99,6 @@ class ScalarAssigner {
const Prop2 &prop2;
};
template<typename MeshT, typename MeshIteratorT>
class ColorSetIterator {
public:
typedef std::output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
ColorSetIterator(MeshT &mesh, MeshIteratorT it) : mesh(mesh), it(it) {}
ColorSetIterator &operator=(const ACG::Vec4f &color) {
mesh.set_color(*it, color);
return *this;
}
ColorSetIterator &operator*() {
return *this;
}
ColorSetIterator &operator++() {
++it;
return *this;
}
ColorSetIterator operator++(int) {
ColorSetIterator<MeshT, MeshIteratorT> cpy(*this);
++it;
return cpy;
}
private:
MeshT &mesh;
MeshIteratorT it;
};
template<typename MeshT, typename IteratorT, typename PropHandleType, float (*ScalarFn)(const typename MeshT::Point &, const typename MeshT::Point &)>
void colorElements(MeshT *mesh, const PropertyInfo &p1,
const PropertyInfo &p2,
......@@ -151,9 +114,10 @@ void colorElements(MeshT *mesh, const PropertyInfo &p1,
const float min = *std::min_element(scalars.begin(), scalars.end());
const float max = *std::max_element(scalars.begin(), scalars.end());
std::transform(scalars.begin(), scalars.end(), ColorSetIterator<MeshT, IteratorT>(*mesh, primitivesBegin),
ACG::ColorCoder(min, max, false));
}
ACG::ColorCoder colCod(min,max,false);
for (std::vector<float>::iterator i = scalars.begin(); i != scalars.end(); ++i)
mesh->set_color(*(primitivesBegin++),colCod(*i));
}
}
......
......@@ -93,43 +93,6 @@ class ScalarAssigner {
const Prop2 &prop2;
};
template<typename MeshT, typename MeshIteratorT>
class ColorSetIterator {
public:
typedef std::output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
ColorSetIterator(VolumeMeshObject<MeshT>* object, MeshIteratorT it) : object(object), it(it) {}
ColorSetIterator &operator=(const ACG::Vec4f &color) {
object->colors()[*it] = color;
return *this;
}
ColorSetIterator &operator*() {
return *this;
}
ColorSetIterator &operator++() {
++it;
return *this;
}
ColorSetIterator operator++(int) {
ColorSetIterator<MeshT, MeshIteratorT> cpy(*this);
++it;
return cpy;
}
private:
VolumeMeshObject<MeshT>* object;
MeshIteratorT it;
};
template<typename MeshT, typename IteratorT, typename PropHandle, float (*ScalarFn)(const ACG::Vec3d &, const ACG::Vec3d &)>
void colorElements(int objectID,
PropHandle prop1,
......@@ -148,8 +111,9 @@ void colorElements(int objectID,
VolumeMeshObject<MeshT>* object;
PluginFunctions::getObject(objectID, object);
std::transform(scalars.begin(), scalars.end(), ColorSetIterator<MeshT, IteratorT>(object, primitivesBegin),
ACG::ColorCoder(min, max, false));
ACG::ColorCoder colCod(min,max,false);
for (std::vector<float>::iterator i = scalars.begin(); i != scalars.end(); ++i)
object->colors()[*(primitivesBegin++)] = colCod(*i);
}
}
......
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