Java Doc for PickIntersection.java in  » 6.0-JDK-Modules » java-3d » com » sun » j3d » utils » picking » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.sun.j3d.utils.picking 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.j3d.utils.picking.PickIntersection

PickIntersection
public class PickIntersection (Code)
Holds information about an intersection of a PickShape with a Node as part of a PickResult. Information about the intersected geometry, intersected primitive, intersection point, and closest vertex can be inquired.

The intersected geometry is indicated by an index into the list of geometry arrays on the PickResult. It can also be inquired from this object.

The intersected primitive indicates which primitive out of the GeometryArray was intersected (where the primitive is a point, line, triangle or quad, not a com.sun.j3d.utils.geometry.Primitive). For example, the intersection would indicate which triangle out of a triangle strip was intersected. The methods which return primitive data will have one value if the primitive is a point, two values if the primitive is a line, three values if the primitive is a triangle and four values if the primitive is quad.

The primitive's VWorld coordinates are saved when then intersection is calculated. The local coordinates, normal, color and texture coordinates for the primitive can also be inquired if they are present and readable.

The intersection point is the location on the primitive which intersects the pick shape closest to the center of the pick shape. The intersection point's location in VWorld coordinates is saved when the intersection is calculated. The local coordinates, normal, color and texture coordiantes of at the intersection can be interpolated if they are present and readable.

The closest vertex is the vertex of the primitive closest to the intersection point. The vertex index, VWorld coordinates and local coordinates of the closest vertex can be inquired. The normal, color and texture coordinate of the closest vertex can be inquired from the geometry array:

 Vector3f getNormal(PickIntersection pi, int vertexIndex) {
 int index;
 Vector3d normal = new Vector3f();
 GeometryArray ga = pickIntersection.getGeometryArray();
 if (pickIntersection.geometryIsIndexed()) {
 index = ga.getNormalIndex(vertexIndex);
 } else {
 index = vertexIndex;
 }
 ga.getNormal(index, normal);
 return normal;
 }
 

The color, normal and texture coordinate information for the intersected primitive and the intersection point can be inquired the geometry includes them and the corresponding READ capibility bits are set. PickTool.setCapabilties(Node, int) can be used to set the capability bits to allow this data to be inquired.



Field Summary
final static  doubleTOL
    
final static  intX_AXIS
    
final static  intY_AXIS
    
final static  intZ_AXIS
    
 Point3dclosestVertexCoordinates
    
 Point3dclosestVertexCoordinatesVW
    
 intclosestVertexIndex
    
final static  booleandebug
    
 doubledistance
    
 GeometryArraygeom
    
 intgeomIndex
    
 booleanhasColors
    
 booleanhasNormals
    
 booleanhasTexCoords
    
 IndexedGeometryArrayiGeom
    
 double[]interpWeights
    
 PickResultpickResult
    
 Color4fpointColor
    
 Point3dpointCoordinates
    
 Point3dpointCoordinatesVW
    
 Vector3fpointNormal
    
 TexCoord3fpointTexCoord
    
 int[]primitiveColorIndices
    
 Color4f[]primitiveColors
    
 int[]primitiveCoordinateIndices
    
 Point3d[]primitiveCoordinates
    
 Point3d[]primitiveCoordinatesVW
    
 int[]primitiveNormalIndices
    
 Vector3f[]primitiveNormals
    
 int[]primitiveTexCoordIndices
    
 TexCoord3f[]primitiveTexCoords
    
 int[]primitiveVertexIndices
    

Constructor Summary
 PickIntersection(PickResult pr, GeometryArray geomArr)
    

Method Summary
 doubleabs(double value)
    
public  booleangeometryIsIndexed()
    
public  Point3dgetClosestVertexCoordinates()
    
public  Point3dgetClosestVertexCoordinatesVW()
    
public  intgetClosestVertexIndex()
    
public  doublegetDistance()
    
public  GeometryArraygetGeometryArray()
    
