Added GetExportMaskCapability
This commit is contained in:
parent
2857c3bafb
commit
b32218acdc
|
@ -49,7 +49,7 @@ namespace vcg {
|
|||
typedef typename SaveMeshType::VertexIterator VertexIterator;
|
||||
typedef typename SaveMeshType::FaceIterator FaceIterator;
|
||||
|
||||
static int Save(SaveMeshType &m, const char * filename )
|
||||
static int Save(SaveMeshType &m, const char * filename, int mask=0 )
|
||||
{
|
||||
vcg::face::Pos<FaceType> he;
|
||||
vcg::face::Pos<FaceType> hei;
|
||||
|
@ -58,12 +58,9 @@ namespace vcg {
|
|||
|
||||
|
||||
|
||||
if( m.HasPerVertexNormal())
|
||||
fprintf(fpout,"N");
|
||||
if( m.HasPerVertexColor())
|
||||
fprintf(fpout,"C");
|
||||
if( m.HasPerVertexTexture())
|
||||
fprintf(fpout,"ST");
|
||||
if( m.HasPerVertexNormal() && (mask & io::Mask::IOM_VERTNORMAL)) fprintf(fpout,"N");
|
||||
if( m.HasPerVertexColor() && (mask & io::Mask::IOM_VERTCOLOR)) fprintf(fpout,"C");
|
||||
if( m.HasPerVertexTexture() && (mask & io::Mask::IOM_VERTTEXCOORD)) fprintf(fpout,"ST");
|
||||
fprintf(fpout,"OFF\n");
|
||||
fprintf(fpout,"%d %d ", m.vn, m.fn);
|
||||
|
||||
|
@ -181,6 +178,17 @@ namespace vcg {
|
|||
if(error>1 || error<0) return "Unknown error";
|
||||
else return off_error_msg[error].c_str();
|
||||
}
|
||||
/*
|
||||
returns mask of capability one define with what are the saveable information of the format.
|
||||
*/
|
||||
static int GetExportMaskCapability()
|
||||
{
|
||||
int capability = 0;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTCOORD;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTCOLOR;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACEINDEX;
|
||||
return capability;
|
||||
}
|
||||
|
||||
}; // end class
|
||||
} // end namespace tri
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
History
|
||||
|
||||
$Log: not supported by cvs2svn $
|
||||
Revision 1.14 2006/01/27 09:11:48 corsini
|
||||
fix signed/unsigned mismatch
|
||||
|
||||
Revision 1.13 2006/01/13 15:47:43 cignoni
|
||||
Uniformed return type to the style of Open. Now every export function returns 0 in case of success.
|
||||
|
||||
|
@ -643,6 +646,26 @@ static const char *ErrorMsg(int error)
|
|||
else return ply_error_msg[error].c_str();
|
||||
};
|
||||
|
||||
static int GetExportMaskCapability()
|
||||
{
|
||||
int capability = 0;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTCOORD ;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTFLAGS ;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTCOLOR ;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTQUALITY ;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTNORMAL ;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTTEXCOORD ;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACEINDEX ;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACEFLAGS ;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACECOLOR ;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACEQUALITY ;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACENORMAL ;
|
||||
capability |= vcg::tri::io::Mask::IOM_WEDGCOLOR ;
|
||||
capability |= vcg::tri::io::Mask::IOM_WEDGTEXCOORD ;
|
||||
capability |= vcg::tri::io::Mask::IOM_WEDGTEXMULTI ;
|
||||
capability |= vcg::tri::io::Mask::IOM_WEDGNORMAL ;
|
||||
return capability;
|
||||
}
|
||||
|
||||
|
||||
}; // end class
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
History
|
||||
|
||||
$Log: not supported by cvs2svn $
|
||||
Revision 1.6 2006/01/13 15:47:43 cignoni
|
||||
Uniformed return type to the style of Open. Now every export function returns 0 in case of success.
|
||||
|
||||
Revision 1.5 2005/12/01 00:58:56 cignoni
|
||||
Added and removed typenames for gcc compiling...
|
||||
|
||||
|
@ -136,6 +139,18 @@ static const char *ErrorMsg(int error)
|
|||
else return stl_error_msg[error].c_str();
|
||||
};
|
||||
|
||||
/*
|
||||
returns mask of capability one define with what are the saveable information of the format.
|
||||
*/
|
||||
static int GetExportMaskCapability()
|
||||
{
|
||||
int capability = 0;
|
||||
capability |= vcg::tri::io::Mask::IOM_VERTCOORD;
|
||||
capability |= vcg::tri::io::Mask::IOM_FACEINDEX;
|
||||
return capability;
|
||||
}
|
||||
|
||||
|
||||
}; // end class
|
||||
|
||||
} // end Namespace tri
|
||||
|
|
Loading…
Reference in New Issue