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:
81 
82  int FillInputPortInformation(int, vtkInformation*);
83 
84  int RequestData(vtkInformation *,
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkX3D::vector
@ vector
Definition: vtkX3D.h:237
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkgl::scale
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkPolyDataAlgorithm.h
vtkDomainsChemistryModule.h
VTKDOMAINSCHEMISTRY_EXPORT
#define VTKDOMAINSCHEMISTRY_EXPORT
Definition: vtkDomainsChemistryModule.h:15
vtkVector3f
Definition: vtkVector.h:314
vtkColor.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkgl::color
GLuint color
Definition: vtkgl.h:12351
vtkProteinRibbonFilter
generates protein ribbons
Definition: vtkProteinRibbonFilter.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkColor3ub
Definition: vtkColor.h:163
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:45
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkgl::void
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
vtkX3D::radius
@ radius
Definition: vtkX3D.h:252
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44