public  intgetGeometryArrayIndex()
    
 intgetInterleavedColorOffset(GeometryArray geo)
    
 intgetInterleavedNormalOffset(GeometryArray geo)
    
 intgetInterleavedStride(GeometryArray geo)
    
 intgetInterleavedVertexOffset(GeometryArray geo)
    
 double[]getInterpWeights()
    
 PickResultgetPickResult()
    
public  Color4fgetPointColor()
     Returns the color of the intersection point.
public  Point3dgetPointCoordinates()
     Returns the coordinates of the intersection point (local coordinates), if available.
public  Point3dgetPointCoordinatesVW()
     Returns the coordinates of the intersection point (world coordinates), if available.
public  Vector3fgetPointNormal()
     Returns the normal of the intersection point.
public  TexCoord3fgetPointTextureCoordinate(int index)
     Returns the texture coordinate of the intersection point at the specifed index in the specified texture coordinate set. Returns null if the geometry does not contain texture coordinates.
public  int[]getPrimitiveColorIndices()
     Get the color indices for the intersected primitive.
public  Color4f[]getPrimitiveColors()
     Get the colors of the intersected primitive.
public  int[]getPrimitiveCoordinateIndices()
     Get the coordinates indices for the intersected primitive.
public  Point3d[]getPrimitiveCoordinates()
    
public  Point3d[]getPrimitiveCoordinatesVW()
    
public  int[]getPrimitiveNormalIndices()
     Get the normal indices for the intersected primitive.
public  Vector3f[]getPrimitiveNormals()
     Get the normals of the intersected primitive.
public  int[]getPrimitiveTexCoordIndices(int index)
     Get the texture coordinate indices for the intersected primitive at the specifed index in the specified texture coordinate set.
public  TexCoord3f[]getPrimitiveTexCoords(int index)
     Get the texture coordinates of the intersected primitive at the specifed index in the specified texture coordinate set. null if the primitive does not contain texture coordinates.
public  int[]getPrimitiveVertexIndices()
    
 booleaninterpTriangle(int index0, int index1, int index2, Point3d[] coords, Point3d intPt)
    
 intmaxAxis(Vector3d delta)
    
 voidsetDistance(double dist)
    
 voidsetGeomIndex(int gi)
    
 voidsetPointCoordinatesVW(Point3d pt)
     Sets the coordinates of the intersection point (world coordinates).
 voidsetPrimitiveCoordinatesVW(Point3d[] coords)
    
 voidsetVertexIndices(int[] verts)
    
 voidstoreClosestVertex()
    
public  StringtoString()
    
 StringtoString2()
    

Field Detail
TOL
final static double TOL(Code)



X_AXIS
final static int X_AXIS(Code)



Y_AXIS
final static int Y_AXIS(Code)



Z_AXIS
final static int Z_AXIS(Code)



closestVertexCoordinates
Point3d closestVertexCoordinates(Code)
Coordinates of the closest vertex



closestVertexCoordinatesVW
Point3d closestVertexCoordinatesVW(Code)
Coordinates of the closest vertex (World coordinates)



closestVertexIndex
int closestVertexIndex(Code)
Index of the closest vertex



debug
final static boolean debug(Code)



distance
double distance(Code)
Distance between start point and intersection point (see comment above)



geom
GeometryArray geom(Code)



geomIndex
int geomIndex(Code)
index of GeometryArray in PickResult



hasColors
boolean hasColors(Code)



hasNormals
boolean hasNormals(Code)



hasTexCoords
boolean hasTexCoords(Code)



iGeom
IndexedGeometryArray iGeom(Code)



interpWeights
double[] interpWeights(Code)
Weight factors for interpolation, values correspond to vertex indices, sum == 1



pickResult
PickResult pickResult(Code)
PickResult for intersection is part of



pointColor
Color4f pointColor(Code)
Color at the intersection point



pointCoordinates
Point3d pointCoordinates(Code)
Local Coordinates of the intersection point



pointCoordinatesVW
Point3d pointCoordinatesVW(Code)
VWorld Coordinates of the intersection point



pointNormal
Vector3f pointNormal(Code)
Normal at the intersection point



pointTexCoord
TexCoord3f pointTexCoord(Code)
TexCoord at the intersection point



primitiveColorIndices
int[] primitiveColorIndices(Code)



primitiveColors
Color4f[] primitiveColors(Code)



primitiveCoordinateIndices
int[] primitiveCoordinateIndices(Code)



primitiveCoordinates
Point3d[] primitiveCoordinates(Code)



primitiveCoordinatesVW
Point3d[] primitiveCoordinatesVW(Code)
VWorld coordinates of intersected primitive



primitiveNormalIndices
int[] primitiveNormalIndices(Code)



primitiveNormals
Vector3f[] primitiveNormals(Code)



primitiveTexCoordIndices
int[] primitiveTexCoordIndices(Code)



primitiveTexCoords
TexCoord3f[] primitiveTexCoords(Code)



primitiveVertexIndices
int[] primitiveVertexIndices(Code)
Indices of the intersected primitive




Constructor Detail
PickIntersection
PickIntersection(PickResult pr, GeometryArray geomArr)(Code)
Constructor
Parameters:
  pickResult - The pickResult this intersection is part of.




Method Detail
abs
double abs(double value)(Code)



geometryIsIndexed
public boolean geometryIsIndexed()(Code)
Returns true if the geometry is indexed



getClosestVertexCoordinates
public Point3d getClosestVertexCoordinates()(Code)
Get coordinates of closest vertex (local) the coordinates of the vertex closest to the intersection point



getClosestVertexCoordinatesVW
public Point3d getClosestVertexCoordinatesVW()(Code)
Get coordinates of closest vertex (world) the coordinates of the vertex closest to the intersection point



getClosestVertexIndex
public int getClosestVertexIndex()(Code)
Get index of closest vertex the index of the closest vertex



getDistance
public double getDistance()(Code)
Get the distance from the PickShape start point to the intersection point the distance to the intersection point, if available.



getGeometryArray
public GeometryArray getGeometryArray()(Code)
Returns the GeometryArray for the intersection



getGeometryArrayIndex
public int getGeometryArrayIndex()(Code)
Returns the index of the intersected GeometryArray into the geometry arrays in the PickResult



getInterleavedColorOffset
int getInterleavedColorOffset(GeometryArray geo)(Code)



getInterleavedNormalOffset
int getInterleavedNormalOffset(GeometryArray geo)(Code)



getInterleavedStride
int getInterleavedStride(GeometryArray geo)(Code)



getInterleavedVertexOffset
int getInterleavedVertexOffset(GeometryArray geo)(Code)



getInterpWeights
double[] getInterpWeights()(Code)



getPickResult
PickResult getPickResult()(Code)
Gets the PickResult this intersection is part of



getPointColor
public Color4f getPointColor()(Code)
Returns the color of the intersection point. Returns null if the geometry does not contain colors. If the geometry was defined with GeometryArray.COLOR_3, the 'w' component of the color will initialized to 1.0 color at the intersection point.



getPointCoordinates
public Point3d getPointCoordinates()(Code)
Returns the coordinates of the intersection point (local coordinates), if available. coordinates of the intersection point



getPointCoordinatesVW
public Point3d getPointCoordinatesVW()(Code)
Returns the coordinates of the intersection point (world coordinates), if available. coordinates of the point



getPointNormal
public Vector3f getPointNormal()(Code)
Returns the normal of the intersection point. Returns null if the geometry does not contain normals. normal at the intersection point.



