Unified Energy-based Qualitative Representation for Building Analysis