50#ifndef OPENMESH_IO_OPTIONS_HH
51#define OPENMESH_IO_OPTIONS_HH
58#include <OpenMesh/Core/System/config.h>
98 typedef int enum_type;
99 typedef enum_type value_type;
139 Options(
const value_type _flgs) : flags_( _flgs)
164 { flags_ = _rhs.flags_;
return *
this; }
167 { flags_ = _rhs;
return *
this; }
176 { flags_ &= ~_rhs;
return *
this; }
178 Options& unset(
const value_type _rhs)
179 {
return (*
this -= _rhs); }
189 { flags_ |= _rhs;
return *
this; }
191 Options& set(
const value_type _rhs)
192 {
return (*
this += _rhs); }
200 bool check(
const value_type _rhs)
const
202 return (flags_ & _rhs)==_rhs;
205 bool is_binary()
const {
return check(
Binary); }
206 bool vertex_has_normal()
const {
return check(
VertexNormal); }
207 bool vertex_has_color()
const {
return check(
VertexColor); }
208 bool vertex_has_texcoord()
const {
return check(
VertexTexCoord); }
209 bool edge_has_color()
const {
return check(
EdgeColor); }
210 bool face_has_normal()
const {
return check(
FaceNormal); }
211 bool face_has_color()
const {
return check(
FaceColor); }
212 bool face_has_texcoord()
const {
return check(
FaceTexCoord); }
213 bool color_has_alpha()
const {
return check(
ColorAlpha); }
214 bool color_is_float()
const {
return check(
ColorFloat); }
219 {
return flags_ == _rhs; }
224 {
return flags_ != _rhs; }
228 operator value_type ()
const {
return flags_; }
232 bool operator && (
const value_type _rhs)
const;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
Set options for reader/writer modules.
Definition Options.hh:96
Options & operator+=(const value_type _rhs)
Set options defined in _rhs.
Definition Options.hh:188
Options(const value_type _flgs)
Initializing constructor setting multiple options.
Definition Options.hh:139
bool operator!=(const value_type _rhs) const
Returns true if _rhs does not have the same options enabled.
Definition Options.hh:223
void cleanup(void)
Restore state after default constructor.
Definition Options.hh:147
bool is_empty(void) const
Returns true if all bits are zero.
Definition Options.hh:155
bool operator==(const value_type _rhs) const
Returns true if _rhs has the same options enabled.
Definition Options.hh:218
void clear(void)
Clear all bits.
Definition Options.hh:151
Options()
Default constructor.
Definition Options.hh:124
Options & operator=(const Options &_rhs)
Copy options defined in _rhs.
Definition Options.hh:163
Flag
Definitions of Options for reading and writing.
Definition Options.hh:103
@ ColorFloat
Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files)
Definition Options.hh:117
@ FaceNormal
Has (r) / store (w) face normals.
Definition Options.hh:113
@ Swap
Swap byte order in binary mode.
Definition Options.hh:108
@ FaceColor
Has (r) / store (w) face colors.
Definition Options.hh:114
@ FaceTexCoord
Has (r) / store (w) face texture coordinates.
Definition Options.hh:115
@ MSB
Assume big endian byte ordering.
Definition Options.hh:106
@ Binary
Set binary mode for r/w.
Definition Options.hh:105
@ Default
No options.
Definition Options.hh:104
@ ColorAlpha
Has (r) / store (w) alpha values for colors.
Definition Options.hh:116
@ LSB
Assume little endian byte ordering.
Definition Options.hh:107
@ VertexNormal
Has (r) / store (w) vertex normals.
Definition Options.hh:109
@ VertexTexCoord
Has (r) / store (w) texture coordinates.
Definition Options.hh:111
@ EdgeColor
Has (r) / store (w) edge colors.
Definition Options.hh:112
@ VertexColor
Has (r) / store (w) vertex colors.
Definition Options.hh:110
@ Custom
Has (r) custom properties (currently only implemented in PLY Reader ASCII version)
Definition Options.hh:118
Options & operator-=(const value_type _rhs)
Unset options defined in _rhs.
Definition Options.hh:175
Options(Flag _flg)
Initializing constructor setting a single option.
Definition Options.hh:134
Options(const Options &_opt)
Copy constructor.
Definition Options.hh:129