Energy and quadratic invariants preserving integrators of Gaussian type