openvrml::texture_node Class Reference
[Nodes]

Inheritance diagram for openvrml::texture_node:
[legend]
List of all members.

Detailed Description

Abstract base class for texture nodes.


Public Member Functions

virtual ~texture_node ()=0 throw ()
 Destroy.
viewer::texture_object_t render_texture (viewer &v)
 Insert a texture into a viewer.
virtual const openvrml::imageimage () const =0 throw ()
 The image.
virtual size_t frames () const =0 throw ()
 Get the number of frames for a time-dependent texture.
virtual bool repeat_s () const =0 throw ()
 Get the flag indicating whether the texture should repeat in the S direction.
virtual bool repeat_t () const =0 throw ()
 Get the flag indicating whether the texture should repeat in the T direction.

Protected Member Functions

 texture_node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw ()
 Construct.

Private Member Functions

virtual texture_nodeto_texture () throw ()
 Cast to a texture_node.
virtual viewer::texture_object_t do_render_texture (viewer &v)
 render_texture implementation.

Private Attributes

viewer::texture_object_t texture_reference
 Identifier for a texture object in the renderer.

Constructor & Destructor Documentation

openvrml::texture_node::~texture_node (  )  throw () [pure virtual]

Destroy.

Todo:
Proper resource deallocation in the viewer depends on the viewer not having been decoupled from the browser. We need to handle this better via some refcounting scheme.

openvrml::texture_node::texture_node ( const node_type type,
const boost::shared_ptr< openvrml::scope > &  scope 
) throw () [protected]

Construct.

Parameters:
type the node_type associated with the node.
scope the Scope the node belongs to.


Member Function Documentation

viewer::texture_object_t openvrml::texture_node::render_texture ( viewer v  ) 

Insert a texture into a viewer.

Parameters:
v viewer.
Returns:
object identifier for the inserted texture.

const image & openvrml::texture_node::image (  )  const throw () [pure virtual]

size_t openvrml::texture_node::frames (  )  const throw () [pure virtual]

Get the number of frames for a time-dependent texture.

Returns:
the number of frames.
Todo:
This needs to go away. Time-dependent textures might not be frame-based. For instance, consider an SVG animation.

Implemented in openvrml::vrml97_node::image_texture_node, openvrml::vrml97_node::movie_texture_node, and openvrml::vrml97_node::pixel_texture_node.

bool openvrml::texture_node::repeat_s (  )  const throw () [pure virtual]

Get the flag indicating whether the texture should repeat in the S direction.

Returns:
true if the image should repeat in the S direction, false otherwise.

Implemented in openvrml::vrml97_node::abstract_texture_node.

bool openvrml::texture_node::repeat_t (  )  const throw () [pure virtual]

Get the flag indicating whether the texture should repeat in the T direction.

Returns:
true if the image should repeat in the T direction, false otherwise.

Implemented in openvrml::vrml97_node::abstract_texture_node.

texture_node * openvrml::texture_node::to_texture (  )  throw () [private, virtual]

Cast to a texture_node.

Returns:
a pointer to this texture_node.

Reimplemented from openvrml::node.

viewer::texture_object_t openvrml::texture_node::do_render_texture ( viewer v  )  [private, virtual]

render_texture implementation.

Parameters:
v viewer.
Returns:
object identifier for the inserted texture.

Reimplemented in openvrml::vrml97_node::image_texture_node, openvrml::vrml97_node::movie_texture_node, and openvrml::vrml97_node::pixel_texture_node.


Member Data Documentation

Identifier for a texture object in the renderer.