author | insilmaril |
Fri, 09 Apr 2010 14:24:04 +0000 | |
changeset 846 | f0fe7c36ec5c |
parent 823 | 0bba81dde1bc |
permissions | -rw-r--r-- |
insilmaril@0 | 1 |
#include "floatobj.h" |
insilmaril@823 | 2 |
#include "mapitem.h" |
insilmaril@790 | 3 |
|
insilmaril@0 | 4 |
///////////////////////////////////////////////////////////////// |
insilmaril@0 | 5 |
// FloatObj |
insilmaril@0 | 6 |
///////////////////////////////////////////////////////////////// |
insilmaril@0 | 7 |
|
insilmaril@790 | 8 |
FloatObj::FloatObj (QGraphicsScene* s, TreeItem *ti):OrnamentedObj(s,ti) |
insilmaril@0 | 9 |
{ |
insilmaril@798 | 10 |
//cout << "Const FloatObj s="<<s<<" ti="<<ti<<" treeItem="<<treeItem<<endl; |
insilmaril@0 | 11 |
setParObj (this); |
insilmaril@0 | 12 |
init(); |
insilmaril@0 | 13 |
} |
insilmaril@0 | 14 |
|
insilmaril@0 | 15 |
FloatObj::~FloatObj () |
insilmaril@0 | 16 |
{ |
insilmaril@0 | 17 |
// cout << "Destr FloatObj\n"; |
insilmaril@0 | 18 |
} |
insilmaril@0 | 19 |
|
insilmaril@0 | 20 |
void FloatObj::init () |
insilmaril@0 | 21 |
{ |
insilmaril@0 | 22 |
zPlane=Z_ICON; |
insilmaril@470 | 23 |
setLinkStyle (LinkableMapObj::Parabel); |
insilmaril@823 | 24 |
((MapItem*)treeItem)->setHideLinkUnselected(true); |
insilmaril@0 | 25 |
} |
insilmaril@0 | 26 |
|
insilmaril@0 | 27 |
void FloatObj::copy (FloatObj* other) |
insilmaril@0 | 28 |
{ |
insilmaril@0 | 29 |
LinkableMapObj::copy (other); |
insilmaril@0 | 30 |
setVisibility (other->visible); |
insilmaril@0 | 31 |
} |
insilmaril@0 | 32 |
|
insilmaril@408 | 33 |
void FloatObj::setZValue(const int &i) |
insilmaril@0 | 34 |
{ |
insilmaril@0 | 35 |
zPlane=i; |
insilmaril@0 | 36 |
} |
insilmaril@0 | 37 |
|
insilmaril@408 | 38 |
int FloatObj::zValue() |
insilmaril@0 | 39 |
{ |
insilmaril@0 | 40 |
return zPlane; |
insilmaril@0 | 41 |
} |
insilmaril@0 | 42 |
|
insilmaril@0 | 43 |
void FloatObj::move (double x, double y) |
insilmaril@0 | 44 |
{ |
insilmaril@0 | 45 |
MapObj::move(x,y); |
insilmaril@0 | 46 |
} |
insilmaril@0 | 47 |
|
insilmaril@408 | 48 |
void FloatObj::move (QPointF p) |
insilmaril@0 | 49 |
{ |
insilmaril@408 | 50 |
MapObj::move (p); |
insilmaril@0 | 51 |
} |
insilmaril@0 | 52 |
|
insilmaril@223 | 53 |
void FloatObj::setDockPos() |
insilmaril@223 | 54 |
{ |
insilmaril@223 | 55 |
parPos=absPos; |
insilmaril@236 | 56 |
childPos=absPos; |
insilmaril@223 | 57 |
} |
insilmaril@223 | 58 |
|
insilmaril@0 | 59 |
void FloatObj::reposition() |
insilmaril@0 | 60 |
{ |
insilmaril@395 | 61 |
move2RelPos (relPos); |
insilmaril@779 | 62 |
updateLinkGeometry(); |
insilmaril@0 | 63 |
} |
insilmaril@0 | 64 |
|
insilmaril@721 | 65 |
QRectF FloatObj::getBBoxSizeWithChildren() |
insilmaril@0 | 66 |
{ |
insilmaril@0 | 67 |
return bboxTotal; |
insilmaril@0 | 68 |
} |
insilmaril@0 | 69 |