gepetto-viewer 6.1.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
gepetto::viewer::WindowManager Class Reference

#include <gepetto/viewer/window-manager.h>

Inheritance diagram for gepetto::viewer::WindowManager:
Collaboration diagram for gepetto::viewer::WindowManager:

Public Types

enum  TextAlignment {
  TOP = 0 , CENTER = 1 , BOTTOM = 2 , RIGHT = 0 ,
  LEFT = 2
}
Public Types inherited from gepetto::viewer::Properties
typedef std::map< std::string, Wrapper > PropertyMap_t

Public Member Functions

virtual WindowManagerPtr_t clone (void) const
WindowManagerPtr_t self (void) const
virtual bool addNode (NodePtr_t graphical_object_ptr)
virtual GroupNodePtr_t getScene () const
virtual bool done ()
virtual bool frame ()
virtual bool run ()
virtual void setWindowDimension (const osgVector2 &size)
virtual void setWindowPosition (const osgVector2 &position)
osgVector2 getWindowPosition () const
osgVector2 getWindowDimension () const
std::string getText (TextAlignment verticalPos, TextAlignment horizontalPos) const
void setText (TextAlignment verticalPos, TextAlignment horizontalPos, const std::string &text, float size=20)
::osgViewer::ViewerRefPtr getViewerClone ()
virtual ~WindowManager ()
void captureFrame (const std::string &filename)
void startCapture (const std::string &filename, const std::string &extension)
void stopCapture ()
bool writeNodeFile (const std::string &filename)
void setBackgroundColor1 (const osg::Vec4 &color)
void setBackgroundColor2 (const osg::Vec4 &color)
void getCameraTransform (osg::Vec3d &pos, osg::Quat &rot)
void setCameraTransform (const osg::Vec3d &pos, const osg::Quat &rot)
void attachCameraToNode (NodePtr_t node)
void detachCamera ()
Public Member Functions inherited from gepetto::viewer::GroupNode
GroupNodePtr_t clone (void) const
GroupNodePtr_t self (void) const
virtual bool addChild (NodePtr_t child_ptr)
virtual bool removeChild (NodePtr_t child_ptr)
virtual bool hasChild (NodePtr_t child_ptr) const
virtual void removeAllChildren ()
virtual size_t getNumOfChildren () const
virtual NodePtr_t getChild (size_t i) const
virtual void setLightingMode (const LightingMode &lighting_state)
 Virtual method for setting the lighting mode of the object : influence by light or not.
virtual void setWireFrameMode (const WireFrameMode &wireframe_state)
 Virtual method for setting the wireframe mode of the object : visible or not.
virtual void setAlpha (const float &alpha)
void setColor (const osgVector4 &color)
void traverse (NodeVisitor &visitor)
virtual osg::ref_ptr< osg::Node > getOsgNode () const
virtual ~GroupNode ()
Public Member Functions inherited from gepetto::viewer::Node
const Configuration & getGlobalTransform () const
 returns rotation and position of the node in word frame
std::string getID () const
 getID is a public method for getting the id_name of the Object
bool isDirty () const
void setDirty (bool dirty=true)
 Called when a property is modified.
bool isSelectable () const
void setSelectable (bool selectable=true)
void applyConfiguration (const osgVector3 &position, const osgQuat &quat)
void applyConfiguration (const Configuration &cfg)
void setStaticTransform (const osgVector3 &position, const osgQuat &quat)
osgQuat getStaticRotation () const
osgVector3 getStaticPosition () const
virtual void setVisibilityMode (const VisibilityMode &visibility_state)
 Virtual method for setting the visibility mode of the object : visible or not visible.
virtual const VisibilityMode & getVisibilityMode () const
virtual LightingMode getLightingMode () const
virtual const WireFrameMode & getWireFrameMode () const
void setScale (float scale)
void setScale (const osgVector3 &scale)
osgVector3 getScale () const
virtual::osg::GroupRefPtr asGroup () const
 Return the root node to include it in the scene.
