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 
77 {
78 public:
79 
82 
85  r_Interest_Tiling(const char* encoded) throw (r_Error);
86 
88  const std::vector<r_Minterval>& interest_areas,
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 
156  std::vector<r_Minterval>* group(std::vector<r_Minterval>& blocks, r_Bytes typelen, Blocks_Type btype) const;
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;
182 
184 };
185 
186 #endif
static const char * tilesizelimit_name_regroupandsubtiling
Definition: interesttiling.hh:181
static const char * get_name_from_tilesize_limit(Tilesize_Limit tsl)
static const char * tilesizelimit_name_subtiling
Definition: interesttiling.hh:180
static const char * tilesizelimit_name_regroup
Definition: interesttiling.hh:179
std::vector< r_Dir_Decompose > * make_partition(const r_Minterval &domain) const
Given a domain and a set of interest areas (internal) gener. partition.
Tilesize_Limit
Possible strategies to limit the tilesize.
Definition: interesttiling.hh:81
Definition: error.hh:88
Definition: dirdecompose.hh:71
Blocks_Type
The Block types (A, B or C)
Definition: interesttiling.hh:146
Definition: tiling.hh:67
static const char * all_tilesizelimit_names[r_Interest_Tiling::NUMBER]
Definition: interesttiling.hh:183
unsigned int r_Dimension
Definition: mddtypes.hh:118
virtual r_Tiling * clone() const
Clones this object.
static const char * tilesizelimit_name_nolimit
Definition: interesttiling.hh:178
r_Interest_Tiling(const char *encoded)
read everything from an encoded string e.g. "2;[0:9,0:9];[100:109,0:9];100;REGROUPSUBTILING" ...
static r_Interest_Tiling::Tilesize_Limit get_tilesize_limit_from_name(const char *name)
Definition: interesttiling.hh:146
Tilesize_Limit ts_strat
Tilesize limitation strategie.
Definition: interesttiling.hh:164
std::vector< r_Minterval > iareas
Interest areas.
Definition: interesttiling.hh:167
std::vector< r_Minterval > * compute_tiles(const r_Minterval &obj_domain, r_Bytes cell_size) const
returns true if the cellTypeSize is smaller or equal to the tile size and the dimension fits the obj_...
static r_Bytes clientTileSize
Definition: rminit.hh:132
Definition: interesttiling.hh:81
Definition: interesttiling.hh:81
r_Tiling_Scheme
Definition: mddtypes.hh:393
Definition: interesttiling.hh:76
std::vector< r_Minterval > * group(std::vector< r_Minterval > &blocks, r_Bytes typelen, Blocks_Type btype) const
Merge as many blocks together in a list as possible.
virtual r_Tiling_Scheme get_tiling_scheme() const
Definition: interesttiling.hh:146
unsigned int r_Bytes
Definition: mddtypes.hh:56
Definition: interesttiling.hh:81
Definition: interesttiling.hh:146
static const char * description
Definition: interesttiling.hh:138
Definition: tiling.hh:153
virtual void print_status(std::ostream &os) const
Prints the current status of the object.
Definition: minterval.hh:249
Definition: interesttiling.hh:81
Definition: interesttiling.hh:81