Developer Documentation
OMFormat.hh
1 /* ========================================================================= *
2  * *
3  * OpenMesh *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openmesh.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenMesh. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39  * *
40  * ========================================================================= */
41 
42 /*===========================================================================*\
43  * *
44  * $Revision$ *
45  * $Date$ *
46  * *
47 \*===========================================================================*/
48 
49 
50 #ifndef OPENMESH_IO_OMFORMAT_HH
51 #define OPENMESH_IO_OMFORMAT_HH
52 
53 
54 //=== INCLUDES ================================================================
55 
58 #include <OpenMesh/Core/IO/SR_store.hh>
59 #include <OpenMesh/Core/Utils/GenProg.hh>
60 #include <OpenMesh/Core/Utils/Endian.hh>
61 #include <OpenMesh/Core/Utils/vector_traits.hh>
62 // --------------------
63 #include <iostream>
64 #if defined(OM_CC_GCC) && (OM_GCC_VERSION < 30000)
66 # define OM_MISSING_HEADER_LIMITS 1
67 #else
68 # include <limits>
69 #endif
70 
71 
72 //== NAMESPACES ==============================================================
73 
74 #ifndef DOXY_IGNORE_THIS
75 namespace OpenMesh {
76 namespace IO {
77 namespace OMFormat {
78 
79 
80 //=== IMPLEMENTATION ==========================================================
81 
82 
86 
87 //-----------------------------------------------------------------------------
88 
89  // <:Header>
90  // <:Comment>
91  // Chunk 0
92  // <:ChunkHeader>
93  // <:Comment>
94  // data
95  // Chunk 1
96  // <:ChunkHeader>
97  // <:Comment>
98  // data
99  // .
100  // .
101  // .
102  // Chunk N
103 
104  //
105  // NOTICE!
106  //
107  // The usage of data types who differ in size
108  // on different pc architectures (32/64 bit) and/or
109  // operating systems, e.g. (unsigned) long, size_t,
110  // is not recommended because of inconsistencies
111  // in case of cross writing and reading.
112  //
113  // Basic types that are supported are:
114 
115 
116  typedef unsigned char uchar;
117  typedef uint8_t uint8;
118  typedef uint16_t uint16;
119  typedef uint32_t uint32;
120  typedef uint64_t uint64;
121  typedef int8_t int8;
122  typedef int16_t int16;
123  typedef int32_t int32;
124  typedef int64_t int64;
125  typedef float32_t float32;
126  typedef float64_t float64;
127 
128  struct Header
129  {
130  uchar magic_[2]; // OM
131  uchar mesh_; // [T]riangles, [Q]uads, [P]olygonals
132  uint8 version_;
133  uint32 n_vertices_;
134  uint32 n_faces_;
135  uint32 n_edges_;
136 
137  size_t store( std::ostream& _os, bool _swap ) const
138  {
139  _os.write( (char*)this, 4); // magic_, mesh_, version_
140  size_t bytes = 4;
141  bytes += binary<uint32_t>::store( _os, n_vertices_, _swap );
142  bytes += binary<uint32_t>::store( _os, n_faces_, _swap );
143  bytes += binary<uint32_t>::store( _os, n_edges_, _swap );
144  return bytes;
145  }
146 
147  size_t restore( std::istream& _is, bool _swap )
148  {
149  if (_is.read( (char*)this, 4 ).eof())
150  return 0;
151 
152  size_t bytes = 4;
153  bytes += binary<uint32_t>::restore( _is, n_vertices_, _swap );
154  bytes += binary<uint32_t>::restore( _is, n_faces_, _swap );
155  bytes += binary<uint32_t>::restore( _is, n_edges_, _swap );
156  return bytes;
157  }
158 
159  };
160 
161  struct Chunk
162  {
163  // Hardcoded this size to an uint32 to make the system 32/64 bit compatible.
164  // Needs further investigation!
165  typedef uint32 esize_t; // element size, used for custom properties
166 
167  enum Type {
168  Type_Pos = 0x00,
169  Type_Normal = 0x01,
170  Type_Texcoord = 0x02,
171  Type_Status = 0x03,
172  Type_Color = 0x04,
173  Type_Custom = 0x06,
174  Type_Topology = 0x07
175  };
176 
177  enum Entity {
178  Entity_Vertex = 0x00,
179  Entity_Mesh = 0x01,
180  Entity_Face = 0x02,
181  Entity_Edge = 0x04,
182  Entity_Halfedge = 0x06
183  };
184 
185  enum Dim {
186  Dim_1D = 0x00,
187  Dim_2D = 0x01,
188  Dim_3D = 0x02,
189  Dim_4D = 0x03,
190  Dim_5D = 0x04,
191  Dim_6D = 0x05,
192  Dim_7D = 0x06,
193  Dim_8D = 0x07
194  };
195 
196  enum Integer_Size {
197  Integer_8 = 0x00, // 1 byte for (unsigned) char
198  Integer_16 = 0x01, // 2 bytes for short
199  Integer_32 = 0x02, // 4 bytes for long
200  Integer_64 = 0x03 // 8 bytes for long long
201  };
202 
203  enum Float_Size {
204  Float_32 = 0x00, // 4 bytes for float
205  Float_64 = 0x01, // 8 bytes for double
206  Float_128 = 0x02 // 16 bytes for long double (an assumption!)
207  };
208 
209  static const int SIZE_RESERVED = 1; // 1
210  static const int SIZE_NAME = 1; // 2
211  static const int SIZE_ENTITY = 3; // 5
212  static const int SIZE_TYPE = 4; // 9
213 
214  static const int SIZE_SIGNED = 1; // 10
215  static const int SIZE_FLOAT = 1; // 11
216  static const int SIZE_DIM = 3; // 14
217  static const int SIZE_BITS = 2; // 16
218 
219  static const int OFF_RESERVED = 0; // 0
220  static const int OFF_NAME = SIZE_RESERVED + OFF_RESERVED; // 2
221  static const int OFF_ENTITY = SIZE_NAME + OFF_NAME; // 3
222  static const int OFF_TYPE = SIZE_ENTITY + OFF_ENTITY; // 5
223  static const int OFF_SIGNED = SIZE_TYPE + OFF_TYPE; // 9
224  static const int OFF_FLOAT = SIZE_SIGNED + OFF_SIGNED; // 10
225  static const int OFF_DIM = SIZE_FLOAT + OFF_FLOAT; // 11
226  static const int OFF_BITS = SIZE_DIM + OFF_DIM; // 14
227 
228  // !Attention! When changing the bit size, the operators
229  // << (uint16, Header) and << (Header, uint16) must be changed as well
230  //
231  // Entries signed_, float_, dim_, bits_ are not used when type_
232  // equals Type_Custom
233  //
234  struct Header // 16 bits long
235  {
236  unsigned reserved_: SIZE_RESERVED;
237  unsigned name_ : SIZE_NAME; // 1 named property, 0 anonymous
238  unsigned entity_ : SIZE_ENTITY; // 0 vertex, 1 mesh, 2 edge,
239  // 4 halfedge, 6 face
240  unsigned type_ : SIZE_TYPE; // 0 pos, 1 normal, 2 texcoord,
241  // 3 status, 4 color 6 custom 7 topology
242  unsigned signed_ : SIZE_SIGNED; // bool
243  unsigned float_ : SIZE_FLOAT; // bool
244  unsigned dim_ : SIZE_DIM; // 0 1D, 1 2D, 2 3D, .., 7 8D
245  unsigned bits_ : SIZE_BITS; // {8, 16, 32, 64} | {32, 64, 128}
246  // (integer) (float)
247  unsigned unused_ : 16; // fill up to 32 bits
248  }; // struct Header
249 
250 
251  class PropertyName : public std::string
252  {
253  public:
254 
255  static const size_t size_max = 256;
256 
257  PropertyName( ) { }
258 
259  PropertyName( const std::string& _name ) { *this = _name; }
260 
261  bool is_valid() const { return is_valid( size() ); }
262 
263  static bool is_valid( size_t _s ) { return _s <= size_max; }
264 
265  PropertyName& operator = ( const std::string& _rhs )
266  {
267  assert( is_valid( _rhs.size() ) );
268 
269  if ( is_valid( _rhs.size() ) )
270  std::string::operator = ( _rhs );
271  else
272  {
273  omerr() << "Warning! Property name too long. Will be shortened!\n";
274  this->std::string::operator = ( _rhs.substr(0, size_max) );
275  }
276 
277  return *this;
278  }
279 
280  };
281 
282  }; // Chunk
283 
284  // ------------------------------------------------------------ Helper
285 
286  // -------------------- get size information
287 
289  inline size_t header_size(void) { return sizeof(Header); }
290 
291 
293  inline size_t chunk_header_size( void ) { return sizeof(uint16); }
294 
295 
297  inline size_t scalar_size( const Chunk::Header& _hdr )
298  {
299  return _hdr.float_ ? (0x01 << _hdr.bits_) : (0x04 << _hdr.bits_);
300  }
301 
302 
304  inline size_t dimensions(const Chunk::Header& _chdr) { return _chdr.dim_+1; }
305 
306 
308  inline size_t vector_size( const Chunk::Header& _chdr )
309  {
310  return dimensions(_chdr)*scalar_size(_chdr);
311  }
312 
313 
315  inline size_t chunk_data_size( Header& _hdr, Chunk::Header& _chunk_hdr )
316  {
317  size_t C = 0;
318 
319  switch( _chunk_hdr.entity_ )
320  {
321  case Chunk::Entity_Vertex: C = _hdr.n_vertices_; break;
322  case Chunk::Entity_Face: C = _hdr.n_faces_; break;
323  case Chunk::Entity_Halfedge: C = _hdr.n_edges_; // no break!
324  case Chunk::Entity_Edge: C += _hdr.n_edges_; break;
325  case Chunk::Entity_Mesh: C = 1; break;
326  default:
327  std::cerr << "Invalid value in _chunk_hdr.entity_\n";
328  assert( false );
329  break;
330  }
331 
332  return C * vector_size( _chunk_hdr );
333  }
334 
335  inline size_t chunk_size( Header& _hdr, Chunk::Header& _chunk_hdr )
336  {
337  return chunk_header_size() + chunk_data_size( _hdr, _chunk_hdr );
338  }
339 
340  // -------------------- convert from Chunk::Header to storage type
341 
342  uint16& operator << (uint16& val, const Chunk::Header& hdr);
343  Chunk::Header& operator << (Chunk::Header& hdr, const uint16 val);
344 
345 
346  // -------------------- type information
347 
348  template <typename T> bool is_float(const T&)
349  {
350 #if defined(OM_MISSING_HEADER_LIMITS)
351  return !Utils::NumLimitsT<T>::is_integer();
352 #else
353  return !std::numeric_limits<T>::is_integer;
354 #endif
355  }
356 
357  template <typename T> bool is_integer(const T)
358  {
359 #if defined(OM_MISSING_HEADER_LIMITS)
360  return Utils::NumLimitsT<T>::is_integer();
361 #else
362  return std::numeric_limits<T>::is_integer;
363 #endif
364  }
365 
366  template <typename T> bool is_signed(const T&)
367  {
368 #if defined(OM_MISSING_HEADER_LIMITS)
369  return Utils::NumLimitsT<T>::is_signed();
370 #else
371  return std::numeric_limits<T>::is_signed;
372 #endif
373  }
374 
375  // -------------------- conversions (format type <- type/value)
376 
377  template <typename VecType>
378  inline
379  Chunk::Dim dim( VecType )
380  {
381  assert( vector_traits< VecType >::size() < 9 );
382  return static_cast<Chunk::Dim>(vector_traits< VecType >::size() - 1);
383  }
384 
385  template <typename VecType>
386  inline
387  Chunk::Dim dim( const Chunk::Header& _hdr )
388  {
389  return static_cast<Chunk::Dim>( _hdr.dim_ );
390  }
391 
392  // calc minimum (power-of-2) number of bits needed
393  Chunk::Integer_Size needed_bits( size_t s );
394 
395  // Convert size of type to Integer_Size
396 #ifdef NDEBUG
397  template <typename T> Chunk::Integer_Size integer_size(const T&)
398 #else
399  template <typename T> Chunk::Integer_Size integer_size(const T& d)
400 #endif
401  {
402  assert( is_integer(d) );
403 
404  switch( sizeof(T) )
405  {
406  case 1: return OMFormat::Chunk::Integer_8;
407  case 2: return OMFormat::Chunk::Integer_16;
408  case 4: return OMFormat::Chunk::Integer_32;
409  case 8: return OMFormat::Chunk::Integer_64;
410  default:
411  std::cerr << "Invalid value in integer_size\n";
412  assert( false );
413  break;
414  }
415  return Chunk::Integer_Size(0);
416  }
417 
418 
419  // Convert size of type to FLoat_Size
420 #ifdef NDEBUG
421  template <typename T> Chunk::Float_Size float_size(const T&)
422 #else
423  template <typename T> Chunk::Float_Size float_size(const T& d)
424 #endif
425  {
426  assert( is_float(d) );
427 
428  switch( sizeof(T) )
429  {
430  case 4: return OMFormat::Chunk::Float_32;
431  case 8: return OMFormat::Chunk::Float_64;
432  case 16: return OMFormat::Chunk::Float_128;
433  default:
434  std::cerr << "Invalid value in float_size\n";
435  assert( false );
436  break;
437  }
438  return Chunk::Float_Size(0);
439  }
440 
441  // Return the storage type (Chunk::Header::bits_)
442  template <typename T>
443  inline
444  unsigned int bits(const T& val)
445  {
446  return is_integer(val)
447  ? (static_cast<unsigned int>(integer_size(val)))
448  : (static_cast<unsigned int>(float_size(val)));
449  }
450 
451  // -------------------- create/read version
452 
453  inline uint8 mk_version(const uint16 major, const uint16 minor)
454  { return (major & 0x07) << 5 | (minor & 0x1f); }
455 
456 
457  inline uint16 major_version(const uint8 version)
458  { return (version >> 5) & 0x07; }
459 
460 
461  inline uint16 minor_version(const uint8 version)
462  { return (version & 0x001f); }
463 
464 
465  // ---------------------------------------- convenience functions
466 
467  const char *as_string(Chunk::Type t);
468  const char *as_string(Chunk::Entity e);
469  const char *as_string(Chunk::Dim d);
470  const char *as_string(Chunk::Integer_Size d);
471  const char *as_string(Chunk::Float_Size d);
472 
473  std::ostream& operator << ( std::ostream& _os, const Header& _h );
474  std::ostream& operator << ( std::ostream& _os, const Chunk::Header& _c );
475 
477 } // namespace OMFormat
478 
479  // -------------------- (re-)store header
480 
481  template <> inline
482  size_t store( std::ostream& _os, const OMFormat::Header& _hdr, bool _swap)
483  { return _hdr.store( _os, _swap ); }
484 
485  template <> inline
486  size_t restore( std::istream& _is, OMFormat::Header& _hdr, bool _swap )
487  { return _hdr.restore( _is, _swap ); }
488 
489 
490  // -------------------- (re-)store chunk header
491 
492  template <> inline
493  size_t
494  store( std::ostream& _os, const OMFormat::Chunk::Header& _hdr, bool _swap)
495  {
496  OMFormat::uint16 val; val << _hdr;
497  return binary<uint16_t>::store( _os, val, _swap );
498  }
499 
500  template <> inline
501  size_t
502  restore( std::istream& _is, OMFormat::Chunk::Header& _hdr, bool _swap )
503  {
504  OMFormat::uint16 val;
505  size_t bytes = binary<uint16_t>::restore( _is, val, _swap );
506 
507  _hdr << val;
508 
509  return bytes;
510  }
511 
512  // -------------------- (re-)store integer with wanted number of bits (bytes)
513 
514  typedef GenProg::TrueType t_signed;
515  typedef GenProg::FalseType t_unsigned;
516 
517  // helper to store a an integer
518  template< typename T >
519  size_t
520  store( std::ostream& _os,
521  const T& _val,
522  OMFormat::Chunk::Integer_Size _b,
523  bool _swap,
524  t_signed);
525 
526  // helper to store a an unsigned integer
527  template< typename T >
528  size_t
529  store( std::ostream& _os,
530  const T& _val,
531  OMFormat::Chunk::Integer_Size _b,
532  bool _swap,
533  t_unsigned);
534 
536  template< typename T >
537  inline
538  size_t
539  store( std::ostream& _os,
540  const T& _val,
541  OMFormat::Chunk::Integer_Size _b,
542  bool _swap)
543  {
544  assert( OMFormat::is_integer( _val ) );
545 
546  if ( OMFormat::is_signed( _val ) )
547  return store( _os, _val, _b, _swap, t_signed() );
548  return store( _os, _val, _b, _swap, t_unsigned() );
549  }
550 
551  // helper to store a an integer
552  template< typename T > inline
553  size_t restore( std::istream& _is,
554  T& _val,
555  OMFormat::Chunk::Integer_Size _b,
556  bool _swap,
557  t_signed);
558 
559  // helper to store a an unsigned integer
560  template< typename T > inline
561  size_t restore( std::istream& _is,
562  T& _val,
563  OMFormat::Chunk::Integer_Size _b,
564  bool _swap,
565  t_unsigned);
566 
568  template< typename T >
569  inline
570  size_t
571  restore( std::istream& _is,
572  T& _val,
573  OMFormat::Chunk::Integer_Size _b,
574  bool _swap)
575  {
576  assert( OMFormat::is_integer( _val ) );
577 
578  if ( OMFormat::is_signed( _val ) )
579  return restore( _is, _val, _b, _swap, t_signed() );
580  return restore( _is, _val, _b, _swap, t_unsigned() );
581  }
582 
583 
584  //
585  // ---------------------------------------- storing vectors
586  template <typename VecT> inline
587  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<2>,
588  bool _swap )
589  {
590  size_t bytes = store( _os, _vec[0], _swap );
591  bytes += store( _os, _vec[1], _swap );
592  return bytes;
593  }
594 
595  template <typename VecT> inline
596  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<3>,
597  bool _swap )
598  {
599  size_t bytes = store( _os, _vec[0], _swap );
600  bytes += store( _os, _vec[1], _swap );
601  bytes += store( _os, _vec[2], _swap );
602  return bytes;
603  }
604 
605  template <typename VecT> inline
606  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<4>,
607  bool _swap )
608  {
609  size_t bytes = store( _os, _vec[0], _swap );
610  bytes += store( _os, _vec[1], _swap );
611  bytes += store( _os, _vec[2], _swap );
612  bytes += store( _os, _vec[3], _swap );
613  return bytes;
614  }
615 
616  template <typename VecT> inline
617  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<1>,
618  bool _swap )
619  {
620  return store( _os, _vec[0], _swap );
621  }
622 
624  template <typename VecT> inline
625  size_t vector_store( std::ostream& _os, const VecT& _vec, bool _swap )
626  {
627  return store( _os, _vec,
628  GenProg::Int2Type< vector_traits<VecT>::size_ >(),
629  _swap );
630  }
631 
632  // ---------------------------------------- restoring vectors
633  template <typename VecT>
634  inline
635  size_t
636  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<2>,
637  bool _swap )
638  {
639  size_t bytes = restore( _is, _vec[0], _swap );
640  bytes += restore( _is, _vec[1], _swap );
641  return bytes;
642  }
643 
644  template <typename VecT>
645  inline
646  size_t
647  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<3>,
648  bool _swap )
649  {
650  typedef typename vector_traits<VecT>::value_type scalar_type;
651  size_t bytes;
652 
653  bytes = binary<scalar_type>::restore( _is, _vec[0], _swap );
654  bytes += binary<scalar_type>::restore( _is, _vec[1], _swap );
655  bytes += binary<scalar_type>::restore( _is, _vec[2], _swap );
656  return bytes;
657  }
658 
659  template <typename VecT>
660  inline
661  size_t
662  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<4>,
663  bool _swap )
664  {
665  typedef typename vector_traits<VecT>::value_type scalar_type;
666  size_t bytes;
667 
668  bytes = binary<scalar_type>::restore( _is, _vec[0], _swap );
669  bytes += binary<scalar_type>::restore( _is, _vec[1], _swap );
670  bytes += binary<scalar_type>::restore( _is, _vec[2], _swap );
671  bytes += binary<scalar_type>::restore( _is, _vec[3], _swap );
672  return bytes;
673  }
674 
675  template <typename VecT>
676  inline
677  size_t
678  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<1>,
679  bool _swap )
680  {
681  return restore( _is, _vec[0], _swap );
682  }
683 
685  template <typename VecT>
686  inline
687  size_t
688  vector_restore( std::istream& _is, VecT& _vec, bool _swap )
689  {
690  return restore( _is, _vec,
691  GenProg::Int2Type< vector_traits<VecT>::size_ >(),
692  _swap );
693  }
694 
695 
696  // ---------------------------------------- storing property names
697 
698  template <>
699  inline
700  size_t store( std::ostream& _os, const OMFormat::Chunk::PropertyName& _pn,
701  bool _swap )
702  {
703  store( _os, _pn.size(), OMFormat::Chunk::Integer_8, _swap ); // 1 byte
704  if ( _pn.size() )
705  _os.write( _pn.c_str(), _pn.size() ); // size bytes
706  return _pn.size() + 1;
707  }
708 
709  template <>
710  inline
711  size_t restore( std::istream& _is, OMFormat::Chunk::PropertyName& _pn,
712  bool _swap )
713  {
714  size_t size;
715 
716  restore( _is, size, OMFormat::Chunk::Integer_8, _swap); // 1 byte
717 
718  assert( OMFormat::Chunk::PropertyName::is_valid( size ) );
719 
720  if ( size > 0 )
721  {
722  char buf[256];
723  _is.read( buf, size ); // size bytes
724  buf[size] = '\0';
725  _pn.resize(size);
726  _pn = buf;
727  }
728  return size+1;
729  }
730 
731 //=============================================================================
732 } // namespace IO
733 } // namespace OpenMesh
734 #endif
735 //=============================================================================
736 #if defined(OM_MISSING_HEADER_LIMITS)
737 # undef OM_MISSING_HEADER_LIMITS
738 #endif
739 //=============================================================================
740 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_IO_OMFORMAT_CC)
741 # define OPENMESH_IO_OMFORMAT_TEMPLATES
742 # include "OMFormatT.cc"
743 #endif
744 //=============================================================================
745 #endif
746 //=============================================================================
unsigned long long uint64_t
Definition: SR_types.hh:94
auto operator<<(std::ostream &os, const VectorT< Scalar, DIM > &_vec) -> typename std::enable_if< sizeof(decltype(os<< _vec[0])) >=0
output a vector by printing its space-separated compontens
Definition: VectorT.hh:652
unsigned char uchar
Definition: SR_types.hh:81
short int16_t
Definition: SR_types.hh:86
static size_t size()
size/dimension of the vector
T::value_type value_type
Type of the scalar value.
unsigned short uint16_t
Definition: SR_types.hh:86
double float64_t
Definition: SR_types.hh:98
unsigned char uint8_t
Definition: SR_types.hh:85
unsigned int uint32_t
Definition: SR_types.hh:90
static const size_t size_
size/dimension of the vector
long long int64_t
Definition: SR_types.hh:94
signed char int8_t
Definition: SR_types.hh:85
float float32_t
Definition: SR_types.hh:97