MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / parseAffineXf

Function parseAffineXf

source/MRIOExtras/MR3mf.cpp:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32{
33
34static Expected <AffineXf3f> parseAffineXf( const std::string& s )
35{
36 std::istringstream ss( s );
37 double value;
38 AffineXf3d xf;
39 int row = 0, col = 0;
40 while ( ss >> value )
41 {
42 if ( col == 4 )
43 return unexpected( "3MF: too many elements in transform" );
44 if ( col < 3 )
45 xf.A[row][col] = value;
46 else
47 xf.b[row] = value;
48 if ( ++row == 3 )
49 {
50 row = 0;
51 ++col;
52 }
53 }
54 if ( !( col == 4 && row == 0 ) )
55 return unexpected( "3MF: too few elements in transform" );
56 return AffineXf3f( xf );
57}
58
59static Expected<Color> parseColor( const std::string& s )
60{

Callers 2

loadObject_Method · 0.85
loadBuildData_Method · 0.85

Calls 1

unexpectedFunction · 0.50

Tested by

no test coverage detected