The shower rough-in valve allows fresh water from your homes water supply system to mix with hot water from your homes water heater. Your shower trim will allow you to manipulate the rough-in valve behind the wall. Each manufacturer has their own set of rough-in valves to service their various lines of shower trims.
The standard connection size for a rough-in valve inlet will be a 1/2″. Some manufacturers will offer an inlet size or compatibility for a 3/4″, primarily to compensate for low water pressure within the homes water supply system.
The rough-in valve should service two connection types, IPS, Iron Pipe Size, and CxC, Copper to Copper. For IPS connections to the homes water supply system, iron pipes are fitted to the valve. For CxC, copper pipes leading from the homes water supply system are sweated into the valve.
IPS to IPS
You can see below an example of an IPS to IPS installation of a rough-in valve.
Copper to Copper
Here you have a Copper to Copper installation of a rough-in valve.
Not all rough-in valves are pre-fabricated with service stops. Some offer plastic stops to be installed during the installation process strictly for testing purposes. Service stops are handy during emergencies or repairs, since the water supply into the valve is halted without effecting the water supply to the entire house.
A quick tutorial on shower valve stops.
The shower diverter valve allows the shower diverter trim to manually divert the water flow from the shower head to a secondary fixture, such as a hand shower. The shower diverter valve is located behind the wall and installed when the shower rough-in valve is installed, along with the connections to the water supply system leading into the shower. The diverter valve will not serve to turn the water supply on or off, it is only used for diverting water flow. It can be placed in line with the shower rough-in valve and shower head or offset, in this case the water line will need to be rerouted into and out of the shower diverter valve location.