CGAL 5.0 - 2D Visibility
This class is a model of the concept
Visibility_2 can answer visibility queries within a polygon that may have holes.
The algorithm obtains a constrained triangulation from the input arrangement, then computes visibility by expanding the triangle that contains the query point. Preprocessing takes \( O(n)\) time and \( O(n) \) space, where \( n \) is the number of vertices of input polygon. The query time is \( O(nh)\), where \( h \) is the number of holes+1 of input polygon. Thus, for simple polygons (or a polygon with a constant number of holes) the algorithm complexity is linear, but it is \( O(n^2)\) in the worst case, as the number of holes can be linear in \( n \).
|Arrangement_2_||is the type used to represent the input environment. It must be an instance of |
|RegularizationCategory||indicates whether the output should be regularized. It can be specified by one of the following: |
|The type of the input arrangement. |
|identifies whether the regularized visibility area is computed (either |
|See Visibility_2::Supports_general_polygon_category. |
|See Visibility_2::Supports_simple_polygon_category. |
|void||attach (const Arrangement_2 &arr)|
|Attaches the given arrangement to the visibility object and computes the restricted triangulation. More...|
|typedef RegularizationCategory CGAL::Triangular_expansion_visibility_2< Arrangement_2_, RegularizationCategory >::Regularization_category|
|void CGAL::Triangular_expansion_visibility_2< Arrangement_2_, RegularizationCategory >::attach||(||const Arrangement_2 &||arr||)|
Attaches the given arrangement to the visibility object and computes the restricted triangulation.
This takes \( O(n) \) time, where \( n \) is the number of vertices.
From this moment on the class observes changes in the arrangement. If the arrangement changes a new restricted triangulation is computed. Re-attaching forces re-computation.
In case the object is already attached to another arrangement, the visibility object gets detached before being attached to