Single and whole group selection in tree table

We are using a tree table view in our product. We also have a multiple selection in this view for purpose of bulk updating or drag and drop. I would like the user to be able to single select the group only or to select the group with all of it sub items.

Actually I have 3 cases:

  1. Only group selected without its sub items
  2. Whole Group selected with all its sub items
  3. Only one or more sub items selected without the parent group

Do you have an idea how to perform this selection and how to visualize it?