public class TLcdTerrainViewshedFactory extends Object implements ILcdViewshedFactory, ILcdStatusSource
Creates viewsheds for terrain models.
Constructor and Description |
---|
TLcdTerrainViewshedFactory(ILcdGeoReference aViewshedReference,
ALcdViewshedObserver aViewshedObserver,
double aStepSize)
Creates a new terrain viewshed factory that samples terrain for a given step size.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(ILcdStatusListener aStatusListener)
Starts notifying a listener with the progress of creation of a viewshed
|
boolean |
canCreateViewshed(Object aObject,
ILcdModelModelTransformation aModelModelTransformation)
Checks if the given object is a height provider.
|
ILcdViewshed |
createViewshed(ILcdHeightProvider aHeightProvider,
ILcdBounds aBounds,
ILcdModelModelTransformation aModelModelTransformation)
Creates a viewshed for a given height provider within a given bounds.
|
ILcdViewshed |
createViewshed(Object aObject,
ILcdModelModelTransformation aModelModelTransformation)
Creates a viewshed for a given object.
|
ILcdBounds |
getSamplingBounds()
Returns the bounds in which terrain is sampled, expressed in the reference of the
height provider.
|
double |
getStepSize()
Gets the step size in which terrain is sampled, expressed in the reference of the terrain.
|
void |
removeStatusListener(ILcdStatusListener aStatusListener)
Terminates notifying a listener of the progress of creation of a viewshed
|
void |
setSamplingBounds(ILcdBounds aSamplingBounds)
Sets the sampling bounds for this terrain viewshed factory.
|
void |
setStepSize(double aPixelDensity)
Sets the step size in which terrain should be sampled, expressed in the reference of the terrain.
|
public TLcdTerrainViewshedFactory(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver, double aStepSize)
aViewshedReference
- the reference of the generated viewshedsaViewshedObserver
- A viewshed observeraStepSize
- A step size in the reference of the terrain. The step size should be defined
in the reference of the given height providers.public void removeStatusListener(ILcdStatusListener aStatusListener)
removeStatusListener
in interface ILcdStatusSource
aStatusListener
- will no longer be notified of progress of creation of the viewshedaddStatusListener(com.luciad.util.ILcdStatusListener)
public void addStatusListener(ILcdStatusListener aStatusListener)
addStatusListener
in interface ILcdStatusSource
aStatusListener
- will be notified of progress of creation of the viewshedremoveStatusListener(ILcdStatusListener)
public double getStepSize()
public void setStepSize(double aPixelDensity)
aPixelDensity
- the step size in which terrain should be sampled,
expressed in the reference of the terrain.public ILcdBounds getSamplingBounds()
Returns the bounds in which terrain is sampled, expressed in the reference of the height provider.
By default this value is null, which means this factory will use the bounds of the given height providers for sampling.
setSamplingBounds(com.luciad.shape.ILcdBounds)
public void setSamplingBounds(ILcdBounds aSamplingBounds)
Sets the sampling bounds for this terrain viewshed factory. The bounds must be given
in the reference of the height providers given to the createViewshed(Object, com.luciad.transformation.ILcdModelModelTransformation)
methods.
This method acts as an override function. If set to null, no bounds will be overridden, and this object will create viewsheds based on the bounds of the given height providers.
aSamplingBounds
- A boundspublic ILcdViewshed createViewshed(ILcdHeightProvider aHeightProvider, ILcdBounds aBounds, ILcdModelModelTransformation aModelModelTransformation)
setStepSize(double)
) or at construction.aHeightProvider
- A height provideraBounds
- The bounds in which terrain should be sampled for the viewshed, given in the source
reference of aModelModelTransformation
.aModelModelTransformation
- A transformation that has its source reference set to the reference in which
aHeightProvider
can be sampled, and its destination reference
set to the desired reference of the resulting viewshed.aModelModelTransformation
public ILcdViewshed createViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)
Creates a viewshed for a given object.
If the given object is ILcdBounded
, and no specific sampling bounds
have been set by setSamplingBounds(com.luciad.shape.ILcdBounds)
, then
these bounds returned by this ILcdBounded
object will be used to sample
the terrain.
If getSamplingBounds()
is not null, then the value of getSamplingBounds()
will be used instead.
createViewshed
in interface ILcdViewshedFactory
aObject
- The object for which a viewshed will be created.aModelModelTransformation
- The transformation that transforms the domain object to the
reference in which the viewshed should be defined. The source
reference should be the reference of aObject
and
aModel
. The destination reference is the desired
reference of the viewshed.aModelModelTransformation
public boolean canCreateViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)
canCreateViewshed
in interface ILcdViewshedFactory
aObject
- The object to check.aModelModelTransformation
- The transformation that transforms the domain object to the
reference in which the viewshed should be defined. The source
reference should be the reference of aObject
and
aModel
. The destination reference is the desired
reference of the viewshed.aObject
is a height provider; false otherwise.