SurgSim::Graphics Namespace Reference

## Classes

class | AxesRepresentation
| Displays the coordinate axes, as three lines from the origin default size is 1.0, the X/Y/Z axis are indicated by R/G/B respectively. More...
struct | BoneData
| Local data structure to store the bones and their references to the transforms. More...
class | BoxRepresentation
| Base graphics box representation class, which defines the basic interface for a box that can be visualized. More...
class | Camera
| Base graphics camera class, which defines the basic interface for all graphics cameras. More...
class | CapsuleRepresentation
| Base graphics capsule representation class, which defines the basic interface for a capsule that can be visualized. More...
class | CurveRepresentation
| This implements a graphical object to draw an interpolated curve, it accepts a series of control points, the number of segments in the curve will depend on the number of control points and the value returned from getSubdivisions(). More...
class | CylinderRepresentation
| Base graphics cylinder representation class, which defines the basic interface for a cylinder that can be visualized. More...
class | Font
| Abstract base class for the Font Asset, fonts are typefaces that can be used to render text on screen they would usually be loaded from disk. More...
class | GenerateTangentSpaceTriangleIndexFunctor
| Triangle index functor which calculates the tangent space basis vectors for the vertices of a geometry from texture coordinates. More...
class | Group
| Base graphics group class, which defines the interface that all graphics groups must implement. More...
class | Light
| Abstract interface for a light, a light needs to be assigned to a group to be active, only the members of this group will be considered to be lit by this light. More...
class | Manager
| Basic graphics manager class which manages graphics components to provide a visualization of the scene to the user. More...
class | Material
| Base class that defines the interface for graphics materials. More...
class | Mesh
class | MeshPlyReaderDelegate
| Implementation of PlyReaderDelegate for graphicsmeshes. More...
class | MeshRepresentation
| Graphics representation of a mesh, can be initialized from a Mesh structure. More...
class | Model
class | OctreeRepresentation
| Graphic representation of an Octree. More...
class | OsgAbstractRenderTarget
| Osg abstract render target, this hides the type of the actual osg texture and lets us use OsgRenderTarget without the template type. More...
class | OsgAxesRepresentation
| Osg axes representation implementation for the AxesRepresentation interface in graphics. More...
class | OsgBoxRepresentation
| OSG implementation of a graphics box representation. More...
class | OsgCamera
| OSG implementation of a graphics camera. More...
class | OsgCapsuleRepresentation
| OSG implementation of a graphics capsule representation. More...
class | OsgCurveRepresentation
| Implements the CurveRepresentation for OpenSceneGraph, it uses Catmull Rom interpolation, to draw the line as a GL_LINESTRIP. More...
class | OsgCylinderRepresentation
| OSG implementation of a graphics Cylinder representation. More...
class | OsgFont
| Osg specialization of the Font class, supports osgText::Font. More...
class | OsgGroup
| OSG implementation of a graphics group. More...
class | OsgLight
| OpenScenegraph implementation for the Light interface. More...
class | OsgLog
| Enable logging of OSG through SurgSim Logging System To use this, an object of OsgLog class must be created. More...
class | OsgManager
| OSG-based implementation of graphics manager class. More...
class | OsgMaterial
| OSG-based implementation of a graphics material. More...
class | OsgMeshRepresentation
| Implementation of a MeshRepresentation for rendering under osg. More...
class | OsgModel
| Osg implementation of the Model class, inheriting from Asset, this class knows how to load models that can be handled by osg. More...
class | OsgOctreeRepresentation
| OSG octree representation, implements an OctreeRepresenation using OSG. More...
class | OsgPlane
| OSG plane geode to be used as a primitive shape The plane is the XZ plane, with normal +Y. More...
class | OsgPlaneRepresentation
| OSG implementation of a graphics plane representation. More...
class | OsgPointCloudRepresentation
| Osg point cloud representation, implementation of a PointCloudRepresenation using OSG. More...
class | OsgProgram
| OSG-based implementation of a graphics shader. More...
class | OsgRenderTarget
| Specific implementation of the render target class. More...
class | OsgRepresentation
| Base OSG implementation of a graphics representation. More...
class | OsgSceneryRepresentation
| A OsgSceneryRepresentation is used to load osg object/node from file. More...
class | OsgScreenSpacePass
| Special RenderPass to draw items using a orthogonal projection, this is specific to the Osg implementation of the SurgSim rendering. More...
class | OsgScreenSpaceQuadRepresentation
| Implements the ScreenSpaceQuadRepresentation, provides the uniform 'texture' for the texture that it carries. More...
class | OsgSkeletonRepresentation
| Skeleton representation is used to move a mesh based on the movements of pre-selected control points (bones). More...
class | OsgSphereRepresentation
| OSG implementation of a graphics sphere representation. More...
class | OsgTextRepresentation
| Osg implementation of the TextRepresentation, to be used with OsgFont assets. More...
class | OsgTexture
| Base class for OSG implementations of Graphics Textures. More...
class | OsgTexture1d
| OSG implementation of a 1D Texture. More...
class | OsgTexture2d
| OSG implementation of a 2D Texture. More...
class | OsgTexture3d
| OSG implementation of a 3D Texture. More...
class | OsgTextureCubeMap
| OSG implementation of a Cube Map Texture. More...
class | OsgTextureRectangle
| OSG implementation of a Rectangle Texture. More...
class | OsgTextureUniform
| OSG implementation of graphics uniform with a texture value. More...
class | OsgTrackballZoomManipulator
| Trackball manipulator that uses the mouse wheel to control zoom amount. More...
class | OsgUniform
| OSG implementation of graphics uniform with a value of type T. More...
class | OsgUniform< std::shared_ptr< OsgTexture1d > >
| Specialization of OsgUniform for OsgTexture1d. More...
class | OsgUniform< std::shared_ptr< OsgTexture2d > >
| Specialization of OsgUniform for OsgTexture2d. More...
class | OsgUniform< std::shared_ptr< OsgTexture3d > >
| Specialization of OsgUniform for OsgTexture3d. More...
class | OsgUniform< std::shared_ptr< OsgTextureCubeMap > >
| Specialization of OsgUniform for OsgTextureCubeMap. More...
class | OsgUniform< std::shared_ptr< OsgTextureRectangle > >
| Specialization of OsgUniform for OsgTextureRectangle. More...
class | OsgUniform< std::vector< T > >
| Specialization of OsgUniform for vectors of values. More...
class | OsgUniformBase
| Base OSG implementation of graphics uniforms. More...
class | OsgUniformFactory
| This class can create the appropriate OsgUniform from an OpenGl glsl type, use the appropriate name from glsl in the create() function to recieve the correctly typed uniform. More...
class | OsgUnitAxes
class | OsgUnitBox
| OSG unit box geode to be used as a primitive shape The box is located at (0, 0, 0) and has a size of 1 on all three axes. More...
class | OsgUnitCylinder
| OSG unit cylinder geode to be used as a primitive shape The cylinder is located at (0, 0, 0) and has a radius of 1 and height of 1. More...
class | OsgUnitSphere
| OSG unit sphere geode to be used as a primitive shape The sphere is located at (0, 0, 0) and has a radius of 1. More...
class | OsgVectorFieldRepresentation
| OSG vector field representation, implements a VectorFieldRepresenation using OSG. More...
class | OsgView
| OSG-based implementation of graphics view class. More...
class | OsgViewElement
| OSG-based implementation of graphics view element. More...
class | PaintBehavior
| Behavior class to allow a specified scene element to receive painting effects. More...
class | PlaneRepresentation
| Base graphics plane representation class, which defines the basic interface for a plane that can be visualized. More...
class | PointCloudRepresentation
| Graphic representation of a point cloud, hase a very basic interface and is intentionally kept generic. More...
class | Program
| Base class that defines the interface for graphics programs. More...
class | RenderPass
| Encapsulation of all the components necessary needed to implement a full renderpass, this SceneElement contains a Camera and Group, it can also take a Material (for shaders and uniforms) and a RenderTarget for textures that are used as the output for the camera. More...
class | RenderTarget
| RenderTarget is an abstraction of the target buffers that a Camera should use to render it's scene valid targets are a given number of color buffers, and an optional depth buffer. More...
class | Representation
| Base graphics representation class, which defines the interface that all graphics representations must implement. More...
class | SceneryRepresentation
| Base class defining the interface for a Graphics Scenery Object. More...
class | ScreenSpaceQuadRepresentation
| A quad to display on the screen in screen space coordinates, use setPose() to set the position but x,y are presumed to be in screen space with 0|0 being in the lower left corner. More...
class | SkeletonRepresentation
| Skeleton representation is used to move a mesh based on the movements of pre-selected control points (bones). More...
class | SphereRepresentation
| Base graphics sphere representation class, which defines the basic interface for a sphere that can be visualized. More...
class | TangentSpaceGenerator
| Node visitor which calculates the tangent space basis vectors from the texture coordinates of any geometry it encounters. More...
class | TextRepresentation
| A text to be displayed on the screen in screen space coordinates, use setPose() to set the position but x,y are presumed to be in screen space with 0|0 being in the lower left corner, has a default font but can also received a separate font. More...
class | Texture
| Base class defining the interface for a Graphics Texture. More...
class | Texture1d
| Base class defining the interface for a 1D Graphics Texture. More...
class | Texture2d
| Base class defining the interface for a 2D Graphics Texture. More...
class | Texture3d
| Base class defining the interface for a 3D Graphics Texture. More...
class | TextureCubeMap
| Base class defining the interface for a Cube Map Graphics Texture. More...
class | TextureRectangle
| Base class defining the interface for a Rectangle Graphics Texture. More...
class | TriangleNormalGenerator
| Triangle index functor which calculates normals for the vertices of a geometry, use createNormalGenerator to instantiate this. More...
class | Uniform
| Base class for a graphics uniform with a value of type T. More...
class | Uniform< std::vector< T > >
| Specialization of Uniform for vectors of values. More...
class | UniformBase
| Common base class for all graphics uniforms. More...
struct | VectorFieldData
| A (mathematical) vector is represented as (X,Y,Z) associated with an optional color (R,G,B,alpha) information. More...
class | VectorFieldRepresentation
| Graphic representation of a vector field Each point/location, i.e. More...
struct | VertexData
class | View
| Base graphics view class, which defines the basic interface for all graphics views. More...
class | ViewElement
| Basic SceneElement that wraps a View so that it can be added to the Scene. More...

