SurgSim::Graphics::OsgRenderTarget< T > Class Template Reference

Specific implementation of the render target class. More...

`#include <SurgSim/Graphics/OsgRenderTarget.h>`

Inheritance diagram for SurgSim::Graphics::OsgRenderTarget< T >:

## Public Types

typedef T | TextureType
| The internal type of the texture, not exposed in the public interface. More...

## Public Member Functions

| OsgRenderTarget ()
| Default constructor. More...
| OsgRenderTarget (int width, int height, double scale=1.0, int colorCount=0, bool useDepth=false)
| Constructor set all the paramters for the render target. More...
| ~OsgRenderTarget ()
| Destructor. More...
void | getSize (int *width, int *height) const override
| Gets a size. More...
int | getColorTargetCount () const override
std::shared_ptr< Texture > | getColorTarget (int index) const override
| Generic accessor for a specific color target texture. More...
std::shared_ptr< OsgTexture > | getColorTargetOsg (int index) const
| Accessor for the color target as an OsgTexture. More...
bool | doesUseDepthTarget () const override
| Determines if RenderTarget does use a depth target. More...
std::shared_ptr< Texture > | getDepthTarget () const override
| Generic accessor for the depth Target. More...
std::shared_ptr< OsgTexture > | getDepthTargetOsg () const
| Accessor for the depth target as an OsgTexture. More...
Public Member Functions inherited from SurgSim::Graphics::RenderTarget
| RenderTarget ()
| Constructor. More...
virtual | ~RenderTarget ()

## Private Types

enum | TargetTypes { TARGETTYPE_DEPTH = 0, TARGETTYPE_COLORBASE = 1 }
| Values that represent TargetTypes. More...

## Private Member Functions

int | setColorTargetCount (int count)
| Sets color target count. More...
void | useDepthTarget (bool val)
| Use depth target. More...
void | setupTexture (int type)
| Sets up the texture with a given target type (depth or color w/ index). More...

## Private Attributes

int | m_width
| The width of this RenderTarget. More...
int | m_height
| The height of this RenderTarget. More...
int | m_colorTargetCount
| Number of color targets. More...
std::vector< std::shared_ptr< TextureType > > | m_textures
| The textures that are being used as target, size of this is 16 (ColorTargets) + 1 (Depth). More...

## Detailed Description

### template<class T>
class SurgSim::Graphics::OsgRenderTarget< T >

Specific implementation of the render target class.

It is templated so different texture formats can be chosen.

Template Parameters

  T | Type of the texture that should be used as targets probably either OsgTexture2d or OsgTextureRectangle.

## Member Typedef Documentation

## TextureType

template<class T >

typedef T SurgSim::Graphics::OsgRenderTarget< T >::TextureType

The internal type of the texture, not exposed in the public interface.

## Member Enumeration Documentation

## TargetTypes

template<class T >

enum SurgSim::Graphics::OsgRenderTarget::TargetTypes

private

Values that represent TargetTypes.

Enumerator
TARGETTYPE_DEPTH |
TARGETTYPE_COLORBASE |

## Constructor & Destructor Documentation

## OsgRenderTarget() [1/2]

template<class T >

SurgSim::Graphics::OsgRenderTarget< T >::OsgRenderTarget | ( |  | ) |

Default constructor.

## OsgRenderTarget() [2/2]

template<class T >

SurgSim::Graphics::OsgRenderTarget< T >::OsgRenderTarget | ( | int | width,
|  | int | height,
|  | double | scale = `1.0`,
|  | int | colorCount = `0`,
|  | bool | useDepth = `false`
| ) |  |

Constructor set all the paramters for the render target.

Parameters

  width,height | The width and height of the target textures.
  scale | (Optional) the scale, scales width and height by this factor.
  colorCount | (Optional) number of color textures to use.
  useDepth | (Optional) whether to use a depth texture.

## ~OsgRenderTarget()

template<class T >

SurgSim::Graphics::OsgRenderTarget< T >::~OsgRenderTarget | ( |  | ) |

