|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.plugins.j3d.utils.J3DUtils
public final class J3DUtils
Utility class for 3D module
Nested Class Summary | |
---|---|
static class |
J3DUtils.OffScreenCanvas3D
Class to create offscreen from canvas 3D |
static class |
J3DUtils.ThreeDDemoKnot
This class is @serial |
Field Summary | |
---|---|
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 Summary | |
---|---|
J3DUtils()
|
Method Summary | |
---|---|
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 |
get3DColorAmbientLight()
Method to get the ambiental color on the 3D display. |
static Pref |
get3DColorAmbientLightPref()
|
static int[] |
get3DColorAxes()
Method to get the color of the axes on the 3D display. |
static int |
get3DColorDirectionalLight()
Method to get the color of directional light on the 3D display. |
static Pref |
get3DColorDirectionalLightPref()
|
static int |
get3DColorHighlighted()
Method to get the color of the highlighted instance on the 3D display. |
static Pref |
get3DColorHighlightedPref()
|
static int |
get3DColorInstanceCell()
Method to get the color of the cell instance on the 3D display. |
static Pref |
get3DColorInstanceCellPref()
|
static void |
get3DColorsInTab(java.util.Map<java.lang.String,ColorPatternPanel.Info> transAndSpecialMap)
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 |
set3DColorAmbientLight(int c)
Method to set the ambiental color on the 3D display. |
static void |
set3DColorDirectionalLight(int c)
Method to set the color of directional light on the 3D display. |
static void |
set3DColorHighlighted(int c)
Method to set the color of the highlighted instance on the 3D display. |
static void |
set3DColorInstanceCell(int c)
Method to set the color of the cell instance on the 3D display. |
static java.lang.Boolean |
set3DColorsInTab(LayersTab tab)
|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Color3f black
public static final Color3f plastic
public static final BoundingSphere infiniteBounds
public static J3DAlpha jAlpha
Constructor Detail |
---|
public J3DUtils()
Method Detail |
---|
public static int get3DColorDirectionalLight()
public static Pref get3DColorDirectionalLightPref()
public static void set3DColorDirectionalLight(int c)
c
- the color of directional light on the 3D display.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 int get3DColorInstanceCell()
public static Pref get3DColorInstanceCellPref()
public static void set3DColorInstanceCell(int c)
c
- the color of the cell instance on the 3D display.public static int get3DColorHighlighted()
public static Pref get3DColorHighlightedPref()
public static void set3DColorHighlighted(int c)
c
- the color of the highlighted instance on the 3D display.public static int get3DColorAmbientLight()
public static Pref get3DColorAmbientLightPref()
public static void set3DColorAmbientLight(int c)
c
- the ambiental color on the 3D display.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<java.lang.String,ColorPatternPanel.Info> transAndSpecialMap)
public static java.lang.Boolean set3DColorsInTab(LayersTab tab)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |