Optical gain of CdS quantum dots embedded in 3D photonic crystals