OpenSceneGraph 3.6.5
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 {
81 return _wf_mat->getEmission(osg::Material::FRONT_AND_BACK);
82 }
83
84 inline void Scribe::setWireframeColor(const osg::Vec4& color)
85 {
86 _wf_mat->setEmission(osg::Material::FRONT_AND_BACK, color);
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
Vec4f Vec4
Definition Vec4:21
The osgFX library is a NodeKit that extends the core scene graph to provide a special effects framewo...
Definition AnisotropicLighting:25
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
@ FRONT_AND_BACK
Definition Material:102
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
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)
set the wireframe line width
Definition Scribe:94
Scribe(const Scribe &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
float getWireframeLineWidth() const
get the wireframe line width
Definition Scribe:89
Scribe & operator=(const Scribe &)
Definition Scribe:68
virtual ~Scribe()
Definition Scribe:67
const osg::Vec4 & getWireframeColor() const
get the wireframe color
Definition Scribe:79
bool define_techniques()
abstract method to be implemented in derived classes; its purpose if to create the techniques that ca...
void setWireframeColor(const osg::Vec4 &color)
set the wireframe color
Definition Scribe:84
#define OSGFX_EXPORT
Definition Export:27

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.