//--------------------------------------------------------------------------------------
#include "ConstructionAPI_Plane.h"
//--------------------------------------------------------------------------------------
-#include <ModelHighAPI_Double.h>
-#include <ModelHighAPI_Selection.h>
+#include <ModelHighAPI_Tools.h>
//--------------------------------------------------------------------------------------
ConstructionAPI_Plane::ConstructionAPI_Plane(
const std::shared_ptr<ModelAPI_Feature> & theFeature)
const ModelHighAPI_Selection & theFace,
const ModelHighAPI_Double & theDistance)
{
- theFace.fillAttribute(myface);
- theDistance.fillAttribute(mydistance);
+ fillAttribute(theFace, myface);
+ fillAttribute(theDistance, mydistance);
execute();
}
const ModelHighAPI_Double & theC,
const ModelHighAPI_Double & theD)
{
- theA.fillAttribute(myA);
- theB.fillAttribute(myB);
- theC.fillAttribute(myC);
- theD.fillAttribute(myD);
+ fillAttribute(theA, myA);
+ fillAttribute(theB, myB);
+ fillAttribute(theC, myC);
+ fillAttribute(theD, myD);
execute();
}
//--------------------------------------------------------------------------------------
#include "ConstructionAPI_Point.h"
//--------------------------------------------------------------------------------------
-#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_Feature.h>
-
-#include <ModelHighAPI_Double.h>
+#include <ModelHighAPI_Tools.h>
//--------------------------------------------------------------------------------------
ConstructionAPI_Point::ConstructionAPI_Point(
const std::shared_ptr<ModelAPI_Feature> & theFeature)
const ModelHighAPI_Double & theY,
const ModelHighAPI_Double & theZ)
{
- theX.fillAttribute(myx);
- theY.fillAttribute(myy);
- theZ.fillAttribute(myz);
+ fillAttribute(theX, myx);
+ fillAttribute(theY, myy);
+ fillAttribute(theZ, myz);
execute();
}
{
mutable std::shared_ptr<ModelAPI_AttributeDouble> myAttribute;
- fill_visitor(std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute)
+ fill_visitor(const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute)
: myAttribute(theAttribute) {}
void operator()(double theValue) const { myAttribute->setValue(theValue); }
};
void ModelHighAPI_Double::fillAttribute(
- std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const
+ const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const
{
boost::apply_visitor(fill_visitor(theAttribute), myValue);
}
/// Fill attribute values
MODELHIGHAPI_EXPORT
- virtual void fillAttribute(std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const;
+ virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute) const;
private:
boost::variant<double, std::string> myValue;
//--------------------------------------------------------------------------------------
#include "ModelHighAPI_Tools.h"
-
+//--------------------------------------------------------------------------------------
+#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeDocRef.h>
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeIntArray.h>
+#include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_AttributeRefAttr.h>
+#include <ModelAPI_AttributeRefAttrList.h>
+#include <ModelAPI_AttributeReference.h>
+#include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeString.h>
-
+//--------------------------------------------------------------------------------------
+#include "ModelHighAPI_Double.h"
#include "ModelHighAPI_Selection.h"
+//--------------------------------------------------------------------------------------
+void fillAttribute(const ModelHighAPI_Double & theValue,
+ const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute)
+{
+ theValue.fillAttribute(theAttribute);
+}
+
+//--------------------------------------------------------------------------------------
+void fillAttribute(const ModelHighAPI_Selection & theValue,
+ const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute)
+{
+ theValue.fillAttribute(theAttribute);
+}
+
//--------------------------------------------------------------------------------------
void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute)
#include <memory>
#include <string>
//--------------------------------------------------------------------------------------
+class ModelAPI_AttributeBoolean;
+class ModelAPI_AttributeDocRef;
+class ModelAPI_AttributeDouble;
+class ModelAPI_AttributeIntArray;
+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 ModelHighAPI_Double;
class ModelHighAPI_Selection;
//--------------------------------------------------------------------------------------
+MODELHIGHAPI_EXPORT
+void fillAttribute(const ModelHighAPI_Double & theValue,
+ const std::shared_ptr<ModelAPI_AttributeDouble> & theAttribute);
+
+MODELHIGHAPI_EXPORT
+void fillAttribute(const ModelHighAPI_Selection & theValue,
+ const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute);
+
MODELHIGHAPI_EXPORT
void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute);