Hi. My very wise family doctor warned me about the whiny threes and gave me some very good advice. I filed it away for future reference, thinking I wouldn't need it since my daugher is pretty good natured. We got through the terrible two's because I ignored her tantrums, which then lasted about 30 seconds. A month after she turned three she started yelling at me and speaking in a nasty fashion. It took me awhile to say the magic words my physician taught me, rather than trying to reason or yell at her. When I finally did, it really worked.
The magic words? "I can't hear you." She knows I can't "hear" her unless she speaks civilly to me. Maybe you can tell her teacher these "magic words" and see if it helps any. My doctor also taught me "when/then" which I haven't used too much since my daughter isn't really motivated by rewards ("when you clean up, then we can go to the park" is an example of how to use it).
Good luck. Could it be a personality clash between your daughter and her teacher? Your daughter is acting normally for a three year old (and it does come on suddenly). Maybe the teacher has some issues that is affecting her discipline in the classroom.
I just thought of something else. Could you ask the teacher if she notices a particular time your daughter is more likely to act up? It could be that she is hungry/tired/both. My daughter can be very cranky right before lunch if she didn't eat enough breakfast or missed her snack; as though her blood sugar has dropped. And if she declines her nap she can get unreasonable before bed (she goes to bed an hour earlier if she declines her nap). My mother would fuss that I was impossible if I was tired or hungry. Well, duh! Who isn't impossible if they are tired and hungry, at any age?