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 
18 #include "vtkDomainsChemistryModule.h" // for export macro
19 #include "vtkPolyDataAlgorithm.h"
20 
21 #include "vtkColor.h" // For vtkColor3ub.
22 #include <map> // For element to color map.
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkVector3f;
26 class vtkStringArray;
27 
28 class VTKDOMAINSCHEMISTRY_EXPORT vtkProteinRibbonFilter : public vtkPolyDataAlgorithm
29 {
30 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
37 
40  vtkGetMacro(CoilWidth, float);
41  vtkSetMacro(CoilWidth, float);
43 
45 
48  vtkGetMacro(HelixWidth, float);
49  vtkSetMacro(HelixWidth, float);
51 
53 
56  vtkGetMacro(SubdivideFactor, int);
57  vtkSetMacro(SubdivideFactor, int);
59 
61 
64  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
65  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
67 
69 
72  vtkGetMacro(SphereResolution, int);
73  vtkSetMacro(SphereResolution, int);
75 
76 protected:
79 
81 
83 
85  std::vector<std::pair<vtkVector3f, bool>>& p1, std::vector<std::pair<vtkVector3f, bool>>& p2,
86  std::vector<vtkColor3ub>& colors);
87 
88  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, double* pos,
89  const vtkColor3ub& color, float radius, float scale);
90 
91  static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool>>& p, int div);
92 
93  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
94 
95  void SetColorByStructure(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes,
96  vtkUnsignedCharArray* ss, const vtkColor3ub& helixColor, const vtkColor3ub& sheetColor);
97 
98  std::map<std::string, vtkColor3ub> ElementColors;
99 
100  float CoilWidth;
101  float HelixWidth;
105 
106 private:
108  void operator=(const vtkProteinRibbonFilter&) = delete;
109 };
110 
111 VTK_ABI_NAMESPACE_END
112 #endif // vtkProteinRibbonFilter_h
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:184
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:29
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
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