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 , TempDoc = 9 , RestoreError = 10 , LinkStampChanged = 11 , IgnoreErrorOnRecompute = 12 } |
Public Member Functions | |
Object handling <br> | |
DocumentObject * | addObject (const char *sType, const char *pObjectName=nullptr, bool isNew=true, const char *viewType=nullptr, 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=nullptr) |
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, bool returnAll=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 char *label) 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=nullptr, 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 they want 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=nullptr) |
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) |
Public Member Functions inherited from App::PropertyContainer | |
virtual App::Property * | addDynamicProperty (const char *type, const char *name=nullptr, const char *group=nullptr, const char *doc=nullptr, short attr=0, bool ro=false, bool hidden=false) |
bool | changeDynamicProperty (const Property *prop, const char *group, const char *doc) |
virtual void | editProperty (const char *) |
virtual App::Property * | getDynamicPropertyByName (const char *name) const |
DynamicProperty::PropData | getDynamicPropertyData (const Property *prop) const |
virtual std::vector< std::string > | getDynamicPropertyNames () const |
virtual std::string | getFullName () const |
virtual unsigned int | getMemSize (void) const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
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... | |
virtual void | getPropertyNamedList (std::vector< std::pair< const char *, Property * > > &List) const |
get all properties with their names, may contain duplicates and aliases 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) |
virtual void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. More... | |
virtual void | Save (Base::Writer &writer) const |
This method is used to save properties to an XML document. More... | |
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... | |
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... | |
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... | |
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=nullptr, bool delaySignal=false, const std::vector< std::string > &objNames={}) |
Restore the document from the file in Property Path. More... | |
bool | 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... | |
const char * | getProgramVersion () const |
Get program version the project file was created with. More... | |
const char * | getFileName () const |
Returned filename. 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 |
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 |
boost::signals2::signal< void(std::string)> | signalLinkXsetValue |
void | clearDocument () |
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 () |
Protected Member Functions inherited from App::PropertyContainer | |
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... | |
virtual void | onBeforeChange (const Property *) |
get called before the value is changed More... | |
virtual void | onChanged (const Property *) |
get called by the container when a property has changed More... | |
Static Protected Member Functions inherited from App::PropertyContainer | |
static const PropertyData * | getPropertyDataPtr (void) |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Protected Attributes inherited from App::PropertyContainer | |
DynamicProperty | dynamicProps |
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.
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 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).
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.
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. |
|
virtual |
|
protected |
Construction.
References Comment, Company, CreatedBy, CreationDate, Base::TimeInfo::currentDateTimeString(), App::DocumentP::DocumentPythonObject, 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.
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().
DocumentObject * Document::addObject | ( | const char * | sType, |
const char * | pObjectName = nullptr , |
||
bool | isNew = true , |
||
const char * | viewType = nullptr , |
||
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.
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::Persistence::getClassTypeId(), Base::Type::getTypeIfDerivedFrom(), 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(), MeshGui::SegmentationBestFit::accept(), ReverseEngineeringGui::Segmentation::accept(), DraftUtils::DraftDxfRead::AddGraphics(), Import::ImpExpDxfRead::AddGraphics(), App::GroupExtension::addObject(), DraftUtils::DraftDxfRead::AddObject(), Import::ImpExpDxfRead::AddObject(), ArchBuildingPart.BuildingPart::autogroup(), Fem::createObjectByType(), ReverseEngineeringGui::SegmentationManual::createSegment(), PartGui::DlgProjectionOnSurface::DlgProjectionOnSurface(), Sandbox::CustomAddObjectEvent::execute(), App::OriginGroupExtension::extensionOnChanged(), ArchPanel.NestTaskPanel::getContainer(), ArchPanel.NestTaskPanel::getShapes(), Part::ImportIgesParts(), Part::ImportStepParts(), Import::ImportOCAF2::loadShapes(), PartDesignGui::TaskFeaturePick::makeCopy(), App::LinkBaseExtension::makeCopyOnChange(), PartDesign::Body::onChanged(), DraftUtils::DraftDxfRead::OnReadText(), Import::ImpExpDxfRead::OnReadText(), DrawingGui::orthoview::orthoview(), readObjects(), Fem::FemVTKTools::readResult(), Restore(), App::LinkBaseExtension::setLink(), Path::Area::showShape(), MeshGui::ViewProviderMesh::splitMesh(), App::LinkBaseExtension::syncCopyOnChange(), and App::LinkBaseExtension::update().
void Document::addObject | ( | DocumentObject * | pcObject, |
const char * | pObjectName = nullptr |
||
) |
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.
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 ArchBuildingPart.BuildingPart::autogroup(), ArchPanel.NestTaskPanel::getContainer(), and ArchPanel.NestTaskPanel::getShapes().
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.
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::Persistence::getClassTypeId(), Base::Tools::getIdentifier(), Base::Type::getTypeIfDerivedFrom(), Base::Tools::getUniqueName(), App::DocumentObject::getViewProviderNameOverride(), 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.
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().
void Document::addRecomputeObject | ( | DocumentObject * | obj | ) |
Called by objects during restore to ask for recompute.
References testStatus(), and App::DocumentP::touchedObjs.
bool Document::afterRestore | ( | const std::vector< App::DocumentObject * > & | objArray, |
bool | checkPartial = false |
||
) |
References App::DocumentP::addRecomputeLog(), DepSort, App::PropertyExpressionEngine::ExecuteOnRestore, getDependencyList(), LinkStampChanged, App::DocumentP::objectArray, PartialDoc, PartialRestore, setStatus(), signalFinishRestoreObject, App::DocumentObject::StdReturn, testStatus(), and App::DocumentP::touchedObjs.
|
protected |
References App::PropertyLinkBase::breakLinks(), and App::DocumentP::objectArray.
Referenced by moveObject(), and removeObject().
bool Document::checkOnCycle | ( | void | ) |
checks if the graph is directed and has no cycles
void Document::clearDocument | ( | ) |
References App::DocumentP::activeObject, App::DocumentP::clearDocument(), 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.
void Document::clearUndos | ( | ) |
Remove all stored Undos and Redos.
References App::DocumentP::activeUndoTransaction, App::DocumentP::committing, and isPerformingTransaction().
Referenced by restore(), setUndoMode(), and ~Document().
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(), MeshGui::SegmentationBestFit::accept(), PartGui::DlgBooleanOperation::accept(), PartGui::DlgFilletEdges::accept(), PartGui::DlgRevolution::accept(), PartGui::Mirroring::accept(), ReverseEngineeringGui::Segmentation::accept(), PartGui::DlgExtrusion::apply(), and Gui::Document::commitCommand().
std::vector< DocumentObject * > Document::copyObject | ( | const std::vector< DocumentObject * > & | objs, |
bool | recursive = false , |
||
bool | returnAll = false |
||
) |
Copy objects from another document to this document.
recursive | if true, then all objects this object depends on are copied as well. By default recursive is false. |
returnAll | if true, return all copied objects including those auto included by recursive searching. If false, then only return the copied object corresponding to the input objects. |
References DepNoXLinked, DepSort, exportObjects(), getDependencyList(), App::Application::getTempFileName(), App::PropertyXLink::hasXLink(), App::MergeDocuments::importObjects(), isSaved(), App::MergeDocuments::setVerbose(), TempDoc, and testStatus().
Referenced by Gui::TreeWidget::dropEvent(), and moveObject().
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().
int Document::countObjectsOfType | ( | const Base::Type & | typeId | ) | const |
References App::DocumentP::objectMap.
Referenced by PartGui::Mirroring::accept(), and PartDesignGui::Workbench::setupContextMenu().
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.
docObj | Document object to get an ID from |
getId returns a canonical string for an ObjectIdentifier;
path |
setGraphAttributes Set graph attributes on a subgraph for a DocumentObject node.
obj | DocumentObject |
setPropertyVertexAttributes Set vertex attributes for a Property node in a graph.
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.
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.
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().
void Document::exportObjects | ( | const std::vector< App::DocumentObject * > & | obj, |
std::ostream & | out | ||
) |
References App::Application::Config(), Base::Uuid::createUuid(), App::Prop_Hidden, App::Prop_Output, Base::ZipWriter::putNextEntry(), App::PropertyUUID::setValue(), signalExportObjects, Base::ZipWriter::Stream(), Base::ZipWriter::writeFiles(), and writeObjects().
Referenced by copyObject(), and importLinks().
std::vector< DocumentObject * > Document::findObjects | ( | const Base::Type & | typeId, |
const char * | objname, | ||
const char * | label | ||
) | const |
References App::DocumentP::objectArray.
Referenced by PartDesignGui::TaskPipeParameters::accept().
DocumentObject * Document::getActiveObject | ( | void | ) | const |
Returns the active Object of this document.
References App::DocumentP::activeObject.
Referenced by Fem::createObjectByType(), Gui::ViewProviderIndex::data(), Fem::getObjectByType(), Gui::Command::isActiveObjectValid(), Fem::FemVTKTools::readResult(), and Fem::FemVTKTools::writeResult().
std::vector< std::string > Document::getAvailableRedoNames | ( | ) | const |
Returns a list of the Redo names.
Referenced by Gui::Document::getRedoVector().
Returns the number of stored Redos. If greater than 0 Redo will be effective.
std::vector< std::string > Document::getAvailableUndoNames | ( | ) | const |
Returns a list of the Undo names.
References App::DocumentP::activeUndoTransaction, and App::Transaction::Name.
Referenced by Gui::Document::getUndoVector().
Returns the number of stored Undos. If greater than 0 Undo will be effective.
References App::DocumentP::activeUndoTransaction, and App::Transaction::getID().
|
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
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(), getDependingObjects(), App::LinkBaseExtension::getOnChangeCopyObjects(), importLinks(), Import::ImportOCAF2::loadShapes(), moveObject(), recompute(), and Gui::ViewProviderLink::setupContextMenu().
std::vector< App::Document * > Document::getDependentDocuments | ( | bool | sort = true | ) |
References getDependentDocuments().
Referenced by Gui::MainWindow::closeAllDocuments(), getDependentDocuments(), App::Application::openDocuments(), Gui::Document::save(), and Gui::Document::saveAll().
|
static |
References App::PropertyXLink::getDocumentOutList().
std::vector< DocumentObject * > Document::getDependingObjects | ( | ) | const |
Returns a list of document's objects including the dependencies.
References getDependencyList(), and App::DocumentP::objectArray.
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().
const char * Document::getFileName | ( | ) | const |
Returned filename.
For saved document, this will be the content stored in property 'Filename'. For unsaved temporary file, this will be the content of property 'TransientDir'.
References FileName, App::PropertyString::getValue(), TempDoc, testStatus(), and TransientDir.
Referenced by App::DocInfo::getDocPath(), and App::PropertyXLink::setValue().
|
overridevirtual |
Reimplemented from App::PropertyContainer.
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.
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.
links | holds the links found |
obj | the linked object. If NULL, then all links are returned. |
option |
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, draftfunctions.move::move(), and App::DocumentP::objectArray.
Referenced by hasLinksTo(), and importLinks().
unsigned int Document::getMaxUndoStackSize | ( | void | ) | const |
Set the Undo limit as stack size.
References App::DocumentP::UndoMaxStackSize.
|
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.
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(), PartDesignGui::TaskShapeBinder::accept(), PartGui::FaceColors::Private::addFacesToSelection(), afterRestore(), Gui::ExpressionBinding::apply(), Gui::ViewProviderAnnotation::attach(), Gui::ViewProviderOriginFeature::attach(), MeshGui::ViewProviderMesh::attach(), PointsGui::ViewProviderScattered::attach(), PointsGui::ViewProviderStructured::attach(), Gui::ViewProviderVRMLObject::attach(), RobotGui::ViewProviderRobotObject::attach(), RobotGui::ViewProviderTrajectory::attach(), 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::TaskSketcherConstraints::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(), SketcherGui::TaskSketcherConstraints::onSelectionChanged(), SketcherGui::TaskSketcherElements::onSelectionChanged(), Gui::Application::open(), App::Application::openDocumentPrivate(), Gui::Dialog::Placement::Placement(), TechDrawGui::MDIViewPage::preSelectionChanged(), Gui::ElementColors::Private::Private(), recompute(), PartDesignGui::TaskDressUpParameters::referenceSelected(), PartDesignGui::TaskPipeParameters::referenceSelected(), PartDesignGui::TaskPipeOrientation::referenceSelected(), PartDesignGui::TaskPipeScaling::referenceSelected(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), removeObject(), App::ObjectIdentifier::resolve(), App::PropertyLinkList::Restore(), Gui::SelectionSingleton::sAddSelection(), TechDrawGui::QGSPage::saveSvg(), Gui::SelectionObserver::SelectionObserver(), Gui::DocumentItem::selectItems(), Gui::Application::setActiveDocument(), Gui::View3DInventorViewer::setDocument(), TechDrawGui::ViewProviderViewPart::setEdit(), SketcherGui::ViewProviderSketch::setEditViewer(), PartDesignGui::TaskDressUpParameters::setSelection(), TechDrawGui::MDIViewPage::setTreeToSceneSelect(), App::PropertyXLink::setValue(), TechDrawGui::ViewProviderPage::showMDIViewPage(), Gui::AutoSaver::slotCreateDocument(), Gui::SelectionSingleton::slotDeletedObject(), Gui::Application::slotDeleteDocument(), Gui::AutoSaver::slotDeleteDocument(), Gui::ElementColors::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(), and ~Document().
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(), SpreadsheetGui::DlgBindSheet::accept(), PartDesignGui::TaskFeaturePick::buildFeatures(), Gui::View3DInventorViewer::checkGroupOnTop(), App::ObjectIdentifier::String::checkImport(), TechDrawGui::TaskActiveView::createActiveView(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::QGSPage::createBalloon(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskSectionView::createSectionView(), TechDrawGui::TaskWeldingSymbol::createWeldingSymbol(), Gui::TreeWidget::dropEvent(), PartGui::DlgExtrusion::getAxisLink(), PartGui::DlgRevolution::getAxisLink(), TechDrawGui::TaskDetail::getBaseFeat(), TechDrawGui::TaskDetail::getDetailFeat(), PartDesignGui::TaskDraftParameters::getLine(), App::GroupExtension::getObject(), Gui::Command::getObject(), PartDesignGui::TaskDraftParameters::getPlane(), PartDesignGui::getReferencedSelection(), PartGui::getShapeFromStrings(), Gui::Document::getViewProviderByName(), PartDesign::ProfileBased::handleChangedPropertyName(), Gui::Command::hasObject(), App::ObjectIdentifier::importSubNames(), PartDesignGui::TaskTransformedParameters::indexesMoved(), TechDrawGui::TaskSectionView::isBaseValid(), TechDrawGui::TaskSectionView::isSectionValid(), PartDesignGui::TaskSketchBasedParameters::onAddSelection(), PartGui::SectionCut::onCutXvalueChanged(), PartGui::SectionCut::onCutYvalueChanged(), PartGui::SectionCut::onCutZvalueChanged(), PartGui::SectionCut::onFlipXclicked(), PartGui::SectionCut::onFlipYclicked(), PartGui::SectionCut::onFlipZclicked(), PartGui::SectionCut::onRefreshCutPBclicked(), PartDesignGui::TaskBooleanParameters::onSelectionChanged(), SketcherGui::DrawSketchHandlerCarbonCopy::onSelectionChanged(), SketcherGui::DrawSketchHandlerExternal::onSelectionChanged(), PartDesignGui::TaskTransformedParameters::originalSelected(), DrawingGui::OrthoViews::OrthoViews(), readObjects(), PartDesignGui::TaskPipeParameters::referenceSelected(), PartDesignGui::TaskPipeOrientation::referenceSelected(), PartDesignGui::TaskPipeScaling::referenceSelected(), App::ObjectIdentifier::resolve(), Restore(), App::PropertyLink::Restore(), App::PropertyLinkList::Restore(), App::PropertyLinkSub::Restore(), App::PropertyLinkSubList::Restore(), App::PropertyXLink::Restore(), PartGui::SectionCut::SectionCut(), Gui::SelectionSingleton::setPreselect(), PartDesignGui::TaskSketchBasedParameters::setUpToFace(), App::PropertyXLink::setValue(), and TechDrawGui::TaskLinkDim::updateDims().
DocumentObject * Document::getObjectByID | ( | long | id | ) | const |
Returns a Object of this document by its id.
References App::DocumentP::objectIdMap.
Referenced by App::LinkBaseExtension::extensionExecute(), and moveObject().
const char * Document::getObjectName | ( | DocumentObject * | pFeat | ) | const |
Returns a Name of an Object or 0.
References App::DocumentP::objectMap.
const std::vector< DocumentObject * > & Document::getObjects | ( | ) | const |
Returns a list of all Objects.
References App::DocumentP::objectArray.
Referenced by Gui::ViewProviderDocumentObject::findFrontRootOfType(), PartDesignGui::ViewProviderDatum::getRelevantBoundBox(), getStandardObjectName(), Gui::DAG::Model::Model(), PartGui::SectionCut::onRefreshCutPBclicked(), PartGui::SectionCut::SectionCut(), and Gui::TreeWidget::startItemSearch().
std::vector< T * > Document::getObjectsOfType |
Returns an array with the correct types already.
References getObjectsOfType().
Referenced by getObjectsOfType().
std::vector< DocumentObject * > Document::getObjectsOfType | ( | const Base::Type & | typeId | ) | const |
References App::DocumentP::objectArray.
Referenced by ReverseEngineeringGui::SegmentationManual::createSegment(), SpreadsheetGui::DlgBindSheet::DlgBindSheet(), ReverseEngineeringGui::SegmentationManual::Private::findGeometry(), TechDrawGui::DrawGuiUtil::findPage(), PartGui::DlgExtrusion::findShapes(), PartGui::DlgFilletEdges::findShapes(), Fem::FemPostFilter::getInputData(), PartDesignGui::getPartFor(), TechDrawGui::DrawGuiUtil::needPage(), TechDrawGui::DrawGuiUtil::needView(), MeshGui::DlgEvaluateMeshImp::on_meshNameButton_activated(), MeshGui::DlgEvaluateMeshImp::refreshList(), and FemGui::TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary().
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.
const std::string & App::Document::getOldLabel | ( | ) | const |
Referenced by App::RelabelDocumentExpressionVisitor::visit().
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 draftfunctions.array::array(), DraftVecUtils::find(), App::DocumentP::findAllPathsAt(), and App::DocumentP::objectArray.
const char * Document::getProgramVersion | ( | ) | const |
Get program version the project file was created with.
References App::DocumentP::programVersion.
|
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.
References App::DocumentP::DocumentPythonObject.
Referenced by App::Application::setActiveDocument().
std::vector< App::DocumentObject * > Document::getRootObjects | ( | ) | const |
get all root objects (objects no other one reference too)
References App::DocumentP::objectArray.
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().
vector< DocumentObject * > Document::getTouched | ( | void | ) | const |
returns all touched objects
References App::DocumentP::objectArray.
Return the undo/redo transaction ID starting from the back.
References App::DocumentP::activeUndoTransaction, App::Transaction::getID(), and undo().
|
protected |
References App::Application::getExecutableName(), and App::Application::getUserCachePath().
Referenced by onChanged().
unsigned int Document::getUndoMemSize | ( | void | ) | const |
Returns the actual memory consumption of the Undo redo stuff.
References App::DocumentP::UndoMemSize.
Referenced by getMemSize().
int Document::getUndoMode | ( | void | ) | const |
switch the level of Undo/Redo
References App::DocumentP::iUndoMode.
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::DlgFilletEdges::accept(), PartGui::DlgRevolution::accept(), addObject(), TechDraw::DrawProjGroup::addProjection(), TechDrawGui::TaskActiveView::createActiveView(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::QGSPage::createBalloon(), TechDrawGui::TaskDetail::createDetail(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskSectionView::createSectionView(), TechDrawGui::TaskWeldingSymbol::createWeldingSymbol(), Gui::TreeWidget::dropEvent(), moveObject(), DrawingGui::orthoview::orthoview(), and App::LinkBaseExtension::setLink().
bool Document::hasLinksTo | ( | const DocumentObject * | obj | ) | const |
Check if there is any link to the given object.
References getLinksTo().
bool Document::hasPendingTransaction | ( | ) | const |
Check if a transaction is open.
References App::DocumentP::activeUndoTransaction.
Referenced by Gui::Document::hasPendingCommand().
std::vector< App::DocumentObject * > Document::importLinks | ( | const std::vector< App::DocumentObject * > & | objs = {} | ) |
Import any externally linked objects.
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. |
References Base::FileInfo::deleteFile(), exportObjects(), getDependencyList(), App::GetLinkExternal, getLinksTo(), App::MergeDocuments::getNameMap(), App::Application::getTempFileName(), App::Property::Immutable, App::MergeDocuments::importObjects(), and App::PartialObject.
std::vector< App::DocumentObject * > Document::importObjects | ( | Base::XMLReader & | reader | ) |
References afterRestore(), Base::Uuid::createUuid(), Base::XMLReader::DocumentSchema, Base::XMLReader::FileVersion, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::getAttributeAsUnsigned(), Base::XMLReader::hasAttribute(), App::ObjImporting, Base::XMLReader::ProgramVersion, App::Prop_Hidden, App::Prop_Output, Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), readObjects(), App::PropertyUUID::setValue(), signalFinishImportObjects, and signalImportObjects.
Referenced by App::MergeDocuments::importObjects(), and Gui::MergeDocuments::importObjects().
|
static |
Indicate if there is any document restoring/importing.
Referenced by App::Application::isRestoring(), Gui::ViewProviderDocumentObject::onPropertyStatusChanged(), App::LinkBaseExtension::setLink(), and App::LinkBaseExtension::update().
bool Document::isClosable | ( | ) | const |
check whether the document can be closed
References Closable, and testStatus().
Document::ExportStatus Document::isExporting | ( | const App::DocumentObject * | obj | ) | const |
References NotExporting, DocExportStatus::objs, and DocExportStatus::status.
Referenced by writeObjects().
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(), PartDesignGui::TaskExtrudeParameters::getReferenceAxis(), PartDesignGui::TaskHelixParameters::getReferenceAxis(), and PartDesignGui::TaskRevolutionParameters::getReferenceAxis().
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(), App::LinkBaseExtension::checkCopyOnChange(), clearUndos(), commitTransaction(), openTransaction(), and App::LinkBaseExtension::update().
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().
bool Document::isTouched | ( | void | ) | const |
check if there is any touched object in this document
References App::DocumentP::objectArray.
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.
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, removeObject(), and App::DocumentP::rollback.
Referenced by Gui::TreeWidget::dropEvent().
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(), recompute(), and Gui::Document::save().
|
overrideprotectedvirtual |
get called before the value is changed
Reimplemented from App::PropertyContainer.
References App::PropertyString::getValue(), Label, and signalBeforeChange.
Referenced by PathScripts.PathGui.QuantitySpinBox::updateProperty().
|
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.
|
overrideprotectedvirtual |
get called by the container when a property has changed
Reimplemented from App::PropertyContainer.
References Base::Console(), Base::FileInfo::createDirectories(), Base::FileInfo::exists(), Base::FileInfo::filePath(), App::GetApplication(), App::PropertyString::getStrValue(), getTransientDirectoryName(), App::PropertyUUID::getValueStr(), Label, Base::FileInfo::renameFile(), App::PropertyUUID::setValue(), App::PropertyString::setValue(), ShowHidden, signalChanged, App::Application::signalRelabelDocument, App::Application::signalShowHidden, TransientDir, Uid, and Base::ConsoleSingleton::Warning().
Referenced by ArchStructure.CommandStructuralSystem::Activated(), draftviewproviders.view_base.ViewProviderDraft::attach(), ArchSite.Compass::buildCoordinates(), draftobjects.wire.Wire::execute(), ArchBuildingPart.ViewProviderBuildingPart::updateData(), ArchPanel.ViewProviderPanelCut::updateData(), ArchPanel.ViewProviderPanelSheet::updateData(), draftviewproviders.view_label.ViewProviderLabel::updateData(), draftviewproviders.view_layer.ViewProviderLayer::updateData(), and draftviewproviders.view_wpproxy.ViewProviderWorkingPlaneProxy::updateData().
|
protected |
callback from the Document objects after property was changed
References signalChangedObject.
void Document::openTransaction | ( | const char * | name = nullptr | ) |
Open a new command Undo/Redo, an UTF-8 name can be specified.
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(), MeshGui::SegmentationBestFit::accept(), PartGui::DlgBooleanOperation::accept(), PartGui::DlgFilletEdges::accept(), PartGui::DlgRevolution::accept(), PartGui::Mirroring::accept(), ReverseEngineeringGui::Segmentation::accept(), PartGui::DlgExtrusion::apply(), PartGui::DlgProjectionOnSurface::DlgProjectionOnSurface(), PartDesignGui::getReferencedSelection(), Gui::Document::openCommand(), and DrawingGui::OrthoViews::OrthoViews().
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.
|
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().
int Document::recompute | ( | const std::vector< App::DocumentObject * > & | objs = {} , |
bool | force = false , |
||
bool * | hasError = nullptr , |
||
int | options = 0 |
||
) |
Recompute touched features and return the number of recalculated features.
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(), App::DocumentP::objectArray, PartialDoc, App::DocumentP::partialTopologicalSort(), App::DocumentP::pendingRemove, Recomputing, App::DocumentP::rollback, signalBeforeRecompute, signalRecomputed, signalRecomputedObject, signalSkipRecompute, SkipRecompute, testStatus(), topologicalSort(), and App::DocumentP::undoing.
Referenced by Gui::Dialog::DlgMacroExecuteImp::accept(), PartGui::DlgBooleanOperation::accept(), PartGui::DlgFilletEdges::accept(), PartGui::DlgRevolution::accept(), PartGui::Mirroring::accept(), Gui::TaskCSysDragger::accept(), Gui::MacroCommand::activated(), Gui::RecentMacrosAction::activateFile(), Gui::TreeWidget::dropEvent(), Sandbox::CustomRecomputeEvent::execute(), Gui::ManualAlignment::finish(), SpreadsheetGui::SheetTableView::pasteClipboard(), Fem::FemVTKTools::readResult(), FemGui::TaskDlgPost::recompute(), recomputeFeature(), TechDrawGui::TaskGeomHatch::reject(), DrawingGui::OrthoViews::set_Axo(), DrawingGui::OrthoViews::set_Axo_scale(), DrawingGui::OrthoViews::set_hidden(), DrawingGui::OrthoViews::set_Ortho(), DrawingGui::OrthoViews::set_smooth(), 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().
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::TaskDressUpParameters::addAllEdges(), 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::onCylinderXSkewChanged(), PartDesignGui::TaskBoxPrimitives::onCylinderYSkewChanged(), 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::TaskBoxPrimitives::onPrismXSkewChanged(), PartDesignGui::TaskBoxPrimitives::onPrismYSkewChanged(), PartDesignGui::TaskBooleanParameters::onSelectionChanged(), PartDesignGui::TaskDraftParameters::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::TaskDimension::recomputeFeature(), TechDrawGui::TaskLeaderLine::recomputeFeature(), and PartDesignGui::TaskDressUpParameters::referenceSelected().
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, App::DocumentP::objectArray, redo(), signalRedo, Transaction, and App::DocumentP::undoing.
Referenced by redo(), and Gui::Document::redo().
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::pendingRemove, App::DocumentP::rollback, App::PropertyLink::setValue(), App::PropertyString::setValue(), signalDeletedObject, signalTransactionRemove, Tip, TipName, and App::DocumentP::undoing.
Referenced by App::GroupExtension::addObject(), DrawingGui::orthoview::deleteme(), Sandbox::CustomRemoveObjectEvent::execute(), moveObject(), FemGui::TaskFemConstraint::onButtonWizCancel(), App::OriginGroupExtension::onExtendedUnsetupObject(), and TechDraw::DrawProjGroup::removeProjection().
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.
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().
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.
|
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().
void Document::restore | ( | const char * | filename = nullptr , |
bool | delaySignal = false , |
||
const std::vector< std::string > & | objNames = {} |
||
) |
Restore the document from the file in Property Path.
References App::DocumentP::activeObject, afterRestore(), App::DocumentP::clearDocument(), 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, App::DocumentP::programVersion, Base::XMLReader::ProgramVersion, Base::XMLReader::readFiles(), Restore(), RestoreError, Restoring, App::Application::setActiveDocument(), setStatus(), App::Application::signalDeleteDocument, App::Application::signalNewDocument, signalRestoreDocument, App::Application::signalStartRestoreDocument, and Base::XMLReader::testStatus().
Referenced by App::Application::openDocumentPrivate().
|
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.
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().
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 Mod.Show.mTempoVis.TempoVis::modify(), Mod.Show.mTempoVis.TempoVis::modifyVPProperty(), draftguitools.gui_setstyle.Draft_SetStyle_TaskPanel::onSaveStyle(), saveAs(), and Mod.Show.mTempoVis.TempoVis::saveCamera().
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 PathScripts.PathToolBitCmd.CommandToolBitSave::Activated(), PathScripts.PathToolBitCmd.CommandToolBitSave::GetResources(), and PathScripts.PathToolBitCmd.CommandToolBitSave::IsActive().
bool Document::saveCopy | ( | const char * | file | ) | const |
References FileName, App::PropertyString::getStrValue(), and 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, App::Application::signalSaveDocument, signalSaveDocument, signalStartSave, App::BackupPolicy::Standard, Base::ZipWriter::Stream(), App::BackupPolicy::TimeStamp, App::BackupPolicy::useBackupExtension(), and Base::ZipWriter::writeFiles().
Referenced by save(), and saveCopy().
void Document::setClosable | ( | bool | c | ) |
set the document to be closable, this is on by default.
References Closable, and setStatus().
void Document::setMaxUndoStackSize | ( | unsigned int | UndoMaxStackSize = 20 | ) |
Set the Undo limit as stack size.
References App::DocumentP::UndoMaxStackSize.
set the status bits
References App::DocumentP::StatusBits.
Referenced by afterRestore(), clearDocument(), TechDraw::DrawDimHelper::makeExtentDim(), readObjects(), Restore(), restore(), and setClosable().
void Document::setTransactionMode | ( | int | iMode | ) |
switch the transaction mode
References App::DocumentP::iTransactionMode.
void Document::setUndoLimit | ( | unsigned int | UndoMemSize = 0 | ) |
Set the Undo limit in Byte!
References App::DocumentP::UndoMemSize.
void Document::setUndoMode | ( | int | iMode | ) |
switch the level of Undo/Redo
References clearUndos(), and App::DocumentP::iUndoMode.
return the status bits
Referenced by addObjects(), addOrRemovePropertyOfObject(), addRecomputeObject(), afterRestore(), copyObject(), TechDraw::DrawViewDetail::execute(), TechDraw::DrawViewSection::execute(), App::OriginGroupExtension::extensionOnChanged(), getFileName(), TechDraw::DrawViewPart::getSourceShape(), TechDraw::DrawViewPart::getSourceShapeFused(), getUniqueObjectName(), isClosable(), readObjects(), recompute(), save(), and PartDesignGui::ViewProviderBody::updateOriginDatumSize().
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 recompute().
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, App::DocumentP::objectArray, signalUndo, Transaction, undo(), and App::DocumentP::undoing.
Referenced by getTransactionID(), undo(), and Gui::Document::undo().
void Document::writeDependencyGraphViz | ( | std::ostream & | out | ) |
write GraphViz file
References App::DocumentP::objectMap.
|
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().
|
friend |
|
friend |
The DocumentObject that will own the expression.
|
friend |
|
friend |
because of transaction handling
|
friend |
PropertyString App::Document::Comment |
long comment or description (UTF8 with line breaks)
Referenced by Document().
PropertyString App::Document::Company |
company name UTF8(optional)
Referenced by Document().
PropertyString App::Document::CreatedBy |
creators name (utf-8)
Referenced by Document().
PropertyString App::Document::CreationDate |
Referenced by Document().
PropertyString App::Document::FileName |
full qualified (with path) file name (utf-8 coded)
Referenced by Document(), getFileName(), Import::ImportOCAF2::ImportOCAF2(), isSaved(), App::Application::openDocumentPrivate(), Restore(), restore(), save(), saveAs(), saveCopy(), and Import::ImportOCAF2::setMode().
PropertyString App::Document::Id |
Id e.g. Part number.
Referenced by Document().
PropertyString App::Document::Label |
holds the long name of the document (utf-8 coded)
Referenced by Gui::Document::canClose(), Gui::Document::createView(), Document(), PartGui::DlgExtrusion::findShapes(), onBeforeChange(), onChanged(), Gui::MDIView::onRelabel(), DrawingGui::DrawingView::onRelabel(), recompute(), Restore(), save(), saveAs(), Gui::DocumentItem::setData(), and App::RelabelDocumentExpressionVisitor::visit().
PropertyString App::Document::LastModifiedBy |
user last modified the document
Referenced by Document(), and save().
PropertyString App::Document::LastModifiedDate |
Referenced by Document(), and save().
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().
App::PropertyString App::Document::LicenseURL |
License description/contract URL.
Referenced by Document().
App::PropertyMap App::Document::Material |
App::PropertyMap App::Document::Meta |
Meta descriptions.
Referenced by Document().
PropertyBool App::Document::ShowHidden |
Whether to show hidden items in TreeView.
Referenced by Document(), onChanged(), Gui::DocumentItem::setShowHidden(), and Gui::DocumentItem::showHidden().
boost::signals2::signal<void (const App::Document&)> App::Document::signalAbortTransaction |
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalActivatedObject |
signal on activated Object
Referenced by addObject(), addObjects(), and Gui::Document::Document().
boost::signals2::signal<void (const App::Document&, const App::Property&)> App::Document::signalBeforeChange |
signal before changing an doc property
Referenced by onBeforeChange().
boost::signals2::signal<void (const App::DocumentObject&, const App::Property&)> App::Document::signalBeforeChangeObject |
signal before changing an Object
Referenced by onBeforeChangeProperty().
boost::signals2::signal<void (const App::Document&)> App::Document::signalBeforeRecompute |
Referenced by recompute().
boost::signals2::signal<void (const App::Document&, const App::Property&)> App::Document::signalChanged |
signal on changed doc property
Referenced by onChanged().
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().
boost::signals2::signal<void (const App::Document&,const App::Property&)> App::Document::signalChangePropertyEditor |
Referenced by Gui::Document::Document(), and Gui::ViewProviderDocumentObject::onPropertyStatusChanged().
boost::signals2::signal<void (const App::Document&)> App::Document::signalCommitTransaction |
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalDeletedObject |
signal on deleted Object
Referenced by Gui::Document::Document(), TechDrawGui::MDIViewPage::MDIViewPage(), and removeObject().
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::Writer &)> App::Document::signalExportObjects |
Referenced by exportObjects().
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::Writer &)> App::Document::signalExportViewObjects |
Referenced by Gui::Document::Document(), and App::MergeDocuments::SaveDocFile().
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&)> App::Document::signalFinishImportObjects |
Referenced by Gui::Document::Document(), and importObjects().
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalFinishRestoreObject |
Referenced by afterRestore(), and Gui::Document::Document().
boost::signals2::signal<void (const App::Document&, const std::string&)> App::Document::signalFinishSave |
Referenced by saveToFile().
boost::signals2::signal<void (const std::vector<App::DocumentObject*>&, Base::XMLReader&)> App::Document::signalImportObjects |
Referenced by importObjects().
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().
boost::signals2::signal<void (std::string)> App::Document::signalLinkXsetValue |
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalNewObject |
signal on new Object
Referenced by addObject(), addObjects(), and Gui::Document::Document().
boost::signals2::signal<void (const App::Document&, std::string)> App::Document::signalOpenTransaction |
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().
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalRecomputedObject |
Referenced by PartDesign::SubShapeBinder::onChanged(), recompute(), and recomputeFeature().
boost::signals2::signal<void (const App::Document&)> App::Document::signalRedo |
signal on redo
Referenced by Gui::Document::Document(), Gui::GraphvizView::GraphvizView(), and redo().
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalRelabelObject |
signal on relabeled Object
Referenced by Gui::Document::Document().
boost::signals2::signal<void (Base::XMLReader&)> App::Document::signalRestoreDocument |
Referenced by Gui::Document::Document(), and restore().
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().
boost::signals2::signal<void (const App::Document&, const std::vector<App::DocumentObject*>&)> App::Document::signalSkipRecompute |
Referenced by Gui::Document::Document(), and recompute().
boost::signals2::signal<void (const App::Document&, const std::string&)> App::Document::signalStartSave |
Referenced by saveToFile().
boost::signals2::signal<void (const App::DocumentObject&)> App::Document::signalTouchedObject |
signal on manually called DocumentObject::touch()
Referenced by Gui::Document::Document().
boost::signals2::signal<void (const App::DocumentObject&, Transaction*)> App::Document::signalTransactionAppend |
signal on created object
Referenced by addObject(), addObjects(), and Gui::Document::Document().
boost::signals2::signal<void (const App::DocumentObject&, Transaction*)> App::Document::signalTransactionRemove |
signal on removed object
Referenced by Gui::Document::Document(), and removeObject().
boost::signals2::signal<void (const App::Document&)> App::Document::signalUndo |
signal on undo
Referenced by Gui::Document::Document(), Gui::GraphvizView::GraphvizView(), and undo().
PropertyLink App::Document::Tip |
Tip object of the document (if any)
Referenced by Document(), removeObject(), Restore(), and save().
PropertyString App::Document::TipName |
Tip object of the document (if any)
Referenced by Document(), removeObject(), Restore(), and save().
PropertyString App::Document::TransientDir |
read-only name of the temp dir created when the document is opened
Referenced by Document(), getFileName(), onChanged(), App::VRMLObject::RestoreDocFile(), Sandbox::DocumentSaverThread::run(), App::VRMLObject::SaveDocFile(), Gui::AutoSaver::slotCreateDocument(), and ~Document().
PropertyUUID App::Document::Uid |
unique identifier of the document
Referenced by Document(), onChanged(), and saveAs().