Namespaces | |
| namespace | Ui |
Typedefs | |
| typedef Gui::ViewProviderPythonFeatureT< ViewProvider > | ViewProviderPython |
| typedef Gui::ViewProviderPythonFeatureT< ViewProviderSubShapeBinder > | ViewProviderSubShapeBinderPython |
Enumerations | |
| enum class | AllowSelection { NONE = 0 , EDGE = 1 << 0 , FACE = 1 << 1 , PLANAR = 1 << 2 , CIRCLE = 1 << 3 , POINT = 1 << 4 , OTHERBODY = 1 << 5 , WHOLE = 1 << 6 } |
| enum class | Workflow { Undetermined = 0 , Legacy = 1<<0 , Modern = 1<<1 } |
| Defines allowded tool set provided by the workbench Legacy mode provides a free PartDesign features but forbids bodies and parts. More... | |
Functions | |
| App::Part * | assertActivePart () |
| Returns active part, if there is no such, creates a new part, if it fails, shows a message. More... | |
| bool | assureLegacyWorkflow (App::Document *doc) |
| Assures that workflow of the given document is determined and returns true if it is Workflow::Legacy. More... | |
| bool | assureModernWorkflow (App::Document *doc) |
| Assures that workflow of the given document is determined and returns true if it is Workflow::Modern. More... | |
| std::string | buildLinkListPythonStr (const std::vector< App::DocumentObject * > &objs) |
| Return reference as string for python in the format [obj1, obj2, ...,]. More... | |
| std::string | buildLinkSingleSubPythonStr (const App::DocumentObject *obj, const std::vector< std::string > &subs) |
| Return reference as string for python in the format (<obj> ["sub"?]) More... | |
| std::string | buildLinkSubListPythonStr (const std::vector< App::DocumentObject * > &objs, const std::vector< std::string > &subs) |
| Returns sub reference list as a python string in the format [(obj1,"sub1"),(obj2,"sub2"),...]. More... | |
| std::string | buildLinkSubPythonStr (const App::DocumentObject *obj, const std::vector< std::string > &subs) |
| Return reference as string for python in the format (<obj> ["sub1", "sub2", ...]) More... | |
| std::vector< App::DocumentObject * > | collectMovableDependencies (std::vector< App::DocumentObject * > &features) |
| Collect dependencies of the features during the move. Dependencies should only be dependent on origin. More... | |
| void | fixSketchSupport (Sketcher::SketchObject *sketch) |
| Fix sketch support after moving a free sketch into a body. More... | |
| App::Part * | getActivePart () |
| PartDesign::Body * | getBody (bool messageIfNot, bool autoActivate, bool assertModern, App::DocumentObject **topParent, std::string *subname) |
| Return active body or show a warning message. If autoActivate is true (the default) then if there is only single body in the document it will be activated. More... | |
| PartDesign::Body * | getBodyFor (const App::DocumentObject *, bool messageIfNot, bool autoActivate=true, bool assertModern=true, App::DocumentObject **topParent=nullptr, std::string *subname=nullptr) |
| Finds a body for the given feature. More... | |
| App::Part * | getPartFor (const App::DocumentObject *obj, bool messageIfNot) |
| bool | getReferencedSelection (const App::DocumentObject *thisObj, const Gui::SelectionChanges &msg, App::DocumentObject *&selObj, std::vector< std::string > &selSub) |
| Extract reference from Selection. More... | |
| QString | getRefStr (const App::DocumentObject *obj, const std::vector< std::string > &sub) |
| Return reference as string for UI elements (format <obj>:<subelement> More... | |
| PyObject * | initModule () |
| bool | isAnyNonPartDesignLinksTo (PartDesign::Feature *feature, bool respectGroups=false) |
| Returns true if document has any non-PartDesign objects that links to the given object. More... | |
| bool | isFeatureMovable (App::DocumentObject *feature) |
| Check if feature is dependent on anything except movable sketches and datums. More... | |
| bool | isLegacyWorkflow (App::Document *doc) |
| Returns true if the workflow of the given document is Workflow::Legacy. More... | |
| bool | isModernWorkflow (App::Document *doc) |
| Returns true if the workflow of the given document is Workflow::Modern. More... | |
| bool | isPartDesignAwareObjecta (App::DocumentObject *obj, bool respectGroups=false) |
| PartDesign::Body * | makeBody (App::Document *doc) |
| Create a Body object in doc, set it active, and return pointer to it. More... | |
| PartDesign::Body * | makeBodyActive (App::DocumentObject *body, App::Document *doc, App::DocumentObject **topParent=nullptr, std::string *subname=nullptr) |
| Set given body active, and return pointer to it. More... | |
| void | needActiveBodyError (void) |
| Display error when there are existing Body objects, but none are active. More... | |
| PartDesign::Body * | needActiveBodyMessage (App::Document *doc, const QString &infoText=QString()) |
| Display a dialog to select or create a Body object when none is active. More... | |
| void | relinkToBody (PartDesign::Feature *feature) |
| Relink all nonPartDesign features to the body instead of the given partDesign Feature. More... | |
| void | relinkToOrigin (App::DocumentObject *feature, PartDesign::Body *body) |
| Relink sketches and datums to target body's origin. More... | |
| bool | setEdit (App::DocumentObject *obj, PartDesign::Body *body=nullptr) |
| Activate edit mode of the given object. More... | |
| typedef Gui::ViewProviderPythonFeatureT<ViewProviderSubShapeBinder> PartDesignGui::ViewProviderSubShapeBinderPython |
|
strong |
|
strong |
Defines allowded tool set provided by the workbench Legacy mode provides a free PartDesign features but forbids bodies and parts.
| Enumerator | |
|---|---|
| Undetermined | No workflow was chosen yet. |
| Legacy | Old-style workflow with free features and no bodies. |
| Modern | New-style workflow with bodies, parts etc. |
| App::Part * PartDesignGui::assertActivePart | ( | ) |
Returns active part, if there is no such, creates a new part, if it fails, shows a message.
References Gui::Application::activeView(), Gui::Application::commandManager(), Gui::MDIView::getActiveObject(), Gui::Application::Instance, and Gui::CommandManager::runCommandByName().
| bool PartDesignGui::assureLegacyWorkflow | ( | App::Document * | doc | ) |
Assures that workflow of the given document is determined and returns true if it is Workflow::Legacy.
References PartDesignGui::WorkflowManager::determineWorkflow(), PartDesignGui::WorkflowManager::instance(), and Legacy.
| bool PartDesignGui::assureModernWorkflow | ( | App::Document * | doc | ) |
Assures that workflow of the given document is determined and returns true if it is Workflow::Modern.
References PartDesignGui::WorkflowManager::determineWorkflow(), PartDesignGui::WorkflowManager::instance(), and Modern.
Referenced by getBody().
| std::string PartDesignGui::buildLinkListPythonStr | ( | const std::vector< App::DocumentObject * > & | objs | ) |
Return reference as string for python in the format [obj1, obj2, ...,].
References Gui::Command::getObjectCmd().
Referenced by relinkToBody().
| std::string PartDesignGui::buildLinkSingleSubPythonStr | ( | const App::DocumentObject * | obj, |
| const std::vector< std::string > & | subs | ||
| ) |
Return reference as string for python in the format (<obj> ["sub"?])
References Gui::Command::getObjectCmd(), and PartDesign::Feature::isDatum().
Referenced by PartDesignGui::TaskDlgDraftParameters::accept(), PartDesignGui::TaskDlgMirroredParameters::accept(), PartDesignGui::TaskLinearPatternParameters::apply(), PartDesignGui::TaskPolarPatternParameters::apply(), PartDesignGui::TaskHelixParameters::apply(), PartDesignGui::TaskRevolutionParameters::apply(), and PartDesignGui::TaskExtrudeParameters::getReferenceAxis().
| std::string PartDesignGui::buildLinkSubListPythonStr | ( | const std::vector< App::DocumentObject * > & | objs, |
| const std::vector< std::string > & | subs | ||
| ) |
Returns sub reference list as a python string in the format [(obj1,"sub1"),(obj2,"sub2"),...].
References Gui::Command::getObjectCmd().
Referenced by relinkToBody().
| std::string PartDesignGui::buildLinkSubPythonStr | ( | const App::DocumentObject * | obj, |
| const std::vector< std::string > & | subs | ||
| ) |
Return reference as string for python in the format (<obj> ["sub1", "sub2", ...])
Referenced by relinkToBody().
| std::vector< App::DocumentObject * > PartDesignGui::collectMovableDependencies | ( | std::vector< App::DocumentObject * > & | features | ) |
Collect dependencies of the features during the move. Dependencies should only be dependent on origin.
References collectMovableDependencies(), Base::Persistence::getClassTypeId(), Base::Persistence::getTypeId(), and Base::Type::isDerivedFrom().
Referenced by collectMovableDependencies(), and PartDesignGui::ViewProviderBody::dropObject().
| void PartDesignGui::fixSketchSupport | ( | Sketcher::SketchObject * | sketch | ) |
Fix sketch support after moving a free sketch into a body.
References fixSketchSupport(), Base::Vector3< _Precision >::GetAngle(), getBodyFor(), App::DocumentObject::getDocument(), Attacher::AttachEngine::getModeName(), Gui::Command::getObjectCmd(), App::OriginGroupExtension::getOrigin(), Base::Placement::getPosition(), Base::Placement::getRotation(), App::PropertyLinkSubList::getValue(), App::PropertyPlacement::getValue(), App::Origin::getXY(), App::Origin::getXZ(), App::Origin::getYZ(), Attacher::mmFlatFace, Base::Rotation::multVec(), App::GeoFeature::Placement, Part::AttachExtension::Support, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by PartDesignGui::TaskFeaturePick::buildFeatures(), and fixSketchSupport().
| App::Part * PartDesignGui::getActivePart | ( | ) |
References Gui::Application::activeView(), Gui::MDIView::getActiveObject(), getActivePart(), and Gui::Application::Instance.
Referenced by PartDesignGui::ViewProviderBody::canDropObject(), and getActivePart().
| PartDesign::Body * PartDesignGui::getBody | ( | bool | messageIfNot, |
| bool | autoActivate, | ||
| bool | assertModern, | ||
| App::DocumentObject ** | topParent, | ||
| std::string * | subname | ||
| ) |
Return active body or show a warning message. If autoActivate is true (the default) then if there is only single body in the document it will be activated.
Return active body or show a warning message.
| messageIfNot | |
| autoActivate |
References Gui::Application::activeView(), assureModernWorkflow(), PartDesignGui::DlgActiveBody::getActiveBody(), Gui::MDIView::getActiveObject(), Gui::BaseView::getAppDocument(), getBody(), Base::Persistence::getClassTypeId(), Gui::getMainWindow(), Gui::Application::Instance, and makeBodyActive().
Referenced by PartDesignGui::TaskFeaturePick::buildFeatures(), getBody(), and getBodyFor().
| PartDesign::Body * PartDesignGui::getBodyFor | ( | const App::DocumentObject * | , |
| bool | messageIfNot, | ||
| bool | autoActivate = true, |
||
| bool | assertModern = true, |
||
| App::DocumentObject ** | topParent = nullptr, |
||
| std::string * | subname = nullptr |
||
| ) |
Finds a body for the given feature.
And shows a message if not found Also unlike Body::findBodyFor it checks if the active body has the feature first.
References PartDesign::Body::findBodyOf(), getBody(), getBodyFor(), Gui::getMainWindow(), and App::OriginGroupExtension::hasObject().
Referenced by PartDesignGui::TaskDlgDatumParameters::accept(), PartDesignGui::TaskPipeParameters::accept(), PartDesignGui::TaskFeaturePick::buildFeatures(), PartDesignGui::ViewProviderDatum::doubleClicked(), fixSketchSupport(), getBodyFor(), getPartFor(), getReferencedSelection(), setEdit(), and PartDesignGui::Workbench::setupContextMenu().
| App::Part * PartDesignGui::getPartFor | ( | const App::DocumentObject * | obj, |
| bool | messageIfNot | ||
| ) |
| bool PartDesignGui::getReferencedSelection | ( | const App::DocumentObject * | thisObj, |
| const Gui::SelectionChanges & | msg, | ||
| App::DocumentObject *& | selObj, | ||
| std::vector< std::string > & | selSub | ||
| ) |
Extract reference from Selection.
References PartDesign::Body::addObject(), getBodyFor(), Base::Persistence::getClassTypeId(), App::DocumentObject::getDocument(), Gui::getMainWindow(), App::Document::getName(), App::Document::getObject(), PartDesign::Feature::isDatum(), Base::BaseClass::isDerivedFrom(), PartDesignGui::TaskFeaturePick::makeCopy(), App::Document::openTransaction(), PartDesignGui::Ui_DlgReference::radioIndependent, PartDesignGui::Ui_DlgReference::radioXRef, and PartDesignGui::Ui_DlgReference::setupUi().
Referenced by PartDesignGui::TaskDraftParameters::onSelectionChanged(), PartDesignGui::TaskLinearPatternParameters::onSelectionChanged(), PartDesignGui::TaskMirroredParameters::onSelectionChanged(), PartDesignGui::TaskPolarPatternParameters::onSelectionChanged(), PartDesignGui::TaskHelixParameters::onSelectionChanged(), and PartDesignGui::TaskRevolutionParameters::onSelectionChanged().
| QString PartDesignGui::getRefStr | ( | const App::DocumentObject * | obj, |
| const std::vector< std::string > & | sub | ||
| ) |
Return reference as string for UI elements (format <obj>:<subelement>
References PartDesign::Feature::isDatum().
Referenced by PartDesignGui::TaskRevolutionParameters::fillAxisCombo(), PartDesignGui::TaskExtrudeParameters::fillDirectionCombo(), PartDesignGui::TaskDraftParameters::onSelectionChanged(), and PartDesignGui::TaskDraftParameters::TaskDraftParameters().
| PyObject * PartDesignGui::initModule | ( | ) |
References Base::InterpreterSingleton::addModule(), and Base::Interpreter().
| bool PartDesignGui::isAnyNonPartDesignLinksTo | ( | PartDesign::Feature * | feature, |
| bool | respectGroups = false |
||
| ) |
Returns true if document has any non-PartDesign objects that links to the given object.
If respectGroups is true don't count links from App::GeoFeatureGroup-derived objects (default is false)
References DraftVecUtils::find(), Base::Persistence::getClassTypeId(), App::DocumentObject::getDocument(), App::PropertyContainer::getPropertyList(), isAnyNonPartDesignLinksTo(), and isPartDesignAwareObjecta().
Referenced by isAnyNonPartDesignLinksTo().
| bool PartDesignGui::isFeatureMovable | ( | App::DocumentObject *const | feat | ) |
Check if feature is dependent on anything except movable sketches and datums.
References Base::Persistence::getClassTypeId(), App::ExtensionContainer::getExtensionByType(), Base::Persistence::getTypeId(), PartDesign::ProfileBased::getVerifiedSketch(), App::ExtensionContainer::hasExtension(), Base::Type::isDerivedFrom(), and isFeatureMovable().
Referenced by PartDesignGui::ViewProviderBody::dropObject(), and isFeatureMovable().
| bool PartDesignGui::isLegacyWorkflow | ( | App::Document * | doc | ) |
Returns true if the workflow of the given document is Workflow::Legacy.
References PartDesignGui::WorkflowManager::getWorkflowForDocument(), PartDesignGui::WorkflowManager::instance(), and Legacy.
| bool PartDesignGui::isModernWorkflow | ( | App::Document * | doc | ) |
Returns true if the workflow of the given document is Workflow::Modern.
References PartDesignGui::WorkflowManager::getWorkflowForDocument(), PartDesignGui::WorkflowManager::instance(), and Modern.
Referenced by PartDesignGui::Workbench::setupContextMenu().
| bool PartDesignGui::isPartDesignAwareObjecta | ( | App::DocumentObject * | obj, |
| bool | respectGroups = false |
||
| ) |
References Base::Persistence::getClassTypeId(), PartDesign::Body::isAllowed(), and isPartDesignAwareObjecta().
Referenced by isAnyNonPartDesignLinksTo(), isPartDesignAwareObjecta(), and relinkToBody().
| PartDesign::Body * PartDesignGui::makeBody | ( | App::Document * | doc | ) |
Create a Body object in doc, set it active, and return pointer to it.
References Gui::Command::Doc, makeBody(), and makeBodyActive().
Referenced by PartDesignGui::DlgActiveBody::accept(), and makeBody().
| PartDesign::Body * PartDesignGui::makeBodyActive | ( | App::DocumentObject * | body, |
| App::Document * | doc, | ||
| App::DocumentObject ** | topParent = nullptr, |
||
| std::string * | subname = nullptr |
||
| ) |
Set given body active, and return pointer to it.
| body | the pointer to the body |
| doc | the pointer to the document in question |
| topParent | and |
| subname | to be passed under certain circumstances (currently only subshapebinder) |
References Gui::Application::activeView(), App::DocumentObject::getDocument(), Gui::Command::getObjectCmd(), App::DocumentObject::getParents(), Gui::Application::Instance, and makeBodyActive().
Referenced by PartDesignGui::DlgActiveBody::accept(), getBody(), makeBody(), and makeBodyActive().
| void PartDesignGui::needActiveBodyError | ( | void | ) |
Display error when there are existing Body objects, but none are active.
References Gui::getMainWindow(), and needActiveBodyError().
Referenced by needActiveBodyError().
| PartDesign::Body * PartDesignGui::needActiveBodyMessage | ( | App::Document * | doc, |
| const QString & | infoText = QString() |
||
| ) |
Display a dialog to select or create a Body object when none is active.
| void PartDesignGui::relinkToBody | ( | PartDesign::Feature * | feature | ) |
Relink all nonPartDesign features to the body instead of the given partDesign Feature.
References buildLinkListPythonStr(), buildLinkSubListPythonStr(), buildLinkSubPythonStr(), PartDesign::Body::findBodyOf(), Base::Persistence::getClassTypeId(), App::DocumentObject::getDocument(), Gui::Command::getObjectCmd(), App::PropertyLinkSub::getSubValues(), App::PropertyLinkSubList::getSubValues(), App::PropertyLink::getValue(), App::PropertyLinkSub::getValue(), App::PropertyListsT< T, ListT, ParentT >::getValues(), App::PropertyLinkSubList::getValues(), isPartDesignAwareObjecta(), and relinkToBody().
Referenced by relinkToBody().
| void PartDesignGui::relinkToOrigin | ( | App::DocumentObject * | feat, |
| PartDesign::Body * | targetbody | ||
| ) |
Relink sketches and datums to target body's origin.
References Base::Persistence::getClassTypeId(), App::ExtensionContainer::getExtensionByType(), App::OriginGroupExtension::getOrigin(), App::Origin::getOriginFeature(), Base::Persistence::getTypeId(), App::ExtensionContainer::hasExtension(), Base::Type::isDerivedFrom(), and relinkToOrigin().
Referenced by relinkToOrigin().
| bool PartDesignGui::setEdit | ( | App::DocumentObject * | obj, |
| PartDesign::Body * | body | ||
| ) |
Activate edit mode of the given object.
References Gui::Application::activeView(), Gui::cmdGuiDocument(), getBodyFor(), App::DocumentObject::getNameInDocument(), Gui::Command::getObjectCmd(), Gui::Application::Instance, and setEdit().
Referenced by PartDesignGui::ViewProviderDatum::doubleClicked(), and setEdit().