~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/App/PropertyGeo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-07-16 18:37:41 UTC
  • Revision ID: james.westby@ubuntu.com-20090716183741-oww9kcxqrk991i1n
Tags: upstream-0.8.2237
ImportĀ upstreamĀ versionĀ 0.8.2237

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (c) Jļæ½rgen Riegel          (juergen.riegel@web.de) 2002     *
 
3
 *                                                                         *
 
4
 *   This file is part of the FreeCAD CAx development system.              *
 
5
 *                                                                         *
 
6
 *   This library is free software; you can redistribute it and/or         *
 
7
 *   modify it under the terms of the GNU Library General Public           *
 
8
 *   License as published by the Free Software Foundation; either          *
 
9
 *   version 2 of the License, or (at your option) any later version.      *
 
10
 *                                                                         *
 
11
 *   This library  is distributed in the hope that it will be useful,      *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU Library General Public License for more details.                  *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU Library General Public     *
 
17
 *   License along with this library; see the file COPYING.LIB. If not,    *
 
18
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
 
19
 *   Suite 330, Boston, MA  02111-1307, USA                                *
 
20
 *                                                                         *
 
21
 ***************************************************************************/
 
22
 
 
23
 
 
24
#include "PreCompiled.h"
 
25
 
 
26
#ifndef _PreComp_
 
27
#       include <assert.h>
 
28
#endif
 
29
 
 
30
/// Here the FreeCAD includes sorted by Base,App,Gui......
 
31
 
 
32
#include <Base/Exception.h>
 
33
#include <Base/Writer.h>
 
34
#include <Base/Reader.h>
 
35
#include <Base/Stream.h>
 
36
#include <Base/Rotation.h>
 
37
#include <Base/VectorPy.h>
 
38
#include <Base/MatrixPy.h>
 
39
#include <Base/PlacementPy.h>
 
40
 
 
41
#include "Placement.h"
 
42
 
 
43
#include "PropertyGeo.h"
 
44
 
 
45
using namespace App;
 
46
using namespace Base;
 
47
using namespace std;
 
48
 
 
49
 
 
50
 
 
51
 
 
52
//**************************************************************************
 
53
//**************************************************************************
 
54
// PropertyVector
 
55
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
56
 
 
57
TYPESYSTEM_SOURCE(App::PropertyVector , App::Property);
 
58
 
 
59
//**************************************************************************
 
60
// Construction/Destruction
 
61
 
 
62
 
 
63
PropertyVector::PropertyVector()
 
64
{
 
65
 
 
66
}
 
67
 
 
68
 
 
69
PropertyVector::~PropertyVector()
 
70
{
 
71
 
 
72
}
 
73
 
 
74
//**************************************************************************
 
75
// Base class implementer
 
76
 
 
77
 
 
78
void PropertyVector::setValue(const Base::Vector3f &vec)
 
79
{
 
80
    aboutToSetValue();
 
81
    _cVec=vec;
 
82
    hasSetValue();
 
83
}
 
84
 
 
85
void PropertyVector::setValue(float x, float y, float z)
 
86
{
 
87
    aboutToSetValue();
 
88
    _cVec=Vector3f(x,y,z);
 
89
    hasSetValue();
 
90
}
 
91
 
 
92
const Base::Vector3f & PropertyVector::getValue(void)const
 
93
{
 
94
    return _cVec;
 
95
}
 
96
 
 
97
PyObject *PropertyVector::getPyObject(void)
 
98
{
 
99
    return new Base::VectorPy(_cVec);
 
100
}
 
101
 
 
102
void PropertyVector::setPyObject(PyObject *value)
 
