VTK  9.3.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
32 #ifndef vtkPLYReader_h
33 #define vtkPLYReader_h
34 
36 #include "vtkIOPLYModule.h" // For export macro
37 #include "vtkResourceStream.h" // For vtkResourceStream
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkStringArray;
41 
42 class VTKIOPLY_EXPORT vtkPLYReader : public vtkAbstractPolyDataReader
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  static vtkPLYReader* New();
52 
56  static int CanReadFile(VTK_FILEPATH const char* filename);
57 
58  vtkGetObjectMacro(Comments, vtkStringArray);
59 
64  vtkGetMacro(FaceTextureTolerance, float);
65  vtkSetMacro(FaceTextureTolerance, float);
66 
68 
76  vtkSetMacro(ReadFromInputString, bool);
77  vtkGetMacro(ReadFromInputString, bool);
78  vtkBooleanMacro(ReadFromInputString, bool);
79  void SetInputString(const std::string& s) { this->InputString = s; }
81 
83 
86  vtkSetSmartPointerMacro(Stream, vtkResourceStream);
87  vtkGetSmartPointerMacro(Stream, vtkResourceStream);
89 
91 
95  vtkSetMacro(ReadFromInputStream, bool);
96  vtkGetMacro(ReadFromInputStream, bool);
97  vtkBooleanMacro(ReadFromInputStream, bool);
99 
106  vtkGetMacro(DuplicatePointsForFaceTexture, bool);
107  vtkSetMacro(DuplicatePointsForFaceTexture, bool);
108 
109 protected:
110  vtkPLYReader();
111  ~vtkPLYReader() override;
112 
114  // Whether this object is reading from a string or a file.
115  // Default is 0: read from file.
117  // The input string.
119 
120  bool ReadFromInputStream = false;
122 
124 
125 private:
126  vtkPLYReader(const vtkPLYReader&) = delete;
127  void operator=(const vtkPLYReader&) = delete;
128 
129  float FaceTextureTolerance;
130  bool DuplicatePointsForFaceTexture;
131 };
132 
133 VTK_ABI_NAMESPACE_END
134 #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:113
a vtkAbstractArray subclass for strings
bool ReadFromInputString
Definition: vtkPLYReader.h:116
void SetInputString(const std::string &s)
Enable reading from an InputString instead of the default, a file.
Definition: vtkPLYReader.h:79
static vtkPolyDataAlgorithm * New()
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:42
std::string InputString
Definition: vtkPLYReader.h:118
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.
vtkSmartPointer< vtkResourceStream > Stream
Definition: vtkPLYReader.h:121