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

📄 lsystem.html

📁 采用Java3D,基于L-system
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Tue May 25 16:08:50 CDT 1999 --><TITLE>: Class  Lsystem</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="overview-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="help-doc.html"><FONT ID="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" ID="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="Interpreter.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="LsystemsReader.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">  <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Lsystem.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2>Class  Lsystem</H2><PRE>java.lang.Object  |  +--<B>Lsystem</B></PRE><HR><DL><DT>public class <B>Lsystem</B><DT>extends java.lang.Object</DL><P>This class provides a front-end interface for creating a BranchGroup  by interpreting a 2-D FRACTINT-type L-system stored in a file. (Currently, it's only been tested on the file "weed.lsys", but hey, that's a start.) For more information on L-systems, see: <a href="http://spanky.triumf.ca/www/fractint/lsys/plants.html"> http://spanky.triumf.ca/www/fractint/lsys/plants.html</a> <p> Example usage: <p> <pre>   Lsystem lsystem = new Lsystem();   // construct an L-system object   lsystem.initLsys (initPoint, lineLength, initAngle);                                      // init. starting Lsystem parameters   lsystem.initDraw (thk, mult, cylEdges, debug);                                      // initialize drawing settings   lsystem.readLsystem(filename);     // read rules from an L-system file   lsystem.setAppearance(branchApp, leafApp);   // set branch/leaf appearance   BranchGroup lsysBg = lsystem.execute(depth);                                      // interpret L-system to depth "depth,"                                      // returning a BranchGroup </pre> <p><P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD><CODE><B><A HREF="Lsystem.html#Lsystem()">Lsystem</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs an L-system object with default parameters.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;javax.media.j3d.BranchGroup</CODE></FONT></TD><TD><CODE><B><A HREF="Lsystem.html#execute(int)">execute</A></B>(int&nbsp;depth)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interprets the L-system.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Lsystem.html#initDraw(double, double, int, boolean)">initDraw</A></B>(double&nbsp;thk,         double&nbsp;mult,         int&nbsp;cylEdges,         boolean&nbsp;debug)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialization parameters affecting the L-system's geometry.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Lsystem.html#initLsys(javax.vecmath.Point3d, double, double)">initLsys</A></B>(javax.vecmath.Point3d&nbsp;initPoint,         double&nbsp;lineLength,         double&nbsp;initAngle)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialization parameters of the L-system.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Lsystem.html#readLsystem(java.lang.String)">readLsystem</A></B>(java.lang.String&nbsp;filename)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads an L-system contained in a file.</TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Lsystem.html#setAppearance(javax.media.j3d.Appearance, javax.media.j3d.Appearance)">setAppearance</A></B>(javax.media.j3d.Appearance&nbsp;branchApp,              javax.media.j3d.Appearance&nbsp;leafApp)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the Appearance of the branches and leaves of the L-system.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" ID="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Lsystem()"><!-- --></A><H3>Lsystem</H3><PRE>public <B>Lsystem</B>()</PRE><DL><DD>Constructs an L-system object with default parameters.</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" ID="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="execute(int)"><!-- --></A><H3>execute</H3><PRE>public javax.media.j3d.BranchGroup <B>execute</B>(int&nbsp;depth)</PRE><DL><DD>Interprets the L-system.<DD><DL><DT><B>Parameters:</B><DD><CODE>depth</CODE> - Number of recursive iterations of the L-system rules.</DL></DD></DL><HR><A NAME="setAppearance(javax.media.j3d.Appearance, javax.media.j3d.Appearance)"><!-- --></A><H3>setAppearance</H3><PRE>public void <B>setAppearance</B>(javax.media.j3d.Appearance&nbsp;branchApp,                          javax.media.j3d.Appearance&nbsp;leafApp)</PRE><DL><DD>Sets the Appearance of the branches and leaves of the L-system. The leaves are simply the line segments added during the final iteration.<DD><DL><DT><B>Parameters:</B><DD><CODE>branchApp</CODE> - Appearance of the branches<DD><CODE>leafApp</CODE> - Appearance of the leaves</DL></DD></DL><HR><A NAME="initLsys(javax.vecmath.Point3d, double, double)"><!-- --></A><H3>initLsys</H3><PRE>public void <B>initLsys</B>(javax.vecmath.Point3d&nbsp;initPoint,                     double&nbsp;lineLength,                     double&nbsp;initAngle)</PRE><DL><DD>Initialization parameters of the L-system.<DD><DL><DT><B>Parameters:</B><DD><CODE>initPoint</CODE> - starting point of L-system interpreter in 3-D space<DD><CODE>lineLength</CODE> - initial line length<DD><CODE>initAngle</CODE> - initial orientation in 2-D space</DL></DD></DL><HR><A NAME="initDraw(double, double, int, boolean)"><!-- --></A><H3>initDraw</H3><PRE>public void <B>initDraw</B>(double&nbsp;thk,                     double&nbsp;mult,                     int&nbsp;cylEdges,                     boolean&nbsp;debug)</PRE><DL><DD>Initialization parameters affecting the L-system's geometry.<DD><DL><DT><B>Parameters:</B><DD><CODE>thk</CODE> - minimum radius of the cylinders (line segments)<DD><CODE>mult</CODE> - multiplier for making longer line segments thicker     (cylinder radius = thickness + mult * lineLength)<DD><CODE>cylEdges</CODE> - number of edges (resolution) of the cylinders<DD><CODE>debug</CODE> - flag to turn on debugging messages</DL></DD></DL><HR><A NAME="readLsystem(java.lang.String)"><!-- --></A><H3>readLsystem</H3><PRE>public boolean <B>readLsystem</B>(java.lang.String&nbsp;filename)</PRE><DL><DD>Reads an L-system contained in a file.<DD><DL><DT><B>Parameters:</B><DD><CODE>filename</CODE> - the name of the file.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="overview-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="help-doc.html"><FONT ID="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" ID="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="Interpreter.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="LsystemsReader.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">  <A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Lsystem.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>

⌨️ 快捷键说明

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