## Typedefs

typedef SurgSim::DataStructures::Vertices< SurgSim::DataStructures::EmptyData > | PointCloud
typedef SurgSim::DataStructures::Vertices< VectorFieldData > | VectorField
typedef OsgRenderTarget< OsgTexture2d > | OsgRenderTarget2d
typedef OsgRenderTarget< OsgTextureRectangle > | OsgRenderTargetRectangle

## Functions

std::shared_ptr< OsgMaterial > | buildMaterial (const std::string &vertexShaderName, const std::string &fragmentShaderName)
| Utility function to build the material. More...
template<int MOpt>
const osg::Matrix2 | toOsg (const Eigen::Matrix< float, 2, 2, MOpt > &matrix)
| Convert a fixed-size 2x2 matrix of floats to OSG. More...
template<int MOpt>
const osg::Matrix2d | toOsg (const Eigen::Matrix< double, 2, 2, MOpt > &matrix)
| Convert a fixed-size 2x2 matrix of doubles to OSG. More...
const Eigen::Matrix< float, 2, 2, Eigen::RowMajor > | fromOsg (const osg::Matrix2 &matrix)
| Convert from OSG to a 2x2 matrix of floats. More...
const Eigen::Matrix< double, 2, 2, Eigen::RowMajor > | fromOsg (const osg::Matrix2d &matrix)
| Convert from OSG to a 2x2 matrix of doubles. More...
template<int MOpt>
const osg::Matrix3 | toOsg (const Eigen::Matrix< float, 3, 3, MOpt > &matrix)
| Convert a fixed-size 3x3 matrix of floats to OSG. More...
template<int MOpt>
const osg::Matrix3d | toOsg (const Eigen::Matrix< double, 3, 3, MOpt > &matrix)
| Convert a fixed-size 3x3 matrix of doubles to OSG. More...
const Eigen::Matrix< float, 3, 3, Eigen::RowMajor > | fromOsg (const osg::Matrix3 &matrix)
| Convert from OSG to a 3x3 matrix of floats. More...
const Eigen::Matrix< double, 3, 3, Eigen::RowMajor > | fromOsg (const osg::Matrix3d &matrix)
| Convert from OSG to a 3x3 matrix of doubles. More...
template<int MOpt>
const osg::Matrixf | toOsg (const Eigen::Matrix< float, 4, 4, MOpt > &matrix)
| Convert a fixed-size 4x4 matrix of floats to OSG. More...
const Eigen::Matrix< float, 4, 4, Eigen::RowMajor > | fromOsg (const osg::Matrixf &matrix)
| Convert from OSG to a 4x4 matrix of floats. More...
template<int MOpt>
const osg::Matrixd | toOsg (const Eigen::Matrix< double, 4, 4, MOpt > &matrix)
| Convert a fixed-size 4x4 matrix of doubles to OSG. More...
const Eigen::Matrix< double, 4, 4, Eigen::RowMajor > | fromOsg (const osg::Matrixd &matrix)
| Convert from OSG to a 4x4 matrix of doubles. More...
std::shared_ptr< OsgProgram > | loadProgram (const SurgSim::Framework::ApplicationData &data, const std::string &name)
| Utility function, load a program from a set of shader files. More...
std::shared_ptr< OsgProgram > | loadProgram (const SurgSim::Framework::ApplicationData &data, const std::string &vertexShaderName, const std::string &fragmentShaderName)
| Utility function, load a program from a set of shader files. More...
osg::Quat | toOsg (const SurgSim::Math::Quaternionf &quaternion)
| Convert quaternion of floats to OSG. More...
osg::Quat | toOsg (const SurgSim::Math::Quaterniond &quaternion)
| Convert quaternion of doubles to OSG. More...
template<typename T >
Eigen::Quaternion< T > | fromOsg (const osg::Quat &quaternion)
| Convert from OSG to either quaternion of floats or doubles. More...
std::pair< osg::Quat, osg::Vec3f > | toOsg (const SurgSim::Math::RigidTransform3f &transform)
| Convert 3D rigid body (isometric) transform, represented as floats, to OSG. More...
std::pair< osg::Quat, osg::Vec3d > | toOsg (const SurgSim::Math::RigidTransform3d &transform)
| Convert 3D rigid body (isometric) transform, represented as doubles, to OSG. More...
SurgSim::Math::RigidTransform3f | fromOsg (const osg::Quat &rotation, const osg::Vec3f &translation)
| Convert from OSG to 3D rigid body (isometric) transform, represented as floats. More...
SurgSim::Math::RigidTransform3f | fromOsg (const std::pair< osg::Quat, osg::Vec3f > &transform)
| Convert from OSG to 3D rigid body (isometric) transform, represented as floats. More...
SurgSim::Math::RigidTransform3d | fromOsg (const osg::Quat &rotation, const osg::Vec3d &translation)
| Convert from OSG to 3D rigid body (isometric) transform, represented as doubles. More...
SurgSim::Math::RigidTransform3d | fromOsg (const std::pair< osg::Quat, osg::Vec3d > &transform)
| Convert from OSG to 3D rigid body (isometric) transform, represented as doubles. More...
template<typename T >
const T & | toOsg (const T &value)
| Default type conversion to OSG. More...
template<class T >
osg::Uniform::Type | getOsgUniformType ()
| Returns the OSG uniform type enum value for the template parameter type. More...
template<>
osg::Uniform::Type | getOsgUniformType< float > ()
template<>
osg::Uniform::Type | getOsgUniformType< double > ()
template<>
osg::Uniform::Type | getOsgUniformType< int > ()
template<>
osg::Uniform::Type | getOsgUniformType< unsigned int > ()
template<>
osg::Uniform::Type | getOsgUniformType< bool > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Vector2f > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Vector3f > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Vector4f > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Vector2d > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Vector3d > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Vector4d > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Matrix22f > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Matrix33f > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Matrix44f > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Matrix22d > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Matrix33d > ()
template<>
osg::Uniform::Type | getOsgUniformType< SurgSim::Math::Matrix44d > ()
template<>
osg::Uniform::Type | getOsgUniformType< std::shared_ptr< OsgTexture1d > > ()
template<>
osg::Uniform::Type | getOsgUniformType< std::shared_ptr< OsgTexture2d > > ()
template<>
osg::Uniform::Type | getOsgUniformType< std::shared_ptr< OsgTexture3d > > ()
template<>
osg::Uniform::Type | getOsgUniformType< std::shared_ptr< OsgTextureCubeMap > > ()
template<>
osg::Uniform::Type | getOsgUniformType< std::shared_ptr< OsgTextureRectangle > > ()
osg::Vec2f | toOsg (const SurgSim::Math::Vector2f &vector)
| Convert 2D vector of floats to OSG. More...
SurgSim::Math::Vector2f | fromOsg (const osg::Vec2f &vector)
| Convert from OSG to 2D vector of floats. More...
osg::Vec2d | toOsg (const SurgSim::Math::Vector2d &vector)
| Convert 2D vector of doubles to OSG. More...
SurgSim::Math::Vector2d | fromOsg (const osg::Vec2d &vector)
| Convert from OSG to 2D vector of doubles. More...
osg::Vec3f | toOsg (const SurgSim::Math::Vector3f &vector)
| Convert 3D vector of floats to OSG. More...
SurgSim::Math::Vector3f | fromOsg (const osg::Vec3f &vector)
| Convert from OSG to 3D vector of floats. More...
osg::Vec3d | toOsg (SurgSim::Math::Vector3d vector)
| Convert 3D vector of doubles to OSG. More...
SurgSim::Math::Vector3d | fromOsg (const osg::Vec3d &vector)
| Convert from OSG to 3D vector of doubles. More...
osg::Vec4f | toOsg (const SurgSim::Math::Vector4f &vector)
| Convert 4D vector of floats to OSG. More...
SurgSim::Math::Vector4f | fromOsg (const osg::Vec4f &vector)
| Convert from OSG to 4D vector of floats. More...
osg::Vec4d | toOsg (const SurgSim::Math::Vector4d &vector)
| Convert 4D vector of doubles to OSG. More...
SurgSim::Math::Vector4d | fromOsg (const osg::Vec4d &vector)
| Convert from OSG to 4D vector of doubles. More...
osg::TriangleIndexFunctor< TriangleNormalGenerator > | createNormalGenerator (osg::Vec3Array *vertexArray, osg::Vec3Array *normalArray)

