+//=============================================================================
+/*!
+ * GetShapesOnCylinderWithLocation
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetShapesOnCylinderWithLocation
+ (const Handle(GEOM_Object)& theShape,
+ const Standard_Integer theShapeType,
+ const Handle(GEOM_Object)& theAxis,
+ const Handle(GEOM_Object)& thePnt,
+ const Standard_Real theRadius,
+ const GEOMAlgo_State theState)
+{
+ SetErrorCode(KO);
+
+ if (theShape.IsNull() || theAxis.IsNull() || thePnt.IsNull()) return NULL;
+
+ TopoDS_Shape aShape = theShape->GetValue();
+ TopoDS_Shape anAxis = theAxis->GetValue();
+ TopoDS_Shape aPnt = thePnt->GetValue();
+
+ if (aShape.IsNull() || anAxis.IsNull() || aPnt.IsNull()) return NULL;
+
+ if (aPnt.ShapeType() != TopAbs_VERTEX )
+ {
+ SetErrorCode("Bottom location point must be vertex");
+ return NULL;
+ }
+
+ TopAbs_ShapeEnum aShapeType = TopAbs_ShapeEnum(theShapeType);
+ if ( !checkTypeShapesOn( aShapeType ))
+ return NULL;
+
+ // Create a cylinder surface
+ Handle(Geom_Surface) aCylinder = makeCylinder( anAxis, theRadius );
+ if ( aCylinder.IsNull() )
+ return NULL;
+
+ // translate the surface
+ Handle(Geom_CylindricalSurface) aCylSurface =
+ Handle(Geom_CylindricalSurface)::DownCast( aCylinder );
+ if ( aCylSurface.IsNull() )
+ {
+ SetErrorCode("Unexpected surface type instead of Geom_CylindricalSurface");
+ return NULL;
+ }
+ gp_Pnt fromLoc = aCylSurface->Cylinder().Location();
+ gp_Pnt toLoc = BRep_Tool::Pnt( TopoDS::Vertex( aPnt ));
+ aCylinder->Translate( fromLoc, toLoc );
+
+ // Find objects
+ TCollection_AsciiString anAsciiList;
+ Handle(TColStd_HSequenceOfTransient) aSeq;
+ aSeq = getShapesOnSurface( aCylinder, theShape, aShapeType, theState, anAsciiList );
+ if ( aSeq.IsNull() || aSeq->Length() == 0 )
+ return NULL;
+
+ // Make a Python command
+
+ Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast( aSeq->Value( 1 ));
+ Handle(GEOM_Function) aFunction = anObj->GetLastFunction();
+
+ GEOM::TPythonDump(aFunction)
+ << "[" << anAsciiList.ToCString()
+ << "] = geompy.GetShapesOnCylinderWithLocation(" << theShape << ", " << aShapeType << ", "
+ << theAxis << ", " << thePnt << ", " << theRadius << ", " << theState << ")";
+
+ SetErrorCode(OK);
+ return aSeq;
+}
+