author | insilmaril |
Wed Sep 06 12:47:06 2006 +0000 (2006-09-06) | |
changeset 377 | 5391ab620c95 |
parent 249 | e7acede0377c |
child 395 | 7ced3733ba60 |
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 |
depth=-1; |
insilmaril@0 | 15 |
} |
insilmaril@0 | 16 |
|
insilmaril@366 | 17 |
FloatObj::FloatObj (Q3Canvas* c):OrnamentedObj(c) |
insilmaril@0 | 18 |
{ |
insilmaril@0 | 19 |
// cout << "Const FloatObj (c) called from MapCenterObj (c)\n"; |
insilmaril@0 | 20 |
setParObj (this); |
insilmaril@0 | 21 |
init(); |
insilmaril@0 | 22 |
depth=-1; |
insilmaril@0 | 23 |
} |
insilmaril@0 | 24 |
|
insilmaril@366 | 25 |
FloatObj::FloatObj (Q3Canvas* c, LinkableMapObj* p):OrnamentedObj (c) |
insilmaril@0 | 26 |
{ |
insilmaril@0 | 27 |
// cout << "Const FloatObj (c,p)\n"; |
insilmaril@0 | 28 |
setParObj (p); |
insilmaril@0 | 29 |
depth=p->getDepth()+1; |
insilmaril@0 | 30 |
init(); |
insilmaril@0 | 31 |
} |
insilmaril@0 | 32 |
|
insilmaril@0 | 33 |
FloatObj::~FloatObj () |
insilmaril@0 | 34 |
{ |
insilmaril@0 | 35 |
// cout << "Destr FloatObj\n"; |
insilmaril@0 | 36 |
} |
insilmaril@0 | 37 |
|
insilmaril@0 | 38 |
void FloatObj::init () |
insilmaril@0 | 39 |
{ |
insilmaril@0 | 40 |
setChildObj(this); |
insilmaril@0 | 41 |
floatExport=true; |
insilmaril@0 | 42 |
zPlane=Z_ICON; |
insilmaril@160 | 43 |
setLinkStyle (StyleParabel); |
insilmaril@160 | 44 |
setHideLinkUnselected(true); |
insilmaril@0 | 45 |
} |
insilmaril@0 | 46 |
|
insilmaril@0 | 47 |
void FloatObj::copy (FloatObj* other) |
insilmaril@0 | 48 |
{ |
insilmaril@0 | 49 |
LinkableMapObj::copy (other); |
insilmaril@0 | 50 |
setVisibility (other->visible); |
insilmaril@0 | 51 |
} |
insilmaril@0 | 52 |
|
insilmaril@0 | 53 |
void FloatObj::setZ(const int &i) |
insilmaril@0 | 54 |
{ |
insilmaril@0 | 55 |
zPlane=i; |
insilmaril@0 | 56 |
} |
insilmaril@0 | 57 |
|
insilmaril@0 | 58 |
int FloatObj::z() |
insilmaril@0 | 59 |
{ |
insilmaril@0 | 60 |
return zPlane; |
insilmaril@0 | 61 |
} |
insilmaril@0 | 62 |
|
insilmaril@0 | 63 |
void FloatObj::setFloatExport(const bool& b) |
insilmaril@0 | 64 |
{ |
insilmaril@0 | 65 |
floatExport=b; |
insilmaril@0 | 66 |
} |
insilmaril@0 | 67 |
|
insilmaril@0 | 68 |
bool FloatObj::getFloatExport() |
insilmaril@0 | 69 |
{ |
insilmaril@0 | 70 |
return floatExport; |
insilmaril@0 | 71 |
} |
insilmaril@0 | 72 |
|
insilmaril@0 | 73 |
void FloatObj::move (double x, double y) |
insilmaril@0 | 74 |
{ |
insilmaril@0 | 75 |
MapObj::move(x,y); |
insilmaril@0 | 76 |
selbox->move(x,y); |
insilmaril@0 | 77 |
} |
insilmaril@0 | 78 |
|
insilmaril@0 | 79 |
void FloatObj::move (QPoint p) |
insilmaril@0 | 80 |
{ |
insilmaril@0 | 81 |
move (p.x(), p.y()); |
insilmaril@0 | 82 |
} |
insilmaril@0 | 83 |
|
insilmaril@223 | 84 |
void FloatObj::setDockPos() |
insilmaril@223 | 85 |
{ |
insilmaril@223 | 86 |
parPos=absPos; |
insilmaril@236 | 87 |
childPos=absPos; |
insilmaril@223 | 88 |
} |
insilmaril@223 | 89 |
|
insilmaril@0 | 90 |
void FloatObj::reposition() |
insilmaril@0 | 91 |
{ |
insilmaril@223 | 92 |
move (parObj->getChildPos().x()+relPos.x(), parObj->getChildPos().y()+relPos.y()); |
insilmaril@0 | 93 |
updateLink(); |
insilmaril@0 | 94 |
} |
insilmaril@0 | 95 |
|
insilmaril@0 | 96 |
QRect FloatObj::getTotalBBox() |
insilmaril@0 | 97 |
{ |
insilmaril@0 | 98 |
return bbox; |
insilmaril@0 | 99 |
} |
insilmaril@0 | 100 |
|
insilmaril@0 | 101 |
QRect FloatObj::getBBoxSizeWithChilds() |
insilmaril@0 | 102 |
{ |
insilmaril@0 | 103 |
return bboxTotal; |
insilmaril@0 | 104 |
} |
insilmaril@0 | 105 |
|
insilmaril@0 | 106 |
void FloatObj::select() |
insilmaril@0 | 107 |
{ |
insilmaril@0 | 108 |
LinkableMapObj::select(); |
insilmaril@241 | 109 |
LinkableMapObj::setLinkColor(parObj->getLinkColor()); |
insilmaril@0 | 110 |
} |
insilmaril@0 | 111 |
|
insilmaril@0 | 112 |
void FloatObj::unselect() |
insilmaril@0 | 113 |
{ |
insilmaril@0 | 114 |
LinkableMapObj::unselect(); |
insilmaril@0 | 115 |
} |
insilmaril@0 | 116 |