VTK  9.2.5
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=========================================================================*/
39#ifndef vtkBlueObeliskData_h
40#define vtkBlueObeliskData_h
41
42#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_1_0
43
44#include "vtkDomainsChemistryModule.h" // For export macro
45#include "vtkLegacy.h" // For VTK_LEGACY_REMOVE
46#include "vtkNew.h" // For vtkNew
47#include "vtkObject.h"
48
49#include <mutex> // for std::mutex
50
52class vtkFloatArray;
53class vtkStringArray;
54#if !defined(VTK_LEGACY_REMOVE)
56#endif
58
59// Hidden STL reference: std::vector<vtkAbstractArray*>
60class MyStdVectorOfVtkAbstractArrays;
61
62class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskData : public vtkObject
63{
64public:
66 void PrintSelf(ostream& os, vtkIndent indent) override;
68
74 void Initialize();
75
79 bool IsInitialized() { return this->Initialized; }
80
82
86#if !defined(VTK_LEGACY_REMOVE)
87 VTK_DEPRECATED_IN_9_1_0("Use LockWriteMutex() and UnlockWriteMutex() instead.")
88 vtkGetObjectMacro(WriteMutex, vtkSimpleMutexLock);
89#endif
91
93
99
101
107
109
113 vtkGetMacro(NumberOfElements, unsigned short);
115
117
124 vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray);
125 vtkGetNewMacro(ElectronicConfigurations, vtkStringArray);
128
131 vtkGetNewMacro(IonizationEnergies, vtkFloatArray);
132 vtkGetNewMacro(ElectronAffinities, vtkFloatArray);
133 vtkGetNewMacro(PaulingElectronegativities, vtkFloatArray);
139
142
147 static bool GenerateHeaderFromXML(std::istream& xml, std::ostream& header);
148
149protected:
151
154
155#if !defined(VTK_LEGACY_REMOVE)
157#else
158private:
159 std::mutex NewWriteMutex;
160
161protected:
162#endif
163
165
170 virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext = 1000);
171
175 virtual void Reset();
176
180 virtual void Squeeze();
181
182 unsigned short NumberOfElements;
183
184 // Lists all arrays
185 MyStdVectorOfVtkAbstractArrays* Arrays;
186
187 // Atomic Symbols
190
191 // Element Names
194
195 // Misc Strings
198 vtkNew<vtkStringArray> Families; // Non-Metal, Noblegas, Metalloids, etc
199
200 // Misc Data
208 vtkNew<vtkFloatArray> DefaultColors; // rgb 3-tuples, [0.0,1.0]
211 vtkNew<vtkUnsignedShortArray> Periods; // Row of periodic table
212 vtkNew<vtkUnsignedShortArray> Groups; // Column of periodic table
213
214 void PrintSelfIfExists(const char*, vtkObject*, ostream&, vtkIndent);
215
216private:
217 vtkBlueObeliskData(const vtkBlueObeliskData&) = delete;
218 void operator=(const vtkBlueObeliskData&) = delete;
219};
220
221#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.
vtkSimpleMutexLock * WriteMutex
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
Definition: vtkFloatArray.h:42
a simple class to control print indentation
Definition: vtkIndent.h:40
Allocate and hold a VTK object.
Definition: vtkNew.h:62
abstract base class for most VTK objects
Definition: vtkObject.h:63
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of unsigned short
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition: vtkType.h:332