/usr/include/vtk-7.1/vtkSplitField.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkSplitField.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.
=========================================================================*/
/**
* @class vtkSplitField
* @brief Split a field into single component fields
*
* vtkSplitField is used to split a multi-component field (vtkDataArray)
* into multiple single component fields. The new fields are put in
* the same field data as the original field. The output arrays
* are of the same type as the input array. Example:
* @verbatim
* sf->SetInputField("gradient", vtkSplitField::POINT_DATA);
* sf->Split(0, "firstcomponent");
* @endverbatim
* tells vtkSplitField to extract the first component of the field
* called gradient and create an array called firstcomponent (the
* new field will be in the output's point data).
* The same can be done from Tcl:
* @verbatim
* sf SetInputField gradient POINT_DATA
* sf Split 0 firstcomponent
*
* AttributeTypes: SCALARS, VECTORS, NORMALS, TCOORDS, TENSORS
* Field locations: DATA_OBJECT, POINT_DATA, CELL_DATA
* @endverbatim
* Note that, by default, the original array is also passed through.
*
* @warning
* When using Tcl, Java, Python or Visual Basic bindings, the array name
* can not be one of the AttributeTypes when calling Split() which takes
* strings as arguments. The Tcl (Java etc.) command will
* always assume the string corresponds to an attribute type when
* the argument is one of the AttributeTypes. In this situation,
* use the Split() which takes enums.
*
* @sa
* vtkFieldData vtkDataSet vtkDataObjectToDataSetFilter
* vtkDataSetAttributes vtkDataArray vtkRearrangeFields
* vtkAssignAttribute vtkMergeFields
*/
#ifndef vtkSplitField_h
#define vtkSplitField_h
#include "vtkFiltersGeneralModule.h" // For export macro
#include "vtkDataSetAlgorithm.h"
#include "vtkDataSetAttributes.h" // Needed for NUM_ATTRIBUTES
class vtkFieldData;
class VTKFILTERSGENERAL_EXPORT vtkSplitField : public vtkDataSetAlgorithm
{
public:
vtkTypeMacro(vtkSplitField,vtkDataSetAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Create a new vtkSplitField.
*/
static vtkSplitField *New();
/**
* Use the given attribute in the field data given
* by fieldLoc as input.
*/
void SetInputField(int attributeType, int fieldLoc);
/**
* Use the array with given name in the field data given
* by fieldLoc as input.
*/
void SetInputField(const char* name, int fieldLoc);
/**
* Helper method used by other language bindings. Allows the caller to
* specify arguments as strings instead of enums.
*/
void SetInputField(const char* name, const char* fieldLoc);
/**
* Create a new array with the given component.
*/
void Split(int component, const char* arrayName);
enum FieldLocations
{
DATA_OBJECT=0,
POINT_DATA=1,
CELL_DATA=2
};
struct Component
{
int Index;
char* FieldName;
Component* Next; // linked list
void SetName(const char* name)
{
delete[] this->FieldName;
this->FieldName = 0;
if (name)
{
size_t len = strlen(name)+1;
this->FieldName = new char[len];
strncpy(this->FieldName, name, len);
}
}
Component() { FieldName = 0; }
~Component() { delete[] FieldName; }
};
protected:
enum FieldTypes
{
NAME,
ATTRIBUTE
};
vtkSplitField();
~vtkSplitField() VTK_OVERRIDE;
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
char* FieldName;
int FieldType;
int AttributeType;
int FieldLocation;
static char FieldLocationNames[3][12];
static char AttributeNames[vtkDataSetAttributes::NUM_ATTRIBUTES][10];
vtkDataArray* SplitArray(vtkDataArray* da, int component);
// Components are stored as a linked list.
Component* Head;
Component* Tail;
// Methods to browse/modify the linked list.
Component* GetNextComponent(Component* op)
{ return op->Next; }
Component* GetFirst()
{ return this->Head; }
void AddComponent(Component* op);
Component* FindComponent(int index);
void DeleteAllComponents();
void PrintComponent(Component* op, ostream& os, vtkIndent indent);
void PrintAllComponents(ostream& os, vtkIndent indent);
private:
vtkSplitField(const vtkSplitField&) VTK_DELETE_FUNCTION;
void operator=(const vtkSplitField&) VTK_DELETE_FUNCTION;
};
#endif
|