From: sbh Date: Tue, 28 Oct 2014 16:43:54 +0000 (+0300) Subject: Helper methods, aliases for data()->method() X-Git-Tag: V_0.5~66^2~5^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=23bd046563358cc8654b0d084fb0f7135acc31f7;p=modules%2Fshaper.git Helper methods, aliases for data()->method() --- diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index fe65a751d..a3a117741 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index ccdd45e77..c6a669718 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/src/ModelAPI/ModelAPI_AttributeBoolean.h b/src/ModelAPI/ModelAPI_AttributeBoolean.h index dcd76efc7..cf431322b 100644 --- a/src/ModelAPI/ModelAPI_AttributeBoolean.h +++ b/src/ModelAPI/ModelAPI_AttributeBoolean.h @@ -45,4 +45,6 @@ class ModelAPI_AttributeBoolean : public ModelAPI_Attribute } }; +typedef boost::shared_ptr AttributeBooleanPtr; + #endif diff --git a/src/ModelAPI/ModelAPI_AttributeDocRef.h b/src/ModelAPI/ModelAPI_AttributeDocRef.h index 7ee1ff1ca..cf7cc84f3 100644 --- a/src/ModelAPI/ModelAPI_AttributeDocRef.h +++ b/src/ModelAPI/ModelAPI_AttributeDocRef.h @@ -46,4 +46,6 @@ class ModelAPI_AttributeDocRef : public ModelAPI_Attribute } }; +typedef boost::shared_ptr AttributeDocRefPtr; + #endif diff --git a/src/ModelAPI/ModelAPI_AttributeRefAttr.h b/src/ModelAPI/ModelAPI_AttributeRefAttr.h index dc862f3a6..a3bf80601 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefAttr.h +++ b/src/ModelAPI/ModelAPI_AttributeRefAttr.h @@ -56,4 +56,6 @@ class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute } }; +typedef boost::shared_ptr AttributeRefAttrPtr; + #endif diff --git a/src/ModelAPI/ModelAPI_AttributeRefList.h b/src/ModelAPI/ModelAPI_AttributeRefList.h index abb39beb6..d8edfe8d0 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefList.h +++ b/src/ModelAPI/ModelAPI_AttributeRefList.h @@ -51,4 +51,6 @@ class ModelAPI_AttributeRefList : public ModelAPI_Attribute } }; +typedef boost::shared_ptr AttributeRefListPtr; + #endif diff --git a/src/ModelAPI/ModelAPI_AttributeReference.h b/src/ModelAPI/ModelAPI_AttributeReference.h index 14d63ae32..5354e8af5 100644 --- a/src/ModelAPI/ModelAPI_AttributeReference.h +++ b/src/ModelAPI/ModelAPI_AttributeReference.h @@ -46,4 +46,6 @@ class ModelAPI_AttributeReference : public ModelAPI_Attribute } }; +typedef boost::shared_ptr AttributeReferencePtr; + #endif diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index b3dc06045..14a1e396f 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include const std::list >& ModelAPI_Feature::results() diff --git a/src/ModelAPI/ModelAPI_Feature.h b/src/ModelAPI/ModelAPI_Feature.h index a6c51d040..3dc6a3d5d 100644 --- a/src/ModelAPI/ModelAPI_Feature.h +++ b/src/ModelAPI/ModelAPI_Feature.h @@ -5,13 +5,27 @@ #ifndef ModelAPI_Feature_H_ #define ModelAPI_Feature_H_ -#include "ModelAPI_Object.h" -#include "ModelAPI_Session.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include #include +#include +#include + class ModelAPI_Data; class ModelAPI_Document; class ModelAPI_Result; @@ -36,6 +50,12 @@ class ModelAPI_Feature : public ModelAPI_Object return MY_GROUP; } + /// Returns document this feature belongs to + virtual boost::shared_ptr document() + { + return ModelAPI_Object::document(); + } + /// Returns the group identifier of this result virtual std::string groupName() { @@ -84,9 +104,73 @@ class ModelAPI_Feature : public ModelAPI_Object MODELAPI_EXPORT static boost::shared_ptr feature(ObjectPtr theObject); + // + // Helper methods, aliases for data()->method() + // ----------------------------------------------------------------------------------------------- + inline std::string name() + { + return data()->name(); + } + + inline boost::shared_ptr boolean(const std::string& theID) + { + return data()->boolean(theID); + } + + inline boost::shared_ptr document(const std::string& theID) + { + return data()->document(theID); + } + + inline boost::shared_ptr real(const std::string& theID) + { + return data()->real(theID); + } + + inline boost::shared_ptr integer(const std::string& theID) + { + return data()->integer(theID); + } + + inline boost::shared_ptr refattr(const std::string& theID) + { + return data()->refattr(theID); + } + + inline boost::shared_ptr reference(const std::string& theID) + { + return data()->reference(theID); + } + + inline boost::shared_ptr reflist(const std::string& theID) + { + return data()->reflist(theID); + } + + inline boost::shared_ptr selection(const std::string& theID) + { + return data()->selection(theID); + } + + inline boost::shared_ptr selectionList(const std::string& theID) + { + return data()->selectionList(theID); + } + + inline boost::shared_ptr string(const std::string& theID) + { + return data()->string(theID); + } + + inline boost::shared_ptr attribute(const std::string& theID) + { + return data()->attribute(theID); + } + // ----------------------------------------------------------------------------------------------- }; //! Pointer on feature object typedef boost::shared_ptr FeaturePtr; #endif + diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index 36bc9f6f3..7236630ff 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index cbe7503a8..256a5b516 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/src/ModuleBase/ModuleBase_WidgetFeature.cpp b/src/ModuleBase/ModuleBase_WidgetFeature.cpp index fcc226b3e..faf664fe5 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeature.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeature.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index d2369702f..36191b141 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index b2f838d1a..58476af8a 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 892f610a0..1eb3f95f9 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp index a2f006fa4..8c6e8cc0a 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp @@ -8,6 +8,7 @@ #include #include #include +#include using namespace std; diff --git a/src/PartSetPlugin/PartSetPlugin_Remove.cpp b/src/PartSetPlugin/PartSetPlugin_Remove.cpp index 5494949d8..d459d9753 100644 --- a/src/PartSetPlugin/PartSetPlugin_Remove.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Remove.cpp @@ -8,6 +8,7 @@ #include #include #include +#include void PartSetPlugin_Remove::execute() { diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index ec9d227de..ae0b225ec 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/src/SketchPlugin/SketchPlugin_Circle.cpp b/src/SketchPlugin/SketchPlugin_Circle.cpp index 4828a0f7b..e4d9d8e94 100644 --- a/src/SketchPlugin/SketchPlugin_Circle.cpp +++ b/src/SketchPlugin/SketchPlugin_Circle.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include @@ -15,7 +17,6 @@ #include #include #include -#include SketchPlugin_Circle::SketchPlugin_Circle() : SketchPlugin_Feature() diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 72a20f861..ccefb4bec 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include diff --git a/src/SketchPlugin/SketchPlugin_Point.cpp b/src/SketchPlugin/SketchPlugin_Point.cpp index c198e9b90..1ad78684f 100644 --- a/src/SketchPlugin/SketchPlugin_Point.cpp +++ b/src/SketchPlugin/SketchPlugin_Point.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 555f0abfe..b71d5adbd 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature, diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 84bf0d7be..a96189889 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include