The Enumeration of Locally Restricted Graphs (I)