## Variables

const int | OsgSupportedTextureCount = 16 + 1

## Typedef Documentation

## OsgRenderTarget2d

typedef OsgRenderTarget<OsgTexture2d> SurgSim::Graphics::OsgRenderTarget2d

Predefine specialized render targets

## OsgRenderTargetRectangle

typedef OsgRenderTarget<OsgTextureRectangle> SurgSim::Graphics::OsgRenderTargetRectangle

Predefine specialized render targets

## PointCloud

typedef SurgSim::DataStructures::Vertices<SurgSim::DataStructures::EmptyData> SurgSim::Graphics::PointCloud

## VectorField

typedef SurgSim::DataStructures::Vertices<VectorFieldData> SurgSim::Graphics::VectorField

## Function Documentation

## buildMaterial()

std::shared_ptr< OsgMaterial > SurgSim::Graphics::buildMaterial | ( | const std::string & | vertexShaderName,
|  | const std::string & | fragmentShaderName
| ) |  |

Utility function to build the material.

Parameters

  vertexShaderName | name of the vertex shader to be used, needs to be available on the path.
  fragmentShaderName | name of the fragment shader to be used, needs to be available on the path.

Returns
  a valid material if all the shaders are found, nullptr otherwise

## createNormalGenerator()

osg::TriangleIndexFunctor< TriangleNormalGenerator > SurgSim::Graphics::createNormalGenerator | ( | osg::Vec3Array * | vertexArray,
|  | osg::Vec3Array * | normalArray
| ) |  |

