OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVpfBoundingRecordTable.cpp
Go to the documentation of this file.
2 
5 {
6 }
7 
9 {
10  bool result = false;
11  theExtent = ossimVpfExtent(0,0,0,0);
12  bool firstOneSetFlag = false;
13 
14  if(ossimVpfTable::openTable(tableName))
15  {
16  ossim_int32 xminIdx = getColumnPosition("XMIN");
17  ossim_int32 yminIdx = getColumnPosition("YMIN");
18  ossim_int32 xmaxIdx = getColumnPosition("XMAX");
19  ossim_int32 ymaxIdx = getColumnPosition("YMAX");
20 
21  if((xminIdx < 0)||
22  (yminIdx < 0)||
23  (xmaxIdx < 0)||
24  (ymaxIdx < 0))
25  {
26  closeTable();
27  }
28  else
29  {
30  if(getNumberOfRows() > 0)
31  {
32  result = true;
33  reset();
34  ossim_int32 n = 1;
35 
36  ossim_float32 xmin;
37  ossim_float32 ymin;
38  ossim_float32 xmax;
39  ossim_float32 ymax;
40 
41  row_type row;
42  for(int rowIdx = 1; rowIdx < getNumberOfRows(); ++rowIdx)
43  {
44  if(rowIdx == 1)
45  {
46  row = read_row(rowIdx,
48  }
49  else
50  {
52  }
53  get_table_element(xminIdx,
54  row,
56  &xmin,
57  &n);
58  get_table_element(yminIdx,
59  row,
61  &ymin,
62  &n);
63  get_table_element(xmaxIdx,
64  row,
66  &xmax,
67  &n);
68  get_table_element(ymaxIdx,
69  row,
71  &ymax,
72  &n);
73  if(!is_vpf_null_float(xmin)&&
74  !is_vpf_null_float(ymin)&&
75  !is_vpf_null_float(xmax)&&
76  !is_vpf_null_float(ymax))
77  {
78  if(!firstOneSetFlag)
79  {
81  ymin,
82  xmax,
83  ymax);
84  firstOneSetFlag = true;
85  }
86  else
87  {
89  ymin,
90  xmax,
91  ymax);
92  }
93  }
95  }
96  }
97  }
98  }
99  return result;
100 }
101 
103 {
104  extent = theExtent;
105 }
vpf_table_type * theTableInformation
Definition: ossimVpfTable.h:81
virtual bool openTable(const ossimFilename &tableName)
void free_row(row_type row, vpf_table_type table)
virtual void closeTable()
int getNumberOfRows() const
float ossim_float32
row_type read_row(ossim_int32 row_number, vpf_table_type table)
virtual bool openTable(const ossimFilename &tableName)
ossim_int32 getColumnPosition(const ossimString &columnName) const
os2<< "> n<< " > nendobj n
int is_vpf_null_float(float num)
virtual void reset() const
void * get_table_element(ossim_int32 field_number, row_type row, vpf_table_type table, void *value, ossim_int32 *count)
row_type read_next_row(vpf_table_type table)
void getExtent(ossimVpfExtent &extent) const
int ossim_int32