File: vtkKWHistogramSet.h

package info (click to toggle)
kwwidgets 1.0.0~cvs20090825-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 14,108 kB
  • ctags: 15,770
  • sloc: cpp: 128,146; ansic: 44,137; tcl: 30,595; python: 2,283; sh: 338; makefile: 69; xml: 10
file content (107 lines) | stat: -rw-r--r-- 3,901 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*=========================================================================

  Module:    $RCSfile: vtkKWHistogramSet.h,v $

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkKWHistogramSet - a set of histograms
// .SECTION Description
// A set of histograms.

#ifndef __vtkKWHistogramSet_h
#define __vtkKWHistogramSet_h

#include "vtkObject.h"
#include "vtkKWWidgets.h" // Needed for export symbols directives

class vtkDataArray;
class vtkKWHistogram;
class vtkKWHistogramCallback;
class vtkKWHistogramSetInternals;

class KWWidgets_EXPORT vtkKWHistogramSet : public vtkObject
{
public:
  static vtkKWHistogramSet* New();
  vtkTypeRevisionMacro(vtkKWHistogramSet,vtkObject);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Add an histogram to the pool under a given name. 
  // Return 1 on success, 0 otherwise.
  virtual int AddHistogram(vtkKWHistogram*, const char *name);

  // Description:
  // Allocate an histogram and add it in the pool under a given name. 
  // Return a pointer to the new histogram on success, NULL otherwise.
  virtual vtkKWHistogram* AllocateAndAddHistogram(const char *name);

  // Description:
  // Get the number of histogram in the pool
  virtual int GetNumberOfHistograms();

  // Description:
  // Retrieve an histogram (or its name) from the pool.
  virtual vtkKWHistogram* GetHistogramWithName(const char *name);
  virtual const char* GetHistogramName(vtkKWHistogram *hist);
  virtual vtkKWHistogram* GetNthHistogram(int index);

  // Description:
  // Query if the pool has a given histogram
  virtual int HasHistogramWithName(const char *name);
  virtual int HasHistogram(vtkKWHistogram *hist);

  // Description:
  // Remove one or all histograms. 
  // Return 1 on success, 0 otherwise.
  virtual int RemoveHistogramWithName(const char *name);
  virtual int RemoveHistogram(vtkKWHistogram *hist);
  virtual void RemoveAllHistograms();

  // Description:
  // The histogram set class is designed to share histogram between several
  // classes in an application. As such, since histogram are retrieved by
  // names, it makes sense to follow some naming guidelines. This method
  // provides such a guideline by computing an histogram name given the 
  // name of the array this histogram will be built upon, the component
  // that will be used in that array, and an optional tag.
  // The histogram name is stored in 'buffer', which should be large enough.
  // Return 1 on success, 0 otherwise.
  static int ComputeHistogramName(
    const char *array_name, int comp, const char *tag, char *buffer);

  // Description:
  // Allocate, add and build histograms for all components of a scalar array.
  // Each histogram name is built by calling ComputeHistogramName with
  // the scalar array, component index and 'tag' arguments.
  // The 'skip_components_mask' is a binary mask specifying which component
  // should be skipped (i.e., if the n-th bit in that mask is set, then the
  // histogram for that n-th component will not be considered)
  // Return 1 on success, 0 otherwise.
  virtual int AddHistograms(vtkDataArray *array, 
                            const char *tag = NULL, 
                            int skip_components_mask = 0);

protected:
  vtkKWHistogramSet();
  ~vtkKWHistogramSet();

  //BTX
  // PIMPL Encapsulation for STL containers
  vtkKWHistogramSetInternals *Internals;
  //ETX

private:
  vtkKWHistogramSet(const vtkKWHistogramSet&); // Not implemented
  void operator=(const vtkKWHistogramSet&); // Not implemented
};

#endif