Gui::Document Class Reference

The Gui Document This is the document on GUI level. More...

#include <Document.h>

Public Member Functions

 Document (App::Document *pcDocument, Application *app)
 
 ~Document ()
 
methods for View handling
Gui::MDIViewgetActiveView (void) const
 Getter for the active view. More...
 
void setActiveWindow (Gui::MDIView *view)
 Document::setActiveWindow If this document is active and the view is part of it then it will be activated. More...
 
Gui::MDIViewgetEditingViewOfViewProvider (Gui::ViewProvider *) const
 
Gui::MDIViewgetViewOfViewProvider (const Gui::ViewProvider *) const
 
Gui::MDIViewgetViewOfNode (SoNode *) const
 
MDIViewcreateView (const Base::Type &typeId)
 Create a new view. More...
 
Gui::MDIViewcloneView (Gui::MDIView *)
 Create a clone of the given view. More...
 
bool sendMsgToViews (const char *pMsg)
 send messages to the active view Send a specific massage to the active view and is able to receive a return message More...
 
bool sendMsgToFirstView (const Base::Type &typeId, const char *pMsg, const char **ppReturn)
 Sends the message pMsg to the views of type typeid and stops with the first view that supports the message and returns ppReturn. More...
 
void attachView (Gui::BaseView *pcView, bool bPassiv=false)
 Attach a view (get called by the MDIView constructor) More...
 
void detachView (Gui::BaseView *pcView, bool bPassiv=false)
 Detach a view (get called by the MDIView destructor) More...
 
ViewProviderDocumentObjectgetViewProviderByPathFromTail (SoPath *path) const
 helper for selection More...
 
ViewProviderDocumentObjectgetViewProviderByPathFromHead (SoPath *path) const
 helper for selection More...
 
std::vector< std::pair< ViewProviderDocumentObject *, int > > getViewProvidersByPath (SoPath *path) const
 Get all view providers along the path and the corresponding node index in the path. More...
 
void onUpdate (void)
 call update on all attached views More...
 
void onRelabel (void)
 call relabel to all attached views More...
 
std::list< MDIView * > getMDIViews () const
 returns a list of all attached MDI views More...
 
std::list< MDIView * > getMDIViewsOfType (const Base::Type &typeId) const
 returns a list of all MDI views of a certain type More...
 
MDIViewsetActiveView (ViewProviderDocumentObject *vp=nullptr, Base::Type typeId=Base::Type())
 
View provider handling <br>
ViewProvidergetViewProvider (const App::DocumentObject *) const
 Get the view provider for that object. More...
 
ViewProviderDocumentObjectgetViewProvider (SoNode *node) const
 
void setAnnotationViewProvider (const char *name, ViewProvider *pcProvider)
 set an annotation view provider More...
 
ViewProvidergetAnnotationViewProvider (const char *name) const
 get an annotation view provider More...
 
void removeAnnotationViewProvider (const char *name)
 remove an annotation view provider More...
 
bool isShow (const char *name)
 test if the feature is in show More...
 
void setShow (const char *name)
 put the feature in show More...
 
void setHide (const char *name)
 set the feature in Noshow More...
 
void setPos (const char *name, const Base::Matrix4D &rclMtrx)
 set the feature transformation (only viewing) More...
 
std::vector< ViewProvider * > getViewProvidersOfType (const Base::Type &typeId) const
 
ViewProvidergetViewProviderByName (const char *name) const
 
bool setEdit (Gui::ViewProvider *p, int ModNum=0, const char *subname=nullptr)
 set the ViewProvider in special edit mode More...
 
const Base::Matrix4DgetEditingTransform () const
 
void setEditingTransform (const Base::Matrix4D &mat)
 
void resetEdit (void)
 reset from edit mode, this cause all document to reset edit More...
 
ViewProvidergetInEdit (ViewProviderDocumentObject **parentVp=nullptr, std::string *subname=nullptr, int *mode=nullptr, std::string *subElement=nullptr) const
 get the in edit ViewProvider or NULL More...
 
void setInEdit (ViewProviderDocumentObject *parentVp, const char *subname)
 set the in edit ViewProvider subname reference More...
 
void toggleInSceneGraph (ViewProvider *vp)
 Add or remove view provider from scene graphs of all views. More...
 
- Public Member Functions inherited from Base::Persistence
void dumpToStream (std::ostream &stream, int compression)
 
virtual unsigned int getMemSize () const =0
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More...
 
virtual Base::Type getTypeId (void) const
 
