1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
46 #include "OSGConfig.h"
48 #include "OSGCameraDecorator.h"
52 /*! \class OSG::CameraDecorator
53 \ingroup GrpSystemWindowCameraDecorators
55 The base class for the camera decorator, see \ref
56 PageSystemWindowCameraDecorators for a description.
58 The decorated object is held in the _sfDecoratee field.
62 /*----------------------- constructors & destructors ----------------------*/
64 CameraDecorator::CameraDecorator(void) :
69 CameraDecorator::CameraDecorator(const CameraDecorator
&source
) :
74 CameraDecorator::~CameraDecorator(void)
78 /*----------------------------- class specific ----------------------------*/
80 void CameraDecorator::initMethod(InitPhase ePhase
)
82 Inherited::initMethod(ePhase
);
85 void CameraDecorator::changed(ConstFieldMaskArg whichField
,
89 Inherited::changed(whichField
, origin
, details
);
92 void CameraDecorator::dump( UInt32
,
93 const BitVector
) const
95 SLOG
<< "Dump CameraDecorator NI" << std::endl
;
99 /*---------------------- Decorated Functions ----------------------------*/
102 void CameraDecorator::getProjection(Matrix
&result
,
106 Camera
*camera
= getDecoratee();
110 FWARNING(("CameraDecorator::getProjection: no decoratee!\n"));
112 result
.setIdentity();
117 camera
->getProjection(result
, width
, height
);
120 void CameraDecorator::getProjectionTranslation(Matrix
&result
,
124 Camera
*camera
= getDecoratee();
128 FWARNING(("CameraDecorator::getProjectionTranslation: "
131 result
.setIdentity();
136 camera
->getProjectionTranslation(result
, width
, height
);
139 void CameraDecorator::getViewing(Matrix
&result
,
143 Camera
*camera
= getDecoratee();
147 FWARNING(("CameraDecorator::getViewing: no decoratee!\n"));
149 result
.setIdentity();
154 camera
->getViewing(result
, width
, height
);
157 Vec2u
CameraDecorator::tileGetFullSize(void) const
159 Camera
*pCam
= getDecoratee();
163 return pCam
->tileGetFullSize();
166 return Inherited::tileGetFullSize();
169 Vec4f
CameraDecorator::tileGetRegion(void) const
171 Camera
*pCam
= getDecoratee();
175 return pCam
->tileGetRegion();
178 return Inherited::tileGetRegion();