Package org.robwork.sdurw_graphics
Class SceneViewerPtr
- java.lang.Object
-
- org.robwork.sdurw_graphics.SceneViewerPtr
-
public class SceneViewerPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description SceneViewerPtr()
Default constructor yielding a NULL-pointer.SceneViewerPtr(long cPtr, boolean cMemoryOwn)
SceneViewerPtr(SceneViewer ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SceneViewer
__ref__()
Dereferencing operator.void
autoZoom()
Automatically fits all frames inside the viewport by moving camera in its z-axis.SceneViewerCPtr
cptr()
SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t
createView(java.lang.String name)
Create a new view.SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t
createView(java.lang.String name, boolean enableBackground)
Create a new view.void
delete()
SceneViewer
deref()
The pointer stored in the object.void
destroyView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)
Destroy view.boolean
equals(SceneViewer p)
static long
getCPtr(SceneViewerPtr obj)
SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t
getCurrentView()
Get the currently selected view.SceneViewer
getDeref()
Member access operator.java.lang.String
getLogo()
get the logo that is displayed in the 3d sceneSWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t
getMainView()
Get the main view.PropertyMap
getPropertyMap()
get propertymapSceneGraphPtr
getScene()
get the current scene graphTransform3D
getTransform()
get the current rotation of the viewSWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneCamera_t
getViewCamera()
Get the view camera.Vector3D
getViewCenter()
Get the view center.SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__graphics__SceneViewer__View_t_t
getViews()
Get all views.GroupNodePtr
getWorldNode()
Get the world node.boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipDrawableNodePtr
pickDrawable(int x, int y)
picks the drawable in the scene that intersects with the ray (x,y,-1) in
camera coordinates.
DrawableNodePtr
pickDrawable(SceneGraph.SceneGraphRenderInfo info, int x, int y)
&,int,int)void
renderView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)
Render a view.void
saveBufferToFile(java.lang.String filename, int fillR, int fillG, int fillB)
Saves the current 3D view to disk as either jpg, bmp or png.
If failing a std::string is thrown with a detailed description of what
when wrong.
void
selectView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)
Select a view.void
setLogo(java.lang.String string)
set the logo that is displayed in the 3d scenevoid
setTransform(Transform3D t3d)
set the orientation of the view.void
setWorkCellScene(WorkCellScenePtr wcscene)
Set the WorkCell scene.void
setWorldNode(GroupNodePtr wnode)
Set the world group node.void
updateState(State state)
Set a new state.void
updateView()
Update the view.void
zoom(double amount)
Move the camera along its z-axis.
-
-
-
Constructor Detail
-
SceneViewerPtr
public SceneViewerPtr(long cPtr, boolean cMemoryOwn)
-
SceneViewerPtr
public SceneViewerPtr()
Default constructor yielding a NULL-pointer.
-
SceneViewerPtr
public SceneViewerPtr(SceneViewer ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(SceneViewerPtr obj)
-
delete
public void delete()
-
deref
public SceneViewer deref()
The pointer stored in the object.
-
__ref__
public SceneViewer __ref__()
Dereferencing operator.
-
getDeref
public SceneViewer getDeref()
Member access operator.
-
equals
public boolean equals(SceneViewer p)
-
isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership- Returns:
- true if Ptr has shared ownership, false if it has no ownership.
-
isNull
public boolean isNull()
checks if the pointer is null- Returns:
- Returns true if the pointer is null
-
cptr
public SceneViewerCPtr cptr()
-
getScene
public SceneGraphPtr getScene()
get the current scene graph
-
getLogo
public java.lang.String getLogo()
get the logo that is displayed in the 3d scene
-
setLogo
public void setLogo(java.lang.String string)
set the logo that is displayed in the 3d scene
-
getPropertyMap
public PropertyMap getPropertyMap()
get propertymap
-
updateView
public void updateView()
Update the view.
-
updateState
public void updateState(State state)
Set a new state.- Parameters:
state
- [in] new state.
-
setWorldNode
public void setWorldNode(GroupNodePtr wnode)
Set the world group node.- Parameters:
wnode
- [in] the world node.
-
setWorkCellScene
public void setWorkCellScene(WorkCellScenePtr wcscene)
Set the WorkCell scene.- Parameters:
wcscene
- [in] the workcell scene.
-
getWorldNode
public GroupNodePtr getWorldNode()
Get the world node.- Returns:
- the world node.
-
saveBufferToFile
public void saveBufferToFile(java.lang.String filename, int fillR, int fillG, int fillB)
Saves the current 3D view to disk as either jpg, bmp or png.
If failing a std::string is thrown with a detailed description of what
when wrong.
- Parameters:
filename
- [in] Path and name of the file. The filename extension
should be either ".jpg", ".bmp" or ".png" to specify which format to use.fillR
- [in] Fill color if viewport is smaller than image, red component [0,255]fillG
- [in] Fill color if viewport is smaller than image, green component [0,255]fillB
- [in] Fill color if viewport is smaller than image, blue component [0,255]
-
getViewCamera
public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneCamera_t getViewCamera()
Get the view camera.- Returns:
- a scene camera.
-
getViewCenter
public Vector3D getViewCenter()
Get the view center.- Returns:
- the center.
-
pickDrawable
public DrawableNodePtr pickDrawable(int x, int y)
picks the drawable in the scene that intersects with the ray (x,y,-1) in
camera coordinates.
- Parameters:
x
- [in] first camera coordinate.y
- [in] second camera coordinate.- Returns:
- the picked drawable.
-
pickDrawable
public DrawableNodePtr pickDrawable(SceneGraph.SceneGraphRenderInfo info, int x, int y)
&,int,int)
-
createView
public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t createView(java.lang.String name, boolean enableBackground)
Create a new view.- Parameters:
name
- [in] name of view.enableBackground
- [in] (optional) enable the background. Default is false.- Returns:
- the new view.
-
createView
public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t createView(java.lang.String name)
Create a new view.- Parameters:
name
- [in] name of view.
- Returns:
- the new view.
-
getMainView
public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t getMainView()
Get the main view.- Returns:
- main view.
-
destroyView
public void destroyView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)
Destroy view.- Parameters:
view
- [in] the view to destroy.
-
selectView
public void selectView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)
Select a view.- Parameters:
view
- [in] the view to select.
-
getCurrentView
public SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t getCurrentView()
Get the currently selected view.- Returns:
- the view.
-
getViews
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__graphics__SceneViewer__View_t_t getViews()
Get all views.- Returns:
- the views.
-
renderView
public void renderView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)
Render a view.- Parameters:
view
- [in] the view to render
-
setTransform
public void setTransform(Transform3D t3d)
set the orientation of the view. The view will look in the
positive direction of the z-axis, with x-axis as the width and
the y-axis as the height. Origin of view is in the center of the
image.- Parameters:
t3d
- [in] transform relative to world
-
getTransform
public Transform3D getTransform()
get the current rotation of the view- Returns:
- orientation of the view
-
zoom
public void zoom(double amount)
Move the camera along its z-axis.- Parameters:
amount
- [in] the amount of zoom.
-
autoZoom
public void autoZoom()
Automatically fits all frames inside the viewport by moving camera in its z-axis.
-
-