virtual void Restore (XMLReader &)=0
 This method is used to restore properties from an XML document. More...
 
virtual void RestoreDocFile (Reader &)
 This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More...
 
void restoreFromStream (std::istream &stream)
 
virtual void Save (Writer &) const =0
 This method is used to save properties to an XML document. More...
 
virtual void SaveDocFile (Writer &) const
 This method is used to save large amounts of data to a binary file. More...
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
 BaseClass (const BaseClass &)=default
 
virtual PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
 
virtual Type getTypeId () const
 
bool isDerivedFrom (const Type type) const
 
BaseClassoperator= (const BaseClass &)=default
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 

Public Attributes

Signals of the document
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalNewObject
 signal on new Object More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalDeletedObject
 signal on deleted Object More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &, const App::Property &)> signalChangedObject
 signal on changed Object, the 2nd argument is the changed property of the referenced document object, not of the view provider More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalRelabelObject
 signal on renamed Object More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalActivatedObject
 signal on activated Object More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalInEdit
 signal on entering in edit mode More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalResetEdit
 signal on leaving edit mode More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &, const Gui::HighlightMode &, bool, App::DocumentObject *parent, const char *subname)> signalHighlightObject
 signal on changed Object, the 2nd argument is the highlite mode to use More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &, const Gui::TreeItemMode &, App::DocumentObject *parent, const char *subname)> signalExpandObject
 signal on changed Object, the 2nd argument is the highlite mode to use More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalShowItem
 signal on changed ShowInTree property in view provider More...
 
boost::signals2::signal< void(const Gui::ViewProviderDocumentObject &)> signalScrollToObject
 signal on scrolling to an object More...
 
boost::signals2::signal< void(const Gui::Document &doc)> signalUndoDocument
 signal on undo Document More...
 
boost::signals2::signal< void(const Gui::Document &doc)> signalRedoDocument
 signal on redo Document More...
 
boost::signals2::signal< void(const Gui::Document &doc)> signalDeleteDocument
 signal on deleting Document More...
 

methods for the UNDO REDO handling

void openCommand (const char *sName=nullptr)
 Open a new Undo transaction on the document. More...
 
void commitCommand (void)
 Commit the Undo transaction on the document. More...
 
void abortCommand (void)
 Abort the Undo transaction on the document. More...
 
bool hasPendingCommand (void) const
 Check if an Undo transaction is open. More...
 
std::vector< std::string > getUndoVector (void) const
 Get an Undo string vector with the Undo names. More...
 
std::vector< std::string > getRedoVector (void) const
 Get an Redo string vector with the Redo names. More...
 
void undo (int iSteps)
 Will UNDO one or more steps. More...
 
void redo (int iSteps)
 Will REDO one or more steps. More...
 
bool isPerformingTransaction () const
 Check if the document is performing undo/redo transaction. More...
 
bool canClose (bool checkModify=true, bool checkLink=false)
 handles the application close event More...
 
bool isLastView (void)
 
void beforeDelete ()
 called by Application before being deleted More...
 
virtual PyObjectgetPyObject (void)
 This method returns the Python wrapper for a C++ object. More...
 
const char * getCameraSettings () const
 
bool saveCameraSettings (const char *) const
 

attributes for the UNDO REDO facility

class TransactionViewProvider
 

I/O of the document

unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More...
 
bool save (void)
 Save the document. More...
 
bool saveAs (void)
 Save the document under a new file name. More...
 
bool saveCopy (void)
 Save a copy of the document under a new file name. More...
 
virtual void Save (Base::Writer &writer) const
 This method is used to save properties or very small amounts of data to an XML document. More...
 
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document. More...
 
virtual void SaveDocFile (Base::Writer &writer) const
 This method is used to save large amounts of data to a binary file. More...
 
virtual void RestoreDocFile (Base::Reader &reader)
 This method is used to restore large amounts of data from a binary file. More...
 
void exportObjects (const std::vector< App::DocumentObject * > &, Base::Writer &)
 
void importObjects (const std::vector< App::DocumentObject * > &, Base::Reader &, const std::map< std::string, std::string > &nameMapping)
 
void addRootObjectsToGroup (const std::vector< App::DocumentObject * > &, App::DocumentObjectGroup *)
 Add all root objects of the given array to a group. More...
 
void setModified (bool)
 Observer message from the App doc. More...
 
bool isModified () const
 
App::DocumentgetDocument (void) const
 Getter for the App Document. More...
 
void slotNewObject (const App::DocumentObject &)
 This slot is connected to the App::Document::signalNewObject(...) More...
 
