Evita  0.16
evPriorityScheduleEntry.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evPriorityScheduleEntry_h
25 #define __evPriorityScheduleEntry_h
26 
27 
28 #include "evBitBuffer.h"
29 #include "evBoundingBox.h"
30 
31 
32 #define EVPRIORITYSCHEDULEENTRY_ROI 0x01
33 #define EVPRIORITYSCHEDULEENTRY_TILE 0x02
34 #define EVPRIORITYSCHEDULEENTRY_COMPONENT 0x04
35 #define EVPRIORITYSCHEDULEENTRY_BITPLANE 0x08
36 #define EVPRIORITYSCHEDULEENTRY_SCALE 0x10
37 
38 
40 {
41  public:
42  evPriorityScheduleEntry(const unsigned int roi = 0,
43  const unsigned int tile = 0,
44  const unsigned int component = 0,
45  const unsigned int bitplane = 0,
46  const unsigned int scale = 0,
47  const unsigned int bitplane_length = 0,
48  const double priority = 0,
49  const evFilePosition file_position = 0,
50  const evBoundingBox &bounding_box = evBoundingBox(),
51  const double grid_spacing = 0,
52  const unsigned int max_num_scales = 0);
53  evPriorityScheduleEntry(const evPriorityScheduleEntry &priority_schedule);
54 
55  static evPriorityScheduleEntry *Create(const unsigned int roi,
56  const unsigned int tile,
57  const unsigned int component,
58  const unsigned int bitplane,
59  const unsigned int scale,
60  const unsigned int bitplane_length,
61  const double priority,
62  const evFilePosition file_position,
63  const evBoundingBox &bounding_box,
64  const double grid_spacing,
65  const unsigned int max_num_scales);
67  &priority_schedule_entry);
68  virtual ~evPriorityScheduleEntry(void);
69 
70  virtual const evString GetClassName(void) const
71  {
72  return(evString("evPriorityScheduleEntry"));
73  }
74 
75  int operator== (const evPriorityScheduleEntry &priority_schedule_entry)
76  const;
77  int IsEqual(const evPriorityScheduleEntry &priority_schedule_entry,
78  const unsigned int match_mask) const;
79 
80  void SetROI(const unsigned int roi);
81  unsigned int GetROI(void) const;
82 
83  void SetTile(const unsigned int tile);
84  unsigned int GetTile(void) const;
85 
86  void SetComponent(const unsigned int component);
87  unsigned int GetComponent(void) const;
88 
89  void SetBitplane(const unsigned int bitplane);
90  unsigned int GetBitplane(void) const;
91 
92  void SetScale(const unsigned int scale);
93  unsigned int GetScale(void) const;
94 
95  void SetBitplaneLength(const unsigned int bitplane_length);
96  unsigned int GetBitplaneLength(void) const;
97 
98  void SetPriority(const double priority);
99  double GetPriority(void) const;
100 
101  void SetFilePosition(const evFilePosition file_position);
102  evFilePosition GetFilePosition(void) const;
103 
104  void SetBoundingBox(const evBoundingBox &bounding_box);
105  evBoundingBox GetBoundingBox(void) const;
106 
107  void SetGridSpacing(const double grid_spacing);
108  double GetGridSpacing(void) const;
109 
110  void SetMaxNumScale(const unsigned int max_num_scales);
111  unsigned int GetMaxNumScales(void) const;
112 
113  void SetNext(evPriorityScheduleEntry *next);
114  evPriorityScheduleEntry *GetNext(void) const;
115 
116  void SetPrevious(evPriorityScheduleEntry *previous);
118 
119  static evPriorityScheduleEntry *Read(evBitBuffer &input_buffer,
120  const unsigned int num_dimensions);
121  int Write(evBitBuffer &output_buffer) const;
122 
123  unsigned int CalcDisplayScale(const double pixel_size) const;
124 
125  void PrintSelf(const int tabbing) const;
126 
127  protected:
128 
129  private:
130  unsigned int ROI;
131  unsigned int Tile;
132  unsigned int Component;
133  unsigned int Bitplane;
134  unsigned int Scale;
135  unsigned int BitplaneLength;
136  double Priority;
139  double GridSpacing;
140  unsigned int MaxNumScales;
143 };
144 
145 
146 inline
148  const unsigned int tile,
149  const unsigned int component,
150  const unsigned int bitplane,
151  const unsigned int scale,
152  const unsigned int
153  bitplane_length,
154  const double priority,
155  const evFilePosition
156  file_position,
157  const evBoundingBox
158  &bounding_box,
159  const double grid_spacing,
160  const unsigned int
161  max_num_scales) :
162  ROI(roi), Tile(tile), Component(component), Bitplane(bitplane), Scale(scale),
163  BitplaneLength(bitplane_length), Priority(priority),
164  FilePosition(file_position), BoundingBox(bounding_box),
165  GridSpacing(grid_spacing), MaxNumScales(max_num_scales),
166  Previous(NULL), Next(NULL)
167 { }
168 
169 
170 inline
172  &priority_schedule)
173 {
174  this->ROI = priority_schedule.ROI;
175  this->Tile = priority_schedule.Tile;
176  this->Component = priority_schedule.Component;
177  this->Bitplane = priority_schedule.Bitplane;
178  this->Scale = priority_schedule.Scale;
179  this->BitplaneLength = priority_schedule.BitplaneLength;
180  this->Priority = priority_schedule.Priority;
181  this->FilePosition = priority_schedule.FilePosition;
182  this->BoundingBox = priority_schedule.BoundingBox;
183  this->GridSpacing = priority_schedule.GridSpacing;
184  this->MaxNumScales = priority_schedule.MaxNumScales;
185  this->Next = NULL;
186  this->Previous = NULL;
187 }
188 
189 
191 *evPriorityScheduleEntry::Create(const unsigned int roi,
192  const unsigned int tile,
193  const unsigned int component,
194  const unsigned int bitplane,
195  const unsigned int scale,
196  const unsigned int bitplane_length,
197  const double priority,
198  const evFilePosition file_position,
199  const evBoundingBox &bounding_box,
200  const double grid_spacing,
201  const unsigned int max_num_scales)
202 {
203  return(new evPriorityScheduleEntry(roi,
204  tile,
205  component,
206  bitplane,
207  scale,
208  bitplane_length,
209  priority,
210  file_position,
211  bounding_box,
212  grid_spacing,
213  max_num_scales));
214 }
215 
216 
219  &priority_schedule_entry)
220 {
221  return(new evPriorityScheduleEntry(priority_schedule_entry));
222 }
223 
224 
226 {
227 }
228 
229 
231  &priority_schedule_entry) const
232 {
233  return((this->ROI == priority_schedule_entry.ROI) &&
234  (this->Tile == priority_schedule_entry.Tile) &&
235  (this->Component == priority_schedule_entry.Component) &&
236  (this->Bitplane == priority_schedule_entry.Bitplane) &&
237  (this->Scale == priority_schedule_entry.Scale));
238 }
239 
240 
242  &priority_schedule_entry,
243  const unsigned int match_mask) const
244 {
245  return(((!(match_mask & EVPRIORITYSCHEDULEENTRY_ROI)) ||
246  (this->ROI == priority_schedule_entry.ROI)) &&
247  ((!(match_mask & EVPRIORITYSCHEDULEENTRY_TILE)) ||
248  (this->Tile == priority_schedule_entry.Tile)) &&
249  ((!(match_mask & EVPRIORITYSCHEDULEENTRY_COMPONENT)) ||
250  (this->Component == priority_schedule_entry.Component)) &&
251  ((!(match_mask & EVPRIORITYSCHEDULEENTRY_BITPLANE)) ||
252  (this->Bitplane == priority_schedule_entry.Bitplane)) &&
253  ((!(match_mask & EVPRIORITYSCHEDULEENTRY_SCALE)) ||
254  (this->Scale == priority_schedule_entry.Scale)));
255 }
256 
257 
258 inline void evPriorityScheduleEntry::SetROI(const unsigned int roi)
259 {
260  this->ROI = roi;
261 }
262 
263 
264 inline unsigned int evPriorityScheduleEntry::GetROI(void) const
265 {
266  return(this->ROI);
267 }
268 
269 
270 inline void evPriorityScheduleEntry::SetTile(const unsigned int tile)
271 {
272  this->Tile = tile;
273 }
274 
275 
276 inline unsigned int evPriorityScheduleEntry::GetTile(void) const
277 {
278  return(this->Tile);
279 }
280 
281 
282 inline void evPriorityScheduleEntry::SetComponent(const unsigned int component)
283 {
284  this->Component = component;
285 }
286 
287 
288 inline unsigned int evPriorityScheduleEntry::GetComponent(void) const
289 {
290  return(this->Component);
291 }
292 
293 
294 inline void evPriorityScheduleEntry::SetBitplane(const unsigned int bitplane)
295 {
296  this->Bitplane = bitplane;
297 }
298 
299 
300 inline unsigned int evPriorityScheduleEntry::GetBitplane(void) const
301 {
302  return(this->Bitplane);
303 }
304 
305 
306 inline void evPriorityScheduleEntry::SetScale(const unsigned int scale)
307 {
308  this->Scale = scale;
309 }
310 
311 
312 inline unsigned int evPriorityScheduleEntry::GetScale(void) const
313 {
314  return(this->Scale);
315 }
316 
317 
318 inline void evPriorityScheduleEntry::SetBitplaneLength(const unsigned int
319  bitplane_length)
320 {
321  this->BitplaneLength = bitplane_length;
322 }
323 
324 
325 inline unsigned int evPriorityScheduleEntry::GetBitplaneLength(void) const
326 {
327  return(this->BitplaneLength);
328 }
329 
330 
331 inline void evPriorityScheduleEntry::SetPriority(const double priority)
332 {
333  this->Priority = priority;
334 }
335 
336 
337 inline double evPriorityScheduleEntry::GetPriority(void) const
338 {
339  return(this->Priority);
340 }
341 
342 
344  file_position)
345 {
346  this->FilePosition = file_position;
347 }
348 
349 
351 {
352  return(this->FilePosition);
353 }
354 
355 
357  &bounding_box)
358 {
359  this->BoundingBox = bounding_box;
360 }
361 
362 
364 {
365  return(this->BoundingBox);
366 }
367 
368 
369 inline void evPriorityScheduleEntry::SetMaxNumScale(const unsigned int
370  max_num_scales)
371 {
372  this->MaxNumScales = max_num_scales;
373 }
374 
375 
376 inline unsigned int evPriorityScheduleEntry::GetMaxNumScales(void) const
377 {
378  return(this->MaxNumScales);
379 }
380 
381 
383 {
384  this->Next = next;
385 }
386 
387 
389 {
390  return(this->Next);
391 }
392 
393 
395  *previous)
396 {
397  this->Previous = previous;
398 }
399 
400 
402  const
403 {
404  return(this->Previous);
405 }
406 
407 
408 #endif
void SetPrevious(evPriorityScheduleEntry *previous)
Definition: evPriorityScheduleEntry.h:394
void SetPriority(const double priority)
Definition: evPriorityScheduleEntry.h:331
#define EVPRIORITYSCHEDULEENTRY_COMPONENT
Definition: evPriorityScheduleEntry.h:34
void SetNext(evPriorityScheduleEntry *next)
Definition: evPriorityScheduleEntry.h:382
virtual const evString GetClassName(void) const
Definition: evPriorityScheduleEntry.h:70
double GridSpacing
Definition: evPriorityScheduleEntry.h:139
void SetBoundingBox(const evBoundingBox &bounding_box)
Definition: evPriorityScheduleEntry.h:356
long evFilePosition
Definition: evFile.h:41
evBoundingBox BoundingBox
Definition: evPriorityScheduleEntry.h:138
void SetBitplane(const unsigned int bitplane)
Definition: evPriorityScheduleEntry.h:294
unsigned int GetBitplaneLength(void) const
Definition: evPriorityScheduleEntry.h:325
void SetScale(const unsigned int scale)
Definition: evPriorityScheduleEntry.h:306
int IsEqual(const evPriorityScheduleEntry &priority_schedule_entry, const unsigned int match_mask) const
Definition: evPriorityScheduleEntry.h:241
evFilePosition GetFilePosition(void) const
Definition: evPriorityScheduleEntry.h:350
Definition: evPriorityScheduleEntry.h:39
static evPriorityScheduleEntry * Create(const unsigned int roi, const unsigned int tile, const unsigned int component, const unsigned int bitplane, const unsigned int scale, const unsigned int bitplane_length, const double priority, const evFilePosition file_position, const evBoundingBox &bounding_box, const double grid_spacing, const unsigned int max_num_scales)
Definition: evPriorityScheduleEntry.h:191
#define EVPRIORITYSCHEDULEENTRY_TILE
Definition: evPriorityScheduleEntry.h:33
void SetROI(const unsigned int roi)
Definition: evPriorityScheduleEntry.h:258
void SetTile(const unsigned int tile)
Definition: evPriorityScheduleEntry.h:270
Definition: evBoundingBox.h:32
evPriorityScheduleEntry * GetPrevious(void) const
Definition: evPriorityScheduleEntry.h:401
unsigned int GetTile(void) const
Definition: evPriorityScheduleEntry.h:276
Definition: evDataObject.h:31
unsigned int ROI
Definition: evPriorityScheduleEntry.h:130
unsigned int GetScale(void) const
Definition: evPriorityScheduleEntry.h:312
void SetComponent(const unsigned int component)
Definition: evPriorityScheduleEntry.h:282
void SetMaxNumScale(const unsigned int max_num_scales)
Definition: evPriorityScheduleEntry.h:369
unsigned int Tile
Definition: evPriorityScheduleEntry.h:131
unsigned int Component
Definition: evPriorityScheduleEntry.h:132
void SetBitplaneLength(const unsigned int bitplane_length)
Definition: evPriorityScheduleEntry.h:318
double GetPriority(void) const
Definition: evPriorityScheduleEntry.h:337
evPriorityScheduleEntry(const unsigned int roi=0, const unsigned int tile=0, const unsigned int component=0, const unsigned int bitplane=0, const unsigned int scale=0, const unsigned int bitplane_length=0, const double priority=0, const evFilePosition file_position=0, const evBoundingBox &bounding_box=evBoundingBox(), const double grid_spacing=0, const unsigned int max_num_scales=0)
Definition: evPriorityScheduleEntry.h:147
evFilePosition FilePosition
Definition: evPriorityScheduleEntry.h:137
Definition: evBitBuffer.h:34
unsigned int GetComponent(void) const
Definition: evPriorityScheduleEntry.h:288
static evPriorityScheduleEntry * Read(evBitBuffer &input_buffer, const unsigned int num_dimensions)
void SetGridSpacing(const double grid_spacing)
double GetGridSpacing(void) const
int operator==(const evPriorityScheduleEntry &priority_schedule_entry) const
Definition: evPriorityScheduleEntry.h:230
#define EVPRIORITYSCHEDULEENTRY_SCALE
Definition: evPriorityScheduleEntry.h:36
int Write(evBitBuffer &output_buffer) const
double Priority
Definition: evPriorityScheduleEntry.h:136
virtual ~evPriorityScheduleEntry(void)
Definition: evPriorityScheduleEntry.h:225
unsigned int Bitplane
Definition: evPriorityScheduleEntry.h:133
unsigned int GetROI(void) const
Definition: evPriorityScheduleEntry.h:264
#define EVPRIORITYSCHEDULEENTRY_BITPLANE
Definition: evPriorityScheduleEntry.h:35
unsigned int CalcDisplayScale(const double pixel_size) const
evPriorityScheduleEntry * GetNext(void) const
Definition: evPriorityScheduleEntry.h:388
evBoundingBox GetBoundingBox(void) const
Definition: evPriorityScheduleEntry.h:363
unsigned int BitplaneLength
Definition: evPriorityScheduleEntry.h:135
evPriorityScheduleEntry * Next
Definition: evPriorityScheduleEntry.h:142
unsigned int Scale
Definition: evPriorityScheduleEntry.h:134
unsigned int GetMaxNumScales(void) const
Definition: evPriorityScheduleEntry.h:376
void PrintSelf(const int tabbing) const
Definition: evString.h:30
#define EVPRIORITYSCHEDULEENTRY_ROI
Definition: evPriorityScheduleEntry.h:32
void SetFilePosition(const evFilePosition file_position)
Definition: evPriorityScheduleEntry.h:343
unsigned int GetBitplane(void) const
Definition: evPriorityScheduleEntry.h:300
unsigned int MaxNumScales
Definition: evPriorityScheduleEntry.h:140
evPriorityScheduleEntry * Previous
Definition: evPriorityScheduleEntry.h:141