public class TLcdPolygonViewshedFactory extends Object implements ILcdViewshedFactory
A viewshed factory that can create viewsheds for planar polygons (i.e. polygons which have points that are part of the same, arbitrary 3D plane).
To create a viewshed, either use the methods defined in ILcdViewshedFactory
,
or directly call the createViewshed(com.luciad.shape.ILcdPolygon, com.luciad.transformation.ILcdModelModelTransformation)
method.
The setCullBackfaces(boolean)
method can be used to automatically cull polygons that are
not facing the observer. See the javadoc of the method for more details.
Constructor and Description |
---|
TLcdPolygonViewshedFactory(ILcdGeoReference aViewshedReference,
ALcdViewshedObserver aViewshedObserver)
Creates a new
TLcdPolygonViewshedFactory , given an ALcdViewshedObserver . |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateViewshed(Object aObject,
ILcdModelModelTransformation aModelModelTransformation)
Checks if this
TLcdPolygonViewshedFactory can handle the given object. |
ILcdViewshed |
createViewshed(Object aObject,
ILcdModelModelTransformation aModelModelTransformation)
Creates a viewshed for the given
ILcdPolygon . |
ALcdViewshedObserver |
getViewshedObserver()
Returns the viewshed observer for this
TLcdBoundedCompositeViewshed . |
boolean |
isCullBackfaces()
Check whether this implementation culls back-faces.
|
void |
setCullBackfaces(boolean aCullBackfaces)
If true, this implementation will cull polygons that are back-facing by having this factory
return null for back-facing polygons instead of
ILcdViewshed instances. |
public TLcdPolygonViewshedFactory(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver)
TLcdPolygonViewshedFactory
, given an ALcdViewshedObserver
.aViewshedReference
- The viewshed reference that should be used by this factory. All generated
viewsheds will use this reference.aViewshedObserver
- The viewshed observer for this viewshed.public ALcdViewshedObserver getViewshedObserver()
TLcdBoundedCompositeViewshed
.public boolean isCullBackfaces()
Check whether this implementation culls back-faces.
setCullBackfaces(boolean)
public void setCullBackfaces(boolean aCullBackfaces)
If true, this implementation will cull polygons that are back-facing by having this factory
return null for back-facing polygons instead of ILcdViewshed
instances.
A polygon is back-facing if the polygon appears to be counter-clockwise when viewed from the observer.
aCullBackfaces
- true if this implementation should cull back faces; false otherwise.isCullBackfaces()
public ILcdViewshed createViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)
Creates a viewshed for the given ILcdPolygon
.
The arguments for this method should return true for the
ILcdViewshedFactory.canCreateViewshed(Object, com.luciad.transformation.ILcdModelModelTransformation)
method.
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. This should be a cartesian reference
such as ILcdGeocentricReference
.aObject
, for the observer given by getViewshedObserver()
and
in the destination reference of aModelModelTransformation
.public boolean canCreateViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation)
TLcdPolygonViewshedFactory
can handle the given object.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. This should be a cartesian reference
such as ILcdGeocentricReference
.aObject
is an instance of ILcdPolygon
, and
all its points lie in a single plane.