void slotDeletedObject (const App::DocumentObject &)
 
void slotChangedObject (const App::DocumentObject &, const App::Property &)
 
void slotRelabelObject (const App::DocumentObject &)
 
void slotTransactionAppend (const App::DocumentObject &, App::Transaction *)
 
void slotTransactionRemove (const App::DocumentObject &, App::Transaction *)
 
void slotActivatedObject (const App::DocumentObject &)
 
void slotStartRestoreDocument (const App::Document &)
 
void slotFinishRestoreDocument (const App::Document &)
 
void slotUndoDocument (const App::Document &)
 
void slotRedoDocument (const App::Document &)
 
void slotShowHidden (const App::Document &)
 
void slotFinishImportObjects (const std::vector< App::DocumentObject * > &)
 
void slotFinishRestoreObject (const App::DocumentObject &obj)
 
void slotRecomputed (const App::Document &)
 
void slotSkipRecompute (const App::Document &doc, const std::vector< App::DocumentObject * > &objs)
 
void slotTouchedObject (const App::DocumentObject &)
 
void slotChangePropertyEditor (const App::Document &, const App::Property &)
 
void addViewProvider (Gui::ViewProviderDocumentObject *)
 
static void saveAll ()
 Save all open document. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Base::Persistence
static void * create (void)
 
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving. More...
 
static Base::Type getClassTypeId (void)
 
static void init (void)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create ()
 
static Type getClassTypeId ()
 
static void init ()
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr)
 

Detailed Description

The Gui Document This is the document on GUI level.

Its main responsibility is keeping track off open windows for a document and warning on unsaved closes. All handled views on the document must inherit from MDIView

See also
App::Document
MDIView
Author
Jürgen Riegel

Constructor & Destructor Documentation

◆ Document()

Document::Document ( App::Document pcDocument,
Application app 
)

References draftgeoutils.faces::bind(), Gui::DocumentP::connectActObject, Gui::DocumentP::connectActObjectBlocker, Gui::DocumentP::connectChangeDocument, Gui::DocumentP::connectChangeDocumentBlocker, Gui::DocumentP::connectChangePropertyEditor, Gui::DocumentP::connectCngObject, Gui::DocumentP::connectDelObject, Gui::DocumentP::connectExportObjects, Gui::DocumentP::connectFinishImportObjects, Gui::DocumentP::connectFinishLoadDocument, Gui::DocumentP::connectFinishRestoreObject, Gui::DocumentP::connectImportObjects, Gui::DocumentP::connectNewObject, Gui::DocumentP::connectRecomputed, Gui::DocumentP::connectRedoDocument, Gui::DocumentP::connectRenObject, Gui::DocumentP::connectRestDocument, Gui::DocumentP::connectSaveDocument, Gui::DocumentP::connectShowHidden, Gui::DocumentP::connectSkipRecompute, Gui::DocumentP::connectStartLoadDocument, Gui::DocumentP::connectTouchedObject, Gui::DocumentP::connectTransactionAppend, Gui::DocumentP::connectTransactionRemove, Gui::DocumentP::connectUndoDocument, exportObjects(), App::GetApplication(), ParameterGrp::GetBool(), ParameterGrp::GetInt(), App::Application::GetParameterGroupByPath(), importObjects(), Restore(), Save(), App::Document::signalActivatedObject, App::Document::signalChangedObject, App::Document::signalChangePropertyEditor, App::Document::signalDeletedObject, App::Document::signalExportViewObjects, App::Document::signalFinishImportObjects, App::Application::signalFinishRestoreDocument, App::Document::signalFinishRestoreObject, App::Document::signalImportViewObjects, App::Document::signalNewObject, App::Document::signalRecomputed, App::Document::signalRedo, App::Document::signalRelabelObject, App::Document::signalRestoreDocument, App::Document::signalSaveDocument, App::Application::signalShowHidden, App::Document::signalSkipRecompute, App::Application::signalStartRestoreDocument, App::Document::signalTouchedObject, App::Document::signalTransactionAppend, App::Document::signalTransactionRemove, App::Document::signalUndo, slotActivatedObject(), slotChangedObject(), slotChangePropertyEditor(), slotDeletedObject(), slotFinishImportObjects(), slotFinishRestoreDocument(), slotFinishRestoreObject(), slotNewObject(), slotRecomputed(), slotRedoDocument(), slotRelabelObject(), slotShowHidden(), slotSkipRecompute(), slotStartRestoreDocument(), slotTouchedObject(), slotTransactionAppend(), slotTransactionRemove(), and slotUndoDocument().

