Skip to content

Commit

Permalink
Part: Added getPaths(...) method to PropertyPartShape.
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindkv authored and wwmayer committed Sep 21, 2015
1 parent ddc22a4 commit 3f0fc98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Mod/Part/App/PropertyTopoShape.cpp
Expand Up @@ -53,6 +53,7 @@
#include <Base/Stream.h>
#include <App/Application.h>
#include <App/DocumentObject.h>
#include <App/ObjectIdentifier.h>

#include "PropertyTopoShape.h"
#include "TopoShapePy.h"
Expand Down Expand Up @@ -229,6 +230,20 @@ unsigned int PropertyPartShape::getMemSize (void) const
return _Shape.getMemSize();
}

void PropertyPartShape::getPaths(std::vector<App::ObjectIdentifier> &paths) const
{
paths.push_back(App::ObjectIdentifier(getContainer()) << App::ObjectIdentifier::Component::SimpleComponent(getName())
<< App::ObjectIdentifier::Component::SimpleComponent(App::ObjectIdentifier::String("ShapeType")));
paths.push_back(App::ObjectIdentifier(getContainer()) << App::ObjectIdentifier::Component::SimpleComponent(getName())
<< App::ObjectIdentifier::Component::SimpleComponent(App::ObjectIdentifier::String("Orientation")));
paths.push_back(App::ObjectIdentifier(getContainer()) << App::ObjectIdentifier::Component::SimpleComponent(getName())
<< App::ObjectIdentifier::Component::SimpleComponent(App::ObjectIdentifier::String("Length")));
paths.push_back(App::ObjectIdentifier(getContainer()) << App::ObjectIdentifier::Component::SimpleComponent(getName())
<< App::ObjectIdentifier::Component::SimpleComponent(App::ObjectIdentifier::String("Area")));
paths.push_back(App::ObjectIdentifier(getContainer()) << App::ObjectIdentifier::Component::SimpleComponent(getName())
<< App::ObjectIdentifier::Component::SimpleComponent(App::ObjectIdentifier::String("Volume")));
}

void PropertyPartShape::Save (Base::Writer &writer) const
{
if(!writer.isForceXML()) {
Expand Down
3 changes: 3 additions & 0 deletions src/Mod/Part/App/PropertyTopoShape.h
Expand Up @@ -92,6 +92,9 @@ class PartExport PropertyPartShape : public App::PropertyComplexGeoData
unsigned int getMemSize (void) const;
//@}

/// Get valid paths for this property; used by auto completer
virtual void getPaths(std::vector<App::ObjectIdentifier> & paths) const;

private:
TopoShape _Shape;
};
Expand Down

0 comments on commit 3f0fc98

Please sign in to comment.