Module com.marginallyclever.ro3
Class TranslateToolMulti
java.lang.Object
com.marginallyclever.ro3.apps.viewport.viewporttool.move.TranslateToolMulti
- All Implemented Interfaces:
ViewportTool
A tool to translate Pose nodes in the Viewport. It is a
combination of three TranslateToolOneAxis. While one tool is active
the other two are hidden.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(SelectedItems list) This method is called when the tool is activated.voidForce cancel the tool.voidThis method is called when the tool is deactivated.voidgetComponents(List<JPanel> list) Build a Swing Component that represents this Tool.javax.vecmath.Point3dReturns the point on the tool clicked by the user.voidhandleMouseEvent(MouseEvent event) Handles mouse input events for the tool.booleanisInUse()Returns true if the tool is active (was clicked correctly and could be dragged)voidmouseDragged(MouseEvent event) voidmouseMoved(MouseEvent event) voidmousePressed(MouseEvent event) voidmouseReleased(MouseEvent event) voidrender(com.jogamp.opengl.GL3 gl, ShaderProgram shaderProgram) Renders any tool-specific visuals to the 3D scene.voidSets the frame of reference for the tool.voidsetViewport(Viewport viewport) voidupdate(double deltaTime) Updates the tool's internal state, if necessary.
-
Constructor Details
-
TranslateToolMulti
public TranslateToolMulti()
-
-
Method Details
-
activate
This method is called when the tool is activated. It receives the SelectedItems object containing the selected entities and their initial world poses.- Specified by:
activatein interfaceViewportTool- Parameters:
list- The selected items to be manipulated by the tool.
-
deactivate
public 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.- Specified by:
deactivatein interfaceViewportTool
-
handleMouseEvent
Handles mouse input events for the tool.- Specified by:
handleMouseEventin interfaceViewportTool- Parameters:
event- The MouseEvent object representing the input event.
-
update
public void update(double deltaTime) Updates the tool's internal state, if necessary.- Specified by:
updatein interfaceViewportTool- Parameters:
deltaTime- Time elapsed since the last update.
-
render
Renders any tool-specific visuals to the 3D scene.- Specified by:
renderin interfaceViewportTool- Parameters:
gl- The OpenGL context to systems to.
-
setViewport
- Specified by:
setViewportin interfaceViewportTool
-
isInUse
public boolean isInUse()Description copied from interface:ViewportToolReturns true if the tool is active (was clicked correctly and could be dragged)- Specified by:
isInUsein interfaceViewportTool- Returns:
- true if the tool is active (was clicked correctly and could be dragged)
-
cancelUse
public void cancelUse()Description copied from interface:ViewportToolForce cancel the tool. useful if two viewporttools are activated at once.- Specified by:
cancelUsein interfaceViewportTool
-
getStartPoint
public javax.vecmath.Point3d getStartPoint()Description copied from interface:ViewportToolReturns the point on the tool clicked by the user. This is used to determine which tool is closer to the user.- Specified by:
getStartPointin interfaceViewportTool- Returns:
- the point on the tool clicked by the user.
-
mouseMoved
- Specified by:
mouseMovedin interfaceViewportTool
-
mousePressed
- Specified by:
mousePressedin interfaceViewportTool
-
mouseDragged
- Specified by:
mouseDraggedin interfaceViewportTool
-
mouseReleased
- Specified by:
mouseReleasedin interfaceViewportTool
-
setFrameOfReference
Sets the frame of reference for the tool.- Specified by:
setFrameOfReferencein interfaceViewportTool- Parameters:
index- aFrameOfReference.
-
getComponents
Description copied from interface:ViewportToolBuild a Swing Component that represents this Tool.- Specified by:
getComponentsin interfaceViewportTool- Parameters:
list- the list to add components to.
-