fr.cnes.sirius.patrius.fieldsofview
Class InvertField

java.lang.Object
  extended by fr.cnes.sirius.patrius.fieldsofview.InvertField
All Implemented Interfaces:
IFieldOfView

public final class InvertField
extends Object
implements IFieldOfView

This field of view contains an existing field and inverts it.

Since:
1.2
Version:
$Id: InvertField.java 17586 2017-05-10 13:29:16Z bignon $
Author:
Thomas Trapier
See Also:
IFieldOfView
Concurrency :
conditionally thread-safe
Concurrency comment :
the used field must be thread-safe itself. All available fields are immutable.

Constructor Summary
InvertField(String name, IFieldOfView invertedField)
          Constructor of the invert field of a given one.
 
Method Summary
 double getAngularDistance(Vector3D direction)
          Computes the angular distance between a vector and the border of the field.
 String getName()
          
 boolean isInTheField(Vector3D direction)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvertField

public InvertField(String name,
                   IFieldOfView invertedField)
Constructor of the invert field of a given one.

Parameters:
name - the name of the new field
invertedField - the field to be inverted
Method Detail

getAngularDistance

public double getAngularDistance(Vector3D direction)
Computes the angular distance between a vector and the border of the field. The result is positive if the direction is in the field, negative otherwise. This "invert" field simply invert the value given by the origin field.

Specified by:
getAngularDistance in interface IFieldOfView
Parameters:
direction - the direction vector
Returns:
the angular distance

isInTheField

public boolean isInTheField(Vector3D direction)

Specified by:
isInTheField in interface IFieldOfView
Parameters:
direction - a direction vector
Returns:
true if the direction is in the field

getName

public String getName()

Specified by:
getName in interface IFieldOfView
Returns:
the name of the field


Copyright © 2017 CNES. All Rights Reserved.