Semialgebraic Groups And Generalized Affine Buildings