STYLE: fix worst spacing violations for 'os <<' constructions

- accept some violations of the coding guidelines though
- perhaps adding a style exception would be simpler.
This commit is contained in:
Mark Olesen
2010-04-13 17:45:49 +02:00
parent 6b819eb50a
commit 42807ddd7e
37 changed files with 115 additions and 121 deletions

View File

@ -50,7 +50,7 @@ Istream& operator>>
alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp
) )
{ {
is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_;
return is; return is;
} }

View File

@ -59,7 +59,7 @@ public:
friend Ostream& operator<<(Ostream& os, const ent& e) friend Ostream& operator<<(Ostream& os, const ent& e)
{ {
os << e.keyword_ << ' ' << e.i_ << endl; os << e.keyword_ << ' ' << e.i_ << endl;
return os; return os;
} }
}; };
@ -88,7 +88,7 @@ public:
friend Ostream& operator<<(Ostream& os, const Scalar& val) friend Ostream& operator<<(Ostream& os, const Scalar& val)
{ {
os << val.data_; os << val.data_;
return os; return os;
} }
}; };

View File

@ -38,7 +38,7 @@ public:
friend std::ostream& operator<<(std::ostream& os, const Vector<C>& v) friend std::ostream& operator<<(std::ostream& os, const Vector<C>& v)
{ {
os << v.X << '\t' << v.Y << '\n'; os << v.X << '\t' << v.Y << '\n';
return os; return os;
} }
}; };

View File

@ -89,7 +89,7 @@ int main()
{ {
OStringStream os; OStringStream os;
os << table1; os << table1;
HASHTABLE_CLASS<double> readTable(IStringStream(os.str())(), 100); HASHTABLE_CLASS<double> readTable(IStringStream(os.str())(), 100);
Info<< "Istream constructor:" << readTable << endl; Info<< "Istream constructor:" << readTable << endl;

View File

@ -54,7 +54,7 @@ public:
friend Ostream& operator<<(Ostream& os, const Scalar& s) friend Ostream& operator<<(Ostream& os, const Scalar& s)
{ {
os << s.data_; os << s.data_;
return os; return os;
} }

View File

@ -60,7 +60,7 @@ public:
friend Ostream& operator<<(Ostream& os, const Scalar& val) friend Ostream& operator<<(Ostream& os, const Scalar& val)
{ {
os << val.data_; os << val.data_;
return os; return os;
} }
}; };

View File

@ -83,7 +83,7 @@ int main()
{ {
OStringStream os; OStringStream os;
os << table1; os << table1;
HASHTABLE_CLASS<double> readTable(IStringStream(os.str())(), 100); HASHTABLE_CLASS<double> readTable(IStringStream(os.str())(), 100);
Info<< "Istream constructor:" << readTable << endl; Info<< "Istream constructor:" << readTable << endl;

View File

@ -56,7 +56,7 @@ public:
friend Ostream& operator<<(Ostream& os, const ent& e) friend Ostream& operator<<(Ostream& os, const ent& e)
{ {
os << e.keyword_ << ' ' << e.i_ << endl; os << e.keyword_ << ' ' << e.i_ << endl;
return os; return os;
} }
}; };

View File

@ -47,8 +47,7 @@ void writeObj(Ostream& os,const pointField& points)
{ {
const point& pt = points[pointI]; const point& pt = points[pointI];
os << "v " << pt.x() << ' ' << pt.y() os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
<< ' ' << pt.z() << endl;
} }
} }

View File

@ -92,14 +92,14 @@ int main(int argc, char * argv[])
{ {
OSHA1stream os; OSHA1stream os;
os << str; os << str;
Info<< os.digest() << endl; Info<< os.digest() << endl;
os << str; os << str;
Info<< os.digest() << endl; Info<< os.digest() << endl;
os.rewind(); os.rewind();
os << "The quick brown fox jumps over the lazy dog"; os << "The quick brown fox jumps over the lazy dog";
Info<< os.digest() << endl; Info<< os.digest() << endl;
} }