103
{
 
104
    if (PyObject_TypeCheck(value, &(Base::VectorPy::Type))) {
 
105
        Base::VectorPy  *pcObject = static_cast<Base::VectorPy*>(value);
 
106
        Base::Vector3d* val = pcObject->getVectorPtr();
 
107
        Base::Vector3f vec((float)val->x,(float)val->y,(float)val->z);
 
108
        setValue(vec);
 
109
    }
 
110
    else if (PyTuple_Check(value)&&PyTuple_Size(value)==3) {
 
111
        PyObject* item;
 
112
        Base::Vector3f cVec;
 
113
        // x
 
114
        item = PyTuple_GetItem(value,0);
 
115
        if (PyFloat_Check(item))
 
116
            cVec.x = (float)PyFloat_AsDouble(item);
 
117
        else if (PyInt_Check(item))
 
118
            cVec.x = (float)PyInt_AsLong(item);
 
119
        else
 
120
            throw Base::Exception("Not allowed type used in tuple (float expected)...");
 
121
        // y
 
122
        item = PyTuple_GetItem(value,1);
 
123
        if (PyFloat_Check(item))
 
124
            cVec.y = (float)PyFloat_AsDouble(item);
 
125
        else if (PyInt_Check(item))
 
126
            cVec.y = (float)PyInt_AsLong(item);
 
127
        else
 
128
            throw Base::Exception("Not allowed type used in tuple (float expected)...");
 
129
        // z
 
130
        item = PyTuple_GetItem(value,2);
 
131
        if (PyFloat_Check(item))
 
132
            cVec.z = (float)PyFloat_AsDouble(item);
 
133
        else if (PyInt_Check(item))
 
134
            cVec.z = (float)PyInt_AsLong(item);
 
135
        else
 
136
            throw Base::Exception("Not allowed type used in tuple (float expected)...");
 
137
        setValue( cVec );
 
138
    }
 
139
    else {
 
140
        std::string error = std::string("type must be 'Vector' or tuple of three floats, not ");
 
141
        error += value->ob_type->tp_name;
 
142
        throw Py::TypeError(error);
 
143
    }
 
144
}
 
145
 
 
146
void PropertyVector::Save (Writer &writer) const
 
147
{
 
148
    writer.Stream() << writer.ind() << "<PropertyVector valueX=\"" <<  _cVec.x << "\" valueY=\"" <<  _cVec.y << "\" valueZ=\"" <<  _cVec.z <<"\"/>" << endl;
 
149
}
 
150
 
 
151
void PropertyVector::Restore(Base::XMLReader &reader)
 
152
{
 
153
    // read my Element
 
154
    reader.readElement("PropertyVector");
 
155
    // get the value of my Attribute
 
156
    aboutToSetValue();
 
157
    _cVec.x = (float)reader.getAttributeAsFloat("valueX");
 
158
    _cVec.y = (float)reader.getAttributeAsFloat("valueY");
 
159
    _cVec.z = (float)reader.getAttributeAsFloat("valueZ");
 
160
    hasSetValue();
 
161
}
 
162
 
 
163
 
 
164
Property *PropertyVector::Copy(void) const
 
165
{
 
166
    PropertyVector *p= new PropertyVector();
 
167
    p->_cVec = _cVec;
 
168
    return p;
 
169
}
 
170
 
 
171
void PropertyVector::Paste(const Property &from)
 
172
{
 
173
    aboutToSetValue();
 
174
    _cVec = dynamic_cast<const PropertyVector&>(from)._cVec;
 
175
    hasSetValue();
 
176
}
 
177
 
 
178
 
 
179
//**************************************************************************
 
180
// PropertyVectorList
 
181
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
182
 
 
183
TYPESYSTEM_SOURCE(App::PropertyVectorList , App::PropertyLists);
 
184
 
 
185
//**************************************************************************
 
186
// Construction/Destruction
 
187
 
 
188
PropertyVectorList::PropertyVectorList()
 
189
{
 
190
 
 
191
}
 
192
 
 
193
PropertyVectorList::~PropertyVectorList()
 
194
{
 
195
 
 
196
}
 
197
 
 
198
//**************************************************************************
 
199
// Base class implementer
 
200
 
 
201
void PropertyVectorList::setValue(const Base::Vector3f& lValue)
 
202
{
 
203
    aboutToSetValue();
 
204
    _lValueList.resize(1);
 
205
    _lValueList[0]=lValue;
 
206
    hasSetValue();
 
207
}
 
208
 
 
209
void PropertyVectorList::setValue(float x, float y, float z)
 
210
{
 
211
    aboutToSetValue();
 
212
    _lValueList.resize(1);
 
213
    _lValueList[0].Set(x,y,z);
 
214
    hasSetValue();
 
215
}
 
216
 
 
217
void PropertyVectorList::setValues(const std::vector<Base::Vector3f>& values)
 