◆ ~Document()

Member Function Documentation

◆ abortCommand()

◆ addRootObjectsToGroup()

void Document::addRootObjectsToGroup ( const std::vector< App::DocumentObject * > &  obj,
App::DocumentObjectGroup grp 
)

Add all root objects of the given array to a group.

References Gui::ViewProvider::claimChildren(), and getViewProvider().

◆ addViewProvider()

◆ attachView()

void Document::attachView ( Gui::BaseView pcView,
bool  bPassiv = false 
)

Attach a view (get called by the MDIView constructor)

References Gui::DocumentP::baseViews, and Gui::DocumentP::passiveViews.

Referenced by Gui::BaseView::setDocument().

◆ beforeDelete()

void Document::beforeDelete ( )

◆ canClose()

bool Document::canClose ( bool  checkModify = true,
bool  checkLink = false 
)

◆ cloneView()

◆ commitCommand()

◆ createView()

◆ detachView()

void Document::detachView ( Gui::BaseView pcView,
bool  bPassiv = false 
)

◆ exportObjects()

◆ getActiveView()

◆ getAnnotationViewProvider()

ViewProvider * Document::getAnnotationViewProvider ( const char *  name) const

get an annotation view provider

Referenced by Gui::View3DInventorPy::removeAnnotation().

◆ getCameraSettings()

const char * Document::getCameraSettings ( ) const

Referenced by SaveDocFile().

◆ getDocument()

App::Document * Document::getDocument ( void  ) const

Getter for the App Document.

Referenced by abortCommand(), Gui::Dialog::DlgMacroExecuteImp::accept(), Gui::TaskCSysDragger::accept(), Gui::MacroCommand::activated(), StdCmdImport::activated(), StdCmdToggleSelectability::activated(), Gui::RecentMacrosAction::activateFile(), PartGui::FaceColors::Private::addFacesToSelection(), canClose(), Gui::View3DInventorViewer::checkGroupOnTop(), commitCommand(), Gui::TreeWidget::contextMenuEvent(), ReverseEngineeringGui::SegmentationManual::createSegment(), createView(), Gui::DocumentIndex::data(), detachView(), Gui::View3DInventorViewer::dropEvent(), Gui::TreeWidget::dropEvent(), ReverseEngineeringGui::SegmentationManual::Private::findGeometry(), Gui::ManualAlignment::finish(), Gui::LinkInfo::getDocName(), Gui::Command::getDocument(), getRedoVector(), getUndoVector(), getViewProviderByName(), hasPendingCommand(), Gui::Command::isActiveObjectValid(), Gui::DAG::Model::Model(), Gui::TreeWidget::onAllowPartialRecompute(), Gui::TreeWidget::onCreateGroup(), Gui::Application::onLastWindowClosed(), Gui::TreeWidget::onMarkRecompute(), Gui::MDIView::onRelabel(), DrawingGui::DrawingView::onRelabel(), Gui::TreeWidget::onReloadDoc(), Gui::View3DInventor::onRename(), Gui::TreeWidget::onSelectDependents(), Gui::TreeWidget::onSkipRecompute(), openCommand(), MeshPartGui::CurveOnMeshHandler::recomputeDocument(), redo(), save(), saveAs(), saveCopy(), Gui::DocumentItem::selectItems(), Gui::Application::setActiveDocument(), Gui::DocumentItem::setData(), Gui::View3DInventorViewer::setDocument(), setEdit(), Gui::DocumentItem::setShowHidden(), Gui::DocumentItem::showHidden(), slotChangePropertyEditor(), Gui::ElementColors::slotDeleteDocument(), Gui::DocumentItem::slotNewObject(), Gui::Application::sSetActiveDocument(), Gui::TreeWidget::startItemSearch(), undo(), Gui::DocumentObjectData::updateChildren(), and PartDesignGui::ViewProviderBody::updateOriginDatumSize().

◆ getEditingTransform()

const Base::Matrix4D & Document::getEditingTransform ( ) const

◆ getEditingViewOfViewProvider()

◆ getInEdit()

◆ getMDIViews()

std::list< MDIView * > Document::getMDIViews ( ) const

◆ getMDIViewsOfType()

◆ getMemSize()

unsigned int Document::getMemSize ( void  ) const
virtual

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?

Implements Base::Persistence.

◆ getPyObject()

PyObject * Document::getPyObject ( void  )
virtual

This method returns the Python wrapper for a C++ object.