View File

@ -110,9 +110,9 @@ const labelListListList& block::boundaryPatches() const
Ostream& operator<<(Ostream& os, const block& b) Ostream& operator<<(Ostream& os, const block& b)
{ {
os << b.Vertices << nl os << b.Vertices << nl
<< b.Cells << nl << b.Cells << nl
<< b.BoundaryPatches << endl; << b.BoundaryPatches << endl;
return os; return os;
} }

View File

@ -57,7 +57,7 @@ void hexBlock::readPoints(Istream& is)
{ {
forAll(points_, i) forAll(points_, i)
{ {
is >> points_[i].x() >> points_[i].y() >> points_[i].z(); is >> points_[i].x() >> points_[i].y() >> points_[i].z();
} }
// Calculate the handedness of the block // Calculate the handedness of the block

View File

@ -128,13 +128,13 @@ void hexBlock::readPoints
Info<< "Reading " << nPoints << " x coordinates..." << endl; Info<< "Reading " << nPoints << " x coordinates..." << endl;
for (label i=0; i < nPoints; i++) for (label i=0; i < nPoints; i++)
{ {
is >> points_[i].x(); is >> points_[i].x();
} }
Info<< "Reading " << nPoints << " y coordinates..." << endl; Info<< "Reading " << nPoints << " y coordinates..." << endl;
for (label i=0; i < nPoints; i++) for (label i=0; i < nPoints; i++)
{ {
is >> points_[i].y(); is >> points_[i].y();
} }
if (twoDThicknes > 0) if (twoDThicknes > 0)
@ -156,7 +156,7 @@ void hexBlock::readPoints
Info<< "Reading " << nPoints << " z coordinates..." << endl; Info<< "Reading " << nPoints << " z coordinates..." << endl;
for (label i=0; i < nPoints; i++) for (label i=0; i < nPoints; i++)
{ {
is >> points_[i].z(); is >> points_[i].z();
} }
} }
@ -166,7 +166,7 @@ void hexBlock::readPoints
Info<< "Reading " << nPoints << " blanks..." << endl; Info<< "Reading " << nPoints << " blanks..." << endl;
for (label i=0; i < nPoints; i++) for (label i=0; i < nPoints; i++)
{ {
is >> iBlank; is >> iBlank;
} }
} }

View File

@ -51,7 +51,7 @@ using namespace Foam;
void writeOBJ(const point& pt, Ostream& os) void writeOBJ(const point& pt, Ostream& os)
{ {
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
} }
// All edges of mesh // All edges of mesh

View File

@ -58,7 +58,7 @@ Foam::Ostream& Foam::operator<<
if (faceI != -1) if (faceI != -1)
{ {
os<< " fc:" << c.patch_.localFaces()[faceI].centre(pts); os << " fc:" << c.patch_.localFaces()[faceI].centre(pts);
} }
return os; return os;
} }

View File

@ -974,7 +974,7 @@ int main(int argc, char *argv[])
IStringStream is(rawLine + ' '); IStringStream is(rawLine + ' ');
// Type: cellSet, faceSet, pointSet, faceZoneSet // Type: cellSet, faceSet, pointSet, faceZoneSet
is >> setType; is >> setType;
stat = parseType(runTime, mesh, setType, is); stat = parseType(runTime, mesh, setType, is);

View File

@ -85,20 +85,20 @@ void Foam::writeFuns::write
fField.size()*sizeof(float) fField.size()*sizeof(float)
); );
os << std::endl; os << std::endl;
} }
else else
{ {
forAll(fField, i) forAll(fField, i)
{ {
os << fField[i] << ' '; os << fField[i] << ' ';
if (i > 0 && (i % 10) == 0) if (i > 0 && (i % 10) == 0)
{ {
os << std::endl; os << std::endl;
} }
} }
os << std::endl; os << std::endl;
} }
} }
@ -134,20 +134,20 @@ void Foam::writeFuns::write
elems.size()*sizeof(label) elems.size()*sizeof(label)
); );
os << std::endl; os << std::endl;
} }
else else
{ {
forAll(elems, i) forAll(elems, i)
{ {
os << elems[i] << ' '; os << elems[i] << ' ';
if (i > 0 && (i % 10) == 0) if (i > 0 && (i % 10) == 0)
{ {
os << std::endl; os << std::endl;
} }
} }
os << std::endl; os << std::endl;
} }
} }

