public class SurfaceRenderer extends AbstractXYZRenderer implements XYZRenderer, ColorScaleRenderer, java.io.Serializable
Function3D). This renderer is different to others in that it
does not plot data from a dataset, instead it samples a function and plots
those values. By default 900 samples are taken (30 x-values by 30 z-values)
although this can be modified.
drawFaceOutlines flag can be set
to false (the default is true) but this may
cause slight rendering artifacts if anti-aliasing is on (note that switching
off anti-aliasing as well also improves rendering performance).
TRANSPARENT_COLOR| Constructor and Description |
|---|
SurfaceRenderer(Function3D function)
Creates a new renderer for the specified function.
|
| Modifier and Type | Method and Description |
|---|---|
void |
composeAll(XYZPlot plot,
World world,
Dimension3D dimensions,
double xOffset,
double yOffset,
double zOffset)
Composes the entire representation of the function in the supplied
world. |
void |
composeItem(XYZDataset dataset,
int series,
int item,
World world,
Dimension3D dimensions,
double xOffset,
double yOffset,
double zOffset)
Throws an
UnsupportedOperationException because this
renderer does not support per-item rendering. |
boolean |
equals(java.lang.Object obj)
Tests this renderer for equality with an arbitrary object.
|
Range |
findXRange(XYZDataset dataset)
Returns the current range for the x-axis - the method is overridden
because this renderer does not use a dataset (it samples and plots a
function directly).
|
Range |
findYRange(XYZDataset dataset)
Returns the range that the renderer requires on the y-axis to display
all the data in the function.
|
Range |
findZRange(XYZDataset dataset)
Returns the current range for the z-axis - the method is overridden
because this renderer does not use a dataset (it samples and plots a
function directly).
|
ColorScale |
getColorScale()
Returns the color scale.
|
ComposeType |
getComposeType()
Returns the compose-type for the renderer.
|
boolean |
getDrawFaceOutlines()
Returns the flag that controls whether or not the faces that make
up the surface have their outlines drawn during rendering.
|
int |
getXSamples()
Returns the number of samples the renderer will take along the
x-axis when plotting the function.
|
int |
getZSamples()
Returns the number of samples the renderer will take along the z-axis
when plotting the function and sends a
Renderer3DChangeEvent to
all registered listeners. |
void |
setColorScale(ColorScale colorScale)
Sets the color scale and sends a
Renderer3DChangeEvent to all
registered listeners. |
void |
setDrawFaceOutlines(boolean draw)
Sets a flag that controls whether or not the faces that make up the
surface are drawn (as well as filled) and sends a
Renderer3DChangeEvent to all registered listeners. |
void |
setXSamples(int count)
Sets the number of samples the renderer will take along the x-axis when
plotting the function and sends a
Renderer3DChangeEvent to all
registered listeners. |
void |
setZSamples(int count)
Sets the number of samples the renderer will take along the z-axis when
plotting the function and sends a
Renderer3DChangeEvent to all
registered listeners. |
getColorSource, getItemLabelGenerator, getPlot, setColors, setColorSource, setItemLabelGenerator, setPlotaddChangeListener, fireChangeEvent, getItemLabelBackgroundColor, getItemLabelColor, getItemLabelFont, getItemLabelPositioning, isNotify, notifyListeners, receive, removeChangeListener, setItemLabelBackgroundColor, setItemLabelColor, setItemLabelFont, setItemLabelPositioning, setNotifyclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetColorSource, getPlot, setColors, setColorSource, setPlotaddChangeListener, removeChangeListenerreceivepublic SurfaceRenderer(Function3D function)
function - the function (null not permitted).public int getXSamples()
public void setXSamples(int count)
Renderer3DChangeEvent to all
registered listeners. The default value is 30, setting this to higher
values will result in smoother looking plots, but they will take
longer to draw.count - the count.setZSamples(int)public int getZSamples()
Renderer3DChangeEvent to
all registered listeners. The default value is 30.public void setZSamples(int count)
Renderer3DChangeEvent to all
registered listeners. The default value is 30, setting this to higher
values will result in smoother looking plots, but they will take
longer to draw.count - the count.setXSamples(int)public ComposeType getComposeType()
ComposeType.ALL which means the plot will call the
composeAll(com.orsoncharts.plot.XYZPlot,
com.orsoncharts.graphics3d.World, com.orsoncharts.graphics3d.Dimension3D,
double, double, double) method for composing the chart.getComposeType in interface XYZRenderergetComposeType in class AbstractXYZRenderernull).public ColorScale getColorScale()
getColorScale in interface ColorScaleRenderernull).public void setColorScale(ColorScale colorScale)
Renderer3DChangeEvent to all
registered listeners.colorScale - the color scale (null not permitted).public boolean getDrawFaceOutlines()
true.public void setDrawFaceOutlines(boolean draw)
Renderer3DChangeEvent to all registered listeners. If the face
outlines are drawn (the default), the surface is solid (but takes longer
to draw). If the face outlines are not drawn, Java2D can leave small
gaps that you can "see" through (if you don't mind this, then the
performance is better).draw - the new flag value.public void composeAll(XYZPlot plot, World world, Dimension3D dimensions, double xOffset, double yOffset, double zOffset)
world.composeAll in interface XYZRenderercomposeAll in class AbstractXYZRendererplot - the plot.world - the world.dimensions - the plot dimensions.xOffset - the x-offset.yOffset - the y-offset.zOffset - the z-offset.public void composeItem(XYZDataset dataset, int series, int item, World world, Dimension3D dimensions, double xOffset, double yOffset, double zOffset)
UnsupportedOperationException because this
renderer does not support per-item rendering.composeItem in interface XYZRendererdataset - the dataset (null not permitted).series - the series index.item - the item index.world - the world (null not permitted).dimensions - the dimensions (null not permitted).xOffset - the x-offset.yOffset - the y-offset.zOffset - the z-offset.public Range findXRange(XYZDataset dataset)
findXRange in interface XYZRendererfindXRange in class AbstractXYZRendererdataset - the dataset (ignored).null).public Range findYRange(XYZDataset dataset)
findYRange in interface XYZRendererfindYRange in class AbstractXYZRendererdataset - the dataset (ignored).public Range findZRange(XYZDataset dataset)
findZRange in interface XYZRendererfindZRange in class AbstractXYZRendererdataset - the dataset (ignored).null).public boolean equals(java.lang.Object obj)
equals in class AbstractXYZRendererobj - the object (null not permitted).