00001 #ifndef vipl_section_descriptor_txx_
00002 #define vipl_section_descriptor_txx_
00003
00004
00005
00006 #include "vipl_section_descriptor.h"
00007 #include <vipl/section/vipl_section_container.h>
00008 #include <vipl/filter/vipl_filter_abs.h>
00009 #include <vcl_iostream.h>
00010
00011 #include <vcl_compiler.h>
00012
00013 #ifdef VCL_VC
00014
00015 # pragma warning( push )
00016 # pragma warning( disable : 4390 )
00017 #endif
00018
00019
00020 template < class DataType >
00021 vipl_section_descriptor< DataType > ::vipl_section_descriptor(
00022 vipl_section_descriptor< DataType >* desc ,
00023 vipl_section_container< DataType >* container)
00024 : hsreal_descriptor(desc),
00025 hsreal_container(container),
00026 hsi_data_ptr(0),
00027 hsi_data_offsets(2,0),
00028 hsi_curr_sec_start(2,0),
00029 hsi_curr_sec_end(2,0),
00030 hsi_curr_sec_size(2,0),
00031 refcount_ (1)
00032 {
00033 if (desc) { FILTER_IMPTR_INC_REFCOUNT(desc); }
00034 if (container) { FILTER_IMPTR_INC_REFCOUNT(container); }
00035 #ifdef DEBUG
00036 vcl_cerr << "Warning: called unimplemented vipl_section_descriptor constructor with signature "
00037 << "vipl_section_descriptor<DataType>*, vipl_section_container<DataType>*\n";
00038 #endif
00039 }
00040
00041 #ifdef VCL_VC
00042 # pragma warning( pop )
00043 #endif
00044
00045
00046 template < class DataType >
00047 vipl_section_descriptor< DataType > ::vipl_section_descriptor(
00048 const vipl_section_descriptor< DataType >* desc ,
00049 const vipl_section_container< DataType >* container ,
00050 int t)
00051 : hsreal_descriptor(0),
00052 hsreal_container(0),
00053 hsi_data_ptr(0),
00054 hsi_data_offsets(2,0),
00055 hsi_curr_sec_start(2,0),
00056 hsi_curr_sec_end(2,0),
00057 hsi_curr_sec_size(2,0),
00058 refcount_ (1)
00059 {
00060 hsreal_descriptor = desc->virtual_copy();
00061 hsreal_container = container->virtual_copy();
00062 #ifdef DEBUG
00063 vcl_cerr << "Warning: called unimplemented vipl_section_descriptor constructor with signature "
00064 << "const vipl_section_descriptor<DataType>*, const vipl_section_container<DataType>*, int\n";
00065 #endif
00066 }
00067
00068
00069
00070
00071
00072
00073
00074 template < class DataType >
00075 vipl_section_descriptor< DataType > ::vipl_section_descriptor(
00076 vcl_vector< int >& startpts ,
00077 vcl_vector< int >& endpts)
00078 : hsreal_descriptor (0),
00079 hsreal_container (0),
00080 hsi_data_ptr (0),
00081 hsi_data_offsets (2,0),
00082 hsi_curr_sec_start (2,0),
00083 hsi_curr_sec_end (2,0),
00084 hsi_curr_sec_size (2,0),
00085 refcount_ (1)
00086 {
00087 #ifdef DEBUG
00088 vcl_cerr << "Warning: called unimplemented vipl_section_descriptor constructor with signature "
00089 << "vcl_vector<int>&, vcl_vector<int>&\n";
00090 #endif
00091 }
00092
00093 template < class DataType >
00094 vipl_section_descriptor< DataType > ::~vipl_section_descriptor()
00095 {
00096 if (this != hsreal_descriptor && hsreal_descriptor && (hsreal_descriptor->refcount() > 1) )
00097 FILTER_IMPTR_DEC_REFCOUNT(hsreal_descriptor);
00098 if (hsreal_container && hsreal_container->refcount()>1)
00099 FILTER_IMPTR_DEC_REFCOUNT(hsreal_container);
00100 #ifdef DEBUG
00101 vcl_cerr << "Warning: called unfinished destructor\n";
00102 #endif
00103 }
00104
00105 template < class DataType >
00106 vipl_section_descriptor< DataType > ::vipl_section_descriptor()
00107 : hsreal_descriptor(this),
00108 hsreal_container(0),
00109 hsi_data_ptr(0),
00110 hsi_data_offsets(2,0),
00111 hsi_curr_sec_start(2,0),
00112 hsi_curr_sec_end(2,0),
00113 hsi_curr_sec_size(2,0),
00114 refcount_ (1)
00115
00116 {
00117 hsreal_descriptor = this;
00118 }
00119
00120 template < class DataType >
00121 vipl_section_descriptor< DataType > ::vipl_section_descriptor(const vipl_section_descriptor< DataType > &t)
00122 : hsreal_descriptor(t.hsreal_descriptor),
00123 hsreal_container(t.hsreal_container),
00124 hsi_data_ptr(t.hsi_data_ptr),
00125 hsi_data_offsets(t.hsi_data_offsets),
00126 hsi_curr_sec_start(t.hsi_curr_sec_start),
00127 hsi_curr_sec_end(t.hsi_curr_sec_end),
00128 hsi_curr_sec_size(t.hsi_curr_sec_size),
00129 refcount_ (1)
00130
00131 {
00132
00133
00134
00135
00136
00137 if (t.hsreal_descriptor)
00138 hsreal_descriptor = t.hsreal_descriptor->virtual_copy();
00139 if (t.hsreal_container)
00140 hsreal_container = t.hsreal_container->virtual_copy();
00141 }
00142
00143
00144
00145
00146
00147
00148 template < class DataType >
00149 int vipl_section_descriptor< DataType > ::data_offsets( int ) const
00150 {
00151 vcl_cerr << "Warning: called unimplemented method vipl_section_descriptor::data_offsets\n";
00152 return 0;
00153 }
00154
00155
00156
00157 template < class DataType >
00158 DataType* vipl_section_descriptor< DataType > ::data_ptr()
00159 {
00160 vcl_cerr << "Warning: called unimplemented method vipl_section_descriptor::data_ptr\n";
00161 return 0;
00162 }
00163
00164
00165
00166 template < class DataType >
00167 const DataType* vipl_section_descriptor< DataType > ::data_ptr() const
00168 {
00169 vcl_cerr << "Warning: called unimplemented method vipl_section_descriptor::data_ptr\n";
00170 return 0;
00171 }
00172
00173
00174
00175
00176
00177
00178 template < class DataType >
00179 int vipl_section_descriptor< DataType > ::restrict( const vipl_section_descriptor< DataType >& ROA)
00180 {
00181 return 0;
00182 }
00183
00184
00185 template < class DataType >
00186 vipl_section_descriptor< DataType >* vipl_section_descriptor< DataType > ::virtual_copy() const
00187 {
00188 vipl_section_descriptor< DataType > *rtn = new vipl_section_descriptor< DataType >;
00189 rtn->put_real_descriptor(rtn);
00190 if (real_container())
00191 rtn->put_real_container(real_container()->virtual_copy());
00192 else
00193 rtn->put_real_container(0);
00194 rtn->put_i_curr_sec_start(i_curr_sec_start());
00195 rtn->put_i_curr_sec_end(i_curr_sec_end());
00196 rtn->put_i_curr_sec_size(i_curr_sec_size());
00197 return rtn;
00198 }
00199
00200 #endif // vipl_section_descriptor_txx_