openrave.org

 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 フレンド マクロ定義 グループ ページ
Public 型 | Public メソッド | Static Public メソッド | Public 変数 | Protected メソッド | すべてのメンバ一覧
クラス OpenRAVE::ViewerBaseabstract

[interface] Base class for the graphics and gui engine that renders the environment and provides visual sensor information. If not specified, method is not multi-thread safe. See Viewer Concepts. [詳細]

#include <viewer.h>

OpenRAVE::ViewerBaseに対する継承グラフ
Inheritance graph
[凡例]
OpenRAVE::ViewerBaseのコラボレーション図
Collaboration graph
[凡例]

Public 型

enum  ViewerEvents { VE_ItemSelection = 1 }
 
typedef boost::function< bool(KinBody::LinkPtr
plink, RaveVector< float >
, RaveVector< float >)> 
ItemSelectionCallbackFn
 callback function for item selection
 
typedef boost::function< void(const
uint8_t *, int, int, int)> 
ViewerImageCallbackFn
 callback function for item selection callback(imagememory,width,height,pixeldepth)
 
typedef boost::function< void()> ViewerThreadCallbackFn
 callback function for viewer thread
 
typedef
ItemSelectionCallbackFn
ViewerCallbackFn 
RAVE_DEPRECATED
 
- Public 型 inherited from OpenRAVE::InterfaceBase
typedef std::map< std::string,
XMLReadablePtr,
CaseInsensitiveCompare
READERSMAP
 

Public メソッド

 ViewerBase (EnvironmentBasePtr penv)
 
virtual ~ViewerBase ()
 
virtual void RemoveKinBody (KinBodyPtr pbody) OPENRAVE_DUMMY_IMPLEMENTATION
 notified when a body has been removed from the environment
 
virtual int main (bool bShow=true)=0
 goes into the main loop
 
virtual void quitmainloop ()=0
 destroys the main loop
 
virtual void Reset () OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void SetBkgndColor (const RaveVector< float > &color) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual UserDataPtr RegisterItemSelectionCallback (const ItemSelectionCallbackFn &fncallback) OPENRAVE_DUMMY_IMPLEMENTATION
 registers a function with the viewer that gets called everytime mouse button is clicked
 
virtual UserDataPtr RegisterViewerImageCallback (const ViewerImageCallbackFn &fncallback) OPENRAVE_DUMMY_IMPLEMENTATION
 registers a function with the viewer that gets called for every new image rendered.
 
virtual UserDataPtr RegisterViewerThreadCallback (const ViewerThreadCallbackFn &fncallback) OPENRAVE_DUMMY_IMPLEMENTATION
 registers a function with the viewer that gets called in the viewer's GUI thread for every cycle the viewer refreshes at
 
virtual void SetEnvironmentSync (bool bUpdate) OPENRAVE_DUMMY_IMPLEMENTATION
 controls whether the viewer synchronizes with the newest environment automatically
 
virtual void EnvironmentSync () OPENRAVE_DUMMY_IMPLEMENTATION
 forces synchronization with the environment, returns when the environment is fully synchronized.
 
virtual void SetSize (int w, int h) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void ViewerSetSize (int w, int h) RAVE_DEPRECATED
 
virtual void Move (int x, int y) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void ViewerMove (int x, int y) RAVE_DEPRECATED
 
virtual void SetName (const std::string &name) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void ViewerSetTitle (const std::string &ptitle) RAVE_DEPRECATED
 
virtual const std::string & GetName () const OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual void UpdateCameraTransform () RAVE_DEPRECATED OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual UserDataPtr RegisterCallback (int properties, const ItemSelectionCallbackFn &fncallback) RAVE_DEPRECATED
 
virtual void SetCamera (const RaveTransform< float > &trans, float focalDistance=0) OPENRAVE_DUMMY_IMPLEMENTATION
 Set the camera transformation.
 
virtual RaveTransform< float > GetCameraTransform () const OPENRAVE_DUMMY_IMPLEMENTATION
 Return the current camera transform that the viewer is rendering the environment at.
 
virtual
geometry::RaveCameraIntrinsics
< float > 
GetCameraIntrinsics () const OPENRAVE_DUMMY_IMPLEMENTATION
 Return the closest camera intrinsics that the viewer is rendering the environment at.
 
virtual bool GetCameraImage (std::vector< uint8_t > &memory, int width, int height, const RaveTransform< float > &t, const SensorBase::CameraIntrinsics &intrinsics) OPENRAVE_DUMMY_IMPLEMENTATION
 Renders a 24bit RGB image of dimensions width and height from the current scene.
 
