16 #ifndef SURGSIM_GRAPHICS_CAMERA_H 17 #define SURGSIM_GRAPHICS_CAMERA_H 65 explicit Camera(
const std::string& name);
94 virtual bool setRenderGroups(
const std::vector<std::shared_ptr<Group>>& groups);
120 virtual void setViewport(
int x,
int y,
int width,
int height) = 0;
124 virtual void getViewport(
int* x,
int* y,
int* width,
int* height)
const = 0;
144 double left,
double right,
145 double bottom,
double top,
146 double near,
double far) = 0;
158 virtual bool setRenderTarget(std::shared_ptr<RenderTarget> renderTarget) = 0;
224 #endif // SURGSIM_GRAPHICS_CAMERA_H virtual std::array< double, 2 > getViewportSize() const =0
Gets the dimensions of the viewport.
Definition: CompoundShapeToGraphics.cpp:29
std::vector< std::shared_ptr< Group > > getRenderGroups() const
Gets all groups of representations that will be seen by this camera.
Definition: Camera.cpp:138
virtual void setOrthogonalProjection(double left, double right, double bottom, double top, double near, double far)=0
Set the projection matrix with the appropriate orthogonal projection parameters.
Camera(const std::string &name)
Constructor.
Definition: Camera.cpp:26
virtual const SurgSim::Math::Matrix44d & getProjectionMatrix() const =0
Gets the projection matrix of the camera.
virtual SurgSim::Math::Matrix44d getViewMatrix() const =0
Gets the view matrix of the camera.
std::vector< std::string > m_renderGroupReferences
The names of the groups that the camera wants to use for rendering, the graphics manager will actuall...
Definition: Camera.h:217
virtual SurgSim::Math::Matrix44d getInverseProjectionMatrix() const =0
Gets the inverse projection matrix of the camera.
virtual bool setRenderGroups(const std::vector< std::shared_ptr< Group >> &groups)
Sets the representation groups that will be seen by this camera.
Definition: Camera.cpp:110
void addRenderGroupReference(const std::string &name)
Adds a single group reference to the collection of group references for rendering.
Definition: Camera.cpp:95
virtual SurgSim::Math::Matrix44d getInverseViewMatrix() const =0
Gets the inverse view matrix of the camera.
virtual void setAmbientColor(const SurgSim::Math::Vector4d &color)=0
Sets a value for the ambient lighting term, this can add light to the scene when there is no lighting...
std::vector< std::shared_ptr< Group > > m_renderGroups
Group of representations that this camera sees Only the representations in this group will be rendere...
Definition: Camera.h:213
virtual bool setRenderGroup(std::shared_ptr< Group > group)
Sets the group of representations that will be seen by this camera.
Definition: Camera.cpp:104
std::array< int, 4 > getViewport() const
Definition: Camera.cpp:170
bool addGroupReference(const std::string &name) override
Add a reference to a group, this will eventual add this representation to the group with the the same...
Definition: Camera.cpp:143
Eigen::Matrix< double, 4, 4, Eigen::RowMajor > Matrix44d
A 4x4 matrix of doubles.
Definition: Matrix.h:55
Base graphics camera class, which defines the basic interface for all graphics cameras.
Definition: Camera.h:51
virtual bool isMainCamera()=0
void setRenderGroupReferences(const std::vector< std::string > &names)
Set the collections of group references that this camera wants to use for rendering.
Definition: Camera.cpp:80
std::vector< std::string > getRenderGroupReferences() const
Gets the collection of names of render groups used for rendering.
Definition: Camera.cpp:90
virtual void setPerspectiveProjection(double fovy, double aspect, double near, double far)=0
Set the projection matrix with the appropriate perspective projection parameters. ...
virtual bool setRenderTarget(std::shared_ptr< RenderTarget > renderTarget)=0
Sets RenderTarget for the current camera, enables the camera to render to off-screen textures...
virtual void setProjectionMatrix(const SurgSim::Math::Matrix44d &matrix)=0
Sets the projection matrix of the camera.
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
Definitions of small fixed-size square matrix types.
Definitions of small fixed-size vector types.
virtual void setViewport(int x, int y, int width, int height)=0
Sets the viewport size for this camera.
virtual SurgSim::Math::Vector4d getAmbientColor()=0
virtual void setViewportSize(std::array< double, 2 > dimensions)=0
Sets the width and height of the viewport.
virtual bool addRenderGroup(std::shared_ptr< Group > group)
Add a group of representations that will seen by this camera.
Definition: Camera.cpp:125
virtual void setRenderOrder(RenderOrder order, int value)=0
Determine when this camera will render.
virtual std::shared_ptr< RenderTarget > getRenderTarget() const =0
Gets RenderTarget that is currently being used by the camera.
Eigen::Matrix< double, 4, 1 > Vector4d
A 4D vector of doubles.
Definition: Vector.h:61
RenderOrder
Definition: Camera.h:55
bool doInitialize() override
Interface to be implemented by derived classes.
Definition: Camera.cpp:177
void setRenderGroupReference(const std::string &name)
Set the group reference that this camera wants to use as the group for rendering. ...
Definition: Camera.cpp:74
virtual void setMainCamera(bool val)=0
Marks the camera as a main view camera, this means that view dependent passes should follow this came...