diff --git a/MeshLib/PropertyVector.h b/MeshLib/PropertyVector.h index 4f4ffdb1e6e3066bced449e6dd27deb840b46b93..eef83543751df8be5515f108c8528b31062c0138 100644 --- a/MeshLib/PropertyVector.h +++ b/MeshLib/PropertyVector.h @@ -68,6 +68,15 @@ public: return std::vector<PROP_VAL_TYPE>::size() / _n_components; } + //! Returns the value for the given component stored in the given tuple. + PROP_VAL_TYPE& getComponent(std::size_t tuple_index, std::size_t component) + { + assert(component < _n_components); + assert(tuple_index < getNumberOfTuples()); + return this->operator[](tuple_index* getNumberOfComponents() + + component); + } + //! Returns the value for the given component stored in the given tuple. PROP_VAL_TYPE const& getComponent(std::size_t tuple_index, std::size_t component) const