vtkOverrideInformation.h 2.93 KB
Newer Older
1 2 3 4
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkOverrideInformation.h
5

6
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 8 9
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

10 11
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
     PURPOSE.  See the above copyright notice for more information.
13 14 15 16 17 18 19 20

=========================================================================*/
// .NAME vtkOverrideInformation - Factory object override information
// .SECTION Description
// vtkOverrideInformation is used to represent the information about
// a class which is overriden in a vtkObjectFactory.
//

21 22
#ifndef vtkOverrideInformation_h
#define vtkOverrideInformation_h
23

24
#include "vtkCommonCoreModule.h" // For export macro
25
#include "vtkObject.h"
26 27

class vtkObjectFactory;
28

29
class VTKCOMMONCORE_EXPORT vtkOverrideInformation : public vtkObject
30
{
31
public:
32
  static vtkOverrideInformation* New();
33
  vtkTypeMacro(vtkOverrideInformation,vtkObject);
34 35
  // Description:
  // Print ObjectFactor to stream.
36
  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
37 38 39

  // Description:
  // Returns the name of the class being overriden.  For example,
40
  // if you had a factory that provided an override for
41
  // vtkVertex, then this funciton would return "vtkVertex"
42 43 44
  const char* GetClassOverrideName()
    {
      return this->ClassOverrideName;
45
    }
46

47 48 49 50 51
  // Description:
  // Returns the name of the class that will override the class.
  // For example, if you had a factory that provided an override for
  // vtkVertex called vtkMyVertex, then this would return "vtkMyVertex"
  const char* GetClassOverrideWithName()
52 53
    {
      return this->ClassOverrideWithName;
54
    }
55

56 57
  // Description:
  // Return a human readable or GUI displayable description of this
58
  // override.
59
  const char* GetDescription()
60 61
    {
      return this->Description;
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
    }

  // Description:
  // Return the specific object factory that this override occurs in.
  vtkObjectFactory* GetObjectFactory()
    {
      return this->ObjectFactory;
    }
  // Description:
  // Set the class override name
  vtkSetStringMacro(ClassOverrideName);
  // Set the class override with name
  vtkSetStringMacro(ClassOverrideWithName);
  // Set the description
  vtkSetStringMacro(Description);
protected:
78 79
  virtual void SetObjectFactory(vtkObjectFactory*);

80 81 82 83 84
private:
  vtkOverrideInformation();
  ~vtkOverrideInformation();
  // allow the object factory to set the values in this
  // class, but only the object factory
85

86
  friend class vtkObjectFactory;
87

88 89 90
  char* ClassOverrideName;
  char* ClassOverrideWithName;
  char* Description;
91
  vtkObjectFactory* ObjectFactory;
92
private:
93
  vtkOverrideInformation(const vtkOverrideInformation&) VTK_DELETE_FUNCTION;
94
  void operator=(const vtkOverrideInformation&) VTK_DELETE_FUNCTION;
95 96 97
};

#endif