218
{
 
219
    aboutToSetValue();
 
220
    _lValueList = values;
 
221
    hasSetValue();
 
222
}
 
223
 
 
224
PyObject *PropertyVectorList::getPyObject(void)
 
225
{
 
226
    PyObject* list = PyList_New(        getSize() );
 
227
 
 
228
    for (int i = 0;i<getSize(); i++)
 
229
        PyList_SetItem( list, i, new VectorPy(  _lValueList[i]));
 
230
 
 
231
    return list;
 
232
}
 
233
 
 
234
void PropertyVectorList::setPyObject(PyObject *value)
 
235
{
 
236
    if (PyList_Check(value)) {
 
237
        Py_ssize_t nSize = PyList_Size(value);
 
238
        std::vector<Base::Vector3f> values;
 
239
        values.resize(nSize);
 
240
 
 
241
        for (Py_ssize_t i=0; i<nSize;++i) {
 
242
            PyObject* item = PyList_GetItem(value, i);
 
243
            PropertyVector val;
 
244
            val.setPyObject( item );
 
245
            values[i] = val.getValue();
 
246
        }
 
247
 
 
248
        setValues(values);
 
249
    }
 
250
    else if (PyObject_TypeCheck(value, &(VectorPy::Type))) {
 
251
        Base::VectorPy  *pcObject = static_cast<Base::VectorPy*>(value);
 
252
        Base::Vector3d* val = pcObject->getVectorPtr();
 
253
        Base::Vector3f vec((float)val->x,(float)val->y,(float)val->z);
 
254
        setValue(vec);
 
255
    }
 
256
    else if (PyTuple_Check(value) && PyTuple_Size(value) == 3) {
 
257
        PropertyVector val;
 
258
        val.setPyObject( value );
 
259
        setValue( val.getValue() );
 
260
    }
 
261
    else {
 
262
        std::string error = std::string("type must be 'Vector' or list of 'Vector', not ");
 
263
        error += value->ob_type->tp_name;
 
264
        throw Py::TypeError(error);
 
265
    }
 
266
}
 
267
 
 
268
void PropertyVectorList::Save (Writer &writer) const
 
269
{
 
270
    if (!writer.isForceXML()) {
 
271
        writer.Stream() << writer.ind() << "<VectorList file=\"" << writer.addFile(getName(), this) << "\"/>" << std::endl;
 
272
    }
 
273
}
 
274
 
 
275
void PropertyVectorList::Restore(Base::XMLReader &reader)
 
276
{
 
277
    reader.readElement("VectorList");
 
278
    std::string file (reader.getAttribute("file") );
 
279
 
 
280
    if (!file.empty()) {
 
281
        // initate a file read
 
282
        reader.addFile(file.c_str(),this);
 
283
    }
 
284
}
 
285
 
 
286
void PropertyVectorList::SaveDocFile (Base::Writer &writer) const
 
287
{
 
288
    Base::OutputStream str(writer.Stream());
 
289
    uint32_t uCt = (uint32_t)getSize();
 
290
    str << uCt;
 
291
    for (std::vector<Base::Vector3f>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) {
 
292
        str << it->x << it->y << it->z;
 
293
    }
 
294
}
 
295
 
 
296
void PropertyVectorList::RestoreDocFile(Base::Reader &reader)
 
297
{
 
298
    Base::InputStream str(reader);
 
299
    uint32_t uCt=0;
 
300
    str >> uCt;
 
301
    std::vector<Base::Vector3f> values(uCt);
 
302
    for (std::vector<Base::Vector3f>::iterator it = values.begin(); it != values.end(); ++it) {
 
303
        str >> it->x >> it->y >> it->z;
 
304
    }
 
305
    setValues(values);
 
306
}
 
307
 
 
308
Property *PropertyVectorList::Copy(void) const
 
309
{
 
310
    PropertyVectorList *p= new PropertyVectorList();
 
311
    p->_lValueList = _lValueList;
 
312
    return p;
 
313
}
 
314
 
 
315
void PropertyVectorList::Paste(const Property &from)
 
316
{
 
317
    aboutToSetValue();
 
318
    _lValueList = dynamic_cast<const PropertyVectorList&>(from)._lValueList;
 
319
    hasSetValue();
 
320
}
 
321
 
 
322
//**************************************************************************
 
323
//**************************************************************************
 
