1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026922: Huge performance issue writing data to the output stream

Test case for issue CR26922

Correction of literal (char to string)
This commit is contained in:
mgn
2015-12-02 16:39:55 +03:00
committed by bugmaster
parent cc6852f3e9
commit 586db386eb
183 changed files with 3221 additions and 3181 deletions

View File

@@ -100,7 +100,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, P1);
proj.Parameters(i,UU,VV);
di << " Le point est sur la surface." << "\n";
di << " Le point est sur la surface.\n";
di << " Ses parametres sont: UU = " << UU << "\n";
di << " VV = " << VV << "\n";
}
@@ -139,7 +139,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
DrawTrSurf::Set(temp, P1);
di << name << " ";
UU = proj.Parameter(i);
di << " Le point est sur la courbe." << "\n";
di << " Le point est sur la courbe.\n";
di << " Son parametre est U = " << UU << "\n";
}
}
@@ -541,7 +541,7 @@ static Standard_Integer totalextcc(Draw_Interpretor& di, Standard_Integer n, con
di << "Extrema is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
}
else {
di << "Extrema is segment of line" << "\n";
di << "Extrema is segment of line\n";
Handle(Geom_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
@@ -558,7 +558,7 @@ static Standard_Integer totalextcc(Draw_Interpretor& di, Standard_Integer n, con
}
else {
di << "Curves are infinite and parallel" << "\n";
di << "Curves are infinite and parallel\n";
}
di << "Minimal distance : " << Ex.TotalLowerDistance() << "\n";

View File

@@ -221,7 +221,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
else {
// C-R-R
di << "Curve, radius, radius ???"<<"\n";
di << "Curve, radius, radius ???\n";
return 1;
}
}
@@ -308,7 +308,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
else {
// P-R-R
di << "Point, radius, radius ???"<<"\n";
di << "Point, radius, radius ???\n";
return 1;
}
}
@@ -338,7 +338,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
else {
// R-C-R
di << "Radius - Curve - Radius ??"<<"\n";
di << "Radius - Curve - Radius ??\n";
return 1;
}
}
@@ -364,13 +364,13 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
}
else {
// R-P-R
di << "Radius - Point - Radius ??"<<"\n";
di << "Radius - Point - Radius ??\n";
return 1;
}
}
else {
// R-R-..
di << "radius, radius ???"<<"\n";
di << "radius, radius ???\n";
return 1;
}
}
@@ -418,7 +418,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
}
}
else
di << "Lin2dTanObl Not done" << "\n";
di << "Lin2dTanObl Not done\n";
}
else {
Geom2dGcc_Lin2d2Tan ct3(Geom2dGcc::Unqualified(C1),
@@ -436,7 +436,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
}
}
else
di << "Lin2d2Tan Not done" << "\n";
di << "Lin2d2Tan Not done\n";
}
DrawTrSurf_CurveColor(col);
@@ -449,12 +449,12 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
//==================================================================================
{
if (n == 1) {
di <<"give a name to your curve !" << "\n";
di <<"give a name to your curve !\n";
return 0;
}
if (n == 2) {
Standard_Integer id,XX,YY,b, i, j;
di << "Pick points "<< "\n";
di << "Pick points \n";
dout.Select(id, XX, YY, b);
Standard_Real zoom = dout.Zoom(id);
if (b != 1) return 0;
@@ -780,8 +780,8 @@ static Standard_Integer gcarc (Draw_Interpretor& di,Standard_Integer n, const ch
}
}
}
di <<"give a name for arc and the type seg or cir then" << "\n";
di <<"give passing points p1 p2 for seg p1 p2 p3 or p1 p2 p3 p4 for cir (p2 p3 is a tgtvec)!" << "\n";
di <<"give a name for arc and the type seg or cir then\n";
di <<"give passing points p1 p2 for seg p1 p2 p3 or p1 p2 p3 p4 for cir (p2 p3 is a tgtvec)!\n";
return 0;
}

View File

@@ -272,7 +272,7 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
ONE = 2;
}
else {
di << "gproject wait 2 or 3 arguments" << "\n";
di << "gproject wait 2 or 3 arguments\n";
return 1;
}
@@ -309,8 +309,8 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
Projector.GetSurface()->D0(P2d.X(), P2d.Y(), P);
DrawTrSurf::Set(temp, P);
DrawTrSurf::Set(temp1, P2d);
di<<temp<<" is 3d projected curve"<<"\n";
di<<temp1<<" is pcurve"<<"\n";
di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve\n";
}
else {
Only2d = Only3d = Standard_False;
@@ -358,8 +358,8 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Curve) OutCur = new Geom_TrimmedCurve(GeomAdaptor::MakeCurve(hcur->Curve()), Ufin, Udeb);
DrawTrSurf::Set(temp, OutCur);
DrawTrSurf::Set(temp1, PCur2d);
di<<temp<<" is 3d projected curve"<<"\n";
di<<temp1<<" is pcurve"<<"\n";
di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve\n";
return 0;
}
else {
@@ -382,8 +382,8 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
DrawTrSurf::Set(temp, appr.Curve3d());
}
DrawTrSurf::Set(temp1, PCur2d);
di<<temp<<" is 3d projected curve"<<"\n";
di<<temp1<<" is pcurve"<<"\n";
di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve\n";
}
}
}
@@ -399,10 +399,10 @@ static Standard_Integer project (Draw_Interpretor& di,
{
if ( n == 1) {
di << "project result2d c3d surf [-e p] [-v n] [-t tol]" << "\n";
di << " -e p : extent the surface of <p>%" << "\n";
di << " -v n : verify the projection at <n> points." << "\n";
di << " -t tol : set the tolerance for approximation" << "\n";
di << "project result2d c3d surf [-e p] [-v n] [-t tol]\n";
di << " -e p : extent the surface of <p>%\n";
di << " -v n : verify the projection at <n> points.\n";
di << " -t tol : set the tolerance for approximation\n";
return 0;
}
@@ -445,7 +445,7 @@ static Standard_Integer project (Draw_Interpretor& di,
GeomProjLib::Curve2d(GC, GS, U1, U2, V1, V2, tolerance);
if ( G2d.IsNull() ) {
di << "\n" << "Projection Failed" << "\n";
di << "\nProjection Failed\n";
return 1;
}
else {
@@ -453,7 +453,7 @@ static Standard_Integer project (Draw_Interpretor& di,
}
if ( Verif) { // verify the projection on n points
if ( NbPoints <= 0) {
di << " n must be positive" << "\n";
di << " n must be positive\n";
return 0;
}
gp_Pnt P1,P2;
@@ -494,7 +494,7 @@ Standard_Integer projonplane(Draw_Interpretor& di,
Handle(Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(S);
if ( Pl.IsNull()) {
di << " The surface must be a plane" << "\n";
di << " The surface must be a plane\n";
return 1;
}
@@ -592,7 +592,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
}
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
@@ -610,7 +610,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
}
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
@@ -629,7 +629,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
}
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
@@ -648,12 +648,12 @@ static Standard_Integer bisec (Draw_Interpretor& di,
}
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
else {
di << " args must be line/circle/point line/circle/point" << "\n";
di << " args must be line/circle/point line/circle/point\n";
return 1;
}
}
@@ -670,7 +670,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
}
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
@@ -682,13 +682,13 @@ static Standard_Integer bisec (Draw_Interpretor& di,
solution(Bis.ThisSolution(),a[1],0);
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
}
else {
di << " the second arg must be line/circle/point " << "\n";
di << " the second arg must be line/circle/point \n";
}
}
else if ( ip1) {
@@ -706,7 +706,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
}
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
@@ -718,7 +718,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
solution(Bis.ThisSolution(),a[1],0);
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
@@ -730,25 +730,25 @@ static Standard_Integer bisec (Draw_Interpretor& di,
DrawTrSurf::Set(a[1],new Geom2d_Line(Bis.ThisSolution()));
}
else {
di << " Bisec has failed !!" << "\n";
di << " Bisec has failed !!\n";
return 1;
}
}
else {
di << " the second arg must be line/circle/point " << "\n";
di << " the second arg must be line/circle/point \n";
return 1;
}
}
else {
di << " args must be line/circle/point line/circle/point" << "\n";
di << " args must be line/circle/point line/circle/point\n";
return 1;
}
if ( NbSol >= 2) {
di << "There are " << NbSol << " Solutions." << "\n";
di << "There are " << NbSol << " Solutions.\n";
}
else {
di << "There is " << NbSol << " Solution." << "\n";
di << "There is " << NbSol << " Solution.\n";
}
return 0;
@@ -819,7 +819,7 @@ static Standard_Integer movelaw (Draw_Interpretor& di, Standard_Integer n, const
Draw::Repaint();
}
else {
di << "Not enought degree of freedom increase degree please" << "\n";
di << "Not enought degree of freedom increase degree please\n";
}
@@ -993,7 +993,7 @@ static Standard_Integer crvpoints (Draw_Interpretor& di, Standard_Integer /*n*/,
GCPnts_QuasiUniformDeflection PntGen(GAC, defl);
if(!PntGen.IsDone()) {
di << "Points generation failed" << "\n";
di << "Points generation failed\n";
return 1;
}
@@ -1100,7 +1100,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
ellip = DrawTrSurf::GetBSplineCurve(a[1]);
if (ellip.IsNull())
{
di << " BSpline is NULL "<<"\n";
di << " BSpline is NULL \n";
return 1;
}*/
@@ -1108,7 +1108,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
ellip = DrawTrSurf::GetCurve(a[1]);
if (ellip.IsNull())
{
di << " Curve is NULL "<<"\n";
di << " Curve is NULL \n";
return 1;
}
@@ -1146,7 +1146,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
catch (Standard_Failure )
{
di << " Standard Failure " <<"\n";
di << " Standard Failure \n";
}
return 0;
}
@@ -1194,7 +1194,7 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
catch(Standard_Failure)
{
di << " Standard Failure "<<"\n";
di << " Standard Failure \n";
}
try
@@ -1223,7 +1223,7 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
catch (Standard_Failure )
{
di << " Standard Failure " <<"\n";
di << " Standard Failure \n";
}
return 0;
}
@@ -1625,14 +1625,14 @@ static Standard_Integer intersection (Draw_Interpretor& di,
}//else if (n == 8 || n == 9 || n == 12 || n == 13 || n == 16 || n == 17)
else
{
di<<"incorrect number of arguments"<<"\n";
di<<"incorrect number of arguments\n";
return 1;
}
//
if (!Inters.IsDone())
{
di<<"No intersections found!"<<"\n";
di<<"No intersections found!\n";
return 1;
}
@@ -1681,7 +1681,7 @@ static Standard_Integer intersection (Draw_Interpretor& di,
//
if (!Inters.IsDone())
{
di<<"No intersections found!"<<"\n";
di<<"No intersections found!\n";
return 1;
}

View File

@@ -34,7 +34,7 @@ Standard_Boolean IsGoodNumber(Standard_Integer argc, Standard_Integer waiting, D
// argc vaut 1 de plus, puisque argv[0] contient le nom de la commande
if (argc != (waiting+1))
{
di << "Waiting "<< waiting << " arguments" << "\n";
di << "Waiting "<< waiting << " arguments\n";
return Standard_False;
}
else
@@ -75,7 +75,7 @@ BattenCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
Handle(DrawFairCurve_Batten) aBatten = new DrawFairCurve_Batten(Bat);
if (aBatten.IsNull()) {
di << " Batten null "<< "\n";
di << " Batten null \n";
return 1;
}
Draw::Set(BattenName,aBatten);
@@ -118,7 +118,7 @@ MVCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
Handle(DrawFairCurve_MinimalVariation) aMVC = new DrawFairCurve_MinimalVariation(MVC);
if (aMVC.IsNull()) {
di << " MVC null "<< "\n";
di << " MVC null \n";
return 1;
}
Draw::Set(MVCName, aMVC);

View File

@@ -231,12 +231,12 @@ static Standard_Integer ruled(Draw_Interpretor& di,
Handle(Geom_Curve) C1 = DrawTrSurf::GetCurve(a[2]);
if ( C1.IsNull()) {
di << " C1 is not a Curve ==> Command failed" << "\n";
di << " C1 is not a Curve ==> Command failed\n";
return 1;
}
Handle(Geom_Curve) C2 = DrawTrSurf::GetCurve(a[3]);
if ( C2.IsNull()) {
di << " C2 is not a Curve ==> Command failed" << "\n";
di << " C2 is not a Curve ==> Command failed\n";
return 1;
}
@@ -277,7 +277,7 @@ static Standard_Integer appsurf(Draw_Interpretor& di,
App.Perform( Line, Section);
if ( !App.IsDone()) {
di << " Approximation aux fraises " << "\n";
di << " Approximation aux fraises \n";
}
Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;

View File

@@ -321,13 +321,13 @@ static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const
//
aC=DrawTrSurf::GetCurve(a[1]);
if (aC.IsNull()) {
di << "Error: " << a[1] << " is not a curve!" << "\n";
di << "Error: " << a[1] << " is not a curve!\n";
return 0;
}
//
aS=DrawTrSurf::GetSurface(a[2]);
if (aS.IsNull()) {
di << "Error: " << a[2] << " is not a surface!" << "\n";
di << "Error: " << a[2] << " is not a surface!\n";
return 0;
}
//
@@ -354,7 +354,7 @@ static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const
aPPS.Init(aP, aS, aTol);
bRet=aPPS.IsDone();
if (!bRet) {
di << "Error: GeomAPI_ProjectPointOnSurf failed" << "\n";
di << "Error: GeomAPI_ProjectPointOnSurf failed\n";
return 0;
}
//