+
+//==================================================================================================
+bool ConstructionPlugin_Point::customisePresentation(ResultPtr theResult,
+ AISObjectPtr thePrs,
+ std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
+{
+ bool isCustomized = theDefaultPrs.get() != NULL &&
+ theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs);
+ //thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
+ return true;
+}
+
+//==================================================================================================
+std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByXYZ()
+{
+ return GeomAlgoAPI_PointBuilder::vertex(real(X())->value(),
+ real(Y())->value(),
+ real(Z())->value());
+}
+
+/*//==================================================================================================
+std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByDistanceOnEdge()
+{
+ // Get edge.
+ AttributeSelectionPtr anEdgeSelection = selection(EDGE());
+ GeomShapePtr aShape = anEdgeSelection->value();
+ if(!aShape.get()) {
+ aShape = anEdgeSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aShape));
+
+ // Get distance value and percent flag.
+ double aValue = real(DISTANCE_VALUE())->value();
+ bool anIsPercent = boolean(DISTANCE_PERCENT())->value();
+
+ // Get reverse flag.
+ bool anIsReverse = boolean(REVERSE())->value();
+
+ return GeomAlgoAPI_PointBuilder::vertexOnEdge(anEdge, aValue, anIsPercent, anIsReverse);
+}
+
+//==================================================================================================
+std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByProjection()
+{
+ // Get point.
+ AttributeSelectionPtr aPointSelection = selection(POINT());
+ GeomShapePtr aPointShape = aPointSelection->value();
+ if(!aPointShape.get()) {
+ aPointShape = aPointSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Vertex> aVertex(new GeomAPI_Vertex(aPointShape));
+
+ // Get plane.
+ AttributeSelectionPtr aPlaneSelection = selection(PLANE());
+ GeomShapePtr aPlaneShape = aPlaneSelection->value();
+ if(!aPlaneShape.get()) {
+ aPlaneShape = aPlaneSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aPlaneShape));
+
+ return GeomAlgoAPI_PointBuilder::vertexByProjection(aVertex, aFace);
+}
+
+//==================================================================================================
+std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByLinesIntersection()
+{
+ // Get first line.
+ AttributeSelectionPtr aFirstLineSelection= selection(FIRST_LINE());
+ GeomShapePtr aFirstLineShape = aFirstLineSelection->value();
+ if(!aFirstLineShape.get()) {
+ aFirstLineShape = aFirstLineSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Edge> aFirstEdge(new GeomAPI_Edge(aFirstLineShape));
+
+ // Get second line.
+ AttributeSelectionPtr aSecondLineSelection= selection(SECOND_LINE());
+ GeomShapePtr aSecondLineShape = aSecondLineSelection->value();
+ if(!aSecondLineShape.get()) {
+ aSecondLineShape = aSecondLineSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Edge> aSecondEdge(new GeomAPI_Edge(aSecondLineShape));
+
+ return GeomAlgoAPI_PointBuilder::vertexByIntersection(aFirstEdge, aSecondEdge);
+}
+*/
+
+//==================================================================================================
+std::list<std::shared_ptr<GeomAPI_Vertex> >
+ ConstructionPlugin_Point::createByLineAndPlaneIntersection()
+{
+ // Get line.
+ AttributeSelectionPtr aLineSelection = selection(INTERSECTION_LINE());
+ GeomShapePtr aLineShape = aLineSelection->value();
+ if(!aLineShape.get()) {
+ aLineShape = aLineSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aLineShape));
+
+ // Get plane.
+ AttributeSelectionPtr aPlaneSelection= selection(INTERSECTION_PLANE());
+ GeomShapePtr aPlaneShape = aPlaneSelection->value();
+ if(!aPlaneShape.get()) {
+ aPlaneShape = aPlaneSelection->context()->shape();
+ }
+ std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aPlaneShape));
+
+ if (!string(USE_OFFSET())->value().empty()) {
+ double anOffset = real(OFFSET())->value();
+ if (boolean(REVERSE_OFFSET())->value())
+ anOffset = -anOffset;
+ if (fabs(anOffset) > 1.e-9) { // move face
+ aFace->translate(aFace->getPlane()->direction(), anOffset);
+ }
+ }
+
+ return GeomAlgoAPI_ShapeTools::intersect(anEdge, aFace,
+ aPlaneSelection->context()->groupName() == ModelAPI_ResultConstruction::group());
+}