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 voidcenter()Centers the geometry in the display.voidcenterAndZoom()Centers the geometry in the display and zooms until the geometry fills the display.voiddraw(GeomElement newGeom)Draws the specified geometry element into the 3D scene without erasing the existing geometry.voiddraw(GeomElement newGeom, boolean erase)Draws the specified geometry element in the 3D scene.voiderase()Erases all the geometry from the 3D scene.voiderase(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.ColorgetLineColor()Returns the color used when rendering curves and lines.intgetLineWidth()Return the width that line/curve objects are rendered in pixels.java.awt.ColorgetPointColor()Returns the color used when rendering points.intgetPointSize()Return the size that Point objects are rendered in pixels.ProjectionPolicygetProjectionPolicy()Retrieves the current projection policy for this scene.RenderTypegetRenderType()Returns therendering typefor the 1st item in the scene.floatgetSurfaceAlpha()Get the alpha or transparency used when rendering surfaces or point-arrays.java.awt.ColorgetSurfaceColor(SurfaceColorType colorType)Get the color (of the specified type) used to render surfaces and point-arrays.floatgetSurfaceShininess()Get the shininess used when rendering surfaces and point-arrays.booleanisMirrored()Returns a flag indicating if the geometry display is currently mirrored about the XZ plane of symmetry or not.GeomListpick()Pick items from the scene by control-clicking with the mouse.voidsetDrawTolerance(Parameter<javax.measure.quantity.Length> tol)Set the tolerance used when drawing parametric objects such as curves and surfaces.voidsetLineColor(java.awt.Color color)Sets the color used when rendering curves and lines.voidsetLineWidth(int pixels)Set the width that line/curve objects are rendered in pixels.voidsetMirrored(boolean mirrored)Sets a flag indicating that the geometry is mirrored about the XZ plane of symmetry.voidsetPointColor(java.awt.Color color)Sets the color used when rendering points.voidsetPointSize(int pixels)Set the size that Point objects are rendered in pixels.voidsetProjectionPolicy(ProjectionPolicy policy)Sets the projection policy for this scene.voidsetRenderType(RenderType type)Setsrendering typefor all the objects currently displayed in the entire scene.voidsetSurfaceAlpha(float alpha)Set the alpha or transparency used to render surfaces and point-arrays.voidsetSurfaceColor(SurfaceColorType colorType, java.awt.Color color)Set the color (of the specified type) used to render surfaces and point-arrays.voidsetSurfaceShininess(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:GeomSSSceneDraws the specified geometry element into the 3D scene without erasing the existing geometry. This is identical todraw(newGeom, false);.- Specified by:
drawin 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:GeomSSSceneDraws the specified geometry element in the 3D scene.- Specified by:
drawin interfaceGeomSSScene- Parameters:
newGeom- The new geometry to be displayed on the 3D canvas.erase- Set totrueto erase the geometry currently displayed. Set tofalseto add the new geometry to the existing display.
-
erase
public void erase()
Description copied from interface:GeomSSSceneErases all the geometry from the 3D scene.- Specified by:
erasein interfaceGeomSSScene
-
erase
public void erase(GeomElement geometry)
Erases the specified geometry from the 3D scene (if possible).- Specified by:
erasein 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:
centerin interfaceGeomSSScene
-
centerAndZoom
public void centerAndZoom()
Centers the geometry in the display and zooms until the geometry fills the display.- Specified by:
centerAndZoomin interfaceGeomSSScene
-
pick
public GeomList pick()
Pick items from the scene by control-clicking with the mouse. Returns a list of selected items.- Specified by:
pickin 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:
setMirroredin interfaceGeomSSScene- Parameters:
mirrored- Set totrueto 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:
isMirroredin 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 typefor all the objects currently displayed in the entire scene.- Specified by:
setRenderTypein interfaceGeomSSScene- Parameters:
type- The render type to set.
-
getRenderType
public RenderType getRenderType()
Returns therendering typefor the 1st item in the scene.- Specified by:
getRenderTypein interfaceGeomSSScene- Returns:
- the
rendering typefor the 1st item in the scene.
-
setPointColor
public void setPointColor(java.awt.Color color)
Sets the color used when rendering points.- Specified by:
setPointColorin 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:
getPointColorin 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:
setPointSizein 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:
getPointSizein 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:
setLineColorin 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:
getLineColorin 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:
setLineWidthin 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:
getLineWidthin 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 isnullor equal to0, it will be silently ignored.- Specified by:
setDrawTolerancein 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:
getDrawTolerancein 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:
getProjectionPolicyin 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:
setProjectionPolicyin 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:
setSurfaceColorin 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:
getSurfaceColorin 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:
setSurfaceAlphain 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:
getSurfaceAlphain 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:
setSurfaceShininessin 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:
getSurfaceShininessin 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.
-
-