324
// PropertyMatrix
 
325
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
326
 
 
327
TYPESYSTEM_SOURCE(App::PropertyMatrix , App::Property);
 
328
 
 
329
//**************************************************************************
 
330
// Construction/Destruction
 
331
 
 
332
 
 
333
PropertyMatrix::PropertyMatrix()
 
334
{
 
335
 
 
336
}
 
337
 
 
338
 
 
339
PropertyMatrix::~PropertyMatrix()
 
340
{
 
341
 
 
342
}
 
343
 
 
344
//**************************************************************************
 
345
// Base class implementer
 
346
 
 
347
 
 
348
void PropertyMatrix::setValue(const Base::Matrix4D &mat)
 
349
{
 
350
    aboutToSetValue();
 
351
    _cMat=mat;
 
352
    hasSetValue();
 
353
}
 
354
 
 
355
 
 
356
const Base::Matrix4D & PropertyMatrix::getValue(void)const
 
357
{
 
358
    return _cMat;
 
359
}
 
360
 
 
361
PyObject *PropertyMatrix::getPyObject(void)
 
362
{
 
363
    return new Base::MatrixPy(_cMat);
 
364
}
 
365
 
 
366
void PropertyMatrix::setPyObject(PyObject *value)
 
367
{
 
368
    if (PyObject_TypeCheck(value, &(Base::MatrixPy::Type))) {
 
369
        Base::MatrixPy  *pcObject = (Base::MatrixPy*)value;
 
370
        setValue( pcObject->value() );
 
371
    }
 
372
    else if (PyTuple_Check(value)&&PyTuple_Size(value)==16) {
 
373
        PyObject* item;
 
374
        Base::Matrix4D cMatrix;
 
375
 
 
376
        for (int x=0; x<4;x++) {
 
377
            for (int y=0; y<4;y++) {
 
378
                item = PyTuple_GetItem(value,x+y*4);
 
379
                if (PyFloat_Check(item))
 
380
                    cMatrix[x][y] = PyFloat_AsDouble(item);
 
381
                else if (PyInt_Check(item))
 
382
                    cMatrix[x][y] = (double)PyInt_AsLong(item);
 
383
                else
 
384
                    throw Base::Exception("Not allowed type used in matrix tuple (a number expected)...");
 
385
            }
 
386
        }
 
387
 
 
388
        setValue( cMatrix );
 
389
    }
 
390
    else {
 
391
        std::string error = std::string("type must be 'Matrix' or tuple of 16 float or int, not ");
 
392
        error += value->ob_type->tp_name;
 
393
        throw Py::TypeError(error);
 
394
    }
 
395
}
 
396
 
 
397
void PropertyMatrix::Save (Base::Writer &writer) const
 
398
{
 
399
    writer.Stream() << writer.ind() << "<PropertyMatrix";
 
400
    writer.Stream() << " a11=\"" <<  _cMat[0][0] << "\" a12=\"" <<  _cMat[0][1] << "\" a13=\"" <<  _cMat[0][2] << "\" a14=\"" <<  _cMat[0][3] << "\"";
 
401
    writer.Stream() << " a21=\"" <<  _cMat[1][0] << "\" a22=\"" <<  _cMat[1][1] << "\" a23=\"" <<  _cMat[1][2] << "\" a24=\"" <<  _cMat[1][3] << "\"";
 
402
    writer.Stream() << " a31=\"" <<  _cMat[2][0] << "\" a32=\"" <<  _cMat[2][1] << "\" a33=\"" <<  _cMat[2][2] << "\" a34=\"" <<  _cMat[2][3] << "\"";
 
403
    writer.Stream() << " a41=\"" <<  _cMat[3][0] << "\" a42=\"" <<  _cMat[3][1] << "\" a43=\"" <<  _cMat[3][2] << "\" a44=\"" <<  _cMat[3][3] << "\"";
 
404
    writer.Stream() <<"/>" << endl;
 
405
}
 
406
 
 
407
void PropertyMatrix::Restore(Base::XMLReader &reader)
 