It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.

The default implementation returns 'None'.

Reimplemented from Base::BaseClass.

Referenced by Gui::Application::sActiveDocument(), Gui::Application::sEditDocument(), Gui::Application::sGetDocument(), and Gui::Application::slotActiveDocument().

◆ getRedoVector()

std::vector< std::string > Document::getRedoVector ( void  ) const

Get an Redo string vector with the Redo names.

Get a string vector with the 'Redo' actions.

References App::Document::getAvailableRedoNames(), and getDocument().

◆ getUndoVector()

std::vector< std::string > Document::getUndoVector ( void  ) const

Get an Undo string vector with the Undo names.

Get a string vector with the 'Undo' actions.

References App::Document::getAvailableUndoNames(), and getDocument().

Referenced by TechDrawGui::TaskLeaderLine::removeFeature(), and TechDrawGui::TaskRichAnno::removeFeature().

◆ getViewOfNode()

◆ getViewOfViewProvider()

◆ getViewProvider() [1/2]

ViewProvider * Document::getViewProvider ( const App::DocumentObject Feat) const

Get the view provider for that object.

Referenced by addRootObjectsToGroup(), Gui::AlignmentGroup::addView(), cloneView(), TechDrawGui::TaskHatch::createHatch(), createView(), Gui::ViewProviderDocumentObject::findFrontRootOfType(), ReverseEngineeringGui::SegmentationManual::Private::findGeometry(), PartGui::DlgExtrusion::findShapes(), Gui::ViewProviderDocumentObject::getElementPicked(), TechDrawGui::QGIView::getFrameState(), TechDrawGui::ViewProviderDrawingView::getMDIViewPage(), TechDrawGui::ViewProviderTemplate::getMDIViewPage(), TechDrawGui::ViewProviderDrawingView::getQView(), Gui::LinkInfo::getView(), TechDrawGui::QGIView::getViewProvider(), Gui::ViewProviderDocumentObjectGroup::getViewProviders(), Gui::MergeDocuments::importObject(), TechDrawGui::TaskLinkDim::loadToTree(), Gui::DAG::Model::Model(), TechDrawGui::ViewProviderDrawingView::onGuiRepaint(), FemGui::ActiveAnalysisObserver::setActiveObject(), TechDrawGui::ViewProviderPage::setTemplateMarkers(), PartDesignGui::ViewProviderBody::setVisualBodyMode(), slotActivatedObject(), slotChangedObject(), slotDeletedObject(), slotFinishRestoreDocument(), slotFinishRestoreObject(), slotNewObject(), slotRelabelObject(), slotTransactionAppend(), TechDrawGui::TaskCosVertex::TaskCosVertex(), TechDrawGui::TaskDetail::TaskDetail(), TechDrawGui::TaskLeaderLine::TaskLeaderLine(), TechDrawGui::TaskProjGroup::TaskProjGroup(), TechDrawGui::TaskRichAnno::TaskRichAnno(), RobotGui::TaskTrajectory::TaskTrajectory(), RobotGui::TrajectorySimulate::TrajectorySimulate(), PartDesignGui::ViewProviderBody::unifyVisualProperty(), MeshGui::ViewProviderMeshCurvature::updateData(), and TechDrawGui::ViewProviderGeomHatch::updateGraphic().

◆ getViewProvider() [2/2]

ViewProviderDocumentObject * Document::getViewProvider ( SoNode node) const

◆ getViewProviderByName()

ViewProvider * Document::getViewProviderByName ( const char *  name) const

◆ getViewProviderByPathFromHead()

ViewProviderDocumentObject * Document::getViewProviderByPathFromHead ( SoPath *  path) const

helper for selection

◆ getViewProviderByPathFromTail()

ViewProviderDocumentObject * Document::getViewProviderByPathFromTail ( SoPath *  path) const

helper for selection

◆ getViewProvidersByPath()

std::vector< std::pair< ViewProviderDocumentObject *, int > > Document::getViewProvidersByPath ( SoPath *  path) const

Get all view providers along the path and the corresponding node index in the path.

◆ getViewProvidersOfType()

std::vector< ViewProvider * > Document::getViewProvidersOfType ( const Base::Type typeId) const

◆ hasPendingCommand()

bool Document::hasPendingCommand ( void  ) const

Check if an Undo transaction is open.

References getDocument(), and App::Document::hasPendingTransaction().

Referenced by PartGui::TaskDlgAttacher::open().

◆ importObjects()

