VTK  9.3.0
vtkProteinRibbonFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef vtkProteinRibbonFilter_h
5 #define vtkProteinRibbonFilter_h
6 
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 VTK_ABI_NAMESPACE_BEGIN
34 class vtkVector3f;
35 class vtkStringArray;
36 
37 class VTKDOMAINSCHEMISTRY_EXPORT vtkProteinRibbonFilter : public vtkPolyDataAlgorithm
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
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:
88 
90 
92 
94  std::vector<std::pair<vtkVector3f, bool>>& p1, std::vector<std::pair<vtkVector3f, bool>>& p2,
95  std::vector<vtkColor3ub>& colors);
96 
97  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, double* pos,
98  const vtkColor3ub& color, float radius, float scale);
99 
100  static std::vector<vtkVector3f>* Subdivide(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 VTK_ABI_NAMESPACE_END
121 #endif // vtkProteinRibbonFilter_h
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:193
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:38
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
generates protein ribbons
~vtkProteinRibbonFilter() override
static vtkProteinRibbonFilter * New()
void SetColorByStructure(std::vector< vtkColor3ub > &colors, vtkStringArray *atomTypes, vtkUnsignedCharArray *ss, const vtkColor3ub &helixColor, const vtkColor3ub &sheetColor)
void SetColorByAtom(std::vector< vtkColor3ub > &colors, vtkStringArray *atomTypes)
static std::vector< vtkVector3f > * Subdivide(std::vector< std::pair< vtkVector3f, bool >> &p, int div)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::map< std::string, vtkColor3ub > ElementColors
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void CreateThinStrip(vtkPolyData *poly, vtkUnsignedCharArray *pointsColors, vtkPoints *p, std::vector< std::pair< vtkVector3f, bool >> &p1, std::vector< std::pair< vtkVector3f, bool >> &p2, std::vector< vtkColor3ub > &colors)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void CreateAtomAsSphere(vtkPolyData *poly, vtkUnsignedCharArray *pointsColors, double *pos, const vtkColor3ub &color, float radius, float scale)
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of unsigned char
@ vector
Definition: vtkX3D.h:237
@ scale
Definition: vtkX3D.h:229
@ color
Definition: vtkX3D.h:221
@ radius
Definition: vtkX3D.h:252