SHAPER
9.13.0
|
Document for internal data structure of any object storage. More...
Public Member Functions | |
virtual const std::string & | kind () const =0 |
Returns the kind of the document: "PartSet", "Part", or something else. More... | |
virtual void | close (const bool theForever=false)=0 |
Removes document data. More... | |
virtual std::shared_ptr< ModelAPI_Feature > | addFeature (std::string theID, const bool theMakeCurrent=true)=0 |
Adds to the document the new feature of the given feature id. More... | |
virtual void | refsToFeature (std::shared_ptr< ModelAPI_Feature > theFeature, std::set< std::shared_ptr< ModelAPI_Feature > > &theRefs, const bool isSendError=true)=0 |
Return a list of features, which refers to the feature. More... | |
virtual void | removeFeature (std::shared_ptr< ModelAPI_Feature > theFeature)=0 |
Removes the feature from the document. More... | |
virtual void | moveFeature (std::shared_ptr< ModelAPI_Feature > theMoved, std::shared_ptr< ModelAPI_Feature > theAfterThis, const bool theSplit=false)=0 |
Moves the feature to make it after the given one in the history. More... | |
virtual const int | id () const =0 |
! Returns the id of the document More... | |
virtual std::shared_ptr< ModelAPI_Object > | object (const std::string &theGroupID, const int theIndex, const bool theAllowFolder=false)=0 |
Returns the object in the group by the index (started from zero) More... | |
virtual std::shared_ptr< ModelAPI_Object > | objectByName (const std::string &theGroupID, const std::wstring &theName)=0 |
Returns the first found object in the group by the object name. More... | |
virtual const int | index (std::shared_ptr< ModelAPI_Object > theObject, const bool theAllowFolder=false)=0 |
Returns the object index in the group. More... | |
virtual int | size (const std::string &theGroupID, const bool theAllowFolder=false)=0 |
Returns the number of objects in the group of objects. More... | |
virtual std::shared_ptr< ModelAPI_Object > | parent (const std::shared_ptr< ModelAPI_Object > theChild)=0 |
Returns the parent object of this child. More... | |
virtual std::shared_ptr< ModelAPI_Feature > | currentFeature (const bool theVisible)=0 |
Returns the feature that is currently edited in this document, normally this is the latest created feature. More... | |
virtual void | setCurrentFeature (std::shared_ptr< ModelAPI_Feature > theCurrent, const bool theVisible)=0 |
Sets the current feature: all features below will be disabled, new features will be appended after this one. More... | |
virtual void | setCurrentFeatureUp ()=0 |
Makes the current feature one feature upper. More... | |
virtual int | numInternalFeatures ()=0 |
Returns the number of all features: in the history or not. More... | |
virtual std::shared_ptr< ModelAPI_Feature > | internalFeature (const int theIndex)=0 |
Returns the feature by zero-based index: features in the history or not. More... | |
virtual void | synchronizeTransactions ()=0 |
Performs synchronization of transactions with the module document: If some document is not active (by undo of activation) but in memory, on activation the transactions must be synchronized because all redo-s performed without this participation. More... | |
virtual | ~ModelAPI_Document () |
To virtually destroy the fields of successors. More... | |
virtual std::shared_ptr< ModelAPI_ResultConstruction > | createConstruction (const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Creates a construction result. More... | |
virtual std::shared_ptr< ModelAPI_ResultBody > | createBody (const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Creates a body result. More... | |
virtual std::shared_ptr< ModelAPI_ResultPart > | createPart (const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Creates a part result. More... | |
virtual std::shared_ptr< ModelAPI_ResultPart > | copyPart (const std::shared_ptr< ModelAPI_ResultPart > &theOrigin, const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Copies a part result, keeping the reference to the origin. More... | |
virtual std::shared_ptr< ModelAPI_ResultGroup > | createGroup (const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Creates a group result. More... | |
virtual std::shared_ptr< ModelAPI_ResultField > | createField (const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Creates a field result. More... | |
virtual std::shared_ptr< ModelAPI_ResultParameter > | createParameter (const std::shared_ptr< ModelAPI_Data > &theFeatureData, const int theIndex=0)=0 |
Creates a parameter result. More... | |
virtual std::shared_ptr< ModelAPI_Feature > | feature (const std::shared_ptr< ModelAPI_Result > &theResult)=0 |
Returns a feature by result (owner of result) More... | |
virtual std::list< std::shared_ptr< ModelAPI_Feature > > | allFeatures ()=0 |
Returns all features of the document including the hidden features which are not in history. More... | |
virtual std::list< std::shared_ptr< ModelAPI_Object > > | allObjects ()=0 |
Returns all objects of the document including the hidden features which are not in history. More... | |
virtual std::shared_ptr< ModelAPI_Folder > | addFolder (std::shared_ptr< ModelAPI_Feature > theAddBefore=std::shared_ptr< ModelAPI_Feature >())=0 |
Creates a folder (group of the features in the object browser) More... | |
virtual void | removeFolder (std::shared_ptr< ModelAPI_Folder > theFolder)=0 |
Removes the folder from the document (all features in the folder will be kept). More... | |
virtual std::shared_ptr< ModelAPI_Folder > | findFolderAbove (const std::list< std::shared_ptr< ModelAPI_Feature > > &theFeatures)=0 |
Search a folder above the list of features applicable to store them (it means the list of features stored in the folder should be consequential) More... | |
virtual std::shared_ptr< ModelAPI_Folder > | findFolderBelow (const std::list< std::shared_ptr< ModelAPI_Feature > > &theFeatures)=0 |
Search a folder below the list of features applicable to store them (it means the list of features stored in the folder should be consequential) More... | |
virtual std::shared_ptr< ModelAPI_Folder > | findContainingFolder (const std::shared_ptr< ModelAPI_Feature > &theFeature, int &theIndexInFolder)=0 |
Search a folder containing the given feature. More... | |
virtual bool | moveToFolder (const std::list< std::shared_ptr< ModelAPI_Feature > > &theFeatures, const std::shared_ptr< ModelAPI_Folder > &theFolder)=0 |
Add a list of features to the folder. More... | |
virtual bool | removeFromFolder (const std::list< std::shared_ptr< ModelAPI_Feature > > &theFeatures, const bool theBefore=true)=0 |
Remove features from the folder. More... | |
virtual void | setActive (const bool theFlag)=0 |
Informs the document that it becomes active and some actions must be performed. More... | |
virtual bool | isActive () const =0 |
Returns true if this document is currently active. More... | |
virtual bool | isOpened ()=0 |
Returns true if document is opened and valid. More... | |
virtual std::shared_ptr< ModelAPI_Feature > | producedByFeature (std::shared_ptr< ModelAPI_Result > theResult, const std::shared_ptr< GeomAPI_Shape > &theShape)=0 |
Returns the feature that produced the given face of the given result. More... | |
virtual bool | isLater (std::shared_ptr< ModelAPI_Feature > theLater, std::shared_ptr< ModelAPI_Feature > theCurrent) const =0 |
Returns true if theLater is in history of features creation later than theCurrent. More... | |
virtual void | updateHistory (const std::string theGroup)=0 |
Internally makes document know that feature was removed or added in history after creation. More... | |
virtual void | storeNodesState (const std::list< bool > &theStates)=0 |
Stores in the document boolean flags: states of the nodes in the object browser. More... | |
virtual void | restoreNodesState (std::list< bool > &theStates) const =0 |
Returns the stored nodes states. More... | |
virtual void | eraseAllFeatures ()=0 |
Just removes all features without touching the document data (to be able undo) More... | |
virtual std::shared_ptr< ModelAPI_Feature > | nextFeature (std::shared_ptr< ModelAPI_Feature > theCurrent, const bool theReverse=false) const =0 |
Returns the next (from the history point of view) feature, any: invisible or disabled. More... | |
virtual bool | importPart (const char *theFileName, std::list< std::shared_ptr< ModelAPI_Feature > > &theImported, bool theCheckOnly=false)=0 |
Loads the OCAF document from the file into the current document. More... | |
virtual bool | save (const char *theFilename, const std::list< std::shared_ptr< ModelAPI_Feature > > &theExportFeatures) const =0 |
Export the list of features to the file. More... | |
virtual void | emptyFunction () const |
Empty function which is added for virtualiation of the interface. More... | |
Protected Member Functions | |
ModelAPI_Document () | |
Only for SWIG wrapping it is here. More... | |
virtual void | updateHistory (const std::shared_ptr< ModelAPI_Object > theObject)=0 |
Internally makes document know that feature was removed or added in history after creation. More... | |
Friends | |
class | ModelAPI_Object |
class | ModelAPI_Result |
Document for internal data structure of any object storage.
Document contains all data that must be stored/retrieved in the file. Also it provides access to this data: open/save, transactions management etc.
|
virtual |
To virtually destroy the fields of successors.
|
protected |
Only for SWIG wrapping it is here.
|
pure virtual |
Returns the kind of the document: "PartSet", "Part", or something else.
This kind is used for feature buttons enable/disable depending on active document (it uses workbench "document" identifier in XML configuration file for this)
Implemented in Model_Document.
|
pure virtual |
Removes document data.
theForever | if it is false, document is just hidden (to keep possibility make it back on Undo/Redo) |
Implemented in Model_Document.
|
pure virtual |
Adds to the document the new feature of the given feature id.
theID | creates feature and puts it in the document (if it is not action) |
theMakeCurrent | to make current this new feature in this document |
Implemented in Model_Document.
|
pure virtual |
Return a list of features, which refers to the feature.
theFeature | a feature |
theRefs | a list of features |
isSendError | a flag whether the error message should be send |
Implemented in Model_Document.
|
pure virtual |
Removes the feature from the document.
theFeature | a feature to be removed |
Implemented in Model_Document.
|
pure virtual |
Moves the feature to make it after the given one in the history.
Implemented in Model_Document.
|
pure virtual |
! Returns the id of the document
Implemented in Model_Document.
|
pure virtual |
Returns the object in the group by the index (started from zero)
theGroupID | group that contains an object |
theIndex | zero-based index of feature in the group |
theAllowFolder | take into account grouping feature by folders |
Implemented in Model_Document.
|
pure virtual |
Returns the first found object in the group by the object name.
theGroupID | group that contains an object |
theName | name of the object to search |
Implemented in Model_Document.
|
pure virtual |
Returns the object index in the group.
Object must be visible. Otherwise returns -1.
theObject | object of this document |
theAllowFolder | take into account grouping feature by folders |
Implemented in Model_Document.
|
pure virtual |
Returns the number of objects in the group of objects.
theGroupID | group of objects |
theAllowFolder | take into account grouping feature by folders |
Implemented in Model_Document.
|
pure virtual |
Returns the parent object of this child.
This may be result or feature, parent of a top result. Fast method, that uses internal data structure specifics.
Implemented in Model_Document.
|
pure virtual |
Returns the feature that is currently edited in this document, normally this is the latest created feature.
theVisible | use visible features only: flag is true for Object Browser functionality |
Implemented in Model_Document.
|
pure virtual |
Sets the current feature: all features below will be disabled, new features will be appended after this one.
This method does not flushes the events appeared: it will be done by the finishOperation, or direct flushes
theCurrent | the selected feature as current: blow it everything become disabled |
theVisible | use visible features only: flag is true for Object Browser functionality |
Implemented in Model_Document.
|
pure virtual |
Makes the current feature one feature upper.
Implemented in Model_Document.
|
pure virtual |
Returns the number of all features: in the history or not.
Implemented in Model_Document.
|
pure virtual |
Returns the feature by zero-based index: features in the history or not.
Implemented in Model_Document.
|
pure virtual |
Performs synchronization of transactions with the module document: If some document is not active (by undo of activation) but in memory, on activation the transactions must be synchronized because all redo-s performed without this participation.
Implemented in Model_Document.
|
pure virtual |
Creates a construction result.
Implemented in Model_Document.
|
pure virtual |
Creates a body result.
Implemented in Model_Document.
|
pure virtual |
Creates a part result.
Implemented in Model_Document.
|
pure virtual |
Copies a part result, keeping the reference to the origin.
Implemented in Model_Document.
|
pure virtual |
Creates a group result.
Implemented in Model_Document.
|
pure virtual |
Creates a field result.
Implemented in Model_Document.
|
pure virtual |
Creates a parameter result.
Implemented in Model_Document.
|
pure virtual |
Returns a feature by result (owner of result)
Implemented in Model_Document.
|
pure virtual |
Returns all features of the document including the hidden features which are not in history.
Not very fast method, for calling once, not in big cycles.
Implemented in Model_Document.
|
pure virtual |
Returns all objects of the document including the hidden features which are not in history.
Not very fast method, for calling once, not in big cycles.
Implemented in Model_Document.
|
pure virtual |
Creates a folder (group of the features in the object browser)
theAddBefore | a feature, the folder is added before (if empty, the folder is added after the last feature) |
Implemented in Model_Document.
|
pure virtual |
Removes the folder from the document (all features in the folder will be kept).
Implemented in Model_Document.
|
pure virtual |
Search a folder above the list of features applicable to store them (it means the list of features stored in the folder should be consequential)
Implemented in Model_Document.
|
pure virtual |
Search a folder below the list of features applicable to store them (it means the list of features stored in the folder should be consequential)
Implemented in Model_Document.
|
pure virtual |
Search a folder containing the given feature.
Additionally calculates a zero-based index of the feature in this folder.
theFeature | feature to search |
theIndexInFolder | zero-based index in the folder or -1 if the feature is top-level. |
Implemented in Model_Document.
|
pure virtual |
Add a list of features to the folder.
The correctness of the adding is not performed (such checks have been done in corresponding find.. method).
true
if the movement is successful Implemented in Model_Document.
|
pure virtual |
Remove features from the folder.
theFeatures | list of features to be removed |
theBefore | extract features before the folder (this parameter is applicable only when all features in the folder are taking out, in other cases the direction is taken automatically) |
true
if the features have been moved out Implemented in Model_Document.
|
pure virtual |
Informs the document that it becomes active and some actions must be performed.
Implemented in Model_Document.
|
pure virtual |
Returns true if this document is currently active.
Implemented in Model_Document.
|
pure virtual |
Returns true if document is opened and valid.
Implemented in Model_Document.
|
pure virtual |
Returns the feature that produced the given face of the given result.
Implemented in Model_Document.
|
pure virtual |
Returns true if theLater is in history of features creation later than theCurrent.
Implemented in Model_Document.
|
pure virtual |
Internally makes document know that feature was removed or added in history after creation.
Implemented in Model_Document.
|
pure virtual |
Stores in the document boolean flags: states of the nodes in the object browser.
Normally is called outside of the transaction, just before "save".
Implemented in Model_Document.
|
pure virtual |
Returns the stored nodes states.
Normally it is calls just after "open". Appends the values to theStates list.
Implemented in Model_Document.
|
pure virtual |
Just removes all features without touching the document data (to be able undo)
Implemented in Model_Document.
|
pure virtual |
Returns the next (from the history point of view) feature, any: invisible or disabled.
theCurrent | previous to the resulting feature |
theReverse | if it is true, iterates in reversed order (next becomes previous) |
Implemented in Model_Document.
|
pure virtual |
Loads the OCAF document from the file into the current document.
All the features are added after the active feature.
theFileName | name of the file to import |
theImported | list of features imported from the file |
theCheckOnly | verify the document does not contain unappropriate features (useful for import to PartSet), but do not import it |
Implemented in Model_Document.
|
pure virtual |
Export the list of features to the file.
theFilename | path to save the file |
theExportFeatures | list of features to export |
Implemented in Model_Document.
|
protectedpure virtual |
Internally makes document know that feature was removed or added in history after creation.
Implemented in Model_Document.
|
inlinevirtualinherited |
Empty function which is added for virtualiation of the interface.