5 /////////////////////////////////////////////////////////////////
7 /////////////////////////////////////////////////////////////////
8 FrameObj::FrameObj() : MapObj()
10 // cout << "Const FrameObj ()\n";
14 FrameObj::FrameObj(QGraphicsScene *s) :MapObj(s)
16 // cout << "Const FrameObj\n";
31 void FrameObj::clear()
48 void FrameObj::move(double x, double y)
55 rectFrame->setPos (x,y);
58 ellipseFrame->setPos (x,y);
63 void FrameObj::moveBy(double x, double y)
68 void FrameObj::positionBBox()
72 void FrameObj::calcBBoxSize()
76 void FrameObj::setRect(const QRectF &r)
84 // rectFrame->prepareGeometryChange();
85 rectFrame->setRect (QRectF(bbox.x(),bbox.y(),bbox.width(),bbox.height() ));
88 // ellipseFrame->prepareGeometryChange();
89 ellipseFrame->setRect (QRectF(bbox.x(),bbox.y(),bbox.width(),bbox.height() ));
94 int FrameObj::getBorder()
99 FrameType FrameObj::getFrameType()
104 QString FrameObj::getFrameTypeName()
119 void FrameObj::setFrameType(const FrameType &t)
132 rectFrame = scene->addRect(QRectF(0,0,0,0), QPen(QColor("black") ), QColor("white"));
133 rectFrame->setZValue(Z_FRAME);
137 ellipseFrame = scene->addEllipse(QRectF(0,0,0,0), QPen(QColor("black") ), QColor("white"));
138 ellipseFrame->setZValue(Z_FRAME);
141 setVisibility (visible);
145 void FrameObj::setFrameType(const QString &t)
148 FrameObj::setFrameType (Rectangle);
149 else if (t=="Ellipse")
150 FrameObj::setFrameType (Ellipse);
152 FrameObj::setFrameType (NoFrame);
155 void FrameObj::setVisibility (bool v)
157 MapObj::setVisibility(v);
170 ellipseFrame->show();
172 ellipseFrame->hide();
177 QString FrameObj::saveToDir ()
179 QString frameTypeAttr=attribut ("frameType",getFrameTypeName());
180 return singleElement ("frame",frameTypeAttr);