public class RenderableUtils
extends java.lang.Object
Constructor and Description |
---|
RenderableUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
cloneRenderProps(Renderable r)
Sets the RenderProps of a Renderable object to a copy of its existing
RenderProps.
|
static void |
drawPoints(Renderer renderer,
RenderObject rob,
int gidx,
RenderProps props,
boolean selected)
Draws the points in a specified point group of a
RenderObject ,
using the shading, point style and point coloring specified by the
supplied RenderProps . |
static void |
drawTriangles(Renderer renderer,
RenderObject rob,
int gidx,
RenderProps props,
boolean selected)
Draws the triangles in a specified triangle group of a
RenderObject ,
using the shading, face style and face coloring specified by the
supplied RenderProps . |
static void |
getBounds(IsRenderable r,
Point3d min,
Point3d max)
Computes the bounds for a Renderable.
|
static double |
getRadius(IsRenderable r)
Returns a "radius" for a Renderable.
|
static double |
getRadiusAndCenter(Point3d center,
IsRenderable r)
Returns a "radius" and a center for a Renderable.
|
static boolean |
isVisible(HasRenderProps renderable)
Returns true if a Renderable is visible.
|
static void |
updateBounds(Vector3d vmin,
Vector3d vmax,
float[] vals) |
static void |
updateFrameBounds(Vector3d vmin,
Vector3d vmax,
RigidTransform3d TFW,
double len)
Update bounds to account for the coordinate frame TFW drawn with length
len.
|
static void |
updateSphereBounds(Vector3d vmin,
Vector3d vmax,
Vector3d center,
double radius)
Update bounds to account for a sphere with a given width and radius.
|
public static boolean isVisible(HasRenderProps renderable)
public static void cloneRenderProps(Renderable r)
getRenderProps
returns null
),
then this method does nothing.
This routine is used to prevent side-effects when the existing RenderProps are shared by more than one object.
r
- Renderable objects whose RenderProps are to be cloned.public static double getRadius(IsRenderable r)
public static double getRadiusAndCenter(Point3d center, IsRenderable r)
public static void getBounds(IsRenderable r, Point3d min, Point3d max)
r
- Renderable to compute bounds formin
- minimum coordinate values (optional)max
- maximum coordinate values (optional)public static void updateSphereBounds(Vector3d vmin, Vector3d vmax, Vector3d center, double radius)
public static void updateFrameBounds(Vector3d vmin, Vector3d vmax, RigidTransform3d TFW, double len)
public static void drawPoints(Renderer renderer, RenderObject rob, int gidx, RenderProps props, boolean selected)
RenderObject
,
using the shading, point style and point coloring specified by the
supplied RenderProps
.renderer
- renderer used to draw the pointsrob
- render object containing the pointsgidx
- point group index within the render objectprops
- specifies the shading, point style and point coloringselected
- if true
, sets the color to the highlighting
colorpublic static void drawTriangles(Renderer renderer, RenderObject rob, int gidx, RenderProps props, boolean selected)
RenderObject
,
using the shading, face style and face coloring specified by the
supplied RenderProps
.renderer
- renderer used to draw the trianglesrob
- render object containing the trianglesgidx
- triangle group index within the render objectprops
- specifies the shading, face style and face coloringselected
- if true
, sets the color to the highlighting
color