mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +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:
@@ -156,7 +156,7 @@ static Standard_Integer Getentry (Draw_Interpretor& di, Standard_Integer n, cons
|
||||
|
||||
TopoDS_Shape S = DBRep::Get(a[2]);
|
||||
if (S.IsNull()) {
|
||||
di <<"Noone shape selected"<<"\n";
|
||||
di <<"Noone shape selected\n";
|
||||
//di << 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ static Standard_Integer Getentry (Draw_Interpretor& di, Standard_Integer n, cons
|
||||
else {
|
||||
di <<Name.ToCString();
|
||||
if (Status == 2) {
|
||||
di <<"Several shapes have the same name"<<"\n";
|
||||
di <<"Several shapes have the same name\n";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -187,7 +187,7 @@ static Standard_Integer NamedShape(Draw_Interpretor& di, Standard_Integer n, con
|
||||
if (!DDF::GetDF(a[1],ND)) return 1;
|
||||
TopoDS_Shape SS = DBRep::Get(a[2]);
|
||||
if (SS.IsNull()) {
|
||||
di <<"Noone shape selected"<<"\n";
|
||||
di <<"Noone shape selected\n";
|
||||
//di << 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -256,7 +256,7 @@ static Standard_Integer Initialshape (Draw_Interpretor& di, Standard_Integer n,
|
||||
TDF_Tool::Entry(itL.Value(),entry);
|
||||
di <<" , "<< entry.ToCString();
|
||||
}
|
||||
di <<"."<<"\n";
|
||||
di <<".\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
|
||||
DDF::FindLabel(ND,a[2],Lab);
|
||||
Handle(TNaming_NamedShape) NS;
|
||||
if (!Lab.FindAttribute(TNaming_NamedShape::GetID(),NS)) {
|
||||
di <<"No shape"<<"\n";
|
||||
di <<"No shape\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
|
||||
}
|
||||
di <<"\n";
|
||||
if (NbShapes == 0) {
|
||||
di <<"No shape"<<"\n";
|
||||
di <<"No shape\n";
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -336,7 +336,7 @@ static Standard_Integer Generatedshape (Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
di << "GetShape : Error" << "\n";
|
||||
di << "GetShape : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ static Standard_Integer Getshape (Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
di << "DDataStd_GetShape : Error" << "\n";
|
||||
di << "DDataStd_GetShape : Error\n";
|
||||
return 1;
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -410,7 +410,7 @@ static Standard_Integer Getcreationentry (Draw_Interpretor& di, Standard_Integer
|
||||
TopoDS_Shape SS = DBRep::Get(a[2]);
|
||||
|
||||
if (SS.IsNull()) {
|
||||
di <<"Noone shape selected"<<"\n";
|
||||
di <<"Noone shape selected\n";
|
||||
//di << 0;
|
||||
return 0;
|
||||
}
|
||||
@@ -431,7 +431,7 @@ static Standard_Integer Getcreationentry (Draw_Interpretor& di, Standard_Integer
|
||||
else {
|
||||
di <<Name.ToCString();
|
||||
if (Status == 2) {
|
||||
di <<"Several shapes have the same name"<<"\n";
|
||||
di <<"Several shapes have the same name\n";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -487,14 +487,14 @@ static Standard_Integer CheckIter (Draw_Interpretor& di,
|
||||
if(nb == 5) aNew = (Standard_Boolean) atoi(arg[4]);
|
||||
if(aNew) {
|
||||
TNaming_NewShapeIterator aNewShapeIter(aNameIter);
|
||||
di << "DNaming_CheckIterator : New It is OK" << "\n";
|
||||
di << "DNaming_CheckIterator : New It is OK\n";
|
||||
} else {
|
||||
TNaming_OldShapeIterator oldShapeIter(aNameIter);
|
||||
di << "DNaming_CheckIterator : Old It is OK" << "\n";
|
||||
di << "DNaming_CheckIterator : Old It is OK\n";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_CheckIterator : Error" << "\n";
|
||||
di << "DNaming_CheckIterator : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -109,7 +109,7 @@ static Standard_Integer DNaming_AddObject(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
di << "DNaming_AddObject: Error" << "\n";
|
||||
di << "DNaming_AddObject: Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ static Standard_Integer DNaming_AddFunction(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
di << "DNaming_AddObject: Error" << "\n";
|
||||
di << "DNaming_AddObject: Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -130,7 +130,7 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_Select : Error" << "\n";
|
||||
di << "DNaming_Select : Error\n";
|
||||
return 1;
|
||||
}
|
||||
// #define DEB_SELN 1
|
||||
@@ -200,7 +200,7 @@ static Standard_Integer DNaming_SolveSelection (Draw_Interpretor& di, Standard_I
|
||||
}
|
||||
TDF_LabelMap aValidMap;
|
||||
if(!FillValidMap(L,aValidMap))
|
||||
di << "Valid map is empty" << "\n";
|
||||
di << "Valid map is empty\n";
|
||||
#ifdef OCCT_DEBUG_SELN
|
||||
cout<<"== Valid Label map =="<<endl;
|
||||
for (TDF_MapIteratorOfLabelMap mapItr(aValidMap);mapItr.More(); mapItr.Next()) {
|
||||
@@ -215,13 +215,13 @@ static Standard_Integer DNaming_SolveSelection (Draw_Interpretor& di, Standard_I
|
||||
TNaming_Selector SL (L);
|
||||
Standard_Boolean isSolved = SL.Solve(aValidMap);
|
||||
if(!isSolved)
|
||||
di << "!!! Solver is failed" <<"\n";
|
||||
di << "!!! Solver is failed\n";
|
||||
TopoDS_Shape Res = TNaming_Tool::CurrentShape(SL.NamedShape());
|
||||
Sprintf (name,"%s_%s","new",a[2]);
|
||||
Display (name,Res);
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_SolveSelection : Error" << "\n";
|
||||
di << "DNaming_SolveSelection : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ static Standard_Integer DNaming_DumpSelection (Draw_Interpretor& di,
|
||||
if (!DDF::FindLabel(DF,a[2],L)) return 1;
|
||||
Handle(TNaming_Naming) naming;
|
||||
if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) {
|
||||
di <<"DNaming_DumpSelection : not a selection" << "\n";
|
||||
di <<"DNaming_DumpSelection : not a selection\n";
|
||||
return 1;
|
||||
}
|
||||
DumpNaming(naming, di);
|
||||
@@ -263,7 +263,7 @@ static Standard_Integer DNaming_DumpSelection (Draw_Interpretor& di,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_DumpSelection : Error" << "\n";
|
||||
di << "DNaming_DumpSelection : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ static Standard_Integer DNaming_ArgsSelection (Draw_Interpretor& di,
|
||||
if (!DDF::FindLabel(DF,a[2],L)) return 1;
|
||||
Handle(TNaming_Naming) naming;
|
||||
if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) {
|
||||
di <<"DNaming_DumpSelection : not a selection" << "\n";
|
||||
di <<"DNaming_DumpSelection : not a selection\n";
|
||||
return 1;
|
||||
}
|
||||
TCollection_AsciiString Entry;
|
||||
@@ -297,7 +297,7 @@ static Standard_Integer DNaming_ArgsSelection (Draw_Interpretor& di,
|
||||
di << "\n";
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_ArgsSelection : Error" << "\n";
|
||||
di << "DNaming_ArgsSelection : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ static Standard_Integer DNaming_Attachment (Draw_Interpretor& di,
|
||||
di << "\n";
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_Attachment : Error" << "\n";
|
||||
di << "DNaming_Attachment : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -86,7 +86,7 @@ static Standard_Integer DNaming_CheckHasSame (Draw_Interpretor& di,
|
||||
for(itr2.Initialize(M2);itr2.More();itr2.Next()) {
|
||||
const TopoDS_Shape& s2 = itr2.Key();
|
||||
if(s1.IsSame(s2))
|
||||
di << "Shapes " << arg[1]<< " and "<< arg[2]<< " have SAME subshapes" <<"\n";
|
||||
di << "Shapes " << arg[1]<< " and "<< arg[2]<< " have SAME subshapes\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ static Standard_Integer DNaming_TCopyShape (Draw_Interpretor& di,
|
||||
TR.Perform();
|
||||
|
||||
if(TR.IsDone()){
|
||||
di << "DNaming_CopyShape:: Copy is Done " << "\n";
|
||||
di << "DNaming_CopyShape:: Copy is Done \n";
|
||||
|
||||
DNaming_DataMapIteratorOfDataMapOfShapeOfName itrn(aDMapOfShapeOfName);
|
||||
for(;itrn.More();itrn.Next()) {
|
||||
@@ -138,7 +138,7 @@ static Standard_Integer DNaming_TCopyShape (Draw_Interpretor& di,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
di << "DNaming_CopyShape : Error" << "\n";
|
||||
di << "DNaming_CopyShape : Error\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ static Standard_Integer DNaming_TCopyTool (Draw_Interpretor& di,
|
||||
const char** arg)
|
||||
{
|
||||
if (nb < 2) {
|
||||
di << "Usage: CopyTool Shape1 [Shape2] ..." << "\n";
|
||||
di << "Usage: CopyTool Shape1 [Shape2] ...\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ static Standard_Integer DNaming_TCopyTool (Draw_Interpretor& di,
|
||||
}
|
||||
|
||||
if (aShape.IsNull()) {
|
||||
di << arg[i] << " is neither a shape nor a BREP file. Skip it." << "\n";
|
||||
di << arg[i] << " is neither a shape nor a BREP file. Skip it.\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user