PartDesignGui Namespace Reference

Namespaces

namespace  Ui
 

Classes

class  CombineSelectionFilterGates
 
class  ComboLinks
 The ComboLinks class is a helper class that binds to a combo box and provides an interface to add links, retrieve links and select items by link value. More...
 
class  DlgActiveBody
 Dialog box to ask user to pick a Part Design body to make active or make a new one. More...
 
class  Module
 
class  NoDependentsSelection
 
class  ReferenceSelection
 
class  StateHandlerTaskPipe
 Convenience class to maintain states between the various task boxes for pipe. More...
 
class  TaskBooleanParameters
 
class  TaskBoxPrimitives
 
class  TaskChamferParameters
 
class  TaskDatumParameters
 
class  TaskDlgBooleanParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgChamferParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgDatumParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgDraftParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgDressUpParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgFeatureParameters
 A common base for sketch based, dressup and other solid parameters dialogs. More...
 
class  TaskDlgFeaturePick
 simulation dialog for the TaskView More...
 
class  TaskDlgFilletParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgHelixParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgHoleParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgLinearPatternParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgLoftParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgMirroredParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgMultiTransformParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgPadParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgPipeParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgPocketParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgPolarPatternParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgRevolutionParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgScaledParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgShapeBinder
 simulation dialog for the TaskView More...
 
class  TaskDlgSketchBasedParameters
 
class  TaskDlgThicknessParameters
 simulation dialog for the TaskView More...
 
class  TaskDlgTransformedParameters
 simulation dialog for the TaskView More...
 
class  TaskDraftParameters
 
class  TaskDressUpParameters
 
class  TaskExtrudeParameters
 
class  TaskFeatureParameters
 Convenience class to collect common methods for all SketchBased features. More...
 
class  TaskFeaturePick
 
class  TaskFilletParameters
 
class  TaskHelixParameters
 
class  TaskHoleParameters
 
class  TaskLinearPatternParameters
 
class  TaskLoftParameters
 
class  TaskMirroredParameters
 
class  TaskMultiTransformParameters
 
class  TaskPadParameters
 
class  TaskPipeOrientation
 
class  TaskPipeParameters
 
class  TaskPipeScaling
 
class  TaskPocketParameters
 
class  TaskPolarPatternParameters
 
class  TaskPrimitiveParameters
 
class  TaskRevolutionParameters
 
class  TaskScaledParameters
 
class  TaskShapeBinder
 
class  TaskSketchBasedParameters
 Convenience class to collect common methods for all SketchBased features. More...
 
class  TaskThicknessParameters
 
class  TaskTransformedMessages
 
class  TaskTransformedParameters
 The transformed subclasses will be used in two different modes: More...
 
class  Ui_DlgActiveBody
 
class  Ui_DlgPrimitives
 
class  Ui_DlgReference
 
class  Ui_TaskBooleanParameters
 
class  Ui_TaskChamferParameters
 
class  Ui_TaskDraftParameters
 
class  Ui_TaskFeaturePick
 
class  Ui_TaskFilletParameters
 
class  Ui_TaskHelixParameters
 
class  Ui_TaskLinearPatternParameters
 
class  Ui_TaskLoftParameters
 
class  Ui_TaskMirroredParameters
 
class  Ui_TaskMultiTransformParameters
 
class  Ui_TaskPadPocketParameters
 
class  Ui_TaskPipeOrientation
 
class  Ui_TaskPipeParameters
 
class  Ui_TaskPipeScaling
 
class  Ui_TaskPolarPatternParameters
 
class  Ui_TaskRevolutionParameters
 
class  Ui_TaskScaledParameters
 
class  Ui_TaskShapeBinder
 
class  Ui_TaskThicknessParameters
 
class  ViewProvider
 A common base class for all part design features view providers. More...
 
class  ViewProviderAddSub
 
class  ViewProviderBase
 
class  ViewProviderBody
 ViewProvider of the Body feature This class manages the visual appearance of the features in the Body feature. More...
 
class  ViewProviderBoolean
 
class  ViewProviderChamfer
 
class  ViewProviderDatum
 
class  ViewProviderDatumCoordinateSystem
 
class  ViewProviderDatumLine
 
class  ViewProviderDatumPlane
 
class  ViewProviderDatumPoint
 
class  ViewProviderDraft
 
class  ViewProviderDressUp
 
