floatobj.cpp
author insilmaril
Wed, 29 Apr 2009 18:46:31 +0000
changeset 760 59614eaf5fbb
parent 755 ed5b407975b3
child 773 340bc29da9a0
permissions -rw-r--r--
started to save data like positions outside of MapObj & Co
     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 }
    15 
    16 FloatObj::FloatObj (QGraphicsScene* s):OrnamentedObj(s)
    17 {
    18 //	cout << "Const FloatObj (s)  called from MapCenterObj (s)\n";
    19     setParObj (this);	
    20     init();
    21 }
    22 
    23 FloatObj::FloatObj (QGraphicsScene* s, LinkableMapObj* p):OrnamentedObj (s)
    24 {
    25 //    cout << "Const FloatObj (s,p)\n";
    26     setParObj (p);	
    27     init();
    28 }
    29 
    30 FloatObj::~FloatObj ()
    31 {
    32 //   cout << "Destr FloatObj\n";
    33 }
    34 
    35 void FloatObj::init () 
    36 {
    37     setChildObj(this);
    38 	floatExport=true;
    39 	zPlane=Z_ICON;
    40 	setLinkStyle (LinkableMapObj::Parabel);
    41 	setHideLinkUnselected(true);
    42 }
    43 
    44 void FloatObj::copy (FloatObj* other)
    45 {
    46 	LinkableMapObj::copy (other);
    47 	setVisibility (other->visible);
    48 }
    49 
    50 void FloatObj::setZValue(const int &i)
    51 {
    52 	zPlane=i;
    53 }
    54 
    55 int FloatObj::zValue()
    56 {
    57 	return zPlane;
    58 }
    59 
    60 void FloatObj::setFloatExport(const bool& b)
    61 {
    62 	floatExport=b;
    63 }
    64 
    65 bool FloatObj::getFloatExport()
    66 {
    67 	return floatExport;
    68 }
    69 
    70 void FloatObj::move (double x, double y)
    71 {
    72 	MapObj::move(x,y);
    73 }
    74 
    75 void FloatObj::move (QPointF p)
    76 {
    77 	MapObj::move (p);
    78 }
    79 
    80 void FloatObj::setDockPos()
    81 {
    82 	parPos=absPos;
    83 	childPos=absPos;
    84 }
    85 
    86 void FloatObj::reposition()
    87 {
    88 	move2RelPos (relPos);
    89 	updateLink();	
    90 }
    91 
    92 QRectF FloatObj::getTotalBBox()
    93 {
    94 	return bbox;
    95 }
    96 
    97 QRectF FloatObj::getBBoxSizeWithChildren()
    98 {
    99 	return bboxTotal;
   100 }
   101 
   102 void FloatObj::select()
   103 {
   104     LinkableMapObj::select();
   105 	LinkableMapObj::setLinkColor(parObj->getLinkColor());
   106 }
   107 
   108 void FloatObj::unselect()
   109 {
   110 	LinkableMapObj::unselect();
   111 }
   112