com.speckled.specksim.imp.walls
Class RandomWalls

java.lang.Object
  extended by com.speckled.specksim.imp.walls.RandomWalls
All Implemented Interfaces:
Configurable, WallProvider

@ConfigurableType(value="Random Walls")
public class RandomWalls
extends java.lang.Object
implements WallProvider

This class represents a number of radio-opaque walls in the simulator

Author:
ryanm

Constructor Summary
RandomWalls()
           
 
Method Summary
 Configurator getConfigurator()
          Gets a Configurator object that describes and can manipulate the variables of this Configurable.
 java.lang.String getName()
          Gets a name for this provider
 int getNumberOfWalls()
          Gets the number of walls
 boolean getTwoDMode()
          Determines if this provider is in two-d mode
 float getWallArea()
          Gets the area of each wall
 int getWallGenerationSeed()
          Gets the current rng seed
 Wall[] getWalls()
          Gets the walls
 void init(WallManager manager)
          Called when this provider is made current for the simulator
 void setNumberOfWalls(int n)
          Sets the number of walls
 void setTwoDMode(boolean twoD)
          Sets if this provider is in two-d mode
 void setWallArea(float area)
          Sets the surface area of each wall
 void setWallGenerationSeed(int seed)
          Sets the seed for the RNG that generates the vertices of the walls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomWalls

public RandomWalls()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: WallProvider
Gets a name for this provider

Specified by:
getName in interface WallProvider
Returns:
A name

getWalls

public Wall[] getWalls()
Description copied from interface: WallProvider
Gets the walls

Specified by:
getWalls in interface WallProvider
Returns:
An array of the wall objects that should be added to the simulator

init

public void init(WallManager manager)
Description copied from interface: WallProvider
Called when this provider is made current for the simulator

Specified by:
init in interface WallProvider
Parameters:
manager - The manager who must be kept appraised of changes to the walls

setTwoDMode

@ConfigurableVariable(value="2D mode")
@Description(value="When in 2D mode, walls will be generated on the z=0 plane")
public void setTwoDMode(boolean twoD)
Sets if this provider is in two-d mode

Parameters:
twoD - true to generate walls on the z=0 plane, false to generate them in the unit cube

getTwoDMode

@ConfigurableVariable(value="2D mode")
public boolean getTwoDMode()
Determines if this provider is in two-d mode

Returns:
true if in two-d mode, false otherwise

setWallArea

@ConfigurableVariable(value="Wall size")
@Description(value="The surface area of each wall")
@NumberRange(value={0.0f,1.0f})
public void setWallArea(float area)
Sets the surface area of each wall

Parameters:
area - The desired area

getWallArea

@ConfigurableVariable(value="Wall size")
public float getWallArea()
Gets the area of each wall

Returns:
The current area

setNumberOfWalls

@ConfigurableVariable(value="Number of walls")
@Description(value="The number of walls")
@NumberRange(value={0.0f,0f/0f})
public void setNumberOfWalls(int n)
Sets the number of walls

Parameters:
n - The number of walls

getNumberOfWalls

@ConfigurableVariable(value="Number of walls")
public int getNumberOfWalls()
Gets the number of walls

Returns:
The number of walls

setWallGenerationSeed

@ConfigurableVariable(value="RNG seed offset")
@Description(value="The rng seed for vertex generation")
public void setWallGenerationSeed(int seed)
Sets the seed for the RNG that generates the vertices of the walls

Parameters:
seed - The new rng seed

getWallGenerationSeed

@ConfigurableVariable(value="RNG seed offset")
public int getWallGenerationSeed()
Gets the current rng seed

Returns:
the current rng seed

getConfigurator

public Configurator getConfigurator()
Description copied from interface: Configurable
Gets a Configurator object that describes and can manipulate the variables of this Configurable. This method must only return null if the Configurable object is Annotated such that an AnnotatedConfigurator can be built from it.

Specified by:
getConfigurator in interface Configurable
Returns:
A configurator object, or null if annotated