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 
30 #include "vtkDomainsChemistryModule.h" // for export macro
31 #include "vtkPolyDataAlgorithm.h"
32 
33 #include "vtkColor.h" // For vtkColor3ub.
34 #include <map> // For element to color map.
35 
36 class vtkVector3f;
37 class vtkStringArray;
38 
39 class VTKDOMAINSCHEMISTRY_EXPORT vtkProteinRibbonFilter
40  : public vtkPolyDataAlgorithm
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
46  static vtkProteinRibbonFilter* New();
47 
49 
52  vtkGetMacro(CoilWidth, float);
53  vtkSetMacro(CoilWidth, float);
55 
57 
60  vtkGetMacro(HelixWidth, float);
61  vtkSetMacro(HelixWidth, float);
63 
65 
68  vtkGetMacro(SubdivideFactor, int);
69  vtkSetMacro(SubdivideFactor, int);
71 
73 
76  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
77  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
79 
81 
84  vtkGetMacro(SphereResolution, int);
85  vtkSetMacro(SphereResolution, int);
87 
88 protected:
91 
92  int FillInputPortInformation(int, vtkInformation*);
93 
94  int RequestData(vtkInformation *,
97 
98  void CreateThinStrip(vtkPolyData* poly, vtkUnsignedCharArray *pointsColors,
99  vtkPoints* p, std::vector<std::pair<vtkVector3f, bool> >& p1,
100  std::vector<std::pair<vtkVector3f, bool> >& p2,
101  std::vector<vtkColor3ub> &colors);
102 
103  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray *pointsColors,
104  double *pos, const vtkColor3ub& color, float radius,
105  float scale);
106 
107  static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool> >& p,
108  int div);
109 
110  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
111 
112  void SetColorByStructure(std::vector<vtkColor3ub>& colors,
113  vtkStringArray* atomTypes, vtkUnsignedCharArray* ss,
114  const vtkColor3ub& helixColor,
115  const vtkColor3ub& sheetColor);
116 
117  std::map<std::string, vtkColor3ub> ElementColors;
118 
119  float CoilWidth;
120  float HelixWidth;
121  int SphereResolution;
122  int SubdivideFactor;
123  bool DrawSmallMoleculesAsSpheres;
124 
125 private:
126  vtkProteinRibbonFilter(const vtkProteinRibbonFilter&) VTK_DELETE_FUNCTION;
127  void operator=(const vtkProteinRibbonFilter&) VTK_DELETE_FUNCTION;
128 };
129 
130 #endif // vtkProteinRibbonFilter_h
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkX3D::vector
@ vector
Definition: vtkX3D.h:237
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:42
vtkPolyDataAlgorithm.h
vtkX3D::color
@ color
Definition: vtkX3D.h:221
vtkVector3f
Definition: vtkVector.h:372
vtkColor.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkProteinRibbonFilter
generates protein ribbons
Definition: vtkProteinRibbonFilter.h:41
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkColor3ub
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:195
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:43
vtkX3D::radius
@ radius
Definition: vtkX3D.h:252
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:45