VTK  9.3.20240425
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
37#include "vtkDomainsChemistryModule.h" // for export macro
39
40#include "vtkColor.h" // For vtkColor3ub.
41#include <map> // For element to color map.
42
43VTK_ABI_NAMESPACE_BEGIN
44class vtkVector3f;
45class vtkStringArray;
46
47class VTKDOMAINSCHEMISTRY_EXPORT vtkProteinRibbonFilter : public vtkPolyDataAlgorithm
48{
49public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54
56
59 vtkGetMacro(CoilWidth, float);
60 vtkSetMacro(CoilWidth, float);
62
64
67 vtkGetMacro(HelixWidth, float);
68 vtkSetMacro(HelixWidth, float);
70
72
75 vtkGetMacro(SubdivideFactor, int);
76 vtkSetMacro(SubdivideFactor, int);
78
80
83 vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
84 vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
86
88
91 vtkGetMacro(SphereResolution, int);
92 vtkSetMacro(SphereResolution, int);
94
95protected:
98
100
102
104 std::vector<std::pair<vtkVector3f, bool>>& p1, std::vector<std::pair<vtkVector3f, bool>>& p2,
105 std::vector<vtkColor3ub>& colors);
106
107 void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, double* pos,
108 const vtkColor3ub& color, float radius, float scale);
109
110 static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool>>& p, int div);
111
112 void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
113
114 void SetColorByStructure(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes,
115 vtkUnsignedCharArray* ss, const vtkColor3ub& helixColor, const vtkColor3ub& sheetColor);
116
117 std::map<std::string, vtkColor3ub> ElementColors;
118
124
125private:
127 void operator=(const vtkProteinRibbonFilter&) = delete;
128};
129
130VTK_ABI_NAMESPACE_END
131#endif // vtkProteinRibbonFilter_h
Some derived classes for the different colors commonly used.
Definition vtkColor.h:203
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:139
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
generates protein ribbons
~vtkProteinRibbonFilter() override
void SetColorByStructure(std::vector< vtkColor3ub > &colors, vtkStringArray *atomTypes, vtkUnsignedCharArray *ss, const vtkColor3ub &helixColor, const vtkColor3ub &sheetColor)
void SetColorByAtom(std::vector< vtkColor3ub > &colors, vtkStringArray *atomTypes)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static std::vector< vtkVector3f > * Subdivide(std::vector< std::pair< vtkVector3f, bool > > &p, int div)
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)
std::map< std::string, vtkColor3ub > ElementColors
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkProteinRibbonFilter * New()
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