ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkCommandOptionsXMLParser.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "qPCL.h" // needed for export macro
11 #include "vtkCommandOptions.h" // for enum
12 #include "vtkXMLParser.h"
13 
14 class vtkCommandOptionsXMLParserInternal;
15 class vtkCommandOptions;
16 
17 class QPCL_ENGINE_LIB_API vtkCommandOptionsXMLParser : public vtkXMLParser {
18 public:
21  void PrintSelf(ostream& os, vtkIndent indent) override;
22 
24 
29  void AddBooleanArgument(const char* longarg, int* var, int type = 0);
30  void AddArgument(const char* longarg, int* var, int type = 0);
31  void AddArgument(const char* longarg, char** var, int type = 0);
32  void SetPVOptions(vtkCommandOptions* o) { this->PVOptions = o; }
33 
34 protected:
36 
40 
44  ~vtkCommandOptionsXMLParser() override;
45 
46  // Called when a new element is opened in the XML source. Should be
47  // replaced by subclasses to handle each element.
48  // name = Name of new element.
49  // atts = Null-terminated array of attribute name/value pairs.
50  // Even indices are attribute names, and odd indices are values.
51  void StartElement(const char* name, const char** atts) override;
52 
53  // Called at the end of an element in the XML source opened when
54  // StartElement was called.
55  void EndElement(const char* name) override;
56  // Call to process the .. of <Option>...</>
57  void HandleOption(const char** atts);
58  // Call to process the .. of <Option>...</>
59  void HandleProcessType(const char** atts);
60 
61  virtual void SetProcessType(const char* ptype);
62  void SetProcessTypeInt(int ptype);
63 
64 private:
66  void operator=(const vtkCommandOptionsXMLParser&) = delete;
67  int InPVXTag;
68  vtkCommandOptions* PVOptions;
69  vtkCommandOptionsXMLParserInternal* Internals;
70 };
std::string name
char type
void SetPVOptions(vtkCommandOptions *o)
vtkTypeMacro(vtkCommandOptionsXMLParser, vtkXMLParser)
static vtkCommandOptionsXMLParser * New()
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15