Class TLcdPolygonViewshedFactory
- All Implemented Interfaces:
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.
- Since:
- 11.0
- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdPolygonViewshedFactory
(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver) Creates a newTLcdPolygonViewshedFactory
, given anALcdViewshedObserver
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateViewshed
(Object aObject, ILcdModelModelTransformation aModelModelTransformation) Checks if thisTLcdPolygonViewshedFactory
can handle the given object.createViewshed
(Object aObject, ILcdModelModelTransformation aModelModelTransformation) Creates a viewshed for the givenILcdPolygon
.Returns the viewshed observer for thisTLcdBoundedCompositeViewshed
.boolean
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 ofILcdViewshed
instances.
-
Constructor Details
-
TLcdPolygonViewshedFactory
public TLcdPolygonViewshedFactory(ILcdGeoReference aViewshedReference, ALcdViewshedObserver aViewshedObserver) Creates a newTLcdPolygonViewshedFactory
, given anALcdViewshedObserver
.- Parameters:
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.
-
-
Method Details
-
getViewshedObserver
Returns the viewshed observer for thisTLcdBoundedCompositeViewshed
.- Returns:
- A viewshed observer.
-
isCullBackfaces
public boolean isCullBackfaces()Check whether this implementation culls back-faces.
- Returns:
- true if this implementation culls back-faces; false otherwise.
- See Also:
-
setCullBackfaces
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.
- Parameters:
aCullBackfaces
- true if this implementation should cull back faces; false otherwise.- See Also:
-
createViewshed
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.- 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. This should be a cartesian reference such asILcdGeocentricReference
.- Returns:
- A viewshed representation of
aObject
, for the observer given bygetViewshedObserver()
and in the destination reference ofaModelModelTransformation
.
-
canCreateViewshed
public boolean canCreateViewshed(Object aObject, ILcdModelModelTransformation aModelModelTransformation) Checks if thisTLcdPolygonViewshedFactory
can handle the given object.- 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. This should be a cartesian reference such asILcdGeocentricReference
.- Returns:
- true if the given
aObject
is an instance ofILcdPolygon
, and all its points lie in a single plane.
-