  We present a novel $C^0$-characterization of symplectic embeddings and
diffeomorphisms in terms of Lagrangian embeddings. Our approach is based on the
shape invariant, which was discovered by J.-C. Sikorav and Y. Eliashberg,
intersection theory and the displacement energy of Lagrangian submanifolds, and
the fact that non-Lagrangian submanifolds can be displaced immediately. This
characterization gives rise to a new proof of $C^0$-rigidity of symplectic
embeddings and diffeomorphisms. The various manifestations of Lagrangian
rigidity that are used in our arguments come from $J$-holomorphic curve
methods. An advantage of our techniques is that they can be adapted to a
$C^0$-characterization of contact embeddings and diffeomorphisms in terms of
coisotropic (or pre-Lagrangian) embeddings, which in turn leads to a proof of
$C^0$-rigidity of contact embeddings and diffeomorphisms. We give a detailed
treatment of the shape invariants of symplectic and contact manifolds, and
demonstrate that shape is often a natural language in symplectic and contact
topology. We consider homeomorphisms that preserve shape, and propose a
hierarchy of notions of Lagrangian topological submanifold. Moreover, we
discuss shape related necessary and sufficient conditions for symplectic and
contact embeddings, and define a symplectic capacity from the shape.