getPointTextureCoordinate
public TexCoord3f getPointTextureCoordinate(int index)(Code)
Returns the texture coordinate of the intersection point at the specifed index in the specified texture coordinate set. Returns null if the geometry does not contain texture coordinates. If the geometry was defined with GeometryArray.TEXTURE_COORDINATE_3, the 'z' component of the texture coordinate will initialized to 0.0 texture coordinate at the intersection point.



getPrimitiveColorIndices
public int[] getPrimitiveColorIndices()(Code)
Get the color indices for the intersected primitive. For a non-indexed primitive, this will be the same as the primitive vertex indices If the geometry array does not contain colors this will return null. an array indices



getPrimitiveColors
public Color4f[] getPrimitiveColors()(Code)
Get the colors of the intersected primitive. This will return null if the primitive does not contain colors. If the geometry was defined using GeometryArray.COLOR_3, the 'w' value of the color will be set to 1.0. an array of Point3d's for the primitive that was intersected



getPrimitiveCoordinateIndices
public int[] getPrimitiveCoordinateIndices()(Code)
Get the coordinates indices for the intersected primitive. For a non-indexed primitive, this will be the same as the primitive vertex indices an array indices



getPrimitiveCoordinates
public Point3d[] getPrimitiveCoordinates()(Code)
Get the local coordinates intersected primitive an array of Point3d's for the primitive that was intersected



getPrimitiveCoordinatesVW
public Point3d[] getPrimitiveCoordinatesVW()(Code)
Get VWorld coordinates of the intersected primitive an array of Point3d's for the primitive that was picked



getPrimitiveNormalIndices
public int[] getPrimitiveNormalIndices()(Code)
Get the normal indices for the intersected primitive. For a non-indexed primitive, this will be the same as the primitive vertex indices If the geometry array does not contain normals this will return null an array indices



getPrimitiveNormals
public Vector3f[] getPrimitiveNormals()(Code)
Get the normals of the intersected primitive. This will return null if the primitive does not contain normals. an array of Point3d's for the primitive that was intersected



getPrimitiveTexCoordIndices
public int[] getPrimitiveTexCoordIndices(int index)(Code)
Get the texture coordinate indices for the intersected primitive at the specifed index in the specified texture coordinate set. For a non-indexed primitive, this will be the same as the primitive vertex indices If the geometry array does not contain texture coordinates, this will return null. an array indices



getPrimitiveTexCoords
public TexCoord3f[] getPrimitiveTexCoords(int index)(Code)
Get the texture coordinates of the intersected primitive at the specifed index in the specified texture coordinate set. null if the primitive does not contain texture coordinates. If the geometry was defined using GeometryArray.TEXTURE_COORDINATE_2, the 'z' value of the texture coordinate will be set to 0.0. an array of TexCoord3f's for the primitive that was intersected



getPrimitiveVertexIndices
public int[] getPrimitiveVertexIndices()(Code)
Get vertex indices of the intersected primitive an array which contains the list of indices



interpTriangle
boolean interpTriangle(int index0, int index1, int index2, Point3d[] coords, Point3d intPt)(Code)



maxAxis
int maxAxis(Vector3d delta)(Code)



setDistance
void setDistance(double dist)(Code)
Set the distance to intersection point
Parameters:
  dist - the distance to the intersection point



setGeomIndex
void setGeomIndex(int gi)(Code)
Sets the geom index into the pick result



setPointCoordinatesVW
void setPointCoordinatesVW(Point3d pt)(Code)
Sets the coordinates of the intersection point (world coordinates).
Parameters:
  pt - the coordinates



setPrimitiveCoordinatesVW
void setPrimitiveCoordinatesVW(Point3d[] coords)(Code)
Set VWorld coordinates of the picked primtive
Parameters:
  coords -



setVertexIndices
void setVertexIndices(int[] verts)(Code)
Set vertex indices of primitive's vertices
Parameters:
  verts - array of coordinate indices



storeClosestVertex
void storeClosestVertex()(Code)
Calculates and stores the closest vertex information



toString
public String toString()(Code)
String representation of this object



toString2
String toString2()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.