Field3D
Field.cpp
Go to the documentation of this file.
00001 //----------------------------------------------------------------------------//
00002 
00003 /*
00004  * Copyright (c) 2009 Sony Pictures Imageworks Inc
00005  *
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * Redistributions of source code must retain the above copyright
00013  * notice, this list of conditions and the following disclaimer.
00014  * Redistributions in binary form must reproduce the above copyright
00015  * notice, this list of conditions and the following disclaimer in the
00016  * documentation and/or other materials provided with the
00017  * distribution.  Neither the name of Sony Pictures Imageworks nor the
00018  * names of its contributors may be used to endorse or promote
00019  * products derived from this software without specific prior written
00020  * permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
00026  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00028  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00029  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00031  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00033  * OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 //----------------------------------------------------------------------------//
00037 
00042 //----------------------------------------------------------------------------//
00043 
00044 #include "Field.h"
00045 
00046 //----------------------------------------------------------------------------//
00047 
00048 FIELD3D_NAMESPACE_OPEN
00049 
00050 //----------------------------------------------------------------------------//
00051 // FieldBase
00052 //----------------------------------------------------------------------------//
00053 
00054 FieldBase::FieldBase()
00055   : RefBase(),
00056     m_metadata(this)
00057 { 
00058   // Empty
00059 }
00060 
00061 FieldBase::FieldBase(const FieldBase &other)
00062   : RefBase(),
00063     name(other.name),
00064     attribute(other.attribute),
00065     m_metadata(this)
00066 { 
00067   m_metadata = other.m_metadata;  
00068 }
00069 
00070 
00071 //----------------------------------------------------------------------------//
00072 
00073 FieldBase::~FieldBase()
00074 { 
00075   // Empty
00076 }
00077 
00078 //----------------------------------------------------------------------------//
00079 // FieldTraits template specializations
00080 //----------------------------------------------------------------------------//
00081 
00082 template <>
00083 int FieldTraits<half>::dataDims()
00084 {
00085   return 1;
00086 }
00087 
00088 //----------------------------------------------------------------------------//
00089 
00090 template <>
00091 int FieldTraits<float>::dataDims()
00092 {
00093   return 1;
00094 }
00095 
00096 //----------------------------------------------------------------------------//
00097 
00098 template <>
00099 int FieldTraits<double>::dataDims()
00100 {
00101   return 1;
00102 }
00103 
00104 //----------------------------------------------------------------------------//
00105 
00106 template <>
00107 int FieldTraits<int>::dataDims()
00108 {
00109   return 1;
00110 }
00111 
00112 //----------------------------------------------------------------------------//
00113 
00114 template <>
00115 int FieldTraits<char>::dataDims()
00116 {
00117   return 1;
00118 }
00119 
00120 //----------------------------------------------------------------------------//
00121 
00122 template <>
00123 int FieldTraits<unsigned char>::dataDims()
00124 {
00125   return 1;
00126 }
00127 
00128 //----------------------------------------------------------------------------//
00129 
00130 template <>
00131 int FieldTraits<V3h>::dataDims()
00132 {
00133   return 3;
00134 }
00135 
00136 //----------------------------------------------------------------------------//
00137 
00138 template <>
00139 int FieldTraits<V3f>::dataDims()
00140 {
00141   return 3;
00142 }
00143 
00144 //----------------------------------------------------------------------------//
00145 
00146 template <>
00147 int FieldTraits<V3d>::dataDims()
00148 {
00149   return 3;
00150 }
00151 
00152 //----------------------------------------------------------------------------//
00153 
00154 template <>
00155 int FieldTraits<C3f>::dataDims()
00156 {
00157   return 3;
00158 }
00159 
00160 //----------------------------------------------------------------------------//
00161 
00162 FIELD3D_NAMESPACE_SOURCE_CLOSE
00163 
00164 //----------------------------------------------------------------------------//