Developer Documentation
OpenMesh::IO::Options Class Reference

Set options for reader/writer modules. More...

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Core/IO/Options.hh>

Public Types

enum  Flag {
  None = 0x0000 , Binary = 0x0001 , MSB = 0x0002 , LSB = 0x0004 ,
  Swap = 0x0008 , VertexNormal = 0x0010 , VertexColor = 0x0020 , VertexTexCoord = 0x0040 ,
  EdgeColor = 0x0080 , FaceNormal = 0x0100 , FaceColor = 0x0200 , FaceTexCoord = 0x0400 ,
  ColorAlpha = 0x0800 , ColorFloat = 0x1000 , Custom = 0x2000 , Status = 0x4000 ,
  TexCoordST = 0x8000 , Default = Custom
}
 
typedef int enum_type
 
typedef enum_type value_type
 

Public Member Functions

 Options ()
 Default constructor. More...
 
 Options (const value_type _flgs)
 Initializing constructor setting multiple options. More...
 
void cleanup (void)
 Restore state after default constructor. More...
 
void clear (void)
 Clear all bits. More...
 
bool is_empty (void) const
 Returns true if all bits are zero. More...
 
Optionsoperator= (const value_type _rhs)
 
Optionsoperator-= (const value_type _rhs)
 Unset options defined in _rhs. More...
 
Optionsunset (const value_type _rhs)
 
Optionsoperator+= (const value_type _rhs)
 Set options defined in _rhs. More...
 
Optionsset (const value_type _rhs)
 
bool check (const value_type _rhs) const
 
bool is_binary () const
 
bool vertex_has_normal () const
 
bool vertex_has_color () const
 
bool vertex_has_texcoord () const
 
bool vertex_has_status () const
 
bool edge_has_color () const
 
bool edge_has_status () const
 
bool halfedge_has_status () const
 
bool face_has_normal () const
 
bool face_has_color () const
 
bool face_has_texcoord () const
 
bool face_has_status () const
 
bool color_has_alpha () const
 
bool color_is_float () const
 
bool use_st_coordinates () const
 
bool operator== (const value_type _rhs) const
 Returns true if _rhs has the same options enabled. More...
 
bool operator!= (const value_type _rhs) const
 Returns true if _rhs does not have the same options enabled. More...
 
 operator value_type () const
 Returns the option set. More...
 

Public Attributes

std::string texture_file
 
std::string material_file_extension
 

Private Member Functions

bool operator&& (const value_type _rhs) const
 

Private Attributes

value_type flags_
 

Detailed Description

Set options for reader/writer modules.

The class is used in a twofold way.

  1. In combination with reader modules the class is used
    • to pass hints to the reading module, whether the input is binary and what byte ordering the binary data has
    • to retrieve information about the file contents after succesful reading.
  2. In combination with write modules the class gives directions to the writer module, whether to
    • use binary mode or not and what byte order to use
    • store one of the standard properties.

The option are defined in Options::Flag as bit values and stored in an int value as a bitset.

Definition at line 91 of file Options.hh.

Member Typedef Documentation

◆ enum_type

typedef int OpenMesh::IO::Options::enum_type

Definition at line 94 of file Options.hh.

◆ value_type

typedef enum_type OpenMesh::IO::Options::value_type

Definition at line 95 of file Options.hh.

Member Enumeration Documentation

◆ Flag

Definitions of Options for reading and writing. The options can be or'ed.

Enumerator
None 

No options.

Binary 

Set binary mode for r/w.

MSB 

Assume big endian byte ordering.

LSB 

Assume little endian byte ordering.

Swap 

Swap byte order in binary mode.

VertexNormal 

Has (r) / store (w) vertex normals.

VertexColor 

Has (r) / store (w) vertex colors.

VertexTexCoord 

Has (r) / store (w) texture coordinates.

EdgeColor 

Has (r) / store (w) edge colors.

FaceNormal 

Has (r) / store (w) face normals.

FaceColor 

Has (r) / store (w) face colors.

FaceTexCoord 

Has (r) / store (w) face texture coordinates.

ColorAlpha 

Has (r) / store (w) alpha values for colors.

ColorFloat 

Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files)

Custom 

Has (r) / store (w) custom properties marked persistent (currently PLY only supports reading and only ASCII version. OM supports reading and writing)

Status 

Has (r) / store (w) status properties.

TexCoordST 

Write texture coordinates as ST instead of UV.

Default 

By default write persistent custom properties.

Definition at line 99 of file Options.hh.

Constructor & Destructor Documentation

◆ Options() [1/2]

OpenMesh::IO::Options::Options ( )
inline

Default constructor.

Definition at line 131 of file Options.hh.

◆ Options() [2/2]

OpenMesh::IO::Options::Options ( const value_type  _flgs)
inline

Initializing constructor setting multiple options.

