VTK  9.1.0
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_1_0
40
41#include "vtkDomainsChemistryModule.h" // For export macro
42#include "vtkLegacy.h" // For VTK_LEGACY_REMOVE
43#include "vtkNew.h" // For vtkNew
44#include "vtkObject.h"
45
46#include <mutex> // for std::mutex
47
49class vtkFloatArray;
50class vtkStringArray;
51#if !defined(VTK_LEGACY_REMOVE)
53#endif
55
56// Hidden STL reference: std::vector<vtkAbstractArray*>
57class MyStdVectorOfVtkAbstractArrays;
58
59class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskData : public vtkObject
60{
61public:
63 void PrintSelf(ostream& os, vtkIndent indent) override;
65
71 void Initialize();
72
76 bool IsInitialized() { return this->Initialized; }
77
79
83#if !defined(VTK_LEGACY_REMOVE)
84 VTK_DEPRECATED_IN_9_1_0("Use LockWriteMutex() and UnlockWriteMutex() instead.")
85 vtkGetObjectMacro(WriteMutex, vtkSimpleMutexLock);
86#endif
88
90
96
98
104
106
110 vtkGetMacro(NumberOfElements, unsigned short);
112
114
125
136
139
144 static bool GenerateHeaderFromXML(std::istream& xml, std::ostream& header);
145
146protected:
148
151
152#if !defined(VTK_LEGACY_REMOVE)
154#else
155private:
156 std::mutex NewWriteMutex;
157
158protected:
159#endif
160
162
167 virtual vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext = 1000);
168
172 virtual void Reset();
173
177 virtual void Squeeze();
178
179 unsigned short NumberOfElements;
180
181 // Lists all arrays
182 MyStdVectorOfVtkAbstractArrays* Arrays;
183
184 // Atomic Symbols
187
188 // Element Names
191
192 // Misc Strings
195 vtkNew<vtkStringArray> Families; // Non-Metal, Noblegas, Metalloids, etc
196
197 // Misc Data
205 vtkNew<vtkFloatArray> DefaultColors; // rgb 3-tuples, [0.0,1.0]
208 vtkNew<vtkUnsignedShortArray> Periods; // Row of periodic table
209 vtkNew<vtkUnsignedShortArray> Groups; // Column of periodic table
210
211 void PrintSelfIfExists(const char*, vtkObject*, ostream&, vtkIndent);
212
213private:
214 vtkBlueObeliskData(const vtkBlueObeliskData&) = delete;
215 void operator=(const vtkBlueObeliskData&) = delete;
216};
217
218#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
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
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
#define VTK_DEPRECATED_IN_9_1_0(reason)
int vtkIdType
Definition: vtkType.h:332