VTK  9.0.1
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 : public vtkPolyDataAlgorithm
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  static vtkProteinRibbonFilter* New();
43 
45 
48  vtkGetMacro(CoilWidth, float);
49  vtkSetMacro(CoilWidth, float);
51 
53 
56  vtkGetMacro(HelixWidth, float);
57  vtkSetMacro(HelixWidth, float);
59 
61 
64  vtkGetMacro(SubdivideFactor, int);
65  vtkSetMacro(SubdivideFactor, int);
67 
69 
72  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
73  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
75 
77 
80  vtkGetMacro(SphereResolution, int);
81  vtkSetMacro(SphereResolution, int);
83 
84 protected:
86  ~vtkProteinRibbonFilter() override;
87 
88  int FillInputPortInformation(int, vtkInformation*) override;
89 
91 
92  void CreateThinStrip(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, vtkPoints* p,
93  std::vector<std::pair<vtkVector3f, bool> >& p1, std::vector<std::pair<vtkVector3f, bool> >& p2,
94  std::vector<vtkColor3ub>& colors);
95 
96  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, double* pos,
97  const vtkColor3ub& color, float radius, float scale);
98 
99  static std::vector<vtkVector3f>* Subdivide(
100  std::vector<std::pair<vtkVector3f, bool> >& p, int div);
101 
102  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
103 
104  void SetColorByStructure(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes,
105  vtkUnsignedCharArray* ss, const vtkColor3ub& helixColor, const vtkColor3ub& sheetColor);
106 
107  std::map<std::string, vtkColor3ub> ElementColors;
108 
109  float CoilWidth;
110  float HelixWidth;
114 
115 private:
117  void operator=(const vtkProteinRibbonFilter&) = delete;
118 };
119 
120 #endif // vtkProteinRibbonFilter_h
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkProteinRibbonFilter::SphereResolution
int SphereResolution
Definition: vtkProteinRibbonFilter.h:111
vtkX3D::vector
@ vector
Definition: vtkX3D.h:243
vtkProteinRibbonFilter::HelixWidth
float HelixWidth
Definition: vtkProteinRibbonFilter.h:110
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataAlgorithm.h
vtkX3D::color
@ color
Definition: vtkX3D.h:227
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkVector3f
Definition: vtkVector.h:475
vtkColor.h
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkProteinRibbonFilter
generates protein ribbons
Definition: vtkProteinRibbonFilter.h:36
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkColor3ub
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:194
vtkProteinRibbonFilter::DrawSmallMoleculesAsSpheres
bool DrawSmallMoleculesAsSpheres
Definition: vtkProteinRibbonFilter.h:113
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
vtkX3D::radius
@ radius
Definition: vtkX3D.h:258
vtkProteinRibbonFilter::SubdivideFactor
int SubdivideFactor
Definition: vtkProteinRibbonFilter.h:112
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkProteinRibbonFilter::CoilWidth
float CoilWidth
Definition: vtkProteinRibbonFilter.h:109
vtkProteinRibbonFilter::ElementColors
std::map< std::string, vtkColor3ub > ElementColors
Definition: vtkProteinRibbonFilter.h:107
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41