ShapeDrawable
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_SHAPEDRAWABLE
#define OSG_SHAPEDRAWABLE 1
#include <osg/Geometry>
namespace osg {
class OSG_EXPORT ShapeDrawable : public osg::Geometry
{
public:
ShapeDrawable();
ShapeDrawable(Shape* shape, TessellationHints* hints=0);
template<class T> ShapeDrawable(const ref_ptr<T>& shape, TessellationHints* hints=0):
_tessellationHints(hints) { setShape(shape.get()); }
ShapeDrawable(const ShapeDrawable& pg,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return new ShapeDrawable(); }
virtual Object* clone(const CopyOp& copyop) const { return new ShapeDrawable(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ShapeDrawable*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "ShapeDrawable"; }
virtual void setShape(Shape* shape);
void setColor(const Vec4& color);
const Vec4& getColor() const { return _color; }
void setTessellationHints(TessellationHints* hints);
TessellationHints* getTessellationHints() { return _tessellationHints.get(); }
const TessellationHints* getTessellationHints() const { return _tessellationHints.get(); }
void build();
protected:
ShapeDrawable& operator = (const ShapeDrawable&) { return *this;}
virtual ~ShapeDrawable();
Vec4 _color;
ref_ptr<TessellationHints> _tessellationHints;
};
}
#endif
Geometry
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Geometry
Definition Geometry:31
osg::Object
Definition Object:61
osg::ShapeDrawable::getTessellationHints
TessellationHints * getTessellationHints()
Definition ShapeDrawable:59
osg::ShapeDrawable::isSameKindAs
virtual bool isSameKindAs(const Object *obj) const
Definition ShapeDrawable:45
osg::ShapeDrawable::setTessellationHints
void setTessellationHints(TessellationHints *hints)
osg::ShapeDrawable::ShapeDrawable
ShapeDrawable()
osg::ShapeDrawable::_tessellationHints
ref_ptr< TessellationHints > _tessellationHints
Definition ShapeDrawable:73
osg::ShapeDrawable::build
void build()
osg::ShapeDrawable::cloneType
virtual Object * cloneType() const
Definition ShapeDrawable:43
osg::ShapeDrawable::getColor
const Vec4 & getColor() const
Definition ShapeDrawable:55
osg::ShapeDrawable::clone
virtual Object * clone(const CopyOp &copyop) const
Definition ShapeDrawable:44
osg::ShapeDrawable::ShapeDrawable
ShapeDrawable(Shape *shape, TessellationHints *hints=0)
osg::ShapeDrawable::setColor
void setColor(const Vec4 &color)
osg::ShapeDrawable::ShapeDrawable
ShapeDrawable(const ShapeDrawable &pg, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
osg::ShapeDrawable::_color
Vec4 _color
Definition ShapeDrawable:71
osg::ShapeDrawable::getTessellationHints
const TessellationHints * getTessellationHints() const
Definition ShapeDrawable:60
osg::ShapeDrawable::className
virtual const char * className() const
Definition ShapeDrawable:47
osg::ShapeDrawable::~ShapeDrawable
virtual ~ShapeDrawable()
osg::ShapeDrawable::ShapeDrawable
ShapeDrawable(const ref_ptr< T > &shape, TessellationHints *hints=0)
Definition ShapeDrawable:37
osg::ShapeDrawable::libraryName
virtual const char * libraryName() const
Definition ShapeDrawable:46
osg::ShapeDrawable::setShape
virtual void setShape(Shape *shape)
osg::Shape
Definition Shape:49
osg::TessellationHints
Definition Shape:658
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osg
Definition AlphaFunc:19
osg::Vec4
Vec4f Vec4
Definition Vec4:21
NULL
#define NULL
Definition osg/Export:55
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39