30
30
31
31
#include < GProp_GProps.hxx>
32
32
33
+ #include < App/DocumentObserver.h>
33
34
#include < App/GeoFeature.h>
34
35
#include < App/PropertyLinks.h>
36
+ #include < App/PropertyStandard.h>
35
37
#include < Base/Exception.h>
36
38
#include < Base/Placement.h>
37
39
@@ -222,7 +224,17 @@ class PartExport AttachEngine : public Base::BaseClass
222
224
const Base::Placement &attachmentOffset = Base::Placement());
223
225
virtual void setUp (const AttachEngine &another);
224
226
virtual AttachEngine* copy () const = 0;
225
- virtual Base::Placement calculateAttachedPlacement (const Base::Placement& origPlacement) const = 0;
227
+
228
+ Base::Placement calculateAttachedPlacement (
229
+ const Base::Placement &origPlacement, bool *subChanged=0 );
230
+
231
+ virtual Base::Placement _calculateAttachedPlacement (
232
+ const std::vector<App::DocumentObject*> &objs,
233
+ const std::vector<std::string> &subs,
234
+ const Base::Placement &origPlacement) const = 0;
235
+
236
+ void setReferences (const App::PropertyLinkSubList &references);
237
+ void setReferences (const std::vector<App::SubObjectT> &references);
226
238
227
239
/* *
228
240
* @brief placementFactory calculates placement from Z axis direction,
@@ -348,6 +360,9 @@ class PartExport AttachEngine : public Base::BaseClass
348
360
349
361
static GProp_GProps getInertialPropsOfShape (const std::vector<const TopoDS_Shape*> &shapes);
350
362
363
+ std::vector<App::DocumentObject*> getRefObjects () const ;
364
+ const std::vector<std::string> &getSubValues () const {return subnames;}
365
+
351
366
/* *
352
367
* @brief verifyReferencesAreSafe: checks if pointers in references still
353
368
* point to objects contained in open documents. This guarantees the links
@@ -362,6 +377,10 @@ class PartExport AttachEngine : public Base::BaseClass
362
377
363
378
public: // members
364
379
App::PropertyLinkSubList references;
380
+ std::string docName;
381
+ std::vector<std::string> objNames;
382
+ std::vector<std::string> subnames;
383
+ std::vector<std::string> shadowSubs;
365
384
366
385
eMapMode mapMode = mmDeactivated;
367
386
bool mapReverse = false ;
@@ -405,7 +424,8 @@ class PartExport AttachEngine : public Base::BaseClass
405
424
ret.push_back (rt4);
406
425
return ret;
407
426
}
408
- static void readLinks (const App::PropertyLinkSubList &references, std::vector<App::GeoFeature *> &geofs,
427
+ static void readLinks (const std::vector<App::DocumentObject*> &objs,
428
+ const std::vector<std::string> &subs, std::vector<App::GeoFeature *> &geofs,
409
429
std::vector<const TopoDS_Shape*>& shapes, std::vector<TopoDS_Shape> &storage,
410
430
std::vector<eRefType> &types);
411
431
@@ -420,7 +440,10 @@ class PartExport AttachEngine3D : public AttachEngine
420
440
public:
421
441
AttachEngine3D ();
422
442
AttachEngine3D* copy () const override ;
423
- Base::Placement calculateAttachedPlacement (const Base::Placement& origPlacement) const override ;
443
+ Base::Placement _calculateAttachedPlacement (
444
+ const std::vector<App::DocumentObject*> &objs,
445
+ const std::vector<std::string> &subs,
446
+ const Base::Placement &origPlacement) const override ;
424
447
private:
425
448
double calculateFoldAngle (gp_Vec axA, gp_Vec axB, gp_Vec edA, gp_Vec edB) const ;
426
449
};
@@ -432,7 +455,10 @@ class PartExport AttachEnginePlane : public AttachEngine
432
455
public:
433
456
AttachEnginePlane ();
434
457
AttachEnginePlane* copy () const override ;
435
- Base::Placement calculateAttachedPlacement (const Base::Placement& origPlacement) const override ;
458
+ Base::Placement _calculateAttachedPlacement (
459
+ const std::vector<App::DocumentObject*> &objs,
460
+ const std::vector<std::string> &subs,
461
+ const Base::Placement &origPlacement) const override ;
436
462
};
437
463
438
464
// attacher specialized for datum lines
@@ -442,7 +468,10 @@ class PartExport AttachEngineLine : public AttachEngine
442
468
public:
443
469
AttachEngineLine ();
444
470
AttachEngineLine* copy () const override ;
445
- Base::Placement calculateAttachedPlacement (const Base::Placement& origPlacement) const override ;
471
+ Base::Placement _calculateAttachedPlacement (
472
+ const std::vector<App::DocumentObject*> &objs,
473
+ const std::vector<std::string> &subs,
474
+ const Base::Placement &origPlacement) const override ;
446
475
};
447
476
448
477
// attacher specialized for datum points
@@ -452,7 +481,10 @@ class PartExport AttachEnginePoint : public AttachEngine
452
481
public:
453
482
AttachEnginePoint ();
454
483
AttachEnginePoint* copy () const override ;
455
- Base::Placement calculateAttachedPlacement (const Base::Placement& origPlacement) const override ;
484
+ Base::Placement _calculateAttachedPlacement (
485
+ const std::vector<App::DocumentObject*> &objs,
486
+ const std::vector<std::string> &subs,
487
+ const Base::Placement &origPlacement) const override ;
456
488
457
489
private:
458
490
gp_Pnt getProximityPoint (eMapMode mode, const TopoDS_Shape& s1, const TopoDS_Shape& s2) const ;
0 commit comments