VTK  9.3.20240425
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
148VTK_ABI_NAMESPACE_BEGIN
149class vtkStringArray;
150
151class VTKIOPLY_EXPORT vtkPLYReader : public vtkAbstractPolyDataReader
152{
153public:
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
218protected:
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.
227 std::string InputString;
228
229 bool ReadFromInputStream = false;
231
233
234private:
235 vtkPLYReader(const vtkPLYReader&) = delete;
236 void operator=(const vtkPLYReader&) = delete;
237
238 float FaceTextureTolerance;
239 bool DuplicatePointsForFaceTexture;
240};
241
242VTK_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
vtkSetSmartPointerMacro(Stream, vtkResourceStream)
Specify stream to read from.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkPLYReader * New()
Construct object with merging set to true.
~vtkPLYReader() override
std::string InputString
vtkStringArray * Comments
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetInputString(const std::string &s)
Enable reading from an InputString instead of the default, a file.
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
vtkSmartPointer< vtkResourceStream > Stream
Abstract class used for custom streams.
Hold a reference to a vtkObjectBase instance.
a vtkAbstractArray subclass for strings
#define VTK_FILEPATH