VTK  9.1.0
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 
46 #include "vtkDomainsChemistryModule.h" // for export macro
47 #include "vtkPolyDataAlgorithm.h"
48 
49 #include "vtkColor.h" // For vtkColor3ub.
50 #include <map> // For element to color map.
51 
52 class vtkVector3f;
53 class vtkStringArray;
54 
55 class VTKDOMAINSCHEMISTRY_EXPORT vtkProteinRibbonFilter : public vtkPolyDataAlgorithm
56 {
57 public:
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62 
64 
67  vtkGetMacro(CoilWidth, float);
68  vtkSetMacro(CoilWidth, float);
70 
72 
75  vtkGetMacro(HelixWidth, float);
76  vtkSetMacro(HelixWidth, float);
78 
80 
83  vtkGetMacro(SubdivideFactor, int);
84  vtkSetMacro(SubdivideFactor, int);
86 
88 
91  vtkGetMacro(DrawSmallMoleculesAsSpheres, bool);
92  vtkSetMacro(DrawSmallMoleculesAsSpheres, bool);
94 
96 
99  vtkGetMacro(SphereResolution, int);
100  vtkSetMacro(SphereResolution, int);
102 
103 protected:
106 
108 
110 
112  std::vector<std::pair<vtkVector3f, bool>>& p1, std::vector<std::pair<vtkVector3f, bool>>& p2,
113  std::vector<vtkColor3ub>& colors);
114 
115  void CreateAtomAsSphere(vtkPolyData* poly, vtkUnsignedCharArray* pointsColors, double* pos,
116  const vtkColor3ub& color, float radius, float scale);
117 
118  static std::vector<vtkVector3f>* Subdivide(std::vector<std::pair<vtkVector3f, bool>>& p, int div);
119 
120  void SetColorByAtom(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes);
121 
122  void SetColorByStructure(std::vector<vtkColor3ub>& colors, vtkStringArray* atomTypes,
123  vtkUnsignedCharArray* ss, const vtkColor3ub& helixColor, const vtkColor3ub& sheetColor);
124 
125  std::map<std::string, vtkColor3ub> ElementColors;
126 
127  float CoilWidth;
128  float HelixWidth;
132 
133 private:
135  void operator=(const vtkProteinRibbonFilter&) = delete;
136 };
137 
138 #endif // vtkProteinRibbonFilter_h
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkProteinRibbonFilter::SphereResolution
int SphereResolution
Definition: vtkProteinRibbonFilter.h:129
vtkX3D::vector
@ vector
Definition: vtkX3D.h:243
vtkProteinRibbonFilter::HelixWidth
float HelixWidth
Definition: vtkProteinRibbonFilter.h:128
vtkProteinRibbonFilter::SetColorByStructure
void SetColorByStructure(std::vector< vtkColor3ub > &colors, vtkStringArray *atomTypes, vtkUnsignedCharArray *ss, const vtkColor3ub &helixColor, const vtkColor3ub &sheetColor)
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkProteinRibbonFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:145
vtkProteinRibbonFilter::~vtkProteinRibbonFilter
~vtkProteinRibbonFilter() override
vtkPolyDataAlgorithm.h
vtkX3D::color
@ color
Definition: vtkX3D.h:227
vtkVector3f
Definition: vtkVector.h:534
vtkProteinRibbonFilter::vtkProteinRibbonFilter
vtkProteinRibbonFilter()
vtkColor.h
vtkProteinRibbonFilter::CreateAtomAsSphere
void CreateAtomAsSphere(vtkPolyData *poly, vtkUnsignedCharArray *pointsColors, double *pos, const vtkColor3ub &color, float radius, float scale)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkProteinRibbonFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkProteinRibbonFilter
generates protein ribbons
Definition: vtkProteinRibbonFilter.h:56
vtkProteinRibbonFilter::SetColorByAtom
void SetColorByAtom(std::vector< vtkColor3ub > &colors, vtkStringArray *atomTypes)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkProteinRibbonFilter::CreateThinStrip
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)
vtkProteinRibbonFilter::New
static vtkProteinRibbonFilter * New()
vtkColor3ub
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:304
vtkProteinRibbonFilter::DrawSmallMoleculesAsSpheres
bool DrawSmallMoleculesAsSpheres
Definition: vtkProteinRibbonFilter.h:131
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:146
vtkX3D::radius
@ radius
Definition: vtkX3D.h:258
vtkProteinRibbonFilter::SubdivideFactor
int SubdivideFactor
Definition: vtkProteinRibbonFilter.h:130
vtkProteinRibbonFilter::Subdivide
static std::vector< vtkVector3f > * Subdivide(std::vector< std::pair< vtkVector3f, bool >> &p, int div)
vtkProteinRibbonFilter::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkProteinRibbonFilter::CoilWidth
float CoilWidth
Definition: vtkProteinRibbonFilter.h:127
vtkProteinRibbonFilter::ElementColors
std::map< std::string, vtkColor3ub > ElementColors
Definition: vtkProteinRibbonFilter.h:125
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151