forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkMergeTables.h
113 lines (96 loc) · 3.48 KB
/
vtkMergeTables.h
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
/*=========================================================================
Program: Visualization Toolkit
Module: vtkMergeTables.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
/**
* @class vtkMergeTables
* @brief combine two tables
*
*
* Combines the columns of two tables into one larger table.
* The number of rows in the resulting table is the sum of the number of
* rows in each of the input tables.
* The number of columns in the output is generally the sum of the number
* of columns in each input table, except in the case where column names
* are duplicated in both tables.
* In this case, if MergeColumnsByName is on (the default), the two columns
* will be merged into a single column of the same name.
* If MergeColumnsByName is off, both columns will exist in the output.
* You may set the FirstTablePrefix and SecondTablePrefix to define how
* the columns named are modified. One of these prefixes may be the empty
* string, but they must be different.
*/
#ifndef vtkMergeTables_h
#define vtkMergeTables_h
#include "vtkInfovisCoreModule.h" // For export macro
#include "vtkTableAlgorithm.h"
class VTKINFOVISCORE_EXPORT vtkMergeTables : public vtkTableAlgorithm
{
public:
static vtkMergeTables* New();
vtkTypeMacro(vtkMergeTables,vtkTableAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
//@{
/**
* The prefix to give to same-named fields from the first table.
* Default is "Table1.".
*/
vtkSetStringMacro(FirstTablePrefix);
vtkGetStringMacro(FirstTablePrefix);
//@}
//@{
/**
* The prefix to give to same-named fields from the second table.
* Default is "Table2.".
*/
vtkSetStringMacro(SecondTablePrefix);
vtkGetStringMacro(SecondTablePrefix);
//@}
//@{
/**
* If on, merges columns with the same name.
* If off, keeps both columns, but calls one
* FirstTablePrefix + name, and the other SecondTablePrefix + name.
* Default is on.
*/
vtkSetMacro(MergeColumnsByName, bool);
vtkGetMacro(MergeColumnsByName, bool);
vtkBooleanMacro(MergeColumnsByName, bool);
//@}
//@{
/**
* If on, all columns will have prefixes except merged columns.
* If off, only unmerged columns with the same name will have prefixes.
* Default is off.
*/
vtkSetMacro(PrefixAllButMerged, bool);
vtkGetMacro(PrefixAllButMerged, bool);
vtkBooleanMacro(PrefixAllButMerged, bool);
//@}
protected:
vtkMergeTables();
~vtkMergeTables() VTK_OVERRIDE;
bool MergeColumnsByName;
bool PrefixAllButMerged;
char* FirstTablePrefix;
char* SecondTablePrefix;
int RequestData(
vtkInformation*,
vtkInformationVector**,
vtkInformationVector*) VTK_OVERRIDE;
private:
vtkMergeTables(const vtkMergeTables&) VTK_DELETE_FUNCTION;
void operator=(const vtkMergeTables&) VTK_DELETE_FUNCTION;
};
#endif