public final class J3DUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
J3DUtils.OffScreenCanvas3D
Class to create offscreen from canvas 3D
|
static class |
J3DUtils.ThreeDDemoKnot
This class is @serial
|
Modifier and Type | Field and Description |
---|---|
static javax.vecmath.Color3f |
black
standard colors to be used by materials
|
static javax.media.j3d.BoundingSphere |
infiniteBounds |
static J3DAlpha |
jAlpha |
static javax.vecmath.Color3f |
plastic
standard colors to be used by materials
|
Constructor and Description |
---|
J3DUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.media.j3d.Node |
addCylinder(java.awt.geom.Point2D[] points,
double distance,
double thickness,
javax.media.j3d.Appearance ap,
javax.media.j3d.TransformGroup objTrans)
Method to add a cylindrical shaped element
|
static javax.media.j3d.Shape3D |
addLine3D(javax.vecmath.Point3d[] pts,
javax.media.j3d.Appearance ap,
javax.media.j3d.TransformGroup objTrans)
Simple method to generate lines
|
static javax.media.j3d.Shape3D |
addPolyhedron(java.awt.geom.PathIterator pIt,
double distance,
double thickness,
javax.media.j3d.Appearance ap,
javax.media.j3d.TransformGroup objTrans) |
static javax.media.j3d.Shape3D |
addPolyhedron(java.awt.geom.Rectangle2D bounds,
double distance,
double thickness,
javax.media.j3d.Appearance ap,
javax.media.j3d.TransformGroup objTrans)
Method to add a polyhedron to the transformation group
|
static javax.media.j3d.Shape3D |
addShape3D(javax.vecmath.Point3d[] pts,
int listLen,
javax.media.j3d.Appearance ap,
javax.media.j3d.TransformGroup objTrans)
Simple method to generate polyhedra
|
static javax.media.j3d.Shape3D |
addText(java.lang.String text,
double x,
double y,
double z,
javax.media.j3d.Appearance ap,
javax.media.j3d.TransformGroup objTrans) |
static double |
convertToRadiant(double degrees) |
static double[] |
convertValues(java.lang.String[] stringValues) |
static void |
correctNormals(java.util.List<javax.vecmath.Point3d> topList,
java.util.List<javax.vecmath.Point3d> bottomList)
Method to correct points sequence to obtain valid normals
|
static void |
createBackground(javax.media.j3d.BranchGroup scene)
Create the background node based on given background color
|
static void |
createLights(javax.media.j3d.BranchGroup scene)
Create the lights (directional and ambient) for the given scene graph
based on User's data
|
static javax.vecmath.Quat4f |
createQuaternionFromEuler(double angleX,
double angleY,
double angleZ)
Convert three rotations about the Euler axes to a quaternion.
|
static int |
get3DAlpha()
Method to get current alpha speed for 3D demos
The default is 1000
|
static int[] |
get3DColorAxes()
Method to get the color of the axes on the 3D display.
|
static void |
get3DColorsInTab(java.util.Map<User.ColorPrefType,java.lang.String> nameTypeSpecialMap)
Color Tab SECTION
|
static double |
get3DFactor()
Method to get current scale factor for Z values.
|
static java.lang.String |
get3DLightDirs()
Method to return the first light direction.
|
static int |
get3DMaxNumNodes()
Method to get maximum number of nodes to consider a scene graph.
|
static double |
get3DOrigZoom()
Method to get original zoom factor for the view
The default is 1
|
static java.lang.String |
get3DRotation()
Method to get default rotation for the view along X, Y and Z
The default is (0 0 0) and values are in radiant
|
static int |
getFactory3DAlpha()
Method to get current alpha speed for 3D demos, by default.
|
static double |
getFactory3DFactor()
Method to get current scale factor for Z values, by default.
|
static java.lang.String |
getFactory3DLightDirs()
Method to return the first light direction, by default.
|
static int |
getFactory3DMaxNumNodes()
Method to get maximum number of nodes to consider a scene graph, by default.
|
static double |
getFactory3DOrigZoom()
Method to get original zoom factor for the view, by default.
|
static java.lang.String |
getFactory3DRotation()
Method to get factory default rotation for the view along X, Y and Z
|
static com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame |
getNextKBKeyFrame(float ratio,
J3DUtils.ThreeDDemoKnot knot)
Method to generate each individual frame key for the interpolation
based on Poly information
|
static com.sun.j3d.utils.behaviors.interpolators.TCBKeyFrame |
getNextTCBKeyFrame(float ratio,
J3DUtils.ThreeDDemoKnot knot) |
static boolean |
is3DAntialiasing()
Method to tell whether to use antialiasing in 3D view.
|
static boolean |
is3DAxesOn()
Method to tell whether to draw 3D axes or not.
|
static boolean |
is3DCellBndOn()
Method to tell whether to draw bounding box for the cells.
|
static boolean |
is3DPerspective()
Method to tell whether to draw 3D views with perspective.
|
static boolean |
isFactory3DAntialiasing()
Method to tell whether to use antialiasing in 3D view, by default.
|
static boolean |
isFactory3DAxesOn()
Method to tell whether to draw 3D axes or not, by default.
|
static boolean |
isFactory3DCellBndOn()
Method to tell whether to draw bounding box for the cells, by default.
|
static boolean |
isFactory3DPerspective()
Method to tell whether to draw 3D views with perspective, by default.
|
static java.lang.String[] |
parseValues(java.lang.String line,
int lineNumner)
To parse capacitance data from line
Format: posX posY posZ rotX rotY rotZ rotPosX rotPosY rotPosZ capacitance radius error
|
static java.util.List<J3DUtils.ThreeDDemoKnot> |
readDemoDataFromFile(View3DWindow view3D)
Method to generate knots for interpolator from a file
|
static void |
set3DAlpha(int value)
Method to set 3D alpha speed
|
static void |
set3DAntialiasing(boolean on)
Method to set whether to draw 3D views with perspective.
|
static void |
set3DAxesOn(boolean on)
Method to set whether to draw 3D axes or not.
|
static void |
set3DCellBndOn(boolean on)
Method to set whether to draw bounding box for the cells.
|
static void |
set3DFactor(double value)
Method to set 3D scale factor
|
static void |
set3DLightDirs(java.lang.String c)
Method to set the first light direction.
|
static void |
set3DMaxNumNodes(int num)
Method to set maximum number of nodes to display in 3D view.
|
static void |
set3DOrigZoom(double value)
Method to set default zoom factor
|
static void |
set3DPerspective(boolean on)
Method to set whether to draw 3D views with perspective.
|
static void |
set3DRotation(java.lang.String value)
Method to set default rotation angles along X, Y and Z.
|
static void |
setAlpha(int speed)
Create alpha according to given interval time in milliseconds
|
static void |
setAmbientalColor(java.lang.Object initValue)
Method to set ambient color
|
static void |
setBackgroundColor(java.lang.Object initValue)
Method to set background color
|
static void |
setDirectionalColor(java.lang.Object initValue)
Method to set directional color
|
static void |
setDirections(java.lang.Object initValue)
Method to set direction in directional light
|
static void |
setViewPoint(com.sun.j3d.utils.universe.SimpleUniverse u,
javax.media.j3d.Canvas3D canvas,
javax.media.j3d.BranchGroup scene,
java.awt.geom.Rectangle2D cellBnd) |
static javax.vecmath.Vector3f[] |
transformIntoVectors(java.lang.String dir) |
static boolean |
updateZValues(javax.media.j3d.Shape3D shape,
float origZ1,
float origZ2,
float z1,
float z2)
Method to reset z values of shapes created with addPolyhedron
|
public static final javax.vecmath.Color3f black
public static final javax.vecmath.Color3f plastic
public static final javax.media.j3d.BoundingSphere infiniteBounds
public static J3DAlpha jAlpha
public static java.lang.String get3DLightDirs()
public static void set3DLightDirs(java.lang.String c)
c
- the company name to use in schematic frames.public static java.lang.String getFactory3DLightDirs()
public static int[] get3DColorAxes()
public static int get3DMaxNumNodes()
public static void set3DMaxNumNodes(int num)
num
- maximum number of nodes.public static int getFactory3DMaxNumNodes()
public static boolean is3DAxesOn()
public static void set3DAxesOn(boolean on)
on
- true to draw 3D axes.public static boolean isFactory3DAxesOn()
public static boolean is3DCellBndOn()
public static void set3DCellBndOn(boolean on)
on
- true to draw bounding box for the cells.public static boolean isFactory3DCellBndOn()
public static boolean is3DPerspective()
public static void set3DPerspective(boolean on)
on
- true to draw 3D views with perspective.public static boolean isFactory3DPerspective()
public static boolean is3DAntialiasing()
public static void set3DAntialiasing(boolean on)
on
- true to draw 3D views with perspective.public static boolean isFactory3DAntialiasing()
public static double get3DOrigZoom()
public static void set3DOrigZoom(double value)
value
- zoom factorpublic static double getFactory3DOrigZoom()
public static java.lang.String get3DRotation()
public static void set3DRotation(java.lang.String value)
value
- angles on X, Y and Zpublic static java.lang.String getFactory3DRotation()
public static double get3DFactor()
public static void set3DFactor(double value)
value
- 3D scale factor to set.public static double getFactory3DFactor()
public static int get3DAlpha()
public static void set3DAlpha(int value)
value
- 3D alpha to set.public static int getFactory3DAlpha()
public static java.util.List<J3DUtils.ThreeDDemoKnot> readDemoDataFromFile(View3DWindow view3D)
view3D
- public static double[] convertValues(java.lang.String[] stringValues)
public static java.lang.String[] parseValues(java.lang.String line, int lineNumner)
line
- lineNumner
- public static javax.vecmath.Vector3f[] transformIntoVectors(java.lang.String dir)
public static void setDirections(java.lang.Object initValue)
initValue
- public static void setAmbientalColor(java.lang.Object initValue)
initValue
- null if value has to be redone from user datapublic static void setDirectionalColor(java.lang.Object initValue)
initValue
- null if value has to be redone from user datapublic static void setBackgroundColor(java.lang.Object initValue)
initValue
- null if value has to be redone from user datapublic static void createBackground(javax.media.j3d.BranchGroup scene)
scene
- public static void setAlpha(int speed)
speed
- public static void createLights(javax.media.j3d.BranchGroup scene)
scene
- public static void setViewPoint(com.sun.j3d.utils.universe.SimpleUniverse u, javax.media.j3d.Canvas3D canvas, javax.media.j3d.BranchGroup scene, java.awt.geom.Rectangle2D cellBnd)
public static double convertToRadiant(double degrees)
public static boolean updateZValues(javax.media.j3d.Shape3D shape, float origZ1, float origZ2, float z1, float z2)
shape
- origZ1
- origZ2
- z1
- z2
- public static javax.media.j3d.Node addCylinder(java.awt.geom.Point2D[] points, double distance, double thickness, javax.media.j3d.Appearance ap, javax.media.j3d.TransformGroup objTrans)
points
- distance
- thickness
- ap
- objTrans
- public static javax.media.j3d.Shape3D addPolyhedron(java.awt.geom.Rectangle2D bounds, double distance, double thickness, javax.media.j3d.Appearance ap, javax.media.j3d.TransformGroup objTrans)
objTrans
- public static javax.media.j3d.Shape3D addShape3D(javax.vecmath.Point3d[] pts, int listLen, javax.media.j3d.Appearance ap, javax.media.j3d.TransformGroup objTrans)
pts
- listLen
- ap
- public static javax.media.j3d.Shape3D addLine3D(javax.vecmath.Point3d[] pts, javax.media.j3d.Appearance ap, javax.media.j3d.TransformGroup objTrans)
pts
- ap
- public static javax.media.j3d.Shape3D addText(java.lang.String text, double x, double y, double z, javax.media.j3d.Appearance ap, javax.media.j3d.TransformGroup objTrans)
public static javax.media.j3d.Shape3D addPolyhedron(java.awt.geom.PathIterator pIt, double distance, double thickness, javax.media.j3d.Appearance ap, javax.media.j3d.TransformGroup objTrans)
public static void correctNormals(java.util.List<javax.vecmath.Point3d> topList, java.util.List<javax.vecmath.Point3d> bottomList)
topList
- bottomList
- public static com.sun.j3d.utils.behaviors.interpolators.KBKeyFrame getNextKBKeyFrame(float ratio, J3DUtils.ThreeDDemoKnot knot)
ratio
- knot
- public static com.sun.j3d.utils.behaviors.interpolators.TCBKeyFrame getNextTCBKeyFrame(float ratio, J3DUtils.ThreeDDemoKnot knot)
public static javax.vecmath.Quat4f createQuaternionFromEuler(double angleX, double angleY, double angleZ)
angleX
- angleY
- angleZ
- public static void get3DColorsInTab(java.util.Map<User.ColorPrefType,java.lang.String> nameTypeSpecialMap)