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
|
/*=========================================================================
Program: ParaView
Module: $RCSfile$
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.
=========================================================================*/
/**
* @class vtkSMRepresentedArrayListDomain
* @brief extends vtkSMArrayListDomain to add
* support for arrays from represented data information.
*
* Representations often add new arrays on top of the ones provided by the
* inputs to the representations. In that case, the domains for properties that
* allow users to pick one of those newly added arrays need to show those
* arrays e.g. "ColorArrayName" property of geometry representations. This
* domain extends vtkSMArrayListDomain to add arrays from represented data
* for representations.
*/
#ifndef vtkSMRepresentedArrayListDomain_h
#define vtkSMRepresentedArrayListDomain_h
#include "vtkPVServerManagerRenderingModule.h" //needed for exports
#include "vtkSMArrayListDomain.h"
#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
class vtkSMRepresentationProxy;
class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMRepresentedArrayListDomain
: public vtkSMArrayListDomain
{
public:
static vtkSMRepresentedArrayListDomain* New();
vtkTypeMacro(vtkSMRepresentedArrayListDomain, vtkSMArrayListDomain);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Update the domain.
*/
virtual void Update(vtkSMProperty*) VTK_OVERRIDE;
//@{
/**
* Set this to true (default) to let this domain use the
* represented-data-information from the outer most representation proxy.
* This ensures that for composite representations where user is provided with
* a selection between multiple representations, the represented array list
* domain fills its values up based on the currently active representation
* type, rather than the representation subproxy from which the property was
* exposed.
* In XML, use 'use_true_parent' attribute on the domain element to set this
* value.
*/
vtkGetMacro(UseTrueParentForRepresentatedDataInformation, bool);
//@}
protected:
vtkSMRepresentedArrayListDomain();
~vtkSMRepresentedArrayListDomain();
/**
* Overridden to process "use_true_parent".
*/
virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem) VTK_OVERRIDE;
/**
* Returns true if an array should be filtered out based on its name or number
* of tuples (for field data arrays).
* This implementation returns true if the array name matches
* an expression in the vtkPVColorArrayListSettings singleton.
*/
virtual bool IsFilteredArray(
vtkPVDataInformation* info, int association, const char* arrayName) VTK_OVERRIDE;
/**
* HACK: Provides a temporary mechanism for subclasses to provide an
* "additional" vtkPVDataInformation instance to get available arrays list
* from.
*/
virtual vtkPVDataInformation* GetExtraDataInformation() VTK_OVERRIDE;
void SetRepresentationProxy(vtkSMRepresentationProxy*);
void OnRepresentationDataUpdated();
vtkWeakPointer<vtkSMRepresentationProxy> RepresentationProxy;
unsigned long ObserverId;
vtkSetMacro(UseTrueParentForRepresentatedDataInformation, bool);
bool UseTrueParentForRepresentatedDataInformation;
private:
vtkSMRepresentedArrayListDomain(const vtkSMRepresentedArrayListDomain&) VTK_DELETE_FUNCTION;
void operator=(const vtkSMRepresentedArrayListDomain&) VTK_DELETE_FUNCTION;
};
#endif
|