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=nullptr) |
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 () | |
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 PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type | getTypeId () const |
bool | isDerivedFrom (const Type type) const |
BaseClass & | operator= (const BaseClass &)=default |
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 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) |
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.
typedef std::shared_ptr<ExpandInfo> Gui::DocumentItem::ExpandInfoPtr |
|
protected |
DocumentItem::DocumentItem | ( | const Gui::Document * | doc, |
QTreeWidgetItem * | parent | ||
) |
DocumentItem::~DocumentItem | ( | ) |
void DocumentItem::clearSelection | ( | DocumentObjectItem * | exclude = nullptr | ) |
References updateItemSelection().
Referenced by Gui::TreeWidget::onSelectTimer().
|
protected |
References Base::Console(), DocumentObjectItem, findRootIndex(), getTree(), App::PartialObject, populateItem(), showHidden(), Gui::DocumentObjectItem::testStatus(), and Base::ConsoleSingleton::Warning().
Referenced by populateItem().
Gui::Document * DocumentItem::document | ( | ) | const |
Referenced by Gui::TreeWidget::contextMenuEvent(), Gui::TreeWidget::dropEvent(), femtest.app.test_solver_calculix.TestSolverCalculix::input_file_writing_test(), femtest.app.test_solver_elmer.TestSolverElmer::input_file_writing_test(), femtest.app.test_solver_mystran.TestSolverMystran::input_file_writing_test(), femtest.app.test_ccxtools.TestCcxTools::input_file_writing_test(), femtest.app.test_solver_z88.TestSolverZ88::inputfile_writing_test(), Gui::TreeWidget::mouseDoubleClickEvent(), Gui::TreeWidget::onAllowPartialRecompute(), Gui::TreeWidget::onCloseDoc(), Gui::TreeWidget::onCreateGroup(), Gui::TreeWidget::onMarkRecompute(), Gui::TreeWidget::onReloadDoc(), Gui::TreeWidget::onSelectDependents(), Gui::TreeWidget::onSkipRecompute(), Gui::TreeWidget::onStartEditing(), populateItem(), Restore(), Mod.Show.mTempoVis.TempoVis::restoreCamera(), femtest.app.test_ccxtools.TestCcxTools::result_reading_test(), Mod.Show.mTempoVis.TempoVis::saveCamera(), slotExpandObject(), slotHighlightObject(), Gui::TreeWidget::syncView(), femtest.app.test_ccxtools.TestCcxTools::tearDown(), femtest.app.test_common.TestFemCommon::tearDown(), femtest.app.test_femimport.TestObjectExistance::tearDown(), femtest.app.test_material.TestMaterialUnits::tearDown(), femtest.app.test_mesh.TestMeshCommon::tearDown(), femtest.app.test_mesh.TestMeshEleTetra10::tearDown(), femtest.app.test_mesh.TestMeshGroups::tearDown(), femtest.app.test_object.TestObjectCreate::tearDown(), femtest.app.test_object.TestObjectType::tearDown(), femtest.app.test_open.TestObjectOpen::tearDown(), femtest.app.test_result.TestResult::tearDown(), femtest.app.test_solver_calculix.TestSolverCalculix::tearDown(), femtest.app.test_solver_elmer.TestSolverElmer::tearDown(), femtest.app.test_solver_mystran.TestSolverMystran::tearDown(), femtest.app.test_solver_z88.TestSolverZ88::tearDown(), femtest.gui.test_open.TestObjectOpen::tearDown(), femtest.app.test_common.TestFemCommon::test_adding_refshaps(), femtest.app.test_ccxtools.TestCcxTools::test_box_frequency(), femtest.app.test_solver_calculix.TestSolverCalculix::test_box_frequency(), femtest.app.test_ccxtools.TestCcxTools::test_box_static(), femtest.app.test_solver_calculix.TestSolverCalculix::test_box_static(), femtest.app.test_solver_elmer.TestSolverElmer::test_box_static_0_mm(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_buckling_flexuralbuckling(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_beam_circle(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_beam_pipe(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_beam_rect(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_hexa20(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_ele_hexa20(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_quad4(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_ele_quad4(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_quad8(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_seg2(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_ele_seg2(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_seg3(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_tria3(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_ele_tria3(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_ele_tria6(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_ele_tria6(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_faceload(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_faceload(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_faceload(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_nodeload(), femtest.app.test_solver_mystran.TestSolverMystran::test_ccx_cantilever_nodeload(), femtest.app.test_solver_z88.TestSolverZ88::test_ccx_cantilever_nodeload(), femtest.app.test_solver_calculix.TestSolverCalculix::test_ccx_cantilever_prescribeddisplacement(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_faceload_0_mm(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_faceload_1_si(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_nodeload_0_mm(), femtest.app.test_solver_elmer.TestSolverElmer::test_ccxcantilever_prescribeddisplacement_0_mm(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_centrif(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_contact_shell_shell(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_contact_solid_solid(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_sectionprint(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_selfweight_cantilever(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_tie(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_transform_beam_hinged(), femtest.app.test_solver_calculix.TestSolverCalculix::test_constraint_transform_torque(), femtest.app.test_object.TestObjectType::test_femobjects_derivedfromfem(), femtest.app.test_object.TestObjectType::test_femobjects_derivedfromstd(), femtest.app.test_object.TestObjectType::test_femobjects_isoftype(), femtest.app.test_object.TestObjectCreate::test_femobjects_make(), femtest.app.test_open.TestObjectOpen::test_femobjects_open_de9b3fb438(), femtest.gui.test_open.TestObjectOpen::test_femobjects_open_de9b3fb438(), femtest.app.test_open.TestObjectOpen::test_femobjects_open_head(), femtest.gui.test_open.TestObjectOpen::test_femobjects_open_head(), femtest.app.test_object.TestObjectType::test_femobjects_type(), femtest.app.test_solver_calculix.TestSolverCalculix::test_frequency_beamsimple(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_multiple_bendingbeam_fiveboxes(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_multiple_bendingbeam_fivefaces(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_multiple_tensionrod_twoboxes(), femtest.app.test_solver_calculix.TestSolverCalculix::test_material_nonlinear(), femtest.app.test_solver_mystran.TestSolverMystran::test_mystran_plate(), femtest.app.test_femimport.TestObjectExistance::test_objects_existance(), femtest.app.test_solver_calculix.TestSolverCalculix::test_square_pipe_end_twisted_edgeforces(), femtest.app.test_solver_calculix.TestSolverCalculix::test_square_pipe_end_twisted_nodeforces(), femtest.app.test_solver_calculix.TestSolverCalculix::test_thermomech_bimetall(), femtest.app.test_ccxtools.TestCcxTools::test_thermomech_flow1D(), femtest.app.test_solver_calculix.TestSolverCalculix::test_thermomech_flow1D(), femtest.app.test_ccxtools.TestCcxTools::test_thermomech_spine(), femtest.app.test_solver_calculix.TestSolverCalculix::test_thermomech_spine(), Gui::DocumentObjectItem::testStatus(), Mod.Show.TVStack.TVStack::unwindForSaving(), and Gui::DocumentObjectData::updateChildren().
|
protected |
References DraftVecUtils::find(), findItem(), Gui::DocumentObjectItem::getName(), Gui::ViewProviderDocumentObject::getObject(), App::DocumentObject::getSubObject(), getTree(), Gui::DocumentObjectItem::object(), Gui::TreeWidget::ObjectType, populateItem(), and draftutils.gui_utils::select().
Referenced by findItem(), and findItemByObject().
|
protected |
References findItem(), Gui::DocumentObjectItem::isParentGroup(), and draftutils.gui_utils::select().
Referenced by selectItems(), and slotInEdit().
|
protected |
References App::DocumentObject::getID(), App::DocumentObject::getNameInDocument(), Gui::TreeParams::Instance(), and Gui::TreeWidget::ObjectType.
Referenced by createNewItem(), and populateItem().
|
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.
|
protected |
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().
const char * DocumentItem::getTreeName | ( | ) | const |
Referenced by Gui::DocumentObjectData::getTreeName().
ViewProviderDocumentObject * DocumentItem::getViewProvider | ( | App::DocumentObject * | obj | ) |
References getViewProvider(), and Gui::Application::Instance.
Referenced by getViewProvider(), populateItem(), selectAllInstances(), and Gui::DocumentObjectData::updateChildren().
bool DocumentItem::isObjectShowable | ( | App::DocumentObject * | obj | ) |
Referenced by Gui::DocumentObjectData::updateChildren().
void DocumentItem::populateItem | ( | DocumentObjectItem * | item, |
bool | refresh = false , |
||
bool | delayUpdate = true |
||
) |
References Gui::SelectionObserver::blockSelection(), 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().
bool DocumentItem::populateObject | ( | App::DocumentObject * | obj | ) |
References populateItem().
|
protected |
References populateItem(), and populateParents().
Referenced by populateParents(), and selectAllInstances().
|
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().
|
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.
Implements Base::Persistence.
References Base::Writer::ind(), and Base::Writer::Stream().
void DocumentItem::selectAllInstances | ( | const ViewProviderDocumentObject & | vpd | ) |
void DocumentItem::selectItems | ( | SelectionReason | reason = SR_SELECT | ) |
References findItemByObject(), Gui::Document::getDocument(), App::Document::getName(), Gui::SelectionSingleton::getSelection(), getTree(), Gui::NoResolve, Gui::DocumentObjectItem::object(), Gui::Selection(), showItem(), SR_FORCE_EXPAND, SR_SELECT, and Gui::TreeWidget::syncView().
Referenced by Gui::TreeWidget::onSelectTimer().
void DocumentItem::setShowHidden | ( | bool | show | ) |
References Gui::Document::getDocument(), App::PropertyBool::setValue(), and App::Document::ShowHidden.
Referenced by Gui::TreeWidget::onShowHidden().
bool DocumentItem::showHidden | ( | ) | const |
References Gui::Document::getDocument(), App::PropertyBool::getValue(), and App::Document::ShowHidden.
Referenced by Gui::TreeWidget::contextMenuEvent(), createNewItem(), and populateItem().
bool DocumentItem::showItem | ( | DocumentObjectItem * | item, |
bool | select, | ||
bool | force = false |
||
) |
References App::NoAutoExpand, Gui::TreeWidget::ObjectType, draftutils.gui_utils::select(), and showItem().
Referenced by selectAllInstances(), selectItems(), showItem(), and slotExpandObject().
|
protected |
|
protected |
References document(), App::DocumentObject::getDocument(), getTree(), and Gui::Application::Instance.
Referenced by DocumentItem().
|
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().
|
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().
|
protected |
References getTree().
Referenced by DocumentItem(), and slotRecomputedObject().
|
protected |
References slotRecomputed().
Referenced by DocumentItem().
|
protected |
References getTree().
Referenced by DocumentItem().
|
protected |
References getTree().
Referenced by DocumentItem().
void DocumentItem::testStatus | ( | void | ) |
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().
void DocumentItem::updateItemsVisibility | ( | QTreeWidgetItem * | item, |
bool | show | ||
) |
References Gui::DocumentObjectItem::object(), Gui::TreeWidget::ObjectType, Gui::ViewProviderDocumentObject::showInTree(), and updateItemsVisibility().
Referenced by populateItem(), and updateItemsVisibility().
void Gui::DocumentItem::updateLinks | ( | const ViewProviderDocumentObject & | view | ) |
|
protected |
void DocumentItem::updateSelection | ( | ) |
References Gui::SelectionObserver::blockSelection(), getTree(), and updateSelection().
Referenced by PathScripts.PathJobGui.TaskPanel::addSelection(), PathScripts.PathOpGui.TaskPanel::addSelection(), PathScripts.PathJobGui.TaskPanel::clearSelection(), PathScripts.PathOpGui.TaskPanel::clearSelection(), PathScripts.PathToolLibraryEditor.EditorPanel::duplicate(), PathScripts.PathPreferencesAdvanced.AdvancedPreferencesPage::loadSettings(), PathScripts.PathToolLibraryEditor.EditorPanel::moveDown(), PathScripts.PathToolLibraryEditor.EditorPanel::moveUp(), PathScripts.PathJobGui.TaskPanel::removeSelection(), PathScripts.PathOpGui.TaskPanel::removeSelection(), selectAllInstances(), PathScripts.PathOpGui.TaskPanelDepthsPage::setFields(), PathScripts.PathJobGui.TaskPanel::setSelection(), PathScripts.PathOpGui.TaskPanel::setSelection(), PathScripts.PathJobGui.TaskPanel::setupUi(), and updateSelection().
void DocumentItem::updateSelection | ( | QTreeWidgetItem * | ti, |
bool | unselect = false |
||
) |
References Gui::TreeWidget::ObjectType, updateItemSelection(), and updateSelection().
Referenced by PathScripts.PathJobGui.TaskPanel::addSelection(), PathScripts.PathOpGui.TaskPanel::addSelection(), PathScripts.PathJobGui.TaskPanel::clearSelection(), PathScripts.PathOpGui.TaskPanel::clearSelection(), PathScripts.PathToolLibraryEditor.EditorPanel::duplicate(), PathScripts.PathPreferencesAdvanced.AdvancedPreferencesPage::loadSettings(), PathScripts.PathToolLibraryEditor.EditorPanel::moveDown(), PathScripts.PathToolLibraryEditor.EditorPanel::moveUp(), PathScripts.PathJobGui.TaskPanel::removeSelection(), PathScripts.PathOpGui.TaskPanel::removeSelection(), PathScripts.PathOpGui.TaskPanelDepthsPage::setFields(), PathScripts.PathJobGui.TaskPanel::setSelection(), PathScripts.PathOpGui.TaskPanel::setSelection(), and PathScripts.PathJobGui.TaskPanel::setupUi().
|
friend |
|
friend |
Referenced by createNewItem().
|
friend |