Szemeredi--Trotter theorems in dimension 3