ContentsWhat is fGUI ?
fGUI basics The classesfApplicationfClassInfo fColor fGroup fObject fPoint |
The flexible GUI: fPointDeclared in: fGUI/fPoint.h Library: fGUI.so
OverviewThe fPoint class is from its interface completely compatible with BPoints but it uses double precision numbers inernally and has some additional methods BPoint has not.
Data Membersdouble xThe x coordinate.
double y
Constructor and DestructorfPoint()
fPoint( double X = 0.0, double Y = 0.0) fPoint( const fPoint &Point) fPoint( const BPoint &Point)Initializes the fPoint to (x,y) or to the same values as Point which can be either a fPoint or a BPoint. If a fPoint is created without arguments it is initialized with 0.0 for both coordinates.
Member Functions
set()
void set( double X, double Y)Sets the point to (X, Y).
constrainTo()
void constrainTo( const BRect &Rect)Behaves like the method in the BPoint class. It constrains the point so that is lies within the rectangle Rect.
rotateBy()
void rotateBy( float Angle)Rotates the point Angle degrees around the origin (fPoint( 0.0, 0.0))
roundToInteger()
void roundToInteger( void)Rounds the x and y coordinates to whole numbers.
printToStream()
void printToStream( const char *Text = NULL) constAs the BPoint method is prints the points coordinates but additionally it prints Text if it is not NULL. Different to the BPoint class printToStream() prints to stderr, not stdout.
Operators
= (assignment)
fPoint &operator =( const fPoint &Point) fPoint &operator =( const BPoint &Point)Assigns the x and y coordinates from Point to another point.
== (equality)
bool operator ==( const fPoint &Point) const bool operator ==( const BPoint &Point) constCompares the x and y values of both points and returns true if both of them match exactly.
!= (inequality)
bool operator !=( const fPoint &Point) const bool operator !=( const BPoint &Point) constCompares the x and y values of both points and returns true if they are different.
< (smaller)
bool operator <( const fPoint &Point) constReturns true if at least one of the coordinates of the point is smaller than that of Point.
> (bigger)
bool operator >( const fPoint &Point) constReturns true if at least one of the coordinates of the point is bigger than that of Point.
+ (addition)
fPoint operator +( const fPoint &Point) constAdds two points together in that it adds the two x coordinates to form the x value of the new point, the same happend to the y value.
+= (addition and assignment)
fPoint &operator +=( const fPoint &Point)Behaves like operator+ but modifies the point in place.
- (subtraction)
fPoint operator -( const fPoint &Point) constSubtracts the x and y values from Point from the x and y coordinates and creates a new point that it returns.
-= (subtraction and assignment)
fPoint &operator -=( const fPoint &Point)Behaves like operator- but modifies the point in place.
* (multiplication)
fPoint operator *( double Multiplier) constMultiplies both x and y value with Multiplier and returns a new point with the resulting values.
BPoint (cast)
operator BPoint( void) constReturns a BPoint with the same coordinates as the point.
The flexible GUI, in HTML for the BeOS Release 3. Copyright © 1997-1998 Stegemann & Co. All rights reserved. Last modified May 19, 1998. |