VTK
vtkMolecule.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMolecule.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 =========================================================================*/
71 #ifndef vtkMolecule_h
72 #define vtkMolecule_h
73 
74 #include "vtkCommonDataModelModule.h" // For export macro
75 #include "vtkUndirectedGraph.h"
76 
77 //BTX
78 #include "vtkAtom.h" // Simple proxy class dependent on vtkMolecule
79 #include "vtkBond.h" // Simple proxy class dependent on vtkMolecule
80 //ETX
81 #include "vtkVector.h" // Small templated vector convenience class
82 
83 class vtkPlane;
85 class vtkPoints;
87 
89 {
90 public:
91  static vtkMolecule *New();
93  void PrintSelf(ostream &os, vtkIndent indent);
94  virtual void Initialize();
95 
97  virtual int GetDataObjectType() {return VTK_MOLECULE;}
98 
99 //BTX
101 
104  {
105  return this->AppendAtom(0, vtkVector3f(0, 0, 0));
106  }
108 
111  vtkAtom AppendAtom(unsigned short atomicNumber, const vtkVector3f &pos);
112 
114 
116  vtkAtom AppendAtom(unsigned short atomicNumber, double x, double y, double z)
117  {
118  return this->AppendAtom(atomicNumber, vtkVector3f(x, y, z));
119  }
121 
124 
127 
129 
133  unsigned short order = 1);
134  vtkBond AppendBond(const vtkAtom &atom1, const vtkAtom &atom2,
135  unsigned short order = 1)
136  {
137  return this->AppendBond(atom1.Id, atom2.Id, order);
138  }
140 
142 
144 //ETX
146 
149 
151  unsigned short GetAtomAtomicNumber(vtkIdType atomId);
152 
154 
156  unsigned short atomicNum);
158 
160 
161  void SetAtomPosition(vtkIdType atomId, const vtkVector3f &pos);
162  void SetAtomPosition(vtkIdType atomId, double x, double y, double z);
164 
166 
168  void GetAtomPosition(vtkIdType atomId, float pos[3]);
170 
172 
173  void SetBondOrder(vtkIdType bondId, unsigned short order);
174  unsigned short GetBondOrder(vtkIdType bondId);
176 
182  double GetBondLength(vtkIdType bondId);
183 
185 
189 
190 //BTX
192 
196 //ETX
198 
200  virtual void ShallowCopy(vtkDataObject *obj);
201 
203  virtual void DeepCopy(vtkDataObject *obj);
204 
207 
210 
214 
218 
220 
233  static bool GetPlaneFromBond(const vtkBond &bond, const vtkVector3f &normal,
234  vtkPlane *plane);
235  static bool GetPlaneFromBond(const vtkAtom &atom1, const vtkAtom &atom2,
236  const vtkVector3f &normal, vtkPlane *plane);
238 
239  protected:
242 
244  virtual void CopyStructureInternal(vtkMolecule *m, bool deep);
245 
247  virtual void CopyAttributesInternal(vtkMolecule *m, bool deep);
248 
250 
255  void SetBondListDirty() {this->BondListIsDirty = true;}
258 
259  friend class vtkAtom;
260  friend class vtkBond;
261 
263 
264 private:
265  vtkMolecule(const vtkMolecule&); // Not implemented.
266  void operator=(const vtkMolecule&); // Not implemented.
267 };
268 
269 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkMolecule::GetAtomicPositionArray
vtkPoints * GetAtomicPositionArray()
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
VTK_MOLECULE
#define VTK_MOLECULE
Definition: vtkType.h:99
vtkPlane
perform various plane computations
Definition: vtkPlane.h:37
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkMolecule::AppendAtom
vtkAtom AppendAtom(unsigned short atomicNumber, double x, double y, double z)
Definition: vtkMolecule.h:116
vtkMolecule::ShallowCopy
virtual void ShallowCopy(vtkDataObject *obj)
vtkUndirectedGraph
An undirected graph.
Definition: vtkUndirectedGraph.h:54
vtkgl::m
const GLfloat * m
Definition: vtkgl.h:18169
vtkMolecule::Initialize
virtual void Initialize()
vtkMolecule::AppendAtom
vtkAtom AppendAtom(unsigned short atomicNumber, const vtkVector3f &pos)
vtkgl::obj
GLsizei GLsizei GLuint * obj
Definition: vtkgl.h:11994
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkUnsignedShortArray
dynamic, self-adjusting array of unsigned short
Definition: vtkUnsignedShortArray.h:50
vtkCommonDataModelModule.h
vtkUndirectedGraph.h
vtkMolecule::GetAtomAtomicNumber
unsigned short GetAtomAtomicNumber(vtkIdType atomId)
vtkMolecule::GetAtomPosition
void GetAtomPosition(vtkIdType atomId, float pos[3])
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkVector.h
vtkMolecule::GetNumberOfBonds
vtkIdType GetNumberOfBonds()
vtkMolecule::DeepCopy
virtual void DeepCopy(vtkDataObject *obj)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkBond
convenience proxy for vtkMolecule
Definition: vtkBond.h:33
vtkMolecule::BondListIsDirty
bool BondListIsDirty
Definition: vtkMolecule.h:254
vtkMolecule::GetDataObjectType
virtual int GetDataObjectType()
Definition: vtkMolecule.h:97
vtkAtom
convenience proxy for vtkMolecule
Definition: vtkAtom.h:34
vtkMolecule::ShallowCopyStructure
virtual void ShallowCopyStructure(vtkMolecule *m)
vtkMolecule::AppendBond
vtkBond AppendBond(const vtkAtom &atom1, const vtkAtom &atom2, unsigned short order=1)
Definition: vtkMolecule.h:134
vtkMolecule::SetElectronicData
virtual void SetElectronicData(vtkAbstractElectronicData *)
vtkMolecule::DeepCopyAttributes
virtual void DeepCopyAttributes(vtkMolecule *m)
vtkMolecule::UpdateBondList
void UpdateBondList()
vtkMolecule::ShallowCopyAttributes
virtual void ShallowCopyAttributes(vtkMolecule *m)
vtkAbstractElectronicData
Provides access to and storage of chemical electronic data.
Definition: vtkAbstractElectronicData.h:33
vtkVector3f
Definition: vtkVector.h:314
vtkMolecule::CopyStructureInternal
virtual void CopyStructureInternal(vtkMolecule *m, bool deep)
vtkMolecule::~vtkMolecule
~vtkMolecule()
vtkMolecule::GetPlaneFromBond
static bool GetPlaneFromBond(const vtkBond &bond, const vtkVector3f &normal, vtkPlane *plane)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMolecule::CopyAttributesInternal
virtual void CopyAttributesInternal(vtkMolecule *m, bool deep)
vtkMolecule::SetAtomAtomicNumber
void SetAtomAtomicNumber(vtkIdType atomId, unsigned short atomicNum)
vtkMolecule::SetAtomPosition
void SetAtomPosition(vtkIdType atomId, double x, double y, double z)
vtkMolecule::GetPlaneFromBond
static bool GetPlaneFromBond(const vtkAtom &atom1, const vtkAtom &atom2, const vtkVector3f &normal, vtkPlane *plane)
vtkMolecule
class describing a molecule
Definition: vtkMolecule.h:89
vtkBond.h
vtkgl::order
GLuint GLdouble GLdouble GLint GLint order
Definition: vtkgl.h:18750
vtkMolecule::GetBondOrder
unsigned short GetBondOrder(vtkIdType bondId)
vtkMolecule::DeepCopyStructure
virtual void DeepCopyStructure(vtkMolecule *m)
vtkMolecule::GetBond
vtkBond GetBond(vtkIdType bondId)
vtkMolecule::GetAtomicNumberArray
vtkUnsignedShortArray * GetAtomicNumberArray()
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkMolecule::vtkMolecule
vtkMolecule()
vtkMolecule::GetAtomPosition
vtkVector3f GetAtomPosition(vtkIdType atomId)
vtkMolecule::SetBondListDirty
void SetBondListDirty()
Definition: vtkMolecule.h:255
vtkMolecule::SetBondOrder
void SetBondOrder(vtkIdType bondId, unsigned short order)
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkMolecule::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkMolecule::AppendAtom
vtkAtom AppendAtom()
Definition: vtkMolecule.h:103
vtkMolecule::SetAtomPosition
void SetAtomPosition(vtkIdType atomId, const vtkVector3f &pos)
vtkAtom::Id
vtkIdType Id
Definition: vtkAtom.h:66
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkMolecule::ElectronicData
vtkAbstractElectronicData * ElectronicData
Definition: vtkMolecule.h:262
vtkBond::vtkMolecule
friend class vtkMolecule
Definition: vtkBond.h:67
vtkMolecule::GetAtom
vtkAtom GetAtom(vtkIdType atomId)
vtkMolecule::GetBondLength
double GetBondLength(vtkIdType bondId)
vtkMolecule::New
static vtkMolecule * New()
vtkMolecule::GetNumberOfAtoms
vtkIdType GetNumberOfAtoms()
vtkAtom.h
vtkMolecule::AppendBond
vtkBond AppendBond(vtkIdType atom1, vtkIdType atom2, unsigned short order=1)