VTK
vtkProteinRibbonFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkProteinRibbonFilter.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 #ifndef _vtkProteinRibbonFilter_h
17 #define _vtkProteinRibbonFilter_h
18 
29 #include "vtkDomainsChemistryModule.h" // for export macro
30 #include "vtkPolyDataAlgorithm.h"
31 
32 #include "vtkColor.h" // For vtkColor3ub.
33 #include <map> // For element to color map.
34 
35 class vtkVector3f;
36 class vtkStringArray;
37 
39  : public vtkPolyDataAlgorithm
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
45  static vtkProteinRibbonFilter* New();
46 
48 
49  vtkGetMacro(CoilWidth, float);
50  vtkSetMacro(CoilWidth, float);
52 
54 
55  vtkGetMacro(HelixWidth, float);
56  vtkSetMacro(HelixWidth, float);
58 
60 
61  vtkGetMacro(SubdivideFactor, int);
62  vtkSetMacro(SubdivideFactor, int);
64 
66 
68  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
69  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
71 
73 
74  vtkGetMacro(SphereResolution, int);
75  vtkSetMacro(SphereResolution, int);
77 
78 protected:
80  ~vtkProteinRibbonFilter();
81 
82  int FillInputPortInformation(int, vtkInformation*);
83 
84  int RequestData(vtkInformation *,
86  vtkInformationVector *);
87 
88  void CreateThinStrip(vtkPolyData* poly, vtkUnsignedCharArray *pointsColors,
89  vtkPoints* p, std::vector<std::pair<vtkVector3f, bool> >& p1,
90  std::vector<std::pair<vtkVector3f, bool> >& p2,
91  std::vector<vtkColor3ub> &colors);
92 
93  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray *pointsColors,
94  double *pos, const vtkColor3ub& color, float radius,
95  float scale);
96 
97  static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool> >& p,
98  int div);
99 
100  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
101 
102  void SetColorByStructure(std::vector<vtkColor3ub>& colors,
103  vtkStringArray* atomTypes, vtkUnsignedCharArray* ss,
104  const vtkColor3ub& helixColor,
105  const vtkColor3ub& sheetColor);
106 
107  std::map<std::string, vtkColor3ub> ElementColors;
108 
109  float CoilWidth;
110  float HelixWidth;
111  int SphereResolution;
112  int SubdivideFactor;
113  bool DrawSmallMoleculesAsSpheres;
114 
115 private:
116  vtkProteinRibbonFilter(const vtkProteinRibbonFilter&); // Not implemented.
117  void operator=(const vtkProteinRibbonFilter&); // Not implemented.
118 };
119 
120 #endif // _vtkProteinRibbonFilter_h
Store vtkAlgorithm input/output information.
a vtkAbstractArray subclass for strings
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
Superclass for algorithms that produce only polydata as output.
#define VTKDOMAINSCHEMISTRY_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
dynamic, self-adjusting array of unsigned char
generates protein ribbons
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:38