insilmaril@0
|
1 |
#include "ornamentedobj.h"
|
insilmaril@0
|
2 |
#include "texteditor.h"
|
insilmaril@0
|
3 |
#include "mapeditor.h"
|
insilmaril@0
|
4 |
#include "linkablemapobj.h"
|
insilmaril@0
|
5 |
|
insilmaril@0
|
6 |
extern TextEditor *textEditor;
|
insilmaril@0
|
7 |
extern FlagRowObj *systemFlagsDefault;
|
insilmaril@0
|
8 |
extern FlagRowObj *standardFlagsDefault;
|
insilmaril@0
|
9 |
|
insilmaril@0
|
10 |
|
insilmaril@0
|
11 |
/////////////////////////////////////////////////////////////////
|
insilmaril@0
|
12 |
// OrnamentedObj
|
insilmaril@0
|
13 |
/////////////////////////////////////////////////////////////////
|
insilmaril@0
|
14 |
|
insilmaril@0
|
15 |
OrnamentedObj::OrnamentedObj():LinkableMapObj()
|
insilmaril@0
|
16 |
{
|
insilmaril@0
|
17 |
// cout << "Const OrnamentedObj ()\n";
|
insilmaril@0
|
18 |
init ();
|
insilmaril@0
|
19 |
}
|
insilmaril@0
|
20 |
|
insilmaril@408
|
21 |
OrnamentedObj::OrnamentedObj(QGraphicsScene* s) :LinkableMapObj(s)
|
insilmaril@0
|
22 |
{
|
insilmaril@408
|
23 |
// cout << "Const OrnamentedObj (s)\n";
|
insilmaril@0
|
24 |
init ();
|
insilmaril@0
|
25 |
}
|
insilmaril@0
|
26 |
|
insilmaril@408
|
27 |
OrnamentedObj::OrnamentedObj (OrnamentedObj* lmo) : LinkableMapObj (lmo->scene)
|
insilmaril@0
|
28 |
{
|
insilmaril@0
|
29 |
copy (lmo);
|
insilmaril@0
|
30 |
}
|
insilmaril@0
|
31 |
|
insilmaril@0
|
32 |
OrnamentedObj::~OrnamentedObj()
|
insilmaril@0
|
33 |
{
|
insilmaril@442
|
34 |
delete heading;
|
insilmaril@442
|
35 |
delete systemFlags;
|
insilmaril@442
|
36 |
delete standardFlags;
|
insilmaril@442
|
37 |
delete frame;
|
insilmaril@0
|
38 |
}
|
insilmaril@0
|
39 |
|
insilmaril@0
|
40 |
|
insilmaril@0
|
41 |
void OrnamentedObj::init ()
|
insilmaril@0
|
42 |
{
|
insilmaril@408
|
43 |
heading = new HeadingObj(scene);
|
insilmaril@0
|
44 |
heading->move (absPos.x(), absPos.y());
|
insilmaril@0
|
45 |
|
insilmaril@0
|
46 |
note.setNote("");
|
insilmaril@0
|
47 |
note.setFontHint (textEditor->getFontHintDefault() );
|
insilmaril@417
|
48 |
isNoteInEditor=false;
|
insilmaril@0
|
49 |
|
insilmaril@408
|
50 |
systemFlags=new FlagRowObj(scene);
|
insilmaril@0
|
51 |
systemFlags->clone(systemFlagsDefault);
|
insilmaril@0
|
52 |
systemFlags->setName ("systemFlags");
|
insilmaril@0
|
53 |
|
insilmaril@408
|
54 |
standardFlags=new FlagRowObj(scene);
|
insilmaril@0
|
55 |
standardFlags->clone(standardFlagsDefault);
|
insilmaril@0
|
56 |
standardFlags->setName ("standardFlags");
|
insilmaril@243
|
57 |
|
insilmaril@442
|
58 |
frame = new FrameObj (scene);
|
insilmaril@442
|
59 |
|
insilmaril@243
|
60 |
hideExport=false;
|
insilmaril@260
|
61 |
hidden=false;
|
insilmaril@243
|
62 |
|
insilmaril@243
|
63 |
url="";
|
insilmaril@243
|
64 |
vymLink="";
|
insilmaril@243
|
65 |
|
insilmaril@0
|
66 |
}
|
insilmaril@0
|
67 |
|
insilmaril@0
|
68 |
void OrnamentedObj::copy (OrnamentedObj* other)
|
insilmaril@0
|
69 |
{
|
insilmaril@0
|
70 |
LinkableMapObj::copy(other);
|
insilmaril@0
|
71 |
heading->copy(other->heading);
|
insilmaril@243
|
72 |
setColor (other->heading->getColor());
|
insilmaril@0
|
73 |
|
insilmaril@0
|
74 |
note.copy (other->note);
|
insilmaril@0
|
75 |
systemFlags->copy (other->systemFlags);
|
insilmaril@0
|
76 |
standardFlags->copy (other->standardFlags);
|
insilmaril@0
|
77 |
|
insilmaril@227
|
78 |
ornamentsBBox=other->ornamentsBBox;
|
insilmaril@227
|
79 |
|
insilmaril@243
|
80 |
hideExport=other->hideExport;
|
insilmaril@243
|
81 |
url=other->url;
|
insilmaril@243
|
82 |
vymLink=other->vymLink;
|
insilmaril@0
|
83 |
}
|
insilmaril@0
|
84 |
|
insilmaril@0
|
85 |
QString OrnamentedObj::getHeading()
|
insilmaril@0
|
86 |
{
|
insilmaril@0
|
87 |
return heading->text();
|
insilmaril@0
|
88 |
}
|
insilmaril@0
|
89 |
|
insilmaril@0
|
90 |
void OrnamentedObj::setLinkColor()
|
insilmaril@0
|
91 |
{
|
insilmaril@398
|
92 |
if (mapEditor->getMapLinkColorHint()==HeadingColor)
|
insilmaril@0
|
93 |
LinkableMapObj::setLinkColor (heading->getColor());
|
insilmaril@0
|
94 |
else
|
insilmaril@398
|
95 |
LinkableMapObj::setLinkColor (mapEditor->getMapDefLinkColor());
|
insilmaril@0
|
96 |
}
|
insilmaril@0
|
97 |
|
insilmaril@243
|
98 |
void OrnamentedObj::setColor (QColor col)
|
insilmaril@243
|
99 |
{
|
insilmaril@243
|
100 |
heading->setColor(col);
|
insilmaril@243
|
101 |
setLinkColor();
|
insilmaril@243
|
102 |
}
|
insilmaril@243
|
103 |
|
insilmaril@0
|
104 |
QColor OrnamentedObj::getColor ()
|
insilmaril@0
|
105 |
{
|
insilmaril@0
|
106 |
return heading->getColor();
|
insilmaril@0
|
107 |
}
|
insilmaril@0
|
108 |
|
insilmaril@442
|
109 |
FrameType OrnamentedObj::getFrameType()
|
insilmaril@442
|
110 |
{
|
insilmaril@442
|
111 |
return frame->getFrameType();
|
insilmaril@442
|
112 |
}
|
insilmaril@442
|
113 |
|
insilmaril@442
|
114 |
void OrnamentedObj::setFrameType(const FrameType &t)
|
insilmaril@442
|
115 |
{
|
insilmaril@442
|
116 |
frame->setFrameType(t);
|
insilmaril@442
|
117 |
if (t == NoFrame)
|
insilmaril@442
|
118 |
linkpos=LinkBottom;
|
insilmaril@442
|
119 |
else
|
insilmaril@442
|
120 |
linkpos=LinkMiddle;
|
insilmaril@442
|
121 |
|
insilmaril@442
|
122 |
calcBBoxSize();
|
insilmaril@442
|
123 |
positionBBox();
|
insilmaril@442
|
124 |
requestReposition();
|
insilmaril@442
|
125 |
}
|
insilmaril@442
|
126 |
|
insilmaril@442
|
127 |
void OrnamentedObj::setFrameType(const QString &t)
|
insilmaril@442
|
128 |
{
|
insilmaril@442
|
129 |
frame->setFrameType(t);
|
insilmaril@442
|
130 |
if (frame->getFrameType() == NoFrame)
|
insilmaril@442
|
131 |
linkpos=LinkBottom;
|
insilmaril@442
|
132 |
else
|
insilmaril@442
|
133 |
linkpos=LinkMiddle;
|
insilmaril@442
|
134 |
|
insilmaril@442
|
135 |
calcBBoxSize();
|
insilmaril@442
|
136 |
positionBBox();
|
insilmaril@442
|
137 |
requestReposition();
|
insilmaril@442
|
138 |
}
|
insilmaril@442
|
139 |
|
insilmaril@442
|
140 |
void OrnamentedObj::setFramePenColor(QColor col)
|
insilmaril@442
|
141 |
{
|
insilmaril@442
|
142 |
frame->setPenColor (col);
|
insilmaril@442
|
143 |
}
|
insilmaril@442
|
144 |
|
insilmaril@442
|
145 |
QColor OrnamentedObj::getFramePenColor()
|
insilmaril@442
|
146 |
{
|
insilmaril@442
|
147 |
return frame->getPenColor ();
|
insilmaril@442
|
148 |
}
|
insilmaril@442
|
149 |
|
insilmaril@442
|
150 |
void OrnamentedObj::setFrameBrushColor(QColor col)
|
insilmaril@442
|
151 |
{
|
insilmaril@442
|
152 |
frame->setBrushColor (col);
|
insilmaril@442
|
153 |
}
|
insilmaril@442
|
154 |
|
insilmaril@442
|
155 |
QColor OrnamentedObj::getFrameBrushColor()
|
insilmaril@442
|
156 |
{
|
insilmaril@442
|
157 |
return frame->getBrushColor ();
|
insilmaril@442
|
158 |
}
|
insilmaril@0
|
159 |
|
insilmaril@177
|
160 |
void OrnamentedObj::positionContents()
|
insilmaril@0
|
161 |
{
|
insilmaril@177
|
162 |
double d=frame->getBorder()/2;
|
insilmaril@177
|
163 |
double x=absPos.x();
|
insilmaril@177
|
164 |
double y=absPos.y();
|
insilmaril@227
|
165 |
|
insilmaril@227
|
166 |
double ox,oy; // Offset due to padding
|
insilmaril@227
|
167 |
|
insilmaril@227
|
168 |
ox=leftPad + d;
|
insilmaril@227
|
169 |
oy=topPad + d;
|
insilmaril@227
|
170 |
|
insilmaril@227
|
171 |
systemFlags-> move (ox +x , oy + y );
|
insilmaril@0
|
172 |
|
insilmaril@0
|
173 |
// vertical align heading to bottom
|
insilmaril@227
|
174 |
heading->move (ox + x + systemFlags->getBBox().width(),
|
insilmaril@227
|
175 |
oy + y + ornamentsBBox.height() - heading->getHeight()
|
insilmaril@0
|
176 |
);
|
insilmaril@227
|
177 |
standardFlags->move (ox +x + heading->getWidth() + systemFlags->getBBox().width() , oy + y );
|
insilmaril@227
|
178 |
|
insilmaril@408
|
179 |
ornamentsBBox.moveTopLeft ( QPointF ((int)(ox+x),(int)(oy+y)));
|
insilmaril@408
|
180 |
clickBox.moveTopLeft (QPointF ((int)(ox + x), (int)(oy + y)));
|
insilmaril@177
|
181 |
}
|
insilmaril@0
|
182 |
|
insilmaril@177
|
183 |
void OrnamentedObj::move (double x, double y)
|
insilmaril@177
|
184 |
{
|
insilmaril@177
|
185 |
MapObj::move (x,y);
|
insilmaril@177
|
186 |
positionContents();
|
insilmaril@0
|
187 |
updateLink();
|
insilmaril@0
|
188 |
requestReposition();
|
insilmaril@0
|
189 |
}
|
insilmaril@0
|
190 |
|
insilmaril@408
|
191 |
void OrnamentedObj::move (QPointF p)
|
insilmaril@0
|
192 |
{
|
insilmaril@0
|
193 |
move (p.x(), p.y());
|
insilmaril@0
|
194 |
}
|
insilmaril@0
|
195 |
|
insilmaril@0
|
196 |
void OrnamentedObj::moveBy (double x, double y)
|
insilmaril@0
|
197 |
{
|
insilmaril@0
|
198 |
|
insilmaril@0
|
199 |
MapObj::moveBy (x,y);
|
insilmaril@0
|
200 |
frame->moveBy (x,y);
|
insilmaril@0
|
201 |
systemFlags->moveBy (x,y);
|
insilmaril@0
|
202 |
standardFlags->moveBy (x,y);
|
insilmaril@0
|
203 |
heading->moveBy (x,y);
|
insilmaril@0
|
204 |
updateLink();
|
insilmaril@0
|
205 |
requestReposition();
|
insilmaril@0
|
206 |
}
|
insilmaril@0
|
207 |
|
insilmaril@408
|
208 |
void OrnamentedObj::moveBy (QPointF p)
|
insilmaril@0
|
209 |
{
|
insilmaril@0
|
210 |
moveBy (p.x(), p.y());
|
insilmaril@0
|
211 |
}
|
insilmaril@0
|
212 |
|
insilmaril@0
|
213 |
void OrnamentedObj::move2RelPos(double x, double y)
|
insilmaril@0
|
214 |
{
|
insilmaril@408
|
215 |
setRelPos (QPointF((int)x,(int)y));
|
insilmaril@388
|
216 |
if (parObj)
|
insilmaril@388
|
217 |
{
|
insilmaril@408
|
218 |
QPointF p=parObj->getChildPos();
|
insilmaril@388
|
219 |
move (p.x()+x, p.y() +y);
|
insilmaril@388
|
220 |
}
|
insilmaril@0
|
221 |
}
|
insilmaril@0
|
222 |
|
insilmaril@408
|
223 |
void OrnamentedObj::move2RelPos(QPointF p)
|
insilmaril@0
|
224 |
{
|
insilmaril@218
|
225 |
move2RelPos (p.x(),p.y());
|
insilmaril@0
|
226 |
}
|
insilmaril@0
|
227 |
|
insilmaril@0
|
228 |
void OrnamentedObj::setNote(QString s)
|
insilmaril@0
|
229 |
{
|
insilmaril@0
|
230 |
note.setNote(s);
|
insilmaril@417
|
231 |
updateNoteFlag();
|
insilmaril@0
|
232 |
}
|
insilmaril@0
|
233 |
|
insilmaril@0
|
234 |
void OrnamentedObj::setNote(NoteObj n)
|
insilmaril@0
|
235 |
{
|
insilmaril@0
|
236 |
note=n;
|
insilmaril@417
|
237 |
updateNoteFlag();
|
insilmaril@0
|
238 |
}
|
insilmaril@0
|
239 |
|
insilmaril@0
|
240 |
QString OrnamentedObj::getNote()
|
insilmaril@0
|
241 |
{
|
insilmaril@0
|
242 |
return note.getNote();
|
insilmaril@0
|
243 |
}
|
insilmaril@0
|
244 |
|
insilmaril@187
|
245 |
QString OrnamentedObj::getNoteASCII()
|
insilmaril@187
|
246 |
{
|
insilmaril@187
|
247 |
return note.getNoteASCII();
|
insilmaril@187
|
248 |
}
|
insilmaril@187
|
249 |
|
insilmaril@187
|
250 |
QString OrnamentedObj::getNoteOpenDoc()
|
insilmaril@187
|
251 |
{
|
insilmaril@187
|
252 |
return note.getNoteOpenDoc();
|
insilmaril@187
|
253 |
}
|
insilmaril@187
|
254 |
|
insilmaril@243
|
255 |
void OrnamentedObj::setURL(QString s)
|
insilmaril@243
|
256 |
{
|
insilmaril@243
|
257 |
url=s;
|
insilmaril@243
|
258 |
if (!url.isEmpty())
|
insilmaril@243
|
259 |
systemFlags->activate("url");
|
insilmaril@243
|
260 |
else
|
insilmaril@243
|
261 |
systemFlags->deactivate("url");
|
insilmaril@243
|
262 |
calcBBoxSize(); // recalculate bbox
|
insilmaril@243
|
263 |
positionBBox(); // rearrange contents
|
insilmaril@243
|
264 |
forceReposition();
|
insilmaril@243
|
265 |
}
|
insilmaril@243
|
266 |
|
insilmaril@243
|
267 |
QString OrnamentedObj::getURL()
|
insilmaril@243
|
268 |
{
|
insilmaril@243
|
269 |
return url;
|
insilmaril@243
|
270 |
}
|
insilmaril@243
|
271 |
|
insilmaril@243
|
272 |
void OrnamentedObj::setVymLink(QString s)
|
insilmaril@243
|
273 |
{
|
insilmaril@243
|
274 |
if (!s.isEmpty())
|
insilmaril@243
|
275 |
{
|
insilmaril@243
|
276 |
// We need the relative (from loading)
|
insilmaril@243
|
277 |
// or absolute path (from User event)
|
insilmaril@243
|
278 |
// and build the absolute path.
|
insilmaril@243
|
279 |
// Note: If we have relative, use path of
|
insilmaril@243
|
280 |
// current map to build absolute path
|
insilmaril@243
|
281 |
QDir d(s);
|
insilmaril@243
|
282 |
if (!d.path().startsWith ("/"))
|
insilmaril@243
|
283 |
{
|
insilmaril@243
|
284 |
QString p=mapEditor->getDestPath();
|
insilmaril@243
|
285 |
int i=p.findRev("/",-1);
|
insilmaril@243
|
286 |
d.setPath(p.left(i)+"/"+s);
|
insilmaril@243
|
287 |
d.convertToAbs();
|
insilmaril@243
|
288 |
}
|
insilmaril@243
|
289 |
vymLink=d.path();
|
insilmaril@243
|
290 |
systemFlags->activate("vymLink");
|
insilmaril@243
|
291 |
}
|
insilmaril@243
|
292 |
else
|
insilmaril@243
|
293 |
{
|
insilmaril@243
|
294 |
systemFlags->deactivate("vymLink");
|
insilmaril@243
|
295 |
vymLink="";
|
insilmaril@243
|
296 |
}
|
insilmaril@243
|
297 |
calcBBoxSize(); // recalculate bbox
|
insilmaril@243
|
298 |
positionBBox(); // rearrange contents
|
insilmaril@243
|
299 |
forceReposition();
|
insilmaril@243
|
300 |
}
|
insilmaril@243
|
301 |
|
insilmaril@243
|
302 |
QString OrnamentedObj::getVymLink()
|
insilmaril@243
|
303 |
{
|
insilmaril@243
|
304 |
return vymLink;
|
insilmaril@243
|
305 |
}
|
insilmaril@243
|
306 |
|
insilmaril@243
|
307 |
|
insilmaril@103
|
308 |
void OrnamentedObj::toggleStandardFlag(QString f, bool exclusive)
|
insilmaril@0
|
309 |
{
|
insilmaril@103
|
310 |
standardFlags->toggle(f,exclusive);
|
insilmaril@0
|
311 |
calcBBoxSize();
|
insilmaril@0
|
312 |
positionBBox();
|
insilmaril@0
|
313 |
move (absPos.x(), absPos.y() );
|
insilmaril@0
|
314 |
forceReposition();
|
insilmaril@0
|
315 |
}
|
insilmaril@0
|
316 |
|
insilmaril@0
|
317 |
void OrnamentedObj::activateStandardFlag(QString f)
|
insilmaril@0
|
318 |
{
|
insilmaril@0
|
319 |
standardFlags->activate(f);
|
insilmaril@0
|
320 |
calcBBoxSize();
|
insilmaril@0
|
321 |
positionBBox();
|
insilmaril@0
|
322 |
move (absPos.x(), absPos.y() );
|
insilmaril@0
|
323 |
forceReposition();
|
insilmaril@0
|
324 |
}
|
insilmaril@0
|
325 |
|
insilmaril@366
|
326 |
void OrnamentedObj::deactivateStandardFlag(QString f)
|
insilmaril@366
|
327 |
{
|
insilmaril@366
|
328 |
standardFlags->deactivate(f);
|
insilmaril@366
|
329 |
calcBBoxSize();
|
insilmaril@366
|
330 |
positionBBox();
|
insilmaril@366
|
331 |
move (absPos.x(), absPos.y() );
|
insilmaril@366
|
332 |
forceReposition();
|
insilmaril@366
|
333 |
}
|
insilmaril@366
|
334 |
|
insilmaril@296
|
335 |
bool OrnamentedObj::isSetStandardFlag (QString f)
|
insilmaril@296
|
336 |
{
|
insilmaril@296
|
337 |
return standardFlags->isActive(f);
|
insilmaril@296
|
338 |
}
|
insilmaril@296
|
339 |
|
insilmaril@408
|
340 |
QString OrnamentedObj::getSystemFlagName(const QPointF &p)
|
insilmaril@0
|
341 |
{
|
insilmaril@0
|
342 |
return systemFlags->getFlagName(p);
|
insilmaril@0
|
343 |
}
|
insilmaril@0
|
344 |
|
insilmaril@236
|
345 |
bool OrnamentedObj::isActiveFlag (const QString & fname)
|
insilmaril@236
|
346 |
{
|
insilmaril@236
|
347 |
if (standardFlags->isActive (fname) ) return true;
|
insilmaril@236
|
348 |
return false;
|
insilmaril@236
|
349 |
}
|
insilmaril@236
|
350 |
|
insilmaril@417
|
351 |
void OrnamentedObj::getNoteFromTextEditor ()
|
insilmaril@417
|
352 |
{
|
insilmaril@417
|
353 |
note.setFilenameHint (textEditor->getFilename());
|
insilmaril@417
|
354 |
note.setFontHint (textEditor->getFontHint() );
|
insilmaril@417
|
355 |
setNote( textEditor->getText() );
|
insilmaril@417
|
356 |
}
|
insilmaril@417
|
357 |
|
insilmaril@0
|
358 |
void OrnamentedObj::updateNoteFlag()
|
insilmaril@0
|
359 |
{
|
insilmaril@417
|
360 |
bool noteEmpty;
|
insilmaril@417
|
361 |
if (isNoteInEditor)
|
insilmaril@417
|
362 |
noteEmpty=textEditor->isEmpty();
|
insilmaril@417
|
363 |
else
|
insilmaril@417
|
364 |
noteEmpty=note.isEmpty();
|
insilmaril@0
|
365 |
|
insilmaril@417
|
366 |
if (!noteEmpty)
|
insilmaril@417
|
367 |
{
|
insilmaril@417
|
368 |
if (systemFlags->isActive ("note")) return;
|
insilmaril@417
|
369 |
systemFlags->activate("note");
|
insilmaril@417
|
370 |
}
|
insilmaril@417
|
371 |
else
|
insilmaril@417
|
372 |
{
|
insilmaril@417
|
373 |
if (!systemFlags->isActive ("note")) return;
|
insilmaril@417
|
374 |
systemFlags->deactivate("note");
|
insilmaril@417
|
375 |
}
|
insilmaril@417
|
376 |
mapEditor->setChanged();
|
insilmaril@417
|
377 |
calcBBoxSize();
|
insilmaril@417
|
378 |
positionBBox();
|
insilmaril@417
|
379 |
move (absPos.x(), absPos.y() );
|
insilmaril@417
|
380 |
forceReposition();
|
insilmaril@0
|
381 |
|
insilmaril@417
|
382 |
}
|
insilmaril@0
|
383 |
|
insilmaril@366
|
384 |
void OrnamentedObj::updateFlagsToolbar()
|
insilmaril@366
|
385 |
{
|
insilmaril@366
|
386 |
standardFlags->updateToolbar();
|
insilmaril@366
|
387 |
}
|
insilmaril@366
|
388 |
|
insilmaril@243
|
389 |
void OrnamentedObj::setHideInExport(bool b)
|
insilmaril@243
|
390 |
{
|
insilmaril@260
|
391 |
if (parObj)
|
insilmaril@260
|
392 |
{
|
insilmaril@260
|
393 |
// Don't allow to MapCenter to be hidden
|
insilmaril@260
|
394 |
hideExport=b;
|
insilmaril@260
|
395 |
if (b)
|
insilmaril@260
|
396 |
systemFlags->activate("hideInExport");
|
insilmaril@260
|
397 |
else
|
insilmaril@260
|
398 |
systemFlags->deactivate("hideInExport");
|
insilmaril@260
|
399 |
calcBBoxSize();
|
insilmaril@260
|
400 |
positionBBox();
|
insilmaril@260
|
401 |
requestReposition();
|
insilmaril@260
|
402 |
}
|
insilmaril@243
|
403 |
}
|
insilmaril@243
|
404 |
|
insilmaril@243
|
405 |
bool OrnamentedObj::hideInExport()
|
insilmaril@243
|
406 |
{
|
insilmaril@243
|
407 |
return hideExport;
|
insilmaril@243
|
408 |
}
|
insilmaril@243
|
409 |
|
insilmaril@260
|
410 |
bool OrnamentedObj::isHidden()
|
insilmaril@260
|
411 |
{
|
insilmaril@260
|
412 |
return hidden;
|
insilmaril@260
|
413 |
}
|
insilmaril@260
|
414 |
|
insilmaril@243
|
415 |
QString OrnamentedObj::getOrnAttr()
|
insilmaril@243
|
416 |
{
|
insilmaril@243
|
417 |
QString posAttr;
|
insilmaril@252
|
418 |
|
insilmaril@388
|
419 |
if (depth==0)
|
insilmaril@388
|
420 |
posAttr=
|
insilmaril@408
|
421 |
attribut("absPosX",QString().setNum(absPos.x())) +
|
insilmaril@408
|
422 |
attribut("absPosY",QString().setNum(absPos.y()));
|
insilmaril@243
|
423 |
else
|
insilmaril@252
|
424 |
{
|
insilmaril@395
|
425 |
if (depth==1 || typeid (*this)==typeid (FloatImageObj))
|
insilmaril@388
|
426 |
posAttr=
|
insilmaril@408
|
427 |
attribut("relPosX",QString().setNum(relPos.x())) +
|
insilmaril@408
|
428 |
attribut("relPosY",QString().setNum(relPos.y()));
|
insilmaril@252
|
429 |
else
|
insilmaril@252
|
430 |
posAttr="";
|
insilmaril@252
|
431 |
}
|
insilmaril@243
|
432 |
|
insilmaril@243
|
433 |
QString urlAttr;
|
insilmaril@243
|
434 |
if (!url.isEmpty())
|
insilmaril@243
|
435 |
urlAttr=attribut ("url",url);
|
insilmaril@243
|
436 |
|
insilmaril@243
|
437 |
QString vymLinkAttr;
|
insilmaril@243
|
438 |
if (!vymLink.isEmpty())
|
insilmaril@243
|
439 |
vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
|
insilmaril@243
|
440 |
|
insilmaril@243
|
441 |
QString hideExpAttr;
|
insilmaril@243
|
442 |
if (hideExport)
|
insilmaril@243
|
443 |
hideExpAttr= attribut("hideInExport","true");
|
insilmaril@243
|
444 |
else
|
insilmaril@243
|
445 |
hideExpAttr="";
|
insilmaril@243
|
446 |
|
insilmaril@243
|
447 |
return posAttr +urlAttr +vymLinkAttr +getLinkAttr() +hideExpAttr;
|
insilmaril@243
|
448 |
}
|
insilmaril@243
|
449 |
|