#include <point.h>
Inheritance diagram for PointValue:
Public Member Functions | |
virtual QString | toString () |
PointValue () | |
PointValue (Token data) | |
PointValue (double a, double b) | |
virtual Data | getSaveDescription (QString) |
PointValue | operator * (const PointValue &other) const |
PointValue & | operator/= (const PointValue &other) |
PointValue & | operator *= (const PointValue &other) |
Public Attributes | |
double | x |
double | y |
Protected Member Functions | |
virtual bool | equals_same_type (Value *other) |
Definition at line 11 of file point.h.
|
Standard constructor; initalizes x and y to 0 Definition at line 21 of file point.h.
|
|
initializes data from the x and y fields in the token. Definition at line 31 of file point.h.
|
|
Standard constructor Definition at line 40 of file point.h.
|
|
Implements Value. Definition at line 21 of file point.cpp. 00022 { 00023 PointValue * o = (PointValue*)other; 00024 return x==o->x && y==o->y; 00025 }
|
|
returns a token containing the type as 'point' and the x and y fields as Float8. Implements Value. Definition at line 50 of file point.h. Referenced by LineValue::getSaveDescription(), ImageValue::getSaveDescription(), and BoxValue::getSaveDescription(). 00051 { 00052 Token r; 00053 r["type"]=Symbol("point"); 00054 r["x"]=Float8(x); 00055 r["y"]=Float8(y); 00056 return r; 00057 };
|
|
Multiplies the x and y coordinates of both points and returns the new point. Useful for scaling and zooming functions. Definition at line 44 of file point.cpp. 00045 { 00046 PointValue result; 00047 result.x = x*other.x; 00048 result.y = y*other.y; 00049 return result; 00050 }
|
|
Definition at line 73 of file point.h.
|
|
Definition at line 66 of file point.h.
|
|
Implements Value. Definition at line 14 of file point.cpp. Referenced by LineValue::toString(), and BoxValue::toString(). 00015 { 00016 return QString("(")+QString::number(x)+ 00017 QString(", ")+QString::number(y)+ 00018 QString(")"); 00019 }
|
|
|