OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
roi_utils.h
Go to the documentation of this file.
1 // -*- mode: c++; c-basic-offset:4 -*-
2 
3 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
4 // Access Protocol.
5 
6 // Copyright (c) 2015 OPeNDAP, Inc.
7 // Author: James Gallagher <jgallagher@opendap.org>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 
25 #ifndef ROI_UTILS_H_
26 #define ROI_UTILS_H_
27 
28 namespace libdap {
29 
30 class BaseType;
31 class Array;
32 class Structure;
33 
34 // Defined here because prior to C++ 11, defining a container using a local
35 // type was not allowed.
36 struct slice {
37  int start, stop;
38  string name;
39 };
40 
41 void roi_bbox_valid_slice(BaseType *btp);
42 unsigned int roi_valid_bbox(BaseType *btp);
43 
44 void roi_bbox_get_slice_data(Array *bbox, unsigned int i, int &start, int &stop, string &name);
45 
46 Structure *roi_bbox_build_slice(unsigned int start_value, unsigned int stop_value, const string &dim_name);
47 
48 auto_ptr<Array> roi_bbox_build_empty_bbox(unsigned int num_dim, const string &bbox_name = "bbox");
49 
50 }
51 
52 #endif /* ROI_UTILS_H_ */
void roi_bbox_valid_slice(BaseType *btp)
Each Bounding Box is made up of a number of 'slices' - test if a given one is valid.
Definition: roi_utils.cc:56
string name
Definition: roi_utils.h:38
void roi_bbox_get_slice_data(Array *slices, unsigned int i, int &start, int &stop, string &name)
This method extracts values from one element of the Bounding Box (i.e., Array of Structures).
Definition: roi_utils.cc:122
unsigned int roi_valid_bbox(BaseType *btp)
Is the bound box valid?
Definition: roi_utils.cc:90
Structure * roi_bbox_build_slice(unsigned int start_value, unsigned int stop_value, const string &dim_name)
Build a single element of a bounding box.
Definition: roi_utils.cc:153
static class NCMLUtil overview
auto_ptr< Array > roi_bbox_build_empty_bbox(unsigned int num_dim, const string &bbox_name)
Build an empty Bounding Box using DAP variables.
Definition: roi_utils.cc:192