- Public メソッド inherited from OpenRAVE::InterfaceBase
 InterfaceBase (InterfaceType type, EnvironmentBasePtr penv)
 
virtual ~InterfaceBase ()
 
InterfaceType GetInterfaceType () const
 
const std::string & GetXMLId () const
 
const std::string & GetPluginName () const
 
EnvironmentBasePtr GetEnv () const
 
const READERSMAPGetReadableInterfaces () const
 Returns the raw map reference, this is not multithread safe and the GetInterfaceMutex should be locked before using.
 
virtual XMLReadablePtr GetReadableInterface (const std::string &xmltag) const
 Returns the readable interface. [multi-thread safe]
 
virtual XMLReadablePtr SetReadableInterface (const std::string &xmltag, XMLReadablePtr readable)
 Set a new readable interface and return the previously set interface if it exists. [multi-thread safe]
 
virtual const std::string & GetDescription () const
 Documentation of the interface in reStructuredText format. See Documenting Interfaces. [multi-thread safe]
 
virtual void SetDescription (const std::string &description)
 sets a description [multi-thread safe]
 
virtual void SetUserData (const std::string &key, UserDataPtr data) const
 set user data for a specific key. [multi-thread safe]
 
virtual UserDataPtr GetUserData (const std::string &key=std::string()) const
 return the user custom data [multi-thread safe]
 
virtual bool RemoveUserData (const std::string &key) const
 removes a user data pointer. if user data pointer does not exist, then return 0, otherwise 1. [multi-thread safe]
 
virtual void SetUserData (UserDataPtr data) RAVE_DEPRECATED
 
virtual const std::string & GetURI () const
 the URI used to load the interface (sometimes this is not possible if the definition lies inside an environment file). [multi-thread safe]
 
virtual const std::string & GetXMLFilename () const
 
virtual void Clone (InterfaceBaseConstPtr preference, int cloningoptions)
 Clone the contents of an interface to the current interface.
 
virtual bool SendCommand (std::ostream &os, std::istream &is)
 Used to send special commands to the interface and receive output.
 
virtual void Serialize (BaseXMLWriterPtr writer, int options=0) const
 serializes the interface
 

Static Public メソッド

static InterfaceType GetInterfaceTypeStatic ()
 return the static interface type this class points to (used for safe casting)
 

Public 変数

enum
OpenRAVE::ViewerBase::ViewerEvents 
RAVE_DEPRECATED
 

Protected メソッド

virtual void SetViewerData (KinBodyPtr body, UserDataPtr data) RAVE_DEPRECATED
 
virtual GraphHandlePtr plot3 (const float *ppoints, int numPoints, int stride, float fPointSize, const RaveVector< float > &color, int drawstyle=0) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr plot3 (const float *ppoints, int numPoints, int stride, float fPointSize, const float *colors, int drawstyle=0, bool bhasalpha=false) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawlinestrip (const float *ppoints, int numPoints, int stride, float fwidth, const RaveVector< float > &color) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawlinestrip (const float *ppoints, int numPoints, int stride, float fwidth, const float *colors) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawlinelist (const float *ppoints, int numPoints, int stride, float fwidth, const RaveVector< float > &color) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawlinelist (const float *ppoints, int numPoints, int stride, float fwidth, const float *colors) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawarrow (const RaveVector< float > &p1, const RaveVector< float > &p2, float fwidth, const RaveVector< float > &color) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawbox (const RaveVector< float > &vpos, const RaveVector< float > &vextents) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawplane (const RaveTransform< float > &tplane, const RaveVector< float > &vextents, const boost::multi_array< float, 3 > &vtexture) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawtrimesh (const float *ppoints, int stride, const int *pIndices, int numTriangles, const RaveVector< float > &color) OPENRAVE_DUMMY_IMPLEMENTATION
 
virtual GraphHandlePtr drawtrimesh (const float *ppoints, int stride, const int *pIndices, int numTriangles, const boost::multi_array< float, 2 > &colors) OPENRAVE_DUMMY_IMPLEMENTATION
 
ViewerBasePtr shared_viewer ()
 
ViewerBaseConstPtr shared_viewer_const () const
 
- Protected メソッド inherited from OpenRAVE::InterfaceBase
virtual void RegisterCommand (const std::string &cmdname, InterfaceCommandFn fncmd, const std::string &strhelp)
 Registers a command and its help string. [multi-thread safe]
 
virtual void UnregisterCommand (const std::string &cmdname)
 Unregisters the command. [multi-thread safe]
 
virtual boost::shared_mutex & GetInterfaceMutex () const
 

Additional Inherited Members

