57 #ifndef __PLYWRITER_HH__
58 #define __PLYWRITER_HH__
67 #include <OpenMesh/Core/System/config.h>
68 #include <OpenMesh/Core/Utils/SingletonT.hh>
69 #include <OpenMesh/Core/IO/exporter/BaseExporter.hh>
70 #include <OpenMesh/Core/IO/writer/BaseWriter.hh>
71 #include <OpenMesh/Core/Utils/GenProg.hh>
105 bool write(
const std::string&,
BaseExporter&,
Options, std::streamsize _precision = 6)
const;
113 ValueTypeFLOAT32, ValueTypeFLOAT,
114 ValueTypeINT32, ValueTypeINT , ValueTypeUINT,
115 ValueTypeUCHAR, ValueTypeCHAR, ValueTypeUINT8,
116 ValueTypeUSHORT, ValueTypeSHORT,
121 mutable Options options_;
123 struct CustomProperty
127 CustomProperty(
const BaseProperty*
const _p):type(Unsupported),property(_p){}
130 const char* nameOfType_[12];
133 std::vector<CustomProperty> writeCustomTypeHeader(std::ostream& _out, BaseKernel::const_prop_iterator _begin, BaseKernel::const_prop_iterator _end)
const;
134 template<
bool binary>
135 void write_customProp(std::ostream& _our,
const CustomProperty& _prop,
size_t _index)
const;
137 void writeProxy(ValueType _type, std::ostream& _out, T _value, OpenMesh::GenProg::TrueType )
const
139 writeValue(_type, _out, _value);
142 void writeProxy(ValueType _type, std::ostream& _out, T _value, OpenMesh::GenProg::FalseType )
const
144 _out <<
" " << _value;
148 void writeValue(ValueType _type, std::ostream& _out,
signed char value)
const;
149 void writeValue(ValueType _type, std::ostream& _out,
unsigned char value)
const;
150 void writeValue(ValueType _type, std::ostream& _out,
short value)
const;
151 void writeValue(ValueType _type, std::ostream& _out,
unsigned short value)
const;
152 void writeValue(ValueType _type, std::ostream& _out,
int value)
const;
153 void writeValue(ValueType _type, std::ostream& _out,
unsigned int value)
const;
154 void writeValue(ValueType _type, std::ostream& _out,
float value)
const;
155 void writeValue(ValueType _type, std::ostream& _out,
double value)
const;
157 bool write_ascii(std::ostream& _out, BaseExporter&, Options)
const;
158 bool write_binary(std::ostream& _out, BaseExporter&, Options)
const;
160 void write_header(std::ostream& _out, BaseExporter& _be, Options& _opt, std::vector<CustomProperty>& _ovProps, std::vector<CustomProperty>& _ofProps)
const;
169 OPENMESHDLLEXPORT _PLYWriter_& PLYWriter();
Set options for reader/writer modules.
Definition: Options.hh:95
Implementation of the PLY format writer.
Definition: PLYWriter.hh:93
std::string get_description() const
Return short description of the supported file format.
Definition: PLYWriter.hh:102
Base class for all writer modules.
Definition: BaseWriter.hh:88
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
_PLYWriter_ __PLYWriterInstance
Declare the single entity of the PLY writer.
Definition: PLYWriter.cc:72
Base class for exporter modules.
Definition: BaseExporter.hh:89
size_t binary_size(const Mesh &_mesh, const std::string &_ext, Options _opt=Options::Default)
Get binary size of data.
Definition: MeshIO.hh:260
Abstract class defining the basic interface of a dynamic property.
Definition: BaseProperty.hh:65
virtual ~_PLYWriter_()
Destructor.
Definition: PLYWriter.hh:100
std::string get_extensions() const
Return file format's extension.
Definition: PLYWriter.hh:103