Change links to Global scope

This commit is contained in:
WandererFan
2017-09-21 18:03:52 -04:00
committed by Yorik van Havre
parent 310fdab492
commit 6d032f1bcf
10 changed files with 20 additions and 25 deletions

View File

@@ -48,7 +48,7 @@ class MeasureExport Measurement : public Base::BaseClass {
TYPESYSTEM_HEADER();
public:
App::PropertyLinkSubList References3D;
App::PropertyLinkSubListGlobal References3D;
public:
Measurement();
@@ -70,13 +70,13 @@ public:
public:
// Methods for distances (edge length, two points, edge and a point
double length() const;
Base::Vector3d delta() const;
Base::Vector3d delta() const; //when would client use delta??
// Calculates the radius for an arc or circular edge
double radius() const;
// Calculates the angle between two edges
double angle(const Base::Vector3d &param = Base::Vector3d(0,0,0)) const;
double angle(const Base::Vector3d &param = Base::Vector3d(0,0,0)) const; //param is never used???
// Calculate volumetric/mass properties
Base::Vector3d massCenter() const;

View File

@@ -54,7 +54,7 @@ public:
DrawProjGroup();
~DrawProjGroup();
App::PropertyLink Source;
App::PropertyLinkGlobal Source;
App::PropertyEnumeration ProjectionType;
App::PropertyBool AutoDistribute;

View File

@@ -166,6 +166,11 @@ double DrawProjGroupItem::getRotateAngle()
double DrawProjGroupItem::getScale(void) const
{
double result = Scale.getValue();
//TODO: should always use DPG.Scale?
// auto pgroup = getPGroup();
// if (pgroup != nullptr) {
// result = pgroup->Scale.getValue();
// }
return result;
}

View File

@@ -42,7 +42,7 @@ public:
DrawViewArch(void);
virtual ~DrawViewArch();
App::PropertyLink Source;
App::PropertyLinkGlobal Source;
App::PropertyBool AllOn;
App::PropertyEnumeration RenderMode; // "Wireframe","Solid"
App::PropertyBool ShowHidden;

View File

@@ -53,10 +53,10 @@ public:
DrawViewDimension();
virtual ~DrawViewDimension();
App::PropertyEnumeration MeasureType; //True/Projected
App::PropertyLinkSubList References2D; //Points to Projection SubFeatures
App::PropertyLinkSubList References3D; //Points to 3D Geometry SubFeatures
App::PropertyEnumeration Type; //DistanceX,DistanceY,Diameter, etc
App::PropertyEnumeration MeasureType; //True/Projected
App::PropertyLinkSubList References2D; //Points to Projection SubFeatures
App::PropertyLinkSubListGlobal References3D; //Points to 3D Geometry SubFeatures
App::PropertyEnumeration Type; //DistanceX,DistanceY,Diameter, etc
/// Properties for Visualisation
App::PropertyFont Font;

View File

@@ -43,7 +43,7 @@ public:
DrawViewDraft(void);
virtual ~DrawViewDraft();
App::PropertyLink Source;
App::PropertyLinkGlobal Source;
App::PropertyFloat LineWidth;
App::PropertyFloat FontSize;
App::PropertyVector Direction;

View File

@@ -81,6 +81,7 @@ DrawViewMulti::DrawViewMulti()
//Source is replaced by Sources in Multi
Source.setStatus(App::Property::ReadOnly,true);
Source.setStatus(App::Property::Hidden,true);
geometryObject = nullptr;
}
@@ -152,7 +153,7 @@ App::DocumentObjectExecReturn *DrawViewMulti::execute(void)
const std::vector<App::DocumentObject*>& links = Sources.getValues();
if (links.empty()) {
Base::Console().Log("INFO - DVM::execute - No Sources - creation?\n");
return DrawViewPart::execute();
return DrawView::execute();
}
m_compound = TopoDS::Compound(getSourceShape());

View File

@@ -57,13 +57,13 @@ public:
DrawViewMulti(void);
virtual ~DrawViewMulti();
App::PropertyLinkList Sources;
App::PropertyLinkListGlobal Sources;
virtual short mustExecute() const;
/** @name methods overide Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
virtual App::DocumentObjectExecReturn *execute(void) override;
virtual void onChanged(const App::Property* prop);
//@}

View File

@@ -152,8 +152,6 @@ DrawViewPart::~DrawViewPart()
delete geometryObject;
}
//does this need all the validation logic?
//how to
TopoDS_Shape DrawViewPart::getSourceShape(void) const
{
TopoDS_Shape result;
@@ -173,17 +171,8 @@ App::DocumentObjectExecReturn *DrawViewPart::execute(void)
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;
}
// App::DocumentObject *link = Source.getValue();
// if (!link) {
// return new App::DocumentObjectExecReturn("DVP - No Source object linked");
// }
// if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
// return new App::DocumentObjectExecReturn("DVP - Linked object is not a Part object");
// }
TopoDS_Shape shape = getSourceShape();
// TopoDS_Shape shape = static_cast<Part::Feature*>(link)->Shape.getShape().getShape();
if (shape.IsNull()) {
return new App::DocumentObjectExecReturn("DVP - Linked shape object is invalid");
}

View File

@@ -76,7 +76,7 @@ public:
DrawViewPart(void);
virtual ~DrawViewPart();
App::PropertyLink Source; //Part Feature
App::PropertyLinkGlobal Source; //Part Feature
App::PropertyVector Direction; //TODO: Rename to YAxisDirection or whatever this actually is (ProjectionDirection)
App::PropertyBool SeamVisible;
App::PropertyBool SmoothVisible;