45#ifndef OPENMESH_IO_OPTIONS_HH
46#define OPENMESH_IO_OPTIONS_HH
94 typedef int enum_type;
95 typedef enum_type value_type;
135 Options(
const value_type _flgs) : flags_( _flgs)
152 Options& operator = (
const value_type _rhs )
153 { flags_ = _rhs;
return *
this; }
160 { flags_ &= ~_rhs;
return *
this; }
162 Options& unset(
const value_type _rhs)
163 {
return (*
this -= _rhs); }
173 { flags_ |= _rhs;
return *
this; }
175 Options& set(
const value_type _rhs)
176 {
return (*
this += _rhs); }
184 bool check(
const value_type _rhs)
const
186 return (flags_ & _rhs)==_rhs;
189 bool is_binary()
const {
return check(
Binary); }
190 bool vertex_has_normal()
const {
return check(
VertexNormal); }
191 bool vertex_has_color()
const {
return check(
VertexColor); }
192 bool vertex_has_texcoord()
const {
return check(
VertexTexCoord); }
193 bool vertex_has_status()
const {
return check(
Status); }
194 bool edge_has_color()
const {
return check(
EdgeColor); }
195 bool edge_has_status()
const {
return check(
Status); }
196 bool halfedge_has_status()
const {
return check(
Status); }
197 bool face_has_normal()
const {
return check(
FaceNormal); }
198 bool face_has_color()
const {
return check(
FaceColor); }
199 bool face_has_texcoord()
const {
return check(
FaceTexCoord); }
200 bool face_has_status()
const {
return check(
Status); }
201 bool color_has_alpha()
const {
return check(
ColorAlpha); }
202 bool color_is_float()
const {
return check(
ColorFloat); }
203 bool use_st_coordinates()
const {
return check(
TexCoordST); }
208 {
return flags_ == _rhs; }
213 {
return flags_ != _rhs; }
217 operator value_type ()
const {
return flags_; }
221 bool operator && (
const value_type _rhs)
const;
Set options for reader/writer modules.
Options & operator+=(const value_type _rhs)
Set options defined in _rhs.
std::string material_file_extension
Options(const value_type _flgs)
Initializing constructor setting multiple options.
bool operator!=(const value_type _rhs) const
Returns true if _rhs does not have the same options enabled.
void cleanup(void)
Restore state after default constructor.
bool is_empty(void) const
Returns true if all bits are zero.
bool operator==(const value_type _rhs) const
Returns true if _rhs has the same options enabled.
void clear(void)
Clear all bits.
Options()
Default constructor.
@ ColorFloat
Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files)
@ FaceNormal
Has (r) / store (w) face normals.
@ TexCoordST
Write texture coordinates as ST instead of UV.
@ Swap
Swap byte order in binary mode.
@ FaceColor
Has (r) / store (w) face colors.
@ FaceTexCoord
Has (r) / store (w) face texture coordinates.
@ MSB
Assume big endian byte ordering.
@ Binary
Set binary mode for r/w.
@ Default
By default write persistent custom properties.
@ Status
Has (r) / store (w) status properties.
@ ColorAlpha
Has (r) / store (w) alpha values for colors.
@ LSB
Assume little endian byte ordering.
@ VertexNormal
Has (r) / store (w) vertex normals.
@ VertexTexCoord
Has (r) / store (w) texture coordinates.
@ EdgeColor
Has (r) / store (w) edge colors.
@ VertexColor
Has (r) / store (w) vertex colors.
@ Custom
Has (r) / store (w) custom properties marked persistent (currently PLY only supports reading and only...
Options & operator-=(const value_type _rhs)
Unset options defined in _rhs.