124
124
_Shape.getFaces(aPoints, aTopo, accuracy, flags);
127
void PropertyPartShape::transform(const Base::Matrix4D &rclTrf)
127
void PropertyPartShape::transformGeometry(const Base::Matrix4D &rclTrf)
130
mat.SetValues(rclTrf[0][0],rclTrf[0][1],rclTrf[0][2],rclTrf[0][3],
131
rclTrf[1][0],rclTrf[1][1],rclTrf[1][2],rclTrf[1][3],
132
rclTrf[2][0],rclTrf[2][1],rclTrf[2][2],rclTrf[2][3],
134
mat.SetScaleFactor(rclTrf[3][3]);
135
// geometric transformation
136
BRepBuilderAPI_GTransform mkTrsf(this->_Shape._Shape, gp_GTrsf(mat));
137
setValue(mkTrsf.Shape());
129
setValue(_Shape.transformGeometry(rclTrf));
140
132
PyObject *PropertyPartShape::getPyObject(void)
270
262
// -------------------------------------------------------------------------
272
TYPESYSTEM_SOURCE(Part::PropertyFilletContour , App::PropertyLists);
274
PropertyFilletContour::PropertyFilletContour()
278
PropertyFilletContour::~PropertyFilletContour()
282
void PropertyFilletContour::setValue(int id, double r1, double r2)
264
TYPESYSTEM_SOURCE(Part::PropertyFilletEdges , App::PropertyLists);
266
PropertyFilletEdges::PropertyFilletEdges()
270
PropertyFilletEdges::~PropertyFilletEdges()
274
void PropertyFilletEdges::setValue(int id, double r1, double r2)
284
276
aboutToSetValue();
285
277
_lValueList.resize(1);
286
_lValueList[0].hashval = id;
278
_lValueList[0].edgeid = id;
287
279
_lValueList[0].radius1 = r1;
288
280
_lValueList[0].radius2 = r2;
292
void PropertyFilletContour::setValues(const std::vector<FilletElement>& values)
284
void PropertyFilletEdges::setValues(const std::vector<FilletElement>& values)
294
286
aboutToSetValue();
295
287
_lValueList = values;
299
PyObject *PropertyFilletContour::getPyObject(void)
291
PyObject *PropertyFilletEdges::getPyObject(void)
301
293
Py::List list(getSize());
302
294
std::vector<FilletElement>::const_iterator it;
304
296
for (it = _lValueList.begin(); it != _lValueList.end(); ++it) {
305
297
Py::Tuple ent(3);
306
ent.setItem(0, Py::Int(it->hashval));
298
ent.setItem(0, Py::Int(it->edgeid));
307
299
ent.setItem(1, Py::Float(it->radius1));
308
300
ent.setItem(2, Py::Float(it->radius2));
309
301
list[index++] = ent;
320
312
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
321
313
FilletElement fe;
322
314
Py::Tuple ent(*it);
323
fe.hashval = (int)Py::Int(ent.getItem(0));
315
fe.edgeid = (int)Py::Int(ent.getItem(0));
324
316
fe.radius1 = (double)Py::Float(ent.getItem(1));
325
317
fe.radius2 = (double)Py::Float(ent.getItem(2));
326
318
values.push_back(fe);
329
321
setValues(values);
332
void PropertyFilletContour::Save (Base::Writer &writer) const
324
void PropertyFilletEdges::Save (Base::Writer &writer) const
334
326
if (!writer.isForceXML()) {
335
writer.Stream() << writer.ind() << "<FilletContour file=\"" << writer.addFile(getName(), this) << "\"/>" << std::endl;
327
writer.Stream() << writer.ind() << "<FilletEdges file=\"" << writer.addFile(getName(), this) << "\"/>" << std::endl;
339
void PropertyFilletContour::Restore(Base::XMLReader &reader)
331
void PropertyFilletEdges::Restore(Base::XMLReader &reader)
341
reader.readElement("FilletContour");
333
reader.readElement("FilletEdges");
342
334
std::string file (reader.getAttribute("file") );
344
336
if (!file.empty()) {
350
void PropertyFilletContour::SaveDocFile (Base::Writer &writer) const
342
void PropertyFilletEdges::SaveDocFile (Base::Writer &writer) const
352
344
Base::OutputStream str(writer.Stream());
353
345
uint32_t uCt = (uint32_t)getSize();
355
347
for (std::vector<FilletElement>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) {
356
str << it->hashval << it->radius1 << it->radius2;
348
str << it->edgeid << it->radius1 << it->radius2;
360
void PropertyFilletContour::RestoreDocFile(Base::Reader &reader)
352
void PropertyFilletEdges::RestoreDocFile(Base::Reader &reader)
362
354
Base::InputStream str(reader);
365
357
std::vector<FilletElement> values(uCt);
366
358
for (std::vector<FilletElement>::iterator it = values.begin(); it != values.end(); ++it) {
367
str >> it->hashval >> it->radius1 >> it->radius2;
359
str >> it->edgeid >> it->radius1 >> it->radius2;
369
361
setValues(values);
372
App::Property *PropertyFilletContour::Copy(void) const
364
App::Property *PropertyFilletEdges::Copy(void) const
374
PropertyFilletContour *p= new PropertyFilletContour();
366
PropertyFilletEdges *p= new PropertyFilletEdges();
375
367
p->_lValueList = _lValueList;
379
void PropertyFilletContour::Paste(const Property &from)
371
void PropertyFilletEdges::Paste(const Property &from)
381
373
aboutToSetValue();
382
_lValueList = dynamic_cast<const PropertyFilletContour&>(from)._lValueList;
374
_lValueList = dynamic_cast<const PropertyFilletEdges&>(from)._lValueList;