52 #ifndef __PLYWRITER_HH__
53 #define __PLYWRITER_HH__
62 #include <OpenMesh/Core/System/config.h>
63 #include <OpenMesh/Core/Utils/SingletonT.hh>
64 #include <OpenMesh/Core/IO/exporter/BaseExporter.hh>
65 #include <OpenMesh/Core/IO/writer/BaseWriter.hh>
66 #include <OpenMesh/Core/Utils/GenProg.hh>
98 std::string
get_description()
const override {
return "PLY polygon file format"; }
101 bool write(
const std::string&,
BaseExporter&,
Options, std::streamsize _precision = 6)
const override;
103 bool write(std::ostream&,
BaseExporter&,
Options, std::streamsize _precision = 6)
const override;
109 ValueTypeFLOAT32, ValueTypeFLOAT,
110 ValueTypeINT32, ValueTypeINT , ValueTypeUINT,
111 ValueTypeUCHAR, ValueTypeCHAR, ValueTypeUINT8,
112 ValueTypeUSHORT, ValueTypeSHORT,
117 mutable Options options_;
119 struct CustomProperty
123 explicit CustomProperty(
const BaseProperty*
const _p):type(Unsupported),property(_p){}
126 const char* nameOfType_[12];
130 template<
bool binary>
131 void write_customProp(std::ostream& _our,
const CustomProperty& _prop,
size_t _index)
const;
133 void writeProxy(ValueType _type, std::ostream& _out, T _value, OpenMesh::GenProg::TrueType )
const
135 writeValue(_type, _out, _value);
138 void writeProxy(ValueType _type, std::ostream& _out, T _value, OpenMesh::GenProg::FalseType )
const
140 _out <<
" " << _value;
144 void writeValue(ValueType _type, std::ostream& _out,
signed char value)
const;
145 void writeValue(ValueType _type, std::ostream& _out,
unsigned char value)
const;
146 void writeValue(ValueType _type, std::ostream& _out,
short value)
const;
147 void writeValue(ValueType _type, std::ostream& _out,
unsigned short value)
const;
148 void writeValue(ValueType _type, std::ostream& _out,
int value)
const;
149 void writeValue(ValueType _type, std::ostream& _out,
unsigned int value)
const;
150 void writeValue(ValueType _type, std::ostream& _out,
float value)
const;
151 void writeValue(ValueType _type, std::ostream& _out,
double value)
const;
153 bool write_ascii(std::ostream& _out, BaseExporter&, Options)
const;
154 bool write_binary(std::ostream& _out, BaseExporter&, Options)
const;
156 void write_header(std::ostream& _out, BaseExporter& _be, Options& _opt, std::vector<CustomProperty>& _ovProps, std::vector<CustomProperty>& _ofProps)
const;
165 OPENMESHDLLEXPORT _PLYWriter_& PLYWriter();
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
size_t binary_size(const Mesh &_mesh, const std::string &_ext, Options _opt=Options::Default)
Get binary size of data.
Definition: MeshIO.hh:251
_PLYWriter_ __PLYWriterInstance
Declare the single entity of the PLY writer.
Definition: PLYWriter.cc:67
Base class for exporter modules.
Definition: BaseExporter.hh:85
Set options for reader/writer modules.
Definition: Options.hh:91
Base class for all writer modules.
Definition: BaseWriter.hh:84
Implementation of the PLY format writer.
Definition: PLYWriter.hh:90
std::string get_extensions() const override
Return file format's extension.
Definition: PLYWriter.hh:99
virtual ~_PLYWriter_()
Destructor.
Definition: PLYWriter.hh:96
std::string get_description() const override
Return short description of the supported file format.
Definition: PLYWriter.hh:98
PropertyContainer::const_iterator const_prop_iterator
You should not use this function directly.
Definition: BaseKernel.hh:783
Abstract class defining the basic interface of a dynamic property.
Definition: BaseProperty.hh:61