com.powerml.structures.styles
Class SpatialStyle

java.lang.Object
  extended bycom.powerml.structures.styles.SpatialStyle
All Implemented Interfaces:
java.io.Serializable

public class SpatialStyle
extends java.lang.Object
implements java.io.Serializable

This class is used to specify a shape's 3D properties.

See Also:
Serialized Form

Field Summary
static byte INTENSITY_BRIGHT
          Bright light source
static byte INTENSITY_DIM
          Dim light source
static byte INTENSITY_NORMAL
          Normal light source
 
Method Summary
 void addXml(org.dom4j.Element parent, int roundPrecision)
          Transforms current instance to XML and adds it to a parent element.
 RGBColor getColor()
          Returns the 3D color.
 int getDepth()
          Returns the 3D depth.
 double getDiffuseAmount()
          Returns the diffuse light amount.
 byte getLightIntensity()
          Returns the light source intensity.
 Point getLightPosition()
          Returns the position of the light source relative to the shape.
 double getSpecularAmount()
          Returns the specular light amount.
 Point getViewpoint()
          Returns the position of the viewpoint relative to the shape.
 int getXRotationAngle()
          Returns the rotation angle around the x axis (up/down tilt).
 int getYRotationAngle()
          Returns the rotation angle around the y axis (left/right tilt).
 boolean isActive()
          Checks if the shape has 3D properties.
 boolean isPerspective()
          Checks if perspective projection is active.
 boolean isWireframe()
          Checks whether the resulting 3D shape is shown as a wireframe.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTENSITY_BRIGHT

public static final byte INTENSITY_BRIGHT
Bright light source

See Also:
Constant Field Values

INTENSITY_DIM

public static final byte INTENSITY_DIM
Dim light source

See Also:
Constant Field Values

INTENSITY_NORMAL

public static final byte INTENSITY_NORMAL
Normal light source

See Also:
Constant Field Values
Method Detail

addXml

public void addXml(org.dom4j.Element parent,
                   int roundPrecision)
Transforms current instance to XML and adds it to a parent element.

Parameters:
parent - parent element
roundPrecision - rounding precision

getColor

public RGBColor getColor()
Returns the 3D color.

Returns:
3D color

getDepth

public int getDepth()
Returns the 3D depth.

Returns:
3D depth

getDiffuseAmount

public double getDiffuseAmount()
Returns the diffuse light amount.

Returns:
diffuse amount

getLightIntensity

public byte getLightIntensity()
Returns the light source intensity.

Returns:
light intensity

getLightPosition

public Point getLightPosition()
Returns the position of the light source relative to the shape. There are 9 possible positions resulting from 3 positions on the x axis (left=-1, center=0, right=1) and 3 positions on the y axis (top=-1, center=0, bottom=1). The z coordinate cannot be specified.

Returns:
light position.

getSpecularAmount

public double getSpecularAmount()
Returns the specular light amount.

Returns:
specular amount

getViewpoint

public Point getViewpoint()
Returns the position of the viewpoint relative to the shape. There are 9 possible positions resulting from 3 positions on the x axis (left=-1, center=0, right=1) and 3 positions on the y axis (top=-1, center=0, bottom=1). The z coordinate cannot be specified.

Returns:
viewpoint position.

getXRotationAngle

public int getXRotationAngle()
Returns the rotation angle around the x axis (up/down tilt).

Returns:
x rotation angle

getYRotationAngle

public int getYRotationAngle()
Returns the rotation angle around the y axis (left/right tilt).

Returns:
x rotation angle

isActive

public boolean isActive()
Checks if the shape has 3D properties.

Returns:
true if 3D on, otherwise false

isPerspective

public boolean isPerspective()
Checks if perspective projection is active.

Returns:
true if perspective, otherwise false

isWireframe

public boolean isWireframe()
Checks whether the resulting 3D shape is shown as a wireframe.

Returns:
true if wireframe, otherwise false


© 2004-2005 Ralf Terdic. All rights reserved.
www.powerml.com