Voreen - Volume Rendering Engine Voreen - Volume Rendering Engine
Voreen - Volume Rendering Engine Westfälische Wilhelms-Universität Münster
  • About
  • Gallery
  • Download
  • Documentation
  • Publications
  • Community

  • Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

include/voreen/core/datastructures/rendertarget.h

00001 /**********************************************************************
00002  *                                                                    *
00003  * Voreen - The Volume Rendering Engine                               *
00004  *                                                                    *
00005  * Copyright (C) 2005-2010 The Voreen Team. <http://www.voreen.org>   *
00006  *                                                                    *
00007  * This file is part of the Voreen software package. Voreen is free   *
00008  * software: you can redistribute it and/or modify it under the terms *
00009  * of the GNU General Public License version 2 as published by the    *
00010  * Free Software Foundation.                                          *
00011  *                                                                    *
00012  * Voreen is distributed in the hope that it will be useful,          *
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the       *
00015  * GNU General Public License for more details.                       *
00016  *                                                                    *
00017  * You should have received a copy of the GNU General Public License  *
00018  * in the file "LICENSE.txt" along with this program.                 *
00019  * If not, see <http://www.gnu.org/licenses/>.                        *
00020  *                                                                    *
00021  * The authors reserve all rights not expressly granted herein. For   *
00022  * non-commercial academic use see the license exception specified in *
00023  * the file "LICENSE-academic.txt". To get information about          *
00024  * commercial licensing please contact the authors.                   *
00025  *                                                                    *
00026  **********************************************************************/
00027 
00028 #ifndef VRN_RENDERTARGET_H
00029 #define VRN_RENDERTARGET_H
00030 
00031 #include "tgt/framebufferobject.h"
00032 
00033 namespace voreen {
00034 
00035 class RenderTarget {
00036 public:
00037     RenderTarget();
00038     virtual ~RenderTarget();
00039 
00040     void initialize(GLint internalColorFormat = GL_RGBA16, GLint internalDepthFormat = GL_DEPTH_COMPONENT24);
00041     //void initialize(GLint internalColorFormat = GL_RGBA16F_ARB, GLint internalDepthFormat = GL_DEPTH_COMPONENT24);
00042     void deinitialize();
00043 
00044     void activateTarget(const std::string& debugLabel = "");
00045     void deactivateTarget();
00046 
00047     void bindColorTexture(GLint texUnit);
00048     void bindDepthTexture(GLint texUnit);
00049 
00050     void bindColorTexture();
00051     void bindDepthTexture();
00052 
00053     tgt::Texture* getColorTexture() { return colorTex_; }
00054     tgt::Texture* getDepthTexture() { return depthTex_; }
00055 
00056     //Get the color at position pos. This method activates the RenderTarget!
00057     tgt::vec4 getColorAtPos(tgt::ivec2 pos);
00058 
00059     tgt::ivec2 getSize() const;
00060     void resize(tgt::ivec2 newsize);
00061 
00062     //these are just for debugging purposes:
00063     std::string getDebugLabel() { return debugLabel_; }
00064     void setDebugLabel(const std::string& debugLabel) { debugLabel_ = debugLabel; }
00065 
00066     void increaseNumUpdates() { numUpdates_++; }
00067     int getNumUpdates() { return numUpdates_; }
00068 
00069 protected:
00070     tgt::FramebufferObject* fbo_;
00071 
00072     tgt::Texture* colorTex_;
00073     tgt::Texture* depthTex_;
00074 
00075     std::string debugLabel_;
00076     int numUpdates_;
00077 
00078     static const std::string loggerCat_;
00079 };
00080 
00081 }   // namespace
00082 
00083 #endif  // VRN_RENDERTARGET_H
  • Getting Started
  • Video Tutorials
  • Build Instructions
  • Adding a Module
  • Programming Tutorials
  • API Documentation
  • FAQ
edit