OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Scribe.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 //osgFX - Copyright (C) 2003 Marco Jez
14 
15 #ifndef OSGFX_SCRIBE_
16 #define OSGFX_SCRIBE_
17 
18 #include <osgFX/Export>
19 #include <osgFX/Effect>
20 
21 #include <osg/Material>
22 #include <osg/LineWidth>
23 
24 namespace osgFX
25 {
26 
34  class OSGFX_EXPORT Scribe: public Effect {
35  public:
36  Scribe();
37  Scribe(const Scribe& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
38 
39  // effect class informations
41  osgFX,
42  Scribe,
43 
44  "Scribe",
45 
46  "This is a two-passes effect; the first pass renders the subgraph as usual "
47  "while the second pass switches to wireframe mode, sets up lighting and "
48  "material to obtain a fixed (user-defined) color and then renders the subgraph.\n"
49  "This effect uses the PolygonOffset attribute to avoid Z-fighting, so it "
50  "requires at least OpenGL version 1.1.",
51 
52  "Marco Jez");
53 
55  inline const osg::Vec4& getWireframeColor() const;
56 
58  inline void setWireframeColor(const osg::Vec4& color);
59 
61  inline float getWireframeLineWidth() const;
62 
64  inline void setWireframeLineWidth(float w);
65 
66  protected:
67  virtual ~Scribe() {}
68  Scribe& operator=(const Scribe&) { return *this; }
69 
70  bool define_techniques();
71 
72  private:
75  };
76 
77  // INLINE METHODS
78 
79  inline const osg::Vec4& Scribe::getWireframeColor() const
80  {
82  }
83 
84  inline void Scribe::setWireframeColor(const osg::Vec4& color)
85  {
87  }
88 
89  inline float Scribe::getWireframeLineWidth() const
90  {
91  return _wf_lw->getWidth();
92  }
93 
94  inline void Scribe::setWireframeLineWidth(float w)
95  {
96  _wf_lw->setWidth(w);
97  }
98 
99 }
100 
101 #endif
Scribe & operator=(const Scribe &)
Definition: Scribe.h:68
const osg::Vec4 & getWireframeColor() const
Definition: Scribe.h:79
float getWidth() const
Definition: LineWidth.h:50
void setWireframeColor(const osg::Vec4 &color)
Definition: Scribe.h:84
#define META_Effect(library, classname, effectname, effectdescription, effectauthor)
Definition: Effect.h:35
float getWireframeLineWidth() const
Definition: Scribe.h:89
void setEmission(Face face, const Vec4 &emission)
const Vec4 & getEmission(Face face) const
#define OSGFX_EXPORT
Definition: Export.h:27
void setWidth(float width)
virtual ~Scribe()
Definition: Scribe.h:67
void setWireframeLineWidth(float w)
Definition: Scribe.h:94