vtkSMDataTypeDomain.h 2.77 KB
Newer Older
Berk Geveci's avatar
Berk Geveci committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*=========================================================================

  Program:   ParaView
  Module:    vtkSMDataTypeDomain.h

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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.

=========================================================================*/
Berk Geveci's avatar
Berk Geveci committed
15
// .NAME vtkSMDataTypeDomain - restricts the input proxies to one or more data types
Berk Geveci's avatar
Berk Geveci committed
16
// .SECTION Description
Berk Geveci's avatar
Berk Geveci committed
17 18 19 20
// vtkSMDataTypeDomain restricts the input proxies to one or more data types.
// These data types are specified in the XML with the <DataType> element.
// VTK class names are used. It is possible to specify a superclass
// (i.e. vtkDataSet) for a more general domain. Works with vtkSMSourceProxy
Berk Geveci's avatar
Berk Geveci committed
21 22 23 24 25
// only. Valid XML elements are:
// @verbatim
// * <DataType value=""> where value is the classname for the data type
// for example: vtkDataSet, vtkImageData,...
// @endverbatim
Berk Geveci's avatar
Berk Geveci committed
26
// .SECTION See Also
Berk Geveci's avatar
Berk Geveci committed
27
// vtkSMDomain  vtkSMSourceProxy
Berk Geveci's avatar
Berk Geveci committed
28 29 30 31 32 33 34 35

#ifndef __vtkSMDataTypeDomain_h
#define __vtkSMDataTypeDomain_h

#include "vtkSMDomain.h"

class vtkSMSourceProxy;
//BTX
Sebastien Jourdain's avatar
Sebastien Jourdain committed
36
struct vtkSMDataTypeDomainInternals;
Berk Geveci's avatar
Berk Geveci committed
37 38 39 40 41 42
//ETX

class VTK_EXPORT vtkSMDataTypeDomain : public vtkSMDomain
{
public:
  static vtkSMDataTypeDomain* New();
43
  vtkTypeMacro(vtkSMDataTypeDomain, vtkSMDomain);
Berk Geveci's avatar
Berk Geveci committed
44 45 46 47 48 49 50 51 52 53 54
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Returns true if the value of the propery is in the domain.
  // The propery has to be a vtkSMProxyProperty which points
  // to a vtkSMSourceProxy. If all data types of the input's
  // parts are in the domain, it returns. It returns 0 otherwise.
  virtual int IsInDomain(vtkSMProperty* property);

  // Description:
  // Returns true if all parts of the source proxy are in the domain.
55
  int IsInDomain(vtkSMSourceProxy* proxy, int outputport=0);
Berk Geveci's avatar
Berk Geveci committed
56 57

  // Description:
Berk Geveci's avatar
Berk Geveci committed
58
  // Returns the number of acceptable data types.
Berk Geveci's avatar
Berk Geveci committed
59 60 61
  unsigned int GetNumberOfDataTypes();

  // Description:
Berk Geveci's avatar
Berk Geveci committed
62
  // Returns a data type.
Berk Geveci's avatar
Berk Geveci committed
63 64
  const char* GetDataType(unsigned int idx);

65
//BTX
Berk Geveci's avatar
Berk Geveci committed
66 67 68 69 70 71 72 73 74 75 76
protected:
  vtkSMDataTypeDomain();
  ~vtkSMDataTypeDomain();

  // Description:
  // Set the appropriate ivars from the xml element. Should
  // be overwritten by subclass if adding ivars.
  virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element);

  vtkSMDataTypeDomainInternals* DTInternals;

77 78 79 80
  int CompositeDataSupported;
  vtkSetMacro(CompositeDataSupported, int);
  vtkGetMacro(CompositeDataSupported, int);

Berk Geveci's avatar
Berk Geveci committed
81 82 83
private:
  vtkSMDataTypeDomain(const vtkSMDataTypeDomain&); // Not implemented
  void operator=(const vtkSMDataTypeDomain&); // Not implemented
84
//ETX
Berk Geveci's avatar
Berk Geveci committed
85 86 87
};

#endif