opensurgsim
CurveRepresentation.h
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 
19 #include "SurgSim/DataStructures/Vertices.h"
20 #include "SurgSim/Framework/LockedContainer.h"
21 #include "SurgSim/Graphics/Representation.h"
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
virtual void setTension(double tension)=0
Sets the tension (tau) parameter of the Catmull Rom interpolation, needs to be between 0...
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
CurveRepresentation(const std::string &name)
Constructor.
Definition: CurveRepresentation.cpp:27
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
This implements a graphical object to draw an interpolated curve, it accepts a series of control poin...
Definition: CurveRepresentation.h:34
virtual void setSubdivisions(size_t num)=0
Sets the number of intermediate points the get generated between each two control points...
virtual void setColor(const SurgSim::Math::Vector4d &color)=0
Sets the color for the curve.
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
virtual void setWidth(double width)=0
Sets the line width to be used for drawing this curve.
virtual void setAntiAliasing(bool val)=0
Sets up whether to use anti aliasing on the curve or not.
virtual double getTension() const =0
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:40
virtual size_t getSubdivisions() const =0
virtual double getWidth() const =0
Framework::LockedContainer< DataStructures::VerticesPlain > m_locker
Container control points, threadsafe access when updating.
Definition: CurveRepresentation.h:92
virtual Math::Vector4d getColor() const =0
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51
virtual bool isAntiAliasing() const =0