void Document::importObjects ( const std::vector< App::DocumentObject * > &  obj,
Base::Reader reader,
const std::map< std::string, std::string > &  nameMapping 
)

◆ isLastView()

bool Document::isLastView ( void  )

◆ isModified()

◆ isPerformingTransaction()

bool Document::isPerformingTransaction ( ) const

Check if the document is performing undo/redo transaction.

Unlike App::Document::isPerformingTransaction(), Gui::Document will report transacting when triggering grouped undo/redo in other documents

◆ isShow()

bool Document::isShow ( const char *  name)

test if the feature is in show

References getViewProviderByName(), and Gui::ViewProvider::isShow().

◆ onRelabel()

void Document::onRelabel ( void  )

◆ onUpdate()

void Document::onUpdate ( void  )

◆ openCommand()

void Document::openCommand ( const char *  sName = nullptr)

Open a new Undo transaction on the document.

Open a new Undo transaction on the active document This method opens a new UNDO transaction on the active document.

This transaction will later appear in the UNDO/REDO dialog with the name of the command. If the user recall the transaction everything changed on the document between OpenCommand() and CommitCommand will be undone (or redone). You can use an alternative name for the operation default is the command name.

See also
CommitCommand(),AbortCommand()

References getDocument(), and App::Document::openTransaction().

Referenced by Gui::ManualAlignment::align(), MeshGui::ViewProviderMesh::clipMeshCallback(), PartGui::DlgPrimitives::createPrimitive(), ReverseEngineeringGui::SegmentationManual::createSegment(), PointsGui::ViewProviderScattered::cut(), PointsGui::ViewProviderStructured::cut(), MeshGui::ViewProviderMesh::fillHole(), MeshGui::ViewProviderMesh::markPartCallback(), SketcherGui::ViewProviderSketch::mouseButtonPressed(), MeshGui::DlgRegularSolidImp::on_createSolidButton_clicked(), PartGui::TaskDlgAttacher::open(), MeshGui::ViewProviderMesh::partMeshCallback(), MeshGui::ViewProviderMesh::segmMeshCallback(), and MeshGui::ViewProviderMesh::trimMeshCallback().

◆ redo()

void Document::redo ( int  iSteps)

◆ removeAnnotationViewProvider()

void Document::removeAnnotationViewProvider ( const char *  name)

◆ resetEdit()

◆ Restore()

void Document::Restore ( Base::XMLReader reader)
virtual

This method is used to restore properties from an XML document.

Loads a separate XML file from the projects file with information about the view providers.

Implements Base::Persistence.

References Base::XMLReader::addFile(), and Gui::isRestoring.

Referenced by Document().

◆ RestoreDocFile()

void Document::RestoreDocFile ( Base::Reader reader)
virtual

◆ Save()

void Document::Save ( Base::Writer writer) const
virtual

This method is used to save properties or very small amounts of data to an XML document.

Adds a separate XML file to the projects file that contains information about the view providers.

Implements Base::Persistence.

References Base::Writer::addFile(), App::GetApplication(), ParameterGrp::GetBool(), Base::BaseClass::getClassTypeId(), ParameterGrp::GetInt(), getMDIViews(), App::Application::GetParameterGroupByPath(), Gui::View3DInventor::getViewer(), Base::Writer::isForceXML(), Gui::Thumbnail::Save(), Gui::Thumbnail::setFileName(), Gui::Thumbnail::setSize(), Gui::Thumbnail::setViewer(), and Gui::DocumentP::thumb.

Referenced by Document().

◆ save()

◆ saveAll()

◆ saveAs()

◆ saveCameraSettings()

bool Document::saveCameraSettings ( const char *  settings) const

◆ saveCopy()

◆ SaveDocFile()

void Document::SaveDocFile ( Base::Writer writer) const
virtual

◆ sendMsgToFirstView()

bool Document::sendMsgToFirstView ( const Base::Type typeId,
const char *  pMsg,
const char **  ppReturn 
)

Sends the message pMsg to the views of type typeid and stops with the first view that supports the message and returns ppReturn.

The very first checked view is the current active view. If a view supports the message true is returned and false otherwise.

References getActiveView(), and getMDIViewsOfType().

◆ sendMsgToViews()

bool Document::sendMsgToViews ( const char *  pMsg)

send messages to the active view Send a specific massage to the active view and is able to receive a return message

send messages to the active view

send Messages to all views

References Gui::DocumentP::baseViews, and Gui::DocumentP::passiveViews.

◆ setActiveView()

◆ setActiveWindow()

void Document::setActiveWindow ( Gui::MDIView view)

