Theory and modelling of semiconductor, dielectric, and metallic nanostructures