OpenLexocad  27.1
CoreDocument.h File Reference
#include <Base/GlobalAttachment.h>
#include <Base/Observer.h>
#include <Core/DocObject.h>
#include <Core/PropertyBundle.h>
#include <Core/PropertyContainer.h>
#include <Core/PropertyInteger.h>
#include <Core/PropertyLink.h>
#include <Core/PropertyText.h>
#include <Core/PythonScriptObject.h>
#include <QDateTime>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <vector>
#include <optional>
#include <boost/signals2.hpp>

Go to the source code of this file.

Classes

struct  Core::AttachmentEntry
 
class  Core::DocChanges
 
struct  Core::DocumentState
 
struct  Core::PropertyLinkDesc
 
class  Core::CoreDocument
 
class  DocumentTimeStampSentinel
 
class  DocumentFactory
 
class  CoreDocument_Factory
 

Namespaces

 Core
 

Macros

#define DIR_NAME_INTERNAL_CATALOG   "__internalCatalog__"
 
#define DIR_NAME_WEBGL_GT   "webgl"
 
#define DIR_NAME_GEOID   "geoid"
 
#define FILE_NAME_CAMERA_ANIMATION   "CameraAnimation.ivc"
 
#define DECLARE_DOCUMENT_FACTORY(_factoryName_, _class_)
 
#define REGISTER_DOCUMENT_FACTORY(_factoryName_, _class_)   Core::DocumentFactory::registry[#_class_] = (Core::DocumentFactory*)new _factoryName_();
 

Typedefs

typedef std::vector< Core::DocObject * > DOCOBJECTS
 
typedef std::map< Core::DocObject *, std::vector< std::string > > DOCOBJECTS_ERROR_MAP
 
typedef std::unordered_map< DocObject::IdType, Core::DocObject * > Core::ObjectMap
 
typedef std::vector< Core::ExecObject * > Core::ExecObjectVector
 
typedef std::unordered_set< Core::ExecObject * > Core::ExecObjectSet
 
typedef std::unordered_map< DocObject::IdType, Core::ExecObject * > Core::ExecObjectMap
 
typedef std::map< Base::Type, ObjectSet > Core::ObjectTypeMap
 
typedef std::multimap< Base::String, Core::AttachmentEntryCore::Attachments
 

Enumerations

enum  Status {
  SkipRecompute = 0, KeepTrailingDigits = 1, Closable = 2, Restoring = 3,
  Recomputing = 4, PartialRestore = 5, Importing = 6, PartialDoc = 7,
  AllowPartialRecompute = 8, TempDoc = 9, RestoreError = 10
}
 

Functions

Core::CoreDocument Core::PropertyContainer, Base::Subject Core::recompute (std::function< void(DOCOBJECTS newObj, DOCOBJECTS updatedObj, DOCOBJECTS deletedObj, DOCOBJECTS_ERROR_MAP errorObj)> onRecomputedCB)
 
 TYPESYSTEM_HEADER ()
 
 LX_NODE_HEADER ()
 
int getDocumentVersion () const
 Returns the version of the document. More...
 
bool addObject (Core::DocObject *e)
 Adds an existing object to the document. More...
 
void removeObject (Core::DocObject *e)
 Removes an object from the document. More...
 
void removeObjectFinal (Core::DocObject *e, bool deep=false)
 Removes an object from the document. More...
 
virtual void onFileOpened ()
 Is called when the file was opened, but before the message FileOpened gets emitted. Can be overwritten to add custom behavior. More...
 
void onBeforeChangeProperty (const Core::DocObject *Who, const Property *What)
 callback from the Document objects before property will be changed More...
 
void onChangedProperty (const Core::DocObject *Who, const Property *What)
 callback from the Document objects after property was changed More...
 
virtual bool onChangedDebug (Core::DocObject *o, Core::Property *p)
 
Base::Type getCopyType () const
 
void clearCopyType ()
 Sets the copy type to Base::Type::badType(), next copied object will be copied as its own type. More...
 
Core::DocObjectcopyObject (Core::DocObject *o, DocObjectMap &copyMap=DocObjectMap())
 Creates a copy of 'o' and adds it to the document, provides map of pairs original-copy to see which object is a copy of another one. More...
 
Core::DocObjectcopyToDifferentType (Core::DocObject *o, Base::Type typeToCreate, DocObjectMap &copyMap)
 Creates an object of type 'typeToCreate' and copy properties from 'o' to it. Provides map of pairs original-copy. More...
 