Document::setActiveWindow If this document is active and the view is part of it then it will be activated.

If the document is not active of the view is already active nothing is done.

Parameters
view

References Gui::MainWindow::activeWindow(), DraftVecUtils::find(), Gui::getMainWindow(), getMDIViews(), and Gui::MainWindow::setActiveWindow().

◆ setAnnotationViewProvider()

void Document::setAnnotationViewProvider ( const char *  name,
ViewProvider pcProvider 
)

◆ setEdit()

bool Document::setEdit ( Gui::ViewProvider p,
int  ModNum = 0,
const char *  subname = nullptr 
)

set the ViewProvider in special edit mode

References Gui::ControlSingleton::activeDialog(), Gui::Control(), Data::ComplexGeoData::findElementName(), getActiveView(), Base::Persistence::getClassTypeId(), Gui::SelectionSingleton::getCompleteSelection(), Gui::ViewProviderDocumentObject::getDocument(), getDocument(), App::DocumentObject::getFullName(), Gui::getMainWindow(), Gui::ViewProviderDocumentObject::getObject(), App::DocumentObject::getSubObject(), Gui::View3DInventor::getViewer(), Gui::Application::getViewProvider(), Gui::Application::Instance, Gui::NoResolve, Gui::Selection(), setActiveView(), Gui::MainWindow::setActiveWindow(), Gui::TaskView::TaskDialog::setDocumentName(), setEdit(), Gui::Application::setEditDocument(), Gui::View3DInventorViewer::setEditingViewProvider(), App::AutoTransaction::setEnable(), and signalInEdit.

Referenced by StdCmdTransformManip::activated(), Gui::ViewProviderLink::doubleClicked(), ArchGrid.ViewProviderArchGrid::doubleClicked(), ArchReference.ViewProviderArchReference::doubleClicked(), draftviewproviders.view_dimension.ViewProviderDimensionBase::doubleClicked(), draftviewproviders.view_hatch.ViewProviderDraftHatch::doubleClicked(), draftviewproviders.view_text.ViewProviderText::doubleClicked(), PathScripts.PathPropertyBagGui.ViewProvider::doubleClicked(), PathScripts.PathSetupSheetGui.ViewProvider::doubleClicked(), PathScripts.PathToolBitGui.ViewProvider::doubleClicked(), Spreadsheet_legacy.ViewProviderSpreadsheet::doubleClicked(), Gui::ViewProviderAnnotationLabel::doubleClicked(), Gui::ViewProviderMaterialObject::doubleClicked(), FemGui::ViewProviderFemPostFunction::doubleClicked(), FemGui::ViewProviderFemPostObject::doubleClicked(), RaytracingGui::ViewProviderLux::doubleClicked(), RaytracingGui::ViewProviderPovray::doubleClicked(), Gui::ViewProviderDragger::doubleClicked(), SketcherGui::ViewProviderSketch::doubleClicked(), ArchSchedule.CommandArchSchedule::IsActive(), setEdit(), PartDesignGui::ViewProviderShapeBinder::setupContextMenu(), PathScripts.PathIconViewProvider.ViewProvider::setupContextMenu(), PathScripts.PathJobGui.ViewProvider::setupContextMenu(), PathScripts.PathOpGui.ViewProvider::setupContextMenu(), PathScripts.PathToolControllerGui.ViewProvider::setupContextMenu(), and Gui::ViewProviderDocumentObject::startDefaultEditMode().

◆ setEditingTransform()

void Document::setEditingTransform ( const Base::Matrix4D mat)

◆ setHide()

void Document::setHide ( const char *  name)

◆ setInEdit()

void Document::setInEdit ( ViewProviderDocumentObject parentVp,
const char *  subname 
)

set the in edit ViewProvider subname reference

◆ setModified()

◆ setPos()

void Document::setPos ( const char *  name,
const Base::Matrix4D rclMtrx 
)

set the feature transformation (only viewing)

set the feature in Noshow

References getViewProviderByName(), and Gui::ViewProvider::setTransformation().

◆ setShow()

void Document::setShow ( const char *  name)

◆ slotActivatedObject()

void Document::slotActivatedObject ( const App::DocumentObject Obj)
protected

◆ slotChangedObject()

◆ slotChangePropertyEditor()

void Document::slotChangePropertyEditor ( const App::Document doc,
const App::Property Prop 
)
protected

◆ slotDeletedObject()

◆ slotFinishImportObjects()

void Document::slotFinishImportObjects ( const std::vector< App::DocumentObject * > &  objs)
protected