View File

@ -85,12 +85,12 @@ void writeBytes(char* start, int nBytes)
// Debug: write wall flags data // Debug: write wall flags data
void writeWallFlags(Ostream& os, label cellI, const labelList& wallFlags) void writeWallFlags(Ostream& os, label cellI, const labelList& wallFlags)
{ {
os << "cell " << cellI << " wallsFlags:"; os << "cell " << cellI << " wallsFlags:";
forAll(wallFlags, wallFaceI) forAll(wallFlags, wallFaceI)
{ {
os << wallFlags[wallFaceI] << " "; os << wallFlags[wallFaceI] << ' ';
} }
os << endl; os << endl;
} }

View File

@ -99,12 +99,12 @@ void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
{ {
if (flds.size()) if (flds.size())
{ {
os << msg; os << msg;
forAll(flds, i) forAll(flds, i)
{ {
os<< ' ' << flds[i].name(); os << ' ' << flds[i].name();
} }
os << endl; os << endl;
} }
} }
@ -113,9 +113,9 @@ void print(Ostream& os, const wordList& flds)
{ {
forAll(flds, i) forAll(flds, i)
{ {
os<< ' ' << flds[i]; os << ' ' << flds[i];
} }
os << endl; os << endl;
} }

View File

@ -163,12 +163,12 @@ void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
{ {
if (flds.size()) if (flds.size())
{ {
os << msg; os << msg;
forAll(flds, i) forAll(flds, i)
{ {
os<< ' ' << flds[i].name(); os << ' ' << flds[i].name();
} }
os << endl; os << endl;
} }
} }
@ -177,9 +177,9 @@ void print(Ostream& os, const wordList& flds)
{ {
forAll(flds, i) forAll(flds, i)
{ {
os<< ' ' << flds[i]; os << ' ' << flds[i];
} }
os << endl; os << endl;
} }

View File

@ -94,20 +94,20 @@ void Foam::writeFuns::write
fField.size()*sizeof(float) fField.size()*sizeof(float)
); );
os << std::endl; os << std::endl;
} }
else else
{ {
forAll(fField, i) forAll(fField, i)
{ {
os << fField[i] << ' '; os << fField[i] << ' ';
if (i > 0 && (i % 10) == 0) if (i > 0 && (i % 10) == 0)
{ {
os << std::endl; os << std::endl;
} }
} }
os << std::endl; os << std::endl;
} }
} }
@ -143,20 +143,20 @@ void Foam::writeFuns::write
elems.size()*sizeof(label) elems.size()*sizeof(label)
); );
os << std::endl; os << std::endl;
} }
else else
{ {
forAll(elems, i) forAll(elems, i)
{ {
os << elems[i] << ' '; os << elems[i] << ' ';
if (i > 0 && (i % 10) == 0) if (i > 0 && (i % 10) == 0)
{ {
os << std::endl; os << std::endl;
} }
} }
os << std::endl; os << std::endl;
} }
} }
@ -186,11 +186,11 @@ void Foam::writeFuns::writeHeader
if (binary) if (binary)
{ {
os << "BINARY" << std::endl; os << "BINARY" << std::endl;
} }
else else
{ {
os << "ASCII" << std::endl; os << "ASCII" << std::endl;
} }
} }

View File

