00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045
00046 #include <OSGConfig.h>
00047
00048 #include "OSGNodePtr.h"
00049 #include "OSGCameraDecorator.h"
00050
00051 OSG_USING_NAMESPACE
00052
00063
00064
00065 CameraDecorator::CameraDecorator(void) :
00066 Inherited()
00067 {
00068 }
00069
00070 CameraDecorator::CameraDecorator(const CameraDecorator &source) :
00071 Inherited(source)
00072 {
00073 }
00074
00075 CameraDecorator::~CameraDecorator(void)
00076 {
00077 }
00078
00079
00080
00081 void CameraDecorator::initMethod (void)
00082 {
00083 }
00084
00085 void CameraDecorator::changed(BitVector whichField, UInt32 origin)
00086 {
00087 Inherited::changed(whichField, origin);
00088 }
00089
00090 void CameraDecorator::dump( UInt32 ,
00091 const BitVector ) const
00092 {
00093 SLOG << "Dump CameraDecorator NI" << std::endl;
00094 }
00095
00096
00097
00098
00099
00100 void CameraDecorator::draw( DrawAction *action,
00101 const Viewport &port )
00102 {
00103 CameraPtr camera = getDecoratee();
00104 if(camera == NullFC)
00105 {
00106 FWARNING(("CameraDecorator::draw: no decoratee!\n"));
00107 return;
00108 }
00109 camera->draw(action, port);
00110 }
00111
00112 void CameraDecorator::getProjection(Matrix &result,
00113 UInt32 width ,
00114 UInt32 height)
00115 {
00116 CameraPtr camera = getDecoratee();
00117 if(camera == NullFC)
00118 {
00119 FWARNING(("CameraDecorator::getProjection: no decoratee!\n"));
00120 result.setIdentity();
00121 return;
00122 }
00123 camera->getProjection(result, width, height);
00124 }
00125
00126 void CameraDecorator::getProjectionTranslation(Matrix &result,
00127 UInt32 width ,
00128 UInt32 height)
00129 {
00130 CameraPtr camera = getDecoratee();
00131 if(camera == NullFC)
00132 {
00133 FWARNING(("CameraDecorator::getProjectionTranslation: no decoratee!\n"));
00134 result.setIdentity();
00135 return;
00136 }
00137 camera->getProjectionTranslation(result, width, height);
00138 }
00139
00140 void CameraDecorator::getViewing(Matrix &result,
00141 UInt32 width ,
00142 UInt32 height)
00143 {
00144 CameraPtr camera = getDecoratee();
00145 if(camera == NullFC)
00146 {
00147 FWARNING(("CameraDecorator::getViewing: no decoratee!\n"));
00148 result.setIdentity();
00149 return;
00150 }
00151 camera->getViewing(result, width, height);
00152 }
00153
00154
00155
00156
00157 #ifdef __sgi
00158 #pragma set woff 1174
00159 #endif
00160
00161 #ifdef OSG_LINUX_ICC
00162 #pragma warning( disable : 177 )
00163 #endif
00164
00165 namespace
00166 {
00167 static char cvsid_cpp[] = "@(#)$Id: $";
00168 static char cvsid_hpp[] = OSGCAMERADECORATOR_HEADER_CVSID;
00169 static char cvsid_inl[] = OSGCAMERADECORATOR_INLINE_CVSID;
00170 }