floatobj.cpp
author insilmaril
Sat, 08 Aug 2009 21:58:26 +0000
changeset 787 c6bb4fdcc55f
parent 780 fe839bdfd10c
child 790 133e2ed6b9c5
permissions -rw-r--r--
Fixed selections with cursor in MapEditor
     1 #include "floatobj.h"
     2 
     3 /////////////////////////////////////////////////////////////////
     4 // FloatObj
     5 /////////////////////////////////////////////////////////////////
     6 
     7 FloatObj::FloatObj ():OrnamentedObj() 
     8 {
     9 //    cout << "Const FloatObj ()\n";
    10     setParObj (this);	
    11     init();
    12 }
    13 
    14 FloatObj::FloatObj (QGraphicsScene* s):OrnamentedObj(s)
    15 {
    16 //	cout << "Const FloatObj (s)  called from MapCenterObj (s)\n";
    17     setParObj (this);	
    18     init();
    19 }
    20 
    21 FloatObj::FloatObj (QGraphicsScene* s, LinkableMapObj* p):OrnamentedObj (s)
    22 {
    23 //    cout << "Const FloatObj (s,p)\n";
    24     setParObj (p);	
    25     init();
    26 }
    27 
    28 FloatObj::~FloatObj ()
    29 {
    30 //   cout << "Destr FloatObj\n";
    31 }
    32 
    33 #include <iostream>
    34 using namespace std;
    35 void FloatObj::init () 
    36 {
    37 	zPlane=Z_ICON;
    38 	setLinkStyle (LinkableMapObj::Parabel);
    39 	//FIXME-2 setHideLinkUnselected(true);
    40 }
    41 
    42 void FloatObj::copy (FloatObj* other)
    43 {
    44 	LinkableMapObj::copy (other);
    45 	setVisibility (other->visible);
    46 }
    47 
    48 void FloatObj::setZValue(const int &i)
    49 {
    50 	zPlane=i;
    51 }
    52 
    53 int FloatObj::zValue()
    54 {
    55 	return zPlane;
    56 }
    57 
    58 void FloatObj::move (double x, double y)
    59 {
    60 	MapObj::move(x,y);
    61 }
    62 
    63 void FloatObj::move (QPointF p)
    64 {
    65 	MapObj::move (p);
    66 }
    67 
    68 void FloatObj::setDockPos()
    69 {
    70 	parPos=absPos;
    71 	childPos=absPos;
    72 }
    73 
    74 void FloatObj::reposition()
    75 {
    76 	move2RelPos (relPos);
    77 	updateLinkGeometry();	
    78 }
    79 
    80 QRectF FloatObj::getTotalBBox()
    81 {
    82 	return bbox;
    83 }
    84 
    85 QRectF FloatObj::getBBoxSizeWithChildren()
    86 {
    87 	return bboxTotal;
    88 }
    89