floatobj.cpp
author insilmaril
Wed, 03 Jun 2009 20:37:17 +0000
changeset 775 6e4b586aa88a
parent 773 340bc29da9a0
child 776 25e634a7e1dc
permissions -rw-r--r--
Unscrolling temporary works again
     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 	floatExport=true;
    38 	zPlane=Z_ICON;
    39 	setLinkStyle (LinkableMapObj::Parabel);
    40 	setHideLinkUnselected(true);
    41 }
    42 
    43 void FloatObj::copy (FloatObj* other)
    44 {
    45 	LinkableMapObj::copy (other);
    46 	setVisibility (other->visible);
    47 }
    48 
    49 void FloatObj::setZValue(const int &i)
    50 {
    51 	zPlane=i;
    52 }
    53 
    54 int FloatObj::zValue()
    55 {
    56 	return zPlane;
    57 }
    58 
    59 void FloatObj::setFloatExport(const bool& b)
    60 {
    61 	floatExport=b;
    62 }
    63 
    64 bool FloatObj::getFloatExport()
    65 {
    66 	return floatExport;
    67 }
    68 
    69 void FloatObj::move (double x, double y)
    70 {
    71 	MapObj::move(x,y);
    72 }
    73 
    74 void FloatObj::move (QPointF p)
    75 {
    76 	MapObj::move (p);
    77 }
    78 
    79 void FloatObj::setDockPos()
    80 {
    81 	parPos=absPos;
    82 	childPos=absPos;
    83 }
    84 
    85 void FloatObj::reposition()
    86 {
    87 	move2RelPos (relPos);
    88 	updateLink();	
    89 }
    90 
    91 QRectF FloatObj::getTotalBBox()
    92 {
    93 	return bbox;
    94 }
    95 
    96 QRectF FloatObj::getBBoxSizeWithChildren()
    97 {
    98 	return bboxTotal;
    99 }
   100 
   101 void FloatObj::select()
   102 {
   103     LinkableMapObj::select();
   104 	LinkableMapObj::setLinkColor(parObj->getLinkColor());
   105 }
   106 
   107 void FloatObj::unselect()
   108 {
   109 	LinkableMapObj::unselect();
   110 }
   111