VTK  9.7.1
vtkPLYReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
38 #ifndef vtkPLYReader_h
39 #define vtkPLYReader_h
40 
42 #include "vtkIOPLYModule.h" // For export macro
43 #include "vtkResourceStream.h" // For vtkResourceStream
44 
45 VTK_ABI_NAMESPACE_BEGIN
46 class vtkStringArray;
47 
48 class VTKIOPLY_EXPORT vtkPLYReader : public vtkAbstractPolyDataReader
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  static vtkPLYReader* New();
58 
60 
65  static vtkTypeBool CanReadFile(VTK_FILEPATH const char* filename);
66  static bool CanReadFile(vtkResourceStream* stream);
68 
69  vtkGetObjectMacro(Comments, vtkStringArray);
70 
75  vtkGetMacro(FaceTextureTolerance, float);
76  vtkSetMacro(FaceTextureTolerance, float);
77 
79 
87  vtkSetMacro(ReadFromInputString, bool);
88  vtkGetMacro(ReadFromInputString, bool);
89  vtkBooleanMacro(ReadFromInputString, bool);
90  void SetInputString(const std::string& s) { this->InputString = s; }
92 
94 
98  vtkSetMacro(ReadFromInputStream, bool);
99  vtkGetMacro(ReadFromInputStream, bool);
100  vtkBooleanMacro(ReadFromInputStream, bool);
102 
109  vtkGetMacro(DuplicatePointsForFaceTexture, bool);
110  vtkSetMacro(DuplicatePointsForFaceTexture, bool);
111 
112 protected:
113  vtkPLYReader();
114  ~vtkPLYReader() override;
115 
117  // Whether this object is reading from a string or a file.
118  // Default is 0: read from file.
120  // The input string.
122 
123  bool ReadFromInputStream = false;
124 
126 
127 private:
128  vtkPLYReader(const vtkPLYReader&) = delete;
129  void operator=(const vtkPLYReader&) = delete;
130 
131  float FaceTextureTolerance;
132  bool DuplicatePointsForFaceTexture;
133 };
134 
135 VTK_ABI_NAMESPACE_END
136 #endif
Abstract class used for custom streams.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkStringArray * Comments
Definition: vtkPLYReader.h:116
a vtkAbstractArray subclass for strings
bool ReadFromInputString
Definition: vtkPLYReader.h:119
void SetInputString(const std::string &s)
Enable reading from an InputString instead of the default, a file.
Definition: vtkPLYReader.h:90
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
Superclass for algorithms that read models from a file.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_FILEPATH
read Stanford University PLY polygonal file format
Definition: vtkPLYReader.h:48
std::string InputString
Definition: vtkPLYReader.h:121
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.