Package org.robwork.sdurw_graphics
Class SceneViewerPtr
- java.lang.Object
-
- org.robwork.sdurw_graphics.SceneViewerPtr
-
public class SceneViewerPtr extends java.lang.ObjectPtr 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.voidautoZoom()Automatically fits all frames inside the viewport by moving camera in its z-axis.SceneViewerCPtrcptr()SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_tcreateView(java.lang.String name)Create a new view.SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_tcreateView(java.lang.String name, boolean enableBackground)Create a new view.voiddelete()SceneViewerderef()The pointer stored in the object.voiddestroyView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)Destroy view.booleanequals(SceneViewer p)static longgetCPtr(SceneViewerPtr obj)SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_tgetCurrentView()Get the currently selected view.SceneViewergetDeref()Member access operator.java.lang.StringgetLogo()get the logo that is displayed in the 3d sceneSWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_tgetMainView()Get the main view.PropertyMapgetPropertyMap()get propertymapSceneGraphPtrgetScene()get the current scene graphTransform3DgetTransform()get the current rotation of the viewSWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneCamera_tgetViewCamera()Get the view camera.Vector3DgetViewCenter()Get the view center.SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__graphics__SceneViewer__View_t_tgetViews()Get all views.GroupNodePtrgetWorldNode()Get the world node.booleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipDrawableNodePtrpickDrawable(int x, int y)picks the drawable in the scene that intersects with the ray (x,y,-1) in
camera coordinates.
DrawableNodePtrpickDrawable(SceneGraph.SceneGraphRenderInfo info, int x, int y)&,int,int)voidrenderView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)Render a view.voidsaveBufferToFile(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.
voidselectView(SWIGTYPE_p_rw__core__PtrT_rw__graphics__SceneViewer__View_t view)Select a view.voidsetLogo(java.lang.String string)set the logo that is displayed in the 3d scenevoidsetTransform(Transform3D t3d)set the orientation of the view.voidsetWorkCellScene(WorkCellScenePtr wcscene)Set the WorkCell scene.voidsetWorldNode(GroupNodePtr wnode)Set the world group node.voidupdateState(State state)Set a new state.voidupdateView()Update the view.voidzoom(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.
-
-