1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkAnnotationLayers.h
5 
6 -------------------------------------------------------------------------
7   Copyright 2008 Sandia Corporation.
8   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9   the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13   All rights reserved.
14   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16      This software is distributed WITHOUT ANY WARRANTY; without even
17      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18      PURPOSE.  See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
22 // .NAME vtkAnnotationLayers - Stores a ordered collection of annotation sets
23 //
24 // .SECTION Description
25 // vtkAnnotationLayers stores a vector of annotation layers. Each layer
26 // may contain any number of vtkAnnotation objects. The ordering of the
27 // layers introduces a prioritization of annotations. Annotations in
28 // higher layers may obscure annotations in lower layers.
29 
30 #ifndef vtkAnnotationLayers_h
31 #define vtkAnnotationLayers_h
32 
33 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkDataObject.h"
35 
36 class vtkAnnotation;
37 class vtkSelection;
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkAnnotationLayers : public vtkDataObject
40 {
41 public:
42   vtkTypeMacro(vtkAnnotationLayers, vtkDataObject);
43   void PrintSelf(ostream& os, vtkIndent indent);
44   static vtkAnnotationLayers* New();
45 
46   // Description:
47   // The current annotation associated with this annotation link.
48   virtual void SetCurrentAnnotation(vtkAnnotation* ann);
49   vtkGetObjectMacro(CurrentAnnotation, vtkAnnotation);
50 
51   // Description:
52   // The current selection associated with this annotation link.
53   // This is simply the selection contained in the current annotation.
54   virtual void SetCurrentSelection(vtkSelection* sel);
55   virtual vtkSelection* GetCurrentSelection();
56 
57   // Description:
58   // The number of annotations in a specific layer.
59   unsigned int GetNumberOfAnnotations();
60 
61   // Description:
62   // Retrieve an annotation from a layer.
63   vtkAnnotation* GetAnnotation(unsigned int idx);
64 
65   // Description:
66   // Add an annotation to a layer.
67   void AddAnnotation(vtkAnnotation* ann);
68 
69   // Description:
70   // Remove an annotation from a layer.
71   void RemoveAnnotation(vtkAnnotation* ann);
72 
73   // Description:
74   // Initialize the data structure to an empty state.
75   virtual void Initialize();
76 
77   // Description:
78   // Copy data from another data object into this one
79   // which references the same member annotations.
80   virtual void ShallowCopy(vtkDataObject* other);
81 
82   // Description:
83   // Copy data from another data object into this one,
84   // performing a deep copy of member annotations.
85   virtual void DeepCopy(vtkDataObject* other);
86 
87   // Description:
88   // Retrieve a vtkAnnotationLayers stored inside an information object.
89   static vtkAnnotationLayers* GetData(vtkInformation* info);
90   static vtkAnnotationLayers* GetData(vtkInformationVector* v, int i=0);
91 
92   // Description:
93   // The modified time for this object.
94   virtual unsigned long GetMTime();
95 
96 //BTX
97 protected:
98   vtkAnnotationLayers();
99   ~vtkAnnotationLayers();
100 
101   class Internals;
102   Internals* Implementation;
103   vtkAnnotation* CurrentAnnotation;
104 
105 private:
106   vtkAnnotationLayers(const vtkAnnotationLayers&);  // Not implemented.
107   void operator=(const vtkAnnotationLayers&);  // Not implemented.
108 //ETX
109 };
110 
111 #endif
112