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 Color3f |
black
standard colors to be used by materials
|
static BoundingSphere |
infiniteBounds |
static J3DAlpha |
jAlpha |
static Color3f |
plastic
standard colors to be used by materials
|
Constructor and Description |
---|
J3DUtils() |
Modifier and Type | Method and Description |
---|---|
static Node |
addCylinder(java.awt.geom.Point2D[] points,
double distance,
double thickness,
Appearance ap,
TransformGroup objTrans)
Method to add a cylindrical shaped element
|
static Shape3D |
addPolyhedron(java.awt.geom.PathIterator pIt,
double distance,
double thickness,
Appearance ap,
TransformGroup objTrans) |
static Shape3D |
addPolyhedron(java.awt.geom.Rectangle2D bounds,
double distance,
double thickness,
Appearance ap,
TransformGroup objTrans)
Method to add a polyhedron to the transformation group
|
static Shape3D |
addShape3D(Point3d[] pts,
int listLen,
Appearance ap,
TransformGroup objTrans)
Simple method to generate polyhedra
|
static double |
convertToRadiant(double degrees) |
static double[] |
convertValues(java.lang.String[] stringValues) |
static void |
correctNormals(java.util.List<Point3d> topList,
java.util.List<Point3d> bottomList)
Method to correct points sequence to obtain valid normals
|
static void |
createBackground(BranchGroup scene)
Create the background node based on given background color
|
static void |
createLights(BranchGroup scene)
Create the lights (directional and ambiental) for the given scene graph
based on User's data
|
static 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 KBKeyFrame |
getNextKBKeyFrame(float ratio,
J3DUtils.ThreeDDemoKnot knot)
Method to generate each individual frame key for the interporlation
based on Poly information
|
static 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 miliseconds
|
static void |
setAmbientalColor(java.lang.Object initValue)
Method to set ambiental 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(SimpleUniverse u,
Canvas3D canvas,
BranchGroup scene,
java.awt.geom.Rectangle2D cellBnd) |
static Vector3f[] |
transformIntoVectors(java.lang.String dir) |
static boolean |
updateZValues(Shape3D shape,
float origZ1,
float origZ2,
float z1,
float z2)
Method to reset z values of shapes created with addPolyhedron
|
public static final Color3f black
public static final Color3f plastic
public static final 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
- maximim 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 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(BranchGroup scene)
scene
- public static void setAlpha(int speed)
speed
- public static void createLights(BranchGroup scene)
scene
- public static void setViewPoint(SimpleUniverse u, Canvas3D canvas, BranchGroup scene, java.awt.geom.Rectangle2D cellBnd)
public static double convertToRadiant(double degrees)
public static boolean updateZValues(Shape3D shape, float origZ1, float origZ2, float z1, float z2)
shape
- origZ1
- origZ2
- z1
- z2
- public static Node addCylinder(java.awt.geom.Point2D[] points, double distance, double thickness, Appearance ap, TransformGroup objTrans)
points
- distance
- thickness
- ap
- objTrans
- public static Shape3D addPolyhedron(java.awt.geom.Rectangle2D bounds, double distance, double thickness, Appearance ap, TransformGroup objTrans)
objTrans
- public static Shape3D addShape3D(Point3d[] pts, int listLen, Appearance ap, TransformGroup objTrans)
pts
- listLen
- ap
- public static Shape3D addPolyhedron(java.awt.geom.PathIterator pIt, double distance, double thickness, Appearance ap, TransformGroup objTrans)
public static void correctNormals(java.util.List<Point3d> topList, java.util.List<Point3d> bottomList)
topList
- bottomList
- public static KBKeyFrame getNextKBKeyFrame(float ratio, J3DUtils.ThreeDDemoKnot knot)
ratio
- knot
- public static TCBKeyFrame getNextTCBKeyFrame(float ratio, J3DUtils.ThreeDDemoKnot knot)
public static Quat4f createQuaternionFromEuler(double angleX, double angleY, double angleZ)
angleX
- angleY
- angleZ
- public static void get3DColorsInTab(java.util.Map<User.ColorPrefType,java.lang.String> nameTypeSpecialMap)