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 Point
s'
colors.
Wireframeable
objects have faces which may reflect lights if there is any light switched
on in the chart.- Author:
- Martin Pernollet
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
if true, may change depth function while rendering wireframe to avoid Z-fighting with polygon face.protected boolean
protected Color
protected Color
protected Color
protected float[]
protected Color
static float
The higher the value, the more the line are far from the faces and hence no z-fighting occurs between faces and lines.protected float
protected boolean
if 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 float
protected boolean
if true, may change the depth range to set lines and polygons in different spaces.protected boolean
protected Color
protected boolean
protected boolean
protected float
protected boolean
if 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
ConstructorDescriptionInitialize the wireframeable with a white color and width of 1 for wires, hidden wireframe, and displayed faces. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyDepthRangeDefault
(IPainter painter) protected void
applyDepthRangeForOverlying
(IPainter painter) protected void
applyDepthRangeForUnderlying
(IPainter painter) protected void
applyMaterial
(IPainter painter) Applies material settingsprotected void
doDrawBoundsIfDisplayed
(IPainter painter) float
float
float
Get the wireframe color.float
Get the wireframe width.boolean
Get the face display status to on or off.boolean
boolean
boolean
boolean
boolean
Get the wireframe display status to on or off.protected void
polygonOffsetFillDisable
(IPainter painter) protected void
polygonOffsetFillEnable
(IPainter painter) protected void
polygonOffsetLineDisable
(IPainter painter) protected void
polygonOffsetLineEnable
(IPainter painter) void
setFaceDisplayed
(boolean status) Set the face display status to on or off.void
setMaterialAmbiantReflection
(Color materialAmbiantReflection) void
setMaterialDiffuseReflection
(Color materialDiffuseReflection) void
setMaterialEmission
(Color materialEmission) void
setMaterialShininess
(float shininess) void
setMaterialSpecularReflection
(Color materialSpecularReflection) void
setPolygonOffsetFactor
(float polygonOffsetFactor) 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.void
setPolygonOffsetUnit
(float polygonOffsetUnit) 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).void
setReflectLight
(boolean reflectLight) If true, drawing this object will set ambient, diffuse, specular and shininess parameters.void
setWireframeColor
(Color color) Set the wireframe color.void
setWireframeColorFromPolygonPoints
(boolean wireframeColorFromPolygonPoints) void
setWireframeDisplayed
(boolean status) Set the wireframe display status to on or off.void
setWireframeWidth
(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:
doDrawBoundsIfDisplayed
in classDrawable
-