floatobj.cpp
author insilmaril
Tue, 16 Oct 2007 09:53:22 +0000
changeset 598 60f019156464
parent 470 80ae7b79828c
child 721 12958f987bcf
permissions -rw-r--r--
included <typeinfo>
     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 (LinkableMapObj::Parabel);
    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 }
    77 
    78 void FloatObj::move (QPointF p)
    79 {
    80 	MapObj::move (p);
    81 }
    82 
    83 void FloatObj::setDockPos()
    84 {
    85 	parPos=absPos;
    86 	childPos=absPos;
    87 }
    88 
    89 void FloatObj::reposition()
    90 {
    91 	move2RelPos (relPos);
    92 	updateLink();	
    93 }
    94 
    95 QRectF FloatObj::getTotalBBox()
    96 {
    97 	return bbox;
    98 }
    99 
   100 QRectF FloatObj::getBBoxSizeWithChilds()
   101 {
   102 	return bboxTotal;
   103 }
   104 
   105 void FloatObj::select()
   106 {
   107     LinkableMapObj::select();
   108 	LinkableMapObj::setLinkColor(parObj->getLinkColor());
   109 }
   110 
   111 void FloatObj::unselect()
   112 {
   113 	LinkableMapObj::unselect();
   114 }
   115