Pottu
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
pottu::Gate2D Struct Reference

Defines 2D polygon for 2D gating. More...

#include <Gate2D.hpp>

Collaboration diagram for pottu::Gate2D:
Collaboration graph
[legend]

Classes

struct  point_t
 Point type. More...
 

Public Member Functions

void update ()
 updates the other important fields after modifying points. More...
 
bool operator() (double x, double y) const noexcept
 Tests if a given point is inside the gate. More...
 

Static Public Member Functions

static Gate2D createFromAsciiFile (const std::string &filename)
 Reads the polygon from a file. More...
 
static int hasIntersection (point_t p0, point_t p1, point_t p2, point_t p3) noexcept
 

Public Attributes

std::vector< point_tpoints
 
point_t pointOutside {0,0}
 
point_t c00 {0}
 
point_t c11 {0}
 

Detailed Description

Defines 2D polygon for 2D gating.

Member Function Documentation

◆ createFromAsciiFile()

static Gate2D pottu::Gate2D::createFromAsciiFile ( const std::string &  filename)
inlinestatic

Reads the polygon from a file.

File must contain two columns, x and y, separated by whitespace. After the read this function calls update() automatically.

◆ operator()()

bool pottu::Gate2D::operator() ( double  x,
double  y 
) const
inlinenoexcept

Tests if a given point is inside the gate.

Parameters
xx coordinate of the point to be tested
yy coordinate of the point to be tested
Returns
true if point is inside

◆ update()

void pottu::Gate2D::update ( )
inline

updates the other important fields after modifying points.

Call this after setting vector points. This will throw runtime_error if points has less than four points (the last must be duplicate of the first).


The documentation for this struct was generated from the following file: