| 60 | */ |
| 61 | template <typename Subclass> |
| 62 | static bool RegisterType() |
| 63 | { |
| 64 | vtkStringToken name = vtk::TypeName<Subclass>(); |
| 65 | auto status = vtkCellMetadata::Constructors().insert(std::make_pair(name, |
| 66 | [](vtkCellGrid* grid) |
| 67 | { |
| 68 | auto result = vtkSmartPointer<Subclass>::New(); |
| 69 | if (result) |
| 70 | { |
| 71 | result->SetCellGrid(grid); |
| 72 | } |
| 73 | return result; |
| 74 | })); |
| 75 | return status.second; // true if insertion occurred. |
| 76 | } |
| 77 | |
| 78 | template <typename Subclass> |
| 79 | static vtkSmartPointer<Subclass> NewInstance(vtkCellGrid* grid = nullptr) |
nothing calls this directly
no test coverage detected