CurveRepresentation.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_GRAPHICS_CURVEREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_CURVEREPRESENTATION_H
18 
22 
23 namespace SurgSim
24 {
25 
26 namespace Graphics
27 {
28 
34 class CurveRepresentation : public virtual Representation
35 {
36 public:
39  explicit CurveRepresentation(const std::string& name);
40 
43  virtual void setSubdivisions(size_t num) = 0;
44 
46  virtual size_t getSubdivisions() const = 0;
47 
50  virtual void setTension(double tension) = 0;
51 
53  virtual double getTension() const = 0;
54 
57  virtual void setColor(const SurgSim::Math::Vector4d& color) = 0;
58 
60  virtual Math::Vector4d getColor() const = 0;
61 
64  virtual void setWidth(double width) = 0;
65 
67  virtual double getWidth() const = 0;
68 
71  virtual void setAntiAliasing(bool val) = 0;
72 
74  virtual bool isAntiAliasing() const = 0;
75 
81 
88 
89 protected:
90 
93 
94 };
95 
96 }
97 }
98 
99 #endif
SurgSim::Graphics::CurveRepresentation::setColor
virtual void setColor(const SurgSim::Math::Vector4d &color)=0
Sets the color for the curve.
SurgSim::Graphics::CurveRepresentation::getSubdivisions
virtual size_t getSubdivisions() const =0
SurgSim::Graphics::CurveRepresentation::updateControlPoints
void updateControlPoints(const DataStructures::VerticesPlain &vertices)
Updates the control points for this class, this will cause a new curve to be generated on the next up...
Definition: CurveRepresentation.cpp:44
SurgSim::DataStructures::Vertices
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:52
Vertices.h
LockedContainer.h
SurgSim::Graphics::CurveRepresentation::setWidth
virtual void setWidth(double width)=0
Sets the line width to be used for drawing this curve.
SurgSim::Graphics::CurveRepresentation::setAntiAliasing
virtual void setAntiAliasing(bool val)=0
Sets up whether to use anti aliasing on the curve or not.
SurgSim::Graphics::CurveRepresentation::getTension
virtual double getTension() const =0
SurgSim::Graphics::CurveRepresentation::CurveRepresentation
CurveRepresentation(const std::string &name)
Constructor.
Definition: CurveRepresentation.cpp:27
Representation.h
SurgSim::Graphics::CurveRepresentation::setSubdivisions
virtual void setSubdivisions(size_t num)=0
Sets the number of intermediate points the get generated between each two control points.
SurgSim
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::Graphics::CurveRepresentation::getColor
virtual Math::Vector4d getColor() const =0
SurgSim::Graphics::CurveRepresentation::isAntiAliasing
virtual bool isAntiAliasing() const =0
SurgSim::Framework::LockedContainer
A simple thread-safe data container that can support multiple writers and readers.
Definition: LockedContainer.h:55
SurgSim::Graphics::CurveRepresentation::getWidth
virtual double getWidth() const =0
SurgSim::Graphics::CurveRepresentation::setTension
virtual void setTension(double tension)=0
Sets the tension (tau) parameter of the Catmull Rom interpolation, needs to be between 0....
SurgSim::Math::Vector4d
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:40
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Graphics::CurveRepresentation::m_locker
Framework::LockedContainer< DataStructures::VerticesPlain > m_locker
Container control points, threadsafe access when updating.
Definition: CurveRepresentation.h:92
SurgSim::Graphics::CurveRepresentation
This implements a graphical object to draw an interpolated curve, it accepts a series of control poin...
Definition: CurveRepresentation.h:35