/*========================================================================= Program: Visualization Toolkit Module: vtkOpenGLVolumeLookupTables.txx Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef vtkOpenGLVolumeLookupTables_txx #define vtkOpenGLVolumeLookupTables_txx #include "vtkOpenGLVolumeLookupTables.h" #include "vtkObjectFactory.h" #include "vtkWindow.h" template vtkStandardNewMacro(vtkOpenGLVolumeLookupTables); //----------------------------------------------------------------------------- template vtkOpenGLVolumeLookupTables::~vtkOpenGLVolumeLookupTables() { for (auto it = this->Tables.begin(); it != this->Tables.end(); ++it) { (*it)->Delete(); } } //---------------------------------------------------------------------------- template void vtkOpenGLVolumeLookupTables::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os, indent); for (auto it = this->Tables.begin(); it != this->Tables.end(); ++it) { (*it)->PrintSelf(os, indent.GetNextIndent()); } } //---------------------------------------------------------------------------- template void vtkOpenGLVolumeLookupTables::Create(std::size_t numberOfTables) { this->Tables.reserve(static_cast(numberOfTables)); for (std::size_t i = 0; i < numberOfTables; ++i) { auto* const table = T::New(); // table->Register(this); this->Tables.push_back(table); } } //---------------------------------------------------------------------------- template T* vtkOpenGLVolumeLookupTables::GetTable(std::size_t i) const { if (i >= this->Tables.size()) { return nullptr; } return this->Tables[i]; } //---------------------------------------------------------------------------- template std::size_t vtkOpenGLVolumeLookupTables::GetNumberOfTables() const { return this->Tables.size(); } //---------------------------------------------------------------------------- template void vtkOpenGLVolumeLookupTables::ReleaseGraphicsResources(vtkWindow* win) { for (auto it = this->Tables.begin(); it != this->Tables.end(); ++it) { (*it)->ReleaseGraphicsResources(win); } } #endif // vtkOpenGLVolumeLookupTables_txx