|
Base graphics view class, which defines the basic interface for all graphics views. More...
#include <SurgSim/Graphics/View.h>
Public Types | |
| enum | StereoMode { STEREO_MODE_NONE = -1, STEREO_MODE_QUAD_BUFFER, STEREO_MODE_ANAGLYPHIC, STEREO_MODE_HORIZONTAL_SPLIT, STEREO_MODE_VERTICAL_SPLIT, STEREO_MODE_LEFT_EYE, STEREO_MODE_RIGHT_EYE, STEREO_MODE_HORIZONTAL_INTERLACE, STEREO_MODE_VERTICAL_INTERLACE, STEREO_MODE_CHECKERBOARD, STEREO_MODE_COUNT } |
| enum | DisplayType { DISPLAY_TYPE_MONITOR, DISPLAY_TYPE_HMD, DISPLAY_TYPE_COUNT } |
Public Types inherited from SurgSim::Framework::Component | |
| typedef SurgSim::Framework::ObjectFactory1< SurgSim::Framework::Component, std::string > | FactoryType |
Public Types inherited from SurgSim::Framework::Accessible | |
| typedef std::function< boost::any(void)> | GetterType |
| typedef std::function< void(boost::any)> | SetterType |
| typedef std::function< YAML::Node(void)> | EncoderType |
| typedef std::function< void(const YAML::Node *)> | DecoderType |
Public Member Functions | |
| View (const std::string &name) | |
| Constructor. More... | |
| virtual void | setPosition (const std::array< int, 2 > &position)=0 |
| Set the position of this view. More... | |
| virtual std::array< int, 2 > | getPosition () const =0 |
| Get the position of this view. More... | |
| virtual void | setDimensions (const std::array< int, 2 > &dimensions)=0 |
| Set the dimensions of this view. More... | |
| virtual std::array< int, 2 > | getDimensions () const =0 |
| Get the dimensions of this view. More... | |
| virtual void | setWindowBorderEnabled (bool enabled)=0 |
| Sets whether the view window has a border. More... | |
| virtual bool | isWindowBorderEnabled () const =0 |
| Returns whether the view window has a border. More... | |
| virtual void | setCamera (std::shared_ptr< SurgSim::Framework::Component > camera) |
| Sets the camera which provides the viewpoint in the scene. More... | |
| std::shared_ptr< Camera > | getCamera () const |
| Gets the camera which provides the viewpoint in the scene. More... | |
| virtual void | update (double dt)=0 |
| Updates the view. More... | |
| virtual bool | isStereo () const |
| virtual void | setStereoMode (int val) |
| Set the mode that this view should use for stereo display, see StereMode for all the modes. More... | |
| int | getStereoMode () const |
| void | setDisplayType (int type) |
| Set the kind of display. More... | |
| int | getDisplayType () const |
| void | setFullScreen (bool val) |
| Request the display to use the whole screen. More... | |
| bool | isFullScreen () const |
| void | setTargetScreen (int val) |
| Request a certain screen to be used for this view. More... | |
| int | getTargetScreen () const |
| void | setEyeSeparation (double val) |
| Set the distance between the users eyes, this is necessary to calculate the correct projection matrices for stereo rendering. More... | |
| double | getEyeSeparation () const |
| void | setScreenDistance (double val) |
| Set the distance of the user from the screen, this is necessary to calculate the correct projection matrices for stereo rendering. More... | |
| double | getScreenDistance () const |
| void | setScreenWidth (double val) |
| Set the width of the screen, this is necessary to calculate the correct projection matrices for stereo rendering. More... | |
| double | getScreenWidth () const |
| void | setScreenHeight (double val) |
| Set the height of the screen, this is necessary to calculate the correct projection matrices for stereo rendering. More... | |
| double | getScreenHeight () const |
Public Member Functions inherited from SurgSim::Framework::Component | |
| Component (const std::string &name) | |
| Constructor. More... | |
| virtual | ~Component () |
| Destructor. More... | |
| std::string | getName () const |
| Gets component name. More... | |
| void | setName (const std::string &name) |
| Sets the name of component. More... | |
| boost::uuids::uuid | getUuid () const |
| Gets the id of the component. More... | |
| bool | isInitialized () const |
| bool | initialize (const std::weak_ptr< Runtime > &runtime) |
| Initialize this component, this needs to be called before wakeUp() can be called. More... | |
| bool | isAwake () const |
| bool | wakeUp () |
| Wakeup this component, this will be called when the component is inserted into the ComponentManager that is responsible for handling this component. More... | |
| void | setScene (std::weak_ptr< Scene > scene) |
| Sets the scene. More... | |
| std::shared_ptr< Scene > | getScene () |
| Gets the scene. More... | |
| void | setSceneElement (std::weak_ptr< SceneElement > sceneElement) |
| Sets the scene element. More... | |
| std::shared_ptr< SceneElement > | getSceneElement () |
| Gets the scene element. More... | |
| std::shared_ptr< const SceneElement > | getSceneElement () const |
| Gets the scene element, constant version. More... | |
| std::shared_ptr< Runtime > | getRuntime () const |
| Get the runtime which contains this component. More... | |
| virtual std::string | getClassName () const |
| The class name for this class, this being the base class it should return SurgSim::Framework::Component but this would make missing implemenentations of this hard to catch, therefore this calls SURGSIM_FAILURE. More... | |
| std::shared_ptr< Component > | getSharedPtr () |
| Gets a shared pointer to this component. More... | |
| virtual bool | doWakeUp ()=0 |
| Interface to be implemented by derived classes. More... | |
| bool | isActive () const |
| virtual void | setLocalActive (bool val) |
| Set the component's active state. More... | |
| bool | isLocalActive () const |
Public Member Functions inherited from SurgSim::Framework::Accessible | |
| Accessible () | |
| Default Constructor. More... | |
| ~Accessible () | |
| Destructor. More... | |
| template<class T > | |
| T | getValue (const std::string &name) const |
| Retrieves the value with the name by executing the getter if it is found and tries to convert it to the given type. More... | |
| boost::any | getValue (const std::string &name) const |
| Retrieves the value with the name by executing the getter if it is found. More... | |
| template<class T > | |
| bool | getValue (const std::string &name, T *value) const |
| Retrieves the value with the name by executing the getter if it is found, and converts it to the type of the output parameter. More... | |
| void | setValue (const std::string &name, const boost::any &value) |
| Sets a value of a property that has setter. More... | |
| bool | isReadable (const std::string &name) const |
| Check whether a property is readable. More... | |
| bool | isWriteable (const std::string &name) const |
| Check whether a property is writable. More... | |
| void | setGetter (const std::string &name, GetterType func) |
| Sets a getter for a given property. More... | |
| void | setSetter (const std::string &name, SetterType func) |
| Sets a setter for a given property. More... | |
| void | setAccessors (const std::string &name, GetterType getter, SetterType setter) |
| Sets the accessors getter and setter in one function. More... | |
| void | removeAccessors (const std::string &name) |
| Removes all the accessors (getter and setter) for a given property. More... | |
| void | forwardProperty (const std::string &name, const Accessible &target, const std::string &targetProperty) |
| Adds a property with the given name that uses the targets accessors, in effect forwarding the value to the target. More... | |
| void | setSerializable (const std::string &name, EncoderType encoder, DecoderType decoder) |
| Sets the functions used to convert data from and to a YAML::Node. More... | |
| YAML::Node | encode () const |
| Encode this Accessible to a YAML::Node. More... | |
| void | decode (const YAML::Node &node, const std::vector< std::string > &ignoredProperties=std::vector< std::string >()) |
| Decode this Accessible from a YAML::Node, will throw an exception if the data type cannot be converted. More... | |
| template<> | |
| boost::any | getValue (const std::string &name) const |
Private Member Functions | |
| virtual bool | doInitialize () override |
| Interface to be implemented by derived classes. More... | |
Private Attributes | |
| std::shared_ptr< Camera > | m_camera |
| Camera whose image will be shown in this view. More... | |
| int | m_stereoMode |
| The stereo mode, that is being used. More... | |
| int | m_displayType |
| The requested display type. More... | |
| int | m_targetScreen |
| Index of the screen to be used. More... | |
| bool | m_isFullscreen |
| Whether to go fullscreen. More... | |
| double | m_eyeSeparation |
| Distance between eypoints in m. More... | |
| double | m_screenDistance |
| Distance from user to screen in m. More... | |
| double | m_screenWidth |
| Width of screen in m. More... | |
| double | m_screenHeight |
| Height of screen in m. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from SurgSim::Framework::Component | |
| static FactoryType & | getFactory () |
Protected Member Functions inherited from SurgSim::Framework::Component | |
| virtual std::shared_ptr< PoseComponent > | getPoseComponent () |
| Get the PoseComponent for this component. More... | |
| virtual std::shared_ptr< const PoseComponent > | getPoseComponent () const |
| Get the PoseComponent for this component, constant access. More... | |
Base graphics view class, which defines the basic interface for all graphics views.
A Graphics::View provides a visualization of the scene to the user.
A Graphics::Camera controls the viewpoint of this View.
|
explicit |
Constructor.
| name | Name of the view |
|
overrideprivatevirtual |
Interface to be implemented by derived classes.
Implements SurgSim::Framework::Component.
Reimplemented in SurgSim::Graphics::OsgView.
| std::shared_ptr< Camera > SurgSim::Graphics::View::getCamera | ( | ) | const |
Gets the camera which provides the viewpoint in the scene.
|
pure virtual |
Get the dimensions of this view.
Implemented in SurgSim::Graphics::OsgView.
| int SurgSim::Graphics::View::getDisplayType | ( | ) | const |
| double SurgSim::Graphics::View::getEyeSeparation | ( | ) | const |
|
pure virtual |
Get the position of this view.
Implemented in SurgSim::Graphics::OsgView.
| double SurgSim::Graphics::View::getScreenDistance | ( | ) | const |
| double SurgSim::Graphics::View::getScreenHeight | ( | ) | const |
| double SurgSim::Graphics::View::getScreenWidth | ( | ) | const |
| int SurgSim::Graphics::View::getStereoMode | ( | ) | const |
| int SurgSim::Graphics::View::getTargetScreen | ( | ) | const |
| bool SurgSim::Graphics::View::isFullScreen | ( | ) | const |
|
virtual |
|
pure virtual |
Returns whether the view window has a border.
Implemented in SurgSim::Graphics::OsgView.
|
virtual |
Sets the camera which provides the viewpoint in the scene.
| camera | Camera whose image will be shown in this view |
Reimplemented in SurgSim::Graphics::OsgView.
|
pure virtual |
Set the dimensions of this view.
| dimensions | Dimensions on the screen (in pixels) |
Implemented in SurgSim::Graphics::OsgView.
| void SurgSim::Graphics::View::setDisplayType | ( | int | type | ) |
Set the kind of display.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called |
| type | The type of display |
| void SurgSim::Graphics::View::setEyeSeparation | ( | double | val | ) |
Set the distance between the users eyes, this is necessary to calculate the correct projection matrices for stereo rendering.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | The distance between the eyes in m. |
| void SurgSim::Graphics::View::setFullScreen | ( | bool | val | ) |
Request the display to use the whole screen.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | If true the display will use up the whole screen, ignoring the dimension and location settings |
|
pure virtual |
Set the position of this view.
| position | Position on the screen (in pixels) |
Implemented in SurgSim::Graphics::OsgView.
| void SurgSim::Graphics::View::setScreenDistance | ( | double | val | ) |
Set the distance of the user from the screen, this is necessary to calculate the correct projection matrices for stereo rendering.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | The distance from the user to the screen in m. |
| void SurgSim::Graphics::View::setScreenHeight | ( | double | val | ) |
Set the height of the screen, this is necessary to calculate the correct projection matrices for stereo rendering.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | The height of the screen used, in m. |
| void SurgSim::Graphics::View::setScreenWidth | ( | double | val | ) |
Set the width of the screen, this is necessary to calculate the correct projection matrices for stereo rendering.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | The width of the screen used, in m. |
|
virtual |
Set the mode that this view should use for stereo display, see StereMode for all the modes.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | The actual mode. |
| void SurgSim::Graphics::View::setTargetScreen | ( | int | val | ) |
Request a certain screen to be used for this view.
| SurgSim::Framework::AssertionFailure | if used after initialize has been called. |
| val | The number of the screen (base 0) that should be used for this view. |
|
pure virtual |
Sets whether the view window has a border.
| enabled | True to enable the border around the window; false for no border |
Implemented in SurgSim::Graphics::OsgView.
|
pure virtual |
Updates the view.
| dt | The time in seconds of the preceding timestep. |
Implemented in SurgSim::Graphics::OsgView.
|
private |
Camera whose image will be shown in this view.
|
private |
The requested display type.
|
private |
Distance between eypoints in m.
|
private |
Whether to go fullscreen.
|
private |
Distance from user to screen in m.
|
private |
Height of screen in m.
|
private |
Width of screen in m.
|
private |
The stereo mode, that is being used.
|
private |
Index of the screen to be used.
1.8.11