virtual void addLandmark (const float &size)
bool hasLandmark () const
::osg::StateSetRefPtr getOrCreateRootStateSet ()
void deleteLandmark ()
bool getHighlightEnabled () const
void setHighlightEnabled (bool enabled)
void setHighlightState (unsigned int state)
const std::size_t & getHighlightState () const
virtual float getAlpha () const
void setTransparency (const float &transparency)
float getTransparency () const
virtual ~Node ()
Public Member Functions inherited from gepetto::viewer::Properties
Property * property (const std::string &name) const
bool callVoidProperty (const std::string &name) const
template<typename T>
bool getProperty (const std::string &name, T &value) const
template<typename T>
bool setProperty (const std::string &name, const T &value)
 Set a property and set this object as dirty.
bool hasProperty (const std::string &name) const
const PropertyMap_t & properties () const
void addProperty (const PropertyPtr_t &prop)
 Add a property and take ownership.
void addProperty (const std::string &name, const PropertyPtr_t &prop)
 Add a property and take ownership.
void addProperty (Property *prop)
 Add a property and leave ownership.
void addProperty (const std::string &name, Property *prop)
 Add a property and leave ownership.
QWidget * guiEditor ()

Static Public Member Functions

static WindowManagerPtr_t create ()
static WindowManagerPtr_t create (osg::GraphicsContext *gc)
static WindowManagerPtr_t create (osgViewer::Viewer *v, osg::GraphicsContext *gc)
static WindowManagerPtr_t create (const unsigned int &x, const unsigned int &y, const unsigned int &width, const unsigned int &height)
static WindowManagerPtr_t createCopy (WindowManagerPtr_t other)
Static Public Member Functions inherited from gepetto::viewer::GroupNode
static GroupNodePtr_t create (const std::string &name)
static GroupNodePtr_t createCopy (GroupNodePtr_t other)

Additional Inherited Members

Public Attributes inherited from gepetto::viewer::GroupNode
 SCENE_VIEWER_ACCEPT_VISITOR
Public Attributes inherited from gepetto::viewer::Node
 SCENE_VIEWER_ACCEPT_VISITOR
Static Public Attributes inherited from gepetto::viewer::Node
static const float TransparencyRenderingBinThreshold
Protected Member Functions inherited from gepetto::viewer::GroupNode
 GroupNode (const std::string &name)
 Default constructor.
 GroupNode (const GroupNode &other)
void initWeakPtr (GroupNodeWeakPtr other_weak_ptr)
Protected Member Functions inherited from gepetto::viewer::Node
 Node (const std::string &name)
 Default constructor.
 Node (const Node &other)
::osg::GroupRefPtr asQueue () const
 Return the root node to include it in the scene.
void setID (const std::string &id_name)
void setTransparentRenderingBin (bool transparent=true, osg::StateSet *ss=NULL)
Protected Attributes inherited from gepetto::viewer::Node
::osg::GeodeRefPtr landmark_geode_ptr_
::osg::GeodeRefPtr geode_ptr_
float alpha_
Protected Attributes inherited from gepetto::viewer::Properties
PropertyMap_t properties_

Detailed Description

Manage a window that renders a scene. The root of the rendered scene is a GroupNode.

Member Enumeration Documentation

◆ TextAlignment

Enumerator
TOP 
CENTER 
BOTTOM 
RIGHT 
LEFT 

Constructor & Destructor Documentation

◆ ~WindowManager()

virtual gepetto::viewer::WindowManager::~WindowManager ( )
virtual

Member Function Documentation

◆ addNode()

virtual bool gepetto::viewer::WindowManager::addNode ( NodePtr_t graphical_object_ptr)
virtual

Add a graphical object to the scene

◆ attachCameraToNode()

void gepetto::viewer::WindowManager::attachCameraToNode ( NodePtr_t node)

◆ captureFrame()

void gepetto::viewer::WindowManager::captureFrame ( const std::string & filename)

◆ clone()

virtual WindowManagerPtr_t gepetto::viewer::WindowManager::clone ( void ) const
virtual

