Graphite  Version 3
An experimental 3D geometry processing program
lua_grob_shader.h
1 /*
2  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3  * Copyright (C) 2000-2009 INRIA - Project ALICE
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * If you modify this software, you should include a notice giving the
20  * name of the person performing the modification, the date of modification,
21  * and the reason for such modification.
22  *
23  * Contact: Bruno Levy - levy@loria.fr
24  *
25  * Project ALICE
26  * LORIA, INRIA Lorraine,
27  * Campus Scientifique, BP 239
28  * 54506 VANDOEUVRE LES NANCY CEDEX
29  * FRANCE
30  *
31  * Note that the GNU General Public License does not permit incorporating
32  * the Software into proprietary programs.
33  *
34  * As an exception to the GPL, Graphite can be linked with
35  * the following (non-GPL) libraries:
36  * Qt, SuperLU, WildMagic and CGAL
37  */
38 
39 
40 #ifndef H_OGF_LUAGROB_SHADERS_LUAGROB_GROB_SHADER_H
41 #define H_OGF_LUAGROB_SHADERS_LUAGROB_GROB_SHADER_H
42 
47 
53 namespace GEO {
54  class Image;
55 }
56 
57 namespace OGF {
58 
59  //________________________________________________________
60 
61  class RenderingContext;
62  class Builder;
63  class Texture;
64 
68  gom_attribute(abstract, "true")
69  gom_class LUAGROB_API LuaGrobShader : public Shader {
70  public:
76 
80  ~LuaGrobShader() override;
81 
85  void draw() override;
86 
90  void pick_object(index_t object_id) override;
91 
95  void blink() override;
96 
97 
98  protected:
103  LuaGrob* lua_grob() const {
104  return static_cast<LuaGrob*>(grob());
105  }
106  };
107 
108  //________________________________________________________
109 
113  gom_class LUAGROB_API PlainLuaGrobShader : public LuaGrobShader {
114  public:
120 
125 
129  void draw() override;
130 
134  void pick_object(index_t object_id) override;
135 
139  void blink() override;
140 
141  gom_properties:
142 
148  void set_lighting(bool value) {
149  lighting_ = value;
151  }
152 
158  bool get_lighting() const {
159  return lighting_;
160  }
161 
162 
169  void set_clipping(bool value) {
170  clipping_ = value;
171  update();
172  }
173 
180  bool get_clipping() const {
181  return clipping_;
182  }
183 
184 
192  void set_box_style(const EdgeStyle& value) {
193  box_style_ = value;
194  update();
195  }
196 
204  const EdgeStyle& get_box_style() const {
205  return box_style_;
206  }
207 
208  protected:
209 
214 
215  protected:
216  bool lighting_;
217  bool clipping_;
218  bool picking_;
219  EdgeStyle box_style_;
220  };
221 
222  //________________________________________________________
223 }
224 #endif
An image.
Definition: image.h:59
Base class for drawing and picking LuaGrob.
void blink() override
Draws the current object several times, while chaning the value of one graphic attribute (e....
~LuaGrobShader() override
LuaGrobShader destructor.
LuaGrobShader(LuaGrob *grob)
LuaGrobShader constructor.
void draw() override
Draws the Grob.
LuaGrob * lua_grob() const
Gets the LuaGrob.
void pick_object(index_t object_id) override
Draws the Grob in picking mode.
A Grob class for luagrob grids.
Definition: lua_grob.h:63
The default implementation of LuaGrobShader.
void set_box_style(const EdgeStyle &value)
Sets the style used to draw the mesh in the facets and in the cells.
void draw_wireframe_box()
Draws the bounding box in wireframe.
void pick_object(index_t object_id) override
Draws the Grob in picking mode.
bool get_clipping() const
Gets whether clipping should be used.
const EdgeStyle & get_box_style() const
Gets the style used to draw the mesh in the facets and in the cells.
PlainLuaGrobShader(LuaGrob *grob)
PlainLuaGrobShader constructor.
void blink() override
Draws the current object several times, while chaning the value of one graphic attribute (e....
void draw() override
Draws the Grob.
update()
Redraws the scene.
void set_clipping(bool value)
Sets whether clipping should be active.
bool get_lighting() const
Gets whether lighting is used.
~PlainLuaGrobShader() override
PlainLuaGrobShader destructor.
Base class for Grob shader.
Definition: shader.h:64
the LuaGrob class.
Global Vorpaline namespace.
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
Global Graphite namespace.
Definition: common.h:76
The base class for all object shaders.
Definitions common to all include files in the luagrob library.
Drawing style for mesh edges.
Definition: properties.h:115