io_mask.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 * VCGLib                                                            o o     *
00003 * Visual and Computer Graphics Library                            o     o   *
00004 *                                                                _   O  _   *
00005 * Copyright(C) 2004                                                \/)\/    *
00006 * Visual Computing Lab                                            /\/|      *
00007 * ISTI - Italian National Research Council                           |      *
00008 *                                                                    \      *
00009 * All rights reserved.                                                      *
00010 *                                                                           *
00011 * This program is free software; you can redistribute it and/or modify      *   
00012 * it under the terms of the GNU General Public License as published by      *
00013 * the Free Software Foundation; either version 2 of the License, or         *
00014 * (at your option) any later version.                                       *
00015 *                                                                           *
00016 * This program is distributed in the hope that it will be useful,           *
00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
00019 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)          *
00020 * for more details.                                                         *
00021 *                                                                           *
00022 ****************************************************************************/
00023 /****************************************************************************
00024   History
00025 
00026 $Log: not supported by cvs2svn $
00027 Revision 1.6  2006/05/21 06:58:55  cignoni
00028 Added ClampMask function
00029 
00030 Revision 1.5  2006/01/10 13:20:42  cignoni
00031 Changed ply::PlyMask to io::Mask
00032 
00033 Revision 1.4  2004/10/28 00:52:45  cignoni
00034 Better Doxygen documentation
00035 
00036 Revision 1.3  2004/05/12 10:19:30  ganovelli
00037 new line added at the end of file
00038 
00039 Revision 1.2  2004/03/09 21:26:47  cignoni
00040 cr lf mismatch
00041 
00042 Revision 1.1  2004/03/03 15:00:51  cignoni
00043 Initial commit
00044 
00045 ****************************************************************************/
00046 #ifndef __VCGLIB_IOTRIMESH_IO_MASK
00047 #define __VCGLIB_IOTRIMESH_IO_MASK
00048 
00049 namespace vcg {
00050 namespace tri {
00051 namespace io {
00052 
00057   
00058 class Mask
00059 {
00060 public:
00061 
00062   /*
00063   Bitmask for specifying what data has to be loaded or saved or it is present in a given plyfile;
00064 */
00065 
00066 enum {
00067         IOM_NONE         = 0x00000,
00068 
00069   IOM_VERTCOORD    = 0x00001,
00070         IOM_VERTFLAGS    = 0x00002,
00071         IOM_VERTCOLOR    = 0x00004,
00072         IOM_VERTQUALITY  = 0x00008,
00073         IOM_VERTNORMAL   = 0x00010,
00074         IOM_VERTTEXCOORD = 0x00020,
00075         IOM_VERTRADIUS   = 0x10000,
00076 
00077         IOM_EDGEINDEX    = 0x80000,
00078 
00079         IOM_FACEINDEX    = 0x00040,
00080         IOM_FACEFLAGS    = 0x00080,
00081         IOM_FACECOLOR    = 0x00100,
00082         IOM_FACEQUALITY  = 0x00200,
00083         IOM_FACENORMAL   = 0x00400,
00084         
00085         IOM_WEDGCOLOR    = 0x00800,
00086         IOM_WEDGTEXCOORD = 0x01000,
00087         IOM_WEDGTEXMULTI = 0x02000, // when textrue index is explicit
00088         IOM_WEDGNORMAL   = 0x04000,
00089 
00090         IOM_BITPOLYGONAL = 0x20000, // loads explicit polygonal mesh
00091 
00092         IOM_CAMERA       = 0x08000,
00093 
00094         IOM_FLAGS        = IOM_VERTFLAGS + IOM_FACEFLAGS,
00095 
00096         IOM_ALL          = 0xFFFFF
00097 };
00098 //
00099 //
00100 //static void IOMask2String( int mask, char str[] )
00101 //{
00102 //      str[0] = 0;
00103 //
00104 //      strcat(str,"V:");
00105 //      if( mask & IOM_VERTFLAGS    ) strcat(str,"flag,");
00106 //      if( mask & IOM_VERTCOLOR    ) strcat(str,"color,");
00107 //      if( mask & IOM_VERTQUALITY  ) strcat(str,"quality,");
00108 //      if( mask & IOM_VERTTEXCOORD ) strcat(str,"texcoord,");
00109 //      if( mask & IOM_VERTNORMAL ) strcat(str,"normal,");
00110 //
00111 //      strcat(str," F:");
00112 //      if( mask & IOM_FACEFLAGS    ) strcat(str,"mask,");
00113 //      if( mask & IOM_FACECOLOR    ) strcat(str,"color,");
00114 //      if( mask & IOM_FACEQUALITY  ) strcat(str,"quality,");
00115 //      if( mask & IOM_FACENORMAL   ) strcat(str,"normal,");
00116 //
00117 //      strcat(str," W:");
00118 //      if( mask & IOM_WEDGCOLOR    ) strcat(str,"color,");
00119 //      if( mask & IOM_WEDGTEXCOORD ) strcat(str,"texcoord,");
00120 //      if( mask & IOM_WEDGNORMAL  ) strcat(str,"normal,");
00121 //
00122 //      if( mask & IOM_CAMERA ) strcat(str," camera");
00123 //}
00124 template <class MeshType>
00125 static void ClampMask(MeshType &m, int &mask)
00126 {
00127   if( (mask & IOM_FACECOLOR)    && !HasPerFaceColor(m) )      mask = mask & (~IOM_FACECOLOR);
00128   if( (mask & IOM_WEDGTEXCOORD) && !HasPerWedgeTexCoord(m) )  mask = mask & (~IOM_WEDGTEXCOORD);
00129   if( (mask & IOM_WEDGNORMAL)   && !HasPerWedgeNormal(m) )   mask = mask & (~IOM_WEDGNORMAL);
00130   if( (mask & IOM_VERTCOLOR)    && !HasPerVertexColor(m) )   mask = mask & (~IOM_VERTCOLOR);
00131 }
00132 
00133 }; // end class
00135 
00136 } // end namespace tri
00137 } // end namespace io
00138 } // end namespace vcg
00139 #endif


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:32:10