float RegionMerger::borderStrength(const coordSet &s1,const coordSet &s2){ set<coord>::iterator it; float s=0.0; for(it=s1.begin();it!=s1.end();it++) s += edgeimg.get_one_float(it->x,it->y); for(it=s2.begin();it!=s2.end();it++) s += edgeimg.get_one_float(it->x,it->y); return s; }
void Foam::gnuplotSetWriter<Type>::write ( const coordSet& points, const wordList& valueSetNames, const List<const Field<Type>*>& valueSets, Ostream& os ) const { os << "set term postscript color" << nl << "set output \"" << points.name() << ".ps\"" << nl << "plot"; forAll(valueSets, i) { if (i != 0) { os << ','; } os << " \"-\" title \"" << valueSetNames[i] << "\" with lines"; } os << nl; forAll(valueSets, i) { this->writeTable(points, *valueSets[i], os); os << "e" << nl; }
void Foam::xmgraceSetWriter<Type>::write ( const coordSet& points, const wordList& valueSetNames, const List<const Field<Type>*>& valueSets, Ostream& os ) const { os << "@g0 on" << nl << "@with g0" << nl << "@ title \"" << points.name() << '"' << nl << "@ xaxis label " << '"' << points.axis() << '"' << nl; forAll(valueSets, i) { os << "@ s" << i << " legend " << '"' << valueSetNames[i] << '"' << nl << "@target G0.S" << i << nl; writeTable(points, *valueSets[i], os); os << '&' << nl; }
void Foam::jplotSetWriter<Type>::write ( const coordSet& points, const wordList& valueSetNames, const List<const Field<Type>*>& valueSets, Ostream& os ) const { os << "# JPlot file" << nl << "# column 1: " << points.name() << nl; forAll(valueSets, i) { os << "# column " << i + 2 << ": " << valueSetNames[i] << nl; }