Into

Modules

Documentation

classPiiPoint

#include <PiiPoint.h>

A two-dimensional point.

Description

In many occasions, matrices are used in storing geometric objects like points, circles (PiiCircle), sizes (PiiSize), rectangles (PiiRectangle) etc. The parameters of these objects are represented as row vectors. The geometric object structures are provided to conveniently handle such matrices.

 // A matrix that stores two points
 PiiMatrix<int> mat(2,  2,
                    1,  1,
                   -1, -1);
 PiiPoint<int> *pt = mat.rowAs<PiiPoint<int> >(0);
 pt->x = 2; // modifies mat(0,0)
 pt->y = 0; // modifies mat(0,1)
 pt = (PiiPoint<int>*)mat.row(1);
 pt->x = 0; // modifies mat(1,0)

 // A circle
 PiiMatrix<float> mat2(1, 3,
                       0.0, 0.0, 5.0);
 PiiCircle<float> *circle = mat2.rowAs<PiiCircle<float> >(0);
 circle->radius += 5; // radius is now 10
 PiiPoint<float> *pt2 = mat2.rowAs<PiiPoint<float> >(0);
 pt2->y = 2; // modifies mat2(0,1)

 // Store the matrix row into a circle structure
 PiiCircle<float> circle2 = *circle;

Constructors and destructor

(
  • T xVal = 0
  • T yVal = 0
)

Public member functions

bool
( )
bool
( )

Function details

  • PiiPoint

    (
    • T xVal = 0
    • T yVal = 0
    )
    [inline]
  • bool operator!=

    ( )
    [inline]
  • bool operator==

    ( )
    [inline]
Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.