Package geomss.app
Class GeomSSBatch.PublicScene
- java.lang.Object
-
- geomss.app.GeomSSBatch.PublicScene
-
- All Implemented Interfaces:
GeomSSScene
- Enclosing class:
- GeomSSBatch
public static class GeomSSBatch.PublicScene extends java.lang.Object implements GeomSSScene
A class that serves as the public interface (in BeanShell) for this application's 3D scene.
-
-
Constructor Summary
Constructors Constructor Description PublicScene()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
center()
Centers the geometry in the display.void
centerAndZoom()
Centers the geometry in the display and zooms until the geometry fills the display.void
draw(GeomElement newGeom)
Draws the specified geometry element into the 3D scene without erasing the existing geometry.void
draw(GeomElement newGeom, boolean erase)
Draws the specified geometry element in the 3D scene.void
erase()
Erases all the geometry from the 3D scene.void
erase(GeomElement geometry)
Erases the specified geometry from the 3D scene (if possible).Parameter<javax.measure.quantity.Length>
getDrawTolerance()
Return the tolerance used when drawing parametric objects such as curves and surfaces.java.awt.Color
getLineColor()
Returns the color used when rendering curves and lines.int
getLineWidth()
Return the width that line/curve objects are rendered in pixels.java.awt.Color
getPointColor()
Returns the color used when rendering points.int
getPointSize()
Return the size that Point objects are rendered in pixels.ProjectionPolicy
getProjectionPolicy()
Retrieves the current projection policy for this scene.RenderType
getRenderType()
Returns therendering type
for the 1st item in the scene.float
getSurfaceAlpha()
Get the alpha or transparency used when rendering surfaces or point-arrays.java.awt.Color
getSurfaceColor(SurfaceColorType colorType)
Get the color (of the specified type) used to render surfaces and point-arrays.float
getSurfaceShininess()
Get the shininess used when rendering surfaces and point-arrays.boolean
isMirrored()
Returns a flag indicating if the geometry display is currently mirrored about the XZ plane of symmetry or not.GeomList
pick()
Pick items from the scene by control-clicking with the mouse.void
setDrawTolerance(Parameter<javax.measure.quantity.Length> tol)
Set the tolerance used when drawing parametric objects such as curves and surfaces.void
setLineColor(java.awt.Color color)
Sets the color used when rendering curves and lines.void
setLineWidth(int pixels)
Set the width that line/curve objects are rendered in pixels.void
setMirrored(boolean mirrored)
Sets a flag indicating that the geometry is mirrored about the XZ plane of symmetry.void
setPointColor(java.awt.Color color)
Sets the color used when rendering points.void
setPointSize(int pixels)
Set the size that Point objects are rendered in pixels.void
setProjectionPolicy(ProjectionPolicy policy)
Sets the projection policy for this scene.void
setRenderType(RenderType type)
Setsrendering type
for all the objects currently displayed in the entire scene.void
setSurfaceAlpha(float alpha)
Set the alpha or transparency used to render surfaces and point-arrays.void
setSurfaceColor(SurfaceColorType colorType, java.awt.Color color)
Set the color (of the specified type) used to render surfaces and point-arrays.void
setSurfaceShininess(float shininess)
Set the shininess used when rendering surfaces and point-arrays.
-
-
-
Constructor Detail
-
PublicScene
public PublicScene()
-
-
Method Detail
-
draw
public void draw(GeomElement newGeom)
Description copied from interface:GeomSSScene
Draws the specified geometry element into the 3D scene without erasing the existing geometry. This is identical todraw(newGeom, false);
.- Specified by:
draw
in interfaceGeomSSScene
- Parameters:
newGeom
- The new geometry to be displayed on the 3D canvas.
-
draw
public void draw(GeomElement newGeom, boolean erase)
Description copied from interface:GeomSSScene
Draws the specified geometry element in the 3D scene.- Specified by:
draw
in interfaceGeomSSScene
- Parameters:
newGeom
- The new geometry to be displayed on the 3D canvas.erase
- Set totrue
to erase the geometry currently displayed. Set tofalse
to add the new geometry to the existing display.
-
erase
public void erase()
Description copied from interface:GeomSSScene
Erases all the geometry from the 3D scene.- Specified by:
erase
in interfaceGeomSSScene
-
erase
public void erase(GeomElement geometry)
Erases the specified geometry from the 3D scene (if possible).- Specified by:
erase
in interfaceGeomSSScene
- Parameters:
geometry
- The specific geometry to be erased from the 3D scene.
-
center
public void center()
Centers the geometry in the display.- Specified by:
center
in interfaceGeomSSScene
-
centerAndZoom
public void centerAndZoom()
Centers the geometry in the display and zooms until the geometry fills the display.- Specified by:
centerAndZoom
in interfaceGeomSSScene
-
pick
public GeomList pick()
Pick items from the scene by control-clicking with the mouse. Returns a list of selected items.- Specified by:
pick
in interfaceGeomSSScene
- Returns:
- A list of picked items.
-
setMirrored
public void setMirrored(boolean mirrored)
Sets a flag indicating that the geometry is mirrored about the XZ plane of symmetry.- Specified by:
setMirrored
in interfaceGeomSSScene
- Parameters:
mirrored
- Set totrue
to turn on mirroring.
-
isMirrored
public boolean isMirrored()
Returns a flag indicating if the geometry display is currently mirrored about the XZ plane of symmetry or not.- Specified by:
isMirrored
in interfaceGeomSSScene
- Returns:
- a flag indicating if the geometry display is currently mirrored about the XZ plane of symmetry or not.
-
setRenderType
public void setRenderType(RenderType type)
Setsrendering type
for all the objects currently displayed in the entire scene.- Specified by:
setRenderType
in interfaceGeomSSScene
- Parameters:
type
- The render type to set.
-
getRenderType
public RenderType getRenderType()
Returns therendering type
for the 1st item in the scene.- Specified by:
getRenderType
in interfaceGeomSSScene
- Returns:
- the
rendering type
for the 1st item in the scene.
-
setPointColor
public void setPointColor(java.awt.Color color)
Sets the color used when rendering points.- Specified by:
setPointColor
in interfaceGeomSSScene
- Parameters:
color
- The color to use for points drawn in the future.
-
getPointColor
public java.awt.Color getPointColor()
Returns the color used when rendering points.- Specified by:
getPointColor
in interfaceGeomSSScene
- Returns:
- the color used when rendering points.
-
setPointSize
public void setPointSize(int pixels)
Set the size that Point objects are rendered in pixels.- Specified by:
setPointSize
in interfaceGeomSSScene
- Parameters:
pixels
- The number of pixels to use when displaying points.
-
getPointSize
public int getPointSize()
Return the size that Point objects are rendered in pixels.- Specified by:
getPointSize
in interfaceGeomSSScene
- Returns:
- the size that Point objects are rendered in pixels.
-
setLineColor
public void setLineColor(java.awt.Color color)
Sets the color used when rendering curves and lines.- Specified by:
setLineColor
in interfaceGeomSSScene
- Parameters:
color
- The color to use when rendering lines in the future.
-
getLineColor
public java.awt.Color getLineColor()
Returns the color used when rendering curves and lines.- Specified by:
getLineColor
in interfaceGeomSSScene
- Returns:
- the color used when rendering curves and lines.
-
setLineWidth
public void setLineWidth(int pixels)
Set the width that line/curve objects are rendered in pixels.- Specified by:
setLineWidth
in interfaceGeomSSScene
- Parameters:
pixels
- The number of pixels line-width to use when rendering lines.
-
getLineWidth
public int getLineWidth()
Return the width that line/curve objects are rendered in pixels.- Specified by:
getLineWidth
in interfaceGeomSSScene
- Returns:
- the width that line/curve objects are rendered in pixels.
-
setDrawTolerance
public void setDrawTolerance(Parameter<javax.measure.quantity.Length> tol)
Set the tolerance used when drawing parametric objects such as curves and surfaces. This tolerance is used when determining how to subdivide parametric objects for rendering. If the input value isnull
or equal to0
, it will be silently ignored.- Specified by:
setDrawTolerance
in interfaceGeomSSScene
- Parameters:
tol
- The tolerance used when drawing parametric objects such as curves and surfaces.
-
getDrawTolerance
public Parameter<javax.measure.quantity.Length> getDrawTolerance()
Return the tolerance used when drawing parametric objects such as curves and surfaces. This tolerance is used when determining how to subdivide parametric objects for rendering.- Specified by:
getDrawTolerance
in interfaceGeomSSScene
- Returns:
- The tolerance used when drawing parametric objects such as curves and surfaces.
-
getProjectionPolicy
public ProjectionPolicy getProjectionPolicy()
Retrieves the current projection policy for this scene. returns- Specified by:
getProjectionPolicy
in interfaceGeomSSScene
- Returns:
- the current projection policy for this scene.
-
setProjectionPolicy
public void setProjectionPolicy(ProjectionPolicy policy)
Sets the projection policy for this scene. This specifies the type of projection transform that will be generated. A value of PARALLEL_PROJECTION specifies that a parallel projection transform is generated. A value of PERSPECTIVE_PROJECTION specifies that a perspective projection transform is generated.- Specified by:
setProjectionPolicy
in interfaceGeomSSScene
- Parameters:
policy
- The new projection policy, one of PARALLEL_PROJECTION or PERSPECTIVE_PROJECTION.
-
setSurfaceColor
public void setSurfaceColor(SurfaceColorType colorType, java.awt.Color color)
Set the color (of the specified type) used to render surfaces and point-arrays.- Specified by:
setSurfaceColor
in interfaceGeomSSScene
- Parameters:
colorType
- The aspect or type of the surface color that is being set.color
- The color to use for the specified type of surface color. The alpha is ignored.- See Also:
setSurfaceAlpha(float)
-
getSurfaceColor
public java.awt.Color getSurfaceColor(SurfaceColorType colorType)
Get the color (of the specified type) used to render surfaces and point-arrays.- Specified by:
getSurfaceColor
in interfaceGeomSSScene
- Parameters:
colorType
- The aspect or type of the surface color that is being set. If AMBIENT_AND_DIFFUSE is passed in, then only the ambient color is returned!- Returns:
- The color used for the specified type of surface color. Alpha is ignored.
- See Also:
getSurfaceAlpha()
-
setSurfaceAlpha
public void setSurfaceAlpha(float alpha)
Set the alpha or transparency used to render surfaces and point-arrays.- Specified by:
setSurfaceAlpha
in interfaceGeomSSScene
- Parameters:
alpha
- The alpha value to use (0.0=completely transparent, 1.0=completely opaque).
-
getSurfaceAlpha
public float getSurfaceAlpha()
Get the alpha or transparency used when rendering surfaces or point-arrays.- Specified by:
getSurfaceAlpha
in interfaceGeomSSScene
- Returns:
- The alpha value used (0.0=completely transparent, 1.0=completely opaque).
-
setSurfaceShininess
public void setSurfaceShininess(float shininess)
Set the shininess used when rendering surfaces and point-arrays.- Specified by:
setSurfaceShininess
in interfaceGeomSSScene
- Parameters:
shininess
- The shininess to use in the range [0.0, 1.0] where 0.0 is not shiny and 1.0 is very shiny. Values outside this range are clamped.
-
getSurfaceShininess
public float getSurfaceShininess()
Get the shininess used when rendering surfaces and point-arrays.- Specified by:
getSurfaceShininess
in interfaceGeomSSScene
- Returns:
- The shininess to use in the range [0.0, 1.0] where 0.0 is not shiny and 1.0 is very shiny.
-
-