Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RetinaOSGUtil.H

Go to the documentation of this file.
00001 /*!@file PointCloud/RetinaOSGUtil.H Open Scene Graph Utils */
00002 
00003 // //////////////////////////////////////////////////////////////////// //
00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2003   //
00005 // by the University of Southern California (USC) and the iLab at USC.  //
00006 // See http://iLab.usc.edu for information about this project.          //
00007 // //////////////////////////////////////////////////////////////////// //
00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected //
00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency //
00010 // in Visual Environments, and Applications'' by Christof Koch and      //
00011 // Laurent Itti, California Institute of Technology, 2001 (patent       //
00012 // pending; application number 09/912,225 filed July 23, 2001; see      //
00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status).     //
00014 // //////////////////////////////////////////////////////////////////// //
00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit.       //
00016 //                                                                      //
00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can   //
00018 // redistribute it and/or modify it under the terms of the GNU General  //
00019 // Public License as published by the Free Software Foundation; either  //
00020 // version 2 of the License, or (at your option) any later version.     //
00021 //                                                                      //
00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope  //
00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the   //
00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
00025 // PURPOSE.  See the GNU General Public License for more details.       //
00026 //                                                                      //
00027 // You should have received a copy of the GNU General Public License    //
00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write   //
00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,   //
00030 // Boston, MA 02111-1307 USA.                                           //
00031 // //////////////////////////////////////////////////////////////////// //
00032 //
00033 // Primary maintainer for this file: T. Nathan Mundhenk <mundhenk@usc.edu>
00034 // $HeadURL: svn://ilab.usc.edu/trunk/saliency/src/Neuro/Retina.H $
00035 // $Id: Retina.H 10217 2008-03-02 06:17:21Z mundhenk $
00036 //
00037 
00038 #ifndef RETINAOSGUTIL_H_DEFINED
00039 #define RETINAOSGUTIL_H_DEFINED
00040 
00041 
00042 #ifndef HAVE_OSG
00043 #ifndef SKIP_ALL_OSG
00044 #define SKIP_ALL_OSG
00045 #endif
00046 #endif
00047 
00048 #include "GUI/OSGText.H"
00049 #include "GUI/OSGUtil.H"
00050 #include "GUI/OSGViewUtil.H"
00051 #include "PointCloud/VirtualVoxel.H"
00052 #include <string>
00053 
00054 #ifndef SKIP_ALL_OSG
00055 #include <osg/Camera>
00056 #include <osg/CameraNode>
00057 
00058 #include <osgViewer/CompositeViewer>
00059 
00060 #include <osgUtil/Optimizer>
00061 #include <osgUtil/SceneView>
00062 #include <osgDB/ReadFile>
00063 
00064 #include "extra/URGENT/LabelGroundTruth/BaseComponent.h"
00065 #include "extra/URGENT/LabelGroundTruth/config.h"
00066 #include "extra/URGENT/LabelGroundTruth/RecolorPts.h"
00067 #include "extra/URGENT/LabelGroundTruth/RenderPts.h"
00068 #include "extra/URGENT/LabelGroundTruth/ronKeyboard.h"
00069 #include "extra/URGENT/LabelGroundTruth/ronTrackball.h"
00070 #include "extra/URGENT/LabelGroundTruth/SnapShot.h"
00071 #include "extra/URGENT/LabelGroundTruth/Terrain.h"
00072 
00073 
00074 //! Retina OSG related methods moved here to clean retina
00075 class RetinaOSGUtil : public OSGViewUtil
00076 {
00077 public:
00078   RetinaOSGUtil();
00079   ~RetinaOSGUtil();  
00080   
00081   //! Read in input from URGENT data format
00082   void readURGENTData(RenderPts& pts, Config& config, 
00083                       const std::string file) const;
00084 
00085   //! Dump debug data about world positioning etc.
00086   void printWorldData(RonTrackball &trackball) const;
00087 
00088   //! Handel an error
00089   std::string handelError(OSGenum::Error error_enum, std::string extra) const;
00090 
00091   //! Set up all four cameras in OSG retina
00092   void setUpCameras(OSGViewUtil& util,
00093                     GLenum& buffer,
00094                     osgViewer::CompositeViewer& viewer,  
00095                     osg::ref_ptr<osg::GraphicsContext::Traits>& traits,
00096                     osg::ref_ptr<osg::GraphicsContext> &gc,
00097                     OSGView& baseView,  OSGView& locationView,
00098                     OSGView& depthView, OSGView& salientView,
00099                     const OSGenum::DepthType depthType,
00100                     const std::string WINDOW_NAME) const;
00101 
00102   //! Set up all point sets in OSG retina
00103   void setUpPoints(const bool decimatePoints,
00104                    const bool desatGround,
00105                    const int  decimateBins,
00106                    const OSGenum::DepthType depthType,
00107                    RecolorPts&  recolorPts,
00108                    OSGViewUtil& util,
00109                    RenderPts&   points,
00110                    OSGView& baseView,  OSGView& locationView,
00111                    OSGView& depthView, OSGView& salientView,
00112                    OSGRetinaPts& salientPts,
00113                    OSGRetinaPts& newSalientPts,
00114                    OSGRetinaPts& airLocationPts, 
00115                    OSGRetinaPts& groundLocationPts,
00116                    OSGRetinaPts& airDepthPts,
00117                    OSGRetinaPts& groundDepthPts,
00118                    OSGRetinaPts& decimatePts,
00119                    OSGRetinaPts& decimateLocatePts,
00120                    OSGTextSet&   textSet) const; 
00121 
00122   //! Get some help menu text to put in a window
00123   void setHelpMenuText(OSGViewUtil& util,
00124                        OSGTextSet&  textSet) const;
00125 
00126 protected: 
00127   using OSGViewUtil::printTime;
00128   using OSGViewUtil::resetTime;
00129   using OSGViewUtil::itsName;
00130   using OSGViewUtil::itsOptimizer; 
00131   using OSGViewUtil::itsTimer;
00132   using OSGViewUtil::itsT0;
00133   using OSGViewUtil::itsT1;
00134   using OSGViewUtil::itsT2;
00135   using OSGViewUtil::itsT3;
00136   using OSGViewUtil::itsGiveTimeSlice;
00137   using OSGViewUtil::itsSnapShotImage;
00138   using OSGViewUtil::itsGLImage;
00139 };
00140     
00141 #endif //SKIP_ALL_OSG
00142 #endif

Generated on Thu Dec 4 10:20:36 2008 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4