Example (2004 Chinese National Team) In $\triangle A B C$, the sides $B C$ and $A C$ are of fixed lengths $a$ and $b$, respectively, while the length of side $A B$ can vary. A square is constructed outward from $\triangle A B C$ with side $A B$. Let $O$ be the center of the constructed square, and let $M$ and $N$ be the midpoints of $B C$ and $A C$, respectively. Find the maximum value of $O M+O N$.

---

The translation preserves the original text's formatting and structure.
Solve: As shown in the figure, let the square be $A B D E$, then $O M=\frac{1}{2} C E, O N=\frac{1}{2} C D$.
Therefore, $O M+O N=\frac{1}{2}(C D+C E)$
Let $A B=c$, then $B D=A E=c, A D=B E=\sqrt{2} c$. Applying the generalized Ptolemy's theorem to quadrilateral $A C B D$ we get
$$
C D \cdot c \leqslant A C \cdot c+B C \cdot \sqrt{2} c
$$

Thus, $C D \leqslant A C+\sqrt{2} B C$
That is, $C D \leqslant b+\sqrt{2} a$
Similarly, applying the generalized Ptolemy's theorem to quadrilateral $A C B E$ we get
$$
C E \cdot c \leqslant B C \cdot c+A C \cdot \sqrt{2} c
$$

That is, $C E \leqslant a+\sqrt{2} b$
Therefore, $O M+O N=\frac{1}{2}(C D+C E) \leqslant \frac{\sqrt{2}+1}{2}(a+b)$
Furthermore, when $\angle A C B=135^{\circ}$, points $A, C, B, D, E$ are concyclic, and the equalities in (1) and (2) can both hold. Therefore,
$$
(O M+O N)_{\max }=\frac{\sqrt{2}+1}{2}(a+b)
$$