MCPcopy Create free account
hub / github.com/ImageEngine/cortex / repr

Function repr

src/IECorePython/ObjectMatrixBinding.cpp:85–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85std::string repr( const ObjectMatrix &m )
86{
87 std::stringstream s;
88
89 s << "IECore.ObjectMatrix(";
90
91 if( m.numRows() > 0 )
92 {
93 s << " [";
94
95 for( size_t x = 0; x < m.numRows(); x++ )
96 {
97 s << " [";
98
99 for( size_t y = 0; y < m.numColumns(); y++ )
100 {
101 object item( m[x][y] );
102 std::string v = call_method< std::string >( item.ptr(), "__repr__" );
103 s << " " << v << ( y == m.numColumns() -1 ? " " : "," );
104 }
105
106 s << "]" << ( x == m.numRows() - 1 ? " " : "," );
107 }
108
109 s << "] ";
110 }
111
112 s << ")";
113
114 return s.str();
115}
116
117size_t convertRowIndex( const ObjectMatrix &m, tuple index )
118{

Callers

nothing calls this directly

Calls 2

numRowsMethod · 0.80
numColumnsMethod · 0.80

Tested by

no test coverage detected