> Date: Mon, 10 Mar 2003 16:36:24 +0200 > From: Rudy Wuite <[EMAIL PROTECTED]> > > I am using a GeometryArray that is BY_REFERENCE, ALLOW_REF_DATA_READ and = > ALLOW_REF_DATA_WRITE. > > I would like to add more user defined vertices to that GeometryArray, so = > I change the length of the underlying BY_REFERENCE coordinate array. > > I am able to adjust the validVertexCount via setValidVertexCount but not = > the vertexCount for the GeometryArray. > > It would seem that is not possible to adjust the length of the = > GeometryArray objects. > > Does anyone have any Ideas, to do this efficiently and with as minimal = > memory overhead as possible, do I have to make a new GeometryArray ?.
It's best to use a new GeometryArray. Since you're using BY_REFERENCE, most of the data stays put in your own arrays and there should be minimal copying. That said, one recent poster to this list did mention using Integer.MAX_VALUE for the vertexCount: > Delivered-To: [EMAIL PROTECTED] > X-Authentication-Warning: charon.adi-limited.com: nobody set sender to > <[EMAIL PROTECTED]> using -f > X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) > X-Accept-Language: en > MIME-Version: 1.0 > References: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us-ascii" > Content-Transfer-Encoding: 7bit > Date: Mon, 10 Mar 2003 09:01:47 +0800 > Reply-To: [EMAIL PROTECTED] > Sender: Discussion list for Java 3D API <[EMAIL PROTECTED]> > From: Brad Christiansen <[EMAIL PROTECTED]> > Content-Length: 5773 > > Hi, > > I have used Integer.MAX_VAL as the vertex count in the constructor. This works but I > have no idea if it is wasting any > resources. It seems not to be but I haven't investigated closely yet. I actualy > asked a question a little while back if this > wasted any resources and rescieved no answers. > > Cheers, > > Brad > > Nick Stark wrote: > > > > Thanks for the response. However, to construct a geometry array, one of > > the parameters that must be passed is the vertex count, which is simply an > > integer. If you pass 0 as the vertex count, then I have not been able to > > later increase this vertex count which has been the problem here. Any > > ideas to address that would be great... > > > > Thanks, > > Nick > > > > |---------+------------------------------> > > | | "Dirk L. van | > > | | Krimpen" | > > | | <[EMAIL PROTECTED]| > > | | .COM> | > > | | Sent by: Discussion| > > | | list for Java 3D | > > | | API | > > | | <[EMAIL PROTECTED]| > > | | VA.SUN.COM> | > > | | | > > | | | > > | | 03/07/2003 02:48 AM| > > | | Please respond to | > > | | Discussion list for| > > | | Java 3D API | > > | | | > > |---------+------------------------------> > > > > >--------------------------------------------------------------------------------------------------------------------------------------------------| > > | > > | > > | To: [EMAIL PROTECTED] > > | > > | cc: > > | > > | Subject: Re: [JAVA3D] Instantiating GeometryArrays without knowing their > > size | > > > > >--------------------------------------------------------------------------------------------------------------------------------------------------| > > > > Hi Nick, > > > > Not sure if this is what you're looking for, but in cases I don't know the > > size of the array beforehand, I do the following: > > > > At initialization (so, before the first constructor) I declare: > > > > float cords[]; > > > > And inside the constructor, just before the GeometryArray, when the number > > of vertices are known, I state: > > > > cords=new float[whatever number]; > > > > Again, not sure if this will help you, but it works for me. > > > > Have fun, Dirk > > > > ----- Original Message ----- > > From: "Nick Stark" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, March 06, 2003 2:38 PM > > Subject: [JAVA3D] Instantiating GeometryArrays without knowing their size > > > > > Hi everyone - > > > > > > I am forced by using the Externalizable interface to have a default > > > constructor for my class that extends a TriangleStripArray. However, > > > GeometryArrays do not have a default constructor, so I am wondering if > > > anyone knows a way of instantiating a GeometryArray without knowing its > > > size. I have figured out that I can make the GeometryArray larger than I > > > need, and I will only have the needed validVertexCount, but the non-valid > > > vertices are still stored in the array (vertices that are never used, but > > > are taking up memory). And I've also determined that you can't initially > > > create the GeometryArray smaller than necessary, because calling > > > setStripCounts on a TriangleStripArray throws an exception if the > > > vertexCount is less than the number of vertices listed in the > > stripCounts. > > > Any ideas or workarounds that anyone can think of? > > > > > > Thanks a lot, > > > Nick > > > > > > > > =========================================================================== > > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > > body > > > of the message "signoff JAVA3D-INTEREST". For general help, send email > > to > > > [EMAIL PROTECTED] and include in the body of the message "help". > > > > =========================================================================== > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > > of the message "signoff JAVA3D-INTEREST". For general help, send email to > > [EMAIL PROTECTED] and include in the body of the message "help". > > > > =========================================================================== > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > > of the message "signoff JAVA3D-INTEREST". For general help, send email to > > [EMAIL PROTECTED] and include in the body of the message "help". > > > ---------------------------------------------------------------------------- > This Email may contain confidential and/or privileged information and is > intended solely for the addressee(s) named. If you have received this > information in error, or are advised that you have been posted this Email by > accident, please notify the sender by return Email, do not redistribute it, > delete the Email and keep no copies. > ---------------------------------------------------------------------------- > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
