VTK  9.7.1
vtkGLSLModifierFactory.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkGLSLModifierFactory_h
11 #define vtkGLSLModifierFactory_h
12 
13 #include "vtkRenderingOpenGL2Module.h"
14 
15 #include <functional>
16 #include <map>
17 #include <string>
18 
19 VTK_ABI_NAMESPACE_BEGIN
21 
22 class VTKRENDERINGOPENGL2_EXPORT vtkGLSLModifierFactory
23 {
24 public:
25  using NewModFunction = std::function<vtkGLSLModifierBase*(void* userData)>;
26 
28  static vtkGLSLModifierBase* CreateAMod(const std::string& modName);
29 
35  static void RegisterAMod(
36  const std::string& modName, NewModFunction createFunction, void* userData = nullptr);
37 
38 private:
39  static vtkGLSLModifierFactory& GetInstance();
40 
41  struct ModCreator
42  {
44  void* UserData;
45  };
46  std::map<std::string, ModCreator> ModTable;
47 };
48 
49 VTK_ABI_NAMESPACE_END
50 #endif
51 // VTK-HeaderTest-Exclude: vtkGLSLModifierFactory.h
This class empowers developers to write and use GLSL mods easily in VTK.
Abstract class that helps you develop modifier for VTK GLSL shaders.
std::function< vtkGLSLModifierBase *(void *userData)> NewModFunction