Changeset 13041 for OpenSceneGraph/trunk/include/osgDB/ParameterOutput
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgDB/ParameterOutput
r9458 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 22 22 { 23 23 public: 24 24 25 25 ParameterOutput(Output& fw): 26 26 _fw(fw), 27 27 _numItemsPerLine(fw.getNumIndicesPerLine()), 28 28 _column(0) {} 29 29 30 30 ParameterOutput(Output& fw,int numItemsPerLine): 31 31 _fw(fw), … … 52 52 _column = 0; 53 53 } 54 54 55 55 template<class T> 56 56 void write(const T& t) … … 59 59 60 60 _fw << t; 61 61 62 62 ++_column; 63 63 if (_column==_numItemsPerLine) … … 72 72 73 73 } 74 74 75 75 template<class Iterator> 76 76 void write(Iterator first, Iterator last) … … 84 84 85 85 } 86 86 87 87 template<class Iterator> 88 88 void writeAsInts(Iterator first, Iterator last) … … 96 96 97 97 } 98 99 98 99 100 100 protected: 101 101 102 102 ParameterOutput& operator = (const ParameterOutput&) { return *this; } 103 103 … … 117 117 118 118 int column=0; 119 119 120 120 for(Iterator itr=first; 121 121 itr!=last; … … 123 123 { 124 124 if (column==0) fw.indent(); 125 125 126 126 fw << *itr; 127 127 128 128 ++column; 129 129 if (column==noItemsPerLine) … … 138 138 } 139 139 if (column!=0) fw << std::endl; 140 140 141 141 fw.moveOut(); 142 142 fw.indent()<<"}"<<std::endl; 143 143 144 144 } 145 145 … … 154 154 155 155 int column=0; 156 156 157 157 for(Iterator itr=first; 158 158 itr!=last; … … 160 160 { 161 161 if (column==0) fw.indent(); 162 162 163 163 fw << (int)*itr; 164 164 165 165 ++column; 166 166 if (column==noItemsPerLine) … … 175 175 } 176 176 if (column!=0) fw << std::endl; 177 177 178 178 fw.moveOut(); 179 179 fw.indent()<<"}"<<std::endl; 180 180 181 181 } 182 182