Proceed to a clonage of the current object defined by the copy constructor

◆ create() [1/4]

WindowManagerPtr_t gepetto::viewer::WindowManager::create ( )
static

Create and initialize a graphical engine of type OSG

◆ create() [2/4]

WindowManagerPtr_t gepetto::viewer::WindowManager::create ( const unsigned int & x,
const unsigned int & y,
const unsigned int & width,
const unsigned int & height )
static

Create and initialize a graphical engine of type OSG with some parameters : position + dimension

◆ create() [3/4]

WindowManagerPtr_t gepetto::viewer::WindowManager::create ( osg::GraphicsContext * gc)
static

Create and initialize a graphical engine with a GraphicsContext

◆ create() [4/4]

WindowManagerPtr_t gepetto::viewer::WindowManager::create ( osgViewer::Viewer * v,
osg::GraphicsContext * gc )
static

◆ createCopy()

WindowManagerPtr_t gepetto::viewer::WindowManager::createCopy ( WindowManagerPtr_t other)
static

Static method for creating a clone of box other with the copy constructor

◆ detachCamera()

void gepetto::viewer::WindowManager::detachCamera ( )

◆ done()

virtual bool gepetto::viewer::WindowManager::done ( )
virtual

Return the current doing of procedure

◆ frame()

virtual bool gepetto::viewer::WindowManager::frame ( )
virtual

Generate a new frame rendering

◆ getCameraTransform()

void gepetto::viewer::WindowManager::getCameraTransform ( osg::Vec3d & pos,
osg::Quat & rot )

◆ getScene()

virtual GroupNodePtr_t gepetto::viewer::WindowManager::getScene ( ) const
inlinevirtual

Return the scene group

◆ getText()

std::string gepetto::viewer::WindowManager::getText ( TextAlignment verticalPos,
TextAlignment horizontalPos ) const

◆ getViewerClone()

::osgViewer::ViewerRefPtr gepetto::viewer::WindowManager::getViewerClone ( )

Return a ref to the viewer

◆ getWindowDimension()

osgVector2 gepetto::viewer::WindowManager::getWindowDimension ( ) const

Return the window width and height as a 2D vector

◆ getWindowPosition()

osgVector2 gepetto::viewer::WindowManager::getWindowPosition ( ) const

Return the window x and y position as a 2D vector

◆ run()

virtual bool gepetto::viewer::WindowManager::run ( )
virtual

Run the scene process

◆ self()

WindowManagerPtr_t gepetto::viewer::WindowManager::self ( void ) const

Return a shared pointer of the current object

◆ setBackgroundColor1()

void gepetto::viewer::WindowManager::setBackgroundColor1 ( const osg::Vec4 & color)
inline

◆ setBackgroundColor2()

void gepetto::viewer::WindowManager::setBackgroundColor2 ( const osg::Vec4 & color)
inline

◆ setCameraTransform()

void gepetto::viewer::WindowManager::setCameraTransform ( const osg::Vec3d & pos,
const osg::Quat & rot )

◆ setText()

void gepetto::viewer::WindowManager::setText ( TextAlignment verticalPos,
TextAlignment horizontalPos,
const std::string & text,
float size = 20 )

Set the HUD text

◆ setWindowDimension()

virtual void gepetto::viewer::WindowManager::setWindowDimension ( const osgVector2 & size)
virtual

Define dimension of the window

Parameters
size(width, height)

◆ setWindowPosition()

virtual void gepetto::viewer::WindowManager::setWindowPosition ( const osgVector2 & position)
virtual

Define the window position

Parameters
position(x_pos, y_pos)

◆ startCapture()

void gepetto::viewer::WindowManager::startCapture ( const std::string & filename,
const std::string & extension )

◆ stopCapture()

void gepetto::viewer::WindowManager::stopCapture ( )

◆ writeNodeFile()

bool gepetto::viewer::WindowManager::writeNodeFile ( const std::string & filename)

The documentation for this class was generated from the following file: