Class TLcdTerrainViewshedFactory
- All Implemented Interfaces:
ILcdViewshedFactory
,ILcdStatusSource
Creates viewsheds for terrain models.
- Since:
- 11.0
-
Constructor Summary
ConstructorDescriptionTLcdTerrainViewshedFactory
(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver, double aStepSize) Creates a new terrain viewshed factory that samples terrain for a given step size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener aStatusListener) Starts notifying a listener with the progress of creation of a viewshedboolean
canCreateViewshed
(Object aObject, ILcdModelModelTransformation aModelModelTransformation) Checks if the given object is a height provider.createViewshed
(ILcdHeightProvider aHeightProvider, ILcdBounds aBounds, ILcdModelModelTransformation aModelModelTransformation) Creates a viewshed for a given height provider within a given bounds.createViewshed
(Object aObject, ILcdModelModelTransformation aModelModelTransformation) Creates a viewshed for a given object.Returns the bounds in which terrain is sampled, expressed in the reference of the height provider.double
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 viewshedvoid
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.
-
Constructor Details
-
TLcdTerrainViewshedFactory
public TLcdTerrainViewshedFactory(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver, double aStepSize) Creates a new terrain viewshed factory that samples terrain for a given step size.- Parameters:
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.
-
-
Method Details
-
removeStatusListener
Terminates notifying a listener of the progress of creation of a viewshed- Specified by:
removeStatusListener
in interfaceILcdStatusSource
- Parameters:
aStatusListener
- will no longer be notified of progress of creation of the viewshed- See Also:
-
addStatusListener
Starts notifying a listener with the progress of creation of a viewshed- Specified by:
addStatusListener
in interfaceILcdStatusSource
- Parameters:
aStatusListener
- will be notified of progress of creation of the viewshed- See Also:
-
getStepSize
public double getStepSize()Gets the step size in which terrain is sampled, expressed in the reference of the terrain.- Returns:
- the step size in which terrain is sampled, expressed in the reference of the terrain.
-
setStepSize
public void setStepSize(double aPixelDensity) Sets the step size in which terrain should be sampled, expressed in the reference of the terrain.- Parameters:
aPixelDensity
- the step size in which terrain should be sampled, expressed in the reference of the terrain.
-
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.
- Returns:
- null if no sampling bounds
- See Also:
-
setSamplingBounds
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.
- Parameters:
aSamplingBounds
- A bounds
-
createViewshed
public ILcdViewshed createViewshed(ILcdHeightProvider aHeightProvider, ILcdBounds aBounds, ILcdModelModelTransformation aModelModelTransformation) Creates a viewshed for a given height provider within a given bounds. The height provider will be sampled in the set step size, which is set usingsetStepSize(double)
) or at construction.- Parameters:
aHeightProvider
- A height provideraBounds
- The bounds in which terrain should be sampled for the viewshed, given in the source reference ofaModelModelTransformation
.aModelModelTransformation
- A transformation that has its source reference set to the reference in whichaHeightProvider
can be sampled, and its destination reference set to the desired reference of the resulting viewshed.- Returns:
- A viewshed for the given height provider, created for the object within the given bounds, in the
reference that is the destination reference of
aModelModelTransformation
-
createViewshed
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 bysetSamplingBounds(com.luciad.shape.ILcdBounds)
, then these bounds returned by thisILcdBounded
object will be used to sample the terrain.If
getSamplingBounds()
is not null, then the value ofgetSamplingBounds()
will be used instead.- Specified by:
createViewshed
in interfaceILcdViewshedFactory
- Parameters:
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 ofaObject
andaModel
. The destination reference is the desired reference of the viewshed.- Returns:
- A viewshed for the given height provider, created for the object within the given bounds, in the
reference that is the destination reference of
aModelModelTransformation
-
canCreateViewshed
public boolean canCreateViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation) Checks if the given object is a height provider.- Specified by:
canCreateViewshed
in interfaceILcdViewshedFactory
- Parameters:
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 ofaObject
andaModel
. The destination reference is the desired reference of the viewshed.- Returns:
- true if
aObject
is a height provider; false otherwise.
-