⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 picktool.html

📁 JAVA多媒体开发类库说明
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_06) on Wed Dec 13 16:20:13 PST 2006 --><TITLE>PickTool (Java 3D 1.5.0)</TITLE><META NAME="keywords" CONTENT="com.sun.j3d.utils.picking.PickTool class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="PickTool (Java 3D 1.5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../com/sun/j3d/utils/picking/PickResult.html" title="class in com.sun.j3d.utils.picking"><B>PREV CLASS</B></A>&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../index.html?com/sun/j3d/utils/picking/PickTool.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="PickTool.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.sun.j3d.utils.picking</FONT><BR>Class PickTool</H2><PRE>java.lang.Object  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.j3d.utils.picking.PickTool</B></PRE><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../com/sun/j3d/utils/picking/PickCanvas.html" title="class in com.sun.j3d.utils.picking">PickCanvas</A></DD></DL><HR><DL><DT><PRE>public class <B>PickTool</B><DT>extends java.lang.Object</DL></PRE><P>The base class for picking operations. The picking methods will return a PickResult object for each object picked,  which can then be queried to  obtain more detailed information about the specific objects that were picked.  <p> The pick mode specifies the detail level of picking before the PickResult is returned: <p> <UL> <LI> PickTool.BOUNDS - Pick using the bounds of the pickable nodes.  The  PickResult returned will contain the SceneGraphPath to the picked Node. </LI> <LI> PickTool.GEOMETRY will pick using the geometry of the pickable nodes. The PickResult returned will contain the SceneGraphPath to the picked Node. Geometry nodes in the scene must have the ALLOW_INTERSECT capability set for this mode.</LI> <LI> PickTool.GEOMETRY_INTERSECT_INFO -is the same as GEOMETRY, but the  the PickResult will also include information on each intersection of the pick shape with the geometry.  The intersection information includes the sub-primitive picked (that is, the point, line, triangle or quad),  the closest vertex to the center of the pick shape, and  the intersection's coordinate, normal, color and texture coordinates. To allow this information to be generated, Shape3D and Morph nodes must have  the ALLOW_GEOMETRY_READ capability set and GeometryArrays must have the  ALLOW_FORMAT_READ, ALLOW_COUNT_READ, and ALLOW_COORDINATE_READ capabilities set, plus the ALLOW_COORDINATE_INDEX_READ capability for indexed geometry.  To inquire the intersection color, normal or texture coordinates  the corresponding READ capability bits must be set on the GeometryArray. </LI> </UL> <p> The utility method  <A HREF="PickTool.html#setCapabilities(javax.media.j3d.Node, int)"> <code>PickTool.setCapabilities(Node, int)</code></A>  can be used before the scene graph is made live to set the  capabilities of Shape3D, Morph or Geometry nodes to allow picking. <p> A PickResult from a lower level of detail pick can be used to inquire more detailed information if the capibility bits are set.   This can be used to filter the PickResults before the more computationally intensive intersection processing.  For example, the application can do a BOUNDS pick and then selectively inquire intersections on some of the PickResults. This will save the effort of  doing intersection computation on the other PickResults.   However, inquiring the intersections from a GEOMETRY pick will make  the intersection computation happen twice, use GEOMETRY_INTERSECT_INFO if you want to inquire the intersection information on all the PickResults. <p> When using pickAllSorted or pickClosest methods, the picks  will be sorted by the distance from the start point of the pick shape to  the intersection point. <p> Morph nodes cannot be picked using the displayed geometry in  GEOMETRY_INTERSECT_INFO mode due to limitations in the current Java3D core  API (the current geometry of the the Morph cannot be inquired).  Instead they are picked  using  the geometry at index 0 in the Morph, this limitation may be eliminated in a future release of Java3D. <p> If the pick shape is a PickBounds, the pick result will contain only the scene graph path, even if the mode is GEOMETRY_INTERSECT_INFO.<P><P><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Field Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#BOUNDS">BOUNDS</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this mode to pick by bounds and get basic information        on the pick.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#GEOMETRY">GEOMETRY</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this mode to pick by geometry and get basic         information on the pick.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#GEOMETRY_INTERSECT_INFO">GEOMETRY_INTERSECT_INFO</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this mode to pick by geometry and save         information about the intersections (intersected primitive,        intersection point and closest vertex).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#INTERSECT_COORD">INTERSECT_COORD</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flag to pass to <CODE>setCapabilities(Node, int)<code> to set the Node's capabilities to allow inquiry of the intersection coordinate information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#INTERSECT_FULL">INTERSECT_FULL</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flag to pass to <CODE>setCapabilities(Node, int)<code> to set the Node's capabilities to allow inquiry of all intersection information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#INTERSECT_TEST">INTERSECT_TEST</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flag to pass to <CODE>setCapabilities(Node, int)<code> to set the Node's capabilities to allow intersection tests, but not inquire information about the intersections (use for GEOMETRY mode).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#userDefineShape">userDefineShape</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#PickTool(javax.media.j3d.BranchGroup)">PickTool</A></B>(<A HREF="../../../../../javax/media/j3d/BranchGroup.html" title="class in javax.media.j3d">BranchGroup</A>&nbsp;b)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor with BranchGroup to be picked.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#PickTool(javax.media.j3d.Locale)">PickTool</A></B>(<A HREF="../../../../../javax/media/j3d/Locale.html" title="class in javax.media.j3d">Locale</A>&nbsp;l)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor with the Locale to be picked.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/media/j3d/BranchGroup.html" title="class in javax.media.j3d">BranchGroup</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#getBranchGroup()">getBranchGroup</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the BranchGroup to be picked if the tool was initialized        with a BranchGroup, null otherwise.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/media/j3d/Locale.html" title="class in javax.media.j3d">Locale</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#getLocale()">getLocale</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the Locale to be picked if the tool was initialized with a Locale, null otherwise.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#getMode()">getMode</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the picking detail mode.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/media/j3d/PickShape.html" title="class in javax.media.j3d">PickShape</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#getPickShape()">getPickShape</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the PickShape for this object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../javax/vecmath/Point3d.html" title="class in javax.vecmath">Point3d</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#getStartPosition()">getStartPosition</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the start postion used for distance measurement.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../../com/sun/j3d/utils/picking/PickResult.html" title="class in com.sun.j3d.utils.picking">PickResult</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/sun/j3d/utils/picking/PickTool.html#pickAll()">pickAll</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Selects all the nodes that intersect the PickShape.</TD></TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -