KWWidgets
debian/tmp/usr/include/KWWidgets/vtkKWHistogramSet.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Module: $RCSfile: vtkKWHistogramSet.h,v $
4 
5  Copyright (c) Kitware, Inc.
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 // .NAME vtkKWHistogramSet - a set of histograms
15 // .SECTION Description
16 // A set of histograms.
17 
18 #ifndef __vtkKWHistogramSet_h
19 #define __vtkKWHistogramSet_h
20 
21 #include "vtkObject.h"
22 #include "vtkKWWidgets.h" // Needed for export symbols directives
23 
24 class vtkDataArray;
25 class vtkKWHistogram;
26 class vtkKWHistogramCallback;
27 class vtkKWHistogramSetInternals;
28 
29 class KWWidgets_EXPORT vtkKWHistogramSet : public vtkObject
30 {
31 public:
32  static vtkKWHistogramSet* New();
33  vtkTypeRevisionMacro(vtkKWHistogramSet,vtkObject);
34  void PrintSelf(ostream& os, vtkIndent indent);
35 
36  // Description:
37  // Add an histogram to the pool under a given name.
38  // Return 1 on success, 0 otherwise.
39  virtual int AddHistogram(vtkKWHistogram*, const char *name);
40 
41  // Description:
42  // Allocate an histogram and add it in the pool under a given name.
43  // Return a pointer to the new histogram on success, NULL otherwise.
44  virtual vtkKWHistogram* AllocateAndAddHistogram(const char *name);
45 
46  // Description:
47  // Get the number of histogram in the pool
48  virtual int GetNumberOfHistograms();
49 
50  // Description:
51  // Retrieve an histogram (or its name) from the pool.
52  virtual vtkKWHistogram* GetHistogramWithName(const char *name);
53  virtual const char* GetHistogramName(vtkKWHistogram *hist);
54  virtual vtkKWHistogram* GetNthHistogram(int index);
55 
56  // Description:
57  // Query if the pool has a given histogram
58  virtual int HasHistogramWithName(const char *name);
59  virtual int HasHistogram(vtkKWHistogram *hist);
60 
61  // Description:
62  // Remove one or all histograms.
63  // Return 1 on success, 0 otherwise.
64  virtual int RemoveHistogramWithName(const char *name);
65  virtual int RemoveHistogram(vtkKWHistogram *hist);
66  virtual void RemoveAllHistograms();
67 
68  // Description:
69  // The histogram set class is designed to share histogram between several
70  // classes in an application. As such, since histogram are retrieved by
71  // names, it makes sense to follow some naming guidelines. This method
72  // provides such a guideline by computing an histogram name given the
73  // name of the array this histogram will be built upon, the component
74  // that will be used in that array, and an optional tag.
75  // The histogram name is stored in 'buffer', which should be large enough.
76  // Return 1 on success, 0 otherwise.
77  static int ComputeHistogramName(
78  const char *array_name, int comp, const char *tag, char *buffer);
79 
80  // Description:
81  // Allocate, add and build histograms for all components of a scalar array.
82  // Each histogram name is built by calling ComputeHistogramName with
83  // the scalar array, component index and 'tag' arguments.
84  // The 'skip_components_mask' is a binary mask specifying which component
85  // should be skipped (i.e., if the n-th bit in that mask is set, then the
86  // histogram for that n-th component will not be considered)
87  // Return 1 on success, 0 otherwise.
88  virtual int AddHistograms(vtkDataArray *array,
89  const char *tag = NULL,
90  int skip_components_mask = 0);
91 
92 protected:
95 
96  //BTX
97  // PIMPL Encapsulation for STL containers
98  vtkKWHistogramSetInternals *Internals;
99  //ETX
100 
101 private:
102  vtkKWHistogramSet(const vtkKWHistogramSet&); // Not implemented
103  void operator=(const vtkKWHistogramSet&); // Not implemented
104 };
105 
106 #endif
107