## fromOsg() [1/17]

SurgSim::Math::Vector2f SurgSim::Graphics::fromOsg | ( | const osg::Vec2f & | vector | ) |

inline

Convert from OSG to 2D vector of floats.

## fromOsg() [2/17]

template<typename T >

Eigen::Quaternion<T> SurgSim::Graphics::fromOsg | ( | const osg::Quat & | quaternion | ) |

inline

Convert from OSG to either quaternion of floats or doubles.

Template Parameters

  T | Value type (float or double)

## fromOsg() [3/17]

SurgSim::Math::RigidTransform3f SurgSim::Graphics::fromOsg | ( | const osg::Quat & | rotation,
|  | const osg::Vec3f & | translation
| ) |  |

inline

Convert from OSG to 3D rigid body (isometric) transform, represented as floats.

## fromOsg() [4/17]

SurgSim::Math::Vector2d SurgSim::Graphics::fromOsg | ( | const osg::Vec2d & | vector | ) |

inline

Convert from OSG to 2D vector of doubles.

## fromOsg() [5/17]

SurgSim::Math::RigidTransform3f SurgSim::Graphics::fromOsg | ( | const std::pair< osg::Quat, osg::Vec3f > & | transform | ) |

inline

Convert from OSG to 3D rigid body (isometric) transform, represented as floats.

