| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #ifndef GUI_ReferenceSelection_H
|
| | #define GUI_ReferenceSelection_H
|
| |
|
| | #include <Gui/Selection/SelectionFilter.h>
|
| | #include <Mod/PartDesign/Gui/EnumFlags.h>
|
| |
|
| | namespace App
|
| | {
|
| | class OriginGroupExtension;
|
| | }
|
| | namespace PartDesign
|
| | {
|
| | class Body;
|
| | }
|
| | namespace PartDesignGui
|
| | {
|
| |
|
| | class ReferenceSelection: public Gui::SelectionFilterGate
|
| | {
|
| | const App::DocumentObject* support;
|
| | AllowSelectionFlags type;
|
| |
|
| | public:
|
| | ReferenceSelection(const App::DocumentObject* support_, AllowSelectionFlags type)
|
| | : Gui::SelectionFilterGate(nullPointer())
|
| | , support(support_)
|
| | , type(type)
|
| | {}
|
| | |
| | |
| | |
| |
|
| | bool allow(App::Document* pDoc, App::DocumentObject* pObj, const char* sSubName) override;
|
| |
|
| | private:
|
| | PartDesign::Body* getBody() const;
|
| | App::OriginGroupExtension* getOriginGroupExtension(PartDesign::Body* body) const;
|
| | bool allowOrigin(
|
| | PartDesign::Body* body,
|
| | App::OriginGroupExtension* originGroup,
|
| | App::DocumentObject* pObj
|
| | ) const;
|
| | bool allowDatum(PartDesign::Body* body, App::DocumentObject* pObj) const;
|
| | bool allowPartFeature(App::DocumentObject* pObj, const char* sSubName) const;
|
| | bool isEdge(App::DocumentObject* pObj, const char* sSubName) const;
|
| | bool isFace(App::DocumentObject* pObj, const char* sSubName) const;
|
| | bool isCircle(App::DocumentObject* pObj, const char* sSubName) const;
|
| | };
|
| |
|
| | class NoDependentsSelection: public Gui::SelectionFilterGate
|
| | {
|
| | const App::DocumentObject* support;
|
| |
|
| | public:
|
| | NoDependentsSelection(const App::DocumentObject* support_)
|
| | : Gui::SelectionFilterGate(nullPointer())
|
| | , support(support_)
|
| | {}
|
| | |
| | |
| |
|
| | bool allow(App::Document* pDoc, App::DocumentObject* pObj, const char* sSubName) override;
|
| | };
|
| |
|
| | class CombineSelectionFilterGates: public Gui::SelectionFilterGate
|
| | {
|
| | std::unique_ptr<Gui::SelectionFilterGate> filter1;
|
| | std::unique_ptr<Gui::SelectionFilterGate> filter2;
|
| |
|
| | public:
|
| | CombineSelectionFilterGates(
|
| | std::unique_ptr<Gui::SelectionFilterGate>& filter1_,
|
| | std::unique_ptr<Gui::SelectionFilterGate>& filter2_
|
| | )
|
| | : Gui::SelectionFilterGate(nullPointer())
|
| | , filter1(std::move(filter1_))
|
| | , filter2(std::move(filter2_))
|
| | {}
|
| | bool allow(App::Document* pDoc, App::DocumentObject* pObj, const char* sSubName) override;
|
| | };
|
| |
|
| |
|
| | bool getReferencedSelection(
|
| | const App::DocumentObject* thisObj,
|
| | const Gui::SelectionChanges& msg,
|
| | App::DocumentObject*& selObj,
|
| | std::vector<std::string>& selSub
|
| | );
|
| |
|
| | QString getRefStr(const App::DocumentObject* obj, const std::vector<std::string>& sub);
|
| |
|
| | std::string buildLinkSubPythonStr(const App::DocumentObject* obj, const std::vector<std::string>& subs);
|
| |
|
| | std::string buildLinkSingleSubPythonStr(
|
| | const App::DocumentObject* obj,
|
| | const std::vector<std::string>& subs
|
| | );
|
| |
|
| | std::string buildLinkListPythonStr(const std::vector<App::DocumentObject*>& objs);
|
| |
|
| | std::string buildLinkSubListPythonStr(
|
| | const std::vector<App::DocumentObject*>& objs,
|
| | const std::vector<std::string>& subs
|
| | );
|
| | }
|
| |
|
| | #endif
|
| |
|