VTK  9.2.6
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 : public vtkPolyDataAlgorithm
40 {
41 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  static vtkProteinRibbonFilter* New();
46 
48 
51  vtkGetMacro(CoilWidth, float);
52  vtkSetMacro(CoilWidth, float);
54 
56 
59  vtkGetMacro(HelixWidth, float);
60  vtkSetMacro(HelixWidth, float);
62 
64 
67  vtkGetMacro(SubdivideFactor, int);
68  vtkSetMacro(SubdivideFactor, int);
70 
72 
75  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
76  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
78 
80 
83  vtkGetMacro(SphereResolution, int);
84  vtkSetMacro(SphereResolution, int);
86 
87 protected:
89  ~vtkProteinRibbonFilter() override;
90 
91  int FillInputPortInformation(int, vtkInformation*) override;
92 
94 
95  void CreateThinStrip(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, vtkPoints* p,
96  std::vector<std::pair<vtkVector3f, bool>>& p1, std::vector<std::pair<vtkVector3f, bool>>& p2,
97  std::vector<vtkColor3ub>& colors);
98 
99  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, double* pos,
100  const vtkColor3ub& color, float radius, float scale);
101 
102  static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool>>& p, int div);
103 
104  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
105 
106  void SetColorByStructure(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes,
107  vtkUnsignedCharArray* ss, const vtkColor3ub& helixColor, const vtkColor3ub& sheetColor);
108 
109  std::map<std::string, vtkColor3ub> ElementColors;
110 
111  float CoilWidth;
112  float HelixWidth;
116 
117 private:
119  void operator=(const vtkProteinRibbonFilter&) = delete;
120 };
121 
122 #endif // vtkProteinRibbonFilter_h
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
a vtkAbstractArray subclass for strings
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
std::map< std::string, vtkColor3ub > ElementColors
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:39
dynamic, self-adjusting array of unsigned char
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
generates protein ribbons
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.