## fromOsg() [6/17]

SurgSim::Math::RigidTransform3d SurgSim::Graphics::fromOsg | ( | const osg::Quat & | rotation,
|  | const osg::Vec3d & | translation
| ) |  |

inline

Convert from OSG to 3D rigid body (isometric) transform, represented as doubles.

## fromOsg() [7/17]

SurgSim::Math::RigidTransform3d SurgSim::Graphics::fromOsg | ( | const std::pair< osg::Quat, osg::Vec3d > & | transform | ) |

inline

Convert from OSG to 3D rigid body (isometric) transform, represented as doubles.

## fromOsg() [8/17]

SurgSim::Math::Vector3f SurgSim::Graphics::fromOsg | ( | const osg::Vec3f & | vector | ) |

inline

Convert from OSG to 3D vector of floats.

## fromOsg() [9/17]

const Eigen::Matrix<float, 2, 2, Eigen::RowMajor> SurgSim::Graphics::fromOsg | ( | const osg::Matrix2 & | matrix | ) |

inline

Convert from OSG to a 2x2 matrix of floats.

## fromOsg() [10/17]

const Eigen::Matrix<double, 2, 2, Eigen::RowMajor> SurgSim::Graphics::fromOsg | ( | const osg::Matrix2d & | matrix | ) |

