openscenegraph
Scribe
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
24namespace osgFX
25{
26
34 class OSGFX_EXPORT Scribe: public Effect {
35 public:
37 Scribe(const Scribe& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
38
39 // effect class information
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
71
72 private:
75 };
76
77 // INLINE METHODS
78
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
Definition Effect:66
Definition Scribe:34
META_Effect(osgFX, Scribe, "Scribe", "This is a two-passes effect; the first pass renders the subgraph as usual " "while the second pass switches to wireframe mode, sets up lighting and " "material to obtain a fixed (user-defined) color and then renders the subgraph.\n" "This effect uses the PolygonOffset attribute to avoid Z-fighting, so it " "requires at least OpenGL version 1.1.", "Marco Jez")
void setWireframeLineWidth(float w)
Definition Scribe:94
Scribe(const Scribe &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
float getWireframeLineWidth() const
Definition Scribe:89
Scribe & operator=(const Scribe &)
Definition Scribe:68
virtual ~Scribe()
Definition Scribe:67
const osg::Vec4 & getWireframeColor() const
Definition Scribe:79
bool define_techniques()
void setWireframeColor(const osg::Vec4 &color)
Definition Scribe:84
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void setWidth(float width)
float getWidth() const
Definition LineWidth:50
@ FRONT_AND_BACK
Definition Material:102
void setEmission(Face face, const Vec4 &emission)
const Vec4 & getEmission(Face face) const
Definition Vec4f:28
Definition ref_ptr:32
Definition AnisotropicLighting:25
#define OSGFX_EXPORT
Definition osgFX/Export:27