File: vtkAnnotationLink.h

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 205,992 kB
  • sloc: cpp: 2,336,570; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 185; javascript: 165; objc: 153; tcl: 59
file content (136 lines) | stat: -rw-r--r-- 3,960 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
 * @class   vtkAnnotationLink
 * @brief   An algorithm for linking annotations among objects
 *
 * vtkAnnotationLink is a simple source filter which outputs the
 * vtkAnnotationLayers object stored internally.  Multiple objects may share
 * the same annotation link filter and connect it to an internal pipeline so
 * that if one object changes the annotation set, it will be pulled into all
 * the other objects when their pipelines update.
 *
 * The shared vtkAnnotationLayers object (a collection of annotations) is
 * shallow copied to output port 0.
 *
 * vtkAnnotationLink can also store a set of domain maps. A domain map is
 * simply a table associating values between domains. The domain of each
 * column is defined by the array name of the column. The domain maps are
 * sent to a multi-block dataset in output port 1.
 *
 * Output ports 0 and 1 can be set as input ports 0 and 1 to
 * vtkConvertSelectionDomain, which can use the domain maps to convert the
 * domains of selections in the vtkAnnotationLayers to match a particular
 * data object (set as port 2 on vtkConvertSelectionDomain).
 *
 * The shared vtkAnnotationLayers object also stores a "current selection"
 * normally interpreted as the interactive selection of an application.
 * As a convenience, this selection is sent to output port 2 so that it
 * can be connected to pipelines requiring a vtkSelection.
 */

#ifndef vtkAnnotationLink_h
#define vtkAnnotationLink_h

#include "vtkAnnotationLayersAlgorithm.h"
#include "vtkFiltersGeneralModule.h" // For export macro

VTK_ABI_NAMESPACE_BEGIN
class vtkCommand;
class vtkDataObjectCollection;
class vtkInformation;
class vtkInformationVector;
class vtkSelection;
class vtkTable;

class VTKFILTERSGENERAL_EXPORT vtkAnnotationLink : public vtkAnnotationLayersAlgorithm
{
public:
  static vtkAnnotationLink* New();
  vtkTypeMacro(vtkAnnotationLink, vtkAnnotationLayersAlgorithm);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  ///@{
  /**
   * The annotations to be shared.
   */
  vtkGetObjectMacro(AnnotationLayers, vtkAnnotationLayers);
  virtual void SetAnnotationLayers(vtkAnnotationLayers* layers);
  ///@}

  ///@{
  /**
   * Set or get the current selection in the annotation layers.
   */
  virtual void SetCurrentSelection(vtkSelection* sel);
  virtual vtkSelection* GetCurrentSelection();
  ///@}

  ///@{
  /**
   * The domain mappings.
   */
  void AddDomainMap(vtkTable* map);
  void RemoveDomainMap(vtkTable* map);
  void RemoveAllDomainMaps();
  int GetNumberOfDomainMaps();
  vtkTable* GetDomainMap(int i);
  ///@}

  /**
   * Get the mtime of this object.
   */
  vtkMTimeType GetMTime() override;

protected:
  vtkAnnotationLink();
  ~vtkAnnotationLink() override;

  /**
   * Called to process modified events from its vtkAnnotationLayers.
   */
  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);

  /**
   * Set up input ports.
   */
  int FillInputPortInformation(int, vtkInformation*) override;

  /**
   * Set up output ports.
   */
  int FillOutputPortInformation(int, vtkInformation*) override;

  /**
   * Copy the data to the output objects.
   */
  void ShallowCopyToOutput(
    vtkAnnotationLayers* input, vtkAnnotationLayers* output, vtkSelection* sel);

  /**
   * Shallow copy the internal selection to the output.
   */
  int RequestData(vtkInformation* info, vtkInformationVector** inVector,
    vtkInformationVector* outVector) override;

  /**
   * The shared selection.
   */
  vtkAnnotationLayers* AnnotationLayers;

  /**
   * The mappings between domains.
   */
  vtkDataObjectCollection* DomainMaps;

private:
  vtkAnnotationLink(const vtkAnnotationLink&) = delete;
  void operator=(const vtkAnnotationLink&) = delete;

  class Command;
  friend class Command;
  Command* Observer;
};

VTK_ABI_NAMESPACE_END
#endif