inline

Convert from OSG to a 2x2 matrix of doubles.

## fromOsg() [11/17]

SurgSim::Math::Vector3d SurgSim::Graphics::fromOsg | ( | const osg::Vec3d & | vector | ) |

inline

Convert from OSG to 3D vector of doubles.

## fromOsg() [12/17]

SurgSim::Math::Vector4f SurgSim::Graphics::fromOsg | ( | const osg::Vec4f & | vector | ) |

inline

Convert from OSG to 4D vector of floats.

## fromOsg() [13/17]

const Eigen::Matrix<float, 3, 3, Eigen::RowMajor> SurgSim::Graphics::fromOsg | ( | const osg::Matrix3 & | matrix | ) |

inline

Convert from OSG to a 3x3 matrix of floats.

## fromOsg() [14/17]

const Eigen::Matrix<double, 3, 3, Eigen::RowMajor> SurgSim::Graphics::fromOsg | ( | const osg::Matrix3d & | matrix | ) |

inline

Convert from OSG to a 3x3 matrix of doubles.

## fromOsg() [15/17]

SurgSim::Math::Vector4d SurgSim::Graphics::fromOsg | ( | const osg::Vec4d & | vector | ) |

inline

Convert from OSG to 4D vector of doubles.

## fromOsg() [16/17]

