16 #ifndef SURGSIM_GRAPHICS_OSGSCREENSPACEQUADREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGSCREENSPACEQUADREPRESENTATION_H
29 #pragma warning(disable:4250)
47 class OsgTextureRectangle;
71 virtual void setSize(
double width,
double height)
override;
76 virtual void getSize(
double* width,
double* height)
const override;
83 virtual bool setTexture(std::shared_ptr<Texture> texture)
override;
90 bool setTexture(std::shared_ptr<OsgTexture2d> texture);
97 bool setTexture(std::shared_ptr<OsgTextureRectangle> texture);
100 virtual void doUpdate(
double dt)
override;
132 bool replaceUniform(
const std::string& name, std::shared_ptr<SurgSim::Graphics::UniformBase> newUniform);
148 const std::string& vertexShaderName,
149 const std::string& fragmentShaderName);
155 #if defined(_MSC_VER)
int m_displayHeight
Definition: OsgScreenSpaceQuadRepresentation.h:121
Definition: DriveElementFromInputBehavior.cpp:27
osg::Vec3 m_scale
Size of the quad.
Definition: OsgScreenSpaceQuadRepresentation.h:116
SurgSim::DataStructures::OptionalValue< int > m_texureType
Indicate which type of texture is currently being used.
Definition: OsgScreenSpaceQuadRepresentation.h:141
osg::ref_ptr< osg::Geometry > m_geometry
Local geometry pointer.
Definition: OsgScreenSpaceQuadRepresentation.h:110
OsgScreenSpaceQuadRepresentation(const std::string &name)
Constructor.
Definition: OsgScreenSpaceQuadRepresentation.cpp:56
int m_displayWidth
Definition: OsgScreenSpaceQuadRepresentation.h:120
virtual void getSize(double *width, double *height) const override
Gets the size of the quad.
Definition: OsgScreenSpaceQuadRepresentation.cpp:111
virtual bool doInitialize() override
Interface to be implemented by derived classes.
Definition: OsgScreenSpaceQuadRepresentation.cpp:212
std::shared_ptr< OsgUniform< std::shared_ptr< OsgTexture2d > > > m_textureUniform
Uniform to carry the power of two texture, "texture".
Definition: OsgScreenSpaceQuadRepresentation.h:135
bool replaceUniform(const std::string &name, std::shared_ptr< SurgSim::Graphics::UniformBase > newUniform)
Replace a uniform in the material, will create the material if necessary.
osg::ref_ptr< osg::Projection > m_projection
Projection matrix, needs to be updated when the view is changed.
Definition: OsgScreenSpaceQuadRepresentation.h:113
std::shared_ptr< OsgUniform< std::shared_ptr< OsgTextureRectangle > > > m_rectangleTextureUniform
Uniform to carry the rectangle texture "texture".
Definition: OsgScreenSpaceQuadRepresentation.h:138
virtual void setLocation(double x, double y)
Sets the location in screen space.
Definition: OsgScreenSpaceQuadRepresentation.cpp:189
osg::ref_ptr< osg::Geode > m_geode
Local geode to contain geometry.
Definition: OsgScreenSpaceQuadRepresentation.h:107
virtual bool setTexture(std::shared_ptr< Texture > texture) override
Sets a Texture for this quad, this should replace a current texture, this is a convenience function a...
Definition: OsgScreenSpaceQuadRepresentation.cpp:118
A quad to display on the screen in screen space coordinates, use setPose() to set the position but x...
Definition: ScreenSpaceQuadRepresentation.h:31
virtual void doUpdate(double dt) override
Definition: OsgScreenSpaceQuadRepresentation.cpp:206
virtual void getLocation(double *x, double *y)
Gets the location in screen space.
Definition: OsgScreenSpaceQuadRepresentation.cpp:196
virtual void setSize(double width, double height) override
Sets the size for the quad in screen coordinates.
Definition: OsgScreenSpaceQuadRepresentation.cpp:104
Definition: OsgLight.h:33
~OsgScreenSpaceQuadRepresentation()
Definition: OsgScreenSpaceQuadRepresentation.cpp:99
std::shared_ptr< OsgMaterial > buildMaterial(const std::string &vertexShaderName, const std::string &fragmentShaderName)
Utility function to build the material.
Definition: OsgScreenSpaceQuadRepresentation.cpp:244
void setTextureCoordinates(float left, float bottom, float right, float top)
Sets texture coordinates for the quad.
Definition: OsgScreenSpaceQuadRepresentation.cpp:179
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:42
Implements the ScreenSpaceQuadRepresentation, provides the uniform 'texture' for the texture that it ...
Definition: OsgScreenSpaceQuadRepresentation.h:52