| 1 | /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 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 | |
|---|
| 14 | #ifndef OSG_IMAGESTREAM |
|---|
| 15 | #define OSG_IMAGESTREAM 1 |
|---|
| 16 | |
|---|
| 17 | #include <osg/Image> |
|---|
| 18 | |
|---|
| 19 | namespace osg { |
|---|
| 20 | |
|---|
| 21 | /** |
|---|
| 22 | * Image Stream class. |
|---|
| 23 | */ |
|---|
| 24 | class SG_EXPORT ImageStream : public Image |
|---|
| 25 | { |
|---|
| 26 | public: |
|---|
| 27 | ImageStream(); |
|---|
| 28 | |
|---|
| 29 | /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ |
|---|
| 30 | ImageStream(const ImageStream& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY); |
|---|
| 31 | |
|---|
| 32 | virtual Object* cloneType() const { return new ImageStream(); } |
|---|
| 33 | virtual Object* clone(const CopyOp& copyop) const { return new ImageStream(*this,copyop); } |
|---|
| 34 | virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ImageStream*>(obj)!=0; } |
|---|
| 35 | virtual const char* libraryName() const { return "osg"; } |
|---|
| 36 | virtual const char* className() const { return "ImageStream"; } |
|---|
| 37 | |
|---|
| 38 | /** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/ |
|---|
| 39 | virtual int compare(const Image& rhs) const; |
|---|
| 40 | |
|---|
| 41 | enum StreamStatus |
|---|
| 42 | { |
|---|
| 43 | PLAYING, |
|---|
| 44 | PAUSED, |
|---|
| 45 | REWINDING |
|---|
| 46 | }; |
|---|
| 47 | |
|---|
| 48 | virtual void play() { _status=PLAYING; } |
|---|
| 49 | |
|---|
| 50 | virtual void pause() { _status=PAUSED; } |
|---|
| 51 | |
|---|
| 52 | virtual void rewind() { _status=REWINDING; } |
|---|
| 53 | |
|---|
| 54 | virtual void quit(bool /*wiatForThreadToExit*/ = true) {} |
|---|
| 55 | |
|---|
| 56 | StreamStatus getStatus() { return _status; } |
|---|
| 57 | |
|---|
| 58 | virtual void setReferenceTime(double) {} |
|---|
| 59 | virtual double getReferenceTime() const { return 0.0; } |
|---|
| 60 | |
|---|
| 61 | virtual void setTimeMultiplier(double) {} |
|---|
| 62 | virtual double getTimeMultiplier() { return 0.0; } |
|---|
| 63 | |
|---|
| 64 | virtual void update() {} |
|---|
| 65 | |
|---|
| 66 | protected: |
|---|
| 67 | |
|---|
| 68 | virtual ~ImageStream() {} |
|---|
| 69 | |
|---|
| 70 | StreamStatus _status; |
|---|
| 71 | }; |
|---|
| 72 | |
|---|
| 73 | } // namespace |
|---|
| 74 | |
|---|
| 75 | #endif |
|---|