class  ViewProviderFillet
 
class  ViewProviderGroove
 
class  ViewProviderHelix
 
class  ViewProviderHole
 
class  ViewProviderLinearPattern
 
class  ViewProviderLoft
 
class  ViewProviderMainPart
 
class  ViewProviderMirrored
 
class  ViewProviderMultiTransform
 
class  ViewProviderPad
 
class  ViewProviderPipe
 
class  ViewProviderPocket
 
class  ViewProviderPolarPattern
 
class  ViewProviderPrimitive
 
class  ViewProviderRevolution
 
class  ViewProviderScaled
 
class  ViewProviderShapeBinder
 
class  ViewProviderSketchBased
 A common base class for Sketch based view providers. More...
 
class  ViewProviderSubShapeBinder
 
class  ViewProviderThickness
 
class  ViewProviderTransformed
 
class  Workbench
 
class  WorkflowManager
 This class controls the workflow of each file. More...
 

Typedefs

typedef Gui::ViewProviderPythonFeatureT< ViewProviderViewProviderPython
 
typedef Gui::ViewProviderPythonFeatureT< ViewProviderSubShapeBinderViewProviderSubShapeBinderPython
 

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::PartassertActivePart ()
 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::PartgetActivePart ()
 
PartDesign::BodygetBody (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::BodygetBodyFor (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::PartgetPartFor (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...
 
PyObjectinitModule ()
 
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::BodymakeBody (App::Document *doc)
 Create a Body object in doc, set it active, and return pointer to it. More...
 
PartDesign::BodymakeBodyActive (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::BodyneedActiveBodyMessage (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 Documentation

◆ ViewProviderPython

◆ ViewProviderSubShapeBinderPython

Enumeration Type Documentation

◆ AllowSelection

enum class PartDesignGui::AllowSelection
strong
Enumerator
NONE 

This is used to indicate to stop the selection.

EDGE 

Allow picking edges.

FACE 

Allow picking faces.

PLANAR 

Allow only linear edges and planar faces.

CIRCLE 

Allow picking circular edges (incl arcs)

POINT 

Allow picking datum points.

OTHERBODY 

Allow picking objects from another body in the same part.

WHOLE 

Allow whole object selection.

◆ Workflow

enum class PartDesignGui::Workflow
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.

Function Documentation

◆ assertActivePart()

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().

◆ assureLegacyWorkflow()

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.

◆ assureModernWorkflow()

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().

◆ buildLinkListPythonStr()

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().

◆ buildLinkSingleSubPythonStr()

◆ buildLinkSubListPythonStr()

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().

◆ buildLinkSubPythonStr()

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().

◆ collectMovableDependencies()

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().

◆ fixSketchSupport()

◆ getActivePart()

◆ getBody()

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.

Parameters
messageIfNot
autoActivate
Returns
Body

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().

◆ getBodyFor()

PartDesign::Body * PartDesignGui::getBodyFor ( const App::DocumentObject ,
bool  messageIfNot,
bool  autoActivate = true,
bool  assertModern = true,
App::DocumentObject **  topParent = nullptr,
std::string *  subname = nullptr 
)

◆ getPartFor()

◆ getReferencedSelection()

◆ getRefStr()

QString PartDesignGui::getRefStr ( const App::DocumentObject obj,
const std::vector< std::string > &  sub 
)

◆ initModule()

PyObject * PartDesignGui::initModule ( )

◆ isAnyNonPartDesignLinksTo()

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().

◆ isFeatureMovable()

◆ isLegacyWorkflow()

bool PartDesignGui::isLegacyWorkflow ( App::Document doc)

◆ isModernWorkflow()

bool PartDesignGui::isModernWorkflow ( App::Document doc)

◆ isPartDesignAwareObjecta()

bool PartDesignGui::isPartDesignAwareObjecta ( App::DocumentObject obj,
bool  respectGroups = false 
)

◆ makeBody()

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().

◆ makeBodyActive()

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.

Parameters
bodythe pointer to the body
docthe pointer to the document in question
topParentand
subnameto 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().

◆ needActiveBodyError()

void PartDesignGui::needActiveBodyError ( void  )

Display error when there are existing Body objects, but none are active.

References Gui::getMainWindow(), and needActiveBodyError().

Referenced by needActiveBodyError().

◆ needActiveBodyMessage()

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.

◆ relinkToBody()

◆ relinkToOrigin()

◆ setEdit()