Commit b548bf22 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Rewrote vertex-centered circulators.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@890 fdac6126-5c0c-442c-9429-916003d36597
parent 6d70b254
This diff is collapsed.
...@@ -117,11 +117,13 @@ class GenericIteratorT { ...@@ -117,11 +117,13 @@ class GenericIteratorT {
} }
/// Get the handle of the item the iterator refers to. /// Get the handle of the item the iterator refers to.
DEPRECATED("This function clutters your code. Use dereferencing operators -> and * instead.")
value_handle handle() const { value_handle handle() const {
return hnd_; return hnd_;
} }
/// Cast to the handle of the item the iterator refers to. /// Cast to the handle of the item the iterator refers to.
DEPRECATED("Implicit casts of iterators are unsafe. Use dereferencing operators -> and * instead.")
operator value_handle() const { operator value_handle() const {
return hnd_; return hnd_;
} }
...@@ -144,6 +146,13 @@ class GenericIteratorT { ...@@ -144,6 +146,13 @@ class GenericIteratorT {
return *this; return *this;
} }
/// Standard post-increment operator
GenericIteratorT operator++(int) {
GenericIteratorT cpy(*this);
++(*this);
return cpy;
}
/// Standard pre-decrement operator /// Standard pre-decrement operator
GenericIteratorT& operator--() { GenericIteratorT& operator--() {
hnd_.__decrement(); hnd_.__decrement();
...@@ -152,6 +161,13 @@ class GenericIteratorT { ...@@ -152,6 +161,13 @@ class GenericIteratorT {
return *this; return *this;
} }
/// Standard post-decrement operator
GenericIteratorT operator--(int) {
GenericIteratorT cpy(*this);
--(*this);
return cpy;
}
/// Turn on skipping: automatically skip deleted/hidden elements /// Turn on skipping: automatically skip deleted/hidden elements
void enable_skipping() { void enable_skipping() {
if (mesh_ && (mesh_->*PrimitiveStatusMember)()) { if (mesh_ && (mesh_->*PrimitiveStatusMember)()) {
......
...@@ -95,21 +95,37 @@ public: ...@@ -95,21 +95,37 @@ public:
*/ */
//@{ //@{
/// Circulator /// Circulator
typedef Iterators::VertexVertexIterT<This> VertexVertexIter; typedef Iterators::GenericCirculatorT<This, typename This::VertexHandle, typename This::VertexHandle,
typedef Iterators::VertexOHalfedgeIterT<This> VertexOHalfedgeIter; &Iterators::GenericCirculatorBaseT<This>::toVertexHandle>
typedef Iterators::VertexIHalfedgeIterT<This> VertexIHalfedgeIter; VertexVertexIter;
typedef Iterators::VertexEdgeIterT<This> VertexEdgeIter;
typedef Iterators::VertexFaceIterT<This> VertexFaceIter; typedef Iterators::GenericCirculatorT<This, typename This::VertexHandle, typename This::HalfedgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toHalfedgeHandle>
VertexOHalfedgeIter;
typedef Iterators::GenericCirculatorT<This, typename This::VertexHandle, typename This::HalfedgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toOppositeHalfedgeHandle>
VertexIHalfedgeIter;
typedef Iterators::GenericCirculatorT<This, typename This::VertexHandle, typename This::FaceHandle,
&Iterators::GenericCirculatorBaseT<This>::toFaceHandle>
VertexFaceIter;
typedef Iterators::GenericCirculatorT<This, typename This::VertexHandle, typename This::EdgeHandle,
&Iterators::GenericCirculatorBaseT<This>::toEdgeHandle>
VertexEdgeIter;
typedef VertexVertexIter ConstVertexVertexIter;
typedef VertexOHalfedgeIter ConstVertexOHalfedgeIter;
typedef VertexIHalfedgeIter ConstVertexIHalfedgeIter;
typedef VertexFaceIter ConstVertexFaceIter;
typedef VertexEdgeIter ConstVertexEdgeIter;
typedef Iterators::FaceVertexIterT<This> FaceVertexIter; typedef Iterators::FaceVertexIterT<This> FaceVertexIter;
typedef Iterators::FaceHalfedgeIterT<This> FaceHalfedgeIter; typedef Iterators::FaceHalfedgeIterT<This> FaceHalfedgeIter;
typedef Iterators::FaceEdgeIterT<This> FaceEdgeIter; typedef Iterators::FaceEdgeIterT<This> FaceEdgeIter;
typedef Iterators::FaceFaceIterT<This> FaceFaceIter; typedef Iterators::FaceFaceIterT<This> FaceFaceIter;
typedef Iterators::ConstVertexVertexIterT<This> ConstVertexVertexIter;
typedef Iterators::ConstVertexOHalfedgeIterT<This> ConstVertexOHalfedgeIter;
typedef Iterators::ConstVertexIHalfedgeIterT<This> ConstVertexIHalfedgeIter;
typedef Iterators::ConstVertexEdgeIterT<This> ConstVertexEdgeIter;
typedef Iterators::ConstVertexFaceIterT<This> ConstVertexFaceIter;
typedef Iterators::ConstFaceVertexIterT<This> ConstFaceVertexIter; typedef Iterators::ConstFaceVertexIterT<This> ConstFaceVertexIter;
typedef Iterators::ConstFaceHalfedgeIterT<This> ConstFaceHalfedgeIter; typedef Iterators::ConstFaceHalfedgeIterT<This> ConstFaceHalfedgeIter;
typedef Iterators::ConstFaceEdgeIterT<This> ConstFaceEdgeIter; typedef Iterators::ConstFaceEdgeIterT<This> ConstFaceEdgeIter;
......
...@@ -77,6 +77,14 @@ ...@@ -77,6 +77,14 @@
# endif # endif
#endif #endif
#if defined(_MSCVER)
#define DEPRECATED(msg) __declspec(deprecated(msg))
#elif defined(__GNUC__) or defined(__clang__)
#define DEPRECATED(msg) __attribute__ ((deprecated(msg)))
#else
#define DEPRECATED(msg)
#endif
typedef unsigned int uint; typedef unsigned int uint;
//============================================================================= //=============================================================================
#endif // OPENMESH_CONFIG_H defined #endif // OPENMESH_CONFIG_H defined
......
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