TextRepresentation.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_TEXTREPRESENTATION_H
#define SURGSIM_GRAPHICS_TEXTREPRESENTATION_H
#include <memory>
#include "SurgSim/Graphics/Representation.h"
#include "SurgSim/DataStructures/OptionalValue.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace Framework
{
class Asset;
}
namespace Graphics
{
class Font;
class TextRepresentation : public virtual Representation
{
public:
explicit TextRepresentation(const std::string name);
virtual ~TextRepresentation() {}
virtual void loadFont(const std::string& fileName) = 0;
virtual void setFont(std::shared_ptr<SurgSim::Framework::Asset> font) = 0;
virtual std::shared_ptr<Font> getFont() const = 0;
virtual void setLocation(double x, double y) = 0;
virtual void getLocation(double* x, double* y) const = 0;
virtual void setText(const std::string& text) = 0;
virtual std::string getText() const = 0;
virtual void setMaximumWidth(double width) = 0;
virtual double getMaximumWidth() = 0;
virtual void setFontSize(double size) = 0;
virtual double getFontSize() const = 0;
virtual void setColor(SurgSim::Math::Vector4d color) = 0;
virtual SurgSim::Math::Vector4d getColor() const = 0;
virtual void setUseScreenSpace(bool value) = 0;
virtual bool isUsingScreenSpace() const = 0;
virtual void setDrawBackground(bool value) = 0;
virtual bool isDrawingBackground() const = 0;
virtual void setBackgroundColor(Math::Vector4d color) = 0;
virtual Math::Vector4d getBackgroundColor() = 0;
virtual void setBackgroundMargin(double margin) = 0;
virtual double getBackgroundMargin() const = 0;
protected:
virtual void setOptionalMaximumWidth(SurgSim::DataStructures::OptionalValue<double> width) = 0;
virtual SurgSim::DataStructures::OptionalValue<double> getOptionalMaximumWidth() = 0;
};
}; // Graphics
}; // SurgSim
#endif // SURGSIM_GRAPHICS_TEXTREPRESENTATION_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::OptionalValue< double >
Representation.h
SurgSim::Graphics::TextRepresentation
A text to be displayed on the screen in screen space coordinates, use setPose() to set the position b...
Definition: TextRepresentation.h:39
SurgSim::Graphics::TextRepresentation::~TextRepresentation
virtual ~TextRepresentation()
Destructor.
Definition: TextRepresentation.h:47
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
Vector.h
Definitions of small fixed-size vector types.
OptionalValue.h
SurgSim::Math::Vector4d
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61