Merge pull request #935 from r-chris/export_precision
setting default export precision to 17 for all exporterspull/939/head
commit
1ed0814f8f
|
@ -94,6 +94,7 @@ ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, co
|
||||||
{
|
{
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
mOutput.imbue( std::locale("C") );
|
mOutput.imbue( std::locale("C") );
|
||||||
|
mOutput.precision(16);
|
||||||
|
|
||||||
mScene = pScene;
|
mScene = pScene;
|
||||||
mSceneOwned = false;
|
mSceneOwned = false;
|
||||||
|
@ -1061,9 +1062,9 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string node_name_escaped = XMLEscape(pNode->mName.data);
|
const std::string node_name_escaped = XMLEscape(pNode->mName.data);
|
||||||
mOutput << startstr
|
mOutput << startstr
|
||||||
<< "<node id=\"" << node_name_escaped
|
<< "<node id=\"" << node_name_escaped
|
||||||
<< "\" name=\"" << node_name_escaped
|
<< "\" name=\"" << node_name_escaped
|
||||||
<< "\" type=\"" << node_type
|
<< "\" type=\"" << node_type
|
||||||
<< "\">" << endstr;
|
<< "\">" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
|
|
|
@ -94,7 +94,9 @@ ObjExporter :: ObjExporter(const char* _filename, const aiScene* pScene)
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
const std::locale& l = std::locale("C");
|
const std::locale& l = std::locale("C");
|
||||||
mOutput.imbue(l);
|
mOutput.imbue(l);
|
||||||
|
mOutput.precision(16);
|
||||||
mOutputMat.imbue(l);
|
mOutputMat.imbue(l);
|
||||||
|
mOutputMat.precision(16);
|
||||||
|
|
||||||
WriteGeometryFile();
|
WriteGeometryFile();
|
||||||
WriteMaterialFile();
|
WriteMaterialFile();
|
||||||
|
|
|
@ -99,6 +99,7 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
const std::locale& l = std::locale("C");
|
const std::locale& l = std::locale("C");
|
||||||
mOutput.imbue(l);
|
mOutput.imbue(l);
|
||||||
|
mOutput.precision(16);
|
||||||
|
|
||||||
unsigned int faces = 0u, vertices = 0u, components = 0u;
|
unsigned int faces = 0u, vertices = 0u, components = 0u;
|
||||||
for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
|
for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
|
||||||
|
|
|
@ -94,6 +94,7 @@ STLExporter :: STLExporter(const char* _filename, const aiScene* pScene, bool bi
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
const std::locale& l = std::locale("C");
|
const std::locale& l = std::locale("C");
|
||||||
mOutput.imbue(l);
|
mOutput.imbue(l);
|
||||||
|
mOutput.precision(16);
|
||||||
if (binary) {
|
if (binary) {
|
||||||
char buf[80] = {0} ;
|
char buf[80] = {0} ;
|
||||||
buf[0] = 'A'; buf[1] = 's'; buf[2] = 's'; buf[3] = 'i'; buf[4] = 'm'; buf[5] = 'p';
|
buf[0] = 'A'; buf[1] = 's'; buf[2] = 's'; buf[3] = 'i'; buf[4] = 'm'; buf[5] = 'p';
|
||||||
|
|
|
@ -146,6 +146,7 @@ StepExporter::StepExporter(const aiScene* pScene, IOSystem* pIOSystem, const std
|
||||||
|
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
mOutput.imbue( std::locale("C") );
|
mOutput.imbue( std::locale("C") );
|
||||||
|
mOutput.precision(16);
|
||||||
|
|
||||||
// start writing
|
// start writing
|
||||||
WriteFile();
|
WriteFile();
|
||||||
|
@ -158,7 +159,9 @@ void StepExporter::WriteFile()
|
||||||
// see http://shodhganga.inflibnet.ac.in:8080/jspui/bitstream/10603/14116/11/11_chapter%203.pdf
|
// see http://shodhganga.inflibnet.ac.in:8080/jspui/bitstream/10603/14116/11/11_chapter%203.pdf
|
||||||
// note, that all realnumber values must be comma separated in x files
|
// note, that all realnumber values must be comma separated in x files
|
||||||
mOutput.setf(std::ios::fixed);
|
mOutput.setf(std::ios::fixed);
|
||||||
mOutput.precision(16); // precission for double
|
// precission for double
|
||||||
|
// see http://stackoverflow.com/questions/554063/how-do-i-print-a-double-value-with-full-precision-using-cout
|
||||||
|
mOutput.precision(16);
|
||||||
|
|
||||||
// standard color
|
// standard color
|
||||||
aiColor4D fColor;
|
aiColor4D fColor;
|
||||||
|
@ -365,4 +368,3 @@ void StepExporter::WriteFile()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ XFileExporter::XFileExporter(const aiScene* pScene, IOSystem* pIOSystem, const s
|
||||||
{
|
{
|
||||||
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
// make sure that all formatting happens using the standard, C locale and not the user's current locale
|
||||||
mOutput.imbue( std::locale("C") );
|
mOutput.imbue( std::locale("C") );
|
||||||
|
mOutput.precision(16);
|
||||||
|
|
||||||
// start writing
|
// start writing
|
||||||
WriteFile();
|
WriteFile();
|
||||||
|
@ -529,4 +530,3 @@ void XFileExporter::writePath(aiString path)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue