The link between the tree and a document. More...
#include <Tree.h>
Classes | |
class ExpandInfo | |
Public Types | |
typedef std::shared_ptr< ExpandInfo > ExpandInfoPtr | |
enum SelectionReason { SR_SELECT, SR_EXPAND, SR_FORCE_EXPAND } | |
Public Member Functions | |
void clearSelection (DocumentObjectItem *exclude=0) | |
Gui::Document * document () const | |
DocumentItem (const Gui::Document *doc, QTreeWidgetItem *parent) | |
virtual unsigned int getMemSize (void) const override | |
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... | |
TreeWidget * getTree () const | |
const char * getTreeName () const | |
ViewProviderDocumentObject * getViewProvider (App::DocumentObject *) | |
bool isObjectShowable (App::DocumentObject *obj) | |
void populateItem (DocumentObjectItem *item, bool refresh=false, bool delayUpdate=true) | |
bool populateObject (App::DocumentObject *obj) | |
virtual void Restore (Base::XMLReader &) override | |
This method is used to restore properties from an XML document. More... | |
virtual void Save (Base::Writer &) const override | |
This method is used to save properties to an XML document. More... | |
void selectAllInstances (const ViewProviderDocumentObject &vpd) | |
void selectItems (SelectionReason reason=SR_SELECT) | |
void setData (int column, int role, const QVariant &value) override | |
void setShowHidden (bool show) | |
bool showHidden () const | |
bool showItem (DocumentObjectItem *item, bool select, bool force=false) | |
void testStatus (void) | |
void updateItemSelection (DocumentObjectItem *) | |
void updateItemsVisibility (QTreeWidgetItem *item, bool show) | |
void updateLinks (const ViewProviderDocumentObject &view) | |
void updateSelection () | |
void updateSelection (QTreeWidgetItem *, bool unselect=false) | |
~DocumentItem () | |
![]() | |
void dumpToStream (std::ostream &stream, int compression) | |
virtual Base::Type getTypeId (void) const | |
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 SaveDocFile (Writer &) const | |
This method is used to save large amounts of data to a binary file. More... | |
![]() | |
BaseClass () | |
Construction. More... | |
virtual PyObject * getPyObject (void) | |
This method returns the Python wrapper for a C++ object. More... | |
bool isDerivedFrom (const Type type) const | |
virtual void setPyObject (PyObject *) | |
virtual ~BaseClass () | |
Destruction. More... | |
Protected Types | |
typedef std::unordered_map< const ViewProvider *, std::vector< ViewProviderDocumentObject * > > ViewParentMap | |
Friends | |
class DocumentObjectData | |
class DocumentObjectItem | |
class TreeWidget | |
Additional Inherited Members | |
![]() | |
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 void * create (void) | |
static Type getClassTypeId (void) | |
static void init (void) | |
![]() | |
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) | |
Detailed Description
The link between the tree and a document.
Every document in the application gets its associated DocumentItem which controls the visibility and the functions of the document.
Member Typedef Documentation
◆ ExpandInfoPtr
typedef std::shared_ptr<ExpandInfo> Gui::DocumentItem::ExpandInfoPtr |
◆ ViewParentMap
|
protected |
Member Enumeration Documentation
◆ SelectionReason
Constructor & Destructor Documentation
◆ DocumentItem()
DocumentItem::DocumentItem | ( | const Gui::Document * | doc, |
QTreeWidgetItem * | parent | ||
) |
◆ ~DocumentItem()
DocumentItem::~DocumentItem | ( | ) |
Member Function Documentation
◆ clearSelection()
void DocumentItem::clearSelection | ( | DocumentObjectItem * | exclude = 0 | ) |
References updateItemSelection().
Referenced by Gui::TreeWidget::onSelectTimer().
◆ createNewItem()
|
protected |
References Base::Console(), DocumentObjectItem, findRootIndex(), getTree(), App::PartialObject, populateItem(), showHidden(), Gui::DocumentObjectItem::testStatus(), and Base::ConsoleSingleton::Warning().
Referenced by populateItem().
◆ document()
Gui::Document * DocumentItem::document | ( | ) | const |
Referenced by Gui::TreeWidget::contextMenuEvent(), Gui::TreeWidget::dropEvent(), Gui::TreeWidget::mouseDoubleClickEvent(), Gui::TreeWidget::onAllowPartialRecompute(), Gui::TreeWidget::onCloseDoc(), Gui::TreeWidget::onCreateGroup(), Gui::TreeWidget::onMarkRecompute(), Gui::TreeWidget::onReloadDoc(), Gui::TreeWidget::onSkipRecompute(), Gui::TreeWidget::onStartEditing(), populateItem(), Restore(), slotExpandObject(), slotHighlightObject(), Gui::TreeWidget::syncView(), Gui::DocumentObjectItem::testStatus(), and Gui::DocumentObjectData::updateChildren().
◆ findItem()
|
protected |
◆ findItemByObject()
|
protected |
References findItem(), and Gui::DocumentObjectItem::isParentGroup().
Referenced by selectItems(), and slotInEdit().
◆ findRootIndex()
|
protected |
References App::DocumentObject::getID(), App::DocumentObject::getNameInDocument(), Gui::TreeParams::Instance(), and Gui::TreeWidget::ObjectType.
Referenced by createNewItem(), and populateItem().
◆ getMemSize()
|
overridevirtual |
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.
◆ getTopParent()
|
protected |
◆ getTree()
TreeWidget * DocumentItem::getTree | ( | ) | const |
Referenced by createNewItem(), DocumentItem(), findItem(), populateItem(), Restore(), selectAllInstances(), selectItems(), slotExpandObject(), slotHighlightObject(), slotInEdit(), slotNewObject(), slotRecomputed(), slotResetEdit(), slotScrollToObject(), updateItemSelection(), updateSelection(), and Gui::DocumentObjectItem::~DocumentObjectItem().
◆ getTreeName()
const char * DocumentItem::getTreeName | ( | ) | const |
Referenced by Gui::DocumentObjectData::getTreeName().
◆ getViewProvider()
ViewProviderDocumentObject * DocumentItem::getViewProvider | ( | App::DocumentObject * | obj | ) |
◆ isObjectShowable()
bool DocumentItem::isObjectShowable | ( | App::DocumentObject * | obj | ) |
Referenced by Gui::DocumentObjectData::updateChildren().
◆ populateItem()
void DocumentItem::populateItem | ( | DocumentObjectItem * | item, |
bool | refresh = false , |
||
bool | delayUpdate = true |
||
) |
References Gui::SelectionObserver::blockConnection(), createNewItem(), document(), findRootIndex(), Gui::ViewProviderDocumentObject::getDocument(), App::DocumentObject::getFullName(), App::DocumentObject::getLinkedObject(), Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::getOwnerDocument(), getTree(), getViewProvider(), Gui::DocumentObjectItem::isChildOfItem(), Gui::DocumentObjectItem::object(), Gui::TreeWidget::ObjectType, Gui::DocumentObjectItem::requiredAtRoot(), Gui::DocumentObjectItem::setHighlight(), showHidden(), and updateItemsVisibility().
Referenced by createNewItem(), findItem(), populateObject(), populateParents(), and slotExpandObject().
◆ populateObject()
bool DocumentItem::populateObject | ( | App::DocumentObject * | obj | ) |
References populateItem().
◆ populateParents()
|
protected |
References populateItem().
Referenced by selectAllInstances().
◆ Restore()
|
overridevirtual |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
Implements Base::Persistence.
References document(), getTree(), Base::XMLReader::hasAttribute(), and Base::XMLReader::readElement().
◆ Save()
|
overridevirtual |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
- See also
- Base::Writer
Implements Base::Persistence.
References Base::Writer::ind(), and Base::Writer::Stream().
◆ selectAllInstances()
void DocumentItem::selectAllInstances | ( | const ViewProviderDocumentObject & | vpd | ) |
◆ selectItems()
void DocumentItem::selectItems | ( | SelectionReason | reason = SR_SELECT | ) |
References findItemByObject(), Gui::Document::getDocument(), App::Document::getName(), Gui::SelectionSingleton::getSelection(), getTree(), Gui::DocumentObjectItem::object(), Gui::Selection(), showItem(), SR_FORCE_EXPAND, SR_SELECT, and Gui::TreeWidget::syncView().
Referenced by Gui::TreeWidget::onSelectTimer().
◆ setData()
|
override |
References Gui::Document::getDocument(), App::Document::Label, and App::PropertyString::setValue().
◆ setShowHidden()
void DocumentItem::setShowHidden | ( | bool | show | ) |
References Gui::Document::getDocument(), App::PropertyBool::setValue(), and App::Document::ShowHidden.
Referenced by Gui::TreeWidget::onShowHidden().
◆ showHidden()
bool DocumentItem::showHidden | ( | ) | const |
References Gui::Document::getDocument(), App::PropertyBool::getValue(), and App::Document::ShowHidden.
Referenced by Gui::TreeWidget::contextMenuEvent(), createNewItem(), and populateItem().
◆ showItem()
bool DocumentItem::showItem | ( | DocumentObjectItem * | item, |
bool | select, | ||
bool | force = false |
||
) |
References App::NoAutoExpand, and Gui::TreeWidget::ObjectType.
Referenced by selectAllInstances(), selectItems(), and slotExpandObject().
◆ slotExpandObject()
|
protected |
◆ slotHighlightObject()
|
protected |
◆ slotInEdit()
|
protected |
Removes a view provider from the document item.
If this view provider is not added nothing happens.
References Gui::Application::editDocument(), findItemByObject(), App::GetApplication(), Gui::ViewProviderDocumentObject::getObject(), App::Application::GetParameterGroupByPath(), getTree(), ParameterGrp::GetUnsigned(), and Gui::Application::Instance.
Referenced by DocumentItem().
◆ slotNewObject()
|
protected |
Adds a view provider to the document item.
If this view provider is already added nothing happens.
References Gui::Document::getDocument(), App::Document::getName(), and getTree().
Referenced by DocumentItem().
◆ slotRecomputed()
|
protected |
References getTree().
Referenced by DocumentItem(), and slotRecomputedObject().
◆ slotRecomputedObject()
|
protected |
References slotRecomputed().
Referenced by DocumentItem().
◆ slotResetEdit()
|
protected |
References getTree(), Gui::DocumentObjectItem::object(), and Gui::DocumentObjectItem::setData().
Referenced by DocumentItem().
◆ slotScrollToObject()
|
protected |
References getTree().
Referenced by DocumentItem().
◆ testStatus()
void DocumentItem::testStatus | ( | void | ) |
◆ updateItemSelection()
void DocumentItem::updateItemSelection | ( | DocumentObjectItem * | item | ) |
References App::DocumentObject::getNameInDocument(), Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::getParentItem(), Gui::DocumentObjectItem::getSubName(), getTree(), App::ExtensionContainer::hasExtension(), Gui::DocumentObjectItem::isGroup(), Gui::DocumentObjectItem::object(), Gui::SelectionSingleton::rmvSelection(), Gui::Selection(), and Gui::TreeWidget::syncView().
Referenced by clearSelection(), and updateSelection().
◆ updateItemsVisibility()
void DocumentItem::updateItemsVisibility | ( | QTreeWidgetItem * | item, |
bool | show | ||
) |
References Gui::TreeWidget::ObjectType.
Referenced by populateItem().
◆ updateLinks()
void Gui::DocumentItem::updateLinks | ( | const ViewProviderDocumentObject & | view | ) |
◆ updateObject()
|
protected |
◆ updateSelection() [1/2]
void DocumentItem::updateSelection | ( | ) |
References Gui::SelectionObserver::blockConnection(), and getTree().
Referenced by PathScripts.PathOpGui.TaskPanel::addSelection(), PathScripts.PathJobGui.TaskPanel::addSelection(), PathScripts.PathOpGui.TaskPanel::clearSelection(), PathScripts.PathJobGui.TaskPanel::clearSelection(), PathScripts.PathToolLibraryEditor.EditorPanel::duplicate(), PathScripts.PathToolLibraryEditor.EditorPanel::moveDown(), PathScripts.PathToolLibraryEditor.EditorPanel::moveUp(), PathScripts.PathOpGui.TaskPanel::removeSelection(), PathScripts.PathJobGui.TaskPanel::removeSelection(), selectAllInstances(), PathScripts.PathOpGui.TaskPanelDepthsPage::setFields(), PathScripts.PathOpGui.TaskPanel::setSelection(), PathScripts.PathJobGui.TaskPanel::setSelection(), PathScripts.PathToolBitGui.ToolBitSelector::setupUI(), PathScripts.PathJobGui.TaskPanel::setupUi(), updateSelection(), and PathScripts.PathToolBitGui.ToolBitSelector::updateTools().
◆ updateSelection() [2/2]
void DocumentItem::updateSelection | ( | QTreeWidgetItem * | ti, |
bool | unselect = false |
||
) |
References Gui::TreeWidget::ObjectType, updateItemSelection(), and updateSelection().
Referenced by PathScripts.PathOpGui.TaskPanel::addSelection(), PathScripts.PathJobGui.TaskPanel::addSelection(), PathScripts.PathOpGui.TaskPanel::clearSelection(), PathScripts.PathJobGui.TaskPanel::clearSelection(), PathScripts.PathToolLibraryEditor.EditorPanel::duplicate(), PathScripts.PathToolLibraryEditor.EditorPanel::moveDown(), PathScripts.PathToolLibraryEditor.EditorPanel::moveUp(), PathScripts.PathOpGui.TaskPanel::removeSelection(), PathScripts.PathJobGui.TaskPanel::removeSelection(), PathScripts.PathOpGui.TaskPanelDepthsPage::setFields(), PathScripts.PathOpGui.TaskPanel::setSelection(), PathScripts.PathJobGui.TaskPanel::setSelection(), PathScripts.PathToolBitGui.ToolBitSelector::setupUI(), PathScripts.PathJobGui.TaskPanel::setupUi(), and PathScripts.PathToolBitGui.ToolBitSelector::updateTools().
Friends And Related Function Documentation
◆ DocumentObjectData
|
friend |
◆ DocumentObjectItem
|
friend |
Referenced by createNewItem().
◆ TreeWidget
|
friend |
The documentation for this class was generated from the following files:
- src/Gui/Tree.h
- src/Gui/Tree.cpp