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 intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intstatic final intfinal Poolprotected static final intFields inherited from class de.grogra.imp.awt.CanvasAdapter
antialiasing, IDENTITY, sceneBufferFields inherited from class de.grogra.imp.awt.ViewComponentAdapter
DISPOSED, DISPOSING, RENDER_OVERLAY, RENDER_OVERLAY_FINISHED, RENDERED_IMAGE, RENDERING, RENDERING_OVERLAY, REPAINT_MASKFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface de.grogra.imp3d.RenderState
CURRENT_HIGHLIGHTFields inherited from interface de.grogra.imp.ViewComponent
ALL, CHANGED, MIN_USER_FLAG, SCENE, SELECTION, TOOLS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinal voidprotected voidvoiddrawBox(float halfWidth, float halfLength, float height, Shader sh, int highlight, boolean asWireframe, Matrix4d t) voiddrawFrustum(float height, float baseRadius, float topRadius, boolean baseClosed, boolean topClosed, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) voiddrawFrustumIrregular(float height, int sectorCount, float[] baseRadii, float[] topRadii, boolean baseClosed, boolean topClosed, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) final voidvoiddrawLamella(float halfWidth, float halfLength, float height, float a, float b, Shader sh, int highlight, boolean asWireframe, Matrix4d t) final voiddrawLine(int v1, int v2) final voiddrawLine(int v1, int v2, boolean accentuated) voidprotected voiddrawOverlay(int type) voiddrawParallelogram(float height, Vector3f secondAxis, float scaleU, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) voidvoidvoiddrawPointCloud(float[] locations, float pointSize, Tuple3f color, int highlight, Matrix4d t) Draw a set of points.final voiddrawPolygon(int vertex, Polygon polygon) voiddrawPolygons(Polygonizable pz, Object obj, boolean asNode, Shader sh, int highlight, boolean asWireframe, Matrix4d t) voiddrawPrismRectangular(float y, float xPos, float xNeg, float zPos, float zNeg, int highlight, boolean asWireframe, Matrix4d t) final voiddrawRect(int vertex, int dx, int dy, int width, int height) voiddrawRectangle(int x, int y, int w, int h, Tuple3f color) voiddrawSphere(float radius, Shader sh, int highlight, boolean asWireframe, Matrix4d t) voiddrawSphereSegmentSolid(float radius, float theta1M, float theta2M, float phiM, Shader s, int highlight, boolean asWireframe, Matrix4d t) final voiddrawString(int vertex, int dx, int dy, String s) voiddrawString(int x, int y, String text, Font font, Tuple3f color) voiddrawSupershape(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).voiddrawTextBlock(String caption, Font font, float depth, Shader s, int highlight, boolean asWireframe, Matrix4d t) floatestimateScaleAt(Tuple3f point) final voidfillPolygon(int vertex, Polygon polygon) final voidfillRect(int vertex, int dx, int dy, int width, int height) voidfillRectangle(int x, int y, int w, int h, Tuple3f color) protected voidfinal ColorgetColor()intgetPool()booleangetWindowPos(Tuple3f origin, Tuple2f out) Computes the window coordinates in pixels of a location in the current object coordinates.protected voidinitPaint(int flags, int width, int height) voidinitView(View view, EventListener listener) Initializes this component.final voidopenLayer(int layer) protected voidoptionValueChanged(String name, Object value) protected voidpaintHighlight(int flags, Graphics2D g) protected voidpaintScene(int flags, Graphics2D g) protected voidpaintSceneNew(int flags, Graphics2D g) voidfinal voidfinal voidfinal voidsetVertex(int index, float x, float y, float z) final voidfinal voidfinal voidfinal voidvoidupdateResolution(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, writeEPSMethods 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, uninstallListenersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.grogra.imp3d.RenderState
getFontMetrics, getRenderGraphStateMethods 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:
updateResolutionin interfaceViewComponent- Overrides:
updateResolutionin classViewComponentAdapter
-
initView
Description copied from interface:ViewComponentInitializes this component. This method sets theviewwithin 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:
initViewin interfaceViewComponent- Overrides:
initViewin 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:
initPaintin classCanvasAdapter
-
paintScene
- Specified by:
paintScenein classCanvasAdapter- Throws:
InterruptedException
-
displayOverlay
protected void displayOverlay() -
clearOverlay
protected void clearOverlay() -
paintSceneNew
- Throws:
InterruptedException
-
paintHighlight
- Specified by:
paintHighlightin classCanvasAdapter
-
finalizePaint
protected void finalizePaint() -
setColor
- Specified by:
setColorin 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:
getPoolin interfaceRenderState
-
getCurrentShader
- Specified by:
getCurrentShaderin interfaceRenderState
-
getCurrentHighlight
public int getCurrentHighlight()- Specified by:
getCurrentHighlightin interfaceRenderState
-
estimateScaleAt
- Specified by:
estimateScaleAtin interfaceRenderState
-
drawPoint
- Specified by:
drawPointin interfaceRenderState
-
drawPointCloud
public void drawPointCloud(float[] locations, float pointSize, Tuple3f color, int highlight, Matrix4d t) Description copied from interface:RenderStateDraw 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:
drawPointCloudin interfaceRenderState- Parameters:
locations- array containing a sequence (x,y,z) of pointspointSize- size of the point on screencolor- color of the pointhighlight-t- transformation of the point cloud
-
drawLine
- Specified by:
drawLinein interfaceRenderState
-
drawPlane
- Specified by:
drawPlanein interfaceRenderState
-
drawBox
public void drawBox(float halfWidth, float halfLength, float height, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawBoxin interfaceRenderState- Parameters:
halfWidth-halfLength-height-sh-highlight-t-
-
drawLamella
public void drawLamella(float halfWidth, float halfLength, float height, float a, float b, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawLamellain interfaceRenderState- Parameters:
halfWidth-halfLength-height-a- amplitudeb- frequencysh-highlight-t-
-
drawSphere
- Specified by:
drawSpherein interfaceRenderState
-
drawSphereSegmentSolid
public void drawSphereSegmentSolid(float radius, float theta1M, float theta2M, float phiM, Shader s, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawSphereSegmentSolidin interfaceRenderState
-
drawTextBlock
public void drawTextBlock(String caption, Font font, float depth, Shader s, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawTextBlockin 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:
drawSupershapein interfaceRenderState- Parameters:
a- , b length of curveshighlight-t- transformation of the point cloudm- , n shape parametersshader-
-
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:
drawFrustumin interfaceRenderState- Parameters:
height-baseRadius-topRadius-baseClosed-topClosed-scaleV-sh-highlight-t-
-
drawParallelogram
public void drawParallelogram(float height, Vector3f secondAxis, float scaleU, float scaleV, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawParallelogramin interfaceRenderState
-
drawPolygons
public void drawPolygons(Polygonizable pz, Object obj, boolean asNode, Shader sh, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawPolygonsin interfaceRenderState- Parameters:
pz-obj-asNode-sh-highlight-t-
-
getWindowPos
Description copied from interface:RenderStateComputes the window coordinates in pixels of a location in the current object coordinates.- Specified by:
getWindowPosin interfaceRenderState- Parameters:
origin- a location in local object coordinatesout- the computed window coordinates are placed in here- Returns:
trueiff the window coordinates are valid (i.e., the location is in the clipping region)
-
drawRectangle
- Specified by:
drawRectanglein interfaceRenderState
-
fillRectangle
- Specified by:
fillRectanglein interfaceRenderState
-
drawString
- Specified by:
drawStringin interfaceRenderState
-
optionValueChanged
- Overrides:
optionValueChangedin 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:
drawFrustumIrregularin interfaceRenderState
-
drawPrismRectangular
public void drawPrismRectangular(float y, float xPos, float xNeg, float zPos, float zNeg, int highlight, boolean asWireframe, Matrix4d t) - Specified by:
drawPrismRectangularin interfaceRenderState- Parameters:
y-xPos-xNeg-zPos-zNeg-highlight-t-
-