const Eigen::Matrix<float, 4, 4, Eigen::RowMajor> SurgSim::Graphics::fromOsg | ( | const osg::Matrixf & | matrix | ) |

inline

Convert from OSG to a 4x4 matrix of floats.

## fromOsg() [17/17]

const Eigen::Matrix<double, 4, 4, Eigen::RowMajor> SurgSim::Graphics::fromOsg | ( | const osg::Matrixd & | matrix | ) |

inline

Convert from OSG to a 4x4 matrix of doubles.

## getOsgUniformType()

template<class T >

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType | ( |  | ) |

inline

Returns the OSG uniform type enum value for the template parameter type.

This template function is specialized to match each type with an enum value. Any types for which the function is not specialized will return osg::Uniform::UNDEFINED.

Template Parameters

  T | Data type

Returns
  OSG uniform type enum value

## getOsgUniformType< bool >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< bool > | ( |  | ) |

inline

## getOsgUniformType< double >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< double > | ( |  | ) |

inline

## getOsgUniformType< float >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< float > | ( |  | ) |

inline

## getOsgUniformType< int >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< int > | ( |  | ) |

inline

## getOsgUniformType< std::shared_ptr< OsgTexture1d > >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< std::shared_ptr< OsgTexture1d > > | ( |  | ) |

inline

## getOsgUniformType< std::shared_ptr< OsgTexture2d > >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< std::shared_ptr< OsgTexture2d > > | ( |  | ) |

inline

## getOsgUniformType< std::shared_ptr< OsgTexture3d > >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< std::shared_ptr< OsgTexture3d > > | ( |  | ) |

inline

## getOsgUniformType< std::shared_ptr< OsgTextureCubeMap > >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< std::shared_ptr< OsgTextureCubeMap > > | ( |  | ) |

inline

## getOsgUniformType< std::shared_ptr< OsgTextureRectangle > >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< std::shared_ptr< OsgTextureRectangle > > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Matrix22d >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Matrix22d > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Matrix22f >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Matrix22f > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Matrix33d >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Matrix33d > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Matrix33f >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Matrix33f > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Matrix44d >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Matrix44d > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Matrix44f >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Matrix44f > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Vector2d >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Vector2d > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Vector2f >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Vector2f > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Vector3d >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Vector3d > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Vector3f >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Vector3f > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Vector4d >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Vector4d > | ( |  | ) |

inline

## getOsgUniformType< SurgSim::Math::Vector4f >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< SurgSim::Math::Vector4f > | ( |  | ) |

inline

## getOsgUniformType< unsigned int >()

template<>

osg::Uniform::Type SurgSim::Graphics::getOsgUniformType< unsigned int > | ( |  | ) |

inline

## loadProgram() [1/2]

std::shared_ptr< SurgSim::Graphics::OsgProgram > SurgSim::Graphics::loadProgram | ( | const SurgSim::Framework::ApplicationData & | data,
|  | const std::string & | name
| ) |  |

Utility function, load a program from a set of shader files.

Parameters

  data | Application data object
  name | the base name of the shader files to be used '.vert' and '.frag' will be added automatically

Returns
  a valid program if all the shaders are found, nullptr otherwise

## loadProgram() [2/2]

std::shared_ptr< SurgSim::Graphics::OsgProgram > SurgSim::Graphics::loadProgram | ( | const SurgSim::Framework::ApplicationData & | data,
|  | const std::string & | vertexShaderName,
|  | const std::string & | fragmentShaderName
| ) |  |

Utility function, load a program from a set of shader files.

Parameters

  data | Application data object
  vertexShaderName | name of the vertex shader to be used
  fragmentShaderName | name of the fragment shader to be used

