java.lang.Object
de.grogra.imp.awt.ViewComponentAdapter
de.grogra.imp.awt.CanvasAdapter
de.grogra.imp3d.WireframeCanvas
- All Implemented Interfaces:
ViewComponent
,RenderState
,ComponentWrapper
,Selectable
,Disposable
,ImageObserver
,Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class de.grogra.imp.awt.CanvasAdapter
CanvasAdapter.CanvasComponent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
static final int
final Pool
protected static final int
Fields inherited from class de.grogra.imp.awt.CanvasAdapter
antialiasing, IDENTITY, sceneBuffer
Fields inherited from class de.grogra.imp.awt.ViewComponentAdapter
DISPOSED, DISPOSING, RENDER_OVERLAY, RENDER_OVERLAY_FINISHED, RENDERED_IMAGE, RENDERING, RENDERING_OVERLAY, REPAINT_MASK
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface de.grogra.imp3d.RenderState
CURRENT_HIGHLIGHT
Fields inherited from interface de.grogra.imp.ViewComponent
ALL, CHANGED, MIN_USER_FLAG, SCENE, SELECTION, TOOLS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
final void
protected void
void
drawBox
(float halfWidth, float halfLength, float height, Shader sh, int highlight, boolean asWireframe, Matrix4d t) void
drawFrustum
(float height, float baseRadius, float topRadius, boolean baseClosed, boolean topClosed, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) void
drawFrustumIrregular
(float height, int sectorCount, float[] baseRadii, float[] topRadii, boolean baseClosed, boolean topClosed, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) final void
void
drawLamella
(float halfWidth, float halfLength, float height, float a, float b, Shader sh, int highlight, boolean asWireframe, Matrix4d t) final void
drawLine
(int v1, int v2) final void
drawLine
(int v1, int v2, boolean accentuated) void
protected void
drawOverlay
(int type) void
drawParallelogram
(float height, Vector3f secondAxis, float scaleU, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) void
void
void
drawPointCloud
(float[] locations, float pointSize, Tuple3f color, int highlight, Matrix4d t) Draw a set of points.final void
drawPolygon
(int vertex, Polygon polygon) void
drawPolygons
(Polygonizable pz, Object obj, boolean asNode, Shader sh, int highlight, boolean asWireframe, Matrix4d t) void
drawPrismRectangular
(float y, float xPos, float xNeg, float zPos, float zNeg, int highlight, boolean asWireframe, Matrix4d t) final void
drawRect
(int vertex, int dx, int dy, int width, int height) void
drawRectangle
(int x, int y, int w, int h, Tuple3f color) void
drawSphere
(float radius, Shader sh, int highlight, boolean asWireframe, Matrix4d t) void
drawSphereSegmentSolid
(float radius, float theta1M, float theta2M, float phiM, Shader s, int highlight, boolean asWireframe, Matrix4d t) final void
drawString
(int vertex, int dx, int dy, String s) void
drawString
(int x, int y, String text, Font font, Tuple3f color) void
drawSupershape
(float a, float b, float m1, float n11, float n12, float n13, float m2, float n21, float n22, float n23, Shader sh, int highlight, boolean asWireframe, Matrix4d t) Draw a supershape around the origin (0/0/0).void
drawTextBlock
(String caption, Font font, float depth, Shader s, int highlight, boolean asWireframe, Matrix4d t) float
estimateScaleAt
(Tuple3f point) final void
fillPolygon
(int vertex, Polygon polygon) final void
fillRect
(int vertex, int dx, int dy, int width, int height) void
fillRectangle
(int x, int y, int w, int h, Tuple3f color) protected void
final Color
getColor()
int
getPool()
boolean
getWindowPos
(Tuple3f origin, Tuple2f out) Computes the window coordinates in pixels of a location in the current object coordinates.protected void
initPaint
(int flags, int width, int height) void
initView
(View view, EventListener listener) Initializes this component.final void
openLayer
(int layer) protected void
optionValueChanged
(String name, Object value) protected void
paintHighlight
(int flags, Graphics2D g) protected void
paintScene
(int flags, Graphics2D g) protected void
paintSceneNew
(int flags, Graphics2D g) void
final void
final void
final void
setVertex
(int index, float x, float y, float z) final void
final void
final void
final void
void
updateResolution
(int r) Methods inherited from class de.grogra.imp.awt.CanvasAdapter
checkBuffers, getComponent, getGraphics, getObserverForRenderer, imageUpdate, initCanvas, initRender, invokeRender, makeSnapshot, render, resetGraphicsTransform, setColor, setColor, setColor, setColor, setColor, writeEPS
Methods inherited from class de.grogra.imp.awt.ViewComponentAdapter
checkRepaint, checkRepaintWrapException, dispose, disposeRenderer, disposeView, getColor, getColor, getDisplayResolution, getFactory, getFontMetrics, getGlobalLOD, getIntColor, getInterruptedException, getOption, getRenderGraphState, getView, initFactory, installListeners, invokeRenderSync, isRenderingOverlay, render, render, renderUninterruptibly, repaint, run, toSelection, uninstallListeners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.grogra.imp3d.RenderState
getFontMetrics, getRenderGraphState
Methods inherited from interface de.grogra.pf.ui.edit.Selectable
toSelection
-
Field Details
-
OVERLAY
public static final int OVERLAY- See Also:
-
COLOR
protected static final int COLOR- See Also:
-
FONT
protected static final int FONT- See Also:
-
LINE
protected static final int LINE- See Also:
-
STRING
protected static final int STRING- See Also:
-
DRAW_RECT
protected static final int DRAW_RECT- See Also:
-
FILL_RECT
protected static final int FILL_RECT- See Also:
-
DRAW_POLY
protected static final int DRAW_POLY- See Also:
-
FILL_POLY
protected static final int FILL_POLY- See Also:
-
ICON
protected static final int ICON- See Also:
-
pool
-
-
Constructor Details
-
WireframeCanvas
public WireframeCanvas()
-
-
Method Details
-
getView3D
-
updateResolution
public void updateResolution(int r) - Specified by:
updateResolution
in interfaceViewComponent
- Overrides:
updateResolution
in classViewComponentAdapter
-
initView
Description copied from interface:ViewComponent
Initializes this component. This method sets theview
within which this view component is used to display the graph. It also sets an event listener. this has to be informed of mouse and keys events within the view component by implementations of this method.- Specified by:
initView
in interfaceViewComponent
- Overrides:
initView
in classCanvasAdapter
- Parameters:
view
- the containing viewlistener
- mouse and key events will be reported to this listener
-
initPaint
protected void initPaint(int flags, int width, int height) - Specified by:
initPaint
in classCanvasAdapter
-
paintScene
- Specified by:
paintScene
in classCanvasAdapter
- Throws:
InterruptedException
-
displayOverlay
protected void displayOverlay() -
clearOverlay
protected void clearOverlay() -
paintSceneNew
- Throws:
InterruptedException
-
paintHighlight
- Specified by:
paintHighlight
in classCanvasAdapter
-
finalizePaint
protected void finalizePaint() -
setColor
- Specified by:
setColor
in classCanvasAdapter
-
getColor
-
setFont
-
drawLine
public final void drawLine(int v1, int v2) -
drawLine
public final void drawLine(int v1, int v2, boolean accentuated) -
drawString
-
drawRect
public final void drawRect(int vertex, int dx, int dy, int width, int height) -
fillRect
public final void fillRect(int vertex, int dx, int dy, int width, int height) -
drawPolygon
-
fillPolygon
-
drawIcon
-
openLayer
public final void openLayer(int layer) -
closeLayer
public final void closeLayer() -
drawOverlay
protected void drawOverlay(int type) -
setVertex
-
setVertex
-
setVertex
-
setVertex
-
setVertex
public final void setVertex(int index, float x, float y, float z) -
setVertex
-
getPool
- Specified by:
getPool
in interfaceRenderState
-
getCurrentShader
- Specified by:
getCurrentShader
in interfaceRenderState
-
getCurrentHighlight
public int getCurrentHighlight()- Specified by:
getCurrentHighlight
in interfaceRenderState
-
estimateScaleAt
- Specified by:
estimateScaleAt
in interfaceRenderState
-
drawPoint
- Specified by:
drawPoint
in interfaceRenderState
-
drawPointCloud
public void drawPointCloud(float[] locations, float pointSize, Tuple3f color, int highlight, Matrix4d t) Description copied from interface:RenderState
Draw a set of points. The array locations contains a sequence of points given as triples of floats for x, y and z position of each point. If the same reference for the array location is passed in the implementation might assume that the contents of the array are the same as well. This is necessary for GLDisplay, for instance, to ensure a performant implementation. The class PointCloud ensures that this is the case.- Specified by:
drawPointCloud
in interfaceRenderState
- Parameters:
locations
- array containing a sequence (x,y,z) of pointspointSize
- size of the point on screencolor
- color of the pointt
- transformation of the point cloud
-
drawLine
- Specified by:
drawLine
in interfaceRenderState
-
drawPlane
- Specified by:
drawPlane
in interfaceRenderState
-
drawBox
public void drawBox(float halfWidth, float halfLength, float height, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawBox
in interfaceRenderState
-
drawLamella
public void drawLamella(float halfWidth, float halfLength, float height, float a, float b, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawLamella
in interfaceRenderState
a
- amplitudeb
- frequency
-
drawSphere
- Specified by:
drawSphere
in interfaceRenderState
-
drawSphereSegmentSolid
public void drawSphereSegmentSolid(float radius, float theta1M, float theta2M, float phiM, Shader s, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawSphereSegmentSolid
in interfaceRenderState
-
drawTextBlock
public void drawTextBlock(String caption, Font font, float depth, Shader s, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawTextBlock
in interfaceRenderState
-
drawSupershape
public void drawSupershape(float a, float b, float m1, float n11, float n12, float n13, float m2, float n21, float n22, float n23, Shader sh, int highlight, boolean asWireframe, Matrix4d t) Draw a supershape around the origin (0/0/0). An implementation of Johan Gielis's Superformula which was published in the American Journal of Botany 90(3): 333–338. 2003. INVITED SPECIAL PAPER A GENERIC GEOMETRIC TRANSFORMATION THAT UNIFIES A WIDE RANGE OF NATURAL AND ABSTRACT SHAPES- Specified by:
drawSupershape
in interfaceRenderState
- Parameters:
a
- , b length of curvesm
- , n shape parametersshader
-highlight
-t
- transformation of the point cloud
-
drawFrustum
public void drawFrustum(float height, float baseRadius, float topRadius, boolean baseClosed, boolean topClosed, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawFrustum
in interfaceRenderState
-
drawParallelogram
public void drawParallelogram(float height, Vector3f secondAxis, float scaleU, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawParallelogram
in interfaceRenderState
-
drawPolygons
public void drawPolygons(Polygonizable pz, Object obj, boolean asNode, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawPolygons
in interfaceRenderState
-
getWindowPos
Description copied from interface:RenderState
Computes the window coordinates in pixels of a location in the current object coordinates.- Specified by:
getWindowPos
in interfaceRenderState
- Parameters:
origin
- a location in local object coordinatesout
- the computed window coordinates are placed in here- Returns:
true
iff the window coordinates are valid (i.e., the location is in the clipping region)
-
drawRectangle
- Specified by:
drawRectangle
in interfaceRenderState
-
fillRectangle
- Specified by:
fillRectangle
in interfaceRenderState
-
drawString
- Specified by:
drawString
in interfaceRenderState
-
optionValueChanged
- Overrides:
optionValueChanged
in classCanvasAdapter
-
drawFrustumIrregular
public void drawFrustumIrregular(float height, int sectorCount, float[] baseRadii, float[] topRadii, boolean baseClosed, boolean topClosed, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawFrustumIrregular
in interfaceRenderState
-
drawPrismRectangular
public void drawPrismRectangular(float y, float xPos, float xNeg, float zPos, float zNeg, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawPrismRectangular
in interfaceRenderState
-