@@ -78,7 +78,7 @@ namespace py = pybind11;
7878/* An edge of a triangle consisting of an triangle index in the range 0 to
7979 * ntri-1 and an edge index in the range 0 to 2. Edge i goes from the
8080 * triangle's point i to point (i+1)%3. */
81- struct TriEdge
81+ struct TriEdge final
8282{
8383 TriEdge ();
8484 TriEdge (int tri_, int edge_);
@@ -111,7 +111,7 @@ struct XY
111111};
112112
113113// 3D point with x,y,z coordinates.
114- struct XYZ
114+ struct XYZ final
115115{
116116 XYZ (const double & x_, const double & y_, const double & z_);
117117 XYZ cross (const XYZ& other) const ;
@@ -123,7 +123,7 @@ struct XYZ
123123};
124124
125125// 2D bounding box, which may be empty.
126- class BoundingBox
126+ class BoundingBox final
127127{
128128public:
129129 BoundingBox ();
@@ -138,7 +138,7 @@ class BoundingBox
138138/* A single line of a contour, which may be a closed line loop or an open line
139139 * strip. Identical adjacent points are avoided using push_back(), and a closed
140140 * line loop should also not have identical first and last points. */
141- class ContourLine : public std ::vector<XY>
141+ class ContourLine final : public std::vector<XY>
142142{
143143public:
144144 ContourLine ();
@@ -157,7 +157,7 @@ void write_contour(const Contour& contour);
157157
158158/* Triangulation with npoints points and ntri triangles. Derived fields are
159159 * calculated when they are first needed. */
160- class Triangulation
160+ class Triangulation final
161161{
162162public:
163163 typedef py::array_t <double , py::array::c_style | py::array::forcecast> CoordinateArray;
@@ -254,7 +254,7 @@ class Triangulation
254254
255255private:
256256 // An edge of a triangulation, composed of start and end point indices.
257- struct Edge
257+ struct Edge final
258258 {
259259 Edge () : start(-1 ), end(-1 ) {}
260260 Edge (int start_, int end_) : start(start_), end(end_) {}
@@ -267,7 +267,7 @@ class Triangulation
267267 /* An edge of a boundary of a triangulation, composed of a boundary index
268268 * and an edge index within that boundary. Used to index into the
269269 * boundaries collection to obtain the corresponding TriEdge. */
270- struct BoundaryEdge
270+ struct BoundaryEdge final
271271 {
272272 BoundaryEdge () : boundary(-1 ), edge(-1 ) {}
273273 BoundaryEdge (int boundary_, int edge_)
@@ -328,7 +328,7 @@ class Triangulation
328328
329329
330330// Contour generator for a triangulation.
331- class TriContourGenerator
331+ class TriContourGenerator final
332332{
333333public:
334334 typedef Triangulation::CoordinateArray CoordinateArray;
@@ -508,7 +508,7 @@ class TriContourGenerator
508508 * colinear points but only in the simplest of cases. No explicit testing of
509509 * the validity of the triangulation is performed as this is a computationally
510510 * more complex task than the trifinding itself. */
511- class TrapezoidMapTriFinder
511+ class TrapezoidMapTriFinder final
512512{
513513public:
514514 typedef Triangulation::CoordinateArray CoordinateArray;
@@ -551,7 +551,7 @@ class TrapezoidMapTriFinder
551551 /* A Point consists of x,y coordinates as well as the index of a triangle
552552 * associated with the point, so that a search at this point's coordinates
553553 * can return a valid triangle index. */
554- struct Point : XY
554+ struct Point final : XY
555555 {
556556 Point () : XY(), tri(-1 ) {}
557557 Point (const double & x, const double & y) : XY(x,y), tri(-1 ) {}
@@ -565,7 +565,7 @@ class TrapezoidMapTriFinder
565565 * the Edge which are used to map from trapezoid to triangle index. Also
566566 * stores pointers to the 3rd points of the below and above triangles,
567567 * which are only used to disambiguate triangles with colinear points. */
568- struct Edge
568+ struct Edge final
569569 {
570570 Edge (const Point* left_,
571571 const Point* right_,
@@ -608,7 +608,7 @@ class TrapezoidMapTriFinder
608608 class Node ; // Forward declaration.
609609
610610 // Helper structure used by TrapezoidMapTriFinder::get_tree_stats.
611- struct NodeStats
611+ struct NodeStats final
612612 {
613613 NodeStats ()
614614 : node_count(0 ), trapezoid_count(0 ), max_parent_count(0 ),
@@ -632,7 +632,7 @@ class TrapezoidMapTriFinder
632632 * The parent collection acts as a reference count to the number of times
633633 * a Node occurs in the search tree. When the parent count is reduced to
634634 * zero a Node can be safely deleted. */
635- class Node
635+ class Node final
636636 {
637637 public:
638638 Node (const Point* point, Node* left, Node* right);// Type_XNode.
@@ -717,7 +717,7 @@ class TrapezoidMapTriFinder
717717 * To obtain the index of the triangle corresponding to a particular
718718 * Trapezoid, use the Edge member variables below.triangle_above or
719719 * above.triangle_below. */
720- struct Trapezoid
720+ struct Trapezoid final
721721 {
722722 Trapezoid (const Point* left_,
723723 const Point* right_,
0 commit comments