OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gfx_object_base.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 #ifndef OST_GFX_OBJ_BASE_HH
20 #define OST_GFX_OBJ_BASE_HH
21 
22 /*
23  Author: Ansgar Philippsen
24 */
25 
26 #include <ost/geom/geom.hh>
27 #include <ost/mol/entity_handle.hh>
28 #include <ost/mol/entity_view.hh>
29 #include <ost/img/map.hh>
30 
31 #include <ost/config.hh>
32 #include "module_config.hh"
33 
34 #include "gfx_node.hh"
35 #include "color.hh"
36 #include "render_mode.hh"
37 #include "gradient.hh"
38 #include "material.hh"
39 #include "color_ops/color_op.hh"
40 
41 namespace ost { namespace gfx {
42 
43 class Scene; // fw decl
44 
46 /*
47  this abstract base class is for both the actual GfxObj as well as a
48  shortly implemented re-design of the GfxNode, and hence temporary in
49  its current form
50 */
52 {
53  public:
54  GfxObjBase(const String& name): GfxNode(name) {}
55 
57  virtual void SetMatAmb(const Color& c) = 0;
59  virtual void SetMatDiff(const Color& c) = 0;
61  virtual void SetMatSpec(const Color& c) = 0;
63  virtual void SetMatShin(float s) = 0;
65  virtual void SetMatEmm(const Color& c) = 0;
66 
68  virtual void ContextSwitch() = 0;
69 
71  virtual void SetRenderMode(RenderMode::Type m) = 0;
73  virtual RenderMode::Type GetRenderMode() const = 0;
74 
76  virtual geom::Vec3 GetCenter() const = 0;
77 
79  virtual void SetLineWidth(float w) = 0;
80 
82  virtual void SetPolyMode(unsigned int m) = 0;
83 
85  virtual void SetAALines(bool f) = 0;
86 
88  virtual void SetLineHalo(float f) = 0;
89 
91  virtual void SetOutline(bool f) = 0;
93  virtual bool GetOutline() const = 0;
95  virtual void SetOutlineMode(int m) = 0;
97  virtual int GetOutlineMode() const = 0;
100  virtual void SetOutlineWidth(float f) = 0;
102  virtual float GetOutlineWidth() const = 0;
105  virtual void SetOutlineExpandFactor(float f) = 0;
107  virtual float GetOutlineExpandFactor() const = 0;
109  virtual void SetOutlineExpandColor(const Color& c) = 0;
111  virtual Color GetOutlineExpandColor() const = 0;
112 
114  virtual void SetOpacity(float f) = 0;
116  virtual float GetOpacity() const = 0;
117 
118  virtual void SetSolid(bool f) = 0;
119  virtual bool GetSolid() const = 0;
120  virtual void SetSolidColor(const Color& c) = 0;
121  virtual Color GetSolidColor() const = 0;
122 
123  virtual void SetClip(bool f) = 0;
124  virtual bool GetClip() const = 0;
125  virtual void SetClipPlane(const geom::Vec4&) = 0;
126  virtual geom::Vec4 GetClipPlane() const = 0;
127  virtual void SetClipOffset(float f) = 0;
128  virtual float GetClipOffset() const = 0;
129 
132  virtual void ColorBy(const mol::EntityView& ev,
133  const String& prop,
134  const Gradient& g, float minv, float maxv) = 0;
135 
137  virtual void ColorBy(const img::MapHandle& mh,
138  const String& prop,
139  const Gradient& g,float minv, float maxv) = 0;
140 };
141 
142 }} // ns
143 
144 #endif
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_GFX
main interface for all graphic objects, both in C++ and Python
Three dimensional vector class, using Real precision.
Definition: vec3.hh:43
GfxObjBase(const String &name)
Manage shared instances of images.
definition of EntityView
Definition: entity_view.hh:86
color gradient
Definition: gradient.hh:59