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

vlvolvoxelops_linear.h

Go to the documentation of this file.
00001 // $Id: vlvolvoxelops_linear.h,v 1.1 2003/01/28 19:53:57 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 #ifndef _vlVolVoxelOps_Linear_h
00028 #define _vlVolVoxelOps_Linear_h
00029 
00030 #include "vlenums.h"
00031 #include "vlvoxeloperator.h"
00032 #include "vlvoxelopplugin.h"
00033 #include "vlvolvoxelops.h"
00034 #include "vlkernel.h"
00035 #include "vltrader.h"
00036 
00037 
00038 template <typename DataType>
00039 class vlVolVoxelOps<DataType, vlLayout::Linear>
00040   : public vlVolVoxelOpsBase<DataType, vlLayout::Linear>
00041 {
00042 public:
00043   vlVoxelOperator<DataType, vlLayout::Linear> * getNativeVoxelOp(const vlVoxelOpType type);
00044 
00045   vlVoxelOperator<DataType, vlLayout::Linear> * getNativeVoxelOp(const std::string & name);
00046 
00047   vlVoxelOperator<DataType, vlLayout::VirtualCall> * getVirtualVoxelOp(const vlVoxelOpType type);
00048 
00049   vlVoxelOperator<DataType, vlLayout::VirtualCall> * getVirtualVoxelOp(const std::string & name);
00050 };
00051 
00052 
00053 template <typename DataType>
00054 vlVoxelOperator<DataType, vlLayout::Linear> *
00055   vlVolVoxelOps<DataType, vlLayout::Linear>::getNativeVoxelOp(const vlVoxelOpType type)
00056 {
00057   vlVoxelOperator<DataType, vlLayout::Linear> *voxelop(0L);
00058 
00059   switch(type) {
00060 
00061   default:
00062     vlVoxelOpPlugin *proc = (vlVoxelOpPlugin *) vlKernel::trader()->getPlugin("VoxelOperator", vlVoxelOp::name(type));
00063 
00064     if(proc) {
00065       DataType variable;
00066       vlDataType datatype;
00067       getVariableDataType(variable, datatype);
00068       voxelop = dynamic_cast< vlVoxelOperator<DataType, vlLayout::Linear> *>(proc->getNativeVoxelOp(datatype  , vlLayout::Linear));
00069       if(voxelop)
00070         return voxelop;
00071     }
00072   }
00073   
00074   return (0L);
00075 }
00076 
00077 template <typename DataType>
00078 vlVoxelOperator<DataType, vlLayout::Linear> *
00079   vlVolVoxelOps<DataType, vlLayout::Linear>::getNativeVoxelOp(const std::string & name)
00080 {
00081   vlVoxelOperator<DataType, vlLayout::Linear> *voxelop(0L);
00082 
00083 //  switch(name) {
00084 
00085 //  default:
00086     vlVoxelOpPlugin *proc = (vlVoxelOpPlugin *) vlKernel::trader()->getPlugin("VoxelOperator", name);
00087 
00088     if(proc) {
00089       DataType variable;
00090       vlDataType datatype;
00091       getVariableDataType(variable, datatype);
00092       voxelop = dynamic_cast< vlVoxelOperator<DataType, vlLayout::Linear> *>(proc->getNativeVoxelOp(datatype, vlLayout::Linear));
00093       if(voxelop)
00094         return voxelop;
00095     }
00096 //  }
00097 
00098   return (0L);
00099 }
00100 
00101 template <typename DataType>
00102 vlVoxelOperator<DataType, vlLayout::VirtualCall> *
00103   vlVolVoxelOps<DataType, vlLayout::Linear>::getVirtualVoxelOp(const vlVoxelOpType type)
00104 {
00105   vlVoxelOperator<DataType, vlLayout::VirtualCall> *voxelop(0L);
00106 
00107   switch(type) {
00108 
00109   default:
00110     vlVoxelOpPlugin *proc = (vlVoxelOpPlugin *) vlKernel::trader()->getPlugin("VoxelOperator", vlVoxelOp::name(type));
00111 
00112     if(proc) {
00113       DataType variable;
00114       vlDataType datatype;
00115       getVariableDataType(variable, datatype);
00116       voxelop = dynamic_cast< vlVoxelOperator<DataType, vlLayout::VirtualCall> *>(proc->getVirtualVoxelOp(datatype));
00117       if(voxelop)
00118         return voxelop;
00119     }
00120   }
00121 
00122   return (0L);
00123 }
00124 
00125 template <typename DataType>
00126 vlVoxelOperator<DataType, vlLayout::VirtualCall> *
00127   vlVolVoxelOps<DataType, vlLayout::Linear>::getVirtualVoxelOp(const std::string & name)
00128 {
00129   vlVoxelOperator<DataType, vlLayout::VirtualCall> *voxelop(0L);
00130 
00131 //  switch(name) {
00132 
00133 //  default:
00134     vlVoxelOpPlugin *proc = (vlVoxelOpPlugin *) vlKernel::trader()->getPlugin("VoxelOperator", name);
00135 
00136     if(proc) {
00137       DataType variable;
00138       vlDataType datatype;
00139       getVariableDataType(variable, datatype);
00140       voxelop = dynamic_cast< vlVoxelOperator<DataType, vlLayout::VirtualCall> *>(proc->getVirtualVoxelOp(datatype));
00141       if(voxelop)
00142         return voxelop;
00143     }
00144 //  }
00145 
00146   return (0L);
00147 }
00148 
00149 
00150 #endif // _vlVolVoxelOps_Linear_h
00151 
00152 

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