   3d editor, 4 view design
  I am working on an editing program where I want to have the four views: perspective, top, front, side.  I am wondering if I should create 4 view classes, or just use one view and switch between 4 different cameras.  Also, the tools behave differently in each view, so how should that be handled?  For example, in a side view, translation should be restricted to the xy plane.  Should I create a specialized xy translation tool, or just make the 3D translation tool flexible so that I can set a flag that restricts its degrees of freedom?I'm just trying to get some advice from someone who has done this before...Thanks.   
  One class. Otherwise you'll have 4 classes with very few differences, and you'll just end up with 4x the code. Similarly for the tools, you want to have one translation tool and restrict it's axes. If each camera view knows it's direction, the translation tool can just act perpendicular to camera direction, then it doesn't need any specialisations.   ;Quote:Original post by QuatAlso, the tools behave differently in each view, so how should that be handled?  For example, in a side view, translation should be restricted to the xy plane.  Should I create a specialized xy translation tool, or just make the 3D translation tool flexible so that I can set a flag that restricts its degrees of freedom?The UI components, as Evil Steve suggests, should be four instances of the same generic object; specifically, they should receive mouse motions in screen space, modify their generic 3D display with general transformation matrices, and issue model modification commands using view-independent model space coordinates.The movement tools translate a 2D motion in the screen plane to a 3D motion in whatever plane is parallel to the screen in some particular view; there is no special case for "side views" and no need for flags, and the normal vector and scale of a particular view are not a constraint but an implicit user input.   