BRUSSELS — As President Trump prepared to leave the NATO summit meeting in his disgruntled wake, the story of his visit could be told in the tight smiles, stiff handshakes and averted gazes he exchanged with the people who are supposed to be some of his closest European allies.

With few leaders willing to publicly push back against Mr. Trump’s aggressive haggling over military spending, observers were left to study his body language, as well as that of his allies and aides. At times, attempts to decipher the mood of the president and other heads of state felt akin to studying a very sophisticated and multilingual high school cafeteria.

For starters, there appeared to be cliques, with a grimacing Mr. Trump often on the outs. As leaders prepared for a so-called (and perhaps dysfunctional) family photo, Mr. Trump’s contemporaries walked ahead and chatted together while the president hung back with Recep Tayyip Erdogan, the Turkish president.