Hello Nikolaos,

I'm pretty sure that the appearance is assigned by reference.  I am
using several Shape3D with IndexQuadArrays, all assigned the same
appearance object.  To change the appearance fill state of the entire
scene, I just retrieve one appearance and change the PolygonAttributes,
and that change propagates through all the Shapes.  You do not have to
reassign the changed appearance to see the effect.

The following couple of lines shows how I use this to set the lines/fill
state of the appearance of the Shapes in my scene.  Note that
StructureAppearance extends Appearance and pa is the PolygonAttributes.

Method call which sets fill/lines of all shapes:  This is called on just
one Shape3D:
        ((StructureAppearance) this.getAppearance()).fill(isFilled);

Implementation in StructureAppearance:
   public void fill (boolean fill) {
        if (fill) 
            pa.setPolygonMode(PolygonAttributes.POLYGON_FILL);
        else 
            pa.setPolygonMode(PolygonAttributes.POLYGON_LINE);
    }

Good luck,

Christopher

-----Original Message-----
From: Nikolaos Abatzis [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 05, 2001 12:03 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] By reference or by value
Importance: High


Hello folks,

Quick question:

When an object is "assigned" an appearance, does it actually have a link
to
that appearance or a "hard copy"?
That is if you change the appearance object does the shape that uses
that
appearance change as well yes, or no. If not how can you change an
appearance dynamically? Do you have to go and reassign the new
appearance
with setAppearance(...)?

Your help is appreciated!

Nikolaos

========================================================================
===
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".

Reply via email to