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

rlencode.cpp

Go to the documentation of this file.
00001 // $Id: rlencode.cpp,v 1.3 2003/01/16 18:36:50 sarang Exp $
00002 //
00003 // OpenVL - A Library for working with volumetric datasets.
00004 //          http://openvl.sf.net
00005 //
00006 // Copyright (C) 2000-2002  Sarang Lakare <sarang#users.sf.net>
00007 //
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU Library General Public
00010 // License as published by the Free Software Foundation; either
00011 // version 2 of the License, or (at your option) any later version.
00012 //
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 // Library General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU Library General Public
00019 // License along with this library; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021 // USA.
00022 //
00023 // Please report all bugs and problems to openvl-devel@lists.sf.net or
00024 // at the OpenVL website.
00025 //
00026 
00027 #include <iostream>
00028 #include "vlvoliter_rlencode.h"
00029 #include "vlgenericfactory.h"
00030 #include "rlencode.h"
00031 
00032 typedef vlGenericFactory<vlVolDataRLEncode> vlVolDataRLEncodeFactory;
00033 VL_EXPORT_COMPONENT_FACTORY( rlencode, vlVolDataRLEncodeFactory );
00034 
00038 vlVolDataRLEncode::vlVolDataRLEncode()
00039 {
00040   infoRef().setVersion(0, 0, 1);
00041   infoRef().setName("RLEncodeLayout");
00042   infoRef().setService("RLEncode", "RLEncoded volume layout");
00043   infoRef().addAuthor("Sarang Lakare");
00044   infoRef().setCopyrightText("2000-2002 Sarang Lakare");
00045 }
00046 
00047 
00051 vlVolDataRLEncode::~vlVolDataRLEncode()
00052 {
00053 }
00054 
00055 vlLayoutType vlVolDataRLEncode::layoutType() const
00056 {
00057   return (LayoutType);
00058 }
00059 
00060 vlVolData * vlVolDataRLEncode::getLayout(const vlDataType & datatype, const vlDim & dim,
00061                                          const vlUnit & units)
00062 {
00063   vlVolData * ret;
00064   callFunctionOnDataType(datatype, ret, getLayoutT, dim, units);
00065   return (ret);
00066 }
00067 
00068 
00069 template <class DataType>
00070 vlVolData * vlVolDataRLEncode::getLayoutT(DataType & dummy, const vlDim & dim,
00071                                           const vlUnit & units)
00072 {
00073   vlVolDataLayout<DataType,LayoutType>* layout =
00074                                 new vlVolDataLayout<DataType,LayoutType>(dim, units);
00075   return (layout);
00076 }
00077 
00078 
00079 vlVolIterSuperBase * vlVolDataRLEncode::getIter(vlVolume * vol)
00080 {
00081   vlVolIterSuperBase *iter;
00082   callFunctionOnDataType(vol->dataType(), iter, getIterT, vol);
00083   return (iter);
00084 }
00085 
00086 vlVolIterSuperBase * vlVolDataRLEncode::getConstIter(const vlVolume * vol)
00087 {
00088   vlVolIterSuperBase *iter;
00089   callFunctionOnDataType(vol->dataType(), iter, getConstIterT, vol);
00090   return (iter);
00091 }
00092 
00093 template <class DataType>
00094 vlVolIterSuperBase * vlVolDataRLEncode::getIterT(DataType & dummy, vlVolume *vol)
00095 {
00096   vlVolIterSuperBase *iter = new vlVolIter<DataType, LayoutType>(vol);
00097   return (iter);
00098 }
00099 
00100 
00101 template <class DataType>
00102 vlVolIterSuperBase * vlVolDataRLEncode::getConstIterT(DataType & dummy, const vlVolume *vol)
00103 {
00104   vlVolIterSuperBase *iter = new vlVolIterConst<DataType, LayoutType>(vol);
00105   return (iter);
00106 }
00107 
00108 
00109 

Generated on Fri Mar 18 11:33:13 2005 for OpenVL by doxygen 1.3.3