class GeomDataAPI_Point;
class GeomDataAPI_Point2D;
+class ModelAPI_Attribute;
class ModelAPI_AttributeBoolean;
class ModelAPI_AttributeDouble;
class ModelAPI_AttributeInteger;
class ModelAPI_AttributeRefAttr;
+class ModelAPI_AttributeRefAttrList;
+class ModelAPI_AttributeReference;
+class ModelAPI_AttributeRefList;
class ModelAPI_AttributeSelection;
class ModelAPI_AttributeSelectionList;
class ModelAPI_AttributeString;
class ModelAPI_Document;
class ModelAPI_Entity;
class ModelAPI_Feature;
+class ModelAPI_Object;
+class ModelAPI_Result;
-typedef std::shared_ptr<ModelAPI_Entity> EntityPtr;
-typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
+typedef std::shared_ptr<ModelAPI_Document> DocumentPtr;
+typedef std::shared_ptr<ModelAPI_Entity> EntityPtr;
+typedef std::shared_ptr<ModelAPI_Feature> FeaturePtr;
+typedef std::shared_ptr<ModelAPI_Result> ResultPtr;
/**\class ModelHighAPI_Dumper
* \ingroup CPPHighAPI
/// Dump string
MODELHIGHAPI_EXPORT
ModelHighAPI_Dumper& operator<<(const std::string& theString);
+ /// Dump boolean
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const bool theValue);
/// Dump integer
MODELHIGHAPI_EXPORT
ModelHighAPI_Dumper& operator<<(const int theValue);
ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeString>& theAttrStr);
/// Dump name of entity and remember to dump "setName" if the entity has user-defined name
MODELHIGHAPI_EXPORT
- ModelHighAPI_Dumper& operator<<(const EntityPtr& theEntity);
+ ModelHighAPI_Dumper& operator<<(const FeaturePtr& theEntity);
+
+ /// Dump result
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const ResultPtr& theResult);
+
+ /// Dump Attribute
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_Attribute>& theAttr);
+ /// Dump Object
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_Object>& theObject);
/// Dump AttributeRefAttr
MODELHIGHAPI_EXPORT
ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeRefAttr>& theRefAttr);
+ /// Dump AttributeRefAttrList as follows:
+ /// "[obj1, obj2, obj3, ...]"
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeRefAttrList>& theRefAttrList);
+ /// Dump AttributeRefList as follows:
+ /// "[obj1, obj2, obj3, ...]"
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeRefList>& theRefList);
/// Dump AttributeSelection
MODELHIGHAPI_EXPORT
ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeSelection>& theAttrSelect);
/// Dump AttributeSelectionList
MODELHIGHAPI_EXPORT
ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeSelectionList>& theAttrSelList);
+ /// Dump AttributeReference
+ MODELHIGHAPI_EXPORT
+ ModelHighAPI_Dumper& operator<<(const std::shared_ptr<ModelAPI_AttributeReference>& theReference);
/// Clear dump buffer
MODELHIGHAPI_EXPORT
/// Iterate all features in document and dump them into intermediate buffer
bool process(const std::shared_ptr<ModelAPI_Document>& theDoc);
+ /// Dump composite feature and all it sub-features
+ bool process(const std::shared_ptr<ModelAPI_CompositeFeature>& theComposite, bool isForce = false);
+
/// Iterate all features in composite feature and dump them into intermediate buffer
- bool process(const std::shared_ptr<ModelAPI_CompositeFeature>& theComposite);
+ /// \param theComposite [in] parent composite feature
+ /// \param theDumpModelDo [in] shows that command "model.do()" should be written at the end
+ MODELHIGHAPI_EXPORT
+ bool processSubs(const std::shared_ptr<ModelAPI_CompositeFeature>& theComposite, bool theDumpModelDo = false);
/// Check the entity is already dumped
bool isDumped(const EntityPtr& theEntity) const;
private:
typedef std::map<EntityPtr, std::pair<std::string, bool> > EntityNameMap;
typedef std::map<std::string, std::set<std::string> > ModulesMap;
+ typedef std::map<DocumentPtr, std::map<std::string, int> > NbFeaturesMap;
static ModelHighAPI_Dumper* mySelf;
EntityNameMap myNames; ///< names of the entities
EntityPtr myLastEntityWithName; ///< not null, if last dumped entity had user defined name
+ NbFeaturesMap myFeatureCount; ///< number of features of each kind
+
protected:
std::set<EntityPtr> myNotDumpedEntities; ///< list of entities, used by other features but not dumped yet
+
+ friend class SketchAPI_Sketch;
};
#endif