vtkCompositePropertyDecorator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef vtkCompositePropertyDecorator_h
5 #define vtkCompositePropertyDecorator_h
6 
7 #include "vtkPropertyDecorator.h"
9 
10 #include <memory> // for std::unique_ptr
11 
52  : public vtkPropertyDecorator
53 {
54 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
59  void Initialize(vtkPVXMLElement* config, vtkSMProxy* proxy) override;
60 
61  bool CanShow(bool show_advanced) const override;
62  bool Enable() const override;
63 
64  /*
65  * @brief Register a new decorator
66  *
67  * When vtkCompositePropertyDecorator iterates its Expresssion it tries to
68  * create a vtkPropertyDecorator of "type" as described in its XML hint. By
69  * defasult it calls vtkPropertyDecorator::Create . If that function returns
70  * nullptr it will try to use any of the functions registered via
71  * RegisterDecorator. This ability allows us to handle new types of
72  * decorators dynamically which can appear via plugins. Currently this
73  * ability is used by pqCompositePropertyWidgetDecorator which is the comsumer
74  * of this class
75  * @{{
76  */
78  std::function<vtkSmartPointer<vtkPropertyDecorator>(vtkPVXMLElement*, vtkSMProxy*)>;
79  void RegisterDecorator(DecoratorCreationFunction func);
80  /*
81  * @}}
82  */
83 protected:
86 
87 private:
89  void operator=(const vtkCompositePropertyDecorator&) = delete;
90 
91  class vtkInternals;
92  std::unique_ptr<vtkInternals> Internals;
93 };
94 
95 #endif
std::function< vtkSmartPointer< vtkPropertyDecorator >(vtkPVXMLElement *, vtkSMProxy *)> DecoratorCreationFunction
virtual void Initialize(vtkPVXMLElement *xml, vtkSMProxy *proxy)
Constructor.
void PrintSelf(ostream &os, vtkIndent indent) override
#define VTKREMOTINGAPPLICATIONCOMPONENTS_EXPORT
static vtkPropertyDecorator * New()
vtkPropertyDecorator hold the logic of pqPropertyDecorator TODO provides a mechanism to decorate pqPr...
virtual bool CanShow(bool show_advanced) const
Override this method to override the visibility of the widget in the panel.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
virtual bool Enable() const
Override this method to override the enable state of the widget in the panel.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
vtkPropertyDecorator subclass that can combine multiple decorators using boolean operations.