Gravar-mail: Task-driven source–detector trajectories in cone-beam computed tomography: I. Theory and methods