VTK  9.0.1
vtkBlueObeliskData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBlueObeliskData.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
36 #ifndef vtkBlueObeliskData_h
37 #define vtkBlueObeliskData_h
38 
39 #include "vtkDomainsChemistryModule.h" // For export macro
40 #include "vtkNew.h" // For vtkNew
41 #include "vtkObject.h"
42 
43 class vtkAbstractArray;
44 class vtkFloatArray;
45 class vtkStringArray;
46 class vtkSimpleMutexLock;
48 
49 // Hidden STL reference: std::vector<vtkAbstractArray*>
50 class MyStdVectorOfVtkAbstractArrays;
51 
52 class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskData : public vtkObject
53 {
54 public:
55  vtkTypeMacro(vtkBlueObeliskData, vtkObject);
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
65  void Initialize();
66 
70  bool IsInitialized() { return this->Initialized; }
71 
73 
77  vtkGetObjectMacro(WriteMutex, vtkSimpleMutexLock);
79 
81 
85  vtkGetMacro(NumberOfElements, unsigned short);
87 
89 
100 
111 
114 
119  static bool GenerateHeaderFromXML(std::istream& xml, std::ostream& header);
120 
121 protected:
123 
126 
129 
134  virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext = 1000);
135 
139  virtual void Reset();
140 
144  virtual void Squeeze();
145 
146  unsigned short NumberOfElements;
147 
148  // Lists all arrays
149  MyStdVectorOfVtkAbstractArrays* Arrays;
150 
151  // Atomic Symbols
154 
155  // Element Names
158 
159  // Misc Strings
162  vtkNew<vtkStringArray> Families; // Non-Metal, Noblegas, Metalloids, etc
163 
164  // Misc Data
172  vtkNew<vtkFloatArray> DefaultColors; // rgb 3-tuples, [0.0,1.0]
175  vtkNew<vtkUnsignedShortArray> Periods; // Row of periodic table
176  vtkNew<vtkUnsignedShortArray> Groups; // Column of periodic table
177 
178  void PrintSelfIfExists(const char*, vtkObject*, ostream&, vtkIndent);
179 
180 private:
181  vtkBlueObeliskData(const vtkBlueObeliskData&) = delete;
182  void operator=(const vtkBlueObeliskData&) = delete;
183 };
184 
185 #endif
Abstract superclass for all arrays.
Fill a vtkBlueObeliskData container with data from the BODR XML dataset.
Contains chemical data from the Blue Obelisk Data Repository.
vtkGetNewMacro(Names, vtkStringArray)
vtkGetNewMacro(Masses, vtkFloatArray)
vtkGetNewMacro(VDWRadii, vtkFloatArray)
static vtkBlueObeliskData * New()
unsigned short NumberOfElements
vtkNew< vtkFloatArray > CovalentRadii
vtkGetNewMacro(ElectronAffinities, vtkFloatArray)
vtkGetNewMacro(IonizationEnergies, vtkFloatArray)
virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext=1000)
Allocate enough memory in each array for sz elements.
vtkNew< vtkFloatArray > ElectronAffinities
vtkNew< vtkFloatArray > BoilingPoints
virtual void Reset()
Reset each array.
void Initialize()
Fill this object using an internal vtkBlueObeliskDataParser instance.
vtkNew< vtkFloatArray > PaulingElectronegativities
static bool GenerateHeaderFromXML(std::istream &xml, std::ostream &header)
Static method to generate the data header file used by this class from the BODR elements....
vtkNew< vtkFloatArray > VDWRadii
bool IsInitialized()
Check if this object has been initialized yet.
vtkGetNewMacro(Periods, vtkUnsignedShortArray)
vtkNew< vtkStringArray > LowerSymbols
vtkGetNewMacro(Groups, vtkUnsignedShortArray)
vtkGetNewMacro(BoilingPoints, vtkFloatArray)
vtkGetNewMacro(ExactMasses, vtkFloatArray)
vtkGetNewMacro(Symbols, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkGetNewMacro(CovalentRadii, vtkFloatArray)
vtkNew< vtkUnsignedShortArray > Periods
vtkGetNewMacro(Families, vtkStringArray)
vtkNew< vtkFloatArray > ExactMasses
vtkNew< vtkStringArray > PeriodicTableBlocks
vtkNew< vtkStringArray > Names
vtkGetNewMacro(DefaultColors, vtkFloatArray)
vtkNew< vtkStringArray > LowerNames
vtkGetNewMacro(ElectronicConfigurations, vtkStringArray)
MyStdVectorOfVtkAbstractArrays * Arrays
vtkNew< vtkFloatArray > Masses
vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray)
vtkNew< vtkStringArray > Symbols
vtkNew< vtkStringArray > ElectronicConfigurations
vtkGetNewMacro(MeltingPoints, vtkFloatArray)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkStringArray > Families
vtkGetNewMacro(LowerNames, vtkStringArray)
vtkSimpleMutexLock * WriteMutex
vtkNew< vtkUnsignedShortArray > Groups
virtual void Squeeze()
Free any unused memory in the member arrays.
vtkGetNewMacro(LowerSymbols, vtkStringArray)
vtkNew< vtkFloatArray > MeltingPoints
vtkGetNewMacro(PaulingElectronegativities, vtkFloatArray)
void PrintSelfIfExists(const char *, vtkObject *, ostream &, vtkIndent)
vtkNew< vtkFloatArray > DefaultColors
vtkNew< vtkFloatArray > IonizationEnergies
~vtkBlueObeliskData() override
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:54
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of unsigned short
static const float PaulingElectronegativities[119][1]
static const char * Families[119]
static const unsigned short Periods[119][1]
static const unsigned short Groups[119][1]
static const char * ElectronicConfigurations[119]
static const float CovalentRadii[119][1]
static const float VDWRadii[119][1]
static const char * LowerNames[119]
static const float ElectronAffinities[119][1]
static const char * Names[119]
static const float DefaultColors[119][3]
static const char * PeriodicTableBlocks[119]
static const char * LowerSymbols[119]
static const char * Symbols[119]
static const float MeltingPoints[119][1]
static const float BoilingPoints[119][1]
static const float Masses[119][1]
static const float IonizationEnergies[119][1]
static const float ExactMasses[119][1]
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:338