Package org.jzy3d.plot3d.rendering.view
Class AbstractViewportManager
java.lang.Object
org.jzy3d.plot3d.rendering.view.AbstractViewportManager
- Direct Known Subclasses:
AWTImageViewport
,Camera
An
AbstractViewportManager
describes an element that occupies the whole rendering
ICanvas
or only a vertical slice of it.
The AbstractViewportManager
also provides a utility function for debugging the slices,
that is the ability to display a 10*10 grid for checking the space occupied by the actual
viewport definition.- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected ViewportConfiguration
protected ViewportMode
protected int
protected boolean
protected int
protected int
protected int
protected int
protected int
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Coord2d
apply_WindowsHiDPI_Workaround
(IPainter painter, int width, int height) static Coord2d
apply_WindowsHiDPI_Workaround
(IPainter painter, Coord2d viewport) applyViewport
(IPainter painter) Build and return aViewportConfiguration
.protected void
applyViewportRectangle
(IPainter painter) protected void
applyViewportSquared
(IPainter painter) Return the viewport as it was invoked at last rendering.Returns the (x,y) offset that was applied to make thisAbstractViewportManager
stand in the appropriate canvas part. and the actual width and height of the viewport.int
The bottom position of the viewport (y)int
int
The left position of the viewport (x)int
int
int
int
getSliceWidth
(int width, float left, float right) static Coord2d
getWindowsHiDPIScale_Workaround
(IPainter painter) boolean
boolean
protected void
renderSubScreenGrid
(IPainter painter) Renders a grid on the defined sub screen.void
setApplyWindowsHiDPIWorkaround
(boolean applyWindowsHiDPIWorkaround) void
setScreenGridDisplayed
(boolean status) Set the status of the screen grid.void
setScreenXOffset
(int screenXOffset) void
setScreenYOffset
(int screenYOffset) void
setViewPort
(int width, int height) Set the view port (size of the renderer).void
setViewPort
(int width, int height, float left, float right) Set the view port (size of the renderer).void
setViewPort
(ViewportConfiguration viewport) void
setViewportMode
(ViewportMode mode)
-
Field Details
-
screenLeft
protected int screenLeft -
screenBottom
protected int screenBottom -
screenXOffset
protected int screenXOffset -
screenYOffset
protected int screenYOffset -
screenWidth
protected int screenWidth -
screenHeight
protected int screenHeight -
screenSquaredDim
protected int screenSquaredDim -
screenGridDisplayed
protected boolean screenGridDisplayed -
mode
-
lastViewPort
-
applyWindowsHiDPIWorkaround
protected boolean applyWindowsHiDPIWorkaround
-
-
Constructor Details
-
AbstractViewportManager
public AbstractViewportManager()
-
-
Method Details
-
setViewPort
public void setViewPort(int width, int height) Set the view port (size of the renderer).- Parameters:
width
- the width of the target window.height
- the height of the target window.
-
getViewportMode
-
setViewportMode
-
setViewPort
public void setViewPort(int width, int height, float left, float right) Set the view port (size of the renderer).- Parameters:
width
- the width of the target window.height
- the height of the target window.left
- the width's ratio where this subscreen starts in the target window.right
- the width's ratio where this subscreen stops in the target window.- Throws:
an
- IllegalArgumentException if right is not greater than left.
-
getSliceWidth
public int getSliceWidth(int width, float left, float right) -
setViewPort
-
getViewPort
-
getLastViewPort
Return the viewport as it was invoked at last rendering. -
applyViewport
Build and return aViewportConfiguration
. Uses gl to- apply viewport with
IPainter.glViewport(int, int, int, int)
- optionnaly to render the viewport debug grid
- apply viewport with
-
apply_WindowsHiDPI_Workaround
-
apply_WindowsHiDPI_Workaround
-
getWindowsHiDPIScale_Workaround
-
applyViewportRectangle
-
applyViewportSquared
-
getRectangle
Returns the (x,y) offset that was applied to make thisAbstractViewportManager
stand in the appropriate canvas part. and the actual width and height of the viewport. Only relevant after a call toinvalid @link
applyViewPort
-
setScreenGridDisplayed
public void setScreenGridDisplayed(boolean status) Set the status of the screen grid.- Parameters:
status
- the grid is displayed if status is set to true
-
renderSubScreenGrid
Renders a grid on the defined sub screen. -
getScreenLeft
public int getScreenLeft()The left position of the viewport (x) -
getScreenBottom
public int getScreenBottom()The bottom position of the viewport (y) -
getScreenXOffset
public int getScreenXOffset() -
getScreenYOffset
public int getScreenYOffset() -
getScreenWidth
public int getScreenWidth() -
getScreenHeight
public int getScreenHeight() -
isScreenGridDisplayed
public boolean isScreenGridDisplayed() -
isApplyWindowsHiDPIWorkaround
public boolean isApplyWindowsHiDPIWorkaround() -
setApplyWindowsHiDPIWorkaround
public void setApplyWindowsHiDPIWorkaround(boolean applyWindowsHiDPIWorkaround) -
setScreenXOffset
public void setScreenXOffset(int screenXOffset) -
setScreenYOffset
public void setScreenYOffset(int screenYOffset)
-