diff --git a/src/Viewer/CameraGroup.cxx b/src/Viewer/CameraGroup.cxx index 15b6f0029..a32ad3f15 100644 --- a/src/Viewer/CameraGroup.cxx +++ b/src/Viewer/CameraGroup.cxx @@ -721,6 +721,16 @@ CameraInfo* CameraGroup::buildCamera(SGPropertyNode* cameraNode) return info; } +void CameraGroup::removeCamera(CameraInfo *info) +{ + for (auto it = _cameras.begin(); it != _cameras.end(); ++it) { + if (*it == info) { + _cameras.erase(it); + return; + } + } +} + void CameraGroup::buildGUICamera(SGPropertyNode* cameraNode, GraphicsWindow* window) { diff --git a/src/Viewer/CameraGroup.hxx b/src/Viewer/CameraGroup.hxx index 0f24adf65..9ebcc570e 100644 --- a/src/Viewer/CameraGroup.hxx +++ b/src/Viewer/CameraGroup.hxx @@ -151,6 +151,10 @@ public: * @return a CameraInfo object for the camera. */ CameraInfo* buildCamera(SGPropertyNode* cameraNode); + /** Remove a camera from the camera group. + * @param info the camera info to remove. + */ + void removeCamera(CameraInfo *info); /** Create a camera from properties that will draw the GUI and add * it to the camera group. * @param cameraNode the property node. This can be 0, in which