Referenced by Document().

◆ slotFinishRestoreDocument()

◆ slotFinishRestoreObject()

void Document::slotFinishRestoreObject ( const App::DocumentObject obj)
protected

◆ slotNewObject()

◆ slotRecomputed()

void Document::slotRecomputed ( const App::Document doc)
protected

◆ slotRedoDocument()

void Document::slotRedoDocument ( const App::Document doc)
protected

◆ slotRelabelObject()

void Document::slotRelabelObject ( const App::DocumentObject Obj)
protected

◆ slotShowHidden()

void Document::slotShowHidden ( const App::Document doc)
protected

◆ slotSkipRecompute()

◆ slotStartRestoreDocument()

void Document::slotStartRestoreDocument ( const App::Document doc)
protected

◆ slotTouchedObject()

void Document::slotTouchedObject ( const App::DocumentObject Obj)
protected

◆ slotTransactionAppend()

void Document::slotTransactionAppend ( const App::DocumentObject obj,
App::Transaction transaction 
)
protected

◆ slotTransactionRemove()

void Document::slotTransactionRemove ( const App::DocumentObject obj,
App::Transaction transaction 
)
protected

◆ slotUndoDocument()

void Document::slotUndoDocument ( const App::Document doc)
protected

◆ toggleInSceneGraph()

void Document::toggleInSceneGraph ( ViewProvider vp)

Add or remove view provider from scene graphs of all views.

It calls ViewProvider::canAddToSceneGraph() to decide whether to add the view provider or remove it

References Gui::DocumentP::baseViews, Gui::ViewProvider::canAddToSceneGraph(), Gui::ViewProvider::getRoot(), and Gui::View3DInventor::getViewer().

Referenced by Gui::ViewProviderPythonFeatureT< ViewProviderT >::onChanged(), and slotFinishRestoreObject().

◆ undo()

Friends And Related Function Documentation

◆ TransactionViewProvider

Member Data Documentation

◆ signalActivatedObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalActivatedObject
mutable

◆ signalChangedObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&, const App::Property&)> Gui::Document::signalChangedObject
mutable

signal on changed Object, the 2nd argument is the changed property of the referenced document object, not of the view provider

Referenced by PartDesignGui::ViewProviderBody::attach(), Gui::ViewProviderOriginGroupExtension::extensionAttach(), Gui::ViewProviderLink::finishRestoring(), Gui::DAG::Model::Model(), slotChangedObject(), and Gui::Application::slotNewDocument().

◆ signalDeletedObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalDeletedObject
mutable

◆ signalDeleteDocument

boost::signals2::signal<void (const Gui::Document& doc)> Gui::Document::signalDeleteDocument
mutable

signal on deleting Document

Referenced by PartGui::TaskAttacher::TaskAttacher().

◆ signalExpandObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&, const Gui::TreeItemMode&, App::DocumentObject *parent, const char *subname)> Gui::Document::signalExpandObject
mutable

signal on changed Object, the 2nd argument is the highlite mode to use

Referenced by importObjects(), and RestoreDocFile().

◆ signalHighlightObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&, const Gui::HighlightMode&, bool, App::DocumentObject *parent, const char *subname)> Gui::Document::signalHighlightObject
mutable

signal on changed Object, the 2nd argument is the highlite mode to use

Referenced by FemGui::ActiveAnalysisObserver::highlightActiveObject().

◆ signalInEdit

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalInEdit
mutable

signal on entering in edit mode

Referenced by Gui::DAG::Model::Model(), setEdit(), and Gui::Application::slotNewDocument().

◆ signalNewObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalNewObject
mutable

◆ signalRedoDocument

boost::signals2::signal<void (const Gui::Document& doc)> Gui::Document::signalRedoDocument
mutable

◆ signalRelabelObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalRelabelObject
mutable

signal on renamed Object

Referenced by Gui::Application::slotNewDocument(), and slotRelabelObject().

◆ signalResetEdit

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalResetEdit
mutable

signal on leaving edit mode

Referenced by Gui::DAG::Model::Model(), and Gui::Application::slotNewDocument().

◆ signalScrollToObject

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalScrollToObject
mutable

signal on scrolling to an object

◆ signalShowItem

boost::signals2::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalShowItem
mutable

signal on changed ShowInTree property in view provider

◆ signalUndoDocument

boost::signals2::signal<void (const Gui::Document& doc)> Gui::Document::signalUndoDocument
mutable

The documentation for this class was generated from the following files: