org.reprap
Class Attributes

java.lang.Object
  extended by org.reprap.Attributes

public class Attributes
extends java.lang.Object

Small class to hold RepRap attributes that are attached to Java3D shapes as user data, primarily to record the material that things are made from.

Author:
adrian

Field Summary
private  javax.media.j3d.Appearance app
          The appearance (colour) in the loading and simulation windows
private  Extruder e
          The extruder corresponsing to this material.
private  java.lang.String material
          The name of the material
private  STLObject parent
          The STLObject of which this is a part
private  javax.media.j3d.BranchGroup part
          Where this is in the STLObject of which it is a part
 
Constructor Summary
Attributes(java.lang.String s, STLObject p, javax.media.j3d.BranchGroup b, javax.media.j3d.Appearance a)
          Constructor - it is permissible to set any argument null.
 
Method Summary
 javax.media.j3d.Appearance getAppearance()
           
 Extruder getExtruder()
          Find my extruder in the list (if not known) or just return it (if known).
 java.lang.String getMaterial()
           
 STLObject getParent()
           
 javax.media.j3d.BranchGroup getPart()
           
 void setAppearance(javax.media.j3d.Appearance a)
          New colour
 void setMaterial(java.lang.String s)
          Change the material name
 void setParent(STLObject p)
          Change the parent
 void setPart(javax.media.j3d.BranchGroup b)
          To be used in conjunction with changing the parent
 java.lang.String toString()
          Just say the name of the material
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

material

private java.lang.String material
The name of the material


parent

private STLObject parent
The STLObject of which this is a part


part

private javax.media.j3d.BranchGroup part
Where this is in the STLObject of which it is a part


app

private javax.media.j3d.Appearance app
The appearance (colour) in the loading and simulation windows


e

private Extruder e
The extruder corresponsing to this material. This is lazily evaluated (I.e. it is not set until there are some extruders around to use).

Constructor Detail

Attributes

public Attributes(java.lang.String s,
                  STLObject p,
                  javax.media.j3d.BranchGroup b,
                  javax.media.j3d.Appearance a)
Constructor - it is permissible to set any argument null. If you know what you're doing of course...

Parameters:
s - The name of the material
p - Parent STLObject
b - Where in p
a - what it looks like
Method Detail

toString

public java.lang.String toString()
Just say the name of the material

Overrides:
toString in class java.lang.Object

getMaterial

public java.lang.String getMaterial()
Returns:
the name of the material

getParent

public STLObject getParent()
Returns:
the parent object

getPart

public javax.media.j3d.BranchGroup getPart()
Returns:
the bit of the STLObject that this is

getAppearance

public javax.media.j3d.Appearance getAppearance()
Returns:
what colour am I?

getExtruder

public Extruder getExtruder()
Find my extruder in the list (if not known) or just return it (if known).

Parameters:
es - The extruders currently in the printer.
Returns:
my extruder

setMaterial

public void setMaterial(java.lang.String s)
Change the material name

Parameters:
s -

setParent

public void setParent(STLObject p)
Change the parent

Parameters:
p -

setPart

public void setPart(javax.media.j3d.BranchGroup b)
To be used in conjunction with changing the parent

Parameters:
b -

setAppearance

public void setAppearance(javax.media.j3d.Appearance a)
New colour

Parameters:
a -