Returns
  a valid program if all the shaders are found, nullptr otherwise

## toOsg() [1/17]

template<typename T >

const T& SurgSim::Graphics::toOsg | ( | const T & | value | ) |

Default type conversion to OSG.

Template Parameters

  T | Type

Note
  The input value is just returned. This allows this conversion method to be used with scalar types such as int and float, which are the same in Eigen and OSG.

## toOsg() [2/17]

osg::Quat SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Quaternionf & | quaternion | ) |

inline

Convert quaternion of floats to OSG.

## toOsg() [3/17]

osg::Vec2f SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Vector2f & | vector | ) |

inline

Convert 2D vector of floats to OSG.

## toOsg() [4/17]

std::pair<osg::Quat, osg::Vec3f> SurgSim::Graphics::toOsg | ( | const SurgSim::Math::RigidTransform3f & | transform | ) |

inline

Convert 3D rigid body (isometric) transform, represented as floats, to OSG.

## toOsg() [5/17]

osg::Quat SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Quaterniond & | quaternion | ) |

inline

Convert quaternion of doubles to OSG.

## toOsg() [6/17]

std::pair<osg::Quat, osg::Vec3d> SurgSim::Graphics::toOsg | ( | const SurgSim::Math::RigidTransform3d & | transform | ) |

inline

Convert 3D rigid body (isometric) transform, represented as doubles, to OSG.

## toOsg() [7/17]

osg::Vec2d SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Vector2d & | vector | ) |

inline

Convert 2D vector of doubles to OSG.

## toOsg() [8/17]

template<int MOpt>

const osg::Matrix2 SurgSim::Graphics::toOsg | ( | const Eigen::Matrix< float, 2, 2, MOpt > & | matrix | ) |

inline

Convert a fixed-size 2x2 matrix of floats to OSG.

## toOsg() [9/17]

osg::Vec3f SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Vector3f & | vector | ) |

inline

Convert 3D vector of floats to OSG.

## toOsg() [10/17]

template<int MOpt>

const osg::Matrix2d SurgSim::Graphics::toOsg | ( | const Eigen::Matrix< double, 2, 2, MOpt > & | matrix | ) |

inline

Convert a fixed-size 2x2 matrix of doubles to OSG.

## toOsg() [11/17]

osg::Vec3d SurgSim::Graphics::toOsg | ( | SurgSim::Math::Vector3d | vector | ) |

inline

Convert 3D vector of doubles to OSG.

## toOsg() [12/17]

template<int MOpt>

const osg::Matrix3 SurgSim::Graphics::toOsg | ( | const Eigen::Matrix< float, 3, 3, MOpt > & | matrix | ) |

inline

Convert a fixed-size 3x3 matrix of floats to OSG.

## toOsg() [13/17]

osg::Vec4f SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Vector4f & | vector | ) |

inline

Convert 4D vector of floats to OSG.

## toOsg() [14/17]

template<int MOpt>

const osg::Matrix3d SurgSim::Graphics::toOsg | ( | const Eigen::Matrix< double, 3, 3, MOpt > & | matrix | ) |

inline

Convert a fixed-size 3x3 matrix of doubles to OSG.

## toOsg() [15/17]

osg::Vec4d SurgSim::Graphics::toOsg | ( | const SurgSim::Math::Vector4d & | vector | ) |

inline

Convert 4D vector of doubles to OSG.

## toOsg() [16/17]

template<int MOpt>

const osg::Matrixf SurgSim::Graphics::toOsg | ( | const Eigen::Matrix< float, 4, 4, MOpt > & | matrix | ) |

inline

Convert a fixed-size 4x4 matrix of floats to OSG.

## toOsg() [17/17]

template<int MOpt>

const osg::Matrixd SurgSim::Graphics::toOsg | ( | const Eigen::Matrix< double, 4, 4, MOpt > & | matrix | ) |

inline

Convert a fixed-size 4x4 matrix of doubles to OSG.

## Variable Documentation

## OsgSupportedTextureCount

const int SurgSim::Graphics::OsgSupportedTextureCount = 16 + 1