OpenStructure
cartoon_render_options.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 /*
20  Author: Stefan Scheuber
21 */
22 
23 #ifndef OST_GFX_CARTOON_RENDER_OPTIONS_HH
24 #define OST_GFX_CARTOON_RENDER_OPTIONS_HH
25 
26 #include <boost/shared_ptr.hpp>
27 
28 #include <ost/gfx/module_config.hh>
29 
30 #include "render_options.hh"
31 
32 namespace ost { namespace gfx {
33 
35 public:
36  CartoonRenderOptions(bool force_tube=false);
37 
38  // RenderOptions interface
40  virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options);
41  virtual void ApplyRenderOptions(RenderOptionsPtr render_options);
42 
44  void SetPolyMode(uint poly_mode);
45  uint GetPolyMode() const;
46 
48  void SetSplineDetail(uint spline_detail);
50 
52  void SetArcDetail(uint arc_detail);
53  uint GetArcDetail() const;
54 
56  void SetNormalSmoothFactor(float smooth_factor);
57  float GetNormalSmoothFactor() const;
58 
59  // tube/coil region
60  void SetTubeRadius(float tube_radius);
61  float GetTubeRadius() const;
62  void SetTubeRatio(float tube_ratio);
63  float GetTubeRatio() const;
64  unsigned int GetTubeProfileType() const;
65  void SetTubeProfileType(unsigned int);
66 
67  // helix
68  void SetHelixWidth(float helix_width);
69  float GetHelixWidth() const;
70  void SetHelixThickness(float helix_thickness);
71  float GetHelixThickness() const;
73  void SetHelixEcc(float helix_ecc);
74  float GetHelixEcc() const;
76  void SetHelixProfileType(unsigned int);
77  unsigned int GetHelixProfileType() const;
79  unsigned int GetHelixMode() const;
80  void SetHelixMode(unsigned int);
81 
82  // strand
83  void SetStrandWidth(float strand_width);
84  float GetStrandWidth() const;
85  void SetStrandThickness(float strand_thickness);
86  float GetStrandThickness() const;
88  void SetStrandEcc(float strand_ecc);
89  float GetStrandEcc() const;
91  void SetStrandProfileType(unsigned int);
92  unsigned int GetStrandProfileType() const;
94  void SetStrandMode(unsigned int);
95  unsigned int GetStrandMode() const;
96 
97  // misc options
98 
100  void SetColorBlendMode(unsigned int);
101  unsigned int GetColorBlendMode() const;
102 
104  void SetTwistHack(bool);
105  bool GetTwistHack() const {return twist_hack_;}
106 
107  // used internally to calculate autoslab boundaries
108  float GetMaxRad() const;
109 
110 private:
111  bool force_tube_;
112  uint spline_detail_;
113  uint poly_mode_;
114  uint arc_detail_;
115 
116  float smooth_factor_;
117 
118  float tube_radius_;
119  float tube_ratio_;
120  unsigned int tube_profile_;
121  float helix_width_;
122  float helix_thickness_;
123  float helix_ecc_;
124  unsigned int helix_profile_;
125  unsigned int helix_mode_;
126  float strand_width_;
127  float strand_thickness_;
128  float strand_ecc_;
129  unsigned int strand_profile_;
130  unsigned int strand_mode_;
131 
132  unsigned int color_blend_mode_;
133 
134  bool twist_hack_;
135 };
136 
137 typedef boost::shared_ptr<CartoonRenderOptions> CartoonRenderOptionsPtr;
138 
139 }}
140 
141 #endif /* OST_GFX_CARTOON_RENDER_OPTIONS_HH */
virtual bool CanApplyRenderOptions(RenderOptionsPtr render_options)
void SetStrandEcc(float strand_ecc)
see strand profile
void SetColorBlendMode(unsigned int)
0=smooth transition, 1=sharp transition
unsigned int GetStrandProfileType() const
void SetTubeRatio(float tube_ratio)
virtual void ApplyRenderOptions(RenderOptionsPtr render_options)
unsigned int GetHelixProfileType() const
void SetHelixWidth(float helix_width)
void SetPolyMode(uint poly_mode)
sets vertex array poly mode
unsigned int GetColorBlendMode() const
void SetStrandProfileType(unsigned int)
various ways to calculate circular profile with ecc
void SetStrandWidth(float strand_width)
void SetStrandMode(unsigned int)
0=normal, 1=straightened
void SetNormalSmoothFactor(float smooth_factor)
experimental
void SetHelixMode(unsigned int)
void SetHelixThickness(float helix_thickness)
void SetTubeProfileType(unsigned int)
unsigned int GetTubeProfileType() const
virtual RenderMode::Type GetRenderMode()
void SetSplineDetail(uint spline_detail)
number of smooth points between spline control points
void SetHelixProfileType(unsigned int)
various ways to calculate circular profile with ecc
unsigned int GetStrandMode() const
unsigned int GetHelixMode() const
0=normal 1=straight cylinders
void SetHelixEcc(float helix_ecc)
see helix profile
CartoonRenderOptions(bool force_tube=false)
void SetArcDetail(uint arc_detail)
number of circular profile subdivisions per 90deg
void SetStrandThickness(float strand_thickness)
void SetTubeRadius(float tube_radius)
void SetTwistHack(bool)
experimental
#define DLLEXPORT_OST_GFX
unsigned int uint
Definition: base.hh:29
boost::shared_ptr< CartoonRenderOptions > CartoonRenderOptionsPtr
boost::shared_ptr< RenderOptions > RenderOptionsPtr
Definition: base.dox:1