Part: Added getPaths(...) method to PropertyPartShape.

This commit is contained in:
Eivind Kvedalen
2015-09-16 19:11:00 +02:00
committed by wmayer
parent a45a663655
commit 9f452674fd
2 changed files with 18 additions and 0 deletions

View File

@@ -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"
@@ -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()) {

View File

@@ -92,6 +92,9 @@ public:
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;
};