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 
27 #include "vtkDomainsChemistryModule.h" // for export macro
28 #include "vtkPolyDataAlgorithm.h"
29 
30 #include "vtkColor.h" // For vtkColor3ub.
31 #include <map> // For element to color map.
32 
33 class vtkVector3f;
34 class vtkStringArray;
35 
36 class VTKDOMAINSCHEMISTRY_EXPORT vtkProteinRibbonFilter
37  : public vtkPolyDataAlgorithm
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
43  static vtkProteinRibbonFilter* New();
44 
46 
49  vtkGetMacro(CoilWidth, float);
50  vtkSetMacro(CoilWidth, float);
52 
54 
57  vtkGetMacro(HelixWidth, float);
58  vtkSetMacro(HelixWidth, float);
60 
62 
65  vtkGetMacro(SubdivideFactor, int);
66  vtkSetMacro(SubdivideFactor, int);
68 
70 
73  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
74  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
76 
78 
81  vtkGetMacro(SphereResolution, int);
82  vtkSetMacro(SphereResolution, int);
84 
85 protected:
87  ~vtkProteinRibbonFilter() VTK_OVERRIDE;
88 
89  int FillInputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
90 
91  int RequestData(vtkInformation *,
93  vtkInformationVector *) VTK_OVERRIDE;
94 
95  void CreateThinStrip(vtkPolyData* poly, vtkUnsignedCharArray *pointsColors,
96  vtkPoints* p, std::vector<std::pair<vtkVector3f, bool> >& p1,
97  std::vector<std::pair<vtkVector3f, bool> >& p2,
98  std::vector<vtkColor3ub> &colors);
99 
100  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray *pointsColors,
101  double *pos, const vtkColor3ub& color, float radius,
102  float scale);
103 
104  static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool> >& p,
105  int div);
106 
107  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
108 
109  void SetColorByStructure(std::vector<vtkColor3ub>& colors,
110  vtkStringArray* atomTypes, vtkUnsignedCharArray* ss,
111  const vtkColor3ub& helixColor,
112  const vtkColor3ub& sheetColor);
113 
114  std::map<std::string, vtkColor3ub> ElementColors;
115 
116  float CoilWidth;
117  float HelixWidth;
118  int SphereResolution;
119  int SubdivideFactor;
120  bool DrawSmallMoleculesAsSpheres;
121 
122 private:
123  vtkProteinRibbonFilter(const vtkProteinRibbonFilter&) VTK_DELETE_FUNCTION;
124  void operator=(const vtkProteinRibbonFilter&) VTK_DELETE_FUNCTION;
125 };
126 
127 #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:79
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:194
a simple class to control print indentation
Definition: vtkIndent.h:33
dynamic, self-adjusting array of unsigned char
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
generates protein ribbons
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.