Definition at line 135 of file Options.hh.

Member Function Documentation

◆ check()

bool OpenMesh::IO::Options::check ( const value_type  _rhs) const
inline

Definition at line 184 of file Options.hh.

◆ cleanup()

void OpenMesh::IO::Options::cleanup ( void  )
inline

Restore state after default constructor.

Definition at line 139 of file Options.hh.

◆ clear()

void OpenMesh::IO::Options::clear ( void  )
inline

Clear all bits.

Definition at line 143 of file Options.hh.

◆ color_has_alpha()

bool OpenMesh::IO::Options::color_has_alpha ( ) const
inline

Definition at line 201 of file Options.hh.

◆ color_is_float()

bool OpenMesh::IO::Options::color_is_float ( ) const
inline

Definition at line 202 of file Options.hh.

◆ edge_has_color()

bool OpenMesh::IO::Options::edge_has_color ( ) const
inline

Definition at line 194 of file Options.hh.

◆ edge_has_status()

bool OpenMesh::IO::Options::edge_has_status ( ) const
inline

Definition at line 195 of file Options.hh.

◆ face_has_color()

bool OpenMesh::IO::Options::face_has_color ( ) const
inline

Definition at line 198 of file Options.hh.

◆ face_has_normal()

bool OpenMesh::IO::Options::face_has_normal ( ) const
inline

Definition at line 197 of file Options.hh.

◆ face_has_status()

bool OpenMesh::IO::Options::face_has_status ( ) const
inline

Definition at line 200 of file Options.hh.

◆ face_has_texcoord()

bool OpenMesh::IO::Options::face_has_texcoord ( ) const
inline

Definition at line 199 of file Options.hh.

◆ halfedge_has_status()

bool OpenMesh::IO::Options::halfedge_has_status ( ) const
inline

Definition at line 196 of file Options.hh.

◆ is_binary()

bool OpenMesh::IO::Options::is_binary ( ) const
inline

Definition at line 189 of file Options.hh.

◆ is_empty()

bool OpenMesh::IO::Options::is_empty ( void  ) const
inline

Returns true if all bits are zero.

Definition at line 147 of file Options.hh.

◆ operator value_type()

OpenMesh::IO::Options::operator value_type ( ) const
inline

Returns the option set.

Definition at line 217 of file Options.hh.

◆ operator!=()

bool OpenMesh::IO::Options::operator!= ( const value_type  _rhs) const
inline

Returns true if _rhs does not have the same options enabled.

Definition at line 212 of file Options.hh.

◆ operator+=()

Options & OpenMesh::IO::Options::operator+= ( const value_type  _rhs)
inline

Set options defined in _rhs.

Definition at line 172 of file Options.hh.

◆ operator-=()

Options & OpenMesh::IO::Options::operator-= ( const value_type  _rhs)
inline

Unset options defined in _rhs.

Definition at line 159 of file Options.hh.

◆ operator=()

Options & OpenMesh::IO::Options::operator= ( const value_type  _rhs)
inline

Definition at line 152 of file Options.hh.

◆ operator==()

bool OpenMesh::IO::Options::operator== ( const value_type  _rhs) const
inline

Returns true if _rhs has the same options enabled.

Definition at line 207 of file Options.hh.

◆ set()

Options & OpenMesh::IO::Options::set ( const value_type  _rhs)
inline

Definition at line 175 of file Options.hh.

◆ unset()

Options & OpenMesh::IO::Options::unset ( const value_type  _rhs)
inline

Definition at line 162 of file Options.hh.

◆ use_st_coordinates()

bool OpenMesh::IO::Options::use_st_coordinates ( ) const
inline

Definition at line 203 of file Options.hh.

◆ vertex_has_color()

bool OpenMesh::IO::Options::vertex_has_color ( ) const
inline

Definition at line 191 of file Options.hh.

◆ vertex_has_normal()

bool OpenMesh::IO::Options::vertex_has_normal ( ) const
inline

Definition at line 190 of file Options.hh.

◆ vertex_has_status()

bool OpenMesh::IO::Options::vertex_has_status ( ) const
inline

Definition at line 193 of file Options.hh.

◆ vertex_has_texcoord()

bool OpenMesh::IO::Options::vertex_has_texcoord ( ) const
inline

Definition at line 192 of file Options.hh.

Member Data Documentation

◆ flags_

value_type OpenMesh::IO::Options::flags_
private

Definition at line 223 of file Options.hh.

◆ material_file_extension

std::string OpenMesh::IO::Options::material_file_extension

Filename extension for material files when writing OBJs default is currently .mat

Definition at line 126 of file Options.hh.

◆ texture_file

std::string OpenMesh::IO::Options::texture_file

Texture filename. This will be written as map_Kd in the OBJ writer into the material file.

Definition at line 122 of file Options.hh.


The documentation for this class was generated from the following file: