STORMM Source Documentation
Loading...
Searching...
No Matches
render_options.h
1// -*-c++-*-
2#ifndef STORMM_RENDER_OPTIONS_H
3#define STORMM_RENDER_OPTIONS_H
4
5#include <string>
6#include <vector>
7#include "copyright.h"
8#ifndef STORMM_USE_HPC
9# include "DataTypes/stormm_vector_types.h"
10#endif
11#include "reporting_enumerators.h"
12
13namespace stormm {
14namespace review {
15
21constexpr double default_rec_bond_thickness = 1.5;
22constexpr double default_lig_bond_thickness = 2.5;
23constexpr double default_border_thickness = 1.5;
24constexpr double default_rec_light_atom_size = 12.0;
25constexpr double default_rec_heavy_atom_size = 20.0;
26constexpr double default_lig_light_atom_size = 16.0;
27constexpr double default_lig_heavy_atom_size = 24.0;
28constexpr double default_wat_light_atom_size = 8.0;
29constexpr double default_wat_heavy_atom_size = 16.0;
30constexpr double default_added_point_size = 8.0;
31constexpr LinePlotStyle default_border_style = LinePlotStyle::SOLID;
32constexpr uchar4 default_rec_bond_color = { 48, 48, 48, 255 };
33constexpr uchar4 default_lig_bond_color = { 128, 224, 224, 255 };
34constexpr uchar4 default_border_line_color = { 128, 128, 128, 255 };
35constexpr uchar4 default_added_point_color = { 168, 0, 39, 255 };
36constexpr char default_lighting_mode[] = "gouraud";
37constexpr char default_camlight_position[] = "right";
39
43constexpr int maximum_line_width = 16;
44constexpr int maximum_marker_size = 64;
46
47//-------------------------------------------------------------------------------------------------
49public:
50
54
61 RenderOptions(const RenderOptions &original) = default;
62 RenderOptions(RenderOptions &&original) = default;
63 RenderOptions& operator=(const RenderOptions &original) = default;
64 RenderOptions& operator=(RenderOptions &&original) = default;
66
68 double getReceptorLineWidth() const;
69
71 double getLigandLineWidth() const;
72
74 double getReceptorLightAtomSize() const;
75
77 double getReceptorHeavyAtomSize() const;
78
80 double getLigandLightAtomSize() const;
81
83 double getLigandHeavyAtomSize() const;
84
86 double getWaterLightAtomSize() const;
87
89 double getWaterHeavyAtomSize() const;
90
92 double getAddedPointSize() const;
93
95 const std::string& getReceptorHighlight() const;
96
98 const std::string& getLigandHighlight() const;
99
102
111 std::string getFormattedReceptorLineColor(GridFileSyntax syntax) const;
112
115
121 std::string getFormattedLigandLineColor(GridFileSyntax syntax) const;
122
125
131 std::string getFormattedAddedPointColor(GridFileSyntax syntax) const;
132
134 bool displayFieldBorders() const;
135
137 double getBorderLineWidth() const;
138
140 LinePlotStyle getBorderLineStyle() const;
141
143
146
153 std::string getFormattedBorderColor(GridFileSyntax syntax) const;
154
156 const std::string& getLightingMode() const;
157
159 const std::string& getCamlightPosition() const;
160
162 int getIsosurfaceCount() const;
163
169 double getIsosurfaceValue(int index) const;
170
174 uchar4 getIsosurfaceColor(int index) const;
175
179 SurfaceRender getIsosurfaceDrawingMethod(int index) const;
180
187 uchar4 getElementColor(int z_number) const;
188
196 std::string getFormattedElementColor(int z_number, GridFileSyntax syntax) const;
197
199 const RenderOptions* getSelfPointer() const;
200
204 void setReceptorLineWidth(double width_in);
205
209 void setLigandLineWidth(double width_in);
210
214 void setReceptorLightAtomSize(double marker_size_in);
215
219 void setReceptorHeavyAtomSize(double marker_size_in);
220
224 void setLigandLightAtomSize(double marker_size_in);
225
229 void setLigandHeavyAtomSize(double marker_size_in);
230
234 void setWaterLightAtomSize(double marker_size_in);
235
239 void setWaterHeavyAtomSize(double marker_size_in);
240
244 void setAddedPointSize(double marker_size_in);
245
249 void setPotentialFieldBorderDisplay(bool display_borders_in);
250
254 void setFieldBorderLineWidth(double width_in);
255
259 void setFieldBorderStyle(LinePlotStyle style_in);
260
264 void setFieldBorderColor(const uchar4 color_in);
265
269 void setReceptorHighlight(const std::string &highlight_in);
270
274 void setLigandHighlight(const std::string &highlight_in);
275
289 void setReceptorLineColor(const uchar4 color_in);
290 void setReceptorLineColor(double red_in, double green_in, double blue_in);
292
296 void setLigandLineColor(const uchar4 color_in);
297 void setLigandLineColor(double red_in, double green_in, double blue_in);
299
303 void setAddedPointColor(const uchar4 color_in);
304 void setAddedPointColor(double red_in, double green_in, double blue_in);
306
312 void setAtomicElementColor(int z_number, const uchar4 color_in);
313 void setAtomicElementColor(int z_number, double red_in, double green_in, double blue_in);
315
320 void setLightingMode(const std::string &mode_in);
321
326 void setCamlightPosition(const std::string &position_in);
327
338 void addIsosurface(double value_in, const uchar4 color_in, SurfaceRender material_in);
339 void addIsosurface(double value_in, const double4 color_in, SurfaceRender material_in);
341
342private:
343 double receptor_bond_thickness;
348 double ligand_bond_thickness;
351 double rec_light_atom_marker_size;
353 double rec_heavy_atom_marker_size;
355 double lig_light_atom_marker_size;
357 double lig_heavy_atom_marker_size;
359 double wat_light_atom_marker_size;
361 double wat_heavy_atom_marker_size;
362 double added_point_marker_size;
364
365 // The following member variables control definition of the borders for a potential field plotted
366 // against the scene.
367 bool display_field_borders;
369 double border_line_thickness;
370 LinePlotStyle border_line_style;
371 uchar4 border_line_color;
372
373 // The following member variables control highlighting, placing circles around additional atom
374 // series. Each string is translated into an atom mask to produce the relevant list of atoms.
375 std::string receptor_highlight;
376 std::string ligand_highlight;
377
378 // The following member variables control colors for atoms, bonds, and points.
379 uchar4 receptor_line_color;
383 uchar4 ligand_line_color;
384 uchar4 added_point_color;
385 std::vector<uchar4> element_colors;
389 std::string lighting_mode;
390 std::string camlight_position;
391
392 // The following member variables control isosurface depictions.
393 int isosurface_count;
394 std::vector<double> isosurface_values;
396 std::vector<uchar4> isosurface_colors;
400 std::vector<SurfaceRender> isosurface_materials;
401
405 void checkIsosurfaceIndex(int index) const;
406
411 void checkZNumber(int z_number, const char* caller) const;
412
417 void checkLineWidth(double width_in, const char* caller = nullptr) const;
418
423 void checkMarkerSize(double marker_size_in, const char* caller = nullptr) const;
424
431 void checkColorRanges(double red_in, double green_in, double blue_in,
432 const char* caller = nullptr) const;
433};
434
436std::vector<uchar4> getDefaultElementColors();
437
443std::string formatColor(const uchar4 color_in, GridFileSyntax syntax);
444
445} // namespace review
446} // namespace stormm
447
448#endif
RenderOptions()
The default constructor will create an object with reasonable properties. Various setters can then mo...
Definition render_options.cpp:18
uchar4 getReceptorLineColor() const
Get the line color to be used in depictions of the receptor.
Definition render_options.cpp:97
void setLigandLineColor(const uchar4 color_in)
Set the line color to be used in coloring the ligand's bonds. Overloading and descriptions of input p...
Definition render_options.cpp:282
uchar4 getIsosurfaceColor(int index) const
Get the color prescribed for depicting a requested isosurface.
Definition render_options.cpp:163
void setAddedPointSize(double marker_size_in)
Set the marker size to be used in adding arbitrary points to the scene.
Definition render_options.cpp:229
double getWaterLightAtomSize() const
Get the water hydrogen and virtual site size to display.
Definition render_options.cpp:72
bool displayFieldBorders() const
Get an indication of whether to display borders of the potential field in the scene.
Definition render_options.cpp:127
const std::string & getLigandHighlight() const
Get the atom mask string for highlighting selected atoms of the ligand.
Definition render_options.cpp:92
void setLigandLightAtomSize(double marker_size_in)
Set the marker size to be used in plotting light atoms of the ligand.
Definition render_options.cpp:217
void setWaterHeavyAtomSize(double marker_size_in)
Set the marker size to be used in plotting oxygen atoms of water.
void setFieldBorderStyle(LinePlotStyle style_in)
Set the style for displaying border lines on the potential field in the scene.
Definition render_options.cpp:245
const std::string & getReceptorHighlight() const
Get the atom mask string for highlighting selected atoms of the receptor.
Definition render_options.cpp:87
void setReceptorHighlight(const std::string &highlight_in)
Set the receptor atom selection mask string.
Definition render_options.cpp:255
void addIsosurface(double value_in, const uchar4 color_in, SurfaceRender material_in)
Add an isosurface to the list of requests.
Definition render_options.cpp:358
double getReceptorHeavyAtomSize() const
Get the marker size to be used in depictions of heavy atoms in the receptor.
Definition render_options.cpp:57
void setLigandLineWidth(double width_in)
Set the line width to be used in plotting ligand bonds.
Definition render_options.cpp:199
double getAddedPointSize() const
Get the marker size to be used in depictions of added points.
Definition render_options.cpp:82
RenderOptions()
The default constructor will create an object with reasonable properties. Various setters can then mo...
Definition render_options.cpp:18
double getWaterHeavyAtomSize() const
Get the water oxygen size to display.
Definition render_options.cpp:77
void setWaterLightAtomSize(double marker_size_in)
Set the marker size to be used in plotting hydrogen atoms and virtual sites of water.
void setAtomicElementColor(int z_number, const uchar4 color_in)
Set the color of a specific element. Overloading and descriptions of input parameters follow from set...
Definition render_options.cpp:316
void setCamlightPosition(const std::string &position_in)
Set the camlight position. Acceptable values include "left", "right", and "headlight".
Definition render_options.cpp:347
double getBorderLineWidth() const
Get the line weight for plotting borders of a potential field in the scene.
Definition render_options.cpp:132
double getLigandLightAtomSize() const
Get the marker size to be used in depictions of light atoms in the ligand.
Definition render_options.cpp:62
double getLigandHeavyAtomSize() const
Get the marker size to be used in depictions of heavy atoms in the ligand.
Definition render_options.cpp:67
void setReceptorLineWidth(double width_in)
Set the line width to be used in plotting receptor bonds.
Definition render_options.cpp:193
void setReceptorLightAtomSize(double marker_size_in)
Set the marker size to be used in plotting light atoms of the receptor.
Definition render_options.cpp:205
void setLigandHighlight(const std::string &highlight_in)
Set the ligand atom selection mask string.
Definition render_options.cpp:260
void setFieldBorderColor(const uchar4 color_in)
Set the color for displaying borders to the potential field in the scene.
Definition render_options.cpp:250
uchar4 getElementColor(int z_number) const
Get the color for depicting a particular element. The R, G, and B colors will be given in the "x",...
Definition render_options.cpp:175
uchar4 getLigandLineColor() const
Get the line color to be used in depictions of the ligand.
Definition render_options.cpp:107
const RenderOptions * getSelfPointer() const
Get a const pointer to the object itself.
Definition render_options.cpp:188
SurfaceRender getIsosurfaceDrawingMethod(int index) const
Get the method of drawing one of the requested isosurfaces.
Definition render_options.cpp:169
uchar4 getBorderLineColor() const
\rbief
Definition render_options.cpp:142
void setAddedPointColor(const uchar4 color_in)
Set the line color to be used in coloring poitns added to the scene. Overloading and descriptions of ...
Definition render_options.cpp:299
uchar4 getAddedPointColor() const
Get the color to be used in placing arbitrary points in the scene.
Definition render_options.cpp:117
void setReceptorHeavyAtomSize(double marker_size_in)
Set the marker size to be used in plotting heavy atoms of the receptor.
Definition render_options.cpp:211
int getIsosurfaceCount() const
Get the number of isosurfaces to render.
Definition render_options.cpp:152
void setReceptorLineColor(const uchar4 color_in)
Set the line color to be used in coloring the receptor's bonds.
Definition render_options.cpp:265
LinePlotStyle getBorderLineStyle() const
Get the line style for plotting borders of a potential field in the scene.
Definition render_options.cpp:137
double getLigandLineWidth() const
Get the ligand bond thickness.
Definition render_options.cpp:47
void setPotentialFieldBorderDisplay(bool display_borders_in)
Set whether to display borders on the potential field.
Definition render_options.cpp:235
const std::string & getLightingMode() const
Get the lighting mode.
double getReceptorLineWidth() const
Get the receptor bond thickness.
Definition render_options.cpp:42
double getReceptorLightAtomSize() const
Get the marker size to be used in depictions of light atoms in the receptor.
Definition render_options.cpp:52
RenderOptions(const RenderOptions &original)=default
With no pointers to repair and no const member variables, the default copy and move constructors as w...
void setLightingMode(const std::string &mode_in)
Set the lighting mode. The mode will be checked for validity. Allowed values include "none",...
Definition render_options.cpp:334
void setLigandHeavyAtomSize(double marker_size_in)
Set the marker size to be used in plotting heavy atoms of the ligand.
Definition render_options.cpp:223
double getIsosurfaceValue(int index) const
Get one of the requested isosurface values. This will be plotted using the matrix package's own isosu...
Definition render_options.cpp:157
std::string getFormattedAddedPointColor(GridFileSyntax syntax) const
Get the color for placing added points on the scene in matrix package syntax. The methodology follows...
Definition render_options.cpp:122
const std::string & getCamlightPosition() const
Get the camlight position.
void setFieldBorderLineWidth(double width_in)
Set the line width for border lines on the potential field.
Definition render_options.cpp:240
std::string getFormattedBorderColor(GridFileSyntax syntax) const
Get the color for drawing borders around the region containing the potential field,...
Definition render_options.cpp:147
std::string getFormattedLigandLineColor(GridFileSyntax syntax) const
Get the color for depicting a line connecting atoms of the ligand in matrix package syntax....
Definition render_options.cpp:112
std::string getFormattedReceptorLineColor(GridFileSyntax syntax) const
Get the color for depicting a line connecting atoms of the receptor in matrix package syntax,...
Definition render_options.cpp:102
std::string getFormattedElementColor(int z_number, GridFileSyntax syntax) const
Get the color for depicting a particular element in matrix package syntax. The methodology follows fr...
Definition render_options.cpp:181
Definition stormm_vector_types.h:123
Definition stormm_vector_types.h:159