跳转至

VTK Macro

VTK Macro

vtkStandardNewMacro

C++
1
2
3
4
vtkObjectFactory.h
// Macro to implement the standard form of the New() method.
#define vtkStandardNewMacro(thisClass)                                                             \
  thisClass* thisClass::New() { VTK_STANDARD_NEW_BODY(thisClass); }

VTK_STANDARD_NEW_BODY

C++
1
2
3
4
5
6
7
8
9
// Macro to implement the body of the standard form of the New() method.
#if defined(VTK_ALL_NEW_OBJECT_FACTORY)
#define VTK_STANDARD_NEW_BODY(thisClass) VTK_OBJECT_FACTORY_NEW_BODY(thisClass)
#else
#define VTK_STANDARD_NEW_BODY(thisClass)                                                           \
  auto result = new thisClass;                                                                     \
  result->InitializeObjectBase();                                                                  \
  return result
#endif