- Protected 型 inherited from OpenRAVE::InterfaceBase
typedef boost::function< bool(std::ostream
&, std::istream &)> 
InterfaceCommandFn
 The function to be executed for every command.
 
- Protected 変数 inherited from OpenRAVE::InterfaceBase
std::string __description
 

説明

[interface] Base class for the graphics and gui engine that renders the environment and provides visual sensor information. If not specified, method is not multi-thread safe. See Viewer Concepts.

viewer.h53 行で定義されています。

型定義

typedef boost::function<bool (KinBody::LinkPtr plink,RaveVector<float>,RaveVector<float>)> OpenRAVE::ViewerBase::ItemSelectionCallbackFn

callback function for item selection

If the function returns true, then the object will be selected. Otherwise, the object remains unselected. callback(target link,offset,direction)

viewer.h117 行で定義されています。

非推奨:
(11/06/10)

viewer.h179 行で定義されています。

typedef boost::function<void (const uint8_t*,int,int,int)> OpenRAVE::ViewerBase::ViewerImageCallbackFn

callback function for item selection callback(imagememory,width,height,pixeldepth)

引数
imagememorywidth x height x pixeldepth RGB image

viewer.h128 行で定義されています。

typedef boost::function<void ()> OpenRAVE::ViewerBase::ViewerThreadCallbackFn

callback function for viewer thread

viewer.h136 行で定義されています。

列挙型

列挙型の値:
VE_ItemSelection 

viewer.h56 行で定義されています。

コンストラクタとデストラクタ

OpenRAVE::ViewerBase::ViewerBase ( EnvironmentBasePtr  penv)
inline

viewer.h61 行で定義されています。

virtual OpenRAVE::ViewerBase::~ViewerBase ( )
inlinevirtual

viewer.h63 行で定義されています。

関数

