1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkPeriodicTable.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 =========================================================================*/
15 /**
16  * @class   vtkPeriodicTable
17  * @brief   Access to information about the elements.
18  *
19  *
20  * Sourced from the Blue Obelisk Data Repository
21  *
22  * @sa
23  * vtkBlueObeliskData vtkBlueObeliskDataParser
24 */
25 
26 #ifndef vtkPeriodicTable_h
27 #define vtkPeriodicTable_h
28 
29 #include "vtkDomainsChemistryModule.h" // For export macro
30 #include "vtkObject.h"
31 #include "vtkNew.h" // Needed for the static data member
32 
33 class vtkBlueObeliskData;
34 class vtkColor3f;
35 class vtkLookupTable;
36 class vtkStdString;
37 
38 class VTKDOMAINSCHEMISTRY_EXPORT vtkPeriodicTable : public vtkObject
39 {
40 public:
41   vtkTypeMacro(vtkPeriodicTable, vtkObject);
42   void PrintSelf(ostream& os, vtkIndent indent) override;
43   static vtkPeriodicTable * New();
44 
45   //@{
46   /**
47    * Access the static vtkBlueObeliskData object for raw access to
48    * BODR data.
49    */
50   vtkGetNewMacro(BlueObeliskData, vtkBlueObeliskData);
51   //@}
52 
53   /**
54    * Returns the number of elements in the periodic table.
55    */
56   unsigned short GetNumberOfElements();
57 
58   /**
59    * Given an atomic number, returns the symbol associated with the
60    * element
61    */
62   const char * GetSymbol(unsigned short atomicNum);
63 
64   /**
65    * Given an atomic number, returns the name of the element
66    */
67   const char * GetElementName(unsigned short atomicNum);
68 
69   //@{
70   /**
71    * Given a case-insensitive string that contains the symbol or name
72    * of an element, return the corresponding atomic number.
73    */
74   unsigned short GetAtomicNumber(const vtkStdString &str);
75   unsigned short GetAtomicNumber(const char *str);
76   //@}
77 
78   /**
79    * Given an atomic number, return the covalent radius of the atom
80    */
81   float GetCovalentRadius(unsigned short atomicNum);
82 
83   /**
84    * Given an atomic number, returns the van der Waals radius of the
85    * atom
86    */
87   float GetVDWRadius(unsigned short atomicNum);
88 
89   /**
90    * Given an atomic number, returns the van der Waals radius of the
91    * atom
92    */
93   float GetMaxVDWRadius();
94 
95   /**
96    * Fill the given vtkLookupTable to map atomic numbers to the
97    * familiar RGB tuples provided by the Blue Obelisk Data Repository
98    */
99   void GetDefaultLUT(vtkLookupTable *);
100 
101   /**
102    * Given an atomic number, return the familiar RGB tuple provided by
103    * the Blue Obelisk Data Repository
104    */
105   void GetDefaultRGBTuple(unsigned short atomicNum, float rgb[3]);
106 
107   /**
108    * Given an atomic number, return the familiar RGB tuple provided by
109    * the Blue Obelisk Data Repository
110    */
111   vtkColor3f GetDefaultRGBTuple(unsigned short atomicNum);
112 
113 protected:
114   vtkPeriodicTable();
115   ~vtkPeriodicTable() override;
116 
117   static vtkNew<vtkBlueObeliskData> BlueObeliskData;
118 
119 private:
120   vtkPeriodicTable(const vtkPeriodicTable&) = delete;
121   void operator=(const vtkPeriodicTable&) = delete;
122 };
123 
124 #endif
125