Moved the ORTHO, PERSPECTIVE enums from the vcg namespace to the camera class namespace.

This commit is contained in:
Paolo Cignoni 2010-10-31 13:19:09 +00:00
parent a8a2e61f58
commit 343493ef11
2 changed files with 13 additions and 14 deletions

View File

@ -136,19 +136,18 @@ creation
namespace vcg{
enum {
PERSPECTIVE = 0,
ORTHO = 1,
ISOMETRIC = 2,
CAVALIERI = 3
};
template<class S>
class Camera
{
public:
typedef S ScalarType;
enum {
PERSPECTIVE = 0,
ORTHO = 1,
ISOMETRIC = 2,
CAVALIERI = 3
};
Camera():
FocalMm(0.f),

View File

@ -150,7 +150,7 @@ static void TransformGL(vcg::Camera<S> & camera, S nearDist, S farDist )
S sx,dx,bt,tp,nr;
camera.GetFrustum(sx,dx,bt,tp,nr);
if(camera.cameraType == vcg::PERSPECTIVE) {
if(camera.cameraType == CameraType::PERSPECTIVE) {
S ratio = nearDist/nr;
sx *= ratio;
dx *= ratio;
@ -162,10 +162,10 @@ static void TransformGL(vcg::Camera<S> & camera, S nearDist, S farDist )
switch(camera.cameraType)
{
case vcg::PERSPECTIVE: glFrustum(sx,dx,bt,tp,nearDist,farDist); break;
case vcg::ORTHO: glOrtho(sx,dx,bt,tp,nearDist,farDist); break;
case vcg::ISOMETRIC: SetGLIsometricProj(sx,dx,bt,tp,nearDist,farDist); break;
case vcg::CAVALIERI: SetGLCavalieriProj(sx,dx,bt,tp,nearDist,farDist); break;
case CameraType::PERSPECTIVE: glFrustum(sx,dx,bt,tp,nearDist,farDist); break;
case CameraType::ORTHO: glOrtho(sx,dx,bt,tp,nearDist,farDist); break;
case CameraType::ISOMETRIC: SetGLIsometricProj(sx,dx,bt,tp,nearDist,farDist); break;
case CameraType::CAVALIERI: SetGLCavalieriProj(sx,dx,bt,tp,nearDist,farDist); break;
}
assert(glGetError()==0);
@ -195,8 +195,8 @@ static void SetSubView(vcg::Camera<S> & camera,vcg::Point2<S> p0,S nearDist, S f
switch(camera.cameraType)
{
case vcg::PERSPECTIVE: glFrustum( width* p0[0]+ sx, width* p1[0]+ sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break;
case vcg::ORTHO: glOrtho(width* p0[0]+sx, width* p1[0]+sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break;
case CameraType::PERSPECTIVE: glFrustum( width* p0[0]+ sx, width* p1[0]+ sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break;
case CameraType::ORTHO: glOrtho(width* p0[0]+sx, width* p1[0]+sx, height* p0[1]+ bt, height* p1[1]+bt,nearDist,farDist); break;
//case vcg::ISOMETRIC: IsometricProj(dx-width* p1[0], dx-width* p0[0], tp-height* p1[1], tp-height* p0[1],nearDist,farDist); break;
//case vcg::CAVALIERI: CavalieriProj(dx-width* p1[0], dx-width* p0[0], tp-height* p1[1], tp-height* p0[1],nearDist,farDist); break;
}