(a) As of right. — If no hearing has begun to determine the compensation to be paid for a piece of property and the plaintiff has not acquired the title or any other interest in or taken possession thereof, the plaintiff may dismiss the action as to that property, without an order of the court, by filing a notice of dismissal setting forth a brief description of the property as to which the action is dismissed.
(b) By stipulation. — Before the entry of any judgment vesting the plaintiff with title or any other interest in or possession of property, the action may be voluntarily dismissed in whole or in part, without an order of the court, as to any property by filing a stipulation of voluntary dismissal by the plaintiff and the defendant affected thereby; and if the parties so stipulate, the court may vacate any judgment that has been entered.
(c) By order of the court. — At any time before compensation for a piece of property has been determined and paid, and after motion and hearing, the court may allow the plaintiff to dismiss the action under the terms and conditions it may deem pertinent as to that property, except that it shall not dismiss the action as to any part of the property of which the plaintiff has taken possession or in which the plaintiff has taken title or other interest, but shall award just compensation for the possession, title or other interest so taken. The court at any time may drop a defendant unnecessarily or improperly joined.
(d) Effect. — Except as otherwise provided in the notice, stipulation or order of the court, any voluntary dismissal is without prejudice.