rasdaman API
interesttiling.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
33 #ifndef _R_INTERESTTILING_HH_
34 #define _R_INTERESTTILING_HH_
35 
36 class r_Dir_Decompose;
37 class r_Interest_Tiling;
38 #include "rasodmg/tiling.hh"
39 
40 //@ManMemo: Module: {\bf rasodmg}
41 
42 /*@Doc:
43  This class implements the "Interesting Areas" tiling algorithm.
44  The user specifies which areas are of interest to him and tiling is
45  performed accordingly.
46 
47  Example of usage:
48  The user says that [10:20, 50:60] and [18:50, 65:70] are of interest
49  to him in the [0:1000, 0:1000] domain. Tiling should be done according
50  to this setting. To specify this with this class the following code
51  would work:
52 
53  ...
54 
55  r_Minterval domain(2);
56  domain << r_Sinterval(0L, 1000L) << r_Sinterval(0L, 1000L);
57 
58  r_Minteval interest1(2);
59  interest1 << r_Sinterval(10L, 20L) << r_Sinterval(50L, 60L);
60 
61  r_Minterval interest2(2);
62  interest2 << r_Sinterval(18L, 50L) << r_Sinterval(65L, 70L);
63 
64  std::vector<r_Minterval> interest_areas;
65  interest_areas.insert_element(interest1);
66  interest_areas.insert_element(interest2);
67 
68  r_Interest_Tiling(interest_areas);
69 
70  ...
71 */
72 
76 class r_Interest_Tiling : public r_Dimension_Tiling
77 {
78 public:
79 
81  enum Tilesize_Limit {NO_LIMIT, REGROUP, SUB_TILING, REGROUP_AND_SUBTILING, NUMBER};
82 
85  r_Interest_Tiling(const char* encoded) throw (r_Error);
86 
87  r_Interest_Tiling(r_Dimension dim,
88  const std::vector<r_Minterval>& interest_areas,
89  r_Bytes ts = RMInit::clientTileSize,
90  Tilesize_Limit strat = SUB_TILING) throw (r_Error);
117  virtual ~r_Interest_Tiling();
118 
119  std::vector<r_Minterval>* compute_tiles(const r_Minterval& obj_domain, r_Bytes cell_size) const throw (r_Error);
120 
121  virtual void print_status(std::ostream& os) const;
122 
123  virtual r_Tiling* clone() const;
124 
125  virtual r_Tiling_Scheme get_tiling_scheme() const;
126 
127  //@ManMemo: Module: {\bf raslib}
131  static r_Interest_Tiling::Tilesize_Limit get_tilesize_limit_from_name(const char* name);
132  //@ManMemo: Module: {\bf raslib}
136  static const char* get_name_from_tilesize_limit(Tilesize_Limit tsl);
137 
138  static const char* description;
139 
140 protected: // methods.
141 
143  std::vector<r_Dir_Decompose>* make_partition(const r_Minterval& domain) const;
144 
146  enum Blocks_Type {BLOCKS_A, BLOCKS_B, BLOCKS_C };
156  std::vector<r_Minterval>* group(std::vector<r_Minterval>& blocks, r_Bytes typelen, Blocks_Type btype) const;
163  Tilesize_Limit ts_strat;
165 
167  std::vector<r_Minterval> iareas;
168 
169 
170  //@ManMemo: Module: {\bf raslib}
178  static const char* tilesizelimit_name_nolimit;
179  static const char* tilesizelimit_name_regroup;
180  static const char* tilesizelimit_name_subtiling;
181  static const char* tilesizelimit_name_regroupandsubtiling;
182 
183  static const char* all_tilesizelimit_names[r_Interest_Tiling::NUMBER];
184 };
185 
186 #endif
static r_Bytes clientTileSize
Definition: rminit.hh:132