Gin
Loading...
Searching...
No Matches
Point< T > Class Template Reference

A lightweight 2D point class for projects that don't use juce_graphics. More...

#include <gin_point.h>

Public Member Functions

 Point ()=default
 Creates a point at the origin (0, 0).
 Point (T x_, T y_)
 Creates a point with the specified coordinates.
T getX ()
 Returns the x coordinate.
T getY ()
 Returns the y coordinate.

Public Attributes

T x = T (0)
 The x coordinate.
T y = T (0)
 The y coordinate.

Detailed Description

template<typename T>
class Point< T >

A lightweight 2D point class for projects that don't use juce_graphics.

This class provides a simple coordinate pair with optional conversion to/from juce::Point when juce_graphics is available. It's useful for modules that need basic point functionality without depending on the full graphics module.

See also
getX, getY, toJuce

Constructor & Destructor Documentation

◆ Point() [1/2]

template<typename T>
Point< T >::Point ( )
default

Creates a point at the origin (0, 0).

◆ Point() [2/2]

template<typename T>
Point< T >::Point ( T x_,
T y_ )

Creates a point with the specified coordinates.

Parameters
x_The x coordinate
y_The y coordinate

References x, and y.

Member Function Documentation

◆ getX()

template<typename T>
T Point< T >::getX ( )

Returns the x coordinate.

Returns
The x coordinate

References x.

Referenced by Ellipse< T >::isPointInside(), Ellipse< T >::isPointOn(), and Ellipse< T >::isPointOutside().

◆ getY()

template<typename T>
T Point< T >::getY ( )

Returns the y coordinate.

Returns
The y coordinate

References y.

Referenced by Ellipse< T >::isPointInside(), Ellipse< T >::isPointOn(), and Ellipse< T >::isPointOutside().

Member Data Documentation

◆ x

template<typename T>
T Point< T >::x = T (0)

◆ y

template<typename T>
T Point< T >::y = T (0)

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