root/OpenSceneGraph/trunk/include/osgParticle/CenteredPlacer @ 13041

Revision 13041, 2.3 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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//osgParticle - Copyright (C) 2002 Marco Jez
14
15#ifndef OSGPARTICLE_CENTERED_PLACER
16#define OSGPARTICLE_CENTERED_PLACER 1
17
18#include <osgParticle/Placer>
19
20#include <osg/CopyOp>
21#include <osg/Object>
22#include <osg/Vec3>
23
24namespace osgParticle
25{
26
27    /**    An abstract placer base class for placers which need a <I>center point</I>.
28    */
29    class CenteredPlacer: public Placer {
30    public:
31        inline CenteredPlacer();
32        inline CenteredPlacer(const CenteredPlacer& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
33
34        virtual const char* libraryName() const { return "osgParticle"; }
35        virtual const char* className() const { return "CenteredPlacer"; }
36        virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Placer* >(obj) != 0; }
37
38        /// Get the center point.
39        inline const osg::Vec3& getCenter() const;
40
41        /// Set the center point.
42        inline void setCenter(const osg::Vec3& v);
43
44        /// Set the center point.
45        inline void setCenter(float x, float y, float z);
46
47    protected:
48        virtual ~CenteredPlacer() {}
49
50    private:
51        osg::Vec3 center_;
52    };
53
54    // INLINE FUNCTIONS
55
56    inline CenteredPlacer::CenteredPlacer()
57    : Placer(), center_(0, 0, 0)
58    {
59    }
60
61    inline CenteredPlacer::CenteredPlacer(const CenteredPlacer& copy, const osg::CopyOp& copyop)
62    : Placer(copy, copyop), center_(copy.center_)
63    {
64    }
65
66    inline const osg::Vec3& CenteredPlacer::getCenter() const
67    {
68        return center_;
69    }
70
71    inline void CenteredPlacer::setCenter(const osg::Vec3& v)
72    {
73        center_ = v;
74    }
75
76    inline void CenteredPlacer::setCenter(float x, float y, float z)
77    {
78        center_.set(x, y, z);
79    }
80
81}
82
83
84#endif
Note: See TracBrowser for help on using the browser.