Recent observations of molecular clouds show that dense filaments are the sites of present-day star formation. Thus, it is necessary to understand the filament formation process because these filaments provide the initial condition for star formation. Theoretical research suggests that shock waves in molecular clouds trigger filament formation. Since several different mechanisms have been proposed for filament formation, the formation mechanism of the observed star-forming filaments requires clarification. In the present study, we perform a series of isothermal magnetohydrodynamics simulations of filament formation. We focus on the influences of shock velocity and turbulence on the formation mechanism and identified three different mechanisms for the filament formation. The results indicate that when the shock is fast, at shock velocity v_sh = 7 km/s, the gas flows driven by the curved shock wave create filaments irrespective of the presence of turbulence and self-gravity. However, at a slow shock velocity v_sh = 2.5 km/s, the compressive flow component involved in the initial turbulence induces filament formation. When both the shock velocities and turbulence are low, the self-gravity in the shock-compressed sheet becomes important for filament formation. Moreover, we analyzed the line-mass distribution of the filaments and showed that strong shock waves can naturally create high-line-mass filaments such as those observed in the massive star-forming regions in a short time. We conclude that the dominant filament formation mode changes with the velocity of the shock wave triggering the filament formation.