vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Factories.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "LinearInterpolator.h"
5 
7 {
8 public:
9  static std::vector<std::string> getSupportedInterpolators()
10  {
11  std::vector<std::string> interpolators;
12  interpolators.push_back("LinearInterpolator");
13  interpolators.push_back("CatmullRomInterpolator");
14 
15  return interpolators;
16  }
17 
18  static InterpolatorPtr get(const std::string& name)
19  {
20  if(name == "LinearInterpolator")
21  return new LinearInterpolator;
22  else if(name == "CatmullRomInterpolator")
23  return new CatmullRomInterpolator;
24  else
25  return new NullInterpolator;
26  }
27 };
28 
29 //class BrushFactory
30 //{
31 // static std::vector<std::string> getSupportedBrushes()
32 // {
33 // std::vector<std::string> brushes;
34 // brushes.push_back("ConstantBrush");
35 // brushes.push_back("GradientBrush");
36 //
37 // return brushes;
38 // }
39 //
40 // static ColorGenPtr get(const std::string& name)
41 // {
42 // if(name == "GradientBrush")
43 // return new GradientBrush;
44 // else /*(name == "ConstantBrush")*/
45 // return new ConstantBrush; //NOTE: Constant brush is also a default brush (like null object)
46 // }
47 //};