Interface ViewportTool
- All Known Implementing Classes:
Compass3D
,RotateToolMulti
,RotateToolOneAxis
,SelectionTool
,TranslateToolMulti
,TranslateToolOneAxis
,TranslateToolTwoAxis
public interface ViewportTool
Interface for
Viewport
tools that can be used to visually edit the scene.-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called when the tool is activated.void
Force cancel the tool.void
This method is called when the tool is deactivated.void
dispose
(com.jogamp.opengl.GL3 gl3) This is called when the OpenGL context is destroyed.javax.vecmath.Point3d
Returns the point on the tool clicked by the user.void
handleMouseEvent
(MouseEvent event) Handles mouse input events for the tool.void
init
(com.jogamp.opengl.GL3 gl3) This is called when the OpenGL context is created.boolean
isInUse()
Returns true if the tool is active (was clicked correctly and could be dragged)void
mouseDragged
(MouseEvent event) void
mouseMoved
(MouseEvent event) void
mousePressed
(MouseEvent event) void
mouseReleased
(MouseEvent event) void
render
(com.jogamp.opengl.GL3 gl, ShaderProgram shaderProgram) Renders any tool-specific visuals to the 3D scene.void
Sets the frame of reference for the tool.void
setViewport
(Viewport viewport) void
update
(double deltaTime) Updates the tool's internal state, if necessary.
-
Method Details
-
activate
This method is called when the tool is activated. It receives a list containing the selected nodes and their initial world poses.- Parameters:
list
- The selected items to be manipulated by the tool.
-
deactivate
void deactivate()This method is called when the tool is deactivated. It allows the tool to perform any necessary cleanup actions before another tool takes over. -
handleMouseEvent
Handles mouse input events for the tool.- Parameters:
event
- The MouseEvent object representing the input event.
-
update
void update(double deltaTime) Updates the tool's internal state, if necessary.- Parameters:
deltaTime
- Time elapsed since the last update.
-
render
Renders any tool-specific visuals to the 3D scene.- Parameters:
gl
- The OpenGL context.
-
setViewport
-
isInUse
boolean isInUse()Returns true if the tool is active (was clicked correctly and could be dragged)- Returns:
- true if the tool is active (was clicked correctly and could be dragged)
-
cancelUse
void cancelUse()Force cancel the tool. useful if two viewporttools are activated at once. -
getStartPoint
javax.vecmath.Point3d getStartPoint()Returns the point on the tool clicked by the user. This is used to determine which tool is closer to the user.- Returns:
- the point on the tool clicked by the user.
-
mouseMoved
-
mousePressed
-
mouseDragged
-
mouseReleased
-
setFrameOfReference
Sets the frame of reference for the tool.- Parameters:
index
- 0 for world, 1 for local, 2 for camera.
-
init
void init(com.jogamp.opengl.GL3 gl3) This is called when the OpenGL context is created. It should create any resources.- Parameters:
gl3
- the OpenGL context.
-
dispose
void dispose(com.jogamp.opengl.GL3 gl3) This is called when the OpenGL context is destroyed. It should release any resources.- Parameters:
gl3
- the OpenGL context.
-