408
{
 
409
    // read my Element
 
410
    reader.readElement("PropertyMatrix");
 
411
    // get the value of my Attribute
 
412
    aboutToSetValue();
 
413
    _cMat[0][0] = (float)reader.getAttributeAsFloat("a11");
 
414
    _cMat[0][1] = (float)reader.getAttributeAsFloat("a12");
 
415
    _cMat[0][2] = (float)reader.getAttributeAsFloat("a13");
 
416
    _cMat[0][3] = (float)reader.getAttributeAsFloat("a14");
 
417
 
 
418
    _cMat[1][0] = (float)reader.getAttributeAsFloat("a21");
 
419
    _cMat[1][1] = (float)reader.getAttributeAsFloat("a22");
 
420
    _cMat[1][2] = (float)reader.getAttributeAsFloat("a23");
 
421
    _cMat[1][3] = (float)reader.getAttributeAsFloat("a24");
 
422
 
 
423
    _cMat[2][0] = (float)reader.getAttributeAsFloat("a31");
 
424
    _cMat[2][1] = (float)reader.getAttributeAsFloat("a32");
 
425
    _cMat[2][2] = (float)reader.getAttributeAsFloat("a33");
 
426
    _cMat[2][3] = (float)reader.getAttributeAsFloat("a34");
 
427
 
 
428
    _cMat[3][0] = (float)reader.getAttributeAsFloat("a41");
 
429
    _cMat[3][1] = (float)reader.getAttributeAsFloat("a42");
 
430
    _cMat[3][2] = (float)reader.getAttributeAsFloat("a43");
 
431
    _cMat[3][3] = (float)reader.getAttributeAsFloat("a44");
 
432
    hasSetValue();
 
433
}
 
434
 
 
435
 
 
436
Property *PropertyMatrix::Copy(void) const
 
437
{
 
438
    PropertyMatrix *p= new PropertyMatrix();
 
439
    p->_cMat = _cMat;
 
440
    return p;
 
441
}
 
442
 
 
443
void PropertyMatrix::Paste(const Property &from)
 
444
{
 
445
    aboutToSetValue();
 
446
    _cMat = dynamic_cast<const PropertyMatrix&>(from)._cMat;
 
447
    hasSetValue();
 
448
}
 
449
 
 
450
//**************************************************************************
 
451
//**************************************************************************
 
452
// PropertyPlacement
 
453
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
454
 
 
455
TYPESYSTEM_SOURCE(App::PropertyPlacement , App::Property);
 
456
 
 
457
//**************************************************************************
 
458
// Construction/Destruction
 
459
 
 
460
 
 
461
PropertyPlacement::PropertyPlacement()
 
462
{
 
463
 
 
464
}
 
465
 
 
466
 
 
467
PropertyPlacement::~PropertyPlacement()
 
468
{
 
469
 
 
470
}
 
471
 
 
472
//**************************************************************************
 
473
// Base class implementer
 
474
 
 
475
 
 
476
void PropertyPlacement::setValue(const Base::Placement &pos)
 
477
{
 
478
    aboutToSetValue();
 
479
    _cPos=pos;
 
480
    hasSetValue();
 
481
}
 
482
 
 
483
const Base::Placement & PropertyPlacement::getValue(void)const
 
484
{
 
485
    return _cPos;
 
486
}
 
487
 
 
488
PyObject *PropertyPlacement::getPyObject(void)
 
489
{
 
490
    Base::Matrix4D mat = _cPos.toMatrix();
 
491
    return new Base::MatrixPy(mat);
 
492
}
 
493
 
 
494
void PropertyPlacement::setPyObject(PyObject *value)
 
495
{
 
496
    if (PyObject_TypeCheck(value, &(Base::MatrixPy::Type))) {
 
497
        Base::MatrixPy  *pcObject = (Base::MatrixPy*)value;
 
498
        Base::Matrix4D mat = pcObject->value();
 
499
        Base::Placement p;
 
500
        p.fromMatrix(mat);
 
501
        setValue(p);
 
502
    }
 
503
    else if (PyObject_TypeCheck(value, &(Base::PlacementPy::Type))) {
 
504
        setValue(*static_cast<Base::PlacementPy*>(value)->getPlacementPtr());
 
505
    }
 
506
    else {
 
507
        std::string error = std::string("type must be 'Matrix' or 'Placement', not ");
 
508
        error += value->ob_type->tp_name;
 
509
        throw Py::TypeError(error);
 
510
    }
 
511
}
 
