Added GetExportMaskCapability
This commit is contained in:
parent
2857c3bafb
commit
b32218acdc
wrap/io_trimesh
|
@ -49,7 +49,7 @@ namespace vcg {
|
||||||
typedef typename SaveMeshType::VertexIterator VertexIterator;
|
typedef typename SaveMeshType::VertexIterator VertexIterator;
|
||||||
typedef typename SaveMeshType::FaceIterator FaceIterator;
|
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> he;
|
||||||
vcg::face::Pos<FaceType> hei;
|
vcg::face::Pos<FaceType> hei;
|
||||||
|
@ -58,12 +58,9 @@ namespace vcg {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( m.HasPerVertexNormal())
|
if( m.HasPerVertexNormal() && (mask & io::Mask::IOM_VERTNORMAL)) fprintf(fpout,"N");
|
||||||
fprintf(fpout,"N");
|
if( m.HasPerVertexColor() && (mask & io::Mask::IOM_VERTCOLOR)) fprintf(fpout,"C");
|
||||||
if( m.HasPerVertexColor())
|
if( m.HasPerVertexTexture() && (mask & io::Mask::IOM_VERTTEXCOORD)) fprintf(fpout,"ST");
|
||||||
fprintf(fpout,"C");
|
|
||||||
if( m.HasPerVertexTexture())
|
|
||||||
fprintf(fpout,"ST");
|
|
||||||
fprintf(fpout,"OFF\n");
|
fprintf(fpout,"OFF\n");
|
||||||
fprintf(fpout,"%d %d ", m.vn, m.fn);
|
fprintf(fpout,"%d %d ", m.vn, m.fn);
|
||||||
|
|
||||||
|
@ -181,6 +178,17 @@ namespace vcg {
|
||||||
if(error>1 || error<0) return "Unknown error";
|
if(error>1 || error<0) return "Unknown error";
|
||||||
else return off_error_msg[error].c_str();
|
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 class
|
||||||
} // end namespace tri
|
} // end namespace tri
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$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
|
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.
|
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();
|
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
|
}; // end class
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$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
|
Revision 1.5 2005/12/01 00:58:56 cignoni
|
||||||
Added and removed typenames for gcc compiling...
|
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();
|
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 class
|
||||||
|
|
||||||
} // end Namespace tri
|
} // end Namespace tri
|
||||||
|
|
Loading…
Reference in New Issue