/usr/include/paraview/vtkSMArrayListDomain.h is in paraview-dev 4.0.1-1ubuntu1.
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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | /*=========================================================================
Program: ParaView
Module: vtkSMArrayListDomain.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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.
=========================================================================*/
// .NAME vtkSMArrayListDomain - list of arrays obtained from input
// .SECTION Description
// vtkSMArrayListDomain represents a domain consisting of array names
// obtained from an input. vtkSMArrayListDomain requires
// a property of class vtkSMProxyProperty which points to a
// vtkSMSourceProxy and contains a vtkSMInputArrayDomain. Only
// the first proxy and domain are used.
// Valid XML attributes are:
// @verbatim
// * attribute_type - one of:
// - scalars
// - vectors
// - normals
// - tcoords
// - tensors
// * data_type - one or more of:
// - VTK_BIT, VTK_CHAR, VTK_INT, VTK_FLOAT, VTK_DOUBLE,... etc etc or the equivalent integers
// from vtkType.h
// - VTK_VOID, and 0 are equivalent to not specifying, meaning any data type
// is allowed
// * none_string - when specified, this string appears as the first entry in
// the list and can be used to show "None", or "Not available" etc.
// * key_location / key_name / key_strategy:
// those tree attributes are related to InformationKey of the array.
// key_location/key_name are the location and name of the given InformationKey
// key_strategy specifies if this specific key is needed to be in the domain
// or if this key is rejected. One of need_key or reject_key.
// if nothing is specified, the default is to add a vtkAbstractArray::GUI_HIDE
// key, with the reject_key strategy, so that arrays that have this InformationKey
// are not visible in the user interface.
// @endverbatim
// Additionally, vtkSMArrayListDomain support 'default_values' attribute which
// specifies a string (only 1 string value is supported). When
// SetDefaultValues() is called, if the array name specified as 'default_values'
// is present in the domain, then that will be used, otherwise, it simply uses
// the first available array (which is default).
//
// Additionally, vtkSMArrayListDomain takes an option required property with
// function "FieldDataSelection" which can be a vtkSMIntVectorProperty with a
// single value. If preset, this property's value is used to determine what type
// of field-data i.e. point-data, cell-data etc. is currently available.
// .SECTION See Also
// vtkSMDomain vtkSMProxyProperty vtkSMInputArrayDomain
#ifndef __vtkSMArrayListDomain_h
#define __vtkSMArrayListDomain_h
#include "vtkPVServerManagerCoreModule.h" //needed for exports
#include "vtkSMStringListDomain.h"
#include "vtkStdString.h" // needed for vtkStdString.
class vtkPVDataSetAttributesInformation;
class vtkSMInputArrayDomain;
class vtkSMProxyProperty;
class vtkSMSourceProxy;
class vtkPVArrayInformation;
//BTX
struct vtkSMArrayListDomainInternals;
//ETX
class VTKPVSERVERMANAGERCORE_EXPORT vtkSMArrayListDomain : public vtkSMStringListDomain
{
public:
static vtkSMArrayListDomain* New();
vtkTypeMacro(vtkSMArrayListDomain, vtkSMStringListDomain);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Updates the string list based on the available arrays. Requires
// a property of class vtkSMProxyProperty which points to a
// vtkSMSourceProxy and contains a vtkSMInputArrayDomain. Only
// the first proxy and domain are used.
virtual void Update(vtkSMProperty* prop);
// Description:
// The DefaultElement is set during Update() using the "active
// attribute" of the assigned AttributeType. For example,
// if the AttributeType is set to SCALARS, DefaultElement is
// set to the index of the array that is the active scalars
// in the dataset.
vtkGetMacro(DefaultElement, unsigned int);
// Description:
// Returns true if the array with the given idx is partial
// false otherwise. See vtkPVArrayInformation for more information.
int IsArrayPartial(unsigned int idx);
// Description:
// Get field association for the array.
int GetFieldAssociation(unsigned int idx);
// Description:
// Get desired association of the current domain
int GetDomainAssociation(unsigned int idx);
// Description:
// Return the attribute type. The values are listed in
// vtkDataSetAttributes.h.
vtkGetMacro(AttributeType, int);
// Description:
// A vtkSMProperty is often defined with a default value in the
// XML itself. However, many times, the default value must be determined
// at run time. To facilitate this, domains can override this method
// to compute and set the default value for the property.
// Note that unlike the compile-time default values, the
// application must explicitly call this method to initialize the
// property.
// Returns 1 if the domain updated the property.
virtual int SetDefaultValues(vtkSMProperty*);
// Description:
// Adds a new string to the domain.
unsigned int AddString(const char* string);
// Description:
// Removes a string from the domain.
virtual int RemoveString(const char* string);
// Description:
// Removes all strings from the domain.
virtual void RemoveAllStrings();
//BTX
// This enum represents the possible strategies associated
// with a given InformationKey :
// NEED_KEY means that if the array will be in the domain only if
// it does contains the given information key in its information.
// REJECT_KEY means that if the array will be in the domain only if
// it does NOT contains the given information key in its information.
enum InformationKeyStrategy
{
NEED_KEY,
REJECT_KEY
};
//ETX
// Description:
// Adds a new InformationKey to the domain.
// The default strategy is NEED_KEY if none is specified.
// If no InformationKey is specified in the xml, the default
// behavior is to create a rejected key vtkAbstractArray::GUI_HIDE
virtual unsigned int AddInformationKey(const char* location, const char *name, int strategy);
virtual unsigned int AddInformationKey(const char* location, const char *name)
{
return this->AddInformationKey(location, name, vtkSMArrayListDomain::NEED_KEY);
}
// Description:
// Removes an InformationKey from this domain.
unsigned int RemoveInformationKey(const char* location, const char *name);
// Description:
// Returns the number of InformationKeys in this domain.
unsigned int GetNumberOfInformationKeys();
//Description:
// Removes all InformationKeys from this domain.
void RemoveAllInformationKeys();
// Description:
// Returns the location/name/strategy of a given InformationKey
const char* GetInformationKeyLocation(unsigned int);
const char* GetInformationKeyName(unsigned int);
int GetInformationKeyStrategy(unsigned int);
// Description:
// return 1 if the InformationKeys of this vtkPVArrayInformation
// fullfill the requirements of the InformationKey in this Domain.
// returns 0 on failure.
int CheckInformationKeys(vtkPVArrayInformation* arrayInfo);
// Description:
// returns the mangled name for the component index that is passed in.
//
static vtkStdString CreateMangledName(vtkPVArrayInformation *arrayInfo, int component);
// Description:
// returns the mangled name for the component index that is passed in.
//
static vtkStdString ArrayNameFromMangledName(const char* name);
static int ComponentIndexFromMangledName(vtkPVArrayInformation *info, const char* name);
protected:
vtkSMArrayListDomain();
~vtkSMArrayListDomain();
// Description:
// Set the appropriate ivars from the xml element. Should
// be overwritten by subclass if adding ivars.
virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element);
// Description:
// Utility functions called by Update()
void AddArrays(vtkSMSourceProxy* sp,
int outputport,
vtkPVDataSetAttributesInformation* info,
vtkSMInputArrayDomain* iad,
int association, int domainAssociation=-1);
// Description:
// Adds a new array to the domain. This internally calls add string. If the \c
// iad tells us that the number of components required==1 and the array has
// more than 1 component and
// vtkSMInputArrayDomain::GetAutomaticPropertyConversion() is true, then the
// array is spilt into individual component and added (with name mangled using
// the component names).
// Returns the index for the array. If the array was split into components,
// then returns the index of the string for the array magnitude.
unsigned int AddArray(vtkPVArrayInformation* arrayinfo, int association, int domainAssociation,
vtkSMInputArrayDomain* iad);
void Update(vtkSMSourceProxy* sp, vtkSMInputArrayDomain* iad, int outputport);
void Update(vtkSMProxyProperty* pp, vtkSMSourceProxy* sp, int outputport);
void Update(vtkSMProxyProperty* pp);
// Description:
// Set to an attribute type defined in vtkDataSetAttributes.
vtkSetMacro(AttributeType, int);
vtkSetMacro(DefaultElement, unsigned int);
int AttributeType;
int Attribute;
int Association;
unsigned int DefaultElement;
// Description:
// InputDomainName refers to a input property domain that describes
// the type of array is needed by this property.
vtkGetStringMacro(InputDomainName);
vtkSetStringMacro(InputDomainName);
vtkSetStringMacro(NoneString);
vtkGetStringMacro(NoneString);
char* InputDomainName;
char* NoneString;
private:
vtkSMArrayListDomain(const vtkSMArrayListDomain&); // Not implemented
void operator=(const vtkSMArrayListDomain&); // Not implemented
vtkSMArrayListDomainInternals* ALDInternals;
};
#endif
|