512
 
 
513
void PropertyPlacement::Save (Base::Writer &writer) const
 
514
{
 
515
    writer.Stream() << writer.ind() << "<PropertyPlacement";
 
516
    writer.Stream() << " Px=\"" <<  _cPos._pos.x << "\" Py=\"" <<  _cPos._pos.y << "\" Pz=\"" <<  _cPos._pos.z << "\"";
 
517
    writer.Stream() << " Q0=\"" <<  _cPos._rot.getValue()[0] << "\" Q1=\"" <<  _cPos._rot.getValue()[1] << "\" Q2=\"" <<  _cPos._rot.getValue()[2] << "\" Q3=\"" <<  _cPos._rot.getValue()[3] << "\"";
 
518
    writer.Stream() <<"/>" << endl;
 
519
}
 
520
 
 
521
void PropertyPlacement::Restore(Base::XMLReader &reader)
 
522
{
 
523
    // read my Element
 
524
    reader.readElement("PropertyPlacement");
 
525
    // get the value of my Attribute
 
526
    aboutToSetValue();
 
527
    _cPos._pos.x = reader.getAttributeAsFloat("Px");
 
528
    _cPos._pos.y = reader.getAttributeAsFloat("Py");
 
529
    _cPos._pos.z = reader.getAttributeAsFloat("Pz");
 
530
 
 
531
    _cPos._rot.setValue(reader.getAttributeAsFloat("Q0"),
 
532
                        reader.getAttributeAsFloat("Q1"),
 
533
                        reader.getAttributeAsFloat("Q2"),
 
534
                        reader.getAttributeAsFloat("Q3"));
 
535
    hasSetValue();
 
536
}
 
537
 
 
538
 
 
539
Property *PropertyPlacement::Copy(void) const
 
540
{
 
541
    PropertyPlacement *p= new PropertyPlacement();
 
542
    p->_cPos = _cPos;
 
543
    return p;
 
544
}
 
545
 
 
546
void PropertyPlacement::Paste(const Property &from)
 
547
{
 
548
    aboutToSetValue();
 
549
    _cPos = dynamic_cast<const PropertyPlacement&>(from)._cPos;
 
550
    hasSetValue();
 
551
}
 
552
 
 
553
//**************************************************************************
 
554
//**************************************************************************
 
555
// PropertyPlacement
 
556
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
557
 
 
558
TYPESYSTEM_SOURCE(App::PropertyPlacementLink , App::PropertyLink);
 
559
 
 
560
//**************************************************************************
 
561
// Construction/Destruction
 
562
 
 
563
 
 
564
PropertyPlacementLink::PropertyPlacementLink()
 
565
{
 
566
 
 
567
}
 
568
 
 
569
 
 
570
PropertyPlacementLink::~PropertyPlacementLink()
 
571
{
 
572
 
 
573
}
 
574
 
 
575
App::Placement * PropertyPlacementLink::getPlacementObject(void) const
 
576
{
 
577
    if (_pcLink->getTypeId().isDerivedFrom(App::Placement::getClassTypeId()))
 
578
        return dynamic_cast<App::Placement*>(_pcLink);
 
579
    else
 
580
        return 0;
 
581
 
 
582
}
 
583
 
 
584
//**************************************************************************
 
585
// Base class implementer
 
586
 
 
587
Property *PropertyPlacementLink::Copy(void) const
 
588
{
 
589
    PropertyPlacementLink *p= new PropertyPlacementLink();
 
590
    p->_pcLink = _pcLink;
 
591
    return p;
 
592
}
 
593
 
 
594
void PropertyPlacementLink::Paste(const Property &from)
 
595
{
 
596
    aboutToSetValue();
 
597
    _pcLink = dynamic_cast<const PropertyPlacementLink&>(from)._pcLink;
 
598
    hasSetValue();
 
599
}
 
600
 
 
601
// ------------------------------------------------------------
 
602
 
 
603
TYPESYSTEM_SOURCE_ABSTRACT(App::PropertyComplexGeoData , App::Property);
 
604
 
 
605
PropertyComplexGeoData::PropertyComplexGeoData()
 
606
{
 
607
 
 
608
}
 
609
 
 
610
PropertyComplexGeoData::~PropertyComplexGeoData()
 
611
{
 
612
 
 
613
}