The ViewProviderT class is a helper class to store the names of a view provider and its document. More...
#include <DocumentObserver.h>
Public Member Functions | |
std::string | getAppDocumentPython () const |
Document * | getDocument () const |
const std::string & | getDocumentName () const |
std::string | getGuiDocumentPython () const |
template<typename T > | |
T * | getObjectAs () const |
const std::string & | getObjectName () const |
std::string | getObjectPython () const |
ViewProviderDocumentObject * | getViewProvider () const |
void | operator= (const ViewProviderDocumentObject *) |
ViewProviderT & | operator= (const ViewProviderT &) |
ViewProviderT & | operator= (ViewProviderT &&) |
bool | operator== (const ViewProviderT &) const |
ViewProviderT () | |
ViewProviderT (const ViewProviderDocumentObject *) | |
ViewProviderT (const ViewProviderT &) | |
ViewProviderT (ViewProviderT &&) | |
~ViewProviderT () | |
The ViewProviderT class is a helper class to store the names of a view provider and its document.
This can be useful when you cannot rely on that the document or the object still exists when you have to access it.
ViewProviderT::ViewProviderT | ( | ) |
Constructor
ViewProviderT::ViewProviderT | ( | const ViewProviderT & | other | ) |
Constructor
ViewProviderT::ViewProviderT | ( | ViewProviderT && | other | ) |
Constructor
References draftfunctions.move::move().
ViewProviderT::ViewProviderT | ( | const ViewProviderDocumentObject * | obj | ) |
Constructor
ViewProviderT::~ViewProviderT | ( | ) |
Destructor
std::string ViewProviderT::getAppDocumentPython | ( | ) | const |
Get the App::Document as Python command.
References Gui::DocumentT::getAppDocumentPython().
Document * ViewProviderT::getDocument | ( | void | ) | const |
Get a pointer to the document or 0 if it doesn't exist any more.
References Gui::Application::getDocument(), and Gui::Application::Instance.
Referenced by getViewProvider(), and Gui::ViewProviderPythonFeatureT< ViewProviderT >::onChanged().
const std::string & ViewProviderT::getDocumentName | ( | ) | const |
Get the name of the document.
std::string ViewProviderT::getGuiDocumentPython | ( | ) | const |
Get the Gui::Document as Python command.
References Gui::DocumentT::getGuiDocumentPython().
T * Gui::ViewProviderT::getObjectAs | ( | ) | const |
Get a pointer to the document or 0 if it doesn't exist any more or the type doesn't match.
const std::string & ViewProviderT::getObjectName | ( | ) | const |
Get the name of the document object.
std::string ViewProviderT::getObjectPython | ( | ) | const |
Get the document object as Python command.
References Gui::Application::activeDocument(), and Gui::Application::Instance.
ViewProviderDocumentObject * ViewProviderT::getViewProvider | ( | ) | const |
Get a pointer to the document object or 0 if it doesn't exist any more.
References getDocument().
void ViewProviderT::operator= | ( | const ViewProviderDocumentObject * | obj | ) |
Assignment operator
ViewProviderT & ViewProviderT::operator= | ( | const ViewProviderT & | obj | ) |
Assignment operator
ViewProviderT & ViewProviderT::operator= | ( | ViewProviderT && | obj | ) |
Assignment operator
References draftfunctions.move::move().
bool ViewProviderT::operator== | ( | const ViewProviderT & | other | ) | const |
Equality operator