VTK  9.3.20240327
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
141 #ifndef vtkPLYReader_h
142 #define vtkPLYReader_h
143 
145 #include "vtkIOPLYModule.h" // For export macro
146 #include "vtkResourceStream.h" // For vtkResourceStream
147 
148 VTK_ABI_NAMESPACE_BEGIN
149 class vtkStringArray;
150 
151 class VTKIOPLY_EXPORT vtkPLYReader : public vtkAbstractPolyDataReader
152 {
153 public:
155  void PrintSelf(ostream& os, vtkIndent indent) override;
156 
160  static vtkPLYReader* New();
161 
165  static int CanReadFile(VTK_FILEPATH const char* filename);
166 
167  vtkGetObjectMacro(Comments, vtkStringArray);
168 
173  vtkGetMacro(FaceTextureTolerance, float);
174  vtkSetMacro(FaceTextureTolerance, float);
175 
177 
185  vtkSetMacro(ReadFromInputString, bool);
186  vtkGetMacro(ReadFromInputString, bool);
187  vtkBooleanMacro(ReadFromInputString, bool);
188  void SetInputString(const std::string& s) { this->InputString = s; }
190 
192 
198 
200 
204  vtkSetMacro(ReadFromInputStream, bool);
205  vtkGetMacro(ReadFromInputStream, bool);
206  vtkBooleanMacro(ReadFromInputStream, bool);
208 
215  vtkGetMacro(DuplicatePointsForFaceTexture, bool);
216  vtkSetMacro(DuplicatePointsForFaceTexture, bool);
217 
218 protected:
220  ~vtkPLYReader() override;
221 
223  // Whether this object is reading from a string or a file.
224  // Default is 0: read from file.
226  // The input string.
228 
229  bool ReadFromInputStream = false;
231 
233 
234 private:
235  vtkPLYReader(const vtkPLYReader&) = delete;
236  void operator=(const vtkPLYReader&) = delete;
237 
238  float FaceTextureTolerance;
239  bool DuplicatePointsForFaceTexture;
240 };
241 
242 VTK_ABI_NAMESPACE_END
243 #endif
Superclass for algorithms that read models from a file.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
read Stanford University PLY polygonal file format
Definition: vtkPLYReader.h:152
vtkSetSmartPointerMacro(Stream, vtkResourceStream)
Specify stream to read from.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
~vtkPLYReader() override
std::string InputString
Definition: vtkPLYReader.h:227
vtkStringArray * Comments
Definition: vtkPLYReader.h:222
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkPLYReader * New()
Construct object with merging set to true.
void SetInputString(const std::string &s)
Enable reading from an InputString instead of the default, a file.
Definition: vtkPLYReader.h:188
static int CanReadFile(VTK_FILEPATH const char *filename)
A simple, non-exhaustive check to see if a file is a valid ply file.
vtkGetSmartPointerMacro(Stream, vtkResourceStream)
Specify stream to read from.
bool ReadFromInputString
Definition: vtkPLYReader.h:225
vtkSmartPointer< vtkResourceStream > Stream
Definition: vtkPLYReader.h:230
Abstract class used for custom streams.
a vtkAbstractArray subclass for strings
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH