/usr/include/vtk-6.3/vtkBlueObeliskDataParser.h is in libvtk6-dev 6.3.0+dfsg1-5.
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 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkBlueObeliskDataParser.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.
=========================================================================*/
// .NAME vtkBlueObeliskDataParser - Fill a vtkBlueObeliskData
// container with data from the BODR XML dataset.
//
// .SECTION Description
// The Blue Obelisk Data Repository is a free, open repository of
// chemical information. This class extracts the BODR information into
// vtk arrays, which are stored in a vtkBlueObeliskData object.
//
// \warning The vtkBlueObeliskDataParser class should never need to be
// used directly. For convenient access to the BODR data, use
// vtkPeriodicTable. For access to the raw arrays produced by this
// parser, see the vtkBlueObeliskData class. A static
// vtkBlueObeliskData object is accessible via
// vtkPeriodicTable::GetBlueObeliskData().
//
// .SECTION See Also
// vtkPeriodicTable vtkBlueObeliskData
#ifndef vtkBlueObeliskDataParser_h
#define vtkBlueObeliskDataParser_h
#include "vtkDomainsChemistryModule.h" // For export macro
#include "vtkXMLParser.h"
#include "vtkSmartPointer.h" // For vtkSmartPointer
class vtkAbstractArray;
class vtkBlueObeliskData;
class vtkFloatArray;
class vtkStdString;
class vtkStringArray;
class vtkUnsignedShortArray;
class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskDataParser : public vtkXMLParser
{
public:
vtkTypeMacro(vtkBlueObeliskDataParser, vtkXMLParser);
static vtkBlueObeliskDataParser * New();
// Description:
// Set the target vtkBlueObeliskData object that this parser will
// populate
virtual void SetTarget(vtkBlueObeliskData *bodr);
// Description:
// Start parsing
virtual int Parse();
// Description:
// These are only implemented to prevent compiler warnings about hidden
// virtual overloads. This function simply call Parse(); the arguments are
// ignored.
virtual int Parse(const char *);
virtual int Parse(const char *, unsigned int);
protected:
vtkBlueObeliskDataParser();
~vtkBlueObeliskDataParser();
void StartElement(const char *name, const char **attr);
void EndElement(const char *name);
void CharacterDataHandler(const char *data, int length);
void SetCurrentValue(const char *data, int length);
void SetCurrentValue(const char *data);
vtkBlueObeliskData *Target;
bool IsProcessingAtom;
void NewAtomStarted(const char **attr);
void NewAtomFinished();
bool IsProcessingValue;
void NewValueStarted(const char **attr);
void NewValueFinished();
std::string CharacterDataValueBuffer;
enum AtomValueType {
None = 0,
AtomicNumber,
Symbol,
Name,
PeriodicTableBlock,
ElectronicConfiguration,
Family,
Mass,
ExactMass,
IonizationEnergy,
ElectronAffinity,
PaulingElectronegativity,
CovalentRadius,
VDWRadius,
DefaultColor,
BoilingPoint,
MeltingPoint,
Period,
Group
} CurrentValueType;
int CurrentAtomicNumber;
vtkStdString *CurrentSymbol;
vtkStdString *CurrentName;
vtkStdString *CurrentPeriodicTableBlock;
vtkStdString *CurrentElectronicConfiguration;
vtkStdString *CurrentFamily;
float CurrentMass;
float CurrentExactMass;
float CurrentIonizationEnergy;
float CurrentElectronAffinity;
float CurrentPaulingElectronegativity;
float CurrentCovalentRadius;
float CurrentVDWRadius;
float CurrentDefaultColor[3];
float CurrentBoilingPoint;
float CurrentMeltingPoint;
unsigned int CurrentPeriod;
unsigned int CurrentGroup;
private:
// Not implemented
vtkBlueObeliskDataParser(const vtkBlueObeliskDataParser&);
void operator=(const vtkBlueObeliskDataParser&);
// Description:
// Resize array if needed and set the entry at ind to val.
static void ResizeArrayIfNeeded(vtkAbstractArray *arr, vtkIdType ind);
static void ResizeAndSetValue(vtkStdString *val,
vtkStringArray *arr,
vtkIdType ind);
static void ResizeAndSetValue(float val,
vtkFloatArray *arr,
vtkIdType ind);
static void ResizeAndSetValue(unsigned short val,
vtkUnsignedShortArray *arr,
vtkIdType ind);
// Description:
// Parse types from const char *
static int parseInt(const char *);
static float parseFloat(const char *);
static void parseFloat3(const char * str, float[3]);
static unsigned short parseUnsignedShort(const char *);
// Description:
// Convert a string to lower case. This will modify the input string
// and return the input pointer.
static vtkStdString * ToLower(vtkStdString *);
};
#endif
|