OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Outline.h
Go to the documentation of this file.
1 // -*-c++-*-
2 
3 /*
4  * OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
5  *
6  * This library is open source and may be redistributed and/or modified under
7  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
8  * (at your option) any later version. The full license is in LICENSE file
9  * included with this distribution, and on the openscenegraph.org website.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * OpenSceneGraph Public License for more details.
15  */
16 
17 /*
18  * osgFX::Outline - Copyright (C) 2004,2009 Ulrich Hertlein
19  */
20 
21 #ifndef OSGFX_OUTLINE_
22 #define OSGFX_OUTLINE_
23 
24 #include <osgFX/Export>
25 #include <osgFX/Effect>
26 
27 namespace osgFX
28 {
40  class OSGFX_EXPORT Outline : public Effect
41  {
42  public:
44  Outline();
45 
47  Outline(const Outline& copy, const osg::CopyOp& op = osg::CopyOp::SHALLOW_COPY) : Effect(copy, op) {
48  _width = copy._width;
49  _color = copy._color;
50  _technique = copy._technique;
51  }
52 
53  // Effect class info
54  META_Effect(osgFX, Outline, "Outline",
55  "Stencil buffer based object outline effect.\n"
56  "This effect needs a properly setup stencil buffer.",
57  "Ulrich Hertlein");
58 
60  void setWidth(float w);
61 
63  float getWidth() const {
64  return _width;
65  }
66 
68  void setColor(const osg::Vec4& color);
69 
71  const osg::Vec4& getColor() const {
72  return _color;
73  }
74 
75  protected:
77  virtual ~Outline() {
78  }
79 
81  bool define_techniques();
82 
83  private:
85  float _width;
86 
88  osg::Vec4 _color;
89 
91  class OutlineTechnique;
92  OutlineTechnique* _technique;
93  };
94 
95 }
96 
97 #endif
Outline(const Outline &copy, const osg::CopyOp &op=osg::CopyOp::SHALLOW_COPY)
Copy constructor.
Definition: Outline.h:47
#define META_Effect(library, classname, effectname, effectdescription, effectauthor)
Definition: Effect.h:35
virtual ~Outline()
Destructor.
Definition: Outline.h:77
float getWidth() const
Get outline width.
Definition: Outline.h:63
#define OSGFX_EXPORT
Definition: Export.h:27
const osg::Vec4 & getColor() const
Get outline color.
Definition: Outline.h:71