virtual GraphHandlePtr OpenRAVE::ViewerBase::drawarrow ( const RaveVector< float > &  p1,
const RaveVector< float > &  p2,
float  fwidth,
const RaveVector< float > &  color 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawbox ( const RaveVector< float > &  vpos,
const RaveVector< float > &  vextents 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawlinelist ( const float *  ppoints,
int  numPoints,
int  stride,
float  fwidth,
const RaveVector< float > &  color 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawlinelist ( const float *  ppoints,
int  numPoints,
int  stride,
float  fwidth,
const float *  colors 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawlinestrip ( const float *  ppoints,
int  numPoints,
int  stride,
float  fwidth,
const RaveVector< float > &  color 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawlinestrip ( const float *  ppoints,
int  numPoints,
int  stride,
float  fwidth,
const float *  colors 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawplane ( const RaveTransform< float > &  tplane,
const RaveVector< float > &  vextents,
const boost::multi_array< float, 3 > &  vtexture 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawtrimesh ( const float *  ppoints,
int  stride,
const int *  pIndices,
int  numTriangles,
const RaveVector< float > &  color 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::drawtrimesh ( const float *  ppoints,
int  stride,
const int *  pIndices,
int  numTriangles,
const boost::multi_array< float, 2 > &  colors 
)
protectedvirtual
virtual void OpenRAVE::ViewerBase::EnvironmentSync ( )
virtual

forces synchronization with the environment, returns when the environment is fully synchronized.

Note that this method might not work if environment is locked in current thread

virtual bool OpenRAVE::ViewerBase::GetCameraImage ( std::vector< uint8_t > &  memory,
int  width,
int  height,
const RaveTransform< float > &  t,
const SensorBase::CameraIntrinsics intrinsics 
)
virtual

Renders a 24bit RGB image of dimensions width and height from the current scene.

The camera is meant to show the underlying OpenRAVE world as a robot would see it, so all graphs rendered with the plotX and drawX functions are hidden by default. Some viewers support the SetFiguresInCamera command to allow graphs to be also displayed.

引数
memorythe memory where the image will be stored at, has to store 3*width*height
widthwidth of the image, if 0 the width of the viewer is used
heightheight of the image, if 0 the width of the viewer is used
tthe rotation and translation of the camera. Note that +z is treated as the camera direction axis! So all points in front of the camera have a positive dot product with its +z direction.
intrinsicsthe intrinsic parameters of the camera defining FOV, distortion, principal point, and focal length. The focal length is used to define the near plane for culling.
virtual geometry::RaveCameraIntrinsics<float> OpenRAVE::ViewerBase::GetCameraIntrinsics ( ) const
virtual

Return the closest camera intrinsics that the viewer is rendering the environment at.

virtual RaveTransform<float> OpenRAVE::ViewerBase::GetCameraTransform ( ) const
virtual

Return the current camera transform that the viewer is rendering the environment at.

static InterfaceType OpenRAVE::ViewerBase::GetInterfaceTypeStatic ( )
inlinestatic

return the static interface type this class points to (used for safe casting)

viewer.h67 行で定義されています。

virtual const std::string& OpenRAVE::ViewerBase::GetName ( ) const
virtual
virtual int OpenRAVE::ViewerBase::main ( bool  bShow = true)
pure virtual

goes into the main loop

引数
bShowif true will show the window
virtual void OpenRAVE::ViewerBase::Move ( int  x,
int  y 
)
virtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::plot3 ( const float *  ppoints,
int  numPoints,
int  stride,
float  fPointSize,
const RaveVector< float > &  color,
int  drawstyle = 0 
)
protectedvirtual
virtual GraphHandlePtr OpenRAVE::ViewerBase::plot3 ( const float *  ppoints,
int  numPoints,
int  stride,
float  fPointSize,
const float *  colors,
int  drawstyle = 0,
bool  bhasalpha = false 
)
protectedvirtual
virtual void OpenRAVE::ViewerBase::quitmainloop ( )
pure virtual

destroys the main loop

virtual UserDataPtr OpenRAVE::ViewerBase::RegisterCallback ( int  properties,
const ItemSelectionCallbackFn fncallback 
)
inlinevirtual
非推奨:
(11/06/10)

viewer.h181 行で定義されています。

virtual UserDataPtr OpenRAVE::ViewerBase::RegisterItemSelectionCallback ( const ItemSelectionCallbackFn fncallback)
virtual

registers a function with the viewer that gets called everytime mouse button is clicked

戻り値
a handle to the callback. If this handle is deleted, the callback will be unregistered.
virtual UserDataPtr OpenRAVE::ViewerBase::RegisterViewerImageCallback ( const ViewerImageCallbackFn fncallback)
virtual

registers a function with the viewer that gets called for every new image rendered.

戻り値
a handle to the callback. If this handle is deleted, the callback will be unregistered.
virtual UserDataPtr OpenRAVE::ViewerBase::RegisterViewerThreadCallback ( const ViewerThreadCallbackFn fncallback)
virtual

registers a function with the viewer that gets called in the viewer's GUI thread for every cycle the viewer refreshes at

The environment will not be locked when the thread is called

戻り値
a handle to the callback. If this handle is deleted, the callback will be unregistered.
virtual void OpenRAVE::ViewerBase::RemoveKinBody ( KinBodyPtr  pbody)
virtual

notified when a body has been removed from the environment

virtual void OpenRAVE::ViewerBase::Reset ( )
virtual
virtual void OpenRAVE::ViewerBase::SetBkgndColor ( const RaveVector< float > &  color)
virtual
virtual void OpenRAVE::ViewerBase::SetCamera ( const RaveTransform< float > &  trans,
float  focalDistance = 0 
)
virtual

Set the camera transformation.

引数
transnew camera transformation in the world coordinate system
focalDistanceThe new focal distance of the camera (higher values is higher zoom). If 0, then the previous focal distance is preserved.
virtual void OpenRAVE::ViewerBase::SetEnvironmentSync ( bool  bUpdate)
virtual

controls whether the viewer synchronizes with the newest environment automatically

virtual void OpenRAVE::ViewerBase::SetName ( const std::string &  name)
virtual
virtual void OpenRAVE::ViewerBase::SetSize ( int  w,
int  h 
)
virtual
virtual void OpenRAVE::ViewerBase::SetViewerData ( KinBodyPtr  body,
UserDataPtr  data 
)
inlineprotectedvirtual
非推奨:
(12/12/11)

viewer.h188 行で定義されています。

ViewerBasePtr OpenRAVE::ViewerBase::shared_viewer ( )
inlineprotected

viewer.h209 行で定義されています。

ViewerBaseConstPtr OpenRAVE::ViewerBase::shared_viewer_const ( ) const
inlineprotected

viewer.h212 行で定義されています。

virtual void OpenRAVE::ViewerBase::UpdateCameraTransform ( )
virtual
非推奨:
(11/06/10)
virtual void OpenRAVE::ViewerBase::ViewerMove ( int  x,
int  y 
)
inlinevirtual
非推奨:
(11/06/13)

viewer.h163 行で定義されています。

virtual void OpenRAVE::ViewerBase::ViewerSetSize ( int  w,
int  h 
)
inlinevirtual
非推奨:
(11/06/13)

viewer.h156 行で定義されています。

virtual void OpenRAVE::ViewerBase::ViewerSetTitle ( const std::string &  ptitle)
inlinevirtual
非推奨:
(11/06/13)

viewer.h170 行で定義されています。

変数


このクラスの説明は次のファイルから生成されました: