VTK
vtkMoleculeMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMoleculeMapper.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 =========================================================================*/
27 #ifndef vtkMoleculeMapper_h
28 #define vtkMoleculeMapper_h
29 
30 #include "vtkDomainsChemistryModule.h" // For export macro
31 #include "vtkMapper.h"
32 #include "vtkNew.h" // For vtkNew
33 
34 class vtkActor;
35 class vtkGlyph3DMapper;
36 class vtkIdTypeArray;
37 class vtkMolecule;
38 class vtkPeriodicTable;
39 class vtkPolyData;
40 class vtkPolyDataMapper;
41 class vtkRenderer;
42 class vtkSelection;
43 class vtkSphereSource;
44 class vtkTrivialProducer;
45 
46 class VTKDOMAINSCHEMISTRY_EXPORT vtkMoleculeMapper : public vtkMapper
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54 
60 
73 
86 
99 
115 
117 
120  vtkGetMacro(RenderAtoms, bool);
121  vtkSetMacro(RenderAtoms, bool);
122  vtkBooleanMacro(RenderAtoms, bool);
124 
126 
129  vtkGetMacro(RenderBonds, bool);
130  vtkSetMacro(RenderBonds, bool);
131  vtkBooleanMacro(RenderBonds, bool);
133 
135 
139  vtkGetMacro(RenderLattice, bool)
140  vtkSetMacro(RenderLattice, bool)
141  vtkBooleanMacro(RenderLattice, bool)
143 
144  enum {
145  CovalentRadius = 0,
148  CustomArrayRadius
149  };
150 
152 
157  vtkGetMacro(AtomicRadiusType, int);
158  vtkSetMacro(AtomicRadiusType, int);
161  {
162  this->SetAtomicRadiusType(CovalentRadius);
163  }
165  {
166  this->SetAtomicRadiusType(VDWRadius);
167  }
169  {
170  this->SetAtomicRadiusType(UnitRadius);
171  }
173  {
174  this->SetAtomicRadiusType(CustomArrayRadius);
175  }
177 
179 
184  vtkGetMacro(AtomicRadiusScaleFactor, float);
185  vtkSetMacro(AtomicRadiusScaleFactor, float);
187 
189 
193  vtkGetMacro(UseMultiCylindersForBonds, bool);
194  vtkSetMacro(UseMultiCylindersForBonds, bool);
195  vtkBooleanMacro(UseMultiCylindersForBonds, bool);
197 
198  enum {
199  SingleColor = 0,
200  DiscreteByAtom
201  };
202 
204 
214  vtkGetMacro(BondColorMode, int);
215  vtkSetMacro(BondColorMode, int);
216  const char * GetBondColorModeAsString();
218  {
219  this->SetBondColorMode(SingleColor);
220  }
222  {
223  this->SetBondColorMode(DiscreteByAtom);
224  }
226 
228 
232  vtkGetVector3Macro(BondColor, unsigned char);
233  vtkSetVector3Macro(BondColor, unsigned char);
235 
237 
240  vtkGetMacro(BondRadius, float);
241  vtkSetMacro(BondRadius, float);
243 
245 
249  vtkGetVector3Macro(LatticeColor, unsigned char)
250  vtkSetVector3Macro(LatticeColor, unsigned char)
252 
254 
258  virtual void GetSelectedAtomsAndBonds(vtkSelection *selection,
259  vtkIdTypeArray *atomIds,
260  vtkIdTypeArray *bondIds);
261  virtual void GetSelectedAtoms(vtkSelection *selection,
262  vtkIdTypeArray *atomIds)
263  {
264  this->GetSelectedAtomsAndBonds(selection, atomIds, NULL);
265  }
266  virtual void GetSelectedBonds(vtkSelection *selection,
267  vtkIdTypeArray *bondIds)
268  {
269  this->GetSelectedAtomsAndBonds(selection, NULL, bondIds);
270  }
272 
274 
277  virtual void Render(vtkRenderer *, vtkActor *);
279  double * GetBounds();
280  void GetBounds(double bounds[6]) { vtkAbstractMapper3D::GetBounds(bounds); }
282  virtual bool GetSupportsSelection() {return true;}
284 
285 protected:
288 
290 
297 
299 
305  float BondRadius;
306  unsigned char BondColor[3];
308 
310 
314  void GlyphRender(vtkRenderer *ren, vtkActor *act);
315 
317 
325  virtual void UpdateGlyphPolyData();
326  virtual void UpdateAtomGlyphPolyData();
327  virtual void UpdateBondGlyphPolyData();
329 
331 
337 
338  unsigned char LatticeColor[3];
341  virtual void UpdateLatticePolyData();
342 
347 
348 private:
349  vtkMoleculeMapper(const vtkMoleculeMapper&) VTK_DELETE_FUNCTION;
350  void operator=(const vtkMoleculeMapper&) VTK_DELETE_FUNCTION;
351 };
352 
353 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:43
vtkMoleculeMapper::SetAtomicRadiusTypeToCovalentRadius
void SetAtomicRadiusTypeToCovalentRadius()
Definition: vtkMoleculeMapper.h:160
vtkMoleculeMapper::RenderLattice
bool RenderLattice
Definition: vtkMoleculeMapper.h:309
vtkMoleculeMapper::Render
virtual void Render(vtkRenderer *, vtkActor *)
Reimplemented from base class.
vtkMoleculeMapper::SetBondColorModeToSingleColor
void SetBondColorModeToSingleColor()
Definition: vtkMoleculeMapper.h:217
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkMoleculeMapper::UpdateLatticePolyData
virtual void UpdateLatticePolyData()
vtkMoleculeMapper::GlyphRender
void GlyphRender(vtkRenderer *ren, vtkActor *act)
Internal render methods.
vtkMoleculeMapper::GetBounds
double * GetBounds()
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkMoleculeMapper::PeriodicTable
vtkNew< vtkPeriodicTable > PeriodicTable
Periodic table for lookups.
Definition: vtkMoleculeMapper.h:346
vtkMoleculeMapper::SetAtomicRadiusTypeToVDWRadius
void SetAtomicRadiusTypeToVDWRadius()
Definition: vtkMoleculeMapper.h:164
vtkMoleculeMapper::SetAtomicRadiusTypeToCustomArrayRadius
void SetAtomicRadiusTypeToCustomArrayRadius()
Definition: vtkMoleculeMapper.h:172
vtkMoleculeMapper::AtomicRadiusScaleFactor
float AtomicRadiusScaleFactor
Definition: vtkMoleculeMapper.h:295
vtkMoleculeMapper::GlyphDataInitialized
bool GlyphDataInitialized
Definition: vtkMoleculeMapper.h:324
vtkMoleculeMapper::vtkMoleculeMapper
vtkMoleculeMapper()
vtkMoleculeMapper::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkMoleculeMapper::VDWRadius
@ VDWRadius
Definition: vtkMoleculeMapper.h:146
vtkSelection
A node in a selection tree.
Definition: vtkSelection.h:44
vtkMoleculeMapper::BondGlyphPolyData
vtkNew< vtkPolyData > BondGlyphPolyData
Definition: vtkMoleculeMapper.h:322
vtkMoleculeMapper::UpdateBondGlyphPolyData
virtual void UpdateBondGlyphPolyData()
vtkMoleculeMapper::GetSupportsSelection
virtual bool GetSupportsSelection()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
Definition: vtkMoleculeMapper.h:282
vtkMoleculeMapper::LatticePolyData
vtkNew< vtkPolyData > LatticePolyData
Definition: vtkMoleculeMapper.h:339
vtkMoleculeMapper::GetInput
vtkMolecule * GetInput()
vtkTrivialProducer
Producer for stand-alone data objects.
Definition: vtkTrivialProducer.h:38
vtkMoleculeMapper::GetBounds
void GetBounds(double bounds[6])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkMoleculeMapper.h:280
vtkMoleculeMapper::UpdateGlyphPolyData
virtual void UpdateGlyphPolyData()
vtkMoleculeMapper::RenderAtoms
bool RenderAtoms
Customize atom rendering.
Definition: vtkMoleculeMapper.h:293
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkMoleculeMapper::UpdateAtomGlyphPolyData
virtual void UpdateAtomGlyphPolyData()
vtkMoleculeMapper::UseMultiCylindersForBonds
bool UseMultiCylindersForBonds
Definition: vtkMoleculeMapper.h:304
vtkMoleculeMapper::GetSelectedBonds
virtual void GetSelectedBonds(vtkSelection *selection, vtkIdTypeArray *bondIds)
Definition: vtkMoleculeMapper.h:266
vtkMapper.h
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkMoleculeMapper::AtomGlyphPolyData
vtkNew< vtkPolyData > AtomGlyphPolyData
Cached variables and update methods.
Definition: vtkMoleculeMapper.h:320
vtkMoleculeMapper::LatticeMapper
vtkNew< vtkPolyDataMapper > LatticeMapper
Definition: vtkMoleculeMapper.h:340
vtkMoleculeMapper::UseLiquoriceStickSettings
void UseLiquoriceStickSettings()
Set ivars to default liquorice stick settings.
vtkMoleculeMapper::AtomGlyphPointOutput
vtkNew< vtkTrivialProducer > AtomGlyphPointOutput
Definition: vtkMoleculeMapper.h:321
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:47
vtkMapper
abstract class specifies interface to map data to graphics primitives
Definition: vtkMapper.h:92
vtkMoleculeMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
vtkGlyph3DMapper
vtkGlyph3D on the GPU.
Definition: vtkGlyph3DMapper.h:40
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMoleculeMapper::AtomicRadiusType
int AtomicRadiusType
Definition: vtkMoleculeMapper.h:294
vtkMoleculeMapper::SetAtomicRadiusTypeToUnitRadius
void SetAtomicRadiusTypeToUnitRadius()
Definition: vtkMoleculeMapper.h:168
vtkMoleculeMapper::BondRadius
float BondRadius
Definition: vtkMoleculeMapper.h:305
vtkNew< vtkPolyData >
vtkMoleculeMapper::UnitRadius
@ UnitRadius
Definition: vtkMoleculeMapper.h:147
vtkMolecule
class describing a molecule
Definition: vtkMolecule.h:91
vtkPeriodicTable
Access to information about the elements.
Definition: vtkPeriodicTable.h:42
vtkMoleculeMapper
Mapper that draws vtkMolecule objects.
Definition: vtkMoleculeMapper.h:47
vtkMoleculeMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkMoleculeMapper::AtomGlyphMapper
vtkNew< vtkGlyph3DMapper > AtomGlyphMapper
Internal mappers.
Definition: vtkMoleculeMapper.h:334
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkNew.h
vtkMoleculeMapper::GetBondColorModeAsString
const char * GetBondColorModeAsString()
vtkMoleculeMapper::UseFastSettings
void UseFastSettings()
Set ivars to use fast settings that may be useful for rendering extremely large molecules where the o...
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkMoleculeMapper::SetBondColorModeToDiscreteByAtom
void SetBondColorModeToDiscreteByAtom()
Definition: vtkMoleculeMapper.h:221
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkMoleculeMapper::BondGlyphPointOutput
vtkNew< vtkTrivialProducer > BondGlyphPointOutput
Definition: vtkMoleculeMapper.h:323
vtkMoleculeMapper::New
static vtkMoleculeMapper * New()
vtkMoleculeMapper::GetAtomicRadiusTypeAsString
const char * GetAtomicRadiusTypeAsString()
vtkMoleculeMapper::BondColorMode
int BondColorMode
Definition: vtkMoleculeMapper.h:303
vtkMoleculeMapper::UseBallAndStickSettings
void UseBallAndStickSettings()
Set ivars to default ball-and-stick settings.
vtkMoleculeMapper::RenderBonds
bool RenderBonds
Customize bond rendering.
Definition: vtkMoleculeMapper.h:302
vtkMoleculeMapper::BondGlyphMapper
vtkNew< vtkGlyph3DMapper > BondGlyphMapper
Definition: vtkMoleculeMapper.h:335
vtkMoleculeMapper::SetInputData
void SetInputData(vtkMolecule *in)
Get/Set the input vtkMolecule.
vtkMoleculeMapper::UseVDWSpheresSettings
void UseVDWSpheresSettings()
Set ivars to default van der Waals spheres settings.
vtkMoleculeMapper::~vtkMoleculeMapper
~vtkMoleculeMapper()