Added support for ImageSequence to all Texture classes

This commit is contained in:
Robert Osfield
2008-07-22 12:28:46 +00:00
parent 74a1b7881e
commit 5ab73e9f80
10 changed files with 160 additions and 7 deletions

View File

@@ -58,8 +58,15 @@ class OSG_EXPORT ImageSequence : public ImageStream
bool getPruneOldImages() const { return _pruneOldImages; }
void addImageFile(const std::string& fileName);
FileNames& getFileNames() { return _fileNames; }
const FileNames& getFileNames() const { return _fileNames; }
void addImage(osg::Image* image);
Images& getImages() { return _images; }
const Images& getImages() const { return _images; }
virtual void update(NodeVisitor* nv);

View File

@@ -35,6 +35,7 @@ namespace osg {
class NodeVisitor;
class State;
class StateSet;
class Texture;
/** META_StateAttribute macro define the standard clone, isSameKindAs,
* className and getType methods.
@@ -209,6 +210,14 @@ class OSG_EXPORT StateAttribute : public Object
/** Return the name of the attribute's class type.*/
virtual const char* className() const { return "StateAttribute"; }
/** Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.*/
virtual Texture* asTexture() { return 0; }
/** Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.*/
virtual const Texture* asTexture() const { return 0; }
/** Return the Type identifier of the attribute's class type.*/
virtual Type getType() const = 0;

View File

@@ -282,11 +282,17 @@ class OSG_EXPORT Texture : public osg::StateAttribute
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Texture *>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Texture"; }
/** Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.*/
virtual Texture* asTexture() { return this; }
/** Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.*/
virtual const Texture* asTexture() const { return this; }
virtual Type getType() const { return TEXTURE; }
virtual bool isTextureAttribute() const { return true; }
virtual GLenum getTextureTarget() const = 0;
virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const