The Gui Document This is the document on GUI level. More...
#include <Document.h>
Public Member Functions | |
bool | canClose () |
handels the application close event | |
Document (App::Document *pcDocument, Application *app) | |
App::Document * | getDocument (void) const |
Getter for the App Document. | |
virtual PyObject * | getPyObject (void) |
This method returns the Python wrapper for a C++ object. | |
bool | isLastView (void) |
bool | isModified () const |
void | setModified (bool) |
Observer message from the App doc. | |
~Document () | |
methods for the UNDO REDO handling | |
void | abortCommand (void) |
Abort the Undo transaction on the document. | |
void | commitCommand (void) |
Commit the Undo transaction on the document. | |
std::vector< std::string > | getRedoVector (void) const |
Get an Redo string vector with the Redo names. | |
std::vector< std::string > | getUndoVector (void) const |
Get an Undo string vector with the Undo names. | |
void | openCommand (const char *sName=0) |
Open a new Undo transaction on the document. | |
void | redo (int iSteps) |
Will REDO one or more steps. | |
void | undo (int iSteps) |
Will UNDO one or more steps. | |
methods for View handling | |
void | attachView (Gui::BaseView *pcView, bool bPassiv=false) |
Attach a view (get called by the MDIView constructor). | |
void | createView (const char *sType) |
Creat a new view. | |
void | detachView (Gui::BaseView *pcView, bool bPassiv=false) |
Detach a view (get called by the MDIView destructor). | |
Gui::MDIView * | getActiveView (void) const |
Getter for the active view. | |
std::list< MDIView * > | getMDIViews () const |
returns a list of all attached MDI views | |
void | onRelabel (void) |
call relabel to all attached views | |
void | onUpdate (void) |
call update on all attached views | |
bool | sendMsgToViews (const char *pMsg) |
send messages to the active view Send a specific massage to the active view and is able to recive a return massage | |
View provider handling | |
ViewProvider * | getAnnotationViewProvider (const char *name) const |
get an annotation view provider | |
ViewProvider * | getInEdit (void) const |
get the in edit ViewProvider or NULL | |
ViewProvider * | getViewProvider (const App::DocumentObject *) const |
Get the view provider for that object. | |
ViewProvider * | getViewProviderByName (const char *name) const |
std::vector< ViewProvider * > | getViewProvidersOfType (const Base::Type &typeId) const |
bool | isShow (const char *name) |
test if the feature is in show | |
void | removeAnnotationViewProvider (const char *name) |
remove an annotation view provider | |
void | resetEdit (void) |
reset from edit mode | |
void | setAnnotationViewProvider (const char *name, ViewProvider *pcProvider) |
set an annotation view provider | |
bool | setEdit (Gui::ViewProvider *p, int ModNum=0) |
set the ViewProvider in special edit mode | |
void | setHide (const char *name) |
set the feature in Noshow | |
void | setPos (const char *name, const Base::Matrix4D &rclMtrx) |
set the feature transformation (only viewing) | |
void | setShow (const char *name) |
put the feature in show | |
Public Attributes | |
Signals of the document | |
boost::signal< void(const Gui::ViewProviderDocumentObject &)> | signalActivatedObject |
signal on activated Object | |
boost::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 | |
boost::signal< void(const Gui::ViewProviderDocumentObject &)> | signalDeletedObject |
signal on deleted Object | |
boost::signal< void(const Gui::ViewProviderDocumentObject &)> | signalInEdit |
signal on goes in edti mode | |
boost::signal< void(const Gui::ViewProviderDocumentObject &)> | signalNewObject |
signal on new Object | |
boost::signal< void(const Gui::ViewProviderDocumentObject &)> | signalRenamedObject |
signal on renamed Object | |
boost::signal< void(const Gui::ViewProviderDocumentObject &)> | signalResetEdit |
signal on leave edit mode | |
Protected Attributes | |
Gui::DocumentPy * | _pcDocPy |
I/O of the document | |
| |
void | exportObjects (const std::vector< App::DocumentObject * > &, Base::Writer &) |
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? | |
void | importObjects (const std::vector< App::DocumentObject * > &, Base::Reader &) |
virtual void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. | |
virtual void | RestoreDocFile (Base::Reader &reader) |
This method is used to restore large amounts of data from a binary file. | |
virtual void | Save (Base::Writer &writer) const |
This method is used to save properties or very small amounts of data to an XML document. | |
bool | save (void) |
Save the document. | |
bool | saveAs (void) |
Save the document under a new file name. | |
virtual void | SaveDocFile (Base::Writer &writer) const |
This method is used to save large amounts of data to a binary file. | |
void | slotActivatedObject (const App::DocumentObject &) |
void | slotChangedObject (const App::DocumentObject &, const App::Property &) |
void | slotDeletedObject (const App::DocumentObject &) |
void | slotNewObject (const App::DocumentObject &) |
This slot is connected to the App::Document::signalNewObject(...). | |
void | slotRenamedObject (const App::DocumentObject &) |
void | slotRestoredDocument (const App::Document &) |
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
Definition at line 56 of file Gui/Document.h.
Document::Document | ( | App::Document * | pcDocument, | |
Application * | app | |||
) |
Definition at line 104 of file Gui/Document.cpp.
References Gui::DocumentP::_iDocId, Gui::DocumentP::_isClosing, Gui::DocumentP::_isModified, Gui::DocumentP::_iWinCount, Gui::DocumentP::_pcAppWnd, _pcDocPy, Gui::DocumentP::_pcDocument, Gui::DocumentP::_pcInEdit, draftlibs::fcgeo::bind(), Gui::DocumentP::connectActObject, Gui::DocumentP::connectCngObject, Gui::DocumentP::connectDelObject, Gui::DocumentP::connectLoadDocument, Gui::DocumentP::connectNewObject, Gui::DocumentP::connectRenObject, Gui::DocumentP::connectRestDocument, Gui::DocumentP::connectSaveDocument, App::GetApplication(), Restore(), Save(), App::Document::setMaxUndoStackSize(), App::Document::setUndoMode(), App::Document::signalActivatedObject, App::Document::signalChangedObject, App::Document::signalDeletedObject, App::Document::signalNewObject, App::Document::signalRenamedObject, App::Application::signalRestoreDocument, App::Document::signalRestoreDocument, App::Document::signalSaveDocument, slotActivatedObject(), slotChangedObject(), slotDeletedObject(), slotNewObject(), slotRenamedObject(), and slotRestoredDocument().
Document::~Document | ( | ) |
Definition at line 147 of file Gui/Document.cpp.
References Gui::DocumentP::_isClosing, _pcDocPy, Gui::DocumentP::_ViewProviderMap, Gui::DocumentP::_ViewProviderMapAnnotation, Gui::DocumentP::baseViews, Gui::DocumentP::connectActObject, Gui::DocumentP::connectCngObject, Gui::DocumentP::connectDelObject, Gui::DocumentP::connectLoadDocument, Gui::DocumentP::connectNewObject, Gui::DocumentP::connectRenObject, Gui::DocumentP::connectRestDocument, Gui::DocumentP::connectSaveDocument, Base::PyObjectBase::DecRef(), and Base::PyObjectBase::setInvalid().
void Document::abortCommand | ( | void | ) |
Abort the Undo transaction on the document.
Definition at line 1038 of file Gui/Document.cpp.
References App::Document::abortTransaction(), and getDocument().
Referenced by Gui::Command::abortCommand().
void Document::attachView | ( | Gui::BaseView * | pcView, | |
bool | bPassiv = false | |||
) |
Attach a view (get called by the MDIView constructor).
Definition at line 834 of file Gui/Document.cpp.
References Gui::DocumentP::baseViews, and Gui::DocumentP::passiveViews.
Referenced by Gui::BaseView::BaseView(), and Gui::BaseView::setDocument().
bool Document::canClose | ( | void | ) |
handels the application close event
This method checks if the document can be closed.
It checks on the save state of the document and is able to abort the closing.
Definition at line 915 of file Gui/Document.cpp.
References Gui::ControlSingleton::activeDialog(), Gui::Control(), getActiveView(), getDocument(), isModified(), save(), and Gui::ControlSingleton::showDialog().
void Document::commitCommand | ( | void | ) |
Commit the Undo transaction on the document.
Definition at line 1033 of file Gui/Document.cpp.
References App::Document::commitTransaction(), and getDocument().
Referenced by InspectionGui::VisualInspection::accept(), PartGui::LoftWidget::accept(), Gui::Command::commitCommand(), Gui::Dialog::TransformStrategy::commitTransform(), MeshGui::RemoveComponents::deleteSelection(), Gui::TreeWidget::dropEvent(), MeshGui::DlgEvaluateMeshImp::on_repairAllTogether_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDegeneratedButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDuplicatedFacesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDuplicatedPointsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairFoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairIndicesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairNonmanifoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairOrientationButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairSelfIntersectionButton_clicked(), and Gui::TreeWidget::onCreateGroup().
void Document::createView | ( | const char * | sType | ) |
Creat a new view.
Definition at line 811 of file Gui/Document.cpp.
References Gui::DocumentP::_iWinCount, Gui::DocumentP::_ViewProviderMap, Gui::DocumentP::_ViewProviderMapAnnotation, Gui::View3DInventorViewer::addViewProvider(), Gui::MainWindow::addWindow(), getDocument(), Gui::getMainWindow(), Gui::View3DInventor::getViewer(), and App::Document::Label.
Referenced by StdCmdViewCreate::activated().
void Document::detachView | ( | Gui::BaseView * | pcView, | |
bool | bPassiv = false | |||
) |
Detach a view (get called by the MDIView destructor).
Definition at line 842 of file Gui/Document.cpp.
References Gui::DocumentP::_isClosing, Gui::DocumentP::_pcAppWnd, Gui::DocumentP::baseViews, draftlibs::fcvec::find(), Gui::Application::onLastWindowClosed(), and Gui::DocumentP::passiveViews.
Referenced by Gui::MDIView::closeEvent(), Gui::BaseView::onClose(), and Gui::BaseView::setDocument().
void Document::exportObjects | ( | const std::vector< App::DocumentObject * > & | obj, | |
Base::Writer & | writer | |||
) |
Definition at line 726 of file Gui/Document.cpp.
References Base::Writer::decInd(), Gui::Application::getDocument(), Base::Type::getName(), App::DocumentObject::getNameInDocument(), Gui::ViewProvider::getTypeId(), getViewProvider(), Base::Writer::incInd(), Base::Writer::ind(), Gui::Application::Instance, Base::Writer::isForceXML(), App::PropertyContainer::Save(), Base::Writer::setForceXML(), and Base::Writer::Stream().
Referenced by Gui::MergeDocuments::SaveDocFile().
MDIView * Document::getActiveView | ( | void | ) | const |
Getter for the active view.
Definition at line 992 of file Gui/Document.cpp.
References Gui::MainWindow::activeWindow(), Gui::getMainWindow(), and getMDIViews().
Referenced by DrawingGui::TaskProjection::accept(), StdCmdMeasureDistance::activated(), StdCmdViewCreate::activated(), CmdPointsPolyCut::activated(), CmdShapeInfo::activated(), CmdMeshFillInteractiveHole::activated(), CmdMeshRemoveCompByHand::activated(), CmdMeshEvaluateFacet::activated(), CmdMeshPolySplit::activated(), CmdMeshPolyCut::activated(), CmdMeshAddFacet::activated(), CmdMeshPolySelect::activated(), CmdMeshPolySegm::activated(), CmdMeshVertexCurvatureInfo::activated(), CmdInspectElement::activated(), Gui::DocumentPy::activeView(), Gui::SelectionSingleton::addSelection(), Gui::Command::adjustCameraPosition(), canClose(), PartGui::CrossSections::CrossSections(), Gui::ViewProviderDocumentObject::getActiveView(), Gui::DocumentPy::getActiveView(), getInEdit(), Gui::Command::isViewOfType(), Gui::TreeView::mouseDoubleClickEvent(), Gui::TreeWidget::mouseDoubleClickEvent(), MeshGui::DlgEvaluateMeshImp::on_refreshButton_clicked(), CamGui::Cutting::on_SelectFace_button_clicked(), CamGui::Cutting::on_toolpath_calculation_highest_level_button_clicked(), CamGui::Cutting::on_toolpath_calculation_lowest_level_button_clicked(), CamGui::Cutting::on_toolpath_calculation_middle_level_button_clicked(), Gui::TreeWidget::onActivateDocument(), Gui::SelectionSingleton::rmvPreselect(), setEdit(), Gui::SelectionSingleton::setPreselect(), and Gui::ViewProviderDocumentObjectGroup::updateData().
ViewProvider * Document::getAnnotationViewProvider | ( | const char * | name | ) | const |
get an annotation view provider
Definition at line 247 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMapAnnotation.
Referenced by Gui::View3DInventorPy::removeAnnotation().
App::Document * Document::getDocument | ( | void | ) | const |
Definition at line 482 of file Gui/Document.cpp.
References Gui::DocumentP::_pcDocument.
Referenced by abortCommand(), InspectionGui::VisualInspection::accept(), PartGui::LoftWidget::accept(), StdCmdHideObjects::activated(), StdCmdShowObjects::activated(), StdCmdToggleObjects::activated(), StdCmdExport::activated(), StdCmdImport::activated(), CmdRaytracingWriteView::activated(), Gui::DocumentPy::activeObject(), canClose(), commitCommand(), createView(), Gui::PointMarker::customEvent(), Gui::DocumentIndex::data(), Gui::DocumentPy::getActiveObject(), Gui::BaseView::getAppDocument(), Gui::DocumentPy::getDocument(), Gui::Command::getDocument(), getRedoVector(), getUndoVector(), Gui::Command::getUniqueObjectName(), getViewProviderByName(), Gui::Command::isActiveObjectValid(), MeshGui::DlgEvaluateMeshImp::on_refreshButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairAllTogether_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDegeneratedButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDuplicatedFacesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDuplicatedPointsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairFoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairIndicesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairNonmanifoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairOrientationButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairSelfIntersectionButton_clicked(), Gui::TreeWidget::onCreateGroup(), Gui::TreeWidget::onFinishEditing(), Gui::Application::onLastWindowClosed(), Gui::MDIView::onRelabel(), Gui::View3DInventor::onRename(), openCommand(), redo(), saveAs(), Gui::DocumentItem::selectItems(), Gui::Application::setActiveDocument(), Gui::DocumentItem::setData(), Gui::DocumentPy::setEdit(), Gui::ViewProviderPythonFeatureObserver::slotDeleteDocument(), undo(), and Gui::DocumentItem::updateSelection().
ViewProvider * Document::getInEdit | ( | void | ) | const |
get the in edit ViewProvider or NULL
Definition at line 215 of file Gui/Document.cpp.
References Gui::DocumentP::_pcInEdit, getActiveView(), Gui::View3DInventor::getViewer(), and Gui::View3DInventorViewer::isEditingViewProvider().
Referenced by CmdSketcherConstrainAngle::activated(), CmdSketcherViewSketch::activated(), ActivateHandler(), getSketchViewprovider(), CmdSketcherViewSketch::isActive(), CmdSketcherLeaveSketch::isActive(), isAlterGeoActive(), isCreateConstraintActive(), isCreateGeoActive(), and updateDatumDistance().
std::list< MDIView * > Document::getMDIViews | ( | ) | const |
returns a list of all attached MDI views
Definition at line 957 of file Gui/Document.cpp.
References Gui::DocumentP::baseViews.
Referenced by getActiveView(), Save(), and setModified().
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.
Definition at line 556 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap.
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.
Definition at line 1071 of file Gui/Document.cpp.
References _pcDocPy, and Base::PyObjectBase::IncRef().
Referenced by Gui::Application::sActiveDocument(), and Gui::Application::sGetDocument().
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.
Definition at line 1050 of file Gui/Document.cpp.
References App::Document::getAvailableRedoNames(), and getDocument().
Referenced by Gui::Dialog::RedoDialog::onFetchInfo().
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.
Definition at line 1044 of file Gui/Document.cpp.
References App::Document::getAvailableUndoNames(), and getDocument().
Referenced by Gui::Dialog::UndoDialog::onFetchInfo().
ViewProvider * Document::getViewProvider | ( | const App::DocumentObject * | Feat | ) | const |
Get the view provider for that object.
Definition at line 270 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap.
Referenced by Gui::Dialog::TransformStrategy::acceptDataTransform(), StdCmdDelete::activated(), StdCmdDDuplicateSelection::activated(), CmdRaytracingWriteView::activated(), CmdPointsPolyCut::activated(), CmdMeshPolySplit::activated(), CmdMeshPolyCut::activated(), CmdMeshPolySelect::activated(), CmdMeshPolySegm::activated(), Gui::DocumentPy::activeObject(), Gui::Dialog::TransformStrategy::applyViewTransform(), exportObjects(), Gui::ViewProviderDocumentObject::findFrontRootOfType(), PartGui::DlgExtrusion::findShapes(), Gui::DocumentPy::getActiveObject(), InspectionGui::ViewProviderInspection::getIcon(), Gui::Application::getViewProvider(), Gui::ViewProviderDocumentObjectGroup::getViewProviders(), Gui::ViewProviderDocumentObjectGroup::hide(), Gui::MergeDocuments::importObject(), importObjects(), Gui::Dialog::TransformStrategy::resetViewTransform(), Gui::ViewProviderDocumentObjectGroup::show(), slotActivatedObject(), slotChangedObject(), slotDeletedObject(), slotRenamedObject(), RobotGui::TaskTrajectory::TaskTrajectory(), RobotGui::TrajectorySimulate::TrajectorySimulate(), Gui::ViewProviderDocumentObjectGroup::updateData(), MeshGui::ViewProviderMeshCurvature::updateData(), and InspectionGui::VisualInspection::VisualInspection().
ViewProvider * Document::getViewProviderByName | ( | const char * | name | ) | const |
Definition at line 288 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap, Gui::DocumentP::_ViewProviderMapAnnotation, getDocument(), and App::Document::getObject().
Referenced by StdCmdToggleSelectability::activated(), Gui::DocumentPy::getCustomAttributes(), Gui::DocumentPy::getObject(), isShow(), Gui::MergeDocuments::RestoreDocFile(), RestoreDocFile(), Gui::DocumentPy::setCustomAttributes(), setHide(), setPos(), and setShow().
std::vector< ViewProvider * > Document::getViewProvidersOfType | ( | const Base::Type & | typeId | ) | const |
Definition at line 277 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap.
Referenced by MeshGui::DlgSettingsMeshView::saveSettings(), and PartGui::DlgSettings3DViewPart::saveSettings().
void Document::importObjects | ( | const std::vector< App::DocumentObject * > & | obj, | |
Base::Reader & | reader | |||
) |
Definition at line 770 of file Gui/Document.cpp.
References Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::Type::getName(), Gui::ViewProvider::getTypeId(), getViewProvider(), Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), App::PropertyContainer::Restore(), and Py::type().
bool Document::isLastView | ( | void | ) |
Definition at line 904 of file Gui/Document.cpp.
References Gui::DocumentP::baseViews.
Referenced by Gui::MDIView::closeEvent().
bool Document::isModified | ( | ) | const |
Definition at line 477 of file Gui/Document.cpp.
References Gui::DocumentP::_isModified.
Referenced by canClose(), and Gui::Application::open().
bool Document::isShow | ( | const char * | name | ) |
test if the feature is in show
Definition at line 311 of file Gui/Document.cpp.
References getViewProviderByName(), and Gui::ViewProvider::isShow().
Referenced by StdCmdToggleObjects::activated(), and StdCmdToggleVisibility::activated().
void Document::onRelabel | ( | void | ) |
call relabel to all attached views
Definition at line 887 of file Gui/Document.cpp.
References Gui::DocumentP::baseViews, Base::Console(), and Gui::DocumentP::passiveViews.
void Document::onUpdate | ( | void | ) |
call update on all attached views
Definition at line 870 of file Gui/Document.cpp.
References Gui::DocumentP::baseViews, Base::Console(), and Gui::DocumentP::passiveViews.
Referenced by Gui::DocumentPy::update(), and Gui::Application::updateActive().
void Document::openCommand | ( | const char * | sName = 0 |
) |
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 alternetive name for the operation default is the command name.
Definition at line 1028 of file Gui/Document.cpp.
References getDocument(), and App::Document::openTransaction().
Referenced by InspectionGui::VisualInspection::accept(), PartGui::LoftWidget::accept(), Gui::Dialog::TransformStrategy::commitTransform(), MeshGui::RemoveComponents::deleteSelection(), Gui::TreeWidget::dropEvent(), MeshGui::DlgEvaluateMeshImp::on_repairAllTogether_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDegeneratedButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDuplicatedFacesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairDuplicatedPointsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairFoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairIndicesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairNonmanifoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairOrientationButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairSelfIntersectionButton_clicked(), Gui::TreeWidget::onCreateGroup(), and Gui::Command::openCommand().
void Document::redo | ( | int | iSteps | ) |
Will REDO one or more steps.
Definition at line 1064 of file Gui/Document.cpp.
References getDocument(), and App::Document::redo().
Referenced by Gui::View3DInventor::onMsg().
void Document::removeAnnotationViewProvider | ( | const char * | name | ) |
remove an annotation view provider
Definition at line 253 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMapAnnotation, Gui::DocumentP::baseViews, Gui::View3DInventor::getViewer(), and Gui::View3DInventorViewer::removeViewProvider().
Referenced by Gui::View3DInventorPy::removeAnnotation(), and setAnnotationViewProvider().
void Document::resetEdit | ( | void | ) |
reset from edit mode
Definition at line 199 of file Gui/Document.cpp.
References Gui::DocumentP::_pcInEdit, Gui::DocumentP::baseViews, Gui::ViewProviderDocumentObject::getClassTypeId(), Gui::View3DInventor::getViewer(), Base::BaseClass::isDerivedFrom(), Gui::View3DInventorViewer::resetEditingViewProvider(), and signalResetEdit.
Referenced by PartGui::FaceColors::accept(), RobotGui::TaskDlgTrajectoryDressUp::accept(), RobotGui::TaskDlgTrajectoryCompound::accept(), RobotGui::TaskDlgEdge2Trac::accept(), Gui::ViewProvider::eventCallback(), Gui::TreeWidget::onFinishEditing(), PartGui::FaceColors::reject(), RobotGui::TaskDlgTrajectoryDressUp::reject(), RobotGui::TaskDlgTrajectoryCompound::reject(), Gui::DocumentPy::resetEdit(), setEdit(), and slotDeletedObject().
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.
Definition at line 596 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap, and Base::XMLReader::addFile().
Referenced by Document().
void Document::RestoreDocFile | ( | Base::Reader & | reader | ) | [virtual] |
This method is used to restore large amounts of data from a binary file.
Restores the properties of the view providers.
Reimplemented from Base::Persistence.
Definition at line 611 of file Gui/Document.cpp.
References Gui::DocumentP::_pcAppWnd, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::getFilenames(), getViewProviderByName(), Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), Base::XMLReader::readFiles(), App::PropertyContainer::Restore(), Gui::Application::sendHasMsgToActiveView(), Gui::Application::sendMsgToActiveView(), and setModified().
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.
Definition at line 570 of file Gui/Document.cpp.
References Gui::DocumentP::_pcDocument, Base::Writer::addFile(), App::Document::FileName, App::GetApplication(), Gui::View3DInventor::getClassTypeId(), getMDIViews(), Base::Writer::isForceXML(), Gui::Thumbnail::Save(), Gui::Thumbnail::setFileName(), Gui::Thumbnail::setSize(), Gui::Thumbnail::setViewer(), and Gui::DocumentP::thumb.
Referenced by Document().
bool Document::save | ( | void | ) |
Save the document.
Definition at line 488 of file Gui/Document.cpp.
References Gui::DocumentP::_pcDocument, Gui::Command::Doc, Gui::Command::doCommand(), App::Document::getName(), App::Document::isSaved(), saveAs(), and setModified().
Referenced by StdCmdSave::activated(), canClose(), and Gui::View3DInventor::onMsg().
bool Document::saveAs | ( | void | ) |
Save the document under a new file name.
Definition at line 503 of file Gui/Document.cpp.
References Gui::MainWindow::appendRecentFile(), Gui::Command::Doc, Gui::Command::doCommand(), DrawingExample::file, App::GetApplication(), getDocument(), App::Application::getDocumentName(), Gui::getMainWindow(), Gui::FileDialog::getWorkingDirectory(), setModified(), Gui::FileDialog::setWorkingDirectory(), and Gui::MainWindow::showMessage().
Referenced by StdCmdSaveAs::activated(), Gui::View3DInventor::onMsg(), and save().
void Document::SaveDocFile | ( | Base::Writer & | writer | ) | const [virtual] |
This method is used to save large amounts of data to a binary file.
Saves the properties of the view providers.
Reimplemented from Base::Persistence.
Definition at line 672 of file Gui/Document.cpp.
References Gui::DocumentP::_pcAppWnd, Gui::DocumentP::_ViewProviderMap, Base::Writer::decInd(), App::DocumentObject::getNameInDocument(), Base::Writer::incInd(), Base::Writer::ind(), Base::Writer::isForceXML(), App::PropertyContainer::Save(), Gui::Application::sendHasMsgToActiveView(), Gui::Application::sendMsgToActiveView(), Base::Writer::setForceXML(), and Base::Writer::Stream().
bool Document::sendMsgToViews | ( | const char * | pMsg | ) |
send messages to the active view Send a specific massage to the active view and is able to recive a return massage
send messages to the active view
send Messages to all views
Definition at line 971 of file Gui/Document.cpp.
References Gui::DocumentP::baseViews, and Gui::DocumentP::passiveViews.
void Document::setAnnotationViewProvider | ( | const char * | name, | |
ViewProvider * | pcProvider | |||
) |
set an annotation view provider
Definition at line 227 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMapAnnotation, Gui::View3DInventorViewer::addViewProvider(), Gui::DocumentP::baseViews, Gui::View3DInventor::getViewer(), and removeAnnotationViewProvider().
Referenced by Gui::DocumentPy::addAnnotation(), Gui::MainWindow::customEvent(), and Gui::View3DInventorPy::setAnnotation().
bool Document::setEdit | ( | Gui::ViewProvider * | p, | |
int | ModNum = 0 | |||
) |
set the ViewProvider in special edit mode
Definition at line 184 of file Gui/Document.cpp.
References Gui::DocumentP::_pcInEdit, getActiveView(), Gui::ViewProviderDocumentObject::getClassTypeId(), Gui::View3DInventor::getViewer(), Base::BaseClass::isDerivedFrom(), resetEdit(), Gui::View3DInventorViewer::setEditingViewProvider(), and signalInEdit.
Referenced by Gui::ViewProviderGeometryObject::doubleClicked(), Gui::ViewProviderAnnotationLabel::doubleClicked(), Gui::TreeWidget::onStartEditing(), and Gui::DocumentPy::setEdit().
void Document::setHide | ( | const char * | name | ) |
set the feature in Noshow
Definition at line 328 of file Gui/Document.cpp.
References Gui::ViewProviderDocumentObject::getClassTypeId(), Gui::ViewProvider::getTypeId(), getViewProviderByName(), and Base::Type::isDerivedFrom().
Referenced by Gui::DocumentPy::hide(), and Gui::Application::sHide().
void Document::setModified | ( | bool | b | ) |
Observer message from the App doc.
Definition at line 467 of file Gui/Document.cpp.
References Gui::DocumentP::_isModified, and getMDIViews().
Referenced by Gui::Application::importFrom(), RestoreDocFile(), save(), saveAs(), slotChangedObject(), slotDeletedObject(), and slotNewObject().
void Document::setPos | ( | const char * | name, | |
const Base::Matrix4D & | rclMtrx | |||
) |
set the feature transformation (only viewing)
set the feature in Noshow
Definition at line 338 of file Gui/Document.cpp.
References getViewProviderByName(), and Gui::ViewProvider::setTransformation().
Referenced by Gui::DocumentPy::setPos().
void Document::setShow | ( | const char * | name | ) |
put the feature in show
Definition at line 318 of file Gui/Document.cpp.
References Gui::ViewProviderDocumentObject::getClassTypeId(), Gui::ViewProvider::getTypeId(), getViewProviderByName(), and Base::Type::isDerivedFrom().
Referenced by Gui::DocumentPy::show(), and Gui::Application::sShow().
void Document::slotActivatedObject | ( | const App::DocumentObject & | Obj | ) | [protected] |
Definition at line 459 of file Gui/Document.cpp.
References Gui::ViewProviderDocumentObject::getClassTypeId(), getViewProvider(), Base::BaseClass::isDerivedFrom(), and signalActivatedObject.
Referenced by Document().
void Document::slotChangedObject | ( | const App::DocumentObject & | Obj, | |
const App::Property & | Prop | |||
) | [protected] |
Definition at line 428 of file Gui/Document.cpp.
References Base::Console(), Gui::ViewProviderDocumentObject::getClassTypeId(), App::DocumentObject::getNameInDocument(), getViewProvider(), Base::BaseClass::isDerivedFrom(), Base::Exception::ReportException(), setModified(), signalChangedObject, Gui::ViewProvider::update(), and Base::Exception::what().
Referenced by Document().
void Document::slotDeletedObject | ( | const App::DocumentObject & | Obj | ) | [protected] |
Definition at line 401 of file Gui/Document.cpp.
References Gui::DocumentP::_pcInEdit, Gui::DocumentP::_ViewProviderMap, Gui::DocumentP::baseViews, Gui::ViewProviderDocumentObject::getClassTypeId(), Gui::ViewProvider::getTypeId(), Gui::View3DInventor::getViewer(), getViewProvider(), Base::Type::isDerivedFrom(), Gui::View3DInventorViewer::removeViewProvider(), resetEdit(), setModified(), and signalDeletedObject.
Referenced by Document().
void Document::slotNewObject | ( | const App::DocumentObject & | Obj | ) | [protected] |
This slot is connected to the App::Document::signalNewObject(...).
Definition at line 349 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap, Gui::View3DInventorViewer::addViewProvider(), Gui::DocumentP::baseViews, Base::Console(), Base::Type::createInstanceByName(), Gui::ViewProviderDocumentObject::getClassTypeId(), Base::Type::getName(), App::DocumentObject::getNameInDocument(), Base::BaseClass::getTypeId(), App::PropertyContainer::getTypeId(), Gui::View3DInventor::getViewer(), App::DocumentObject::getViewProviderName(), Base::Exception::ReportException(), setModified(), signalNewObject, and Base::Exception::what().
Referenced by Document().
void Document::slotRenamedObject | ( | const App::DocumentObject & | Obj | ) | [protected] |
Definition at line 451 of file Gui/Document.cpp.
References Gui::ViewProviderDocumentObject::getClassTypeId(), getViewProvider(), Base::BaseClass::isDerivedFrom(), and signalRenamedObject.
Referenced by Document().
void Document::slotRestoredDocument | ( | const App::Document & | ) | [protected] |
Definition at line 660 of file Gui/Document.cpp.
References Gui::DocumentP::_ViewProviderMap.
Referenced by Document().
void Document::undo | ( | int | iSteps | ) |
Will UNDO one or more steps.
Definition at line 1056 of file Gui/Document.cpp.
References getDocument(), and App::Document::undo().
Referenced by Gui::View3DInventor::onMsg().
Gui::DocumentPy* Gui::Document::_pcDocPy [protected] |
Definition at line 199 of file Gui/Document.h.
Referenced by Document(), getPyObject(), and ~Document().
boost::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalActivatedObject [mutable] |
signal on activated Object
Definition at line 88 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and slotActivatedObject().
boost::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
Definition at line 84 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and slotChangedObject().
boost::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalDeletedObject [mutable] |
signal on deleted Object
Definition at line 80 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and slotDeletedObject().
boost::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalInEdit [mutable] |
signal on goes in edti mode
Definition at line 90 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and setEdit().
boost::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalNewObject [mutable] |
signal on new Object
Definition at line 78 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and slotNewObject().
boost::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalRenamedObject [mutable] |
signal on renamed Object
Definition at line 86 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and slotRenamedObject().
boost::signal<void (const Gui::ViewProviderDocumentObject&)> Gui::Document::signalResetEdit [mutable] |
signal on leave edit mode
Definition at line 92 of file Gui/Document.h.
Referenced by Gui::DocumentItem::DocumentItem(), and resetEdit().