|
SHAPER
9.15.0
|
Dump engine for the model. More...
Data Structures | |
| class | DumpStorage |
| Storage for the dumped data. More... | |
| class | DumpStorageBuffer |
| class | DumpStorageGeom |
| Process selection attributes to be dumped by geometric properties. More... | |
| class | DumpStorageWeak |
| Process selection attributes to be dumped by weak naming. More... | |
Public Types | |
| typedef std::shared_ptr< DumpStorage > | DumpStoragePtr |
Public Member Functions | |
| ModelHighAPI_Dumper () | |
| Default constructor. More... | |
| void | setIsMultiDump (const bool theValue) |
| Sets multifile flag value. More... | |
| virtual | ~ModelHighAPI_Dumper () |
| Destructor. More... | |
| void | addCustomStorage (const DumpStoragePtr &theStorage) |
| Add custom storage to collect corresponding dump. More... | |
| void | clearCustomStorage () |
| Clear custom storages list. More... | |
| bool | process (const std::shared_ptr< ModelAPI_Document > &theDoc, const std::string &theFileName) |
| Dump given document into the file. More... | |
| void | setDumpDir (const std::string &theDumpDir) |
| Keep path to the true dumping directory. More... | |
| std::string | getDumpDir () const |
| Return path to the true dumping directory. More... | |
| void | importModule (const std::string &theModuleName) |
| Add module to list of imported modules. More... | |
| const std::string & | name (const EntityPtr &theEntity, bool theSaveNotDumped=true, bool theUseEntityName=false, bool theSetIsDumped=false) |
| Returns name of specified entity. More... | |
| const std::string & | parentName (const FeaturePtr &theFeature) |
| Returns name of parent composite feature for specified entity. More... | |
| virtual void | dumpParameter (const FeaturePtr &theFeature)=0 |
| Dump parameter feature only. More... | |
| virtual void | dumpFeature (const FeaturePtr &theFeature, const bool theForce=false)=0 |
| Dump given feature. More... | |
| virtual void | dumpFolder (const FolderPtr &theFolder)=0 |
| Dump folder. More... | |
| void | postpone (const EntityPtr &theEntity) |
| Set feature postponed until all its dependencies are not dumped. More... | |
| void | doNotDumpFeature (const FeaturePtr &theFeature) |
| Set a feature that should not be dumped anyway. More... | |
| void | dumpSubFeatureNameAndColor (const std::string theSubFeatureGet, const FeaturePtr &theSubFeature) |
| Dump sub-feature name and color, without dumping feature creation. More... | |
| virtual std::string | attributeGetter (const FeaturePtr &theFeature, const std::string &theAttrName) const =0 |
| Return name of getter for corresponding attribute. More... | |
| virtual std::string | featureWrapper (const FeaturePtr &theFeature) const =0 |
| Return name of wrapper feature. More... | |
| ModelHighAPI_Dumper & | operator<< (const char theChar) |
| Dump character. More... | |
| ModelHighAPI_Dumper & | operator<< (const char *theString) |
| Dump string. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::string &theString) |
| Dump string. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::wstring &theString) |
| Dump wstring. More... | |
| ModelHighAPI_Dumper & | operator<< (const bool theValue) |
| Dump boolean. More... | |
| ModelHighAPI_Dumper & | operator<< (const int theValue) |
| Dump integer. More... | |
| ModelHighAPI_Dumper & | operator<< (const double theValue) |
| Dump real. More... | |
| void | newline () |
| Print std::endl from Python. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< GeomAPI_Pnt > &thePoint) |
| Dump GeomAPI_Pnt in the following form: "GeomAPI_Pnt(X, Y, Z)". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< GeomAPI_Dir > &theDir) |
| Dump GeomAPI_Dir "GeomAPI_Dir(X, Y, Z)". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< GeomDataAPI_Dir > &theDir) |
| Dump GeomDataAPI_Dir in the following form: "X, Y, Z". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< GeomDataAPI_Point > &thePoint) |
| Dump GeomDataAPI_Point in the following form: "X, Y, Z". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< GeomDataAPI_Point2D > &thePoint) |
| Dump GeomDataAPI_Point2D in the following form: "X, Y". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< GeomDataAPI_Point2DArray > &thePointArray) |
| Dump GeomDataAPI_Point2DArray as a list of 2D points. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeBoolean > &theAttrBool) |
| Dump AttributeBoolean. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeInteger > &theAttrInt) |
| Dump AttributeInteger. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeIntArray > &theArray) |
| Dump AttributeIntArray. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeDouble > &theAttrReal) |
| Dump AttributeDouble. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeDoubleArray > &theArray) |
| Dump AttributeDoubleArray. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeString > &theAttrStr) |
| Dump AttributeString. More... | |
| ModelHighAPI_Dumper & | operator<< (const FeaturePtr &theEntity) |
| Dump name of entity and remember to dump "setName" if the entity has user-defined name. More... | |
| ModelHighAPI_Dumper & | operator<< (const FolderPtr &theFolder) |
| Dump folder. More... | |
| ModelHighAPI_Dumper & | operator<< (const ResultPtr &theResult) |
| Dump result. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::list< ResultPtr > &theResults) |
| Dump a list of results. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_Attribute > &theAttr) |
| Dump Attribute. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_Object > &theObject) |
| Dump Object. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeRefAttr > &theRefAttr) |
| Dump AttributeRefAttr. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeRefAttrList > &theRefAttrList) |
| Dump AttributeRefAttrList as follows: "[obj1, obj2, obj3, ...]". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeRefList > &theRefList) |
| Dump AttributeRefList as follows: "[obj1, obj2, obj3, ...]". More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeSelection > &theAttrSelect) |
| Dump AttributeSelection. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeSelectionList > &theAttrSelList) |
| Dump AttributeSelectionList. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeReference > &theReference) |
| Dump AttributeReference. More... | |
| ModelHighAPI_Dumper & | operator<< (const std::shared_ptr< ModelAPI_AttributeStringArray > &theArray) |
| Dump AttributeStringArray. More... | |
| void | clearNotDumped () |
| clear list of not dumped entities More... | |
| bool | isDumped (const EntityPtr &theEntity) const |
| Check the entity is already dumped. More... | |
| bool | isDumped (const std::shared_ptr< ModelAPI_AttributeRefAttr > &theRefAttr) const |
| Check theRefAttr is already dumped. More... | |
| bool | isDumped (const std::shared_ptr< ModelAPI_AttributeRefList > &theRefList) const |
| Check all objects in theRefList are already dumped. More... | |
| size_t | indexOfFirstNotDumped (const std::shared_ptr< ModelAPI_AttributeRefList > &theRefList) const |
| Returns the index of the first object in the list which is not dumped yet. More... | |
| virtual void | exportVariables () const |
| Export variables names to another module (calls exportVariable implemented in python) More... | |
| virtual void | exportVariable (const std::string &, const std::string &) const |
| Export one variable name to another module (implemented in python) More... | |
| bool | dumpCommentBeforeFeature (const FeaturePtr &theFeature) const |
Returns true if the special comment line to improve the readability should be printed before the feature of the given kind. More... | |
Static Public Member Functions | |
| static void | setInstance (ModelHighAPI_Dumper *theDumper) |
| Sets instance of a dumper. More... | |
| static ModelHighAPI_Dumper * | getInstance () |
| Returns instance of a dumper. More... | |
Protected Member Functions | |
| void | dumpEntitySetName () |
| Dump "setName" command if last entity had user-defined name. More... | |
Protected Attributes | |
| std::set< EntityPtr > | myNotDumpedEntities |
| list of entities, used by other features but not dumped yet More... | |
Friends | |
| class | SketchAPI_Sketch |
| class | ModelHighAPI_Folder |
| ModelHighAPI_Dumper & | operator<< (ModelHighAPI_Dumper &theDumper, std::basic_ostream< char > &(*theEndl)(std::basic_ostream< char > &)) |
| Dump std::endl. More... | |
Dump engine for the model.
The dumper can be customized by the set of storages (DumpStorage), for example to identify dumped selected objects by their geometrical properties. By default, the dump is executed to store original names of the selected shapes.
| ModelHighAPI_Dumper::ModelHighAPI_Dumper | ( | ) |
Default constructor.
|
virtual |
Destructor.
|
static |
Sets instance of a dumper.
| void ModelHighAPI_Dumper::setIsMultiDump | ( | const bool | theValue | ) |
Sets multifile flag value.
|
static |
Returns instance of a dumper.
| void ModelHighAPI_Dumper::addCustomStorage | ( | const DumpStoragePtr & | theStorage | ) |
Add custom storage to collect corresponding dump.
| void ModelHighAPI_Dumper::clearCustomStorage | ( | ) |
Clear custom storages list.
| bool ModelHighAPI_Dumper::process | ( | const std::shared_ptr< ModelAPI_Document > & | theDoc, |
| const std::string & | theFileName | ||
| ) |
Dump given document into the file.
true, if succeed
|
inline |
Keep path to the true dumping directory.
It is used to store image files or any other external files
| theDumpDir | path to the true dumping directory |
|
inline |
Return path to the true dumping directory.
| void ModelHighAPI_Dumper::importModule | ( | const std::string & | theModuleName | ) |
Add module to list of imported modules.
| theModuleName | name of the module to be imported |
| const std::string & ModelHighAPI_Dumper::name | ( | const EntityPtr & | theEntity, |
| bool | theSaveNotDumped = true, |
||
| bool | theUseEntityName = false, |
||
| bool | theSetIsDumped = false |
||
| ) |
Returns name of specified entity.
| theEntity | [in] named entity |
| theSaveNotDumped | [in] if true, the entity should be stored as not dumped (will be dumped automatically) |
| theUseEntityName | [in] if true, the entity name should be used "as is" without changing default name |
| const std::string & ModelHighAPI_Dumper::parentName | ( | const FeaturePtr & | theFeature | ) |
Returns name of parent composite feature for specified entity.
|
pure virtual |
Dump parameter feature only.
|
pure virtual |
Dump given feature.
|
pure virtual |
Dump folder.
| void ModelHighAPI_Dumper::postpone | ( | const EntityPtr & | theEntity | ) |
Set feature postponed until all its dependencies are not dumped.
The name of the feature is stored anyway.
|
inline |
Set a feature that should not be dumped anyway.
| void ModelHighAPI_Dumper::dumpSubFeatureNameAndColor | ( | const std::string | theSubFeatureGet, |
| const FeaturePtr & | theSubFeature | ||
| ) |
Dump sub-feature name and color, without dumping feature creation.
Used for features which creates sub-features in their execute method.
| theSubFeatureGet | [in] method for getting sub-feature (e.g. "Feature_1.subFeature(0)") |
| theSubFeature | [in] sub-feature |
|
pure virtual |
Return name of getter for corresponding attribute.
|
pure virtual |
Return name of wrapper feature.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const char | theChar | ) |
Dump character.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const char * | theString | ) |
Dump string.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::string & | theString | ) |
Dump string.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::wstring & | theString | ) |
Dump wstring.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const bool | theValue | ) |
Dump boolean.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const int | theValue | ) |
Dump integer.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const double | theValue | ) |
Dump real.
| void ModelHighAPI_Dumper::newline | ( | ) |
Print std::endl from Python.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< GeomAPI_Pnt > & | thePoint | ) |
Dump GeomAPI_Pnt in the following form: "GeomAPI_Pnt(X, Y, Z)".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< GeomAPI_Dir > & | theDir | ) |
Dump GeomAPI_Dir "GeomAPI_Dir(X, Y, Z)".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< GeomDataAPI_Dir > & | theDir | ) |
Dump GeomDataAPI_Dir in the following form: "X, Y, Z".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< GeomDataAPI_Point > & | thePoint | ) |
Dump GeomDataAPI_Point in the following form: "X, Y, Z".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< GeomDataAPI_Point2D > & | thePoint | ) |
Dump GeomDataAPI_Point2D in the following form: "X, Y".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< GeomDataAPI_Point2DArray > & | thePointArray | ) |
Dump GeomDataAPI_Point2DArray as a list of 2D points.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeBoolean > & | theAttrBool | ) |
Dump AttributeBoolean.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeInteger > & | theAttrInt | ) |
Dump AttributeInteger.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeIntArray > & | theArray | ) |
Dump AttributeIntArray.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeDouble > & | theAttrReal | ) |
Dump AttributeDouble.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeDoubleArray > & | theArray | ) |
Dump AttributeDoubleArray.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeString > & | theAttrStr | ) |
Dump AttributeString.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const FeaturePtr & | theEntity | ) |
Dump name of entity and remember to dump "setName" if the entity has user-defined name.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const FolderPtr & | theFolder | ) |
Dump folder.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const ResultPtr & | theResult | ) |
Dump result.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::list< ResultPtr > & | theResults | ) |
Dump a list of results.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_Attribute > & | theAttr | ) |
Dump Attribute.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_Object > & | theObject | ) |
Dump Object.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeRefAttr > & | theRefAttr | ) |
Dump AttributeRefAttr.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeRefAttrList > & | theRefAttrList | ) |
Dump AttributeRefAttrList as follows: "[obj1, obj2, obj3, ...]".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeRefList > & | theRefList | ) |
Dump AttributeRefList as follows: "[obj1, obj2, obj3, ...]".
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeSelection > & | theAttrSelect | ) |
Dump AttributeSelection.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeSelectionList > & | theAttrSelList | ) |
Dump AttributeSelectionList.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeReference > & | theReference | ) |
Dump AttributeReference.
| ModelHighAPI_Dumper & ModelHighAPI_Dumper::operator<< | ( | const std::shared_ptr< ModelAPI_AttributeStringArray > & | theArray | ) |
Dump AttributeStringArray.
| void ModelHighAPI_Dumper::clearNotDumped | ( | ) |
clear list of not dumped entities
| bool ModelHighAPI_Dumper::isDumped | ( | const EntityPtr & | theEntity | ) | const |
Check the entity is already dumped.
| bool ModelHighAPI_Dumper::isDumped | ( | const std::shared_ptr< ModelAPI_AttributeRefAttr > & | theRefAttr | ) | const |
Check theRefAttr is already dumped.
| bool ModelHighAPI_Dumper::isDumped | ( | const std::shared_ptr< ModelAPI_AttributeRefList > & | theRefList | ) | const |
Check all objects in theRefList are already dumped.
| size_t ModelHighAPI_Dumper::indexOfFirstNotDumped | ( | const std::shared_ptr< ModelAPI_AttributeRefList > & | theRefList | ) | const |
Returns the index of the first object in the list which is not dumped yet.
|
virtual |
Export variables names to another module (calls exportVariable implemented in python)
|
inlinevirtual |
Export one variable name to another module (implemented in python)
| bool ModelHighAPI_Dumper::dumpCommentBeforeFeature | ( | const FeaturePtr & | theFeature | ) | const |
Returns true if the special comment line to improve the readability should be printed before the feature of the given kind.
|
protected |
Dump "setName" command if last entity had user-defined name.
|
friend |
Dump std::endl.
|
protected |
list of entities, used by other features but not dumped yet