public final class PyramidalField extends Object implements IFieldOfView
IFieldOfView
,
Serialized FormModifier | Constructor and Description |
---|---|
|
PyramidalField(String name,
Vector3D[] directions)
Constructor for a pyramidal field of view.
|
|
PyramidalField(String name,
Vector3D[] directions,
boolean checkIntersectingFaces)
Constructor for a pyramidal field of view.
|
protected |
PyramidalField(String name,
Vector3D[] directions,
PolyhedronsSet polyhedronIn)
Constructor for a pyramidal field of view.
|
protected |
PyramidalField(String name,
Vector3D[] directions,
PolyhedronsSet polyhedronIn,
boolean checkIntersectingFaces)
Protected constructor for a pyramidal field of view.
|
Modifier and Type | Method and Description |
---|---|
IDirection[] |
computeSideDirections(Frame frame)
Retrieve the directions delimiting the pyramidal field of view.
|
boolean |
equals(PyramidalField otherFov,
double angularTol)
Check the equality between this and a provided
PyramidalField . |
double |
getAngularDistance(Vector3D direction)
Computes the angular distance between a vector and the border of the field.
|
PyramidalField |
getComplementaryFieldOfView()
Build the complementary field of view of this.
|
PyramidalField |
getIntersectionWith(PyramidalField otherFov)
Build a new
PyramidalField from the intersection between this field of view and the provided one. |
String |
getName() |
Vector3D[] |
getSideAxis()
Get the side axis of the field of view.
|
PyramidalField |
getUnionWith(PyramidalField otherFov)
Build a new
PyramidalField from the union between this field of view and the provided one. |
boolean |
isConvex()
Indicates whether or not this field of view is convex.
|
boolean |
isIntersectingFaces()
Indicates whether or not the faces of this field intersect each other.
|
boolean |
isInTheField(PyramidalField otherFov)
Indicates whether or not the provided
PyramidalField is included in this one. |
boolean |
isInTheField(Vector3D direction) |
static boolean |
turnClockwise(PyramidalField fov)
Assess if the side axes of the entered field of view turn clockwise or counter-clockwise, from a sensor's/user's
point of view.
Calculation is perfomed only once for a field, meaning that it is performed if it has never been, and returns the previously calculated result otherwise. Field's attribute alreadyComputed is updated for this purpose. |
public PyramidalField(String name, Vector3D[] directions)
name
- the name of the fielddirections
- the directions defining the border of the field.
They must be given in the right order : from the vector i to the vector i + 1,
the inside of the field is on the side of the positive cross vector v(i) * v(i+1)protected PyramidalField(String name, Vector3D[] directions, PolyhedronsSet polyhedronIn)
name
- the name of the fielddirections
- the directions defining the border of the field.
They must be given in the right order : from the vector i to the vector i + 1,
the inside of the field is on the side of the positive cross vector v(i) * v(i+1)polyhedronIn
- the polyhedron modelizing the field of viewpublic PyramidalField(String name, Vector3D[] directions, boolean checkIntersectingFaces)
name
- the name of the fielddirections
- the directions defining the border of the field.
They must be given in the right order : from the vector i to the vector i + 1,
the inside of the field is on the side of the positive cross vector v(i) * v(i+1)checkIntersectingFaces
- flag that indicates if a verification on the field of view has to be performed: if yes, an exception is
thrown if any field's face crosses any other faceprotected PyramidalField(String name, Vector3D[] directions, PolyhedronsSet polyhedronIn, boolean checkIntersectingFaces)
name
- the name of the fielddirections
- the directions defining the border of the field.
They must be given in the right order : from the vector i to the vector i + 1,
the inside of the field is on the side of the positive cross vector v(i) * v(i+1)polyhedronIn
- the polyhedron modelizing the field of viewcheckIntersectingFaces
- flag that indicates if a verification on the field of view has to be performed: if yes, an exception is
thrown if any field's face crosses any other facepublic double getAngularDistance(Vector3D direction)
getAngularDistance
in interface IFieldOfView
direction
- the direction vector (expressed in the topocentric coordinate system of the object)public boolean isInTheField(Vector3D direction)
isInTheField
in interface IFieldOfView
direction
- a direction vector (expressed in the topocentric coordinate system of the object)public String getName()
getName
in interface IFieldOfView
public Vector3D[] getSideAxis()
public boolean isConvex()
true
if this field is convexpublic boolean isIntersectingFaces()
true
if the faces of this field intersect each otherpublic boolean equals(PyramidalField otherFov, double angularTol)
PyramidalField
. The side axis are assumed to be sorted in
the same order. To be equal, both objects must have the same number of side axis and side axis at same index
position must be colinear within a given tolerance.otherFov
- the other pyramidal fieldangularTol
- the numerical tolerance to check the colinearity between side axistrue
if both pyramidal field are equal within the tolerancepublic boolean isInTheField(PyramidalField otherFov)
PyramidalField
is included in this one. The condition
is respected if every side axis of the other field of view are contained in this one and if every side axis
of this one are outside the other pyramidal field.
Note: The second condition is verified only if this field of view is not convex.
Note: By convention the result is true if the provided PyramidalField
is null.
otherFov
- the other field of view.true
if this field of view contains the other onepublic PyramidalField getComplementaryFieldOfView()
public PyramidalField getIntersectionWith(PyramidalField otherFov) throws PatriusException
PyramidalField
from the intersection between this field of view and the provided one.otherFov
- the other field of view.PatriusException
- thrown if an error occurs with the binary space partition. Such error can occur if one of the fields is
concave and leads to several intersections.public PyramidalField getUnionWith(PyramidalField otherFov) throws PatriusException
PyramidalField
from the union between this field of view and the provided one.otherFov
- the other field of view.PatriusException
- thrown if an error occurs with the binary space partition. Such error can occur if the
two fields are disjointed or if one of them is concave and leads to a hole in the middle of the
theoretical resulting field.public IDirection[] computeSideDirections(Frame frame)
frame
- the reference frame in which the vectors will be defined as
constantpublic static final boolean turnClockwise(PyramidalField fov)
fov
- input field of view (expected to be well-formed, i.e. its faces do not cross with each other)Copyright © 2023 CNES. All rights reserved.