Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
properties.h
Go to the documentation of this file.
1/*
2 * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3 * Copyright (C) 2000 Bruno Levy
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
24 *
25 * levy@loria.fr
26 *
27 * ISA Project
28 * LORIA, INRIA Lorraine,
29 * Campus Scientifique, BP 239
30 * 54506 VANDOEUVRE LES NANCY CEDEX
31 * FRANCE
32 *
33 * Note that the GNU General Public License does not permit incorporating
34 * the Software into proprietary programs.
35 */
36
37
38#ifndef H_OGF_SCENE_GRAPH_TYPES_SHADER_PROPERTIES_H
39#define H_OGF_SCENE_GRAPH_TYPES_SHADER_PROPERTIES_H
40
43#include <geogram/image/color.h>
44
45#include <iostream>
46#include <string>
47
53namespace GEO {
54 class Image;
55}
56
57namespace OGF {
58
59 //________________________________________________________
60
64 struct PointStyle {
70 visible(false),
71 color(0.0,0.0,0.0,1.0),
72 size(4) {
73 }
77 bool visible;
78
83
88 };
89
90 /****************************************************************/
91
95 struct EdgeStyle {
101 visible(false),
102 color(0.0,0.0,0.0,1.0),
103 width(1) {
104 }
105
110
115
120 };
121
122 /*************************************************************/
123
134 visible(false),
135 color(0.0,0.0,0.0,1.0) {
136 }
141
146 };
147
148 /***********************************************************************/
149
158 template <class T, bool create=false> class Name : public NameBase {
159 public:
164
171 }
172
177 Name(const thisclass& rhs) : val_(rhs.val_) {
178 }
179
184 Name(const std::string& rhs) : val_(rhs) {
185 }
186
191 Name(const char* rhs) : val_(rhs) {
192 }
193
200 val_ = rhs.val_;
201 return *this;
202 }
203
209 thisclass& operator=(const std::string& rhs) {
210 val_ = rhs;
211 return *this;
212 }
213
219 thisclass& operator=(const char* rhs) {
220 val_ = std::string(rhs);
221 return *this;
222 }
223
228 operator const std::string&() const {
229 return val_;
230 }
231
236 operator std::string&() {
237 return val_;
238 }
239
247 bool operator==(const std::string& rhs) const {
248 return val_ == rhs;
249 }
250
258 bool operator!=(const std::string& rhs) const {
259 return val_ != rhs;
260 }
261
262 private:
263 std::string val_;
264 };
265
266 //________________________________________________________
267
274 template <class T, bool B> inline std::ostream& operator<< (
275 std::ostream& out, const Name<T,B>& name
276 ) {
277 return (out << (const std::string&)(name)) ;
278 }
279
286 template <class T, bool B> std::istream& operator>> (
287 std::istream& in, Name<T,B>& name
288 ) {
289 // Note: we use "std::getline(in, name)" instead of "in >> name" since
290 // "in >> name" would truncate the string if it contains whitespace
291 // (and under Windows, "My documents" directory contains a
292 // whitespace !)
293
294 std::getline(in, (std::string&)name) ;
295 return in ;
296 }
297
298 //________________________________________________________
299
304 template <class T> class File {
305 public:
306 };
307
317
327
328 //________________________________________________________
329
340
351
352 //________________________________________________________
353
354 class Grob;
355
364
375
376 //________________________________________________________
377
388
399
400 //________________________________________________________
401
402 class GrobClass;
403
413
414 //_______________________________________________________
415
416 class Colormap;
417
427
428 //________________________________________________________
429
434
439 colormap_name("rainbow"),
440 smooth(true),
441 repeat(0),
442 show(false),
443 flip(false) {
444 }
445
450
455 bool smooth;
456
463
469 bool show;
470
474 bool flip;
475 };
476
477 /**************************************************************/
478
479 class FullScreenEffect;
480
489
490}
491
492#endif
Generic arguments and argument lists.
A Colormap.
Definition colormap.h:61
Just a placeholder template to create new Name<> types for file names.
Definition properties.h:304
A Full screen effect.
Base class for all 3D Graphite objects.
Definition grob.h:68
Base class for all Names in Graphite (GrobName ...).
Definition arg_list.h:59
A template class for strings that need to have a specific type in the GOM system.
Definition properties.h:158
bool operator!=(const std::string &rhs) const
Tests whether this Name differs from a given string.
Definition properties.h:258
thisclass & operator=(const thisclass &rhs)
Assignment operator.
Definition properties.h:199
Name()
Name constructor.
Definition properties.h:170
thisclass & operator=(const char *rhs)
Assignment operator from a C string.
Definition properties.h:219
Name< T > thisclass
This class type.
Definition properties.h:163
Name(const std::string &rhs)
Name copy constructor from std::string.
Definition properties.h:184
bool operator==(const std::string &rhs) const
Tests whether this Name corresponds to a given string.
Definition properties.h:247
thisclass & operator=(const std::string &rhs)
Assignment operator from std::string.
Definition properties.h:209
Name(const thisclass &rhs)
Name copy constructor.
Definition properties.h:177
Name(const char *rhs)
Name copy constructor from const char*.
Definition properties.h:191
Color types.
Global Vorpaline namespace.
geo_index_t index_t
The type for storing and manipulating indices.
Definition numeric.h:330
Global Graphite namespace.
Definition common.h:76
Name< Colormap * > ColormapName
The name of a colormap.
Definition properties.h:426
Name< File< Image * >, true > NewImageFileName
The name of an (existing or not) file that contains an Image.
Definition properties.h:350
std::istream & operator>>(std::istream &in, Name< T, B > &name)
Reads a Name from a stream.
Definition properties.h:286
Name< Grob *, true > NewGrobName
The name of an (existing or not) Grob in the SceneGraph.
Definition properties.h:374
Name< File< Memory::byte >, true > NewFileName
The name of a new file.
Definition properties.h:326
Name< File< Grob * >, true > NewGrobFileName
The name of an (existing or not) file that contains an object.
Definition properties.h:398
std::ostream & operator<<(std::ostream &out, const ArgList &args)
Prints an ArgList into a stream.
Definition arg_list.h:527
Name< Grob * > GrobName
The name of an existing Grob in the SceneGraph.
Definition properties.h:363
Name< File< Grob * > > GrobFileName
The name of an existing file that contains an object.
Definition properties.h:387
Name< GrobClass * > GrobClassName
The name of a Grob class.
Definition properties.h:412
Name< File< Memory::byte > > FileName
The name of an existing file.
Definition properties.h:316
Name< FullScreenEffect * > FullScreenEffectName
The name of a full screen effect.
Definition properties.h:488
Name< File< Image * > > ImageFileName
The name of an existing file that contains an Image.
Definition properties.h:339
Definitions common to all include files in the scene_graph library.
The style used to display colormapped colors.
Definition properties.h:433
ColormapName colormap_name
Name of the colormap file, in "lib/colormaps".
Definition properties.h:449
bool show
If true, show the colormap and mapped minimum and maximum value on the top left corner of the renderi...
Definition properties.h:469
bool flip
If true, flip the colormap.
Definition properties.h:474
bool smooth
If true, then colormap is smoothed (using linear interpolation and mipmaps, else GL_NEAREST is used.
Definition properties.h:455
ColormapStyle()
ColormapStyle constructor.
Definition properties.h:438
index_t repeat
Number of times the colormap should be repeated within the [0,1] range of color indices....
Definition properties.h:462
Drawing style for mesh edges.
Definition properties.h:95
Color color
Color of the edges.
Definition properties.h:114
EdgeStyle()
EdgeStyle constructor.
Definition properties.h:100
index_t width
width of the edges.
Definition properties.h:119
bool visible
true if edges are visible, false otherwise.
Definition properties.h:109
Drawing style for points.
Definition properties.h:64
index_t size
Size of the points.
Definition properties.h:87
bool visible
true if points are visible, false otherwise.
Definition properties.h:77
Color color
Color of the points.
Definition properties.h:82
PointStyle()
PointStyle constructor.
Definition properties.h:69
Drawing style for polygons.
Definition properties.h:127
Color color
The Color used to draw the polygons.
Definition properties.h:145
bool visible
true if polygons are visible, false otherwise.
Definition properties.h:140
SurfaceStyle()
SurfaceStyle constructor.
Definition properties.h:133