ScreenSpaceQuadRepresentation.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_GRAPHICS_SCREENSPACEQUADREPRESENTATION_H
#define SURGSIM_GRAPHICS_SCREENSPACEQUADREPRESENTATION_H
#include "SurgSim/DataStructures/DataStructuresConvert.h"
#include "SurgSim/Framework/Macros.h"
#include "SurgSim/Framework/FrameworkConvert.h"
#include "SurgSim/Graphics/Representation.h"
#include <array>
namespace SurgSim
{
namespace Graphics
{
class View;
class Texture;
class ScreenSpaceQuadRepresentation : public virtual Representation
{
public:
explicit ScreenSpaceQuadRepresentation(const std::string name) : Representation(name)
{
}
~ScreenSpaceQuadRepresentation()
{
}
virtual void setLocation(double x, double y) = 0;
virtual void getLocation(double* x, double* y) = 0;
virtual void setSize(double width, double height) = 0;
virtual void getSize(double* width, double* height) const = 0;
virtual bool setTexture(std::shared_ptr<Texture> texture) = 0;
SurgSim::Math::RigidTransform3d getPose() const override
{
return getLocalPose();
}
};
}; // Graphics
}; // SurgSim
#endif
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
DataStructuresConvert.h
SurgSim::Graphics::ScreenSpaceQuadRepresentation::~ScreenSpaceQuadRepresentation
~ScreenSpaceQuadRepresentation()
Definition: ScreenSpaceQuadRepresentation.h:46
Representation.h
SurgSim::Graphics::ScreenSpaceQuadRepresentation::getSize
virtual void getSize(double *width, double *height) const =0
Gets the size of the quad.
SurgSim::Graphics::ScreenSpaceQuadRepresentation::setTexture
virtual bool setTexture(std::shared_ptr< Texture > texture)=0
Sets a Texture for this quad, this should replace a current texture, this is a convenience function a...
SurgSim::Graphics::ScreenSpaceQuadRepresentation::ScreenSpaceQuadRepresentation
ScreenSpaceQuadRepresentation(const std::string name)
Constructor.
Definition: ScreenSpaceQuadRepresentation.h:42
SurgSim::Graphics::ScreenSpaceQuadRepresentation
A quad to display on the screen in screen space coordinates, use setPose() to set the position but x...
Definition: ScreenSpaceQuadRepresentation.h:36
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
SurgSim::Graphics::ScreenSpaceQuadRepresentation::setSize
virtual void setSize(double width, double height)=0
Sets the size for the quad in screen coordinates.
Macros.h
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
SurgSim::Graphics::ScreenSpaceQuadRepresentation::getLocation
virtual void getLocation(double *x, double *y)=0
Gets the location in screen space.
FrameworkConvert.h
SurgSim::Graphics::ScreenSpaceQuadRepresentation::getPose
SurgSim::Math::RigidTransform3d getPose() const override
Definition: ScreenSpaceQuadRepresentation.h:77
SurgSim::Framework::Representation::getLocalPose
virtual SurgSim::Math::RigidTransform3d getLocalPose() const
Get the pose of the representation with respect to the Scene Element.
Definition: Representation.cpp:67
SurgSim::Graphics::ScreenSpaceQuadRepresentation::setLocation
virtual void setLocation(double x, double y)=0
Sets the location in screen space.