The document class. More...
#include <Document.h>
Public Types | |
enum Status { SkipRecompute = 0, KeepTrailingDigits = 1, Closable = 2, Restoring = 3, Recomputing = 4, PartialRestore = 5, Importing = 6, PartialDoc = 7, AllowPartialRecompute = 8 } | |
Public Member Functions | |
Object handling | |
| |
DocumentObject * addObject (const char *sType, const char *pObjectName=0, bool isNew=true, const char *viewType=0, bool isPartial=false) | |
Add a feature of sType with sName (ASCII) to this document and set it active. More... | |
std::vector< DocumentObject * > addObjects (const char *sType, const std::vector< std::string > &objectNames, bool isNew=true) | |
Add an array of features of the given types and names. More... | |
void removeObject (const char *sName) | |
Remove a feature out of the document. More... | |
void addObject (DocumentObject *, const char *pObjectName=0) | |
Add an existing feature with sName (ASCII) to this document and set it active. More... | |
std::vector< DocumentObject * > copyObject (const std::vector< DocumentObject * > &objs, bool recursive=false) | |
Copy objects from another document to this document. More... | |
DocumentObject * moveObject (DocumentObject *obj, bool recursive=false) | |
Move an object from another document to this document If recursive is true then all objects this object depends on are moved as well. More... | |
DocumentObject * getActiveObject (void) const | |
Returns the active Object of this document. More... | |
DocumentObject * getObject (const char *Name) const | |
Returns a Object of this document. More... | |
DocumentObject * getObjectByID (long id) const | |
Returns a Object of this document by its id. More... | |
bool isIn (const DocumentObject *pFeat) const | |
Returns true if the DocumentObject is contained in this document. More... | |
const char * getObjectName (DocumentObject *pFeat) const | |
Returns a Name of an Object or 0. More... | |
std::string getUniqueObjectName (const char *Name) const | |
Returns a Name of an Object or 0. More... | |
std::string getStandardObjectName (const char *Name, int d) const | |
Returns a name of the form prefix_number. d specifies the number of digits. More... | |
std::vector< DocumentObject * > getDependingObjects () const | |
Returns a list of document's objects including the dependencies. More... | |
const std::vector< DocumentObject * > & getObjects () const | |
Returns a list of all Objects. More... | |
std::vector< DocumentObject * > getObjectsOfType (const Base::Type &typeId) const | |
std::vector< DocumentObject * > getObjectsWithExtension (const Base::Type &typeId, bool derived=true) const | |
Returns all object with given extensions. If derived=true also all objects with extensions derived from the given one. More... | |
std::vector< DocumentObject * > findObjects (const Base::Type &typeId, const char *objname) const | |
template<typename T > | |
std::vector< T * > getObjectsOfType () const | |
Returns an array with the correct types already. More... | |
int countObjectsOfType (const Base::Type &typeId) const | |
int countObjects (void) const | |
get the number of objects in the document More... | |
methods for modification and state handling | |
void purgeTouched () | |
Remove all modifications. After this call The document becomes Valid again. More... | |
bool isTouched (void) const | |
check if there is any touched object in this document More... | |
bool mustExecute (void) const | |
check if there is any object must execute in this document More... | |
std::vector< App::DocumentObject * > getTouched (void) const | |
returns all touched objects More... | |
void setClosable (bool) | |
set the document to be closable, this is on by default. More... | |
bool isClosable () const | |
check whether the document can be closed More... | |
int recompute (const std::vector< App::DocumentObject * > &objs={}, bool force=false, bool *hasError=0, int options=0) | |
Recompute touched features and return the number of recalculated features. More... | |
bool recomputeFeature (DocumentObject *Feat, bool recursive=false) | |
Recompute only one feature. More... | |
const char * getErrorDescription (const App::DocumentObject *) const | |
get the text of the error of a specified object More... | |
bool testStatus (Status pos) const | |
return the status bits More... | |
void setStatus (Status pos, bool on) | |
set the status bits More... | |
methods for the UNDO REDO and Transaction handling | |
Introduce a new concept of transaction ID. Each transaction must be unique inside the document. Multiple transactions from different documents can be grouped together with the same transaction ID. When undo, Gui component can query getAvailableUndo(id) to see if it is possible to undo with a given ID. If there more than one undo transactions, meaning that there are other transactions before the given ID. The Gui component shall ask user if he wants to undo multiple steps. And if the user agrees, call undo(id) to unroll all transaction before and including the the one with the give ID. Same applies for redo. The new transaction ID describe here is fully backward compatible. Calling the APIs with a default id=0 gives the original behavior. | |
void setUndoMode (int iMode) | |
switch the level of Undo/Redo More... | |
int getUndoMode (void) const | |
switch the level of Undo/Redo More... | |
void setTransactionMode (int iMode) | |
switch the transaction mode More... | |
void openTransaction (const char *name=0) | |
Open a new command Undo/Redo, an UTF-8 name can be specified. More... | |
void renameTransaction (const char *name, int id) | |
Rename the current transaction if the id matches. More... | |
void commitTransaction () | |
Commit the Command transaction. Do nothing If there is no Command transaction open. More... | |
void abortTransaction () | |
Abort the actually running transaction. More... | |
bool hasPendingTransaction () const | |
Check if a transaction is open. More... | |
int getTransactionID (bool undo, unsigned pos=0) const | |
Return the undo/redo transaction ID starting from the back. More... | |
bool isTransactionEmpty () const | |
Check if a transaction is open and its list is empty. More... | |
void setUndoLimit (unsigned int UndoMemSize=0) | |
Set the Undo limit in Byte! More... | |
unsigned int getUndoMemSize (void) const | |
Returns the actual memory consumption of the Undo redo stuff. More... | |
void setMaxUndoStackSize (unsigned int UndoMaxStackSize=20) | |
Set the Undo limit as stack size. More... | |
unsigned int getMaxUndoStackSize (void) const | |
Set the Undo limit as stack size. More... | |
void clearUndos () | |
Remove all stored Undos and Redos. More... | |
int getAvailableUndos (int id=0) const | |
Returns the number of stored Undos. If greater than 0 Undo will be effective. More... | |
std::vector< std::string > getAvailableUndoNames () const | |
Returns a list of the Undo names. More... | |
bool undo (int id=0) | |
Will UNDO one step, returns False if no undo was done (Undos == 0). More... | |
int getAvailableRedos (int id=0) const | |
Returns the number of stored Redos. If greater than 0 Redo will be effective. More... | |
std::vector< std::string > getAvailableRedoNames () const | |
Returns a list of the Redo names. More... | |
bool redo (int id=0) | |
Will REDO one step, returns False if no redo was done (Redos == 0). More... | |
bool isPerformingTransaction () const | |
returns true if the document is in an Transaction phase, e.g. currently performing a redo/undo or rollback More... | |
void addOrRemovePropertyOfObject (TransactionalObject *, Property *prop, bool add) | |
![]() | |
virtual App::Property * addDynamicProperty (const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false) | |
virtual App::Property * getDynamicPropertyByName (const char *name) const | |
DynamicProperty::PropData getDynamicPropertyData (const Property *prop) const | |
virtual std::vector< std::string > getDynamicPropertyNames () const | |
virtual Property * getPropertyByName (const char *name) const | |
find a property by its name More... | |
virtual const char * getPropertyDocumentation (const char *name) const | |
get the Group of a named Property More... | |
virtual const char * getPropertyDocumentation (const Property *prop) const | |
get the Group of a Property More... | |
virtual const char * getPropertyGroup (const char *name) const | |
get the Group of a named Property More... | |
virtual const char * getPropertyGroup (const Property *prop) const | |
get the Group of a Property More... | |
virtual void getPropertyList (std::vector< Property * > &List) const | |
get all properties of the class (including properties of the parent) More... | |
virtual void getPropertyMap (std::map< std::string, Property * > &Map) const | |
get all properties of the class (including properties of the parent) More... | |
virtual const char * getPropertyName (const Property *prop) const | |
get the name of a property More... | |
const char * getPropertyPrefix () const | |
virtual short getPropertyType (const char *name) const | |
get the Type of a named Property More... | |
virtual short getPropertyType (const Property *prop) const | |
get the Type of a Property More... | |
bool isHidden (const char *name) const | |
check if the named property is hidden More... | |
bool isHidden (const Property *prop) const | |
check if the property is hidden More... | |
bool isReadOnly (const char *name) const | |
check if the named property is read-only More... | |
bool isReadOnly (const Property *prop) const | |
check if the property is read-only More... | |
virtual void onPropertyStatusChanged (const Property &prop, unsigned long oldStatus) | |
PropertyContainer () | |
A constructor. More... | |
virtual bool removeDynamicProperty (const char *name) | |
void setPropertyPrefix (const char *prefix) | |
void setPropertyStatus (unsigned char bit, bool value) | |
set the Status bit of all properties at once More... | |
virtual ~PropertyContainer () | |
A destructor. More... | |
![]() | |
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... | |
bool isDerivedFrom (const Type type) const | |
virtual void setPyObject (PyObject *) | |
virtual ~BaseClass () | |
Destruction. More... | |
Public Attributes | |
Properties | |
PropertyString Label | |
holds the long name of the document (utf-8 coded) More... | |
PropertyString FileName | |
full qualified (with path) file name (utf-8 coded) More... | |
PropertyString CreatedBy | |
creators name (utf-8) More... | |
PropertyString CreationDate | |
PropertyString LastModifiedBy | |
user last modified the document More... | |
PropertyString LastModifiedDate | |
PropertyString Company | |
company name UTF8(optional) More... | |
PropertyString Comment | |
long comment or description (UTF8 with line breaks) More... | |
PropertyString Id | |
Id e.g. Part number. More... | |
PropertyUUID Uid | |
unique identifier of the document More... | |
App::PropertyString License | |
License string Holds the short license string for the Item, e.g. More... | |
App::PropertyString LicenseURL | |
License description/contract URL. More... | |
App::PropertyMap Meta | |
Meta descriptions. More... | |
App::PropertyMap Material | |
Material descriptions, used and defined in the Material module. More... | |
PropertyString TransientDir | |
read-only name of the temp dir created when the document is opened More... | |
PropertyLink Tip | |
Tip object of the document (if any) More... | |
PropertyString TipName | |
Tip object of the document (if any) More... | |
PropertyBool ShowHidden | |
Whether to show hidden items in TreeView. More... | |
Signals of the document | |
boost::signals2::signal< void(const App::Document &, const App::Property &)> signalBeforeChange | |
signal before changing an doc property More... | |
boost::signals2::signal< void(const App::Document &, const App::Property &)> signalChanged | |
signal on changed doc property More... | |
boost::signals2::signal< void(const App::DocumentObject &)> signalNewObject | |
signal on new Object More... | |
boost::signals2::signal< void(const App::DocumentObject &)> signalDeletedObject | |
signal on deleted Object More... | |
boost::signals2::signal< void(const App::DocumentObject &, const App::Property &)> signalBeforeChangeObject | |
signal before changing an Object More... | |
boost::signals2::signal< void(const App::DocumentObject &, const App::Property &)> signalChangedObject | |
signal on changed Object More... | |
boost::signals2::signal< void(const App::DocumentObject &)> signalTouchedObject | |
signal on manually called DocumentObject::touch() More... | |
boost::signals2::signal< void(const App::DocumentObject &)> signalRelabelObject | |
signal on relabeled Object More... | |
boost::signals2::signal< void(const App::DocumentObject &)> signalActivatedObject | |
signal on activated Object More... | |
boost::signals2::signal< void(const App::DocumentObject &, Transaction *)> signalTransactionAppend | |
signal on created object More... | |
boost::signals2::signal< void(const App::DocumentObject &, Transaction *)> signalTransactionRemove | |
signal on removed object More... | |
boost::signals2::signal< void(const App::Document &)> signalUndo | |
signal on undo More... | |
boost::signals2::signal< void(const App::Document &)> signalRedo | |
signal on redo More... | |
boost::signals2::signal< void(Base::Writer &)> signalSaveDocument | |
signal on load/save document this signal is given when the document gets streamed. More... | |
boost::signals2::signal< void(Base::XMLReader &)> signalRestoreDocument | |
boost::signals2::signal< void(const std::vector< App::DocumentObject * > &, Base::Writer &)> signalExportObjects | |
boost::signals2::signal< void(const std::vector< App::DocumentObject * > &, Base::Writer &)> signalExportViewObjects | |
boost::signals2::signal< void(const std::vector< App::DocumentObject * > &, Base::XMLReader &)> signalImportObjects | |
boost::signals2::signal< void(const std::vector< App::DocumentObject * > &, Base::Reader &, const std::map< std::string, std::string > &)> signalImportViewObjects | |
boost::signals2::signal< void(const std::vector< App::DocumentObject * > &)> signalFinishImportObjects | |
boost::signals2::signal< void(const App::Document &, const std::string &)> signalStartSave | |
boost::signals2::signal< void(const App::Document &, const std::string &)> signalFinishSave | |
boost::signals2::signal< void(const App::Document &)> signalBeforeRecompute | |
boost::signals2::signal< void(const App::Document &, const std::vector< App::DocumentObject * > &)> signalRecomputed | |
boost::signals2::signal< void(const App::DocumentObject &)> signalRecomputedObject | |
boost::signals2::signal< void(const App::Document &, std::string)> signalOpenTransaction | |
boost::signals2::signal< void(const App::Document &)> signalCommitTransaction | |
boost::signals2::signal< void(const App::Document &)> signalAbortTransaction | |
boost::signals2::signal< void(const App::Document &, const std::vector< App::DocumentObject * > &)> signalSkipRecompute | |
boost::signals2::signal< void(const App::DocumentObject &)> signalFinishRestoreObject | |
boost::signals2::signal< void(const App::Document &, const App::Property &)> signalChangePropertyEditor | |
void clearDocument () | |
File handling of the document | |
enum ExportStatus { NotExporting, Exporting } | |
bool save (void) | |
Save the Document under a new Name. More... | |
bool saveAs (const char *file) | |
bool saveCopy (const char *file) const | |
void restore (const char *filename=0, bool delaySignal=false, const std::set< std::string > &objNames={}) | |
Restore the document from the file in Property Path. More... | |
void afterRestore (bool checkPartial=false) | |
bool afterRestore (const std::vector< App::DocumentObject * > &, bool checkPartial=false) | |
ExportStatus isExporting (const App::DocumentObject *obj) const | |
void exportObjects (const std::vector< App::DocumentObject * > &, std::ostream &) | |
void exportGraphviz (std::ostream &) const | |
std::vector< App::DocumentObject * > importObjects (Base::XMLReader &reader) | |
std::vector< App::DocumentObject * > importLinks (const std::vector< App::DocumentObject * > &objs={}) | |
Import any externally linked objects. More... | |
bool isSaved () const | |
Opens the document from its file name. More... | |
const char * getName () const | |
Get the document name. More... | |
virtual void Save (Base::Writer &writer) const override | |
This method is used to save properties to an XML document. More... | |
virtual void Restore (Base::XMLReader &reader) override | |
This method is used to restore properties from an XML document. More... | |
unsigned int getMemSize (void) const override | |
returns the complete document memory consumption, including all managed DocObjects and Undo Redo. More... | |
dependency stuff | |
enum DependencyOption { DepSort = 1, DepNoXLinked = 2, DepNoCycle = 4 } | |
Option bit flags used by getDepenencyList() More... | |
class Application | |
class TransactionalObject | |
because of transaction handling More... | |
class DocumentObject | |
The DocumentObject that will own the expression. More... | |
class Transaction | |
class TransactionDocumentObject | |
void writeDependencyGraphViz (std::ostream &out) | |
write GraphViz file More... | |
bool checkOnCycle (void) | |
checks if the graph is directed and has no cycles More... | |
std::vector< App::DocumentObject * > getInList (const DocumentObject *me) const | |
get a list of all objects linking to the given object More... | |
std::vector< App::Document * > getDependentDocuments (bool sort=true) | |
std::vector< App::DocumentObject * > topologicalSort () const | |
get a list of topological sorted objects (https://en.wikipedia.org/wiki/Topological_sorting) More... | |
std::vector< App::DocumentObject * > getRootObjects () const | |
get all root objects (objects no other one reference too) More... | |
std::vector< std::list< App::DocumentObject * > > getPathsByOutList (const App::DocumentObject *from, const App::DocumentObject *to) const | |
get all possible paths from one object to another following the OutList More... | |
void getLinksTo (std::set< DocumentObject * > &links, const DocumentObject *obj, int options, int maxCount=0, const std::vector< DocumentObject * > &objs={}) const | |
Return the links to a given object. More... | |
bool hasLinksTo (const DocumentObject *obj) const | |
Check if there is any link to the given object. More... | |
void addRecomputeObject (DocumentObject *obj) | |
Called by objects during restore to ask for recompute. More... | |
const std::string & getOldLabel () const | |
void renameObjectIdentifiers (const std::map< App::ObjectIdentifier, App::ObjectIdentifier > &paths, const std::function< bool(const App::DocumentObject *)> &selector=[](const App::DocumentObject *) { return true;}) | |
Function called to signal that an object identifier has been renamed. More... | |
virtual PyObject * getPyObject (void) override | |
This method returns the Python wrapper for a C++ object. More... | |
virtual std::string getFullName () const override | |
virtual ~Document () | |
Destruction. More... | |
static std::vector< App::DocumentObject * > getDependencyList (const std::vector< App::DocumentObject * > &objs, int options=0) | |
Get a complete list of all objects the given objects depend on. More... | |
static std::vector< App::Document * > getDependentDocuments (std::vector< App::Document * > docs, bool sort) | |
static bool isAnyRestoring () | |
Indicate if there is any document restoring/importing. More... | |
Document (const char *name="") | |
Construction. More... | |
void breakDependency (DocumentObject *pcObject, bool clear) | |
std::vector< App::DocumentObject * > readObjects (Base::XMLReader &reader) | |
void writeObjects (const std::vector< App::DocumentObject * > &, Base::Writer &writer) const | |
bool saveToFile (const char *filename) const | |
void onBeforeChange (const Property *prop) override | |
get called before the value is changed More... | |
void onChanged (const Property *prop) override | |
get called by the container when a property has changed More... | |
void onBeforeChangeProperty (const TransactionalObject *Who, const Property *What) | |
callback from the Document objects before property will be changed More... | |
void onChangedProperty (const DocumentObject *Who, const Property *What) | |
callback from the Document objects after property was changed More... | |
std::string getTransientDirectoryName (const std::string &uuid, const std::string &filename) const | |
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) | |
![]() | |
virtual const PropertyData & getPropertyData (void) const | |
virtual void handleChangedPropertyName (Base::XMLReader &reader, const char *TypeName, const char *PropName) | |
PropertyContainer::handleChangedPropertyName is called during restore to possibly fix reading of older versions of this property container. More... | |
virtual void handleChangedPropertyType (Base::XMLReader &reader, const char *TypeName, Property *prop) | |
PropertyContainer::handleChangedPropertyType is called during restore to possibly fix reading of older versions of the property container. More... | |
![]() | |
static const PropertyData * getPropertyDataPtr (void) | |
![]() | |
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) | |
![]() | |
DynamicProperty dynamicProps | |
Detailed Description
The document class.
This is besides the Application class the most important class in FreeCAD It contains all the data of the opened, saved or newly created FreeCAD Document. The Document manage the Undo and Redo mechanism and the linking of documents.
Note: the documents are not free objects. They are completely handled by the App::Application. Only the Application can Open or destroy a document.
Exception handling
As the document is the main data structure of FreeCAD we have to take a close look at how Exceptions affect the integrity of the App::Document.
Undo Redo an Transactions
Undo Redo handling is one of the major mechanism of a document in terms of user friendliness and speed (no one will wait for Undo too long).
Graph and dependency handling
The FreeCAD document handles the dependencies of its DocumentObjects with an adjacence list. This gives the opportunity to calculate the shortest recompute path. Also, it enables more complicated dependencies beyond trees.
- See also
- App::Application
- App::DocumentObject
Member Enumeration Documentation
◆ DependencyOption
Option bit flags used by getDepenencyList()
Enumerator | |
---|---|
DepSort | Return topological sorted list. |
DepNoXLinked | Do no include object linked by PropertyXLink, as it can handle external link. |
DepNoCycle | Raise exception on cycles. |
◆ ExportStatus
◆ Status
Constructor & Destructor Documentation
◆ ~Document()
|
virtual |
◆ Document()
|
protected |
Construction.
References Comment, Company, CreatedBy, CreationDate, Base::TimeInfo::currentDateTimeString(), FileName, App::GetApplication(), ParameterGrp::GetASCII(), ParameterGrp::GetInt(), App::Application::GetParameterGroupByPath(), Id, Label, LastModifiedBy, LastModifiedDate, License, LicenseURL, Base::ConsoleSingleton::Log(), Meta, App::Prop_Hidden, App::Prop_None, App::Prop_ReadOnly, App::Prop_Transient, ShowHidden, Tip, TipName, App::Property::touch(), TransientDir, and Uid.
Member Function Documentation
◆ abortTransaction()
void Document::abortTransaction | ( | ) |
Abort the actually running transaction.
References App::DocumentP::activeUndoTransaction, App::Application::closeActiveTransaction(), App::DocumentP::committing, App::GetApplication(), App::Transaction::getID(), and isPerformingTransaction().
Referenced by Gui::Document::abortCommand(), App::DocumentPy::abortTransaction(), and MeshPartGui::Tessellation::accept().
◆ addObject() [1/2]
DocumentObject * Document::addObject | ( | const char * | sType, |
const char * | pObjectName = 0 , |
||
bool | isNew = true , |
||
const char * | viewType = 0 , |
||
bool | isPartial = false |
||
) |
Add a feature of sType with sName (ASCII) to this document and set it active.
Unicode names are set through the Label property.
- Parameters
-
sType the type of created object pObjectName if nonNULL use that name otherwise generate a new unique name based on the sType isNew if false don't call the DocumentObject::setupObject()
callback (default is true)viewType override object's view provider name isPartial indicate if this object is meant to be partially loaded
References App::DocumentP::activeObject, App::DocumentP::activeUndoTransaction, App::Transaction::addObjectDel(), Base::Type::createInstanceByName(), Base::Persistence::getClassTypeId(), getUniqueObjectName(), App::DocumentObject::getViewProviderNameOverride(), App::DocumentObject::Label, App::DocumentP::lastObjectId, App::DocumentP::objectArray, App::DocumentP::objectIdMap, App::DocumentP::objectMap, App::DocumentObject::pcNameInDocument, Restoring, App::DocumentP::rollback, App::DocumentObject::setDocument(), App::DocumentObject::setStatus(), App::DocumentObject::setupObject(), App::PropertyString::setValue(), signalActivatedObject, signalNewObject, signalTransactionAppend, App::DocumentP::StatusBits, and App::DocumentP::undoing.
Referenced by MeshGui::Segmentation::accept(), ReverseEngineeringGui::Segmentation::accept(), MeshGui::SegmentationBestFit::accept(), Import::ImpExpDxfRead::AddGraphics(), DraftUtils::DraftDxfRead::AddGraphics(), Import::ImpExpDxfRead::AddObject(), App::GroupExtension::addObject(), App::DocumentPy::addObject(), DraftUtils::DraftDxfRead::AddObject(), ReverseEngineeringGui::SegmentationManual::createSegment(), PartGui::DlgProjectionOnSurface::DlgProjectionOnSurface(), Sandbox::CustomAddObjectEvent::execute(), ArchPanel.NestTaskPanel::getContainer(), ArchPanel.NestTaskPanel::getShapes(), Part::ImportIgesParts(), Part::ImportStepParts(), Import::ImportOCAF2::loadShapes(), PartDesignGui::TaskFeaturePick::makeCopy(), PartDesign::Body::onChanged(), Import::ImpExpDxfRead::OnReadText(), DraftUtils::DraftDxfRead::OnReadText(), readObjects(), Restore(), Path::Area::showShape(), MeshGui::ViewProviderMesh::splitMesh(), and App::LinkBaseExtension::update().
◆ addObject() [2/2]
void Document::addObject | ( | DocumentObject * | pcObject, |
const char * | pObjectName = 0 |
||
) |
Add an existing feature with sName (ASCII) to this document and set it active.
Unicode names are set through the Label property. This is an overloaded function of the function above and can be used to create a feature outside and add it to the document afterwards.
- Note
- The passed feature must not yet be added to a document, otherwise an exception is raised.
References App::DocumentP::activeObject, App::DocumentP::activeUndoTransaction, App::Transaction::addObjectDel(), App::DocumentObject::getDocument(), Base::Type::getName(), Base::Persistence::getTypeId(), getUniqueObjectName(), App::DocumentObject::getViewProviderNameOverride(), App::DocumentObject::Label, App::DocumentP::lastObjectId, App::DocumentP::objectArray, App::DocumentP::objectIdMap, App::DocumentP::objectMap, App::DocumentObject::pcNameInDocument, App::DocumentP::rollback, App::DocumentObject::setDocument(), App::DocumentObject::setStatus(), App::PropertyString::setValue(), signalActivatedObject, signalNewObject, and signalTransactionAppend.
Referenced by ArchPanel.NestTaskPanel::getContainer(), and ArchPanel.NestTaskPanel::getShapes().
◆ addObjects()
std::vector< DocumentObject * > Document::addObjects | ( | const char * | sType, |
const std::vector< std::string > & | objectNames, | ||
bool | isNew = true |
||
) |
Add an array of features of the given types and names.
Unicode names are set through the Label property.
- Parameters
-
sType The type of created object objectNames A list of object names isNew If false don't call the DocumentObject::setupObject()
callback (default is true)
References App::DocumentP::activeObject, App::DocumentP::activeUndoTransaction, App::Transaction::addObjectDel(), Base::Type::fromName(), Base::Persistence::getClassTypeId(), Base::Tools::getIdentifier(), Base::Tools::getUniqueName(), App::DocumentObject::getViewProviderNameOverride(), Base::Type::importModule(), KeepTrailingDigits, App::DocumentObject::Label, App::DocumentP::lastObjectId, App::DocumentP::objectArray, App::DocumentP::objectIdMap, App::DocumentP::objectMap, App::DocumentObject::pcNameInDocument, App::DocumentP::rollback, App::DocumentObject::setDocument(), App::DocumentObject::setStatus(), App::DocumentObject::setupObject(), App::PropertyString::setValue(), signalActivatedObject, signalNewObject, signalTransactionAppend, testStatus(), and App::DocumentP::undoing.
◆ addOrRemovePropertyOfObject()
void Document::addOrRemovePropertyOfObject | ( | TransactionalObject * | obj, |
Property * | prop, | ||
bool | add | ||
) |
References App::DocumentP::activeUndoTransaction, App::Transaction::addOrRemoveProperty(), App::Application::getActiveTransaction(), App::GetApplication(), Importing, isPerformingTransaction(), App::DocumentP::iUndoMode, Restoring, App::DocumentP::rollback, and testStatus().
Referenced by Gui::ViewProviderDocumentObject::addDynamicProperty(), and Gui::ViewProviderDocumentObject::removeDynamicProperty().
◆ addRecomputeObject()
void Document::addRecomputeObject | ( | DocumentObject * | obj | ) |
Called by objects during restore to ask for recompute.
References testStatus(), and App::DocumentP::touchedObjs.
◆ afterRestore() [1/2]
void Document::afterRestore | ( | bool | checkPartial = false | ) |
References App::GetApplication(), getName(), App::DocumentP::objectArray, restore(), Restoring, setStatus(), and App::Application::signalFinishRestoreDocument.
Referenced by importObjects(), and restore().
◆ afterRestore() [2/2]
bool Document::afterRestore | ( | const std::vector< App::DocumentObject * > & | objArray, |
bool | checkPartial = false |
||
) |
References App::DocumentP::addRecomputeLog(), DepSort, App::PropertyExpressionEngine::ExecuteOnRestore, getDependencyList(), App::DocumentP::objectArray, PartialDoc, PartialRestore, setStatus(), signalFinishRestoreObject, App::DocumentObject::StdReturn, testStatus(), and App::DocumentP::touchedObjs.
◆ breakDependency()
|
protected |
References App::PropertyLinkBase::breakLinks(), and App::DocumentP::objectArray.
Referenced by moveObject(), and removeObject().
◆ checkOnCycle()
bool Document::checkOnCycle | ( | void | ) |
checks if the graph is directed and has no cycles
◆ clearDocument()
void Document::clearDocument | ( | ) |
References App::DocumentP::activeObject, App::DocumentP::clearRecomputeLog(), App::GetApplication(), App::DocumentP::lastObjectId, App::DocumentP::objectArray, App::DocumentP::objectIdMap, App::DocumentP::objectMap, PartialDoc, setStatus(), App::Application::signalDeleteDocument, and App::Application::signalNewDocument.
◆ clearUndos()
void Document::clearUndos | ( | ) |
Remove all stored Undos and Redos.
References App::DocumentP::activeUndoTransaction, App::DocumentP::committing, and isPerformingTransaction().
Referenced by App::DocumentPy::clearUndos(), restore(), setUndoMode(), and ~Document().
◆ commitTransaction()
void Document::commitTransaction | ( | ) |
Commit the Command transaction. Do nothing If there is no Command transaction open.
References App::DocumentP::activeUndoTransaction, App::Application::closeActiveTransaction(), App::DocumentP::committing, App::GetApplication(), App::Transaction::getID(), and isPerformingTransaction().
Referenced by MeshGui::Segmentation::accept(), PartGui::Mirroring::accept(), ReverseEngineeringGui::Segmentation::accept(), PartGui::DlgBooleanOperation::accept(), PartGui::DlgRevolution::accept(), MeshPartGui::Tessellation::accept(), PartGui::DlgFilletEdges::accept(), MeshGui::SegmentationBestFit::accept(), PartGui::DlgExtrusion::apply(), Gui::Document::commitCommand(), and App::DocumentPy::commitTransaction().
◆ copyObject()
std::vector< DocumentObject * > Document::copyObject | ( | const std::vector< DocumentObject * > & | objs, |
bool | recursive = false |
||
) |
Copy objects from another document to this document.
- Parameters
-
recursive if true, then all objects this object depends on are copied as well. By default recursive is false.
- Returns
- Returns the list of objects copied.
References DepNoXLinked, DepSort, exportObjects(), getDependencyList(), App::Application::getTempFileName(), App::PropertyXLink::hasXLink(), App::MergeDocuments::importObjects(), isSaved(), and App::MergeDocuments::setVerbose().
Referenced by App::DocumentPy::copyObject(), Gui::TreeWidget::dropEvent(), and moveObject().
◆ countObjects()
int Document::countObjects | ( | void | ) | const |
get the number of objects in the document
References App::DocumentP::objectArray.
Referenced by StdCmdImport::activated(), and Gui::Application::open().
◆ countObjectsOfType()
int Document::countObjectsOfType | ( | const Base::Type & | typeId | ) | const |
References App::DocumentP::objectMap.
Referenced by PartGui::Mirroring::accept(), and PartDesignGui::Workbench::setupContextMenu().
◆ exportGraphviz()
void Document::exportGraphviz | ( | std::ostream & | out | ) | const |
The GraphCreator class
This class creates the dependency graph for a document.
getId returns a canonical string for a DocumentObject.
- Parameters
-
docObj Document object to get an ID from
- Returns
- A string
getId returns a canonical string for an ObjectIdentifier;
- Parameters
-
path
- Returns
- A string
setGraphAttributes Set graph attributes on a subgraph for a DocumentObject node.
- Parameters
-
obj DocumentObject
setPropertyVertexAttributes Set vertex attributes for a Property node in a graph.
- Parameters
-
g Graph vertex Property node name Name of node
addExpressionSubgraphIfNeeded Add a subgraph to the main graph if it is needed, i.e. there are defined at least one expression in the document object, or other objects are referencing properties in it.
- Parameters
-
obj DocumentObject to assess. CSSubgraphs Boolean if the GeoFeatureGroups are created as subgraphs
add Add @docObj to the graph, including all expressions (and dependencies) it includes.
- Parameters
-
docObj The document object to add. name Name of node.
References App::DocumentObject::ExpressionEngine, DraftVecUtils::find(), App::GetApplication(), ParameterGrp::GetBool(), Base::Persistence::getClassTypeId(), App::PropertyExpressionEngine::getExpressions(), App::ExtensionContainer::getExtensionByType(), App::GeoFeatureGroupExtension::getGroupOfObject(), App::GeoFeatureGroupExtension::getInvalidLinkObjects(), getName(), App::DocumentObject::getNameInDocument(), App::OriginFeature::getOrigin(), App::DocumentObject::getOutList(), App::Application::GetParameterGroupByPath(), App::ExtensionContainer::hasExtension(), and Base::BaseClass::isDerivedFrom().
Referenced by App::DocumentPy::exportGraphviz(), and App::DocumentPy::getDependencyGraph().
◆ exportObjects()
void Document::exportObjects | ( | const std::vector< App::DocumentObject * > & | obj, |
std::ostream & | out | ||
) |
References App::Application::Config(), Base::ZipWriter::putNextEntry(), signalExportObjects, Base::ZipWriter::Stream(), Base::ZipWriter::writeFiles(), and writeObjects().
Referenced by copyObject(), and importLinks().
◆ findObjects()
std::vector< DocumentObject * > Document::findObjects | ( | const Base::Type & | typeId, |
const char * | objname | ||
) | const |
References App::DocumentP::objectArray.
Referenced by App::DocumentPy::findObjects().
◆ getActiveObject()
DocumentObject * Document::getActiveObject | ( | void | ) | const |
Returns the active Object of this document.
References App::DocumentP::activeObject.
Referenced by MeshPartGui::Tessellation::accept(), StdCmdGroup::activated(), Gui::DocumentPy::activeObject(), Gui::ViewProviderIndex::data(), Gui::DocumentPy::getActiveObject(), App::DocumentPy::getActiveObject(), and Gui::Command::isActiveObjectValid().
◆ getAvailableRedoNames()
std::vector< std::string > Document::getAvailableRedoNames | ( | ) | const |
Returns a list of the Redo names.
Referenced by App::DocumentPy::getRedoNames(), and Gui::Document::getRedoVector().
◆ getAvailableRedos()
int Document::getAvailableRedos | ( | int | id = 0 | ) | const |
Returns the number of stored Redos. If greater than 0 Redo will be effective.
◆ getAvailableUndoNames()
std::vector< std::string > Document::getAvailableUndoNames | ( | ) | const |
Returns a list of the Undo names.
References App::DocumentP::activeUndoTransaction, and App::Transaction::Name.
Referenced by App::DocumentPy::getUndoNames(), and Gui::Document::getUndoVector().
◆ getAvailableUndos()
int Document::getAvailableUndos | ( | int | id = 0 | ) | const |
Returns the number of stored Undos. If greater than 0 Undo will be effective.
References App::DocumentP::activeUndoTransaction, and App::Transaction::getID().
◆ getDependencyList()
|
static |
Get a complete list of all objects the given objects depend on.
This function is defined as static because it accepts objects from different documents, and the returned list will contain dependent objects from all relevant documents
- Parameters
-
objs input objects to query for dependency. options See DependencyOption
References DepNoCycle, DepSort, and App::DocumentP::partialTopologicalSort().
Referenced by StdCmdDuplicateSelection::activated(), afterRestore(), copyObject(), Gui::MainWindow::createMimeDataFromSelection(), Gui::DlgObjectSelection::DlgObjectSelection(), getDependingObjects(), importLinks(), Import::ImportOCAF2::loadShapes(), moveObject(), and recompute().
◆ getDependentDocuments() [1/2]
std::vector< App::Document * > Document::getDependentDocuments | ( | bool | sort = true | ) |
◆ getDependentDocuments() [2/2]
|
static |
References App::PropertyXLink::getDocumentOutList().
◆ getDependingObjects()
std::vector< DocumentObject * > Document::getDependingObjects | ( | ) | const |
Returns a list of document's objects including the dependencies.
References getDependencyList(), and App::DocumentP::objectArray.
◆ getErrorDescription()
const char * Document::getErrorDescription | ( | const App::DocumentObject * | Obj | ) | const |
get the text of the error of a specified object
References App::DocumentP::findRecomputeLog().
Referenced by PartDesignGui::ViewProviderTransformed::recomputeFeature(), and writeObjects().
◆ getFullName()
|
overridevirtual |
Reimplemented from App::PropertyContainer.
◆ getInList()
std::vector< App::DocumentObject * > Document::getInList | ( | const DocumentObject * | me | ) | const |
get a list of all objects linking to the given object
References App::DocumentP::objectMap.
◆ getLinksTo()
void Document::getLinksTo | ( | std::set< DocumentObject * > & | links, |
const DocumentObject * | obj, | ||
int | options, | ||
int | maxCount = 0 , |
||
const std::vector< DocumentObject * > & | objs = {} |
||
) | const |
Return the links to a given object.
- Parameters
-
links holds the links found obj the linked object. If NULL, then all links are returned. option
- See also
- App::GetLinkOptions
- Parameters
-
maxCount limit the number of links returned, 0 means no limit objs optional objects to search for, if empty, then all objects of this document are searched.
References App::GetApplication(), App::GetLinkArrayElement, App::GetLinkedObject, App::GetLinkExternal, App::GetLinkRecursive, and App::DocumentP::objectArray.
Referenced by hasLinksTo(), and importLinks().
◆ getMaxUndoStackSize()
unsigned int Document::getMaxUndoStackSize | ( | void | ) | const |
Set the Undo limit as stack size.
References App::DocumentP::UndoMaxStackSize.
◆ getMemSize()
|
overridevirtual |
returns the complete document memory consumption, including all managed DocObjects and Undo Redo.
Reimplemented from App::PropertyContainer.
References App::PropertyContainer::getMemSize(), getUndoMemSize(), and App::DocumentP::objectArray.
◆ getName()
const char * Document::getName | ( | ) | const |
Get the document name.
Label is the visible name of a document shown e.g.
in the windows title or in the tree view. The label almost (but not always e.g. if you manually change it) matches with the file name where the document is stored to. In contrast to Label the method getName() returns the internal name of the document that only matches with Label when loading or creating a document because then both are set to the same value. Since the internal name cannot be changed during runtime it must differ from the Label after saving the document the first time or saving it under a new file name. @ note More than one document can have the same label name. @ note The internal is always guaranteed to be unique because Application::newDocument() checks for a document with the same name and makes it unique if needed. Hence you cannot rely on that the internal name matches with the name you passed to Application::newDoument(). You should use the method getName() instead.
Referenced by MeshPartGui::Tessellation::accept(), StdCmdSelectVisibleObjects::activated(), StdCmdToggleObjects::activated(), StdCmdShowObjects::activated(), StdCmdHideObjects::activated(), PartGui::FaceColors::Private::addFacesToSelection(), afterRestore(), Gui::ExpressionBinding::apply(), Gui::ViewProviderVRMLObject::attach(), RobotGui::ViewProviderTrajectory::attach(), RobotGui::ViewProviderRobotObject::attach(), Gui::ViewProviderOriginFeature::attach(), Gui::ViewProviderAnnotation::attach(), MeshGui::ViewProviderMesh::attach(), PointsGui::ViewProviderScattered::attach(), PointsGui::ViewProviderStructured::attach(), Gui::SelectionSingleton::clearSelection(), Gui::DAG::Model::contextMenuEvent(), App::PropertyXLink::copyTo(), App::DocInfo::deinit(), Gui::TreeWidget::dropEvent(), exportGraphviz(), PartGui::DlgExtrusion::findShapes(), Gui::LinkInfo::getDocName(), Gui::View3DInventorPy::getObjectInfo(), Gui::View3DInventorPy::getObjectsInfo(), App::PropertyLinkSubList::getPyReprString(), App::PropertyXLinkSubList::getPyReprString(), PartDesignGui::getReferencedSelection(), Gui::SelectionSingleton::isSelected(), Gui::DAG::Model::mousePressEvent(), Spreadsheet::Sheet::observeDocument(), SketcherGui::TaskSketcherConstrains::on_listWidgetConstraints_itemSelectionChanged(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemEntered(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(), Gui::Application::onLastWindowClosed(), Gui::TreeWidget::onPreSelectTimer(), Gui::View3DInventor::onRename(), PartDesignGui::TaskBooleanParameters::onSelectionChanged(), FemGui::TaskFemConstraintBearing::onSelectionChanged(), SketcherGui::TaskSketcherConstrains::onSelectionChanged(), FemGui::TaskFemConstraintGear::onSelectionChanged(), SketcherGui::TaskSketcherElements::onSelectionChanged(), Gui::Application::open(), App::Application::openDocumentPrivate(), Gui::Dialog::Placement::Placement(), TechDrawGui::MDIViewPage::preSelectionChanged(), Gui::ElementColors::Private::Private(), recompute(), PartDesignGui::TaskShapeBinder::referenceSelected(), PartDesignGui::TaskPipeParameters::referenceSelected(), PartDesignGui::TaskDressUpParameters::referenceSelected(), PartDesignGui::TaskPipeOrientation::referenceSelected(), PartDesignGui::TaskPipeScaling::referenceSelected(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerFillet::releaseButton(), removeObject(), App::ObjectIdentifier::resolve(), App::PropertyLinkList::Restore(), Gui::SelectionSingleton::sAddSelection(), TechDrawGui::QGVPage::saveSvg(), Gui::SelectionObserver::SelectionObserver(), Gui::DocumentItem::selectItems(), Gui::Application::setActiveDocument(), Gui::View3DInventorViewer::setDocument(), TechDrawGui::ViewProviderViewPart::setEdit(), FemGui::TaskFemConstraint::setSelection(), PartDesignGui::TaskDressUpParameters::setSelection(), TechDrawGui::MDIViewPage::setTreeToSceneSelect(), App::PropertyXLink::setValue(), Gui::AutoSaver::slotCreateDocument(), Gui::SelectionSingleton::slotDeletedObject(), Gui::ElementColors::slotDeleteDocument(), Gui::AutoSaver::slotDeleteDocument(), Gui::Application::slotDeleteDocument(), Gui::DocumentItem::slotNewObject(), Gui::SelectionSingleton::sRemoveSelection(), Gui::SelectionSingleton::sSetPreselection(), Gui::SelectionSingleton::sUpdateSelection(), PartDesignGui::TaskFeaturePick::TaskFeaturePick(), PartDesignGui::ViewProvider::unsetEdit(), Gui::ViewProviderInventorObject::updateData(), PartGui::DlgExtrusion::writeParametersToFeature(), ~Document(), and PathGui::Module::~Module().
◆ getObject()
DocumentObject * Document::getObject | ( | const char * | Name | ) | const |
Returns a Object of this document.
References App::DocumentP::objectMap.
Referenced by PartGui::DlgBooleanOperation::accept(), PathGui::TaskDlgPathCompound::accept(), Sketcher::SketchObjectPy::addExternal(), Measure::MeasurementPy::addReference3D(), PartDesignGui::TaskFeaturePick::buildFeatures(), Sketcher::SketchObjectPy::carbonCopy(), Gui::View3DInventorViewer::checkGroupOnTop(), App::ObjectIdentifier::String::checkImport(), TechDrawGui::TaskActiveView::createActiveView(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskSectionView::createSectionView(), TechDrawGui::TaskWeldingSymbol::createWeldingSymbol(), Gui::TreeWidget::dropEvent(), PartGui::DlgExtrusion::getAxisLink(), PartGui::DlgRevolution::getAxisLink(), TechDrawGui::TaskDetail::getBaseFeat(), App::DocumentPy::getCustomAttributes(), TechDrawGui::TaskDetail::getDetailFeat(), PartDesignGui::TaskDraftParameters::getLine(), App::GroupExtension::getObject(), App::DocumentPy::getObject(), Gui::Command::getObject(), PartDesignGui::TaskDraftParameters::getPlane(), PartDesignGui::getReferencedSelection(), PartGui::getShapeFromStrings(), Gui::Document::getViewProviderByName(), Gui::Command::hasObject(), App::ObjectIdentifier::importSubNames(), TechDrawGui::TaskSectionView::isBaseValid(), TechDrawGui::TaskSectionView::isSectionValid(), TechDrawGui::QGVPage::mouseReleaseEvent(), PartDesignGui::TaskSketchBasedParameters::onAddSelection(), PartDesignGui::TaskBooleanParameters::onSelectionChanged(), FemGui::TaskFemConstraintBearing::onSelectionChanged(), FemGui::TaskFemConstraintGear::onSelectionChanged(), DrawSketchHandlerExternal::onSelectionChanged(), DrawSketchHandlerCarbonCopy::onSelectionChanged(), PartDesignGui::TaskTransformedParameters::originalSelected(), readObjects(), PartDesignGui::TaskShapeBinder::referenceSelected(), PartDesignGui::TaskPipeParameters::referenceSelected(), PartDesignGui::TaskPipeOrientation::referenceSelected(), PartDesignGui::TaskPipeScaling::referenceSelected(), App::DocumentPy::removeObject(), App::ObjectIdentifier::resolve(), PartDesign::ProfileBased::Restore(), Restore(), App::PropertyLink::Restore(), App::PropertyLinkList::Restore(), App::PropertyLinkSub::Restore(), App::PropertyLinkSubList::Restore(), App::PropertyXLink::Restore(), App::DocumentPy::setCustomAttributes(), Gui::DocumentPy::setEdit(), Gui::SelectionSingleton::setPreselect(), PartDesignGui::TaskSketchBasedParameters::setUpToFace(), App::PropertyXLink::setValue(), and TechDrawGui::TaskLinkDim::updateDims().
◆ getObjectByID()
DocumentObject * Document::getObjectByID | ( | long | id | ) | const |
Returns a Object of this document by its id.
References App::DocumentP::objectIdMap.
Referenced by App::LinkBaseExtension::extensionExecute(), App::DocumentPy::getObject(), and moveObject().
◆ getObjectName()
const char * Document::getObjectName | ( | DocumentObject * | pFeat | ) | const |
Returns a Name of an Object or 0.
References App::DocumentP::objectMap.
◆ getObjects()
const std::vector< DocumentObject * > & Document::getObjects | ( | ) | const |
Returns a list of all Objects.
References App::DocumentP::objectArray.
Referenced by Gui::ViewProviderDocumentObject::findFrontRootOfType(), App::DocumentPy::getObjects(), App::DocumentPy::getObjectsByLabel(), PartDesignGui::ViewProviderDatum::getRelevantBoundBox(), getStandardObjectName(), Gui::DAG::Model::Model(), and Gui::TreeWidget::startItemSearch().
◆ getObjectsOfType() [1/2]
std::vector< T * > Document::getObjectsOfType |
Returns an array with the correct types already.
◆ getObjectsOfType() [2/2]
std::vector< DocumentObject * > Document::getObjectsOfType | ( | const Base::Type & | typeId | ) | const |
References App::DocumentP::objectArray.
Referenced by StdCmdSelectVisibleObjects::activated(), StdCmdToggleObjects::activated(), StdCmdShowObjects::activated(), StdCmdHideObjects::activated(), ReverseEngineeringGui::SegmentationManual::createSegment(), ReverseEngineeringGui::SegmentationManual::Private::findGeometry(), App::DocumentPy::findObjects(), TechDrawGui::DrawGuiUtil::findPage(), PartGui::DlgExtrusion::findShapes(), PartGui::DlgFilletEdges::findShapes(), PartDesignGui::getPartFor(), TechDrawGui::DrawGuiUtil::needPage(), TechDrawGui::DrawGuiUtil::needView(), MeshGui::DlgEvaluateMeshImp::on_meshNameButton_activated(), MeshGui::DlgEvaluateMeshImp::refreshList(), and FemGui::TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary().
◆ getObjectsWithExtension()
std::vector< DocumentObject * > Document::getObjectsWithExtension | ( | const Base::Type & | typeId, |
bool | derived = true |
||
) | const |
Returns all object with given extensions. If derived=true also all objects with extensions derived from the given one.
References App::DocumentP::objectArray.
◆ getOldLabel()
const std::string& App::Document::getOldLabel | ( | ) | const |
◆ getPathsByOutList()
std::vector< std::list< App::DocumentObject * > > Document::getPathsByOutList | ( | const App::DocumentObject * | from, |
const App::DocumentObject * | to | ||
) | const |
get all possible paths from one object to another following the OutList
References DraftVecUtils::find(), App::DocumentP::findAllPathsAt(), and App::DocumentP::objectArray.
◆ getPyObject()
|
overridevirtual |
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 App::Application::setActiveDocument().
◆ getRootObjects()
std::vector< App::DocumentObject * > Document::getRootObjects | ( | ) | const |
get all root objects (objects no other one reference too)
References App::DocumentP::objectArray.
Referenced by App::DocumentPy::getRootObjects().
◆ getStandardObjectName()
std::string Document::getStandardObjectName | ( | const char * | Name, |
int | d | ||
) | const |
Returns a name of the form prefix_number. d specifies the number of digits.
References getObjects(), and Base::Tools::getUniqueName().
◆ getTouched()
vector< DocumentObject * > Document::getTouched | ( | void | ) | const |
returns all touched objects
References App::DocumentP::objectArray.
◆ getTransactionID()
int Document::getTransactionID | ( | bool | undo, |
unsigned | pos = 0 |
||
) | const |
Return the undo/redo transaction ID starting from the back.
References App::DocumentP::activeUndoTransaction, App::Transaction::getID(), and undo().
◆ getTransientDirectoryName()
|
protected |
References App::GetApplication(), App::Application::getExecutableName(), and App::Application::getTempPath().
Referenced by onChanged().
◆ getUndoMemSize()
unsigned int Document::getUndoMemSize | ( | void | ) | const |
Returns the actual memory consumption of the Undo redo stuff.
References App::DocumentP::UndoMemSize.
Referenced by getMemSize().
◆ getUndoMode()
int Document::getUndoMode | ( | void | ) | const |
switch the level of Undo/Redo
References App::DocumentP::iUndoMode.
◆ getUniqueObjectName()
std::string Document::getUniqueObjectName | ( | const char * | Name | ) | const |
Returns a Name of an Object or 0.
References Base::Tools::getIdentifier(), Base::Tools::getUniqueName(), KeepTrailingDigits, App::DocumentP::objectMap, and testStatus().
Referenced by PartGui::DlgBooleanOperation::accept(), PartGui::DlgRevolution::accept(), PartGui::DlgFilletEdges::accept(), addObject(), TechDraw::DrawProjGroup::addProjection(), TechDrawGui::TaskActiveView::createActiveView(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskSectionView::createSectionView(), TechDrawGui::TaskWeldingSymbol::createWeldingSymbol(), Gui::TreeWidget::dropEvent(), TechDrawGui::QGVPage::mouseReleaseEvent(), moveObject(), DrawingGui::orthoview::orthoview(), and App::LinkBaseExtension::setLink().
◆ hasLinksTo()
bool Document::hasLinksTo | ( | const DocumentObject * | obj | ) | const |
Check if there is any link to the given object.
References getLinksTo().
◆ hasPendingTransaction()
bool Document::hasPendingTransaction | ( | ) | const |
Check if a transaction is open.
References App::DocumentP::activeUndoTransaction.
Referenced by Gui::Document::hasPendingCommand().
◆ importLinks()
std::vector< App::DocumentObject * > Document::importLinks | ( | const std::vector< App::DocumentObject * > & | objs = {} | ) |
Import any externally linked objects.
- Parameters
-
objs input list of objects. Only objects belonging to this document will be checked for external links. And all found external linked object will be imported to this document. Link type properties of those input objects will be automatically reassigned to the imported objects. Note that the link properties of other objects in the document but not included in the input list, will not be affected even if they point to some object beining imported. To import all objects, simply pass in all objects of this document.
- Returns
- the list of imported objects
References Base::FileInfo::deleteFile(), exportObjects(), getDependencyList(), App::GetLinkExternal, getLinksTo(), App::MergeDocuments::getNameMap(), App::Application::getTempFileName(), App::Property::Immutable, App::MergeDocuments::importObjects(), and App::PartialObject.
◆ importObjects()
std::vector< App::DocumentObject * > Document::importObjects | ( | Base::XMLReader & | reader | ) |
References afterRestore(), Base::XMLReader::DocumentSchema, Base::XMLReader::FileVersion, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::getAttributeAsUnsigned(), Base::XMLReader::hasAttribute(), App::ObjImporting, Base::XMLReader::ProgramVersion, Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), readObjects(), signalFinishImportObjects, and signalImportObjects.
Referenced by App::MergeDocuments::importObjects(), and Gui::MergeDocuments::importObjects().
◆ isAnyRestoring()
|
static |
Indicate if there is any document restoring/importing.
Referenced by App::Application::isRestoring(), Gui::ViewProviderDocumentObject::onPropertyStatusChanged(), and App::LinkBaseExtension::setLink().
◆ isClosable()
bool Document::isClosable | ( | ) | const |
check whether the document can be closed
References Closable, and testStatus().
◆ isExporting()
Document::ExportStatus Document::isExporting | ( | const App::DocumentObject * | obj | ) | const |
References NotExporting, DocExportStatus::objs, and DocExportStatus::status.
Referenced by writeObjects().
◆ isIn()
bool Document::isIn | ( | const DocumentObject * | pFeat | ) | const |
Returns true if the DocumentObject is contained in this document.
References App::DocumentP::objectMap.
Referenced by PartDesignGui::ComboLinks::getLink(), and PartDesignGui::TaskRevolutionParameters::getReferenceAxis().
◆ isPerformingTransaction()
bool Document::isPerformingTransaction | ( | ) | const |
returns true if the document is in an Transaction phase, e.g. currently performing a redo/undo or rollback
References App::DocumentP::rollback, and App::DocumentP::undoing.
Referenced by abortTransaction(), addOrRemovePropertyOfObject(), clearUndos(), commitTransaction(), openTransaction(), and App::LinkBaseExtension::update().
◆ isSaved()
bool Document::isSaved | ( | ) | const |
Opens the document from its file name.
Is the document already saved to a file?
References FileName, and App::PropertyString::getValue().
Referenced by copyObject(), Import::ImportOCAF2::ImportOCAF2(), and Import::ImportOCAF2::setMode().
◆ isTouched()
bool Document::isTouched | ( | void | ) | const |
check if there is any touched object in this document
References App::DocumentP::objectArray.
◆ isTransactionEmpty()
bool Document::isTransactionEmpty | ( | ) | const |
Check if a transaction is open and its list is empty.
If no transaction is open true is returned.
References App::DocumentP::activeUndoTransaction.
◆ moveObject()
DocumentObject * Document::moveObject | ( | DocumentObject * | obj, |
bool | recursive = false |
||
) |
Move an object from another document to this document If recursive is true then all objects this object depends on are moved as well.
By default recursive is false. Returns the moved object itself or 0 if the object is already part of this document..
References breakDependency(), copyObject(), DepNoXLinked, DepSort, getDependencyList(), getObjectByID(), getUniqueObjectName(), App::DocumentP::iUndoMode, and removeObject().
Referenced by Gui::TreeWidget::dropEvent(), and App::DocumentPy::moveObject().
◆ mustExecute()
bool Document::mustExecute | ( | void | ) | const |
check if there is any object must execute in this document
References App::PropertyXLink::hasXLink(), and App::DocumentP::objectArray.
Referenced by StdCmdRefresh::isActive(), and recompute().
◆ onBeforeChange()
|
overrideprotectedvirtual |
get called before the value is changed
Reimplemented from App::PropertyContainer.
References App::PropertyString::getValue(), Label, and signalBeforeChange.
◆ onBeforeChangeProperty()
|
protected |
callback from the Document objects before property will be changed
References App::DocumentP::activeUndoTransaction, App::Transaction::addObjectChange(), Base::Persistence::getClassTypeId(), Base::BaseClass::isDerivedFrom(), App::DocumentP::rollback, and signalBeforeChangeObject.
◆ onChanged()
|
overrideprotectedvirtual |
get called by the container when a property has changed
Reimplemented from App::PropertyContainer.
References Base::Console(), Base::FileInfo::createDirectory(), Base::FileInfo::exists(), Base::FileInfo::filePath(), App::GetApplication(), App::PropertyString::getStrValue(), getTransientDirectoryName(), App::PropertyUUID::getValueStr(), Label, Base::FileInfo::renameFile(), App::PropertyString::setValue(), App::PropertyUUID::setValue(), ShowHidden, signalChanged, App::Application::signalRelabelDocument, App::Application::signalShowHidden, TransientDir, Uid, and Base::ConsoleSingleton::Warning().
Referenced by draftviewproviders.view_base.ViewProviderDraft::attach(), ArchSite.Compass::buildCoordinates(), draftobjects.wire.Wire::execute(), ArchAxis.CommandArchGrid::IsActive(), draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy::updateData(), draftviewproviders.view_label.ViewProviderLabel::updateData(), DraftLayer.ViewProviderLayer::updateData(), ArchBuildingPart.ViewProviderBuildingPart::updateData(), ArchPanel.ViewProviderPanelCut::updateData(), and ArchPanel.ViewProviderPanelSheet::updateData().
◆ onChangedProperty()
|
protected |
callback from the Document objects after property was changed
References signalChangedObject.
◆ openTransaction()
void Document::openTransaction | ( | const char * | name = 0 | ) |
Open a new command Undo/Redo, an UTF-8 name can be specified.
- Parameters
-
name transaction name
This function calls App::Application::setActiveTransaction(name) instead to setup a potential transaction which will only be created if there is actual changes.
References App::DocumentP::committing, App::GetApplication(), isPerformingTransaction(), and App::Application::setActiveTransaction().
Referenced by MeshGui::Segmentation::accept(), PartGui::Mirroring::accept(), ReverseEngineeringGui::Segmentation::accept(), PartGui::DlgBooleanOperation::accept(), PartGui::DlgRevolution::accept(), MeshPartGui::Tessellation::accept(), PartGui::DlgFilletEdges::accept(), MeshGui::SegmentationBestFit::accept(), PartGui::DlgExtrusion::apply(), PartGui::DlgProjectionOnSurface::DlgProjectionOnSurface(), PartDesignGui::getReferencedSelection(), Gui::Document::openCommand(), and App::DocumentPy::openTransaction().
◆ purgeTouched()
void Document::purgeTouched | ( | ) |
Remove all modifications. After this call The document becomes Valid again.
Remove all modifications. After this call The document becomes valid again.
References App::DocumentP::objectArray.
◆ readObjects()
|
protected |
References Base::XMLReader::addName(), addObject(), App::DocumentP::addRecomputeLog(), Base::XMLReader::clearPartialRestoreDocumentObject(), Base::Console(), Base::XMLReader::doNameMapping(), Base::ConsoleSingleton::Error(), Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), App::DocumentObject::getFullName(), Base::XMLReader::getName(), getObject(), Base::XMLReader::hasAttribute(), KeepTrailingDigits, App::DocumentP::lastObjectId, PartialDoc, App::DocumentP::partialLoadObjects, App::PartialObject, Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), App::ExtensionContainer::Restore(), App::DocumentObject::setStatus(), setStatus(), App::DocumentObject::testStatus(), Base::XMLReader::testStatus(), testStatus(), and App::DocumentP::touchedObjs.
Referenced by importObjects(), and Restore().
◆ recompute()
int Document::recompute | ( | const std::vector< App::DocumentObject * > & | objs = {} , |
bool | force = false , |
||
bool * | hasError = 0 , |
||
int | options = 0 |
||
) |
Recompute touched features and return the number of recalculated features.
- Parameters
-
objs specify a sub set of objects to recompute. If empty, then all object in this document is checked for recompute
References App::DocumentP::clearRecomputeLog(), Base::Console(), DepSort, Base::ConsoleSingleton::Error(), App::GetApplication(), ParameterGrp::GetBool(), getDependencyList(), getName(), App::Application::GetParameterGroupByPath(), App::PropertyString::getValue(), Label, mustExecute(), Base::SequencerLauncher::next(), App::DocumentP::objectArray, PartialDoc, App::DocumentP::partialTopologicalSort(), Recomputing, App::DocumentP::rollback, signalBeforeRecompute, signalRecomputed, signalRecomputedObject, signalSkipRecompute, SkipRecompute, testStatus(), topologicalSort(), and App::DocumentP::undoing.
Referenced by Gui::TaskCSysDragger::accept(), PartGui::Mirroring::accept(), PartGui::DlgBooleanOperation::accept(), Gui::Dialog::DlgMacroExecuteImp::accept(), TechDrawGui::TaskHatch::accept(), TechDrawGui::TaskGeomHatch::accept(), PartGui::DlgRevolution::accept(), PartGui::DlgFilletEdges::accept(), Gui::MacroCommand::activated(), FemGui::TaskDlgPost::clicked(), Gui::TreeWidget::dropEvent(), Sandbox::CustomRecomputeEvent::execute(), Gui::ManualAlignment::finish(), TechDrawGui::TaskHatch::onFileChanged(), SpreadsheetGui::SheetTableView::pasteClipboard(), App::DocumentPy::recompute(), FemGui::TaskPostBox::recompute(), recomputeFeature(), TechDrawGui::TaskHatch::reject(), TechDrawGui::TaskGeomHatch::reject(), draftguitools.gui_trackers.arcTracker::setApertureAngle(), draftguitools.gui_trackers.arcTracker::setEndAngle(), draftguitools.gui_trackers.arcTracker::setStartAngle(), draftguitools.gui_trackers.bsplineTracker::update(), and draftguitools.gui_trackers.bezcurveTracker::update().
◆ recomputeFeature()
bool Document::recomputeFeature | ( | DocumentObject * | Feat, |
bool | recursive = false |
||
) |
Recompute only one feature.
References App::DocumentP::clearRecomputeLog(), App::DocumentObject::getNameInDocument(), App::DocumentObject::isValid(), recompute(), and signalRecomputedObject.
Referenced by PartDesignGui::TaskBoxPrimitives::onBoxHeightChanged(), PartDesignGui::TaskBoxPrimitives::onBoxLengthChanged(), PartDesignGui::TaskBoxPrimitives::onBoxWidthChanged(), PartDesignGui::TaskBoxPrimitives::onConeAngleChanged(), PartDesignGui::TaskBoxPrimitives::onConeHeightChanged(), PartDesignGui::TaskBoxPrimitives::onConeRadius1Changed(), PartDesignGui::TaskBoxPrimitives::onConeRadius2Changed(), PartDesignGui::TaskBoxPrimitives::onCylinderAngleChanged(), PartDesignGui::TaskBoxPrimitives::onCylinderHeightChanged(), PartDesignGui::TaskBoxPrimitives::onCylinderRadiusChanged(), PartDesignGui::TaskBoxPrimitives::onEllipsoidAngle1Changed(), PartDesignGui::TaskBoxPrimitives::onEllipsoidAngle2Changed(), PartDesignGui::TaskBoxPrimitives::onEllipsoidAngle3Changed(), PartDesignGui::TaskBoxPrimitives::onEllipsoidRadius1Changed(), PartDesignGui::TaskBoxPrimitives::onEllipsoidRadius2Changed(), PartDesignGui::TaskBoxPrimitives::onEllipsoidRadius3Changed(), PartDesignGui::TaskBoxPrimitives::onPrismCircumradiusChanged(), PartDesignGui::TaskBoxPrimitives::onPrismHeightChanged(), PartDesignGui::TaskBoxPrimitives::onPrismPolygonChanged(), PartDesignGui::TaskDraftParameters::onSelectionChanged(), PartDesignGui::TaskBooleanParameters::onSelectionChanged(), PartDesignGui::TaskBoxPrimitives::onSphereAngle1Changed(), PartDesignGui::TaskBoxPrimitives::onSphereAngle2Changed(), PartDesignGui::TaskBoxPrimitives::onSphereAngle3Changed(), PartDesignGui::TaskBoxPrimitives::onSphereRadiusChanged(), PartDesignGui::TaskBoxPrimitives::onTorusAngle1Changed(), PartDesignGui::TaskBoxPrimitives::onTorusAngle2Changed(), PartDesignGui::TaskBoxPrimitives::onTorusAngle3Changed(), PartDesignGui::TaskBoxPrimitives::onTorusRadius1Changed(), PartDesignGui::TaskBoxPrimitives::onTorusRadius2Changed(), PartDesignGui::TaskBoxPrimitives::onWedgeX2maxChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeX2minChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeXmaxChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeXminChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeYmaxChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeYminChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeZ2maxChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeZ2minChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeZmaxChanged(), PartDesignGui::TaskBoxPrimitives::onWedgeZminChanged(), TechDrawGui::TaskBalloon::recomputeFeature(), TechDrawGui::TaskLeaderLine::recomputeFeature(), and PartDesignGui::TaskDressUpParameters::referenceSelected().
◆ redo()
bool Document::redo | ( | int | id = 0 | ) |
Will REDO one step, returns False if no redo was done (Redos == 0).
References App::DocumentP::activeUndoTransaction, App::Transaction::getID(), App::DocumentP::iUndoMode, App::Transaction::Name, signalRedo, Transaction, and App::DocumentP::undoing.
Referenced by App::DocumentPy::redo(), and Gui::Document::redo().
◆ removeObject()
void Document::removeObject | ( | const char * | sName | ) |
Remove a feature out of the document.
Remove an object out of the document.
References App::DocumentP::activeObject, App::DocumentP::activeUndoTransaction, App::Transaction::addObjectChange(), App::Transaction::addObjectNew(), breakDependency(), getName(), App::DocumentObject::getNameInDocument(), App::PropertyLink::getValue(), App::DocumentP::objectArray, App::DocumentP::objectIdMap, App::DocumentP::objectMap, App::DocumentP::rollback, App::DocumentObject::setStatus(), App::PropertyLink::setValue(), App::PropertyString::setValue(), signalDeletedObject, signalTransactionRemove, Tip, TipName, and App::DocumentP::undoing.
Referenced by App::GroupExtension::addObject(), Sandbox::CustomRemoveObjectEvent::execute(), moveObject(), FemGui::TaskFemConstraint::onButtonWizCancel(), App::OriginGroupExtension::onExtendedUnsetupObject(), App::DocumentPy::removeObject(), and TechDraw::DrawProjGroup::removeProjection().
◆ renameObjectIdentifiers()
void Document::renameObjectIdentifiers | ( | const std::map< App::ObjectIdentifier, App::ObjectIdentifier > & | paths, |
const std::function< bool(const App::DocumentObject *)> & | selector = [](const App::DocumentObject *) { return true; } |
||
) |
Function called to signal that an object identifier has been renamed.
Signal that object identifiers, typically a property or document object has been renamed.
This function iterates through all document object in the document, and calls its renameObjectIdentifiers functions.
- Parameters
-
paths Map with current and new names
References App::DocumentP::objectArray.
Referenced by Spreadsheet::PropertySheet::insertColumns(), Spreadsheet::PropertySheet::insertRows(), Spreadsheet::PropertySheet::removeColumns(), Spreadsheet::PropertySheet::removeRows(), and Spreadsheet::PropertySheet::setAlias().
◆ renameTransaction()
void Document::renameTransaction | ( | const char * | name, |
int | id | ||
) |
Rename the current transaction if the id matches.
References App::DocumentP::activeUndoTransaction, App::Transaction::getID(), and App::Transaction::Name.
◆ 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:
Reimplemented from App::PropertyContainer.
References addObject(), Base::Console(), Base::XMLReader::DocumentSchema, FileName, Base::XMLReader::FileVersion, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::getAttributeAsUnsigned(), getObject(), App::PropertyString::getValue(), Base::XMLReader::hasAttribute(), Label, Base::ConsoleSingleton::Message(), PartialDoc, Base::XMLReader::ProgramVersion, Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), readObjects(), App::PropertyContainer::Restore(), App::ExtensionContainer::Restore(), App::DocumentObject::setStatus(), setStatus(), App::PropertyLink::setValue(), App::PropertyString::setValue(), Tip, TipName, and App::DocumentP::touchedObjs.
Referenced by restore().
◆ restore()
void Document::restore | ( | const char * | filename = 0 , |
bool | delaySignal = false , |
||
const std::set< std::string > & | objNames = {} |
||
) |
Restore the document from the file in Property Path.
References App::DocumentP::activeObject, afterRestore(), App::DocumentP::clearRecomputeLog(), clearUndos(), Base::Console(), Base::ConsoleSingleton::Error(), FileName, App::Application::getActiveDocument(), App::GetApplication(), App::PropertyString::getValue(), Base::XMLReader::isValid(), App::DocumentP::lastObjectId, App::DocumentP::objectArray, App::DocumentP::objectIdMap, App::DocumentP::objectMap, PartialDoc, App::DocumentP::partialLoadObjects, PartialRestore, Base::XMLReader::readFiles(), Restore(), Restoring, App::Application::setActiveDocument(), setStatus(), App::Application::signalDeleteDocument, App::Application::signalNewDocument, signalRestoreDocument, App::Application::signalStartRestoreDocument, and Base::XMLReader::testStatus().
Referenced by afterRestore(), App::DocumentPy::load(), App::Application::openDocumentPrivate(), and App::DocumentPy::restore().
◆ 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
Reimplemented from App::PropertyContainer.
References App::Application::Config(), Base::Writer::getFileVersion(), App::DocumentP::objectArray, App::PropertyContainer::Save(), Base::Writer::Stream(), and writeObjects().
Referenced by Sandbox::DocumentSaverThread::run(), and saveToFile().
◆ save()
bool Document::save | ( | void | ) |
Save the Document under a new Name.
Save the document to the file in Property Path
References Base::TimeInfo::currentDateTimeString(), FileName, App::GetApplication(), ParameterGrp::GetASCII(), ParameterGrp::GetBool(), App::DocumentObject::getNameInDocument(), App::Application::GetParameterGroupByPath(), App::PropertyLink::getValue(), App::PropertyString::getValue(), Label, LastModifiedBy, LastModifiedDate, PartialDoc, saveToFile(), App::PropertyString::setValue(), testStatus(), Tip, and TipName.
Referenced by shipGZ.TaskPanel.TaskPanel::accept(), shipAreasCurve.TaskPanel.TaskPanel::accept(), shipHydrostatics.TaskPanel.TaskPanel::accept(), Mod.Show.mTempoVis.TempoVis::modify(), Mod.Show.mTempoVis.TempoVis::modifyVPProperty(), saveAs(), and Mod.Show.mTempoVis.TempoVis::saveCamera().
◆ saveAs()
bool Document::saveAs | ( | const char * | file | ) |
References FileName, Base::FileInfo::fileNamePure(), App::PropertyString::getStrValue(), Label, save(), App::PropertyString::setValue(), App::Property::touch(), and Uid.
Referenced by App::DocumentPy::saveAs().
◆ saveCopy()
bool Document::saveCopy | ( | const char * | file | ) | const |
References FileName, App::PropertyString::getStrValue(), and saveToFile().
Referenced by App::DocumentPy::saveCopy().
◆ saveToFile()
|
protected |
References App::BackupPolicy::apply(), Base::Uuid::createUuid(), App::GetApplication(), ParameterGrp::GetASCII(), ParameterGrp::GetBool(), ParameterGrp::GetInt(), App::Application::GetParameterGroupByPath(), Base::Writer::hasErrors(), Base::ZipWriter::putNextEntry(), Save(), Base::ZipWriter::setComment(), App::BackupPolicy::setDateFormat(), Base::ZipWriter::setLevel(), Base::Writer::setMode(), App::BackupPolicy::setNumberOfFiles(), App::BackupPolicy::setPolicy(), signalFinishSave, signalSaveDocument, App::Application::signalSaveDocument, signalStartSave, App::BackupPolicy::Standard, Base::ZipWriter::Stream(), App::BackupPolicy::TimeStamp, App::BackupPolicy::useBackupExtension(), and Base::ZipWriter::writeFiles().
Referenced by save(), and saveCopy().
◆ setClosable()
void Document::setClosable | ( | bool | c | ) |
set the document to be closable, this is on by default.
References Closable, and setStatus().
◆ setMaxUndoStackSize()
void Document::setMaxUndoStackSize | ( | unsigned int | UndoMaxStackSize = 20 | ) |
Set the Undo limit as stack size.
References App::DocumentP::UndoMaxStackSize.
◆ setStatus()
set the status bits
References App::DocumentP::StatusBits.
Referenced by afterRestore(), clearDocument(), TechDraw::DrawDimHelper::makeExtentDim(), readObjects(), restore(), Restore(), setClosable(), and App::DocumentPy::setRecomputesFrozen().
◆ setTransactionMode()
void Document::setTransactionMode | ( | int | iMode | ) |
switch the transaction mode
References App::DocumentP::iTransactionMode.
◆ setUndoLimit()
void Document::setUndoLimit | ( | unsigned int | UndoMemSize = 0 | ) |
Set the Undo limit in Byte!
References App::DocumentP::UndoMemSize.
◆ setUndoMode()
void Document::setUndoMode | ( | int | iMode | ) |
switch the level of Undo/Redo
References clearUndos(), and App::DocumentP::iUndoMode.
Referenced by App::DocumentPy::setUndoMode().
◆ testStatus()
return the status bits
Referenced by addObjects(), addOrRemovePropertyOfObject(), addRecomputeObject(), afterRestore(), TechDraw::DrawViewPart::getSourceShape(), TechDraw::DrawViewPart::getSourceShapeFused(), getUniqueObjectName(), isClosable(), readObjects(), recompute(), save(), and PartDesignGui::ViewProviderBody::updateOriginDatumSize().
◆ topologicalSort()
std::vector< App::DocumentObject * > Document::topologicalSort | ( | ) | const |
get a list of topological sorted objects (https://en.wikipedia.org/wiki/Topological_sorting)
References App::DocumentP::objectArray, and App::DocumentP::topologicalSort().
Referenced by App::DocumentPy::getTopologicalSortedObjects(), and recompute().
◆ undo()
bool Document::undo | ( | int | id = 0 | ) |
Will UNDO one step, returns False if no undo was done (Undos == 0).
References App::DocumentP::activeUndoTransaction, App::Transaction::getID(), App::DocumentP::iUndoMode, App::Transaction::Name, signalUndo, Transaction, and App::DocumentP::undoing.
Referenced by getTransactionID(), App::DocumentPy::undo(), and Gui::Document::undo().
◆ writeDependencyGraphViz()
void Document::writeDependencyGraphViz | ( | std::ostream & | out | ) |
write GraphViz file
References App::DocumentP::objectMap.
◆ writeObjects()
|
protected |
References Base::Writer::decInd(), Base::Persistence::encodeAttribute(), getErrorDescription(), Base::Writer::incInd(), Base::Writer::ind(), isExporting(), App::DocumentObject::OutListNoHidden, App::DocumentObject::OutListNoXLinked, and Base::Writer::Stream().
Referenced by exportObjects(), and Save().
Friends And Related Function Documentation
◆ Application
|
friend |
◆ DocumentObject
|
friend |
The DocumentObject that will own the expression.
◆ Transaction
|
friend |
◆ TransactionalObject
|
friend |
because of transaction handling
◆ TransactionDocumentObject
|
friend |
Member Data Documentation
◆ Comment
PropertyString App::Document::Comment |
long comment or description (UTF8 with line breaks)
Referenced by Document().
◆ Company
PropertyString App::Document::Company |
company name UTF8(optional)
Referenced by Document().
◆ CreatedBy
PropertyString App::Document::CreatedBy |
creators name (utf-8)
Referenced by Document().
◆ CreationDate
PropertyString App::Document::CreationDate |
Referenced by Document().
◆ FileName
PropertyString App::Document::FileName |
full qualified (with path) file name (utf-8 coded)
Referenced by Document(), App::DocInfo::getDocPath(), Import::ImportOCAF2::ImportOCAF2(), isSaved(), App::DocumentPy::load(), App::Application::openDocumentPrivate(), App::DocumentPy::restore(), restore(), Restore(), App::DocumentPy::save(), save(), saveAs(), saveCopy(), Import::ImportOCAF2::setMode(), and App::PropertyXLink::setValue().
◆ Id
PropertyString App::Document::Id |
Id e.g. Part number.
Referenced by Document().
◆ Label
PropertyString App::Document::Label |
holds the long name of the document (utf-8 coded)
Referenced by Gui::Document::createView(), Document(), PartGui::DlgExtrusion::findShapes(), onBeforeChange(), onChanged(), Gui::MDIView::onRelabel(), DrawingGui::DrawingView::onRelabel(), recompute(), Restore(), save(), saveAs(), and Gui::DocumentItem::setData().
◆ LastModifiedBy
PropertyString App::Document::LastModifiedBy |
user last modified the document
Referenced by Document(), and save().
◆ LastModifiedDate
PropertyString App::Document::LastModifiedDate |
Referenced by Document(), and save().
◆ License
App::PropertyString App::Document::License |
License string Holds the short license string for the Item, e.g.
CC-BY for the Creative Commons license suit.
Referenced by Document().
◆ LicenseURL
App::PropertyString App::Document::LicenseURL |
License description/contract URL.
Referenced by Document().
◆ Material
App::PropertyMap App::Document::Material |
◆ Meta
App::PropertyMap App::Document::Meta |
Meta descriptions.
Referenced by Document().
◆ ShowHidden
PropertyBool App::Document::ShowHidden |
Whether to show hidden items in TreeView.
Referenced by Document(), onChanged(), Gui::DocumentItem::setShowHidden(), and Gui::DocumentItem::showHidden().
◆ signalAbortTransaction
boost::signals2::signal<void (const App::Document&)> App::Document::signalAbortTransaction |
◆ signalActivatedObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalActivatedObject |
signal on activated Object
Referenced by addObject(), addObjects(), and Gui::Document::Document().
◆ signalBeforeChange
boost::signals2::signal<void (const App::Document&, const App::Property&)> App::Document::signalBeforeChange |
signal before changing an doc property
Referenced by onBeforeChange().
◆ signalBeforeChangeObject
boost::signals2::signal<void (const App::DocumentObject&, const App::Property&)> App::Document::signalBeforeChangeObject |
signal before changing an Object
Referenced by onBeforeChangeProperty().
◆ signalBeforeRecompute
boost::signals2::signal<void (const App::Document&)> App::Document::signalBeforeRecompute |
Referenced by recompute().
◆ signalChanged
boost::signals2::signal<void (const App::Document&, const App::Property&)> App::Document::signalChanged |
signal on changed doc property
Referenced by onChanged().
◆ signalChangedObject
boost::signals2::signal<void (const App::DocumentObject&, const App::Property&)> App::Document::signalChangedObject |
signal on changed Object
Referenced by PartDesignGui::ViewProviderBody::attach(), Gui::Document::Document(), Gui::ViewProviderOriginGroupExtension::extensionAttach(), onChangedProperty(), and FemGui::FunctionWidget::setViewProvider().
◆ signalChangePropertyEditor
boost::signals2::signal<void (const App::Document&,const App::Property&)> App::Document::signalChangePropertyEditor |
Referenced by Gui::Document::Document(), and Gui::ViewProviderDocumentObject::onPropertyStatusChanged().
◆ signalCommitTransaction
boost::signals2::signal<void (const App::Document&)> App::Document::signalCommitTransaction |
◆ signalDeletedObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalDeletedObject |
signal on deleted Object
Referenced by Gui::Document::Document(), TechDrawGui::MDIViewPage::MDIViewPage(), and removeObject().
◆ signalExportObjects
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::Writer &)> App::Document::signalExportObjects |
Referenced by exportObjects().
◆ signalExportViewObjects
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::Writer &)> App::Document::signalExportViewObjects |
Referenced by Gui::Document::Document(), and App::MergeDocuments::SaveDocFile().
◆ signalFinishImportObjects
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&)> App::Document::signalFinishImportObjects |
Referenced by Gui::Document::Document(), and importObjects().
◆ signalFinishRestoreObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalFinishRestoreObject |
Referenced by afterRestore(), and Gui::Document::Document().
◆ signalFinishSave
boost::signals2::signal<void (const App::Document&, const std::string&)> App::Document::signalFinishSave |
Referenced by saveToFile().
◆ signalImportObjects
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::XMLReader&)> App::Document::signalImportObjects |
Referenced by importObjects().
◆ signalImportViewObjects
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::Reader&, const std::map<std::string, std::string>&)> App::Document::signalImportViewObjects |
Referenced by Gui::Document::Document(), and App::MergeDocuments::RestoreDocFile().
◆ signalNewObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalNewObject |
signal on new Object
Referenced by addObject(), addObjects(), and Gui::Document::Document().
◆ signalOpenTransaction
boost::signals2::signal<void (const App::Document&, std::string)> App::Document::signalOpenTransaction |
◆ signalRecomputed
boost::signals2::signal<void (const App::Document&, const std::vector<App::DocumentObject*>&)> App::Document::signalRecomputed |
Referenced by Gui::Document::Document(), Gui::GraphvizView::GraphvizView(), and recompute().
◆ signalRecomputedObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalRecomputedObject |
Referenced by PartDesign::SubShapeBinder::onChanged(), recompute(), and recomputeFeature().
◆ signalRedo
boost::signals2::signal<void (const App::Document&)> App::Document::signalRedo |
signal on redo
Referenced by Gui::Document::Document(), Gui::GraphvizView::GraphvizView(), redo(), and SketcherGui::TaskDlgEditSketch::TaskDlgEditSketch().
◆ signalRelabelObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalRelabelObject |
signal on relabeled Object
Referenced by Gui::Document::Document().
◆ signalRestoreDocument
boost::signals2::signal<void (Base::XMLReader&)> App::Document::signalRestoreDocument |
Referenced by Gui::Document::Document(), and restore().
◆ signalSaveDocument
boost::signals2::signal<void (Base::Writer &)> App::Document::signalSaveDocument |
signal on load/save document this signal is given when the document gets streamed.
you can use this hook to write additional information in the file (like the Gui::Document does).
Referenced by Gui::Document::Document(), Sandbox::DocumentSaverThread::run(), and saveToFile().
◆ signalSkipRecompute
boost::signals2::signal<void (const App::Document&, const std::vector<App::DocumentObject*>&)> App::Document::signalSkipRecompute |
Referenced by Gui::Document::Document(), and recompute().
◆ signalStartSave
boost::signals2::signal<void (const App::Document&, const std::string&)> App::Document::signalStartSave |
Referenced by saveToFile().
◆ signalTouchedObject
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalTouchedObject |
signal on manually called DocumentObject::touch()
Referenced by Gui::Document::Document().
◆ signalTransactionAppend
boost::signals2::signal<void (const App::DocumentObject&, Transaction*)> App::Document::signalTransactionAppend |
signal on created object
Referenced by addObject(), addObjects(), and Gui::Document::Document().
◆ signalTransactionRemove
boost::signals2::signal<void (const App::DocumentObject&, Transaction*)> App::Document::signalTransactionRemove |
signal on removed object
Referenced by Gui::Document::Document(), and removeObject().
◆ signalUndo
boost::signals2::signal<void (const App::Document&)> App::Document::signalUndo |
signal on undo
Referenced by Gui::Document::Document(), Gui::GraphvizView::GraphvizView(), SketcherGui::TaskDlgEditSketch::TaskDlgEditSketch(), and undo().
◆ Tip
PropertyLink App::Document::Tip |
Tip object of the document (if any)
Referenced by Document(), removeObject(), Restore(), and save().
◆ TipName
PropertyString App::Document::TipName |
Tip object of the document (if any)
Referenced by Document(), removeObject(), Restore(), and save().
◆ TransientDir
PropertyString App::Document::TransientDir |
read-only name of the temp dir created when the document is opened
Referenced by Document(), onChanged(), App::VRMLObject::RestoreDocFile(), Sandbox::DocumentSaverThread::run(), App::VRMLObject::SaveDocFile(), Gui::AutoSaver::slotCreateDocument(), and ~Document().
◆ Uid
PropertyUUID App::Document::Uid |
unique identifier of the document
Referenced by Document(), onChanged(), and saveAs().
The documentation for this class was generated from the following files:
- src/App/Document.h
- src/App/Document.cpp