VTK  9.3.0
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
41 #ifndef vtkPLYReader_h
42 #define vtkPLYReader_h
43 
45 #include "vtkIOPLYModule.h" // For export macro
46 #include "vtkResourceStream.h" // For vtkResourceStream
47 
48 VTK_ABI_NAMESPACE_BEGIN
49 class vtkStringArray;
50 
51 class VTKIOPLY_EXPORT vtkPLYReader : public vtkAbstractPolyDataReader
52 {
53 public:
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
60  static vtkPLYReader* New();
61 
65  static int CanReadFile(VTK_FILEPATH const char* filename);
66 
67  vtkGetObjectMacro(Comments, vtkStringArray);
68 
73  vtkGetMacro(FaceTextureTolerance, float);
74  vtkSetMacro(FaceTextureTolerance, float);
75 
77 
85  vtkSetMacro(ReadFromInputString, bool);
86  vtkGetMacro(ReadFromInputString, bool);
87  vtkBooleanMacro(ReadFromInputString, bool);
88  void SetInputString(const std::string& s) { this->InputString = s; }
90 
92 
98 
100 
104  vtkSetMacro(ReadFromInputStream, bool);
105  vtkGetMacro(ReadFromInputStream, bool);
106  vtkBooleanMacro(ReadFromInputStream, bool);
108 
115  vtkGetMacro(DuplicatePointsForFaceTexture, bool);
116  vtkSetMacro(DuplicatePointsForFaceTexture, bool);
117 
118 protected:
120  ~vtkPLYReader() override;
121 
123  // Whether this object is reading from a string or a file.
124  // Default is 0: read from file.
126  // The input string.
128 
129  bool ReadFromInputStream = false;
131 
133 
134 private:
135  vtkPLYReader(const vtkPLYReader&) = delete;
136  void operator=(const vtkPLYReader&) = delete;
137 
138  float FaceTextureTolerance;
139  bool DuplicatePointsForFaceTexture;
140 };
141 
142 VTK_ABI_NAMESPACE_END
143 #endif
Superclass for algorithms that read models from a file.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
read Stanford University PLY polygonal file format
Definition: vtkPLYReader.h:52
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:127
vtkStringArray * Comments
Definition: vtkPLYReader.h:122
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:88
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:125
vtkSmartPointer< vtkResourceStream > Stream
Definition: vtkPLYReader.h:130
Abstract class used for custom streams.
a vtkAbstractArray subclass for strings
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH