A model-independent Hamiltonian formulation of paraxial and diffracted ray-tracing equations is presented. It is applied to asymptotic Green's function computations. The medium can have an arbitrary number of interfaces, possibly intersecting at diffracting edges and vertices. Continuously varying model parameters and anisotropy are allowed. The algorithm for elastic waves, involving accuracy control and amplitude computation, is implemented in a platform-independent object-orientated C++ package. Numerical tests and modelling examples are presented.