The CmdSketcherConstraint class Superclass for all sketcher constraints to ease generation of constraint creation modes. More...
Public Member Functions | |
virtual const char * className () const | |
The C++ class name is needed as context for the translation framework. More... | |
CmdSketcherConstraint (const char *name) | |
virtual ~CmdSketcherConstraint () | |
![]() | |
const char * beginCmdHelp (void) | |
returns the begin of a online help page More... | |
const char * endCmdHelp (void) | |
returns the end of a online help page More... | |
virtual const char * getHelpUrl (void) const | |
Get the help URL. More... | |
bool hasActiveDocument (void) const | |
true when there is a document More... | |
bool hasObject (const char *Name) | |
true when there is a document and a Feature with Name More... | |
const char * getAppModuleName (void) const | |
returns the name to which the command belongs More... | |
void setAppModuleName (const char *) | |
const char * getName () const | |
Get the command name. More... | |
const char * getGroupName () const | |
Get the name of the grouping of the command. More... | |
void setGroupName (const char *) | |
void testActive (void) | |
Get somtile called to check the state of the command. More... | |
void setEnabled (bool) | |
Enables or disables the command. More... | |
TriggerSource triggerSource () const | |
Return the current command trigger source. More... | |
void invoke (int index, TriggerSource trigger=TriggerNone) | |
Called to invoke the command. More... | |
void addTo (QWidget *) | |
adds this command to arbitrary widgets More... | |
void addToGroup (ActionGroup *, bool checkable) | |
void addToGroup (ActionGroup *) | |
void adjustCameraPosition () | |
Gui::Document * getActiveGuiDocument (void) const | |
Get pointer to the active gui document. More... | |
App::Document * getDocument (const char *Name=0) const | |
Get pointer to the named or active App document Returns a pointer to the named document or the active document when no name is given. More... | |
bool isViewOfType (Base::Type t) const | |
checks if the active view is of a special type or derived More... | |
App::DocumentObject * getObject (const char *Name) const | |
returns the named feature or the active one from the active document or NULL More... | |
std::string getUniqueObjectName (const char *BaseName, const App::DocumentObject *obj=0) const | |
Get unique Feature name from the active document. More... | |
void languageChange () | |
Translate command. More... | |
void updateAction (int mode) | |
Updates the QAction with respect to the passed mode. More... | |
void setupCheckable (int iMsg) | |
Setup checkable actions based on current TriggerSource. More... | |
const std::string strToPython (const char *Str) | |
translate a string to a python string literal (needed e.g. in file names for windows...) More... | |
const std::string strToPython (const std::string &Str) | |
![]() | |
Action * getAction () const | |
Returns the Action object of this command, or 0 if it doesn't exist. More... | |
virtual const char * getMenuText () const | |
virtual const char * getToolTipText () const | |
virtual const char * getStatusTip () const | |
virtual const char * getWhatsThis () const | |
virtual const char * getPixmap () const | |
virtual const char * getAccel () const | |
void setWhatsThis (const char *) | |
void setMenuText (const char *) | |
void setToolTipText (const char *) | |
void setStatusTip (const char *) | |
void setPixmap (const char *) | |
void setAccel (const char *) | |
Protected Member Functions | |
virtual void activated (int) | |
Methods which gets called when activated, needs to be reimplemented! More... | |
virtual void applyConstraint (std::vector< SelIdPair > &, int) | |
virtual bool isActive (void) | |
Override this method if your Cmd is not always active. More... | |
![]() | |
Command (const char *name) | |
virtual ~Command () | |
virtual Action * createAction (void) | |
Creates the used Action. More... | |
void applyCommandData (const char *context, Action *) | |
Applies the menu text, tool and status tip to the passed action object. More... | |
const char * keySequenceToAccel (int) const | |
![]() | |
CommandBase (const char *sMenu, const char *sToolTip=0, const char *sWhat=0, const char *sStatus=0, const char *sPixmap=0, const char *sAccel=0) | |
virtual ~CommandBase () | |
Protected Attributes | |
std::vector< std::vector< SketcherGui::SelType > > allowedSelSequences | |
allowedSelSequences Each element is a vector representing sequence of selections allowable. More... | |
const char ** constraintCursor = 0 | |
![]() | |
const char * sAppModule | |
const char * sGroup | |
const char * sName | |
const char * sHelpUrl | |
int eType | |
bool bCanLog | |
Indicate if the command shall log to MacroManager. More... | |
![]() | |
const char * sMenuText | |
const char * sToolTipText | |
const char * sWhatsThis | |
const char * sStatusTip | |
const char * sPixmap | |
const char * sAccel | |
std::string displayText | |
Friends | |
class DrawSketchHandlerGenConstraint | |
Additional Inherited Members | |
![]() | |
enum TriggerSource { TriggerNone, TriggerAction, TriggerChildAction } | |
Command trigger source. More... | |
enum DoCmd_Type { Doc, App, Gui } | |
types of application level actions for DoCommand() More... | |
![]() | |
static void blockCommand (bool) | |
Blocks all command objects. More... | |
static void printPyCaller () | |
Print to Python console the current Python calling source file and line number. More... | |
static void printCaller (const char *file, int line) | |
Print to Python console the current calling source file and line number. More... | |
static void addModule (DoCmd_Type eType, const char *sModuleName) | |
import an external (or own) module only once More... | |
static Application * getGuiApplication (void) | |
Get pointer to the Application Window. More... | |
static Gui::SelectionSingleton & getSelection (void) | |
Get a reference to the selection. More... | |
static std::string getObjectCmd (const char *Name, const App::Document *doc=0, const char *prefix=0, const char *postfix=0, bool gui=false) | |
returns a python command string to retrieve an object from a document More... | |
static std::string getObjectCmd (const App::DocumentObject *obj, const char *prefix=0, const char *postfix=0, bool gui=false) | |
returns a python command string to retrieve the given object More... | |
static void openCommand (const char *sName=0) | |
Open a new Undo transaction on the active document. More... | |
static void commitCommand (void) | |
Commit the Undo transaction on the active document. More... | |
static void abortCommand (void) | |
Abort the Undo transaction on the active document. More... | |
static bool hasPendingCommand (void) | |
Check if an Undo transaction is open on the active document. More... | |
static void updateActive (void) | |
Updates the (active) document (propagate changes) More... | |
static void updateAll (std::list< Gui::Document * > cList) | |
Updates the (all or listed) documents (propagate changes) More... | |
static bool isActiveObjectValid (void) | |
Checks if the active object of the active document is valid. More... | |
static std::string getPythonTuple (const std::string &name, const std::vector< std::string > &subnames) | |
Get Python tuple from object and sub-elements. More... | |
![]() | |
enum CmdType { AlterDoc = 1, Alter3DView = 2, AlterSelection = 4, ForEdit = 8, NoTransaction = 16 } | |
Detailed Description
The CmdSketcherConstraint class Superclass for all sketcher constraints to ease generation of constraint creation modes.
Constructor & Destructor Documentation
◆ CmdSketcherConstraint()
CmdSketcherConstraint::CmdSketcherConstraint | ( | const char * | name | ) |
◆ ~CmdSketcherConstraint()
|
virtual |
Member Function Documentation
◆ activated()
|
protectedvirtual |
Methods which gets called when activated, needs to be reimplemented!
Implements Gui::Command.
Reimplemented in CmdSketcherConstrainSymmetric, CmdSketcherConstrainEqual, CmdSketcherConstrainAngle, CmdSketcherConstrainDiameter, CmdSketcherConstrainRadius, CmdSketcherConstrainTangent, CmdSketcherConstrainPerpendicular, CmdSketcherConstrainParallel, CmdSketcherConstrainDistanceY, CmdSketcherConstrainDistanceX, CmdSketcherConstrainPointOnObject, CmdSketcherConstrainDistance, CmdSketcherConstrainCoincident, CmdSketcherConstrainBlock, CmdSketcherConstrainLock, CmdSketcherConstrainVertical, and CmdSketcherConstrainHorizontal.
◆ applyConstraint()
|
protectedvirtual |
Reimplemented in CmdSketcherConstrainSymmetric, CmdSketcherConstrainEqual, CmdSketcherConstrainAngle, CmdSketcherConstrainDiameter, CmdSketcherConstrainRadius, CmdSketcherConstrainTangent, CmdSketcherConstrainPerpendicular, CmdSketcherConstrainParallel, CmdSketcherConstrainDistanceY, CmdSketcherConstrainDistanceX, CmdSketcherConstrainPointOnObject, CmdSketcherConstrainDistance, CmdSketcherConstrainCoincident, CmdSketcherConstrainBlock, CmdSketcherConstrainLock, CmdSketcherConstrainVertical, and CmdSketcherConstrainHorizontal.
◆ className()
|
virtual |
The C++ class name is needed as context for the translation framework.
Implements Gui::CommandBase.
Reimplemented in CmdSketcherConstrainSymmetric, CmdSketcherConstrainEqual, CmdSketcherConstrainAngle, CmdSketcherConstrainDiameter, CmdSketcherConstrainRadius, CmdSketcherConstrainTangent, CmdSketcherConstrainPerpendicular, CmdSketcherConstrainParallel, CmdSketcherConstrainDistanceY, CmdSketcherConstrainDistanceX, CmdSketcherConstrainPointOnObject, CmdSketcherConstrainDistance, CmdSketcherConstrainCoincident, CmdSketcherConstrainBlock, CmdSketcherConstrainLock, CmdSketcherConstrainVertical, and CmdSketcherConstrainHorizontal.
◆ isActive()
|
protectedvirtual |
Override this method if your Cmd is not always active.
Reimplemented from Gui::Command.
Friends And Related Function Documentation
◆ DrawSketchHandlerGenConstraint
|
friend |
Referenced by CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), and CmdSketcherConstrainSymmetric::activated().
Member Data Documentation
◆ allowedSelSequences
|
protected |
allowedSelSequences Each element is a vector representing sequence of selections allowable.
DrawSketchHandlerGenConstraint will use these to filter elements and generate sequences to be passed to applyConstraint(). Whenever any sequence is completed, applyConstraint() is called, so it's best to keep them prefix-free. Be mindful that when SelVertex and SelRoot are given preference over SelVertexOrRoot, and similar for edges/axes. Thus if a vertex is selected when SelVertex and SelVertexOrRoot are both applicable, only sequences with SelVertex will be continue.
TODO: Introduce structs to allow keeping first selection
Referenced by CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), CmdSketcherConstrainVertical::CmdSketcherConstrainVertical(), and DrawSketchHandlerGenConstraint::resetOngoingSequences().
◆ constraintCursor
|
protected |
Referenced by CmdSketcherConstrainHorizontal::activated(), CmdSketcherConstrainVertical::activated(), CmdSketcherConstrainLock::activated(), CmdSketcherConstrainBlock::activated(), CmdSketcherConstrainCoincident::activated(), CmdSketcherConstrainDistance::activated(), CmdSketcherConstrainPointOnObject::activated(), CmdSketcherConstrainDistanceX::activated(), CmdSketcherConstrainDistanceY::activated(), CmdSketcherConstrainParallel::activated(), CmdSketcherConstrainPerpendicular::activated(), CmdSketcherConstrainTangent::activated(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainAngle::activated(), CmdSketcherConstrainEqual::activated(), CmdSketcherConstrainSymmetric::activated(), CmdSketcherConstrainAngle::CmdSketcherConstrainAngle(), CmdSketcherConstrainBlock::CmdSketcherConstrainBlock(), CmdSketcherConstrainCoincident::CmdSketcherConstrainCoincident(), CmdSketcherConstrainDiameter::CmdSketcherConstrainDiameter(), CmdSketcherConstrainDistance::CmdSketcherConstrainDistance(), CmdSketcherConstrainDistanceX::CmdSketcherConstrainDistanceX(), CmdSketcherConstrainDistanceY::CmdSketcherConstrainDistanceY(), CmdSketcherConstrainEqual::CmdSketcherConstrainEqual(), CmdSketcherConstrainHorizontal::CmdSketcherConstrainHorizontal(), CmdSketcherConstrainLock::CmdSketcherConstrainLock(), CmdSketcherConstrainParallel::CmdSketcherConstrainParallel(), CmdSketcherConstrainPerpendicular::CmdSketcherConstrainPerpendicular(), CmdSketcherConstrainPointOnObject::CmdSketcherConstrainPointOnObject(), CmdSketcherConstrainRadius::CmdSketcherConstrainRadius(), CmdSketcherConstrainSymmetric::CmdSketcherConstrainSymmetric(), CmdSketcherConstrainTangent::CmdSketcherConstrainTangent(), and CmdSketcherConstrainVertical::CmdSketcherConstrainVertical().
The documentation for this class was generated from the following file:
- src/Mod/Sketcher/Gui/CommandConstraints.cpp