MCPcopy Create free account
hub / github.com/Kitware/VTK / Dump

Method Dump

Common/DataModel/vtkTable.cxx:69–145  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

67
68//------------------------------------------------------------------------------
69void vtkTable::Dump(unsigned int colWidth, int rowLimit, unsigned int indent)
70
71{
72 if (!this->GetNumberOfColumns())
73 {
74 std::cout << "++\n++\n";
75 return;
76 }
77
78 std::string lineStr(indent, ' ');
79 for (int c = 0; c < this->GetNumberOfColumns(); ++c)
80 {
81 lineStr += "+-";
82
83 for (unsigned int i = 0; i < colWidth; ++i)
84 {
85 lineStr += "-";
86 }
87 }
88 lineStr += "-+\n";
89
90 std::cout << lineStr;
91
92 std::cout << std::string(indent, ' ');
93 for (int c = 0; c < this->GetNumberOfColumns(); ++c)
94 {
95 std::cout << "| ";
96 const char* name = this->GetColumnName(c);
97 std::string str = name ? name : "";
98
99 if (colWidth < str.length())
100 {
101 std::cout << str.substr(0, colWidth);
102 }
103 else
104 {
105 std::cout << str;
106 for (unsigned int i = static_cast<unsigned int>(str.length()); i < colWidth; ++i)
107 {
108 std::cout << " ";
109 }
110 }
111 }
112
113 std::cout << " |\n" << lineStr;
114
115 if (rowLimit != 0)
116 {
117 for (vtkIdType r = 0; r < this->GetNumberOfRows(); ++r)
118 {
119 std::cout << std::string(indent, ' ');
120 for (int c = 0; c < this->GetNumberOfColumns(); ++c)
121 {
122 std::cout << "| ";
123 std::string str = this->GetValue(r, c).ToString();
124
125 if (colWidth < str.length())
126 {

Callers

nothing calls this directly

Calls 8

GetNumberOfColumnsMethod · 0.95
GetColumnNameMethod · 0.95
GetNumberOfRowsMethod · 0.95
GetValueMethod · 0.95
stringClass · 0.50
lengthMethod · 0.45
ToStringMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected