diff --git a/ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh b/ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh index f9584ce0b25f3ffbbe6baab1b45d1b530d837108..741de1b6543c28cc2585dc0c6ad54f86dfefe8e6 100644 --- a/ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh +++ b/ObjectTypes/VolumeMeshObject/VolumeMeshObject.hh @@ -115,6 +115,11 @@ public: MeshT* mesh(); const MeshT* mesh() const; + /// re-create mesh attribute objects. This us useful after + /// using mesh assignment to use the newly assigned properties instead + /// of the old stale ones. + void recreateAttributes(); + /** return a full copy of this object ( All scenegraph nodes will be created ) * but the object will not be a part of the object tree. */ diff --git a/ObjectTypes/VolumeMeshObject/VolumeMeshObjectT_impl.hh b/ObjectTypes/VolumeMeshObject/VolumeMeshObjectT_impl.hh index ba16fa0b09377795d53476c71ee6f94255cba045..3c948a53c60133a138b22490f3ad10dcaf0bd877 100644 --- a/ObjectTypes/VolumeMeshObject/VolumeMeshObjectT_impl.hh +++ b/ObjectTypes/VolumeMeshObject/VolumeMeshObjectT_impl.hh @@ -98,6 +98,16 @@ VolumeMeshObject<MeshT>::VolumeMeshObject(DataType _typeId) : init(); } + +template<class MeshT> +void VolumeMeshObject<MeshT>::recreateAttributes() +{ + statusAttrib_ = StatusAttrib(*mesh_); + colorAttrib_ = ColorAttrib(*mesh_); + normalAttrib_ = NormalAttrib(*mesh_); + texcoordAttrib_ = TexCoordAttrib(*mesh_); +} + template<class MeshT> VolumeMeshObject<MeshT>::~VolumeMeshObject() {