+
+
+// ================= Auxiliary functions ==============================
+AttrType typeOfAttribute(boost::shared_ptr<ModelAPI_Attribute> theAttribute)
+{
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttrRef =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+ if (!anAttrRef) return UNKNOWN;
+
+ if (anAttrRef->isObject())
+ {
+ ResultConstructionPtr aRC =
+ boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(anAttrRef->object());
+ if (!aRC) return UNKNOWN;
+
+ if (aRC->shape()->isVertex())
+ return POINT3D;
+ else if (aRC->shape()->isEdge())
+ {
+ boost::shared_ptr<GeomAPI_Edge> anEdge =
+ boost::dynamic_pointer_cast<GeomAPI_Edge>(aRC->shape());
+ if (anEdge->isLine())
+ return LINE;
+ else if (anEdge->isCircle())
+ return CIRCLE;
+ else if (anEdge->isArc())
+ return ARC;
+ }
+ }
+ else
+ {
+ const std::string aType = anAttrRef->attr()->attributeType();
+ if (aType == GeomDataAPI_Point2D::type())
+ return POINT2D;
+ if (aType == GeomDataAPI_Point2D::type())
+ return POINT2D;
+ }
+
+ return UNKNOWN;
+}
+