Fade2D Documentation pages v2.16.8
Delaunay Features
Point2.h File Reference
#include "common.h"
#include "Vector2.h"
#include <cstring>

Go to the source code of this file.

Classes

class  GEOM_FADE2D::Point2
 Represents a 2D point. More...
 
struct  GEOM_FADE2D::VtxColor
 Structure to store vertex color (RGBA). More...
 

Enumerations

enum  CINC2 { CINC2_UNKNOWN , CINC2_ZERO , CINC2_INCIRCLE , CINC2_OUTCIRCLE }
 Enum for the position of a point relative to a circle. More...
 

Functions

Point2 GEOM_FADE2D::center (const Point2 &p0, const Point2 &p1)
 Compute the midpoint of points p0 and p1. More...
 
std::ostream & GEOM_FADE2D::operator<< (std::ostream &stream, const Point2 &pnt)
 Print to output stream. More...
 
std::istream & GEOM_FADE2D::operator>> (std::istream &stream, Point2 &pnt)
 Read coordinates from an input stream into a Point2. More...
 
double GEOM_FADE2D::sqDistance2D (const double x0, const double y0, const Point2 &p1)
 Get the squared 2D distance between two points. More...
 
double GEOM_FADE2D::sqDistance2D (const Point2 &p0, const Point2 &p1)
 Get the squared 2D distance between two points. More...
 

Enumeration Type Documentation

◆ CINC2

enum CINC2

This enumeration describes the possible positions of a point in relation to a circle.

Enumerator
CINC2_UNKNOWN 

Invalid value (undefined)

CINC2_ZERO 

Point lies exactly on the circumference of the circle.

CINC2_INCIRCLE 

Point lies inside the circle.

CINC2_OUTCIRCLE 

Point lies outside the circle.

Function Documentation

◆ center()

Point2 GEOM_FADE2D::center ( const Point2 p0,
const Point2 p1 
)
inline

This function calculates the midpoint between two given points, p0 and p1.

Parameters
p0First point
p1Second point
Returns
The computed midpoint
Note
The exact midpoint of p0 and p1 may not exist in floating-point numbers due to limited precision. As a result, the returned point may not be perfectly collinear with p0 and p1.

◆ operator<<()

std::ostream& GEOM_FADE2D::operator<< ( std::ostream &  stream,
const Point2 pnt 
)
inline

Prints a Point2 to an output stream.

Parameters
streamThe output stream.
pntThe Point2 to be printed.
Returns
The output stream.

◆ operator>>()

std::istream& GEOM_FADE2D::operator>> ( std::istream &  stream,
Point2 pnt 
)
inline

Reads coordinates from a stream into a Point2.

Parameters
streamThe input stream.
pntThe Point2 to be populated with data.
Returns
The input stream.

◆ sqDistance2D() [1/2]

double GEOM_FADE2D::sqDistance2D ( const double  x0,
const double  y0,
const Point2 p1 
)
inline

Computes the squared distance between two points

Parameters
x0,y0The coordinates of the first point
p1The second point
Returns
The squared 2D distance between the specified points.

◆ sqDistance2D() [2/2]

double GEOM_FADE2D::sqDistance2D ( const Point2 p0,
const Point2 p1 
)
inline

Computes the squared distance between two points

Parameters
p0,p1The Point2 objects whose squared distance is to be computed
Returns
The squared 2D distance between p0 and p1.