@ -502,15 +502,14 @@ void vtkPV3FoamReader::PrintSelf(ostream& os, vtkIndent indent)
vtkDebugMacro(<<"PrintSelf"); vtkDebugMacro(<<"PrintSelf");
this->Superclass::PrintSelf(os,indent); this->Superclass::PrintSelf(os,indent);
os<< indent << "File name: " os << indent << "File name: "
<< (this->FileName ? this->FileName : "(none)") << "\n"; << (this->FileName ? this->FileName : "(none)") << "\n";
foamData_->PrintSelf(os, indent); foamData_->PrintSelf(os, indent);
os<< indent << "Time step range: " os << indent << "Time step range: "
<< this->TimeStepRange[0] << " - " << this->TimeStepRange[1] << this->TimeStepRange[0] << " - " << this->TimeStepRange[1] << "\n"
<< "\n"; << indent << "Time step: " << this->GetTimeStep() << endl;
os<< indent << "Time step: " << this->GetTimeStep() << endl;
} }

View File

@ -283,8 +283,8 @@ void vtkPV3blockMeshReader::PrintSelf(ostream& os, vtkIndent indent)
vtkDebugMacro(<<"PrintSelf"); vtkDebugMacro(<<"PrintSelf");
this->Superclass::PrintSelf(os,indent); this->Superclass::PrintSelf(os,indent);
os<< indent << "File name: " os << indent << "File name: "
<< (this->FileName ? this->FileName : "(none)") << "\n"; << (this->FileName ? this->FileName : "(none)") << "\n";
foamData_->PrintSelf(os, indent); foamData_->PrintSelf(os, indent);
} }

View File

@ -41,7 +41,7 @@ Foam::Ostream& Foam::operator<<
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::sumData& wDist) Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::sumData& wDist)
{ {
return is >> wDist.oldFace_ >> wDist.sum_ >> wDist.count_; return is >> wDist.oldFace_ >> wDist.sum_ >> wDist.count_;
} }

View File

@ -65,7 +65,7 @@ void writeOBJ(Ostream& os, const pointField& pts)
{ {
const point& pt = pts[i]; const point& pt = pts[i];
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
} }
} }
@ -85,7 +85,7 @@ void dumpPoints(const triSurface& surf, const labelList& borderPoint)
{ {
const point& pt = surf.localPoints()[pointI]; const point& pt = surf.localPoints()[pointI];
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
} }
} }
} }
@ -108,7 +108,7 @@ void dumpEdges(const triSurface& surf, const boolList& borderEdge)
{ {
const edge& e = surf.edges()[edgeI]; const edge& e = surf.edges()[edgeI];
os << "l " << e.start()+1 << ' ' << e.end()+1 << endl; os << "l " << e.start()+1 << ' ' << e.end()+1 << endl;
} }
} }
} }

View File

@ -95,13 +95,13 @@ public:
friend Istream& operator>>(Istream& is, substance& s) friend Istream& operator>>(Istream& is, substance& s)
{ {
is >> s.name_ >> s.volFrac_; is >> s.name_ >> s.volFrac_;
return is; return is;
} }
friend Ostream& operator<<(Ostream& os, const substance& s) friend Ostream& operator<<(Ostream& os, const substance& s)
{ {
os << s.name_ << token::SPACE << s.volFrac_; os << s.name_ << token::SPACE << s.volFrac_;
return os; return os;
} }
}; };

View File

@ -122,19 +122,18 @@ void printSourceFileAndLine
if (line == "") if (line == "")
{ {
os << " addr2line failed"; os << " addr2line failed";
} }
else if (line == "??:0") else if (line == "??:0")
{ {
os << " in " << filename; os << " in " << filename;
} }
else else
{ {
string cwdLine(line.replaceAll(cwd() + '/', "")); string cwdLine(line.replaceAll(cwd() + '/', ""));
string homeLine(cwdLine.replaceAll(home(), '~')); string homeLine(cwdLine.replaceAll(home(), '~'));
os << " at " << homeLine.c_str(); os << " at " << homeLine.c_str();
} }
} }
} }
@ -160,11 +159,11 @@ void getSymbolForRaw
if (fcnt != "") if (fcnt != "")
{ {
os << fcnt.c_str(); os << fcnt.c_str();
return; return;
} }
} }
os << "Uninterpreted: " << raw.c_str(); os << "Uninterpreted: " << raw.c_str();
} }
@ -210,8 +209,8 @@ void error::printStack(Ostream& os)
fileName programFile; fileName programFile;
word address; word address;
os << '#' << label(i) << " "; os << '#' << label(i) << " ";
//os << "Raw : " << msg << "\n\t"; //os << "Raw : " << msg << "\n\t";
{ {
string::size_type lPos = msg.find('['); string::size_type lPos = msg.find('[');
string::size_type rPos = msg.find(']'); string::size_type rPos = msg.find(']');
@ -263,12 +262,12 @@ void error::printStack(Ostream& os)
if (status == 0 && cplusNamePtr) if (status == 0 && cplusNamePtr)
{ {
os << cplusNamePtr; os << cplusNamePtr;
free(cplusNamePtr); free(cplusNamePtr);
} }
else else
{ {
os << cName.c_str(); os << cName.c_str();
} }
} }
else else
@ -279,7 +278,7 @@ void error::printStack(Ostream& os)
{ {
string fullName(msg.substr(start, endBracketPos-start)); string fullName(msg.substr(start, endBracketPos-start));
os << fullName.c_str() << nl; os << fullName.c_str() << nl;
} }
else else
{ {
@ -296,7 +295,7 @@ void error::printStack(Ostream& os)
printSourceFileAndLine(os, addressMap, programFile, address); printSourceFileAndLine(os, addressMap, programFile, address);
os << nl; os << nl;
} }
free(strings); free(strings);

View File

@ -71,7 +71,7 @@ void Foam::coupledPolyPatch::writeOBJ
writeOBJ(os, p1); writeOBJ(os, p1);
vertI++; vertI++;
os<< "l " << vertI-1 << ' ' << vertI << nl; os << "l " << vertI-1 << ' ' << vertI << nl;
} }

View File

@ -3036,12 +3036,12 @@ void Foam::cellCuts::writeOBJ
vertI++; vertI++;
} }
os << 'f'; os << 'f';
forAll(loopPts, fp) forAll(loopPts, fp)
{ {
os << ' ' << startVertI + fp + 1; os << ' ' << startVertI + fp + 1;
} }
os<< endl; os << endl;
} }

View File

@ -67,7 +67,7 @@ bool Foam::IOPosition<ParticleType>::write() const
template<class ParticleType> template<class ParticleType>
bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
{ {
os<< cloud_.size() << nl << token::BEGIN_LIST << nl; os << cloud_.size() << nl << token::BEGIN_LIST << nl;
forAllConstIter(typename Cloud<ParticleType>, cloud_, iter) forAllConstIter(typename Cloud<ParticleType>, cloud_, iter)
{ {
@ -80,7 +80,7 @@ bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
os << nl; os << nl;
} }
os<< token::END_LIST << endl; os << token::END_LIST << endl;
return os.good(); return os.good();
} }

View File

@ -36,7 +36,7 @@ void Foam::treeLeaf<Type>::space(Ostream& os, const label n)
{ {
for (label i=0; i<n; i++) for (label i=0; i<n; i++)
{ {
os<< ' '; os << ' ';
} }
} }

View File

@ -104,7 +104,7 @@ void Foam::treeNode<Type>::space(Ostream& os, const label n)
{ {
for (label i=0; i<n; i++) for (label i=0; i<n; i++)
{ {
os<< ' '; os << ' ';
} }
} }

View File

@ -53,7 +53,7 @@ void triSurface::writeDXGeometry
os << "# " << patchI << " " os << "# " << patchI << " "
<< myPatches[patchI].name() << endl; << myPatches[patchI].name() << endl;
} }
os << endl << endl; os << nl << endl;
// Write vertex coordinates // Write vertex coordinates
@ -63,7 +63,7 @@ void triSurface::writeDXGeometry
forAll(localPoints(), pointI) forAll(localPoints(), pointI)
{ {
const point& pt = localPoints()[pointI]; const point& pt = localPoints()[pointI];
os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
} }
os << endl; os << endl;
@ -87,10 +87,9 @@ void triSurface::writeDXGeometry
) )
{ {
const label faceI = faceMap[faceIndex++]; const label faceI = faceMap[faceIndex++];
const labelledTri& f = localFaces()[faceI]; const labelledTri& f = localFaces()[faceI];
os << f[0] << ' ' << f[1] << ' ' << f[2] << endl; os << f[0] << ' ' << f[1] << ' ' << f[2] << endl;
} }
} }
} }
@ -100,11 +99,11 @@ void triSurface::writeDXGeometry
{ {
const labelledTri& f = localFaces()[faceI]; const labelledTri& f = localFaces()[faceI];
os << f[0] << ' ' << f[1] << ' ' << f[2] << endl; os << f[0] << ' ' << f[1] << ' ' << f[2] << endl;
} }
} }
os << "attribute \"element type\" string \"triangles\"" << endl os << "attribute \"element type\" string \"triangles\"" << endl
<< "attribute \"ref\" string \"positions\"" << endl << endl; << "attribute \"ref\" string \"positions\"" << endl << endl;
} }
@ -139,7 +138,7 @@ void triSurface::writeDX(const bool writeSorted, Ostream& os) const
{ {
forAll(myPatches[patchI], patchFaceI) forAll(myPatches[patchI], patchFaceI)
{ {
os << patchI << endl; os << patchI << endl;
} }
} }
} }
@ -149,7 +148,7 @@ void triSurface::writeDX(const bool writeSorted, Ostream& os) const
forAll(*this, faceI) forAll(*this, faceI)
{ {
os << faceI << endl; os << faceI << endl;
} }
} }
@ -157,7 +156,7 @@ void triSurface::writeDX(const bool writeSorted, Ostream& os) const
writeDXTrailer(os); writeDXTrailer(os);
os << "end" << endl; os << "end" << endl;
} }
@ -173,7 +172,7 @@ void triSurface::writeDX(const scalarField& field, Ostream& os) const
<< " data follows" << endl; << " data follows" << endl;
forAll(field, faceI) forAll(field, faceI)
{ {
os << field[faceI] << endl; os << field[faceI] << endl;
} }
os << endl os << endl
<< "attribute \"dep\" string \"connections\"" << endl << endl; << "attribute \"dep\" string \"connections\"" << endl << endl;
@ -185,7 +184,7 @@ void triSurface::writeDX(const scalarField& field, Ostream& os) const
<< " data follows" << endl; << " data follows" << endl;
forAll(field, pointI) forAll(field, pointI)
{ {
os << field[pointI] << endl; os << field[pointI] << endl;
} }
os << endl os << endl
<< "attribute \"dep\" string \"positions\"" << endl << endl; << "attribute \"dep\" string \"positions\"" << endl << endl;
@ -202,7 +201,7 @@ void triSurface::writeDX(const scalarField& field, Ostream& os) const
writeDXTrailer(os); writeDXTrailer(os);
os << "end" << endl; os << "end" << endl;
} }
@ -251,7 +250,7 @@ void triSurface::writeDX(const vectorField& field, Ostream& os) const
writeDXTrailer(os); writeDXTrailer(os);
os << "end" << endl; os << "end" << endl;
} }

View File

@ -79,7 +79,7 @@ void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const
{ {
// Print all faces belonging to this patch // Print all faces belonging to this patch
os << "g " << myPatches[patchI].name() << nl; os << "g " << myPatches[patchI].name() << nl;
for for
( (
@ -121,7 +121,7 @@ void triSurface::writeOBJ(const bool writeSorted, Ostream& os) const
if (prevPatchI != patchIDs[faceI]) if (prevPatchI != patchIDs[faceI])
{ {
prevPatchI = patchIDs[faceI]; prevPatchI = patchIDs[faceI];
os << "g " << myPatches[patchIDs[faceI]].name() << nl; os << "g " << myPatches[patchIDs[faceI]].name() << nl;
} }
os << "f " os << "f "
<< operator[](faceI)[0] + 1 << ' ' << operator[](faceI)[0] + 1 << ' '

View File

@ -48,7 +48,7 @@ void triSurface::writeOFF(const bool writeSorted, Ostream& os) const
os << "# " << patchI << " " os << "# " << patchI << " "
<< myPatches[patchI].name() << endl; << myPatches[patchI].name() << endl;
} }
os << endl << endl; os << nl << endl;
const pointField& ps = points(); const pointField& ps = points();
@ -56,7 +56,7 @@ void triSurface::writeOFF(const bool writeSorted, Ostream& os) const
<< ps.size() << ps.size()
<< ' ' << size() << ' ' << size()
<< ' ' << nEdges() << ' ' << nEdges()
<< endl << endl; << nl << endl;
// Write vertex coords // Write vertex coords
forAll(ps, pointi) forAll(ps, pointi)
@ -66,7 +66,7 @@ void triSurface::writeOFF(const bool writeSorted, Ostream& os) const
<< ps[pointi].z() << " #" << pointi << endl; << ps[pointi].z() << " #" << pointi << endl;
} }
os << endl; os << endl;
if (writeSorted) if (writeSorted)
{ {

View File

@ -48,7 +48,7 @@ void triSurface::writeSTLASCII(Ostream& os) const
// Print all faces belonging to this region // Print all faces belonging to this region
const surfacePatch& patch = myPatches[patchI]; const surfacePatch& patch = myPatches[patchI];
os << "solid " << patch.name() << endl; os << "solid " << patch.name() << endl;
for for
( (
@ -62,8 +62,8 @@ void triSurface::writeSTLASCII(Ostream& os) const
const vector& n = faceNormals()[faceI]; const vector& n = faceNormals()[faceI];
os << " facet normal " os << " facet normal "
<< n.x() << ' ' << n.y() << ' ' << n.z() << endl; << n.x() << ' ' << n.y() << ' ' << n.z() << nl
os << " outer loop" << endl; << " outer loop" << endl;
const labelledTri& f = (*this)[faceI]; const labelledTri& f = (*this)[faceI];
const point& pa = points()[f[0]]; const point& pa = points()[f[0]];
@ -71,18 +71,16 @@ void triSurface::writeSTLASCII(Ostream& os) const
const point& pc = points()[f[2]]; const point& pc = points()[f[2]];
os << " vertex " os << " vertex "
<< pa.x() << ' ' << pa.y() << ' ' << pa.z() << endl; << pa.x() << ' ' << pa.y() << ' ' << pa.z() << nl
os << " vertex " << " vertex "
<< pb.x() << ' ' << pb.y() << ' ' << pb.z() << endl; << pb.x() << ' ' << pb.y() << ' ' << pb.z() << nl
os << " vertex " << " vertex "
<< pc.x() << ' ' << pc.y() << ' ' << pc.z() << endl; << pc.x() << ' ' << pc.y() << ' ' << pc.z() << nl
os << " endloop" << nl
<< " endloop" << endl;
os
<< " endfacet" << endl; << " endfacet" << endl;
} }
os << "endsolid " << patch.name() << endl; os << "endsolid " << patch.name() << endl;
} }
} }

View File

@ -120,7 +120,7 @@ Foam::surfacePatchIOList::~surfacePatchIOList()
// writeData member function required by regIOobject // writeData member function required by regIOobject
bool Foam::surfacePatchIOList::writeData(Ostream& os) const bool Foam::surfacePatchIOList::writeData(Ostream& os) const
{ {
os << *this; os << *this;
return os.good(); return os.good();
} }