VTK  9.3.1
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 
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkAbstractArray;
38 class vtkFloatArray;
39 class vtkStringArray;
41 
42 // Hidden STL reference: std::vector<vtkAbstractArray*>
43 class MyStdVectorOfVtkAbstractArrays;
44 
45 class VTKDOMAINSCHEMISTRY_EXPORT vtkBlueObeliskData : public vtkObject
46 {
47 public:
48  vtkTypeMacro(vtkBlueObeliskData, vtkObject);
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50  static vtkBlueObeliskData* New();
51 
57  void Initialize();
58 
62  bool IsInitialized() { return this->Initialized; }
63 
65 
69  void LockWriteMutex();
71 
73 
77  void UnlockWriteMutex();
79 
81 
85  vtkGetMacro(NumberOfElements, unsigned short);
87 
89 
92  vtkGetNewMacro(Symbols, vtkStringArray);
93  vtkGetNewMacro(LowerSymbols, vtkStringArray);
94  vtkGetNewMacro(Names, vtkStringArray);
95  vtkGetNewMacro(LowerNames, vtkStringArray);
96  vtkGetNewMacro(PeriodicTableBlocks, vtkStringArray);
98  vtkGetNewMacro(Families, vtkStringArray);
100 
101  vtkGetNewMacro(Masses, vtkFloatArray);
102  vtkGetNewMacro(ExactMasses, vtkFloatArray);
103  vtkGetNewMacro(IonizationEnergies, vtkFloatArray);
104  vtkGetNewMacro(ElectronAffinities, vtkFloatArray);
105  vtkGetNewMacro(PaulingElectronegativities, vtkFloatArray);
106  vtkGetNewMacro(CovalentRadii, vtkFloatArray);
107  vtkGetNewMacro(VDWRadii, vtkFloatArray);
108  vtkGetNewMacro(DefaultColors, vtkFloatArray);
109  vtkGetNewMacro(BoilingPoints, vtkFloatArray);
110  vtkGetNewMacro(MeltingPoints, vtkFloatArray);
111 
112  vtkGetNewMacro(Periods, vtkUnsignedShortArray);
113  vtkGetNewMacro(Groups, vtkUnsignedShortArray);
114 
119  static bool GenerateHeaderFromXML(std::istream& xml, std::ostream& header);
120 
121 protected:
123 
125  ~vtkBlueObeliskData() override;
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 
179 private:
180  vtkBlueObeliskData(const vtkBlueObeliskData&) = delete;
181  void operator=(const vtkBlueObeliskData&) = delete;
182 
183  std::mutex NewWriteMutex;
184 };
185 
186 VTK_ABI_NAMESPACE_END
187 #endif
bool IsInitialized()
Check if this object has been initialized yet.
vtkNew< vtkFloatArray > CovalentRadii
static const char * PeriodicTableBlocks[119]
abstract base class for most VTK objects
Definition: vtkObject.h:51
static const char * LowerSymbols[119]
vtkNew< vtkStringArray > Names
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkFloatArray > ElectronAffinities
static const float VDWRadii[119][1]
Abstract superclass for all arrays.
vtkNew< vtkStringArray > ElectronicConfigurations
vtkNew< vtkFloatArray > Masses
static const float ElectronAffinities[119][1]
static const float BoilingPoints[119][1]
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:30
vtkNew< vtkFloatArray > MeltingPoints
vtkNew< vtkUnsignedShortArray > Groups
a vtkAbstractArray subclass for strings
vtkNew< vtkStringArray > PeriodicTableBlocks
int vtkIdType
Definition: vtkType.h:315
vtkNew< vtkFloatArray > IonizationEnergies
static const float MeltingPoints[119][1]
static const float IonizationEnergies[119][1]
vtkNew< vtkStringArray > Symbols
static const char * Families[119]
int vtkTypeBool
Definition: vtkABI.h:64
vtkNew< vtkFloatArray > DefaultColors
static const char * Names[119]
vtkNew< vtkStringArray > Families
a simple class to control print indentation
Definition: vtkIndent.h:28
static const char * ElectronicConfigurations[119]
static const float DefaultColors[119][3]
static const unsigned short Groups[119][1]
static const char * Symbols[119]
static const char * LowerNames[119]
vtkNew< vtkFloatArray > VDWRadii
vtkNew< vtkFloatArray > BoilingPoints
unsigned short NumberOfElements
vtkNew< vtkStringArray > LowerNames
static const float ExactMasses[119][1]
vtkNew< vtkFloatArray > PaulingElectronegativities
static const float Masses[119][1]
vtkNew< vtkStringArray > LowerSymbols
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Fill a vtkBlueObeliskData container with data from the BODR XML dataset.
MyStdVectorOfVtkAbstractArrays * Arrays
vtkNew< vtkUnsignedShortArray > Periods
static const unsigned short Periods[119][1]
static const float PaulingElectronegativities[119][1]
static const float CovalentRadii[119][1]
vtkNew< vtkFloatArray > ExactMasses
dynamic, self-adjusting array of unsigned short
Contains chemical data from the Blue Obelisk Data Repository.