floatobj.cpp
author insilmaril
Mon, 29 Jan 2007 12:29:13 +0000
changeset 424 d886c77ac0fe
parent 408 c2a05fa925a1
child 442 dfbc371b7280
permissions -rw-r--r--
minor fixes
     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 (QGraphicsScene* s):OrnamentedObj(s)
    18 {
    19 //	cout << "Const FloatObj (s)  called from MapCenterObj (s)\n";
    20     setParObj (this);	
    21     init();
    22     depth=-1;
    23 }
    24 
    25 FloatObj::FloatObj (QGraphicsScene* s, LinkableMapObj* p):OrnamentedObj (s)
    26 {
    27 //    cout << "Const FloatObj (s,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::setZValue(const int &i)
    54 {
    55 	zPlane=i;
    56 }
    57 
    58 int FloatObj::zValue()
    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->setPos(x,y);
    77 	selbox->rect().moveTo (QPointF (x,y));
    78 }
    79 
    80 void FloatObj::move (QPointF p)
    81 {
    82 	MapObj::move (p);
    83 	selbox->rect().moveTo (p);
    84 }
    85 
    86 void FloatObj::setDockPos()
    87 {
    88 	parPos=absPos;
    89 	childPos=absPos;
    90 }
    91 
    92 void FloatObj::reposition()
    93 {
    94 	move2RelPos (relPos);
    95 	updateLink();	
    96 }
    97 
    98 QRectF FloatObj::getTotalBBox()
    99 {
   100 	return bbox;
   101 }
   102 
   103 QRectF FloatObj::getBBoxSizeWithChilds()
   104 {
   105 	return bboxTotal;
   106 }
   107 
   108 void FloatObj::select()
   109 {
   110     LinkableMapObj::select();
   111 	LinkableMapObj::setLinkColor(parObj->getLinkColor());
   112 }
   113 
   114 void FloatObj::unselect()
   115 {
   116 	LinkableMapObj::unselect();
   117 }
   118