VTK  9.3.1
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 
34  static vtkProteinRibbonFilter* New();
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:
78  ~vtkProteinRibbonFilter() override;
79 
80  int FillInputPortInformation(int, vtkInformation*) override;
81 
83 
84  void CreateThinStrip(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, vtkPoints* p,
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
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:79
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:183
a simple class to control print indentation
Definition: vtkIndent.h:28
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:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.