Destructor.

## Member Function Documentation

## doesUseDepthTarget()

template<class T >

bool SurgSim::Graphics::OsgRenderTarget< T >::doesUseDepthTarget | ( |  | ) | const

override virtual

Determines if RenderTarget does use a depth target.

Returns
  true if it does.

Implements SurgSim::Graphics::RenderTarget.

## getColorTarget()

template<class T >

std::shared_ptr< Texture > SurgSim::Graphics::OsgRenderTarget< T >::getColorTarget | ( | int | index | ) | const

override virtual

Generic accessor for a specific color target texture.

Parameters

  index | Zero-based index of the texure.

Returns
  The actual Texture.

Implements SurgSim::Graphics::RenderTarget.

## getColorTargetCount()

template<class T >

int SurgSim::Graphics::OsgRenderTarget< T >::getColorTargetCount | ( |  | ) | const

override virtual

Returns
  The number of color targets that are available.

Implements SurgSim::Graphics::RenderTarget.

## getColorTargetOsg()

template<class T >

std::shared_ptr< OsgTexture > SurgSim::Graphics::OsgRenderTarget< T >::getColorTargetOsg | ( | int | index | ) | const

virtual

Accessor for the color target as an OsgTexture.

Parameters

  index | Zero-based index of the color texture.

Returns
  The color target as an osg specific class.

Implements SurgSim::Graphics::OsgAbstractRenderTarget.

## getDepthTarget()

template<class T >

std::shared_ptr< Texture > SurgSim::Graphics::OsgRenderTarget< T >::getDepthTarget | ( |  | ) | const

override virtual

Generic accessor for the depth Target.

Returns
  The depth target.

Implements SurgSim::Graphics::RenderTarget.

## getDepthTargetOsg()

template<class T >

std::shared_ptr< OsgTexture > SurgSim::Graphics::OsgRenderTarget< T >::getDepthTargetOsg | ( |  | ) | const

virtual

Accessor for the depth target as an OsgTexture.

Returns
  The depth target as an osg specific class.

Implements SurgSim::Graphics::OsgAbstractRenderTarget.

## getSize()

template<class T >

void SurgSim::Graphics::OsgRenderTarget< T >::getSize | ( | int * | width,
|  | int * | height
| ) |  | const

override virtual

Gets a size.

Parameters

  [out] | width,height | The width and height of the RenderTarget textures.

Implements SurgSim::Graphics::RenderTarget.

## setColorTargetCount()

template<class T >

int SurgSim::Graphics::OsgRenderTarget< T >::setColorTargetCount | ( | int | count | ) |

private

Sets color target count.

Parameters

  count | The number of color textures to use.

Returns
  .

## setupTexture()

template<class T >

void SurgSim::Graphics::OsgRenderTarget< T >::setupTexture | ( | int | type | ) |

private

Sets up the texture with a given target type (depth or color w/ index).

Parameters

  type | The index of the texture to use.

## useDepthTarget()

template<class T >

void SurgSim::Graphics::OsgRenderTarget< T >::useDepthTarget | ( | bool | val | ) |

private

Use depth target.

Parameters

  val | true to value.

## Member Data Documentation

## m_colorTargetCount

template<class T >

int SurgSim::Graphics::OsgRenderTarget< T >::m_colorTargetCount

private

Number of color targets.

## m_height

template<class T >

int SurgSim::Graphics::OsgRenderTarget< T >::m_height

private

The height of this RenderTarget.

## m_textures

template<class T >

std::vector<std::shared_ptr<TextureType> > SurgSim::Graphics::OsgRenderTarget< T >::m_textures

private

The textures that are being used as target, size of this is 16 (ColorTargets) + 1 (Depth).

## m_width

template<class T >

int SurgSim::Graphics::OsgRenderTarget< T >::m_width

private

The width of this RenderTarget.

The documentation for this class was generated from the following files:

- SurgSim/Graphics/OsgRenderTarget.h
- SurgSim/Graphics/OsgRenderTarget-inl.h