Core::DocObjectcopySharedObject (Core::DocObject *o, DocObjectMap &copyMap)
 Copy shared object. This is violating of the share, but in some cases this is useful. Use wisely!! More...
 
template<typename Type >
Type copyObjectShallow (Type o)
 Creates a copy of 'o' and adds it to the document. Performs shallow copy. More...
 
std::vector< Core::DocObject * > getObjects (bool includeDeletedObjects=false) const
 Returns all objects in the document. More...
 
std::vector< const Core::DocObject * > getObjectsConst (bool includeDeletedObjects=false) const
 
std::vector< Core::DocObject * > getObjectsSorted () const
 Returns all objects topologically sorted. More...
 
Core::DocObjectcreateObjectFromTypeName (const char *typeName)
 Creates an object from type name and adds it to the document. More...
 
Core::DocObjectcreateObjectFromType (Base::Type type)
 Creates an object from type and adds it to the document. More...
 
std::vector< Core::DocObject * > getObjectsByTypeName (const std::string &typeName) const
 Returns all objects of typeName. More...
 
virtual void recompute ()
 Recomputes the document. More...
 
virtual bool Core::saveAs (const Base::String &filename)
 Saves the document under this name. More...
 
Base::String Core::getTmpDirectory ()
 Returns the temporary directory. More...
 
bool Core::isActive () const
 Returns 'true' if the Document is the active Document. Otherwise returns 'false'. More...
 
virtual bool Core::isChanged ()
 Returns 'true' if the document is changed. More...
 
Core::DocObjectCore::getObjectByGlobalId (const Base::GlobalId &guid) const
 Returns the DocObject with this GUID. More...
 
std::string Core::getDocXMLAsString ()
 
bool Core::testStatusBits (Status pos) const
 return the status bits More...
 
void Core::setStatusBits (Status pos, bool on)
 set the status bits More...
 
virtual Core::DocObjectCore::getObjectById (const DocObject::IdType &id) const
 Returns the object with this id. More...
 
Core::DocObjectCore::getObjectByUserName (const Base::String &s) const
 Returns the object with this userName. More...
 
void Core::emitAndNotify (Core::DocChanges &aDocChanges)
 
template<typename T >
T * Core::createObject ()
 
template<typename T >
T * Core::addImmutableObject (Core::PropertyBundle< T > *po)
 
template<typename T >
T * Core::addImmutableObject_NoCheck (Core::PropertyBundle< T > *po)
 
template<typename T >
std::vector< T * > Core::getObjectsByType () const
 Return all object of given type and all derived classes. More...
 
template<typename T >
void Core::getObjectsByType (std::vector< T * > &objs) const
 Returns all objects of type 'T'. More...
 
void Core::getObjectsFromTypeMap (Base::Type t, std::vector< Core::DocObject * > &ret) const
 Returns all objects of type 'T'. More...
 
const ObjectTypeMap & Core::getTypeMap () const
 
void Core::addPropertyLinkError (const std::string &from, const std::string &to)
 
const DocumentState & Core::getDocumentState () const
 
bool Core::checkObjectLinks (const std::vector< const Core::DocObject * > &objvec, std::vector< std::pair< const Core::DocObject *, const Core::DocObject * >> *errors=nullptr)
 Checks the document for errors. Returns false if there is an error. More...
 
bool Core::checkObjectLinks (const std::vector< const Core::DocObject * > &objvec, const std::vector< const Core::DocObject * > &objToCheck, std::vector< std::pair< const Core::DocObject *, const Core::DocObject * >> *errors=nullptr)
 
bool Core::checkDeletedObjectLinks (const std::vector< const Core::DocObject * > &objToCheck, std::vector< std::pair< const Core::DocObject *, const Core::DocObject * >> *errors)
 
std::vector< const Core::DocObject * > Core::getInner (const Core::DocObject *me, std::function< bool(const Core::DocObject *)> *allowToAddObject=0)
 Get ALL Links to me, also indirect. More...
 
std::vector< const Core::DocObject * > Core::getOuter (const Core::DocObject *me)
 Get ALL Links from me, also indirect. More...
 
std::vector< const Core::DocObject * > Core::getLinksByProperties (const Core::DocObject *o) const
 
std::vector< PropertyLinkDesc > Core::getLinkDescByProperties (const Core::DocObject *o) const
 
std::vector< const Core::DocObject * > Core::getBackLinksByProperties (const Core::DocObject *source) const
 
void Core::removeLinkInProperties (const Core::DocObject *source, Core::DocObject *link)
 
void Core::removeBackLinkInProperties (const Core::DocObject *source, Core::DocObject *link)
 
std::string Core::dumpGraph (void)
 Returns a string representation of the graph. More...
 
std::vector< std::string > Core::check_graph ()
 
std::vector< const Core::DocObject * > Core::getLinksToMe (const Core::DocObject *o)
 Returns all objects that directly linked to 'o'. More...
 
std::vector< const Core::DocObject * > Core::getBackLinksToMe (const Core::DocObject *o)
 Returns all objects that directly linked to 'o'. More...
 
std::vector< const Core::DocObject * > Core::getLinksFromMe (const Core::DocObject *o)
 Returns all objects 'o' directly linked from 'o'. More...
 
std::vector< const Core::DocObject * > Core::getBackLinksFromMe (const Core::DocObject *o)
 Returns all objects 'o' directly linked from 'o'. More...
 
virtual bool Core::maybeSave ()
 Can be overwritten to check if the undo stack is clean etc. More...
 
std::vector< Core::DocObject * > Core::getObjectsToSave ()
 Returns all objects that will be saved in document. Basically interface for build_savemap(). More...
 
bool Core::saveFile (bool toExport=false, bool saveBackupCopy=false)
 Saves the file. More...
 
bool Core::saveAsFile (const Base::String &filename=Base::String(), bool toExport=false, bool saveBackupCopy=false, const Base::String &initialDir=Base::String())
 Saves a new file under this name. More...
 
bool Core::saveCopy (const Base::String &filename)
 Saves a copy of the current document, no notify, only store the doc under this name. More...
 
bool Core::saveAsFileVersion (int aMajorVersion, int aMinorVersion, const Base::String &filename=Base::String(), bool toExport=false, bool saveBackupCopy=false, const Base::String &initialDir=Base::String(), bool dontRename=false)
 Saves a new file under this name. More...
 
void Core::setOnSaveChangeToDefaultUser (bool onoff)
 If true: Change to default user on next change. Usually from IFC User to Lexocad User. More...
 
bool Core::getOnSaveChangeToDefaultUser () const
 Return whether the user get changed to default user on next save. More...
 
bool Core::askAndSetNewFilename (QString &newFilename, const Base::String &initialDir=Base::String())
 Ask user for filename (if not already passed in as newFilename) and set it to document. Returns false if user cancelled the save. More...
 
void Core::setSaveBlocksUntilFinished (bool onoff)
 If true, saving will block until the whole save is finished and file is ready. More...
 
bool Core::getSaveBlocksUntilFinished () const
 Returns whether saving will block until the whole save is finished and file is ready. More...
 
virtual void Core::addInventorDirectory (const Base::String &)
 Inventor search directories - needs to be stored for IV/Z export, but SoInput is not OK... More...
 
virtual void Core::createGroundPlate_deprecated ()
 To overwrite. Deprecated, do not use. More...
 
void Core::setGuidPolicy (const Base::GlobalId_Policy &policy)
 Sets the default GUID policy. This determines what should be done if identical GUIDs are imported. More...
 
void Core::setGuidPolicy (const Base::String &suffix, const Base::GlobalId_Policy &policy)
 Sets the GUID policy for a file suffix. This determines what should be done if identical GUIDs are imported from files with this suffix. More...
 
Base::GlobalId_Policy Core::getGuidPolicy () const
 Returns the default GUID policy. More...
 
bool Core::getGuidPolicy (const Base::String &suffix, Base::GlobalId_Policy &policy) const
 Returns the GUID policy for a file suffix. More...
 
void Core::addReferenceFrom (Core::DocObject *from)
 
void Core::removeReferenceFrom (Core::DocObject *from)
 
bool Core::hasReferencesFrom (Core::DocObject *from) const
 
const std::set< Core::DocObject * > & Core::getReferences () const
 
void Core::setFullFileName (const Base::String &fullfilename)
 Sets the full file name including the path. More...
 
virtual const char * Core::subject_name (void)
 
virtual bool Core::restoreGlobalAttachment (Base::GlobalAttachment *gAtta, std::istream *, uint64_t streamsize, const Base::String &entryName)
 
bool Core::addFileToZip (const Base::String &entryName, const Base::String &path)
 
bool Core::restoreFileFromZip (const Base::String &entryName, const Base::String &targetpath, bool binaryMode)
 
void Core::forceBackupOnNextSave ()
 Modifies the _lastBackupFileTime to force backup when the document is saved next time. More...
 
bool Core::hasErrorObjectsInRecompute ()
 get result of last recompute More...
 
void Core::resetHasErrorObjectsInRecompute ()
 reset result of last recompute(); More...
 
size_t Core::getRecomputeCount () const
 get count of recomputes() More...
 
virtual void Core::setChanged (bool changed)
 
bool Core::getImmutableObjects (Base::Type t, ObjectSet &set) const
 
virtual Core::DocObjectCore::addImmutableObjectMaterial (Core::PropertyContainer *pc)
 
void Core::setImportedIFCFile (QString a)
 
QString Core::getImportedIFCFile ()
 
void Core::test_graph ()
 
void Core::onAddLink (PropertyLinkBaseBase *p, Core::DocObject *from, Core::DocObject *o)
 
void Core::onRemoveLink (PropertyLinkBaseBase *p, Core::DocObject *from, Core::DocObject *o)
 
void Core::onAddLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::list< Core::DocObject * > &linkList)
 
void Core::onRemoveLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::list< Core::DocObject * > &linkList)
 
void Core::onAddLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::unordered_set< Core::DocObject * > &linkSet)
 
void Core::onRemoveLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::unordered_set< Core::DocObject * > &linkSet)
 
void Core::onAddBackLink (PropertyLinkBaseBase *p, Core::DocObject *from, Core::DocObject *o)
 
void Core::onRemoveBackLink (PropertyLinkBaseBase *p, Core::DocObject *from, Core::DocObject *o)
 
void Core::onAddBackLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::list< Core::DocObject * > &linkList)
 
void Core::onRemoveBackLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::list< Core::DocObject * > &linkList)
 
void Core::onAddBackLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::unordered_set< Core::DocObject * > &linkSet)
 
void Core::onRemoveBackLinks (PropertyLinkBaseBase *p, Core::DocObject *from, const std::unordered_set< Core::DocObject * > &linkSet)
 
Core::DocObject::IdType Core::getUniqueObjectIdFromInteger (size_t input) const
 
void Core::breakLinks (Core::DocObject *from)
 
std::vector< std::pair< Core::PropertyLinkBaseBase *, Core::DocObject * > > Core::getInLinks (Core::DocObject *docObj)
 
std::vector< std::pair< Core::PropertyLinkBaseBase *, Core::DocObject * > > Core::getInBackLinks (Core::DocObject *docObj)
 
std::vector< std::pair< Core::PropertyLinkBaseBase *, Core::DocObject * > > Core::getOutLinks (Core::DocObject *docObj)
 
std::vector< std::pair< Core::PropertyLinkBaseBase *, Core::DocObject * > > Core::getOutBackLinks (Core::DocObject *docObj)
 
 Core::CoreDocument ()
 
 Core::CoreDocument (const CoreDocument &rhs)
 
virtual Core::~CoreDocument ()
 
virtual void Core::deleteObject (Core::DocObject *o)
 Physically deletes an object without informing the object maps. More...
 
Core::DocObject::IdType Core::getUniqueObjectId () const
 Returns the next available unique id. More...
 
void Core::addToDocumentMaps (Core::DocObject *o)
 Adds the object to all relevant maps. More...
 
Core::DocObjectCore::getImmutableObjectWithSameValues (Base::Type t, Core::PropertyContainer *pc) const
 Returns the object that has the same values as 'pc'. Returns '0' if there is no such object. More...
 
virtual Core::DocObjectCore::restoreObject (const std::string &typeName, const std::string &typeHierarchy, const std::string &id)
 Tries to restore an object from a given type name. More...
 
void Core::restoreProperty (Core::Property *property, const Base::String &name, Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
 
virtual void Core::saveDocument (std::shared_ptr< Base::AbstractWriter > writer, int versionMajor2save, int versionMinor2save, bool showProgress)
 Saves the document. More...
 
virtual int Core::restoreDocument (Base::XMLReader &reader, Core::Attachments &attachments)
 Restores the document. Returns the doc version of the restored document. More...
 
virtual std::vector< Core::DocObject * > Core::build_savemap (std::vector< std::string > &delete_log)
 Build a map of the objects that get saved. Objects that are marked for delete get removed. More...
 
void Core::addNewObjectsToGraph ()
 Adds objects with status 'New' to the graph. More...
 
bool Core::checkDeletedObjectLinks (const std::vector< const Core::DocObject * > &objvec, const std::vector< const Core::DocObject * > &objToCheck, std::vector< std::pair< const Core::DocObject *, const Core::DocObject * >> *errors)
 
void Core::resolveLinkInDocument (Core::PropertyLinkBase *link)
 After opening a document this method restores the links declared in the document header. More...
 
virtual bool Core::renameTypeFromOlderVersions (int, Base::String &)
 
virtual void Core::checkBeforeObjectRestoring (int, int)
 Is called before restoring objects of a document. More...
 
virtual void Core::checkAndConfigureOpenedDocument ()
 Is called when opening a document. Can be overwritten to do some custom check routines. More...
 
virtual void Core::checkAndConfigureOpenedDocumentAfterRecompute (int, int)
 Is called when opening a document after recompute. Can be overwritten to do some custom check routines. More...
 
virtual bool Core::convertFromOlderVersions (int docVersion, int appVersion)
 
virtual bool Core::getPatchedUserTypes (const Base::String &filename, std::map< QString, QString > &id2TypeMap)
 
virtual void Core::cleanUndoStack ()
 Cleans the undo stack. Must be overwritten. More...
 
virtual void Core::storeDirectory (const QString &, Base::AbstractWriter &)
 Stores directory at given path to zip stream. More...
 
virtual void Core::restoreDirectory (const QString &)
 Restores directory to temp. More...
 
virtual void Core::initDocument (bool)
 Initialize document.. Can be overwritten to do some custom initialization. More...
 
const ObjectMap & Core::getObjectMap () const
 Returns the object map. More...
 
void Core::createTempDirectory ()
 Creates the temporary directory. More...
 
void Core::cleanTempDirectory ()
 Cleans the temporary directory. More...
 
bool Core::maybe_add_GUID (const Base::GlobalId &guid, Core::DocObject *o)
 Adds a guid to the map IF this id is not in use yet. More...
 
void Core::add_GUID (const Base::GlobalId &guid, Core::DocObject *o)
 Adds a guid without checking. More...
 
void Core::remove_GUID (const Base::GlobalId &guid, Core::DocObject *o)
 Removes a guid without checking. More...
 
void Core::waitForSaveIsFinished ()
 Saving runs in Threads, wait for finish. More...
 
bool Core::isCatalogFile () const
 Returns true if this document's file is part of catalog. More...
 
bool Core::createBackupFile (const Base::String &path, bool savePath)
 
bool Core::createBackupFileAfterOpeningDoc (const Base::String &path, bool savePath)
 
void Core::__setEnableTimeStamps__ (bool aOnOff)
 
bool Core::__getEnableTimeStamps__ () const
 
void Core::_checkTransaction (Core::DocObject *pcDelObj, const Property *What, int line)
 checks if a valid transaction is open More...
 
int Core::_openTransaction (const char *name=0, int id=0)
 
void Core::_commitTransaction (bool notify=false)
 Internally called by App::Application to commit the Command transaction. More...
 
void Core::_abortTransaction ()
 Internally called by App::Application to abort the running transaction. More...
 
void Core::_clearRedos ()
 
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 Core::setUndoMode (int iMode)
 switch the level of Undo/Redo More...
 
int Core::getUndoMode (void) const
 switch the level of Undo/Redo More...
 
void Core::setTransactionMode (int iMode)
 switch the transaction mode More...
 
int Core::openTransaction (const char *name=0)
 
void Core::renameTransaction (const char *name, int id)
 Rename the current transaction if the id matches. More...
 
void Core::commitTransaction ()
 Commit the Command transaction. Do nothing If there is no Command transaction open. More...
 
void Core::abortTransaction ()
 Abort the actually running transaction. More...
 
bool Core::hasPendingTransaction () const
 Check if a transaction is open. More...
 
int Core::getTransactionID (bool undo, unsigned pos=0) const
 Return the undo/redo transaction ID starting from the back. More...
 
bool Core::isTransactionEmpty () const
 
void Core::setUndoLimit (unsigned int UndoMemSize=0)
 Set the Undo limit in Byte! More...
 
void Core::setMaxUndoStackSize (unsigned int UndoMaxStackSize=20)
 Set the Undo limit as stack size. More...
 
unsigned int Core::getMaxUndoStackSize (void) const
 Set the Undo limit as stack size. More...
 
void Core::clearUndos ()
 Remove all stored Undos and Redos. More...
 
int Core::getAvailableUndos (int id=0) const
 Returns the number of stored Undos. If greater than 0 Undo will be effective. More...
 
std::vector< std::string > Core::getAvailableUndoNames () const
 Returns a list of the Undo names. More...
 
bool Core::undo (int id=0)
 Will UNDO one step, returns False if no undo was done (Undos == 0). More...
 
int Core::getAvailableRedos (int id=0) const
 Returns the number of stored Redos. If greater than 0 Redo will be effective. More...
 
std::vector< std::string > Core::getAvailableRedoNames () const
 Returns a list of the Redo names. More...
 
bool Core::redo (int id=0)
 Will REDO one step, returns False if no redo was done (Redos == 0). More...
 
bool Core::isPerformingTransaction () const
 returns true if the document is in an Transaction phase, e.g. currently performing a redo/undo or rollback More...
 

Variables

const int Core::LEXOCAD_CORE_MSGID = 1000
 
 RecomputeError = LEXOCAD_CORE_MSGID
 
 Rename = LEXOCAD_CORE_MSGID + 1
 
 NewFile = LEXOCAD_CORE_MSGID + 2
 
 FileOpened = LEXOCAD_CORE_MSGID + 3
 
 BeforeSave = LEXOCAD_CORE_MSGID + 4
 
 AfterSave = LEXOCAD_CORE_MSGID + 5
 
 CleanAll = LEXOCAD_CORE_MSGID + 6
 
 AddDirectoryPath = LEXOCAD_CORE_MSGID + 7
 
 RecomputeFinished = LEXOCAD_CORE_MSGID + 8
 
 ErrorCanNotOpenFile = LEXOCAD_CORE_MSGID + 9
 
 ChangeToDefaultUser = LEXOCAD_CORE_MSGID + 10
 
 GUID_Conflict = LEXOCAD_CORE_MSGID + 11
 
 Export = LEXOCAD_CORE_MSGID + 12
 
 Import = LEXOCAD_CORE_MSGID + 13
 
 SaveStart = LEXOCAD_CORE_MSGID + 14
 
 Closing = LEXOCAD_CORE_MSGID + 15
 
 PriceCalculationChanged = LEXOCAD_CORE_MSGID + 16
 
Core::PropertyText name
 
Core::PropertyText documentVersion
 
Core::PropertyText compatibleInfo
 
Core::PropertyText documentGUID
 
Core::PropertyIndex documentChanges
 
Core::PropertyIndex documentMaxID
 
Core::PropertyIndex application_mainversion
 
Core::PropertyIndex application_minorversion
 
Core::PropertyText documentTypeName
 
Core::PropertyText filename
 
Core::PropertyText createdBy
 
Core::PropertyText creationDate
 
Core::PropertyText lastModifiedBy
 
Core::PropertyText lastModifiedDate
 
Core::PropertyText company
 
Core::PropertyText comment
 
Core::PropertyText projectNumber
 
Core::PropertyText architect
 
Base::String fileName
 
auto onRecomputedCB
 
DocumentState Core::_state
 
ObjectMap Core::_all_objects_map
 
ObjectVector Core::_all_objects_vector
 
ObjectTypeMap Core::_immutableObjectsMap
 
ObjectGraph * Core::_graph
 
ObjectTypeMap Core::_typeObjects
 
RelGraph * Core::_relGraph
 
RelGraph * Core::_relGraphBackLink
 
std::set< Core::DocObject * > Core::_references
 
std::map< Base::GlobalId, Core::DocObject * > Core::_guid_map
 
std::map< long, Core::DocObject * > Core::_ifcId_map
 
bool Core::_hasErrorObjectsInRecompute = false
 
bool Core::_needRestoreBeforeRecompute = false
 
size_t Core::_recomputeCnt = 0
 
bool Core::mSolvingEnabled = true
 
Signals of the document
boost::signals2::signal< void(Core::DocChanges &)> Core::signalDocChanges
 Signals DocChanges (To be removed) More...
 
boost::signals2::signal< void(const Core::DocObject &)> Core::signalNewObject
 signal on new Object More...
 
boost::signals2::signal< void(const Core::DocObject &)> Core::signalDeletedObject
 signal on deleted Object More...
 
boost::signals2::signal< void(const Core::DocObject &, const Core::Property &)> Core::signalBeforeChangeObject
 signal before changing an Object More...
 
boost::signals2::signal< void(const Core::DocObject &, const Core::Property &)> Core::signalChangedObject
 signal on changed Object More...
 
boost::signals2::signal< void()> Core::signalBeforeRecompute
 Signals before recompute. More...
 
boost::signals2::signal< void(const std::vector< Core::DocObject * > &, const std::vector< Core::DocObject * > &, const std::vector< Core::DocObject * > &)> Core::signalRecomputed
 Signals NewObjects, UpdatedObjects, DeletedObjects being recomputed. More...
 
boost::signals2::signal< void()> Core::signalRecomputeError
 Signals a recompute error. More...
 
boost::signals2::signal< void(const std::map< Core::DocObject *, std::vector< std::string >> &)> Core::signalRecomputedErrorObjects
 Signals recomputed error DocObjects. More...
 
boost::signals2::signal< void(const std::vector< std::pair< const Core::DocObject *, const Core::DocObject * >> &)> Core::signalDefectLinks
 Signals defect links from object1 to object2. More...
 
boost::signals2::signal< void()> Core::signalNewFile
 Signals new file. More...
 

Macro Definition Documentation

◆ DECLARE_DOCUMENT_FACTORY

#define DECLARE_DOCUMENT_FACTORY (   _factoryName_,
  _class_ 
)
Value:
class _factoryName_ : public Core::DocumentFactory \
{ \
private: \
virtual Core::CoreDocument* createByFactory() \
{ \
Core::CoreDocument* doc = new _class_; \
return doc; \
} \
};
Definition: CoreDocument.h:210
CoreDocument(const CoreDocument &rhs)

◆ DIR_NAME_GEOID

#define DIR_NAME_GEOID   "geoid"

◆ DIR_NAME_INTERNAL_CATALOG

#define DIR_NAME_INTERNAL_CATALOG   "__internalCatalog__"

◆ DIR_NAME_WEBGL_GT

#define DIR_NAME_WEBGL_GT   "webgl"

◆ FILE_NAME_CAMERA_ANIMATION

#define FILE_NAME_CAMERA_ANIMATION   "CameraAnimation.ivc"

◆ REGISTER_DOCUMENT_FACTORY

#define REGISTER_DOCUMENT_FACTORY (   _factoryName_,
  _class_ 
)    Core::DocumentFactory::registry[#_class_] = (Core::DocumentFactory*)new _factoryName_();

Typedef Documentation

◆ DOCOBJECTS

typedef std::vector<Core::DocObject*> DOCOBJECTS

◆ DOCOBJECTS_ERROR_MAP

typedef std::map<Core::DocObject*, std::vector<std::string> > DOCOBJECTS_ERROR_MAP

Enumeration Type Documentation

◆ Status

enum Status
Enumerator
SkipRecompute 
KeepTrailingDigits 
Closable 
Restoring 
Recomputing 
PartialRestore 
Importing 
PartialDoc 
AllowPartialRecompute 
TempDoc 
RestoreError 

Function Documentation

◆ addObject()

bool recompute::addObject ( Core::DocObject e)

Adds an existing object to the document.

◆ clearCopyType()

void recompute::clearCopyType ( )

Sets the copy type to Base::Type::badType(), next copied object will be copied as its own type.

◆ copyObject()

Core::DocObject* recompute::copyObject ( Core::DocObject o,
DocObjectMap copyMap = DocObjectMap() 
)

Creates a copy of 'o' and adds it to the document, provides map of pairs original-copy to see which object is a copy of another one.

◆ copyObjectShallow()

template<typename Type >
Type recompute::copyObjectShallow ( Type  o)

Creates a copy of 'o' and adds it to the document. Performs shallow copy.

◆ copySharedObject()

Core::DocObject* recompute::copySharedObject ( Core::DocObject o,
DocObjectMap copyMap 
)

Copy shared object. This is violating of the share, but in some cases this is useful. Use wisely!!

◆ copyToDifferentType()

Core::DocObject* recompute::copyToDifferentType ( Core::DocObject o,
Base::Type  typeToCreate,
DocObjectMap copyMap 
)

Creates an object of type 'typeToCreate' and copy properties from 'o' to it. Provides map of pairs original-copy.

◆ createObjectFromType()

Core::DocObject* recompute::createObjectFromType ( Base::Type  type)

Creates an object from type and adds it to the document.

◆ createObjectFromTypeName()

Core::DocObject* recompute::createObjectFromTypeName ( const char *  typeName)

Creates an object from type name and adds it to the document.

◆ getCopyType()

Base::Type recompute::getCopyType ( ) const

Return type of which new copied element should be created. setCopyType is intentionally not available because it is decided in copy methods.

◆ getDocumentVersion()

int recompute::getDocumentVersion ( ) const

Returns the version of the document.

◆ getObjects()

std::vector<Core::DocObject*> recompute::getObjects ( bool  includeDeletedObjects = false) const

Returns all objects in the document.

◆ getObjectsByTypeName()

std::vector<Core::DocObject*> recompute::getObjectsByTypeName ( const std::string &  typeName) const

Returns all objects of typeName.

◆ getObjectsConst()

std::vector<const Core::DocObject*> recompute::getObjectsConst ( bool  includeDeletedObjects = false) const

◆ getObjectsSorted()

std::vector<Core::DocObject*> recompute::getObjectsSorted ( ) const

Returns all objects topologically sorted.

◆ LX_NODE_HEADER()

recompute::LX_NODE_HEADER ( )

◆ onBeforeChangeProperty()

void recompute::onBeforeChangeProperty ( const Core::DocObject Who,
const Property *  What 
)

callback from the Document objects before property will be changed

◆ onChangedDebug()

virtual bool recompute::onChangedDebug ( Core::DocObject o,
Core::Property p 
)
virtual

◆ onChangedProperty()

void recompute::onChangedProperty ( const Core::DocObject Who,
const Property *  What 
)

callback from the Document objects after property was changed

◆ onFileOpened()

virtual void recompute::onFileOpened ( )
virtual

Is called when the file was opened, but before the message FileOpened gets emitted. Can be overwritten to add custom behavior.

◆ recompute()

virtual void recompute::recompute ( )
virtual

Recomputes the document.

◆ removeObject()

void recompute::removeObject ( Core::DocObject e)

Removes an object from the document.

◆ removeObjectFinal()

void recompute::removeObjectFinal ( Core::DocObject e,
bool  deep = false 
)

Removes an object from the document.

◆ TYPESYSTEM_HEADER()

recompute::TYPESYSTEM_HEADER ( )

Variable Documentation

◆ AddDirectoryPath

AddDirectoryPath = LEXOCAD_CORE_MSGID + 7

◆ AfterSave

AfterSave = LEXOCAD_CORE_MSGID + 5

◆ application_mainversion

Core::PropertyIndex application_mainversion

◆ application_minorversion

Core::PropertyIndex application_minorversion

◆ architect

Core::PropertyText architect

◆ BeforeSave

BeforeSave = LEXOCAD_CORE_MSGID + 4

◆ ChangeToDefaultUser

ChangeToDefaultUser = LEXOCAD_CORE_MSGID + 10

◆ CleanAll

CleanAll = LEXOCAD_CORE_MSGID + 6

◆ Closing

Closing = LEXOCAD_CORE_MSGID + 15

◆ comment

◆ company

◆ compatibleInfo

Core::PropertyText compatibleInfo

◆ createdBy

Core::PropertyText createdBy

◆ creationDate

Core::PropertyText creationDate

◆ documentChanges

Core::PropertyIndex documentChanges

◆ documentGUID

Core::PropertyText documentGUID

◆ documentMaxID

Core::PropertyIndex documentMaxID

◆ documentTypeName

Core::PropertyText documentTypeName

◆ documentVersion

Core::PropertyText documentVersion

◆ ErrorCanNotOpenFile

ErrorCanNotOpenFile = LEXOCAD_CORE_MSGID + 9

◆ Export

Export = LEXOCAD_CORE_MSGID + 12

◆ filename

◆ fileName

Base::String fileName

◆ FileOpened

FileOpened = LEXOCAD_CORE_MSGID + 3

◆ GUID_Conflict

GUID_Conflict = LEXOCAD_CORE_MSGID + 11

◆ Import

Import = LEXOCAD_CORE_MSGID + 13

◆ lastModifiedBy

Core::PropertyText lastModifiedBy

◆ lastModifiedDate

Core::PropertyText lastModifiedDate

◆ name

◆ NewFile

NewFile = LEXOCAD_CORE_MSGID + 2

◆ onRecomputedCB

auto onRecomputedCB
Initial value:
= [this] (DOCOBJECTS newObj, DOCOBJECTS updatedObj,
* DOCOBJECTS deletedObj, DOCOBJECTS_ERROR_MAP errorObj)
std::map< Core::DocObject *, std::vector< std::string > > DOCOBJECTS_ERROR_MAP
Definition: CoreDocument.h:34
std::vector< Core::DocObject * > DOCOBJECTS
Definition: CoreDocument.h:33

Recomputes the document. Takes a lambda as an argument -> { /*CODE

◆ PriceCalculationChanged

PriceCalculationChanged = LEXOCAD_CORE_MSGID + 16

◆ projectNumber

Core::PropertyText projectNumber

◆ RecomputeError

RecomputeError = LEXOCAD_CORE_MSGID

◆ RecomputeFinished

RecomputeFinished = LEXOCAD_CORE_MSGID + 8

◆ Rename

Rename = LEXOCAD_CORE_MSGID + 1

◆ SaveStart

SaveStart = LEXOCAD_CORE_MSGID + 14