VTK  9.3.20240423
vtkBlueObeliskData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
27#ifndef vtkBlueObeliskData_h
28#define vtkBlueObeliskData_h
29
30#include "vtkDomainsChemistryModule.h" // For export macro
31#include "vtkNew.h" // For vtkNew
32#include "vtkObject.h"
33
34#include <mutex> // for std::mutex
35
36VTK_ABI_NAMESPACE_BEGIN
38class vtkFloatArray;
39class vtkStringArray;
41
42// Hidden STL reference: std::vector<vtkAbstractArray*>
43class MyStdVectorOfVtkAbstractArrays;
44
45class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskData : public vtkObject
46{
47public:
49 void PrintSelf(ostream& os, vtkIndent indent) override;
51
57 void Initialize();
58
62 bool IsInitialized() { return this->Initialized; }
63
65
71
73
79
81
85 vtkGetMacro(NumberOfElements, unsigned short);
87
89
96 vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray);
97 vtkGetNewMacro(ElectronicConfigurations, vtkStringArray);
100
103 vtkGetNewMacro(IonizationEnergies, vtkFloatArray);
104 vtkGetNewMacro(ElectronAffinities, vtkFloatArray);
105 vtkGetNewMacro(PaulingElectronegativities, vtkFloatArray);
111
114
119 static bool GenerateHeaderFromXML(std::istream& xml, std::ostream& header);
120
121protected:
123
126
128
133 virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext = 1000);
134
138 virtual void Reset();
139
143 virtual void Squeeze();
144
145 unsigned short NumberOfElements;
146
147 // Lists all arrays
148 MyStdVectorOfVtkAbstractArrays* Arrays;
149
150 // Atomic Symbols
153
154 // Element Names
157
158 // Misc Strings
161 vtkNew<vtkStringArray> Families; // Non-Metal, Noblegas, Metalloids, etc
162
163 // Misc Data
171 vtkNew<vtkFloatArray> DefaultColors; // rgb 3-tuples, [0.0,1.0]
174 vtkNew<vtkUnsignedShortArray> Periods; // Row of periodic table
175 vtkNew<vtkUnsignedShortArray> Groups; // Column of periodic table
176
177 void PrintSelfIfExists(const char*, vtkObject*, ostream&, vtkIndent);
178
179private:
180 vtkBlueObeliskData(const vtkBlueObeliskData&) = delete;
181 void operator=(const vtkBlueObeliskData&) = delete;
182
183 std::mutex NewWriteMutex;
184};
185
186VTK_ABI_NAMESPACE_END
187#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.
void UnlockWriteMutex()
Unlock the mutex that protects the arrays during a call to Initialize().
vtkGetNewMacro(Names, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkGetNewMacro(Masses, vtkFloatArray)
vtkGetNewMacro(VDWRadii, vtkFloatArray)
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)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkNew< vtkFloatArray > ExactMasses
vtkNew< vtkStringArray > PeriodicTableBlocks
vtkNew< vtkStringArray > Names
vtkGetNewMacro(DefaultColors, vtkFloatArray)
vtkNew< vtkStringArray > LowerNames
vtkGetNewMacro(ElectronicConfigurations, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
MyStdVectorOfVtkAbstractArrays * Arrays
vtkNew< vtkFloatArray > Masses
vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
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)
Access the raw arrays stored in this vtkBlueObeliskData.
vtkNew< vtkUnsignedShortArray > Groups
virtual void Squeeze()
Free any unused memory in the member arrays.
vtkGetNewMacro(LowerSymbols, vtkStringArray)
Access the raw arrays stored in this vtkBlueObeliskData.
static vtkBlueObeliskData * New()
void LockWriteMutex()
Lock the mutex that protects the arrays during a call to Initialize().
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
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:160
abstract base class for most VTK objects
Definition vtkObject.h:162
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of unsigned short
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315