45 #ifndef OPENMESH_IO_OPTIONS_HH 46 #define OPENMESH_IO_OPTIONS_HH 93 typedef int enum_type;
94 typedef enum_type value_type;
135 Options(
const value_type _flgs) : flags_( _flgs)
160 { flags_ = _rhs.flags_;
return *
this; }
163 { flags_ = _rhs;
return *
this; }
172 { flags_ &= ~_rhs;
return *
this; }
175 {
return (*
this -= _rhs); }
185 { flags_ |= _rhs;
return *
this; }
188 {
return (*
this += _rhs); }
196 bool check(
const value_type _rhs)
const 198 return (flags_ & _rhs)==_rhs;
201 bool is_binary()
const {
return check(
Binary); }
202 bool vertex_has_normal()
const {
return check(
VertexNormal); }
203 bool vertex_has_color()
const {
return check(
VertexColor); }
204 bool vertex_has_texcoord()
const {
return check(
VertexTexCoord); }
205 bool vertex_has_status()
const {
return check(
Status); }
206 bool edge_has_color()
const {
return check(
EdgeColor); }
207 bool edge_has_status()
const {
return check(
Status); }
208 bool halfedge_has_status()
const {
return check(
Status); }
209 bool face_has_normal()
const {
return check(
FaceNormal); }
210 bool face_has_color()
const {
return check(
FaceColor); }
211 bool face_has_texcoord()
const {
return check(
FaceTexCoord); }
212 bool face_has_status()
const {
return check(
Status); }
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;
Has (r) / store (w) vertex colors.
Swap byte order in binary mode.
bool operator==(const value_type _rhs) const
Returns true if _rhs has the same options enabled.
Options(Flag _flg)
Initializing constructor setting a single option.
Assume little endian byte ordering.
Has (r) / store (w) face colors.
Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files) ...
Has (r) / store (w) face normals.
Has (r) / store (w) texture coordinates.
Has (r) / store (w) face texture coordinates.
Options & unset(const value_type _rhs)
Unset options defined in _rhs.
Has (r) / store (w) status properties.
Options & operator-=(const value_type _rhs)
Unset options defined in _rhs.
bool is_empty(void) const
Returns true if all bits are zero.
void clear(void)
Clear all bits.
void cleanup(void)
Restore state after default constructor.
Set options for reader/writer modules.
Has (r) / store (w) alpha values for colors.
Has (r) / store (w) vertex normals.
Options()
Default constructor.
Options & operator+=(const value_type _rhs)
Set options defined in _rhs.
Options(const Options &_opt)
Copy constructor.
Assume big endian byte ordering.
bool operator!=(const value_type _rhs) const
Returns true if _rhs does not have the same options enabled.
Has (r) / store (w) edge colors.
Options & operator=(const Options &_rhs)
Copy options defined in _rhs.
Options(const value_type _flgs)
Initializing constructor setting multiple options.