| 32 | { |
| 33 | |
| 34 | static 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 | |
| 59 | static Expected<Color> parseColor( const std::string& s ) |
| 60 | { |
no test coverage detected