author | insilmaril |
Thu, 07 May 2009 08:48:53 +0000 | |
changeset 766 | 7a71a914afdb |
parent 755 | ed5b407975b3 |
child 773 | 340bc29da9a0 |
permissions | -rw-r--r-- |
insilmaril@0 | 1 |
#include "floatobj.h" |
insilmaril@0 | 2 |
|
insilmaril@0 | 3 |
extern QAction* actionEditToggleFloatExport; |
insilmaril@0 | 4 |
|
insilmaril@0 | 5 |
///////////////////////////////////////////////////////////////// |
insilmaril@0 | 6 |
// FloatObj |
insilmaril@0 | 7 |
///////////////////////////////////////////////////////////////// |
insilmaril@0 | 8 |
|
insilmaril@241 | 9 |
FloatObj::FloatObj ():OrnamentedObj() |
insilmaril@0 | 10 |
{ |
insilmaril@0 | 11 |
// cout << "Const FloatObj ()\n"; |
insilmaril@0 | 12 |
setParObj (this); |
insilmaril@0 | 13 |
init(); |
insilmaril@0 | 14 |
} |
insilmaril@0 | 15 |
|
insilmaril@408 | 16 |
FloatObj::FloatObj (QGraphicsScene* s):OrnamentedObj(s) |
insilmaril@0 | 17 |
{ |
insilmaril@408 | 18 |
// cout << "Const FloatObj (s) called from MapCenterObj (s)\n"; |
insilmaril@0 | 19 |
setParObj (this); |
insilmaril@0 | 20 |
init(); |
insilmaril@0 | 21 |
} |
insilmaril@0 | 22 |
|
insilmaril@408 | 23 |
FloatObj::FloatObj (QGraphicsScene* s, LinkableMapObj* p):OrnamentedObj (s) |
insilmaril@0 | 24 |
{ |
insilmaril@408 | 25 |
// cout << "Const FloatObj (s,p)\n"; |
insilmaril@0 | 26 |
setParObj (p); |
insilmaril@0 | 27 |
init(); |
insilmaril@0 | 28 |
} |
insilmaril@0 | 29 |
|
insilmaril@0 | 30 |
FloatObj::~FloatObj () |
insilmaril@0 | 31 |
{ |
insilmaril@0 | 32 |
// cout << "Destr FloatObj\n"; |
insilmaril@0 | 33 |
} |
insilmaril@0 | 34 |
|
insilmaril@0 | 35 |
void FloatObj::init () |
insilmaril@0 | 36 |
{ |
insilmaril@0 | 37 |
setChildObj(this); |
insilmaril@0 | 38 |
floatExport=true; |
insilmaril@0 | 39 |
zPlane=Z_ICON; |
insilmaril@470 | 40 |
setLinkStyle (LinkableMapObj::Parabel); |
insilmaril@160 | 41 |
setHideLinkUnselected(true); |
insilmaril@0 | 42 |
} |
insilmaril@0 | 43 |
|
insilmaril@0 | 44 |
void FloatObj::copy (FloatObj* other) |
insilmaril@0 | 45 |
{ |
insilmaril@0 | 46 |
LinkableMapObj::copy (other); |
insilmaril@0 | 47 |
setVisibility (other->visible); |
insilmaril@0 | 48 |
} |
insilmaril@0 | 49 |
|
insilmaril@408 | 50 |
void FloatObj::setZValue(const int &i) |
insilmaril@0 | 51 |
{ |
insilmaril@0 | 52 |
zPlane=i; |
insilmaril@0 | 53 |
} |
insilmaril@0 | 54 |
|
insilmaril@408 | 55 |
int FloatObj::zValue() |
insilmaril@0 | 56 |
{ |
insilmaril@0 | 57 |
return zPlane; |
insilmaril@0 | 58 |
} |
insilmaril@0 | 59 |
|
insilmaril@0 | 60 |
void FloatObj::setFloatExport(const bool& b) |
insilmaril@0 | 61 |
{ |
insilmaril@0 | 62 |
floatExport=b; |
insilmaril@0 | 63 |
} |
insilmaril@0 | 64 |
|
insilmaril@0 | 65 |
bool FloatObj::getFloatExport() |
insilmaril@0 | 66 |
{ |
insilmaril@0 | 67 |
return floatExport; |
insilmaril@0 | 68 |
} |
insilmaril@0 | 69 |
|
insilmaril@0 | 70 |
void FloatObj::move (double x, double y) |
insilmaril@0 | 71 |
{ |
insilmaril@0 | 72 |
MapObj::move(x,y); |
insilmaril@0 | 73 |
} |
insilmaril@0 | 74 |
|
insilmaril@408 | 75 |
void FloatObj::move (QPointF p) |
insilmaril@0 | 76 |
{ |
insilmaril@408 | 77 |
MapObj::move (p); |
insilmaril@0 | 78 |
} |
insilmaril@0 | 79 |
|
insilmaril@223 | 80 |
void FloatObj::setDockPos() |
insilmaril@223 | 81 |
{ |
insilmaril@223 | 82 |
parPos=absPos; |
insilmaril@236 | 83 |
childPos=absPos; |
insilmaril@223 | 84 |
} |
insilmaril@223 | 85 |
|
insilmaril@0 | 86 |
void FloatObj::reposition() |
insilmaril@0 | 87 |
{ |
insilmaril@395 | 88 |
move2RelPos (relPos); |
insilmaril@0 | 89 |
updateLink(); |
insilmaril@0 | 90 |
} |
insilmaril@0 | 91 |
|
insilmaril@408 | 92 |
QRectF FloatObj::getTotalBBox() |
insilmaril@0 | 93 |
{ |
insilmaril@0 | 94 |
return bbox; |
insilmaril@0 | 95 |
} |
insilmaril@0 | 96 |
|
insilmaril@721 | 97 |
QRectF FloatObj::getBBoxSizeWithChildren() |
insilmaril@0 | 98 |
{ |
insilmaril@0 | 99 |
return bboxTotal; |
insilmaril@0 | 100 |
} |
insilmaril@0 | 101 |
|
insilmaril@0 | 102 |
void FloatObj::select() |
insilmaril@0 | 103 |
{ |
insilmaril@0 | 104 |
LinkableMapObj::select(); |
insilmaril@241 | 105 |
LinkableMapObj::setLinkColor(parObj->getLinkColor()); |
insilmaril@0 | 106 |
} |
insilmaril@0 | 107 |
|
insilmaril@0 | 108 |
void FloatObj::unselect() |
insilmaril@0 | 109 |
{ |
insilmaril@0 | 110 |
LinkableMapObj::unselect(); |
insilmaril@0 | 111 |
} |
insilmaril@0 | 112 |