floatobj.cpp
author insilmaril
Wed May 31 12:27:41 2006 +0000 (2006-05-31)
changeset 338 e886fd2fb37d
parent 241 f5243654fe86
child 366 e95081c21da2
permissions -rw-r--r--
1.7.18
     1 #include "floatobj.h"
     2 
     3 extern QAction* actionEditToggleFloatExport;
     4 
     5 /////////////////////////////////////////////////////////////////
     6 // FloatObj
     7 /////////////////////////////////////////////////////////////////
     8 
     9 FloatObj::FloatObj ():OrnamentedObj() 
    10 {
    11 //    cout << "Const FloatObj ()\n";
    12     setParObj (this);	
    13     init();
    14     depth=-1;
    15 }
    16 
    17 FloatObj::FloatObj (QCanvas* c):OrnamentedObj(c)
    18 {
    19 //	cout << "Const FloatObj (c)  called from MapCenterObj (c)\n";
    20     setParObj (this);	
    21     init();
    22     depth=-1;
    23 }
    24 
    25 FloatObj::FloatObj (QCanvas* c, LinkableMapObj* p):OrnamentedObj (c)
    26 {
    27 //    cout << "Const FloatObj (c,p)\n";
    28     setParObj (p);	
    29     depth=p->getDepth()+1;
    30     init();
    31 }
    32 
    33 FloatObj::~FloatObj ()
    34 {
    35 //   cout << "Destr FloatObj\n";
    36 }
    37 
    38 void FloatObj::init () 
    39 {
    40     setChildObj(this);
    41 	floatExport=true;
    42 	zPlane=Z_ICON;
    43 	setLinkStyle (StyleParabel);
    44 	setHideLinkUnselected(true);
    45 }
    46 
    47 void FloatObj::copy (FloatObj* other)
    48 {
    49 	LinkableMapObj::copy (other);
    50 	setVisibility (other->visible);
    51 }
    52 
    53 void FloatObj::setZ(const int &i)
    54 {
    55 	zPlane=i;
    56 }
    57 
    58 int FloatObj::z()
    59 {
    60 	return zPlane;
    61 }
    62 
    63 void FloatObj::setFloatExport(const bool& b)
    64 {
    65 	floatExport=b;
    66 }
    67 
    68 bool FloatObj::getFloatExport()
    69 {
    70 	return floatExport;
    71 }
    72 
    73 void FloatObj::move (double x, double y)
    74 {
    75 	MapObj::move(x,y);
    76 	selbox->move(x,y);
    77 }
    78 
    79 void FloatObj::move (QPoint p)
    80 {
    81 	move (p.x(), p.y());
    82 }
    83 
    84 void FloatObj::setDockPos()
    85 {
    86 	parPos=absPos;
    87 	childPos=absPos;
    88 }
    89 
    90 void FloatObj::reposition()
    91 {
    92 	move (parObj->getChildPos().x()+relPos.x(), parObj->getChildPos().y()+relPos.y());
    93 	updateLink();	
    94 }
    95 
    96 QRect FloatObj::getTotalBBox()
    97 {
    98 	return bbox;
    99 }
   100 
   101 QRect FloatObj::getBBoxSizeWithChilds()
   102 {
   103 	return bboxTotal;
   104 }
   105 
   106 void FloatObj::select()
   107 {
   108     LinkableMapObj::select();
   109 	LinkableMapObj::setLinkColor(parObj->getLinkColor());
   110 }
   111 
   112 void FloatObj::unselect()
   113 {
   114 	LinkableMapObj::unselect();
   115 }
   116