Package org.jzy3d.plot3d.primitives
Class Wireframeable
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.Wireframeable
- All Implemented Interfaces:
IGLRenderer,ISortableDraw
- Direct Known Subclasses:
AbstractEnlightable,CompileableComposite,Composite,CubeGLUT,Disk,DrawableBoundingBox,DrawableVBO2,Geometry,LineStrip,Parallelepiped,Sphere,Teapot,Tube
An
Wireframeable is a Drawable that has a wireframe mode for display, i.e. almost
all objects except Point.
Defining an object as Wireframeable means this object will have a wireframe mode status
(on/off), a wireframe color, and a wireframe width. As a consequence of being
Wireframeable, a 3d object may have its faces displayed or not by
setFaceDisplayed(boolean).
Wireframe coloring can either be based on the wireframe color or the geometry Points'
colors.
Wireframeable objects have faces which may reflect lights if there is any light switched
on in the chart.- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanif true, may change depth function while rendering wireframe to avoid Z-fighting with polygon face.protected booleanprotected Colorprotected Colorprotected Colorprotected float[]protected Colorstatic floatThe higher the value, the more the line are far from the faces and hence no z-fighting occurs between faces and lines.protected floatprotected booleanif true, enable polygon offset fill, which is the most clean way of handling polygon fill / line Z fighting, but only available in native mode (not emulgl)protected floatprotected booleanif true, may change the depth range to set lines and polygons in different spaces.protected booleanprotected Colorprotected booleanprotected booleanprotected floatprotected booleanif true, use line loop for rendering polygon border, otherwise use polygon mode + line mode.Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore -
Constructor Summary
ConstructorsConstructorDescriptionInitialize the wireframeable with a white color and width of 1 for wires, hidden wireframe, and displayed faces. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyDepthRangeDefault(IPainter painter) protected voidapplyDepthRangeForOverlying(IPainter painter) protected voidapplyDepthRangeForUnderlying(IPainter painter) protected voidapplyMaterial(IPainter painter) Applies material settingsprotected voiddoDrawBoundsIfDisplayed(IPainter painter) floatfloatfloatGet the wireframe color.floatGet the wireframe width.booleanGet the face display status to on or off.booleanbooleanbooleanbooleanbooleanGet the wireframe display status to on or off.protected voidpolygonOffsetFillDisable(IPainter painter) protected voidpolygonOffsetFillEnable(IPainter painter) protected voidpolygonOffsetLineDisable(IPainter painter) protected voidpolygonOffsetLineEnable(IPainter painter) voidsetFaceDisplayed(boolean status) Set the face display status to on or off.voidsetMaterialAmbiantReflection(Color materialAmbiantReflection) voidsetMaterialDiffuseReflection(Color materialDiffuseReflection) voidsetMaterialEmission(Color materialEmission) voidsetMaterialShininess(float shininess) voidsetMaterialSpecularReflection(Color materialSpecularReflection) voidsetPolygonOffsetFactor(float polygonOffsetFactor) voidsetPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) Enable offset fill, which let a polygon with a wireframe render cleanly without weird depth uncertainty between face polygon and wireframe polygon.voidsetPolygonOffsetUnit(float polygonOffsetUnit) voidsetPolygonWireframeDepthTrick(boolean polygonWireframeDepthTrick) May be used as alternative tosetPolygonOffsetFillEnable(boolean)in case it is not supported by underlying OpenGL version (Polygon offset appears as off version 2).voidsetReflectLight(boolean reflectLight) If true, drawing this object will set ambient, diffuse, specular and shininess parameters.voidsetWireframeColor(Color color) Set the wireframe color.voidsetWireframeColorFromPolygonPoints(boolean wireframeColorFromPolygonPoints) voidsetWireframeDisplayed(boolean status) Set the wireframe display status to on or off.voidsetWireframeWidth(float width) Set the wireframe width.Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, applyGeometryTransform, asWireframeable, dispose, doTransform, draw, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString, updateBounds
-
Field Details
-
wireframeColor
-
wireframeWidth
protected float wireframeWidth -
wireframeDisplayed
protected boolean wireframeDisplayed -
wireframeColorFromPolygonPoints
protected boolean wireframeColorFromPolygonPoints -
faceDisplayed
protected boolean faceDisplayed -
wireframeWithLineLoop
protected boolean wireframeWithLineLoopif true, use line loop for rendering polygon border, otherwise use polygon mode + line mode. -
depthFunctionChangeForWireframe
protected boolean depthFunctionChangeForWireframeif true, may change depth function while rendering wireframe to avoid Z-fighting with polygon face. -
polygonWireframeDepthTrick
protected boolean polygonWireframeDepthTrickif true, may change the depth range to set lines and polygons in different spaces. Not accurate. -
polygonOffsetFillEnable
protected boolean polygonOffsetFillEnableif true, enable polygon offset fill, which is the most clean way of handling polygon fill / line Z fighting, but only available in native mode (not emulgl) -
polygonOffsetFactor
protected float polygonOffsetFactor -
polygonOffsetUnit
protected float polygonOffsetUnit -
reflectLight
protected boolean reflectLight -
materialAmbiantReflection
-
materialDiffuseReflection
-
materialSpecularReflection
-
materialEmission
-
materialShininess
protected float[] materialShininess -
NO_OVERLAP_DEPTH_RATIO
public static float NO_OVERLAP_DEPTH_RATIOThe higher the value, the more the line are far from the faces and hence no z-fighting occurs between faces and lines. In case of higher value, line will be display more often, but also lines that should be behind the polygon
-
-
Constructor Details
-
Wireframeable
public Wireframeable()Initialize the wireframeable with a white color and width of 1 for wires, hidden wireframe, and displayed faces.
-
-
Method Details
-
isWireframeColorFromPolygonPoints
public boolean isWireframeColorFromPolygonPoints() -
setWireframeColorFromPolygonPoints
public void setWireframeColorFromPolygonPoints(boolean wireframeColorFromPolygonPoints) -
setWireframeColor
Set the wireframe color. -
setWireframeDisplayed
public void setWireframeDisplayed(boolean status) Set the wireframe display status to on or off. -
setWireframeWidth
public void setWireframeWidth(float width) Set the wireframe width. -
setFaceDisplayed
public void setFaceDisplayed(boolean status) Set the face display status to on or off. -
getWireframeColor
Get the wireframe color. -
isWireframeDisplayed
public boolean isWireframeDisplayed()Get the wireframe display status to on or off. -
getWireframeWidth
public float getWireframeWidth()Get the wireframe width. -
isFaceDisplayed
public boolean isFaceDisplayed()Get the face display status to on or off. -
polygonOffsetFillEnable
-
polygonOffsetFillDisable
-
polygonOffsetLineEnable
-
polygonOffsetLineDisable
-
isPolygonOffsetFillEnable
public boolean isPolygonOffsetFillEnable() -
setPolygonOffsetFillEnable
public void setPolygonOffsetFillEnable(boolean polygonOffsetFillEnable) Enable offset fill, which let a polygon with a wireframe render cleanly without weird depth uncertainty between face polygon and wireframe polygon. -
getPolygonOffsetFactor
public float getPolygonOffsetFactor() -
setPolygonOffsetFactor
public void setPolygonOffsetFactor(float polygonOffsetFactor) -
getPolygonOffsetUnit
public float getPolygonOffsetUnit() -
setPolygonOffsetUnit
public void setPolygonOffsetUnit(float polygonOffsetUnit) -
setPolygonWireframeDepthTrick
public void setPolygonWireframeDepthTrick(boolean polygonWireframeDepthTrick) May be used as alternative tosetPolygonOffsetFillEnable(boolean)in case it is not supported by underlying OpenGL version (Polygon offset appears as off version 2). -
isPolygonWireframeDepthTrick
public boolean isPolygonWireframeDepthTrick() -
applyDepthRangeForUnderlying
-
applyDepthRangeForOverlying
-
applyDepthRangeDefault
-
isReflectLight
public boolean isReflectLight() -
setReflectLight
public void setReflectLight(boolean reflectLight) If true, drawing this object will set ambient, diffuse, specular and shininess parameters. If the drawable has no normal defined, then the normal will be automatically processed.- Parameters:
reflectLight-
-
applyMaterial
Applies material settings -
getMaterialAmbiantReflection
-
setMaterialAmbiantReflection
-
getMaterialDiffuseReflection
-
setMaterialDiffuseReflection
-
getMaterialSpecularReflection
-
setMaterialSpecularReflection
-
getMaterialEmission
-
setMaterialEmission
-
getMaterialShininess
public float getMaterialShininess() -
setMaterialShininess
public void setMaterialShininess(float shininess) -
doDrawBoundsIfDisplayed
- Overrides:
doDrawBoundsIfDisplayedin classDrawable
-