1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +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

@ -300,11 +300,11 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
// //
if (iErr) { if (iErr) {
di << "There were errors during the operation, "; di << "There were errors during the operation, ";
di << "so the list may be incomplete." << "\n"; di << "so the list may be incomplete.\n";
} }
// //
if (!iCnt) { if (!iCnt) {
di << " This shape seems to be OK." << "\n"; di << " This shape seems to be OK.\n";
} }
if (bShowTime) if (bShowTime)
{ {
@ -325,48 +325,48 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
di << "\n"; di << "\n";
di << " Use >bopargcheck Shape1 [[Shape2] "; di << " Use >bopargcheck Shape1 [[Shape2] ";
di << "[-F/O/C/T/S/U] [/R|F|T|V|E|I|P|C|S]] [#BF]\n\n"; di << "[-F/O/C/T/S/U] [/R|F|T|V|E|I|P|C|S]] [#BF]\n\n";
di << " -<Boolean Operation>" << "\n"; di << " -<Boolean Operation>\n";
di << " F (fuse)" << "\n"; di << " F (fuse)\n";
di << " O (common)" << "\n"; di << " O (common)\n";
di << " C (cut)" << "\n"; di << " C (cut)\n";
di << " T (cut21)" << "\n"; di << " T (cut21)\n";
di << " S (section)" << "\n"; di << " S (section)\n";
di << " U (unknown)" << "\n"; di << " U (unknown)\n";
di << " For example: \"bopargcheck s1 s2 -F\" enables" ; di << " For example: \"bopargcheck s1 s2 -F\" enables" ;
di << " checking for Fuse operation" << "\n"; di << " checking for Fuse operation\n";
di << " default - section" << "\n" << "\n"; di << " default - section\n\n";
di << " /<Test Options>" << "\n"; di << " /<Test Options>\n";
di << " R (disable small edges (shrank range) test)" << "\n"; di << " R (disable small edges (shrank range) test)\n";
di << " F (disable faces verification test)" << "\n"; di << " F (disable faces verification test)\n";
di << " T (disable tangent faces searching test)" << "\n"; di << " T (disable tangent faces searching test)\n";
di << " V (disable test possibility to merge vertices)" << "\n"; di << " V (disable test possibility to merge vertices)\n";
di << " E (disable test possibility to merge edges)" << "\n"; di << " E (disable test possibility to merge edges)\n";
di << " I (disable self-interference test)" << "\n"; di << " I (disable self-interference test)\n";
di << " P (disable shape type test)" << "\n"; di << " P (disable shape type test)\n";
di << " C (disable test for shape continuity)" << "\n"; di << " C (disable test for shape continuity)\n";
di << " S (disable curve on surface check)" << "\n"; di << " S (disable curve on surface check)\n";
di << " For example: \"bopargcheck s1 s2 /RI\" disables "; di << " For example: \"bopargcheck s1 s2 /RI\" disables ";
di << "small edge detection and self-intersection detection" << "\n"; di << "small edge detection and self-intersection detection\n";
di << " default - all options are enabled" << "\n" << "\n"; di << " default - all options are enabled\n\n";
di << " #<Additional Test Options>" << "\n"; di << " #<Additional Test Options>\n";
di << " B (stop test on first faulty found); default OFF" << "\n"; di << " B (stop test on first faulty found); default OFF\n";
di << " F (full output for faulty shapes); default - output "; di << " F (full output for faulty shapes); default - output ";
di << "in a short format" << "\n" << "\n"; di << "in a short format\n\n";
di << " NOTE: <Boolean Operation> and <Test Options> are "; di << " NOTE: <Boolean Operation> and <Test Options> are ";
di << "used only for couple" << "\n"; di << "used only for couple\n";
di << " of argument shapes, except I and P options "; di << " of argument shapes, except I and P options ";
di << "that are always used for" << "\n"; di << "that are always used for\n";
di << " couple of shapes as well as for "; di << " couple of shapes as well as for ";
di <<"single shape test." << "\n"; di <<"single shape test.\n";
return 1; return 1;
} }
TopoDS_Shape aS1 = DBRep::Get(a[1]); TopoDS_Shape aS1 = DBRep::Get(a[1]);
if(aS1.IsNull()) { if(aS1.IsNull()) {
di << "Error: null shape not allowed!" << "\n"; di << "Error: null shape not allowed!\n";
di << "Type bopargcheck without arguments for more "; di << "Type bopargcheck without arguments for more ";
di <<"information" << "\n"; di <<"information\n";
return 1; return 1;
} }
@ -410,15 +410,15 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
TopoDS_Shape aS22, aS2; TopoDS_Shape aS22, aS2;
if(isS2) { if(isS2) {
if(indxS2 != 2) { if(indxS2 != 2) {
di << "Error: second shape should follow the first one!" << "\n"; di << "Error: second shape should follow the first one!\n";
di << "Type bopargcheck without arguments for more information" << "\n"; di << "Type bopargcheck without arguments for more information\n";
return 1; return 1;
} }
else { else {
aS22 = DBRep::Get(a[2]); aS22 = DBRep::Get(a[2]);
if(aS22.IsNull()) { if(aS22.IsNull()) {
di << "Error: second shape is null!" << "\n"; di << "Error: second shape is null!\n";
di << "Type bopargcheck without arguments for more information" << "\n"; di << "Type bopargcheck without arguments for more information\n";
return 1; return 1;
} }
} }
@ -463,8 +463,8 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
aChecker.OperationType() = BOPAlgo_UNKNOWN; aChecker.OperationType() = BOPAlgo_UNKNOWN;
} }
else { else {
di << "Error: invalid boolean operation type!" << "\n"; di << "Error: invalid boolean operation type!\n";
di << "Type bopargcheck without arguments for more information" << "\n"; di << "Type bopargcheck without arguments for more information\n";
return 1; return 1;
} }
} }
@ -508,8 +508,8 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
aChecker.CurveOnSurfaceMode() = Standard_False; aChecker.CurveOnSurfaceMode() = Standard_False;
} }
else { else {
di << "Error: invalid test option(s)!" << "\n"; di << "Error: invalid test option(s)!\n";
di << "Type bopargcheck without arguments for more information" << "\n"; di << "Type bopargcheck without arguments for more information\n";
return 1; return 1;
} }
ind++; ind++;
@ -528,8 +528,8 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
fullOutput = Standard_True; fullOutput = Standard_True;
} }
else { else {
di << "Error: invalid additional test option(s)!" << "\n"; di << "Error: invalid additional test option(s)!\n";
di << "Type bopargcheck without arguments for more information" << "\n"; di << "Type bopargcheck without arguments for more information\n";
return 1; return 1;
} }
ind++; ind++;
@ -545,7 +545,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
} }
else { else {
if(!fullOutput) { if(!fullOutput) {
di << "Faulties, that can not be treated by BOP, are detected." << "\n"; di << "Faulties, that can not be treated by BOP, are detected.\n";
} }
else { else {
const BOPAlgo_ListOfCheckResult& aResultList = aChecker.GetCheckResult(); const BOPAlgo_ListOfCheckResult& aResultList = aChecker.GetCheckResult();
@ -720,7 +720,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
// output for first shape // output for first shape
di << "Faulties for FIRST shape found : " << FS1 << "\n"; di << "Faulties for FIRST shape found : " << FS1 << "\n";
if(FS1 != 0) { if(FS1 != 0) {
di << "---------------------------------" << "\n"; di << "---------------------------------\n";
Standard_CString CString1; Standard_CString CString1;
if (S1_BadType != 0) if (S1_BadType != 0)
CString1="YES"; CString1="YES";
@ -734,7 +734,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString2=aChecker.SelfInterMode() ? "NO" : "DISABLED"; CString2=aChecker.SelfInterMode() ? "NO" : "DISABLED";
di << "Self-Intersections : " << CString2; di << "Self-Intersections : " << CString2;
if(S1_SelfInt != 0) if(S1_SelfInt != 0)
di << " Cases(" << S1_SelfInt << ") Total shapes(" << S1_SelfIntAll << ")" << "\n"; di << " Cases(" << S1_SelfInt << ") Total shapes(" << S1_SelfIntAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString13; Standard_CString CString13;
@ -750,7 +750,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString3=aChecker.SmallEdgeMode() ? "NO" : "DISABLED"; CString3=aChecker.SmallEdgeMode() ? "NO" : "DISABLED";
di << "Too small edges : " << CString3; di << "Too small edges : " << CString3;
if(S1_SmalE != 0) if(S1_SmalE != 0)
di << " Cases(" << S1_SmalE << ") Total shapes(" << S1_SmalEAll << ")" << "\n"; di << " Cases(" << S1_SmalE << ") Total shapes(" << S1_SmalEAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString4; Standard_CString CString4;
@ -760,7 +760,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString4=aChecker.RebuildFaceMode() ? "NO" : "DISABLED"; CString4=aChecker.RebuildFaceMode() ? "NO" : "DISABLED";
di << "Bad faces : " << CString4; di << "Bad faces : " << CString4;
if(S1_BadF != 0) if(S1_BadF != 0)
di << " Cases(" << S1_BadF << ") Total shapes(" << S1_BadFAll << ")" << "\n"; di << " Cases(" << S1_BadF << ") Total shapes(" << S1_BadFAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString5; Standard_CString CString5;
@ -770,7 +770,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString5=aChecker.MergeVertexMode() ? "NO" : "DISABLED"; CString5=aChecker.MergeVertexMode() ? "NO" : "DISABLED";
di << "Too close vertices : " << CString5; di << "Too close vertices : " << CString5;
if(S1_BadV != 0) if(S1_BadV != 0)
di << " Cases(" << S1_BadV << ") Total shapes(" << S1_BadVAll << ")" << "\n"; di << " Cases(" << S1_BadV << ") Total shapes(" << S1_BadVAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString6; Standard_CString CString6;
@ -780,7 +780,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString6=aChecker.MergeEdgeMode() ? "NO" : "DISABLED"; CString6=aChecker.MergeEdgeMode() ? "NO" : "DISABLED";
di << "Too close edges : " << CString6; di << "Too close edges : " << CString6;
if(S1_BadE != 0) if(S1_BadE != 0)
di << " Cases(" << S1_BadE << ") Total shapes(" << S1_BadEAll << ")" << "\n"; di << " Cases(" << S1_BadE << ") Total shapes(" << S1_BadEAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString15; Standard_CString CString15;
@ -790,7 +790,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString15=aChecker.ContinuityMode() ? "NO" : "DISABLED"; CString15=aChecker.ContinuityMode() ? "NO" : "DISABLED";
di << "Shapes with Continuity C0 : " << CString15; di << "Shapes with Continuity C0 : " << CString15;
if(S1_C0 != 0) if(S1_C0 != 0)
di << " Cases(" << S1_C0 << ") Total shapes(" << S1_C0All << ")" << "\n"; di << " Cases(" << S1_C0 << ") Total shapes(" << S1_C0All << ")\n";
else else
di << "\n"; di << "\n";
@ -801,7 +801,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString17=aChecker.CurveOnSurfaceMode() ? "NO" : "DISABLED"; CString17=aChecker.CurveOnSurfaceMode() ? "NO" : "DISABLED";
di << "Invalid Curve on Surface : " << CString17; di << "Invalid Curve on Surface : " << CString17;
if(S1_COnS != 0) if(S1_COnS != 0)
di << " Cases(" << S1_COnS << ") Total shapes(" << S1_COnSAll << ")" << "\n"; di << " Cases(" << S1_COnS << ") Total shapes(" << S1_COnSAll << ")\n";
else else
di << "\n"; di << "\n";
} }
@ -810,7 +810,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
di << "\n"; di << "\n";
di << "Faulties for SECOND shape found : " << FS2 << "\n"; di << "Faulties for SECOND shape found : " << FS2 << "\n";
if(FS2 != 0) { if(FS2 != 0) {
di << "---------------------------------" << "\n"; di << "---------------------------------\n";
Standard_CString CString7; Standard_CString CString7;
if (S2_BadType != 0) if (S2_BadType != 0)
CString7="YES"; CString7="YES";
@ -824,7 +824,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString8=aChecker.SelfInterMode() ? "NO" : "DISABLED"; CString8=aChecker.SelfInterMode() ? "NO" : "DISABLED";
di << "Self-Intersections : " << CString8; di << "Self-Intersections : " << CString8;
if(S2_SelfInt != 0) if(S2_SelfInt != 0)
di << " Cases(" << S2_SelfInt << ") Total shapes(" << S2_SelfIntAll << ")" << "\n"; di << " Cases(" << S2_SelfInt << ") Total shapes(" << S2_SelfIntAll << ")\n";
else else
di << "\n"; di << "\n";
@ -841,7 +841,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString9=aChecker.SmallEdgeMode() ? "NO" : "DISABLED"; CString9=aChecker.SmallEdgeMode() ? "NO" : "DISABLED";
di << "Too small edges : " << CString9; di << "Too small edges : " << CString9;
if(S2_SmalE != 0) if(S2_SmalE != 0)
di << " Cases(" << S2_SmalE << ") Total shapes(" << S2_SmalEAll << ")" << "\n"; di << " Cases(" << S2_SmalE << ") Total shapes(" << S2_SmalEAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString10; Standard_CString CString10;
@ -851,7 +851,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString10=aChecker.RebuildFaceMode() ? "NO" : "DISABLED"; CString10=aChecker.RebuildFaceMode() ? "NO" : "DISABLED";
di << "Bad faces : " << CString10; di << "Bad faces : " << CString10;
if(S2_BadF != 0) if(S2_BadF != 0)
di << " Cases(" << S2_BadF << ") Total shapes(" << S2_BadFAll << ")" << "\n"; di << " Cases(" << S2_BadF << ") Total shapes(" << S2_BadFAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString11; Standard_CString CString11;
@ -861,7 +861,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString11=aChecker.MergeVertexMode() ? "NO" : "DISABLED"; CString11=aChecker.MergeVertexMode() ? "NO" : "DISABLED";
di << "Too close vertices : " << CString11; di << "Too close vertices : " << CString11;
if(S2_BadV != 0) if(S2_BadV != 0)
di << " Cases(" << S2_BadV << ") Total shapes(" << S2_BadVAll << ")" << "\n"; di << " Cases(" << S2_BadV << ") Total shapes(" << S2_BadVAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString12; Standard_CString CString12;
@ -871,7 +871,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString12=aChecker.MergeEdgeMode() ? "NO" : "DISABLED"; CString12=aChecker.MergeEdgeMode() ? "NO" : "DISABLED";
di << "Too close edges : " << CString12; di << "Too close edges : " << CString12;
if(S2_BadE != 0) if(S2_BadE != 0)
di << " Cases(" << S2_BadE << ") Total shapes(" << S2_BadEAll << ")" << "\n"; di << " Cases(" << S2_BadE << ") Total shapes(" << S2_BadEAll << ")\n";
else else
di << "\n"; di << "\n";
Standard_CString CString16; Standard_CString CString16;
@ -881,7 +881,7 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString16=aChecker.ContinuityMode() ? "NO" : "DISABLED"; CString16=aChecker.ContinuityMode() ? "NO" : "DISABLED";
di << "Shapes with Continuity C0 : " << CString16; di << "Shapes with Continuity C0 : " << CString16;
if(S2_C0 != 0) if(S2_C0 != 0)
di << " Cases(" << S2_C0 << ") Total shapes(" << S2_C0All << ")" << "\n"; di << " Cases(" << S2_C0 << ") Total shapes(" << S2_C0All << ")\n";
else else
di << "\n"; di << "\n";
@ -892,14 +892,14 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
CString18=aChecker.CurveOnSurfaceMode() ? "NO" : "DISABLED"; CString18=aChecker.CurveOnSurfaceMode() ? "NO" : "DISABLED";
di << "Invalid Curve on Surface : " << CString18; di << "Invalid Curve on Surface : " << CString18;
if(S2_COnS != 0) if(S2_COnS != 0)
di << " Cases(" << S2_COnS << ") Total shapes(" << S2_COnSAll << ")" << "\n"; di << " Cases(" << S2_COnS << ") Total shapes(" << S2_COnSAll << ")\n";
else else
di << "\n"; di << "\n";
} }
// warning // warning
if(hasUnknown) { if(hasUnknown) {
di << "\n"; di << "\n";
di << "WARNING: The unexpected test break occurs!" << "\n"; di << "WARNING: The unexpected test break occurs!\n";
} }
} // full output } // full output
} // has faulties } // has faulties

View File

@ -189,7 +189,7 @@ static Standard_Integer deform(Draw_Interpretor& di,Standard_Integer n,const cha
TopoDS_Shape S = DBRep::Get(a[2]); TopoDS_Shape S = DBRep::Get(a[2]);
if (S.IsNull()) { if (S.IsNull()) {
//cout << a[2] << " is not a valid shape" << endl; //cout << a[2] << " is not a valid shape" << endl;
di << a[2] << " is not a valid shape" << "\n"; di << a[2] << " is not a valid shape\n";
} }
else { else {
gtrf.Perform(S); gtrf.Perform(S);
@ -264,7 +264,7 @@ static Standard_Integer nurbsconvert(Draw_Interpretor& di,Standard_Integer n,con
TopoDS_Shape S = DBRep::Get(a[2*i+2]); TopoDS_Shape S = DBRep::Get(a[2*i+2]);
if (S.IsNull()) { if (S.IsNull()) {
//cout << a[2*i+2] << " is not a valid shape" << endl; //cout << a[2*i+2] << " is not a valid shape" << endl;
di << a[2*i+2] << " is not a valid shape" << "\n"; di << a[2*i+2] << " is not a valid shape\n";
} }
else { else {
nbscv.Perform(S); nbscv.Perform(S);
@ -495,7 +495,7 @@ static Standard_Integer reperageshape(Draw_Interpretor& di, Standard_Integer nar
TopoDS_Shape TheShape1 = DBRep::Get(id1); TopoDS_Shape TheShape1 = DBRep::Get(id1);
//cout << "Pick positions with button "<<endl; //cout << "Pick positions with button "<<endl;
di << "Pick positions with button "<< "\n"; di << "Pick positions with button \n";
Standard_Integer id,X,Y,b; Standard_Integer id,X,Y,b;
gp_Trsf T; gp_Trsf T;
gp_Pnt P1,P2; gp_Pnt P1,P2;
@ -636,7 +636,7 @@ static Standard_Integer maxtolerance(Draw_Interpretor& theCommands,
static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char** ) { static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char** ) {
//cout << "Pick positions with button "<<endl; //cout << "Pick positions with button "<<endl;
di << "Pick positions with button "<< "\n"; di << "Pick positions with button \n";
Standard_Integer id,X,Y,b; Standard_Integer id,X,Y,b;
gp_Trsf T; gp_Trsf T;
@ -774,7 +774,7 @@ static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char*
Standard_Boolean IsWire=OrtProj.BuildWire(Wire); Standard_Boolean IsWire=OrtProj.BuildWire(Wire);
if (IsWire) { if (IsWire) {
//cout << " BuildWire OK " << endl; //cout << " BuildWire OK " << endl;
di << " BuildWire OK " << "\n"; di << " BuildWire OK \n";
} }
DBRep::Set(a[1], OrtProj.Shape()); DBRep::Set(a[1], OrtProj.Shape());
return 0; return 0;

View File

@ -46,10 +46,10 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
//cout <<" Construction by equal distances from edge : chamf newname shape edge face S dist"<< endl; //cout <<" Construction by equal distances from edge : chamf newname shape edge face S dist"<< endl;
//cout <<" Construction by two distances from edge : chamf newname shape edge face dist1 dist2"<< endl; //cout <<" Construction by two distances from edge : chamf newname shape edge face dist1 dist2"<< endl;
//cout <<" Construction by distance from edge and given angle : chamf newname shape edge face A dist angle"<< endl; //cout <<" Construction by distance from edge and given angle : chamf newname shape edge face A dist angle"<< endl;
di <<" help for chamf : "<< "\n"; di <<" help for chamf : \n";
di <<" Construction by equal distances from edge : chamf newname shape edge face S dist"<< "\n"; di <<" Construction by equal distances from edge : chamf newname shape edge face S dist\n";
di <<" Construction by two distances from edge : chamf newname shape edge face dist1 dist2"<< "\n"; di <<" Construction by two distances from edge : chamf newname shape edge face dist1 dist2\n";
di <<" Construction by distance from edge and given angle : chamf newname shape edge face A dist angle"<< "\n"; di <<" Construction by distance from edge and given angle : chamf newname shape edge face A dist angle\n";
} }
else { else {
if (narg < 7) return 1; if (narg < 7) return 1;
@ -135,7 +135,7 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
if (aMCh.NbContours() == 0 ) if (aMCh.NbContours() == 0 )
{ {
//cout<<"No suitable edges to chamfer"<<endl; //cout<<"No suitable edges to chamfer"<<endl;
di<<"No suitable edges to chamfer"<<"\n"; di<<"No suitable edges to chamfer\n";
return 1; return 1;
} }
else aMCh.Build(); else aMCh.Build();
@ -146,7 +146,7 @@ static Standard_Integer chamfer(Draw_Interpretor& di,
} }
else { else {
//cout<<"compute of chamfer failed"<<endl; //cout<<"compute of chamfer failed"<<endl;
di<<"compute of chamfer failed"<<"\n"; di<<"compute of chamfer failed\n";
return 1; return 1;
} }
} }

View File

@ -255,7 +255,7 @@ static Standard_Integer computetolerance(Draw_Interpretor& di,
{ {
if (narg < 2) { if (narg < 2) {
//cout << "Usage: computetolerance shape" << endl; //cout << "Usage: computetolerance shape" << endl;
di << "Usage: computetolerance shape" << "\n"; di << "Usage: computetolerance shape\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get(a[1]); TopoDS_Shape S = DBRep::Get(a[1]);
@ -383,10 +383,10 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
if (BRepAlgo::IsValid(lesArgs, resu, closedSolid, geomCtrl)) { if (BRepAlgo::IsValid(lesArgs, resu, closedSolid, geomCtrl)) {
//cout << "Difference is Valid." << endl; //cout << "Difference is Valid." << endl;
di << "Difference is Valid." << "\n"; di << "Difference is Valid.\n";
} else { } else {
//cout << "error : Difference is Not Valid !" << endl; //cout << "error : Difference is Not Valid !" << endl;
di << "error : Difference is Not Valid !" << "\n"; di << "error : Difference is Not Valid !\n";
} }
return 0; return 0;
@ -609,9 +609,9 @@ void StructuralDump(Draw_Interpretor& theCommands,
//cout << " -- The Shape " << ShName << " has problems :"<<endl; //cout << " -- The Shape " << ShName << " has problems :"<<endl;
//cout<<" Check Count"<<endl; //cout<<" Check Count"<<endl;
//cout<<" ------------------------------------------------"<<endl; //cout<<" ------------------------------------------------"<<endl;
theCommands << " -- The Shape " << ShName << " has problems :"<<"\n"; theCommands << " -- The Shape " << ShName << " has problems :\n";
theCommands<<" Check Count"<<"\n"; theCommands<<" Check Count\n";
theCommands<<" ------------------------------------------------"<<"\n"; theCommands<<" ------------------------------------------------\n";
Handle(TColStd_HArray1OfInteger) NbProblems = new Handle(TColStd_HArray1OfInteger) NbProblems = new
TColStd_HArray1OfInteger(1,NumberOfStatus); TColStd_HArray1OfInteger(1,NumberOfStatus);
@ -768,7 +768,7 @@ void StructuralDump(Draw_Interpretor& theCommands,
theCommands<<" ------------------------------------------------"<<"\n"; theCommands<<" ------------------------------------------------\n";
theCommands<<"*** Shapes with problems : "<<sl->Length()<<"\n"; theCommands<<"*** Shapes with problems : "<<sl->Length()<<"\n";
slv = new TopTools_HSequenceOfShape(); slv = new TopTools_HSequenceOfShape();
@ -802,11 +802,11 @@ void StructuralDump(Draw_Interpretor& theCommands,
char aName[20]; char aName[20];
Sprintf(aName,"%s_v",Pref); Sprintf(aName,"%s_v",Pref);
DBRep::Set(aName,comp); DBRep::Set(aName,comp);
//cout<<"VERTEX"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl; //cout<<"VERTEX : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9) if (nb > 9)
theCommands<<"VERTEX"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"VERTEX : "<<nb<<" Items -> compound named "<<aName<<"\n";
else else
theCommands<<"VERTEX"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"VERTEX : "<<nb<<" Items -> compound named "<<aName<<"\n";
} }
if(sle->Length()>0) { if(sle->Length()>0) {
TopoDS_Compound comp; TopoDS_Compound comp;
@ -817,11 +817,11 @@ void StructuralDump(Draw_Interpretor& theCommands,
char aName[20]; char aName[20];
Sprintf(aName,"%s_e",Pref); Sprintf(aName,"%s_e",Pref);
DBRep::Set(aName,comp); DBRep::Set(aName,comp);
//cout<<"EDGE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl; //cout<<"EDGE : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9) if (nb > 9)
theCommands<<"EDGE"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"EDGE : "<<nb<<" Items -> compound named "<<aName<<"\n";
else else
theCommands<<"EDGE"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"EDGE : "<<nb<<" Items -> compound named "<<aName<<"\n";
} }
if(slw->Length()>0) { if(slw->Length()>0) {
TopoDS_Compound comp; TopoDS_Compound comp;
@ -832,11 +832,11 @@ void StructuralDump(Draw_Interpretor& theCommands,
char aName[20]; char aName[20];
Sprintf(aName,"%s_w",Pref); Sprintf(aName,"%s_w",Pref);
DBRep::Set(aName,comp); DBRep::Set(aName,comp);
//cout<<"WIRE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl; //cout<<"WIRE : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9) if (nb > 9)
theCommands<<"WIRE"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"WIRE : "<<nb<<" Items -> compound named "<<aName<<"\n";
else else
theCommands<<"WIRE"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"WIRE : "<<nb<<" Items -> compound named "<<aName<<"\n";
} }
if(slf->Length()>0) { if(slf->Length()>0) {
TopoDS_Compound comp; TopoDS_Compound comp;
@ -847,11 +847,11 @@ void StructuralDump(Draw_Interpretor& theCommands,
char aName[20]; char aName[20];
Sprintf(aName,"%s_f",Pref); Sprintf(aName,"%s_f",Pref);
DBRep::Set(aName,comp); DBRep::Set(aName,comp);
//cout<<"FACE"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl; //cout<<"FACE : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9) if (nb > 9)
theCommands<<"FACE"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"FACE : "<<nb<<" Items -> compound named "<<aName<<"\n";
else else
theCommands<<"FACE"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"FACE : "<<nb<<" Items -> compound named "<<aName<<"\n";
} }
if(sls->Length()>0) { if(sls->Length()>0) {
TopoDS_Compound comp; TopoDS_Compound comp;
@ -862,11 +862,11 @@ void StructuralDump(Draw_Interpretor& theCommands,
char aName[20]; char aName[20];
Sprintf(aName,"%s_s",Pref); Sprintf(aName,"%s_s",Pref);
DBRep::Set(aName,comp); DBRep::Set(aName,comp);
//cout<<"SHELL"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl; //cout<<"SHELL : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9) if (nb > 9)
theCommands<<"SHELL"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"SHELL : "<<nb<<" Items -> compound named "<<aName<<"\n";
else else
theCommands<<"SHELL"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"SHELL : "<<nb<<" Items -> compound named "<<aName<<"\n";
} }
if(slo->Length()>0) { if(slo->Length()>0) {
TopoDS_Compound comp; TopoDS_Compound comp;
@ -877,11 +877,11 @@ void StructuralDump(Draw_Interpretor& theCommands,
char aName[20]; char aName[20];
Sprintf(aName,"%s_o",Pref); Sprintf(aName,"%s_o",Pref);
DBRep::Set(aName,comp); DBRep::Set(aName,comp);
//cout<<"SOLID"<<" : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl; //cout<<"SOLID : "<<(nb > 9 ? "" : " ")<<nb<<" Items -> compound named "<<aName<<endl;
if (nb > 9) if (nb > 9)
theCommands<<"SOLID"<<" : "<<""<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"SOLID : "<<nb<<" Items -> compound named "<<aName<<"\n";
else else
theCommands<<"SOLID"<<" : "<<" "<<nb<<" Items -> compound named "<<aName<<"\n"; theCommands<<"SOLID : "<<nb<<" Items -> compound named "<<aName<<"\n";
} }
} }
@ -904,14 +904,14 @@ static Standard_Integer checkshape(Draw_Interpretor& theCommands,
//cout << " output style will be used. Otherwise - contextual one." << endl; //cout << " output style will be used. Otherwise - contextual one." << endl;
//cout << " -short - short description of check." << endl; //cout << " -short - short description of check." << endl;
theCommands << "\n"; theCommands << "\n";
theCommands << "Usage : checkshape [-top] shape [result] [-short]" << "\n"; theCommands << "Usage : checkshape [-top] shape [result] [-short]\n";
theCommands << "\n"; theCommands << "\n";
theCommands << "Where :" << "\n"; theCommands << "Where :\n";
theCommands << " -top - check topology only." << "\n"; theCommands << " -top - check topology only.\n";
theCommands << " shape - the name of the shape to test." << "\n"; theCommands << " shape - the name of the shape to test.\n";
theCommands << " result - the prefix of the output shape names. If it is used, structural" << "\n"; theCommands << " result - the prefix of the output shape names. If it is used, structural\n";
theCommands << " output style will be used. Otherwise - contextual one." << "\n"; theCommands << " output style will be used. Otherwise - contextual one.\n";
theCommands << " -short - short description of check." << "\n"; theCommands << " -short - short description of check.\n";
return 0; return 0;
} }
@ -919,8 +919,8 @@ static Standard_Integer checkshape(Draw_Interpretor& theCommands,
if (narg > 5) { if (narg > 5) {
//cout << "Invalid number of args!!!" << endl; //cout << "Invalid number of args!!!" << endl;
//cout << "No args to have help." << endl; //cout << "No args to have help." << endl;
theCommands << "Invalid number of args!!!" << "\n"; theCommands << "Invalid number of args!!!\n";
theCommands << "No args to have help." << "\n"; theCommands << "No args to have help.\n";
return 1; return 1;
} }
@ -936,8 +936,8 @@ static Standard_Integer checkshape(Draw_Interpretor& theCommands,
if (aCurInd > narg - 1) { if (aCurInd > narg - 1) {
//cout << "Invalid number of args!!!" << endl; //cout << "Invalid number of args!!!" << endl;
//cout << "No args to have help." << endl; //cout << "No args to have help." << endl;
theCommands << "Invalid number of args!!!" << "\n"; theCommands << "Invalid number of args!!!\n";
theCommands << "No args to have help." << "\n"; theCommands << "No args to have help.\n";
return 1; return 1;
} }
@ -947,7 +947,7 @@ static Standard_Integer checkshape(Draw_Interpretor& theCommands,
if (aShape.IsNull()) { if (aShape.IsNull()) {
//cout << a[aCurInd] << " is not a topological shape!!!" << endl; //cout << a[aCurInd] << " is not a topological shape!!!" << endl;
theCommands << a[aCurInd] << " is not a topological shape!!!" << "\n"; theCommands << a[aCurInd] << " is not a topological shape!!!\n";
return 1; return 1;
} }
@ -966,8 +966,8 @@ static Standard_Integer checkshape(Draw_Interpretor& theCommands,
if (aCurInd < aBackInd - 1) { if (aCurInd < aBackInd - 1) {
//cout << "Invalid number of args!!!" << endl; //cout << "Invalid number of args!!!" << endl;
//cout << "No args to have help." << endl; //cout << "No args to have help." << endl;
theCommands << "Invalid number of args!!!" << "\n"; theCommands << "Invalid number of args!!!\n";
theCommands << "No args to have help." << "\n"; theCommands << "No args to have help.\n";
return 1; return 1;
} else if (aCurInd < aBackInd) { } else if (aCurInd < aBackInd) {
@ -1139,10 +1139,10 @@ static Standard_Integer shapeG1continuity (Draw_Interpretor& di, Standard_Intege
//else { cout<<" the continuity is not G1 "<<endl;} //else { cout<<" the continuity is not G1 "<<endl;}
//cout<<"MaxG0Value :"<< MaxG0Value << endl; //cout<<"MaxG0Value :"<< MaxG0Value << endl;
//cout<<"MaxG1Angle:"<< MaxG1Angle << endl; //cout<<"MaxG1Angle:"<< MaxG1Angle << endl;
if (!isdone) { di<<" Problem in computation "<<"\n"; return 1;} if (!isdone) { di<<" Problem in computation \n"; return 1;}
if (ISG1) if (ISG1)
{di<<" the continuity is G1 "<<"\n";} {di<<" the continuity is G1 \n";}
else { di<<" the continuity is not G1 "<<"\n";} else { di<<" the continuity is not G1 \n";}
di<<"MaxG0Value :"<< MaxG0Value << "\n"; di<<"MaxG0Value :"<< MaxG0Value << "\n";
di<<"MaxG1Angle:"<< MaxG1Angle << "\n"; di<<"MaxG1Angle:"<< MaxG1Angle << "\n";
return 0; return 0;
@ -1260,11 +1260,11 @@ static Standard_Integer shapeG0continuity (Draw_Interpretor& di, Standard_Intege
//else { cout<<" the continuity is not G0 "<<endl;} //else { cout<<" the continuity is not G0 "<<endl;}
//cout<<"MaxG0Value :"<< MaxG0Value << endl; //cout<<"MaxG0Value :"<< MaxG0Value << endl;
if (!isdone) { di<<" Problem in computation "<<"\n"; return 1;} if (!isdone) { di<<" Problem in computation \n"; return 1;}
if (ISG0) if (ISG0)
{di<<" the continuity is G0 "<<"\n";} {di<<" the continuity is G0 \n";}
else { di<<" the continuity is not G0 "<<"\n";} else { di<<" the continuity is not G0 \n";}
di<<"MaxG0Value :"<< MaxG0Value << "\n"; di<<"MaxG0Value :"<< MaxG0Value << "\n";
return 0; return 0;
} }
@ -1395,10 +1395,10 @@ static Standard_Integer shapeG2continuity (Draw_Interpretor& di, Standard_Intege
//cout<<"MaxG0Value :"<< MaxG0Value << endl; //cout<<"MaxG0Value :"<< MaxG0Value << endl;
//cout<<"MaxG1Angle:"<< MaxG1Angle << endl; //cout<<"MaxG1Angle:"<< MaxG1Angle << endl;
//cout<<"MaxG2Curvature:"<<MaxG2Curvature<<endl; //cout<<"MaxG2Curvature:"<<MaxG2Curvature<<endl;
if (!isdone) { di<<" Problem in computation "<<"\n"; return 1;} if (!isdone) { di<<" Problem in computation \n"; return 1;}
if (ISG2) if (ISG2)
di<<" the continuity is G2 "<<"\n"; di<<" the continuity is G2 \n";
else di<<" the continuity is not G2 "<<"\n"; else di<<" the continuity is not G2 \n";
di<<"MaxG0Value :"<< MaxG0Value << "\n"; di<<"MaxG0Value :"<< MaxG0Value << "\n";
di<<"MaxG1Angle:"<< MaxG1Angle << "\n"; di<<"MaxG1Angle:"<< MaxG1Angle << "\n";
di<<"MaxG2Curvature:"<<MaxG2Curvature<<"\n"; di<<"MaxG2Curvature:"<<MaxG2Curvature<<"\n";
@ -1417,7 +1417,7 @@ static Standard_Integer clintedge(Draw_Interpretor& di,
if (narg < 2) { if (narg < 2) {
//cout << "Usage: clintedge shape" << endl; //cout << "Usage: clintedge shape" << endl;
di << "Usage: clintedge shape" << "\n"; di << "Usage: clintedge shape\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get(a[1]); TopoDS_Shape S = DBRep::Get(a[1]);
@ -1428,7 +1428,7 @@ static Standard_Integer clintedge(Draw_Interpretor& di,
if (nbedges > 0) if (nbedges > 0)
{ {
//cout<<nbedges<<" internal (or external) edges to be removed"<<endl; //cout<<nbedges<<" internal (or external) edges to be removed"<<endl;
di<<nbedges<<" internal (or external) edges to be removed"<<"\n"; di<<nbedges<<" internal (or external) edges to be removed\n";
Standard_Integer i = 1; Standard_Integer i = 1;
char* temp = newname; char* temp = newname;
@ -1442,7 +1442,7 @@ static Standard_Integer clintedge(Draw_Interpretor& di,
di<<"\n"; di<<"\n";
} }
else else
di << "no internal (or external) edges"<<"\n"; di << "no internal (or external) edges\n";
//cout << "no internal (or external) edges"<<endl; //cout << "no internal (or external) edges"<<endl;
return 0; return 0;
@ -1460,7 +1460,7 @@ static Standard_Integer facintedge(Draw_Interpretor& di,
if (narg < 2) { if (narg < 2) {
//cout << "Usage: facintedge shape" << endl; //cout << "Usage: facintedge shape" << endl;
di << "Usage: facintedge shape" << "\n"; di << "Usage: facintedge shape\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get(a[1]); TopoDS_Shape S = DBRep::Get(a[1]);
@ -1498,7 +1498,7 @@ static Standard_Integer fuseedge(Draw_Interpretor& di,
if (narg < 2) { if (narg < 2) {
//cout << "Usage: fuseedge shape" << endl; //cout << "Usage: fuseedge shape" << endl;
di << "Usage: fuseedge shape" << "\n"; di << "Usage: fuseedge shape\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get(a[1]); TopoDS_Shape S = DBRep::Get(a[1]);
@ -1513,7 +1513,7 @@ static Standard_Integer fuseedge(Draw_Interpretor& di,
if (nbvertices > 0) { if (nbvertices > 0) {
//cout<<nbvertices<<" vertices to be removed"<<endl; //cout<<nbvertices<<" vertices to be removed"<<endl;
di<<nbvertices<<" vertices to be removed"<<"\n"; di<<nbvertices<<" vertices to be removed\n";
Standard_Integer i = 1; Standard_Integer i = 1;
char* temp = newname; char* temp = newname;
@ -1527,7 +1527,7 @@ static Standard_Integer fuseedge(Draw_Interpretor& di,
di<<"\n"; di<<"\n";
} }
else else
di << "no vertices to remove"<<"\n"; di << "no vertices to remove\n";
//cout << "no vertices to remove"<<endl; //cout << "no vertices to remove"<<endl;
return 0; return 0;
@ -1545,7 +1545,7 @@ static Standard_Integer listfuseedge(Draw_Interpretor& di,
if (narg < 2) { if (narg < 2) {
//cout << "Usage: listfuseedge shape" << endl; //cout << "Usage: listfuseedge shape" << endl;
di << "Usage: listfuseedge shape" << "\n"; di << "Usage: listfuseedge shape\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get(a[1]); TopoDS_Shape S = DBRep::Get(a[1]);

View File

@ -171,7 +171,7 @@ static Standard_Integer trim(Draw_Interpretor& di, Standard_Integer n, const cha
} }
else { else {
//cout <<"Error creating edge"<<endl; //cout <<"Error creating edge"<<endl;
di <<"Error creating edge"<<"\n"; di <<"Error creating edge\n";
} }
return 0; return 0;
} }
@ -236,7 +236,7 @@ static Standard_Integer wire(Draw_Interpretor& di, Standard_Integer n, const cha
} }
if (!MW.IsDone()) { if (!MW.IsDone()) {
//cout << "Wire not done" << endl; //cout << "Wire not done" << endl;
di << "Wire not done" << "\n"; di << "Wire not done\n";
return 0; return 0;
} }
DBRep::Set(a[1],MW); DBRep::Set(a[1],MW);
@ -255,7 +255,7 @@ static Standard_Integer mkedge(Draw_Interpretor& di, Standard_Integer n, const c
Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]); Handle(Geom2d_Curve) C2d = DrawTrSurf::GetCurve2d(a[2]);
if (C.IsNull() && C2d.IsNull()) { if (C.IsNull() && C2d.IsNull()) {
//cout << a[2] << " is not a curve" << endl; //cout << a[2] << " is not a curve" << endl;
di << a[2] << " is not a curve" << "\n"; di << a[2] << " is not a curve\n";
return 1; return 1;
} }
@ -336,7 +336,7 @@ static Standard_Integer mkcurve(Draw_Interpretor& di, Standard_Integer n, const
Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(S),L,f,l); Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(S),L,f,l);
if (C.IsNull()) { if (C.IsNull()) {
//cout << a[2] << " has no 3d curve" << endl; //cout << a[2] << " has no 3d curve" << endl;
di << a[2] << " has no 3d curve" << "\n"; di << a[2] << " has no 3d curve\n";
return 1; return 1;
} }
C = new Geom_TrimmedCurve(C,f,l); C = new Geom_TrimmedCurve(C,f,l);
@ -1544,7 +1544,7 @@ Standard_Integer mkoffset(Draw_Interpretor& di,
if ( !Paral.IsDone()) if ( !Paral.IsDone())
{ {
di << " Error: Offset is not done." << "\n"; di << " Error: Offset is not done.\n";
return 1; return 1;
} }
else else
@ -1604,7 +1604,7 @@ Standard_Integer openoffset(Draw_Interpretor& di,
if ( !Paral.IsDone()) if ( !Paral.IsDone())
{ {
di << " Error: Offset is not done." << "\n"; di << " Error: Offset is not done.\n";
return 1; return 1;
} }
else else
@ -1672,7 +1672,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
if (EInter.IsEmpty()) { if (EInter.IsEmpty()) {
//cout << " No intersection found" << endl; //cout << " No intersection found" << endl;
di << " No intersection found" << "\n"; di << " No intersection found\n";
return 0; return 0;
} }
@ -1715,10 +1715,10 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
di << " Orientation of vertex " << NbV << " on " << a[i+1] << ": "; di << " Orientation of vertex " << NbV << " on " << a[i+1] << ": ";
if (OO == TopAbs_FORWARD) { if (OO == TopAbs_FORWARD) {
//cout << "FORWARD" << endl; //cout << "FORWARD" << endl;
di << "FORWARD" << "\n"; di << "FORWARD\n";
} else { } else {
//cout << "REVERSED" << endl; //cout << "REVERSED" << endl;
di << "REVERSED" << "\n"; di << "REVERSED\n";
} }
} }
} }
@ -1787,7 +1787,7 @@ Standard_Integer build3d(Draw_Interpretor& di,
if ( (n <2) || (n>3) ) { if ( (n <2) || (n>3) ) {
//cout << " 1 or 2 arguments expected" << endl; //cout << " 1 or 2 arguments expected" << endl;
di << " 1 or 2 arguments expected" << "\n"; di << " 1 or 2 arguments expected\n";
return 1; return 1;
} }
@ -1798,7 +1798,7 @@ Standard_Integer build3d(Draw_Interpretor& di,
if (n==2) { Ok = BRepLib::BuildCurves3d(S); } if (n==2) { Ok = BRepLib::BuildCurves3d(S); }
else { Ok = BRepLib::BuildCurves3d(S,Draw::Atof(a[2])); } else { Ok = BRepLib::BuildCurves3d(S,Draw::Atof(a[2])); }
//if (!Ok) {cout << " one of the computation failed" << endl;} //if (!Ok) {cout << " one of the computation failed" << endl;}
if (!Ok) {di << " one of the computation failed" << "\n";} if (!Ok) {di << " one of the computation failed\n";}
return 0; return 0;
} }
@ -1819,7 +1819,7 @@ Standard_Integer reducepcurves(Draw_Interpretor& di,
TopoDS_Shape aShape = DBRep::Get(a[i]); TopoDS_Shape aShape = DBRep::Get(a[i]);
if (aShape.IsNull()) if (aShape.IsNull())
//cout << a[i] << " is not a valid shape" << endl; //cout << a[i] << " is not a valid shape" << endl;
di << a[i] << " is not a valid shape" << "\n"; di << a[i] << " is not a valid shape\n";
else else
BRepTools::RemoveUnusedPCurves(aShape); BRepTools::RemoveUnusedPCurves(aShape);
} }

View File

@ -103,7 +103,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
TopoDS_Shape V = DBRep::Get(a[2]); TopoDS_Shape V = DBRep::Get(a[2]);
if ( V.IsNull()) { if ( V.IsNull()) {
//cout << a[2] << " is not a Shape" << endl; //cout << a[2] << " is not a Shape" << endl;
theCommands << a[2] << " is not a Shape" << "\n"; theCommands << a[2] << " is not a Shape\n";
return 1; return 1;
} }
@ -123,7 +123,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
if ( F.IsNull()) { if ( F.IsNull()) {
//cout << a[9*ii+6] << " is not a face" << endl; //cout << a[9*ii+6] << " is not a face" << endl;
theCommands << a[9*ii+6] << " is not a face" << "\n"; theCommands << a[9*ii+6] << " is not a face\n";
return 1; return 1;
} }
@ -211,11 +211,11 @@ static Standard_Integer draft (Draw_Interpretor& di,
if (Internal) { if (Internal) {
MkDraft.SetDraft(Internal); MkDraft.SetDraft(Internal);
di << "Internal Draft : " << "\n"; di << "Internal Draft : \n";
//cout << "Internal Draft : " << endl; //cout << "Internal Draft : " << endl;
} }
else else
di << "External Draft : " << "\n"; di << "External Draft : \n";
//cout << "External Draft : " << endl; //cout << "External Draft : " << endl;
TopoDS_Shape Stop = DBRep::Get(a[7]);//shape d'arret TopoDS_Shape Stop = DBRep::Get(a[7]);//shape d'arret

View File

@ -135,7 +135,7 @@ static Standard_Integer distmini(Draw_Interpretor& di, Standard_Integer n, const
} }
else di << "probleme"<< "\n"; else di << "probleme\n";
//else cout << "probleme"<< endl; //else cout << "probleme"<< endl;
return 0; return 0;
} }

View File

@ -544,7 +544,7 @@ static Standard_Integer PRW(Draw_Interpretor& theCommands,
else { else {
// il faudrait inverser V et appeler PerfomFromEnd... // il faudrait inverser V et appeler PerfomFromEnd...
//cout << "Not Implemented" << endl; //cout << "Not Implemented" << endl;
theCommands << "Not Implemented" << "\n"; theCommands << "Not Implemented\n";
} }
} }
if (!thePFace.IsDone()) { if (!thePFace.IsDone()) {
@ -709,7 +709,7 @@ static Standard_Integer PRF(Draw_Interpretor& theCommands,
else { //FUntil.IsNull() else { //FUntil.IsNull()
// il faudrait inverser V et appeler PerfomFromEnd... // il faudrait inverser V et appeler PerfomFromEnd...
//cout << "Not Implemented" << endl; //cout << "Not Implemented" << endl;
theCommands << "Not Implemented" << "\n"; theCommands << "Not Implemented\n";
} }
} }
if (!thePFace.IsDone()) { if (!thePFace.IsDone()) {
@ -949,8 +949,8 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
Standard_Integer n, const char** a) Standard_Integer n, const char** a)
{ {
if ( n == 1 ) { if ( n == 1 ) {
di << " OffsetParameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]" << "\n"; di << " OffsetParameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]\n";
di << " Current Values" << "\n"; di << " Current Values\n";
di << " --> Tolerance : " << TheTolerance << "\n"; di << " --> Tolerance : " << TheTolerance << "\n";
di << " --> TheInter : "; di << " --> TheInter : ";
if ( TheInter) { if ( TheInter) {
@ -958,7 +958,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
} else { } else {
di << "Partial"; di << "Partial";
} }
di << "\n" << " --> TheJoin : "; di << "\n --> TheJoin : ";
switch (TheJoin) { switch (TheJoin) {
case GeomAbs_Arc: di << "Arc"; break; case GeomAbs_Arc: di << "Arc"; break;
@ -967,7 +967,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
break ; break ;
} }
// //
di << "\n" << " --> Internal Edges : "; di << "\n --> Internal Edges : ";
if (RemoveIntEdges) { if (RemoveIntEdges) {
di << "Remove"; di << "Remove";
} }
@ -975,7 +975,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
di << "Keep"; di << "Keep";
} }
// //
di << "\n" << " --> Invalid Faces : "; di << "\n --> Invalid Faces : ";
if (RemoveInvalidFaces) { if (RemoveInvalidFaces) {
di << "Remove"; di << "Remove";
} }

View File

@ -80,15 +80,15 @@ static Standard_Integer contblend(Draw_Interpretor& di, Standard_Integer narg, c
switch (blend_cont) { switch (blend_cont) {
case GeomAbs_C0: case GeomAbs_C0:
//cout << ""<<endl; //cout << ""<<endl;
di << "C0"<<"\n"; di << "C0\n";
break; break;
case GeomAbs_C1: case GeomAbs_C1:
//cout << "C1"<<endl; //cout << "C1"<<endl;
di << "C1"<<"\n"; di << "C1\n";
break; break;
case GeomAbs_C2: case GeomAbs_C2:
//cout << "C2"<<endl; //cout << "C2"<<endl;
di << "C2"<<"\n"; di << "C2\n";
break; break;
default: default:
break; break;
@ -215,12 +215,12 @@ static Standard_Integer CheckHist(Draw_Interpretor& di,
{ {
if(Rakk == 0) { if(Rakk == 0) {
//cout<<"No active Builder"<<endl; //cout<<"No active Builder"<<endl;
di<<"No active Builder"<<"\n"; di<<"No active Builder\n";
return 1; return 1;
} }
if(!Rakk->IsDone()) { if(!Rakk->IsDone()) {
//cout<<"Active Builder Not Done"<<endl; //cout<<"Active Builder Not Done"<<endl;
di<<"Active Builder Not Done"<<"\n"; di<<"Active Builder Not Done\n";
return 1; return 1;
} }
Standard_Integer nbc = Rakk->NbContours(); Standard_Integer nbc = Rakk->NbContours();
@ -242,7 +242,7 @@ static Standard_Integer CheckHist(Draw_Interpretor& di,
PrintHist(curshape,It,nbgen); PrintHist(curshape,It,nbgen);
} }
//cout<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }"<<endl; //cout<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }"<<endl;
di<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }"<<"\n"; di<<"foreach g [lsort [dir gen*]] { wclick; puts [dname $g]; donl $g; }\n";
return 0; return 0;
} }
@ -277,7 +277,7 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
{ {
if(Rake == 0){ if(Rake == 0){
//cout << "MakeFillet not initialized"<<endl; //cout << "MakeFillet not initialized"<<endl;
di << "MakeFillet not initialized"<<"\n"; di << "MakeFillet not initialized\n";
return 1 ; return 1 ;
} }
if(narg%2 != 0 || narg < 4) return 1; if(narg%2 != 0 || narg < 4) return 1;
@ -301,7 +301,7 @@ static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
{ {
if(Rake == 0){ if(Rake == 0){
//cout << "MakeFillet not initialized"<<endl; //cout << "MakeFillet not initialized"<<endl;
di << "MakeFillet not initialized"<<"\n"; di << "MakeFillet not initialized\n";
return 1 ; return 1 ;
} }
Rake->Build(); Rake->Build();
@ -528,16 +528,16 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
// if (Rakk.IsDone()==FilletSurf_IsPartial) cout <<"resultat partiel"<<endl; // if (Rakk.IsDone()==FilletSurf_IsPartial) cout <<"resultat partiel"<<endl;
if (aRakk.IsDone()==FilletSurf_IsNotOk) if (aRakk.IsDone()==FilletSurf_IsNotOk)
{ FilletSurf_ErrorTypeStatus err=aRakk.StatusError(); { FilletSurf_ErrorTypeStatus err=aRakk.StatusError();
if (err==FilletSurf_EmptyList) di<< "StatusError=EmptyList"<<"\n"; if (err==FilletSurf_EmptyList) di<< "StatusError=EmptyList\n";
else if (err==FilletSurf_EdgeNotG1) di<< "StatusError=NotG1"<<"\n"; else if (err==FilletSurf_EdgeNotG1) di<< "StatusError=NotG1\n";
else if (err==FilletSurf_FacesNotG1) di<< "StatusError=facesNotG1"<<"\n"; else if (err==FilletSurf_FacesNotG1) di<< "StatusError=facesNotG1\n";
else if (err==FilletSurf_EdgeNotOnShape) else if (err==FilletSurf_EdgeNotOnShape)
di<< "StatusError=edgenotonshape"<<"\n"; di<< "StatusError=edgenotonshape\n";
else if (err==FilletSurf_NotSharpEdge ) di<< "StatusError=notsharpedge"<<"\n"; else if (err==FilletSurf_NotSharpEdge ) di<< "StatusError=notsharpedge\n";
else if (err==FilletSurf_PbFilletCompute) di <<"StatusError=PBFillet"<<"\n"; else if (err==FilletSurf_PbFilletCompute) di <<"StatusError=PBFillet\n";
} }
else { else {
if (aRakk.IsDone()==FilletSurf_IsPartial) di <<"partial result"<<"\n"; if (aRakk.IsDone()==FilletSurf_IsPartial) di <<"partial result\n";
nb=aRakk.NbSurface(); nb=aRakk.NbSurface();
char localname [100]; char localname [100];
@ -554,11 +554,11 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
//else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge) //else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
// {cout<<" type deb conges = WLBLEND"<<endl;} // {cout<<" type deb conges = WLBLEND"<<endl;}
if (aRakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge) if (aRakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge)
{di<<" type start fillets = WLBLOUT"<<"\n";} {di<<" type start fillets = WLBLOUT\n";}
else if (aRakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge) else if (aRakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge)
{ di<<" type start fillets = WLBLSTOP"<<"\n";} { di<<" type start fillets = WLBLSTOP\n";}
else if (aRakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge) else if (aRakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
{di<<" type start fillets = WLBLEND"<<"\n";} {di<<" type start fillets = WLBLEND\n";}
//if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge) //if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
// {cout<<" type fin conges = WLBLOUT"<<endl;} // {cout<<" type fin conges = WLBLOUT"<<endl;}
@ -567,11 +567,11 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
//else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge) //else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
// { cout<<" type fin conges = WLBLEND"<<endl;} // { cout<<" type fin conges = WLBLEND"<<endl;}
if (aRakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge) if (aRakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
{di<<" type end fillets = WLBLOUT"<<"\n";} {di<<" type end fillets = WLBLOUT\n";}
else if (aRakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge) else if (aRakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge)
{di<<" type end fillets = WLBLSTOP"<<"\n";} {di<<" type end fillets = WLBLSTOP\n";}
else if (aRakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge) else if (aRakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
{ di<<" type end fillets = WLBLEND"<<"\n";} { di<<" type end fillets = WLBLEND\n";}
Standard_Real f,l; Standard_Real f,l;
f = aRakk.FirstParameter(); f = aRakk.FirstParameter();
l = aRakk.LastParameter(); l = aRakk.LastParameter();
@ -679,7 +679,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
// TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE)); // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
if ( F1.IsNull()) { if ( F1.IsNull()) {
//cout << " Stop face not referenced." << endl; //cout << " Stop face not referenced." << endl;
di << " Stop face not referenced." << "\n"; di << " Stop face not referenced.\n";
return 1; return 1;
} }
Roll.SetStoppingFace(F1); Roll.SetStoppingFace(F1);
@ -691,7 +691,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
i++; i++;
if ( !strcmp(a[i],"@")) { if ( !strcmp(a[i],"@")) {
//cout << " Even number of ball support faces is required " << endl; //cout << " Even number of ball support faces is required " << endl;
di << " Even number of ball support faces is required " << "\n"; di << " Even number of ball support faces is required \n";
return 1; return 1;
} }
aLocalFace = DBRep::Get(a[i],TopAbs_FACE); aLocalFace = DBRep::Get(a[i],TopAbs_FACE);
@ -699,7 +699,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
// TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE)); // TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
if ( F1.IsNull() || F2.IsNull()) { if ( F1.IsNull() || F2.IsNull()) {
//cout << " Support face not referenced." << endl; //cout << " Support face not referenced." << endl;
di << " Support face not referenced." << "\n"; di << " Support face not referenced.\n";
return 1; return 1;
} }
Roll.SetFaces(F1,F2); Roll.SetFaces(F1,F2);
@ -710,7 +710,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[i],TopAbs_EDGE)); // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[i],TopAbs_EDGE));
if ( E.IsNull()) { if ( E.IsNull()) {
//cout << " Edge not referenced." << endl; //cout << " Edge not referenced." << endl;
di << " Edge not referenced." << "\n"; di << " Edge not referenced.\n";
return 1; return 1;
} }
Roll.SetEdge(E); Roll.SetEdge(E);

View File

@ -508,7 +508,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
if (F.IsNull()) if (F.IsNull())
{ {
//cout<<endl<<"Wrong parameters"<<endl<<endl; //cout<<endl<<"Wrong parameters"<<endl<<endl;
di<<"\n"<<"Wrong parameters"<<"\n"<<"\n"; di<<"\nWrong parameters\n\n";
return 1; return 1;
} }
else else
@ -527,7 +527,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
if (E.IsNull()) if (E.IsNull())
{ {
//cout<<"Wrong parameters"<<endl; //cout<<"Wrong parameters"<<endl;
di<<"Wrong parameters"<<"\n"; di<<"Wrong parameters\n";
return 1; return 1;
} }
//TopoDS_Shape alocalFace(DBRep::Get( a[i], TopAbs_FACE ) ); //TopoDS_Shape alocalFace(DBRep::Get( a[i], TopAbs_FACE ) );
@ -559,7 +559,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
if (F.IsNull()) if (F.IsNull())
{ {
//cout<<"Wrong parameters"<<endl; //cout<<"Wrong parameters"<<endl;
di<<"Wrong parameters"<<"\n"; di<<"Wrong parameters\n";
return 1; return 1;
} }
Order = Draw::Atoi( a[i++] ); Order = Draw::Atoi( a[i++] );
@ -572,7 +572,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
if (! MakeFilling.IsDone()) if (! MakeFilling.IsDone())
{ {
//cout<<"filling failed"<<endl; //cout<<"filling failed"<<endl;
di<<"filling failed"<<"\n"; di<<"filling failed\n";
return 0; return 0;
} }
@ -591,7 +591,7 @@ static Standard_Integer filling( Draw_Interpretor & di, Standard_Integer n, cons
Chrono.Show(Tps); Chrono.Show(Tps);
//cout<<"*** FIN DE FILLING ***"<<endl; //cout<<"*** FIN DE FILLING ***"<<endl;
//cout<<"Temps de calcul : "<<Tps<<endl; //cout<<"Temps de calcul : "<<Tps<<endl;
di<<"*** FIN DE FILLING ***"<<"\n"; di<<"*** FIN DE FILLING ***\n";
di<<"Temps de calcul : "<<Tps<<"\n"; di<<"Temps de calcul : "<<Tps<<"\n";
#endif #endif
@ -609,11 +609,11 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
//cout << "-c t2d t3d tang tcur : to set tolerances" << endl; //cout << "-c t2d t3d tang tcur : to set tolerances" << endl;
//cout << "-a maxdeg maxseg : Approximation option" << endl; //cout << "-a maxdeg maxseg : Approximation option" << endl;
di << "fillingparam : options are" <<"\n"; di << "fillingparam : options are" <<"\n";
di << "-l : to list current values" << "\n"; di << "-l : to list current values\n";
di << "-i : to set default values" << "\n"; di << "-i : to set default values" << "\n";
di << "-r deg nbPonC nbIt anis : to set filling options" <<"\n"; di << "-r deg nbPonC nbIt anis : to set filling options\n";
di << "-c t2d t3d tang tcur : to set tolerances" << "\n"; di << "-c t2d t3d tang tcur : to set tolerances\n";
di << "-a maxdeg maxseg : Approximation option" << "\n"; di << "-a maxdeg maxseg : Approximation option\n";
} }
else if (n > 1) else if (n > 1)
{ {
@ -639,15 +639,15 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
di<<"Degree = "<<Degree<<"\n"; di<<"Degree = "<<Degree<<"\n";
di<<"NbPtsOnCur = "<<NbPtsOnCur<<"\n"; di<<"NbPtsOnCur = "<<NbPtsOnCur<<"\n";
di<<"NbIter = "<<NbIter<<"\n"; di<<"NbIter = "<<NbIter<<"\n";
di<<"Anisotropie = "<< (Standard_Integer) Anisotropie<<"\n"<<"\n"; di<<"Anisotropie = "<< (Standard_Integer) Anisotropie<<"\n\n";
di<<"Tol2d = "<<Tol2d<<"\n"; di<<"Tol2d = "<<Tol2d<<"\n";
di<<"Tol3d = "<<Tol3d<<"\n"; di<<"Tol3d = "<<Tol3d<<"\n";
di<<"TolAng = "<<TolAng<<"\n"; di<<"TolAng = "<<TolAng<<"\n";
di<<"TolCurv = "<<TolCurv<<"\n"<<"\n"; di<<"TolCurv = "<<TolCurv<<"\n\n";
di<<"MaxDeg = "<<MaxDeg<<"\n"; di<<"MaxDeg = "<<MaxDeg<<"\n";
di<<"MaxSegments = "<<MaxSegments<<"\n"<<"\n"; di<<"MaxSegments = "<<MaxSegments<<"\n\n";
} }
else if (strcmp( flag, "-i" ) == 0 && n == 2) else if (strcmp( flag, "-i" ) == 0 && n == 2)
{ {
@ -686,7 +686,7 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
else else
{ {
//cout<<"Wrong parameters"<<endl; //cout<<"Wrong parameters"<<endl;
di<<"Wrong parameters"<<"\n"; di<<"Wrong parameters\n";
return 1; return 1;
} }
} }

View File

@ -41,10 +41,10 @@ Standard_IMPORT Draw_Viewer dout;
Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a) Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a)
{ {
if (n < 2) { if (n < 2) {
di << "Use: " << a[0] << " shape [epsilon] [c[losed]] [x y z] [-full]" << "\n"; di << "Use: " << a[0] << " shape [epsilon] [c[losed]] [x y z] [-full]\n";
di << "Compute properties of the shape" << "\n"; di << "Compute properties of the shape\n";
di << "The epsilon, if given, defines relative precision of computation" << "\n"; di << "The epsilon, if given, defines relative precision of computation\n";
di << "The \"closed\" flag, if present, do computation only closed shells of the shape" << "\n"; di << "The \"closed\" flag, if present, do computation only closed shells of the shape\n";
di << "The centroid coordinates will be put to DRAW variables x y z (if given)\n"; di << "The centroid coordinates will be put to DRAW variables x y z (if given)\n";
di << "All values are outputted with the full precision in the full mode.\n\n"; di << "All values are outputted with the full precision in the full mode.\n\n";
return 1; return 1;
@ -104,8 +104,8 @@ Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a)
{ {
Standard_SStream aSStream1; Standard_SStream aSStream1;
aSStream1 << "\n\n"; aSStream1 << "\n\n";
aSStream1 << "Mass : " << setw(15) << G.Mass() << "\n" << "\n"; aSStream1 << "Mass : " << setw(15) << G.Mass() << "\n\n";
if(witheps && *a[0] != 'l') aSStream1 << "Relative error of mass computation : " << setw(15) << eps << "\n" << "\n"; if(witheps && *a[0] != 'l') aSStream1 << "Relative error of mass computation : " << setw(15) << eps << "\n\n";
aSStream1 << "Center of gravity : \n"; aSStream1 << "Center of gravity : \n";
aSStream1 << "X = " << setw(15) << P.X() << "\n"; aSStream1 << "X = " << setw(15) << P.X() << "\n";
@ -174,21 +174,21 @@ Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a)
Standard_Integer vpropsgk(Draw_Interpretor& di, Standard_Integer n, const char** a) Standard_Integer vpropsgk(Draw_Interpretor& di, Standard_Integer n, const char** a)
{ {
if (n < 2) { if (n < 2) {
di << "Use: " << a[0] << " shape epsilon closed span mode [x y z]" << "\n"; di << "Use: " << a[0] << " shape epsilon closed span mode [x y z]\n";
di << "Compute properties of the shape" << "\n"; di << "Compute properties of the shape\n";
di << "The epsilon defines relative precision of computation" << "\n"; di << "The epsilon defines relative precision of computation\n";
di << "The \"closed\" flag, if equal 1, causes computation only closed shells of the shape" << "\n"; di << "The \"closed\" flag, if equal 1, causes computation only closed shells of the shape\n";
di << "The \"span\" flag, if equal 1, says that computation is performed on spans" << "\n"; di << "The \"span\" flag, if equal 1, says that computation is performed on spans\n";
di << " This option makes effect only for BSpline surfaces." << "\n"; di << " This option makes effect only for BSpline surfaces.\n";
di << "mode can be 0 - only volume calculations" << "\n"; di << "mode can be 0 - only volume calculations\n";
di << " 1 - volume and gravity center" << "\n"; di << " 1 - volume and gravity center\n";
di << " 2 - volume, gravity center and matrix of inertia" << "\n"; di << " 2 - volume, gravity center and matrix of inertia\n";
di << "The centroid coordinates will be put to DRAW variables x y z (if given)\n" << "\n"; di << "The centroid coordinates will be put to DRAW variables x y z (if given)\n\n";
return 1; return 1;
} }
if ( n > 2 && n < 6) { if ( n > 2 && n < 6) {
di << "Wrong arguments" << "\n"; di << "Wrong arguments\n";
return 1; return 1;
} }
@ -227,8 +227,8 @@ Standard_Integer vpropsgk(Draw_Interpretor& di, Standard_Integer n, const char**
aSStream0.precision(15); aSStream0.precision(15);
aSStream0 << "\n\n"; aSStream0 << "\n\n";
aSStream0 << "Mass : " << setw(anOutWidth) << G.Mass() << "\n" << "\n"; aSStream0 << "Mass : " << setw(anOutWidth) << G.Mass() << "\n\n";
aSStream0 << "Relative error of mass computation : " << setw(anOutWidth) << eps << "\n" << "\n"; aSStream0 << "Relative error of mass computation : " << setw(anOutWidth) << eps << "\n\n";
aSStream0 << ends; aSStream0 << ends;
di << aSStream0; di << aSStream0;

View File

@ -351,7 +351,7 @@ Standard_Integer brepintcs(Draw_Interpretor& di, Standard_Integer n, const char*
} }
} }
if(!nbpi) if(!nbpi)
di<<"Points of intersections are not found"<<"\n"; di<<"Points of intersections are not found\n";
if(indshape < n-1) if(indshape < n-1)
DBRep::Set(a[n-1], aComp); DBRep::Set(a[n-1], aComp);
//POP pour NT //POP pour NT
@ -424,7 +424,7 @@ Standard_Integer MakeShell(Draw_Interpretor& , Standard_Integer , const char** a
Standard_Integer xbounds(Draw_Interpretor& di, Standard_Integer n, const char** a) Standard_Integer xbounds(Draw_Interpretor& di, Standard_Integer n, const char** a)
{ {
if (n<2) { if (n<2) {
di << "Usage : " << a[0] << " face" << "\n"; di << "Usage : " << a[0] << " face\n";
return 0; return 0;
} }
// //

View File

@ -328,7 +328,7 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
} }
else else
{ {
theDi << "Error! min tolerance can't possess the null value" << "\n"; theDi << "Error! min tolerance can't possess the null value\n";
return (1); return (1);
} }
} }
@ -338,7 +338,7 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
aMaxTol = Draw::Atof (theArgv[++i]); aMaxTol = Draw::Atof (theArgv[++i]);
else else
{ {
theDi << "Error! max tolerance can't possess the null value" << "\n"; theDi << "Error! max tolerance can't possess the null value\n";
return (1); return (1);
} }
} }
@ -371,22 +371,22 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
if (aPar < 2) if (aPar < 2)
{ {
theDi << "Use: " << theArgv[0] << " result [tolerance] shape1 shape2 ... [min tolerance] [max tolerance] [switches]" << "\n"; theDi << "Use: " << theArgv[0] << " result [tolerance] shape1 shape2 ... [min tolerance] [max tolerance] [switches]\n";
theDi << "To set user's value of min/max tolerances the following syntax is used: +<parameter> <value>" << "\n"; theDi << "To set user's value of min/max tolerances the following syntax is used: +<parameter> <value>\n";
theDi << "- parameters are identified by letters:" << "\n"; theDi << "- parameters are identified by letters:\n";
theDi << " mint - min tolerance" << "\n"; theDi << " mint - min tolerance\n";
theDi << " maxt - max tolerance" << "\n"; theDi << " maxt - max tolerance\n";
theDi << "Switches allow to tune other parameters of Sewing" << "\n"; theDi << "Switches allow to tune other parameters of Sewing\n";
theDi << "The following syntax is used: <symbol><parameter>" << "\n"; theDi << "The following syntax is used: <symbol><parameter>\n";
theDi << "- symbol may be - to set parameter off, + to set on" << "\n"; theDi << "- symbol may be - to set parameter off, + to set on\n";
theDi << "- parameters are identified by letters:" << "\n"; theDi << "- parameters are identified by letters:\n";
theDi << " s - mode for creating sewed shape" << "\n"; theDi << " s - mode for creating sewed shape\n";
theDi << " a - mode for analysis of input shapes" << "\n"; theDi << " a - mode for analysis of input shapes\n";
theDi << " c - mode for cutting of free edges" << "\n"; theDi << " c - mode for cutting of free edges\n";
theDi << " n - mode for non manifold processing" << "\n"; theDi << " n - mode for non manifold processing\n";
theDi << " p - mode for same parameter processing for edges" << "\n"; theDi << " p - mode for same parameter processing for edges\n";
theDi << " e - mode for sewing floating edges" << "\n"; theDi << " e - mode for sewing floating edges\n";
theDi << " f - mode for sewing faces" << "\n"; theDi << " f - mode for sewing faces\n";
return (1); return (1);
} }
@ -398,12 +398,12 @@ static Standard_Integer sewing (Draw_Interpretor& theDi,
aMinTol = Precision::Confusion(); aMinTol = Precision::Confusion();
if (aMinTol > aTol) if (aMinTol > aTol)
{ {
theDi << "Error! min tolerance can't exceed working tolerance" << "\n"; theDi << "Error! min tolerance can't exceed working tolerance\n";
return (1); return (1);
} }
if (aMaxTol < aTol) if (aMaxTol < aTol)
{ {
theDi << "Error! max tolerance can't be less than working tolerance" << "\n"; theDi << "Error! max tolerance can't be less than working tolerance\n";
return (1); return (1);
} }

View File

@ -130,11 +130,11 @@ static Standard_Integer pipe(Draw_Interpretor& di,
{ {
if (n == 1) if (n == 1)
{ {
di << "pipe result Wire_spine Profile [Mode [Approx]]" << "\n"; di << "pipe result Wire_spine Profile [Mode [Approx]]\n";
di << "Mode = 0 - CorrectedFrenet," << "\n"; di << "Mode = 0 - CorrectedFrenet,\n";
di << " = 1 - Frenet," << "\n"; di << " = 1 - Frenet,\n";
di << " = 2 - DiscreteTrihedron" << "\n"; di << " = 2 - DiscreteTrihedron\n";
di << "Approx - force C1-approximation if result is C0" << "\n"; di << "Approx - force C1-approximation if result is C0\n";
return 0; return 0;
} }
@ -221,11 +221,11 @@ Standard_Integer evolved(Draw_Interpretor& di, Standard_Integer n, const char**
//cout << " is given in the referencial axis. " << endl; //cout << " is given in the referencial axis. " << endl;
//cout << " 2) evolved result base profil o : "<< endl; //cout << " 2) evolved result base profil o : "<< endl;
//cout << " This position is automatically computed." << endl; //cout << " This position is automatically computed." << endl;
di << " 1) evolved result base profil : "<< "\n"; di << " 1) evolved result base profil : \n";
di << " The relative position of the profil on the base" << "\n"; di << " The relative position of the profil on the base\n";
di << " is given in the referencial axis. " << "\n"; di << " is given in the referencial axis. \n";
di << " 2) evolved result base profil o : "<< "\n"; di << " 2) evolved result base profil o : \n";
di << " This position is automatically computed." << "\n"; di << " This position is automatically computed.\n";
return 0; return 0;
} }
@ -450,22 +450,22 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
//cout << " -CN dx dy dz : BiNormal is given by dx dy dz" << endl; //cout << " -CN dx dy dz : BiNormal is given by dx dy dz" << endl;
//cout << " -FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed" <<endl; //cout << " -FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed" <<endl;
//cout << " -G guide 0|1(ACR|Plan) 0|1(contact|no contact) : with guide"<<endl; //cout << " -G guide 0|1(ACR|Plan) 0|1(contact|no contact) : with guide"<<endl;
di << "setsweep options [arg1 [arg2 [...]]] : options are :" << "\n"; di << "setsweep options [arg1 [arg2 [...]]] : options are :\n";
di << " -FR : Tangent and Normal are given by Frenet trihedron" <<"\n"; di << " -FR : Tangent and Normal are given by Frenet trihedron\n";
di << " -CF : Tangente is given by Frenet," << "\n"; di << " -CF : Tangente is given by Frenet,\n";
di << " the Normal is computed to minimize the torsion " << "\n"; di << " the Normal is computed to minimize the torsion \n";
di << " -DT : discrete trihedron" << "\n"; di << " -DT : discrete trihedron\n";
di << " -DX Surf : Tangent and Normal are given by Darboux trihedron," <<"\n"; di << " -DX Surf : Tangent and Normal are given by Darboux trihedron,\n";
di << " Surf have to be a shell or a face" <<"\n"; di << " Surf have to be a shell or a face\n";
di << " -CN dx dy dz : BiNormal is given by dx dy dz" << "\n"; di << " -CN dx dy dz : BiNormal is given by dx dy dz\n";
di << " -FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed" <<"\n"; di << " -FX Tx Ty TZ [Nx Ny Nz] : Tangent and Normal are fixed\n";
di << " -G guide 0|1(Plan|ACR) 0|1|2(no contact|contact|contact on border) : with guide"<<"\n"; di << " -G guide 0|1(Plan|ACR) 0|1|2(no contact|contact|contact on border) : with guide\n";
return 0; return 0;
} }
if (Sweep ==0) { if (Sweep ==0) {
//cout << "You have forgotten the <<mksweep>> command !"<< endl; //cout << "You have forgotten the <<mksweep>> command !"<< endl;
di << "You have forgotten the <<mksweep>> command !"<< "\n"; di << "You have forgotten the <<mksweep>> command !\n";
return 1; return 1;
} }
if (!strcmp(a[1],"-FR")) { if (!strcmp(a[1],"-FR")) {
@ -480,14 +480,14 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else if (!strcmp(a[1],"-DX")) { else if (!strcmp(a[1],"-DX")) {
if (n!=3) { if (n!=3) {
//cout << "bad arguments !" << endl; //cout << "bad arguments !" << endl;
di << "bad arguments !" << "\n"; di << "bad arguments !\n";
return 1; return 1;
} }
TopoDS_Shape Surf; TopoDS_Shape Surf;
Surf = DBRep::Get(a[2],TopAbs_SHAPE); Surf = DBRep::Get(a[2],TopAbs_SHAPE);
if (Surf.IsNull()) { if (Surf.IsNull()) {
//cout << a[2] <<"is not a shape !" << endl; //cout << a[2] <<"is not a shape !" << endl;
di << a[2] <<"is not a shape !" << "\n"; di << a[2] <<"is not a shape !\n";
return 1; return 1;
} }
Sweep->SetMode(Surf); Sweep->SetMode(Surf);
@ -495,7 +495,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else if (!strcmp(a[1],"-CN")) { else if (!strcmp(a[1],"-CN")) {
if (n!=5) { if (n!=5) {
//cout << "bad arguments !" << endl; //cout << "bad arguments !" << endl;
di << "bad arguments !" << "\n"; di << "bad arguments !\n";
return 1; return 1;
} }
gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])); gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
@ -504,7 +504,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else if (!strcmp(a[1],"-FX")) { else if (!strcmp(a[1],"-FX")) {
if ((n!=5)&&(n!=8)) { if ((n!=5)&&(n!=8)) {
//cout << "bad arguments !" << endl; //cout << "bad arguments !" << endl;
di << "bad arguments !" << "\n"; di << "bad arguments !\n";
return 1; return 1;
} }
gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])); gp_Dir D(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
@ -523,7 +523,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
if (n != 5) if (n != 5)
{ {
//cout << "bad arguments !" << endl; //cout << "bad arguments !" << endl;
di << "bad arguments !" << "\n"; di << "bad arguments !\n";
return 1; return 1;
} }
else else
@ -539,7 +539,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else { else {
//cout << "The option "<< a[1] << " is unknown !" << endl; //cout << "The option "<< a[1] << " is unknown !" << endl;
di << "The option "<< a[1] << " is unknown !" << "\n"; di << "The option "<< a[1] << " is unknown !\n";
return 1; return 1;
} }
return 0; return 0;
@ -558,17 +558,17 @@ static Standard_Integer addsweep(Draw_Interpretor& di,
//cout << " with the spine" <<endl; //cout << " with the spine" <<endl;
//cout << " -R : the wire have to be rotated to assume orthogonality"<<endl; //cout << " -R : the wire have to be rotated to assume orthogonality"<<endl;
//cout << " with the spine's tangent" << endl; //cout << " with the spine's tangent" << endl;
di << "addsweep wire/vertex [Vertex] [-T] [-R] [u0 v0 u1 v1 [...[uN vN]]] : options are :" << "\n"; di << "addsweep wire/vertex [Vertex] [-T] [-R] [u0 v0 u1 v1 [...[uN vN]]] : options are :\n";
di << " -T : the wire/vertex have to be translated to assume contact"<< "\n"; di << " -T : the wire/vertex have to be translated to assume contact\n";
di << " with the spine" <<"\n"; di << " with the spine\n";
di << " -R : the wire have to be rotated to assume orthogonality"<<"\n"; di << " -R : the wire have to be rotated to assume orthogonality\n";
di << " with the spine's tangent" << "\n"; di << " with the spine's tangent\n";
return 0; return 0;
} }
if (Sweep ==0) { if (Sweep ==0) {
//cout << "You have forgotten the <<mksweep>> command !"<< endl; //cout << "You have forgotten the <<mksweep>> command !"<< endl;
di << "You have forgotten the <<mksweep>> command !"<< "\n"; di << "You have forgotten the <<mksweep>> command !\n";
return 1; return 1;
} }
@ -581,7 +581,7 @@ static Standard_Integer addsweep(Draw_Interpretor& di,
Section.ShapeType() != TopAbs_VERTEX) Section.ShapeType() != TopAbs_VERTEX)
{ {
//cout << a[1] <<"is not a wire and is not a vertex!" << endl; //cout << a[1] <<"is not a wire and is not a vertex!" << endl;
di << a[1] <<"is not a wire and is not a vertex!" << "\n"; di << a[1] <<"is not a wire and is not a vertex!\n";
return 1; return 1;
} }
@ -659,7 +659,7 @@ static Standard_Integer deletesweep(Draw_Interpretor& di,
// Section = TopoDS::Wire(DBRep::Get(a[1],TopAbs_SHAPE)); // Section = TopoDS::Wire(DBRep::Get(a[1],TopAbs_SHAPE));
if (Section.IsNull()) { if (Section.IsNull()) {
//cout << a[1] <<"is not a wire !" << endl; //cout << a[1] <<"is not a wire !" << endl;
di << a[1] <<"is not a wire !" << "\n"; di << a[1] <<"is not a wire !\n";
return 1; return 1;
} }
@ -683,27 +683,27 @@ static Standard_Integer buildsweep(Draw_Interpretor& di,
//cout << " -R : Discontinuities are treated like Round Corner" << endl; //cout << " -R : Discontinuities are treated like Round Corner" << endl;
//cout << " Treatement is Intersect and Fill" << endl; //cout << " Treatement is Intersect and Fill" << endl;
//cout << " -S : To build a Solid" << endl; //cout << " -S : To build a Solid" << endl;
di << "build sweep result [-M/-C/-R] [-S] [tol] : options are" << "\n"; di << "build sweep result [-M/-C/-R] [-S] [tol] : options are\n";
di << " -M : Discontinuities are treated by Modfication of"<< "\n"; di << " -M : Discontinuities are treated by Modfication of\n";
di << " the sweeping mode : it is the default" <<"\n"; di << " the sweeping mode : it is the default\n";
di << " -C : Discontinuities are treated like Right Corner" << "\n"; di << " -C : Discontinuities are treated like Right Corner\n";
di << " Treatement is Extent && Intersect" << "\n"; di << " Treatement is Extent && Intersect\n";
di << " -R : Discontinuities are treated like Round Corner" << "\n"; di << " -R : Discontinuities are treated like Round Corner\n";
di << " Treatement is Intersect and Fill" << "\n"; di << " Treatement is Intersect and Fill\n";
di << " -S : To build a Solid" << "\n"; di << " -S : To build a Solid\n";
return 0; return 0;
} }
Standard_Boolean mksolid = Standard_False; Standard_Boolean mksolid = Standard_False;
if (Sweep ==0) { if (Sweep ==0) {
//cout << "You have forgotten the <<mksweep>> command !"<< endl; //cout << "You have forgotten the <<mksweep>> command !"<< endl;
di << "You have forgotten the <<mksweep>> command !"<< "\n"; di << "You have forgotten the <<mksweep>> command !\n";
return 1; return 1;
} }
if (!Sweep->IsReady()) { if (!Sweep->IsReady()) {
//cout << "You have forgotten the <<addsweep>> command !"<< endl; //cout << "You have forgotten the <<addsweep>> command !"<< endl;
di << "You have forgotten the <<addsweep>> command !"<< "\n"; di << "You have forgotten the <<addsweep>> command !\n";
return 1; return 1;
} }
@ -730,15 +730,15 @@ static Standard_Integer buildsweep(Draw_Interpretor& di,
Sweep->Build(); Sweep->Build();
if (!Sweep->IsDone()) { if (!Sweep->IsDone()) {
//cout << "Buildsweep : Not Done" << endl; //cout << "Buildsweep : Not Done" << endl;
di << "Buildsweep : Not Done" << "\n"; di << "Buildsweep : Not Done\n";
BRepBuilderAPI_PipeError Stat = Sweep->GetStatus(); BRepBuilderAPI_PipeError Stat = Sweep->GetStatus();
if (Stat == BRepBuilderAPI_PlaneNotIntersectGuide) { if (Stat == BRepBuilderAPI_PlaneNotIntersectGuide) {
//cout << "Buildsweep : One Plane not intersect the guide" << endl; //cout << "Buildsweep : One Plane not intersect the guide" << endl;
di << "Buildsweep : One Plane not intersect the guide" << "\n"; di << "Buildsweep : One Plane not intersect the guide\n";
} }
if (Stat == BRepBuilderAPI_ImpossibleContact) { if (Stat == BRepBuilderAPI_ImpossibleContact) {
//cout << "BuildSweep : One section can not be in contact with the guide" << endl; //cout << "BuildSweep : One section can not be in contact with the guide" << endl;
di << "BuildSweep : One section can not be in contact with the guide" << "\n"; di << "BuildSweep : One section can not be in contact with the guide\n";
} }
return 1; return 1;
} }
@ -747,7 +747,7 @@ static Standard_Integer buildsweep(Draw_Interpretor& di,
Standard_Boolean B; Standard_Boolean B;
B = Sweep->MakeSolid(); B = Sweep->MakeSolid();
//if (!B) cout << " BuildSweep : It is impossible to make a solid !" << endl; //if (!B) cout << " BuildSweep : It is impossible to make a solid !" << endl;
if (!B) di << " BuildSweep : It is impossible to make a solid !" << "\n"; if (!B) di << " BuildSweep : It is impossible to make a solid !\n";
} }
result = Sweep->Shape(); result = Sweep->Shape();
DBRep::Set(a[1],result); DBRep::Set(a[1],result);
@ -766,13 +766,13 @@ static Standard_Integer simulsweep(Draw_Interpretor& di,
if (Sweep ==0) { if (Sweep ==0) {
//cout << "You have forgotten the <<mksweep>> command !"<< endl; //cout << "You have forgotten the <<mksweep>> command !"<< endl;
di << "You have forgotten the <<mksweep>> command !"<< "\n"; di << "You have forgotten the <<mksweep>> command !\n";
return 1; return 1;
} }
if (!Sweep->IsReady()) { if (!Sweep->IsReady()) {
//cout << "You have forgotten the <<addsweep>> command !"<< endl; //cout << "You have forgotten the <<addsweep>> command !"<< endl;
di << "You have forgotten the <<addsweep>> command !"<< "\n"; di << "You have forgotten the <<addsweep>> command !\n";
return 1; return 1;
} }

View File

@ -168,7 +168,7 @@ static Standard_Integer halfspace(Draw_Interpretor& di,
TopoDS_Shape Shell = DBRep::Get(a[2],TopAbs_SHELL); TopoDS_Shape Shell = DBRep::Get(a[2],TopAbs_SHELL);
if (Shell.IsNull()) { if (Shell.IsNull()) {
//cout << a[2] << " must be a face or a shell" << endl; //cout << a[2] << " must be a face or a shell" << endl;
di << a[2] << " must be a face or a shell" << "\n"; di << a[2] << " must be a face or a shell\n";
return 1; return 1;
} }
else { else {
@ -178,7 +178,7 @@ static Standard_Integer halfspace(Draw_Interpretor& di,
} }
else { else {
//cout << " HalfSpace NotDone" << endl; //cout << " HalfSpace NotDone" << endl;
di << " HalfSpace NotDone" << "\n"; di << " HalfSpace NotDone\n";
return 1; return 1;
} }
} }
@ -190,7 +190,7 @@ static Standard_Integer halfspace(Draw_Interpretor& di,
} }
else { else {
//cout << " HalfSpace NotDone" << endl; //cout << " HalfSpace NotDone" << endl;
di << " HalfSpace NotDone" << "\n"; di << " HalfSpace NotDone\n";
return 1; return 1;
} }
} }

View File

@ -543,7 +543,7 @@ void BRepTools_ShapeSet::DumpGeometry(const TopoDS_Shape& S,
OS << " on triangulation " << myTriangulations.FindIndex(CR->Triangulation()); OS << " on triangulation " << myTriangulations.FindIndex(CR->Triangulation());
if (!CR->Location().IsIdentity()) if (!CR->Location().IsIdentity())
OS << " location "<<Locations().Index(CR->Location()); OS << " location "<<Locations().Index(CR->Location());
OS << endl; OS << "\n";
} }
itrc.Next(); itrc.Next();
} }
@ -1240,7 +1240,7 @@ void BRepTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS,
Handle(Message_ProgressIndicator) progress = GetProgress(); Handle(Message_ProgressIndicator) progress = GetProgress();
Message_ProgressSentry PS(progress, "Polygons On Triangulation", 0, nbpOntri, 1); Message_ProgressSentry PS(progress, "Polygons On Triangulation", 0, nbpOntri, 1);
if (Compact) if (Compact)
OS << "PolygonOnTriangulations " << nbpOntri << endl; OS << "PolygonOnTriangulations " << nbpOntri << "\n";
else { else {
OS << " -------\n"; OS << " -------\n";
OS <<"Dump of " << nbpOntri << " PolygonOnTriangulations\n"; OS <<"Dump of " << nbpOntri << " PolygonOnTriangulations\n";
@ -1271,7 +1271,7 @@ void BRepTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS,
if (!Param.IsNull()) { if (!Param.IsNull()) {
if (!Compact) { if (!Compact) {
OS << " "<< "Parameters :"; OS << " Parameters :";
} }
else OS << "1 " ; else OS << "1 " ;
if (!Compact) OS <<" "; if (!Compact) OS <<" ";
@ -1360,7 +1360,7 @@ void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS,
Message_ProgressSentry PS(progress, "3D Poligons", 0, nbpol, 1); Message_ProgressSentry PS(progress, "3D Poligons", 0, nbpol, 1);
if (Compact) if (Compact)
OS << "Polygon3D " << nbpol << endl; OS << "Polygon3D " << nbpol << "\n";
else { else {
OS << " -------\n"; OS << " -------\n";
OS <<"Dump of " << nbpol << " Polygon3Ds\n"; OS <<"Dump of " << nbpol << " Polygon3Ds\n";
@ -1484,7 +1484,7 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
Message_ProgressSentry PS(progress, "Triangulations", 0, nbtri, 1); Message_ProgressSentry PS(progress, "Triangulations", 0, nbtri, 1);
if (Compact) if (Compact)
OS << "Triangulations " << nbtri << endl; OS << "Triangulations " << nbtri << "\n";
else { else {
OS << " -------\n"; OS << " -------\n";
OS <<"Dump of " << nbtri << " Triangulations\n"; OS <<"Dump of " << nbtri << " Triangulations\n";

View File

@ -164,7 +164,7 @@ void BinTools_LocationSet::Write(Standard_OStream& OS) const
{ {
Standard_Integer i, nbLoc = myMap.Extent(); Standard_Integer i, nbLoc = myMap.Extent();
OS << "Locations "<< nbLoc <<endl; OS << "Locations "<< nbLoc << "\n";
try { try {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
for (i = 1; i <= nbLoc; i++) { for (i = 1; i <= nbLoc; i++) {

View File

@ -321,11 +321,11 @@ void BinTools_ShapeSet::Write(Standard_OStream& OS)const
// write the copyright // write the copyright
if (myFormatNb == 3) if (myFormatNb == 3)
OS << "\n" << Version_3 << endl; OS << "\n" << Version_3 << "\n";
else if (myFormatNb == 2) else if (myFormatNb == 2)
OS << "\n" << Version_2 << endl; OS << "\n" << Version_2 << "\n";
else else
OS << "\n" << Version_1 << endl; OS << "\n" << Version_1 << "\n";
//----------------------------------------- //-----------------------------------------
// write the locations // write the locations
@ -1194,7 +1194,7 @@ void BinTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS) const
{ {
Standard_Integer i, j, nbpOntri = myNodes.Extent(); Standard_Integer i, j, nbpOntri = myNodes.Extent();
OS << "PolygonOnTriangulations " << nbpOntri << endl; OS << "PolygonOnTriangulations " << nbpOntri << "\n";
Handle(Poly_PolygonOnTriangulation) Poly; Handle(Poly_PolygonOnTriangulation) Poly;
Handle(TColStd_HArray1OfReal) Param; Handle(TColStd_HArray1OfReal) Param;
try { try {
@ -1293,7 +1293,7 @@ void BinTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS)
void BinTools_ShapeSet::WritePolygon3D(Standard_OStream& OS)const void BinTools_ShapeSet::WritePolygon3D(Standard_OStream& OS)const
{ {
Standard_Integer i, j, nbpol = myPolygons3D.Extent(); Standard_Integer i, j, nbpol = myPolygons3D.Extent();
OS << "Polygon3D " << nbpol << endl; OS << "Polygon3D " << nbpol << "\n";
Handle(Poly_Polygon3D) P; Handle(Poly_Polygon3D) P;
try { try {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
@ -1396,7 +1396,7 @@ void BinTools_ShapeSet::WriteTriangulation(Standard_OStream& OS) const
{ {
Standard_Integer i, j, nbNodes, nbtri = myTriangulations.Extent(); Standard_Integer i, j, nbNodes, nbtri = myTriangulations.Extent();
Standard_Integer nbTriangles = 0, n1, n2, n3; Standard_Integer nbTriangles = 0, n1, n2, n3;
OS << "Triangulations " << nbtri << endl; OS << "Triangulations " << nbtri << "\n";
Handle(Poly_Triangulation) T; Handle(Poly_Triangulation) T;
try { try {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS

View File

@ -1203,7 +1203,7 @@ void CDM_Document::LoadResources()
} }
myResourcesAreLoaded=Standard_True; myResourcesAreLoaded=Standard_True;
// cout << "resource Loaded: " << "Format: " << theFormat << ", FileExtension:" << myFileExtension << ", DataType:" << myDataType << ", VersionDataType:" << myVersionDataType << ", Description:" << myDescription << ", Domain:" << myDomain << endl; // cout << "resource Loaded: Format: " << theFormat << ", FileExtension:" << myFileExtension << ", DataType:" << myDataType << ", VersionDataType:" << myVersionDataType << ", Description:" << myDescription << ", Domain:" << myDomain << endl;
} }
return; return;
} }

View File

@ -177,7 +177,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
di << "\n"; di << "\n";
if (withHLR) { if (withHLR) {
di << "Angle of discretization : "; di << "Angle of discretization : ";
di << anglHLR * 180 / M_PI << " degrees" << "\n"; di << anglHLR * 180 / M_PI << " degrees\n";
} }
} }
else di << " wireframe"; else di << " wireframe";
@ -212,7 +212,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
} }
else if (!strcasecmp(a[1],"ang" )) { else if (!strcasecmp(a[1],"ang" )) {
di << "Angle de discretisation : "; di << "Angle de discretisation : ";
di << anglHLR * 180 / M_PI << " degres" << "\n"; di << anglHLR * 180 / M_PI << " degres\n";
} }
else return 1; else return 1;
} }
@ -228,7 +228,7 @@ static Standard_Integer hlr (Draw_Interpretor& di,
if (anglHLR > HAngMax) anglHLR = HAngMax; if (anglHLR > HAngMax) anglHLR = HAngMax;
} }
di << "Angle of discretization : "; di << "Angle of discretization : ";
di << anglHLR * 180 / M_PI << " degrees" << "\n"; di << anglHLR * 180 / M_PI << " degrees\n";
} }
if (n >= nFirst + 1) { if (n >= nFirst + 1) {
@ -636,7 +636,7 @@ static Standard_Integer nexplode(Draw_Interpretor& di,
// Check of equality of MidXYZ // Check of equality of MidXYZ
for (Index=1; Index < MaxShapes; Index++) { for (Index=1; Index < MaxShapes; Index++) {
if (MidXYZ(OrderInd(Index+1)) == MidXYZ(OrderInd(Index))) if (MidXYZ(OrderInd(Index+1)) == MidXYZ(OrderInd(Index)))
di<<"Warning! For this shape the results may be incorrect."<<"\n"; di<<"Warning! For this shape the results may be incorrect.\n";
} }
for (Index=1 ;Index <= MaxShapes; Index++) { for (Index=1 ;Index <= MaxShapes; Index++) {
@ -1155,7 +1155,7 @@ static Standard_Integer normals(Draw_Interpretor& di,
V.Multiply(l/x); V.Multiply(l/x);
else { else {
V.SetCoord(l/2.,0,0); V.SetCoord(l/2.,0,0);
di << "Null normal"<< "\n"; di << "Null normal\n";
} }
P2 = P1; P2 = P1;

View File

@ -220,7 +220,7 @@ static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
TDF_TagSource::Set(L); TDF_TagSource::Set(L);
return 0; return 0;
} }
di << "DDF_SetTagger : Error" << "\n"; di << "DDF_SetTagger : Error\n";
return 1; return 1;
} }
@ -243,7 +243,7 @@ static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
di << A->NewTag (); di << A->NewTag ();
return 0; return 0;
} }
di << "DDF_NewTag : Error" << "\n"; di << "DDF_NewTag : Error\n";
return 1; return 1;
} }
@ -273,7 +273,7 @@ static Standard_Integer DDF_NewChild (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDF_NewChild : Error" << "\n"; di << "DDF_NewChild : Error\n";
return 1; return 1;
} }
@ -290,13 +290,13 @@ static Standard_Integer DDF_Label (Draw_Interpretor& di,Standard_Integer n, cons
TDF_Label L; TDF_Label L;
if (!DDF::FindLabel(DF,a[2],L,Standard_False)) { if (!DDF::FindLabel(DF,a[2],L,Standard_False)) {
DDF::AddLabel(DF,a[2],L); DDF::AddLabel(DF,a[2],L);
//di << "Label : " << a[2] << " created" << "\n"; //di << "Label : " << a[2] << " created\n";
} }
//else di << "Label : " << a[2] << " retrieved" << "\n"; //else di << "Label : " << a[2] << " retrieved\n";
DDF::ReturnLabel(di,L); DDF::ReturnLabel(di,L);
return 0; return 0;
} }
di << "DDF_Label : Error" << "\n"; di << "DDF_Label : Error\n";
return 1; return 1;
} }

View File

@ -66,7 +66,7 @@ static Standard_Integer MakeDF (Draw_Interpretor& di,
if (!D.IsNull ()) { if (!D.IsNull ()) {
NewDDF = Handle(DDF_Data)::DownCast (D); NewDDF = Handle(DDF_Data)::DownCast (D);
if (!NewDDF.IsNull ()) { if (!NewDDF.IsNull ()) {
di<<"DDF_BasicCommands::MakeDF - Sorry, this Data Framework already exists"<<"\n"; di<<"DDF_BasicCommands::MakeDF - Sorry, this Data Framework already exists\n";
return 0; return 0;
} }
} }
@ -108,7 +108,7 @@ static Standard_Integer ClearDF (Draw_Interpretor& di,
} }
} }
di<<"DDF_BasicCommands::MakeDF - Sorry, this Data Framework doesn't exist"<<"\n"; di<<"DDF_BasicCommands::MakeDF - Sorry, this Data Framework doesn't exist\n";
return 0; return 0;
} }
@ -182,18 +182,18 @@ static Standard_Integer MiniDumpDF (Draw_Interpretor& di,
D = Draw::Get(a[1]); D = Draw::Get(a[1]);
if (D.IsNull ()) { if (D.IsNull ()) {
di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist"<<"\n"; di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist\n";
return Standard_False; return Standard_False;
} }
DDF = Handle(DDF_Data)::DownCast (D); DDF = Handle(DDF_Data)::DownCast (D);
if (DDF.IsNull ()) { if (DDF.IsNull ()) {
di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist"<<"\n"; di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist\n";
return Standard_False; return Standard_False;
} }
di<<"*********** Dump of "<<a[1]<<" ***********"<<"\n"; di<<"*********** Dump of "<<a[1]<<" ***********\n";
//DDF->DataFramework()->Dump(cout); //DDF->DataFramework()->Dump(cout);
Standard_SStream aSStream; Standard_SStream aSStream;
@ -220,18 +220,18 @@ static Standard_Integer XDumpDF (Draw_Interpretor& di,
D = Draw::Get(a[1]); D = Draw::Get(a[1]);
if (D.IsNull ()) { if (D.IsNull ()) {
di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist"<<"\n"; di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist\n";
return Standard_False; return Standard_False;
} }
DDF = Handle(DDF_Data)::DownCast (D); DDF = Handle(DDF_Data)::DownCast (D);
if (DDF.IsNull ()) { if (DDF.IsNull ()) {
di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist"<<"\n"; di<<"DDF_BasicCommands : Sorry this Data Framework doesn't exist\n";
return Standard_False; return Standard_False;
} }
di<<"*********** Dump of "<<a[1]<<" ***********"<<"\n"; di<<"*********** Dump of "<<a[1]<<" ***********\n";
TDF_IDFilter filter(Standard_False); TDF_IDFilter filter(Standard_False);
//TDF_Tool::ExtendedDeepDump(cout,DDF->DataFramework(),filter); //TDF_Tool::ExtendedDeepDump(cout,DDF->DataFramework(),filter);
@ -257,7 +257,7 @@ static Standard_Integer CopyLabel_SCopy (Draw_Interpretor& di,Standard_Integer n
if(!DDF::GetDF(a[1], DF)) return 1; if(!DDF::GetDF(a[1], DF)) return 1;
if (!DDF::FindLabel(DF,a[2],SOURCE)) return 1; if (!DDF::FindLabel(DF,a[2],SOURCE)) return 1;
if (DDF::FindLabel(DF,a[3],TARGET)) { if (DDF::FindLabel(DF,a[3],TARGET)) {
di << " target label is already setted "<< "\n"; di << " target label is already setted \n";
return 1; return 1;
} }
DDF::AddLabel(DF,a[3],TARGET); DDF::AddLabel(DF,a[3],TARGET);
@ -265,10 +265,10 @@ static Standard_Integer CopyLabel_SCopy (Draw_Interpretor& di,Standard_Integer n
cop.Load(SOURCE, TARGET); cop.Load(SOURCE, TARGET);
cop.Perform(); cop.Perform();
if (!cop.IsDone()) if (!cop.IsDone())
di << "copy not done" << "\n"; di << "copy not done\n";
return 0; return 0;
} }
di << "DDF_CopyLabel : Error" << "\n"; di << "DDF_CopyLabel : Error\n";
return 1; return 1;
} }
@ -327,10 +327,10 @@ static Standard_Integer DDF_CheckAttrs (Draw_Interpretor& di,Standard_Integer n
ds1->Clear(); ds1->Clear();
} }
if(!Shar) if(!Shar)
di << "Shareable attributes not found" << "\n"; di << "Shareable attributes not found\n";
return 0; return 0;
} }
di << "DDF_CheckAttrs : Error" << "\n"; di << "DDF_CheckAttrs : Error\n";
return 1; return 1;
} }
@ -367,7 +367,7 @@ static Standard_Integer DDF_CheckLabel (Draw_Interpretor& di,Standard_Integer n
return 0; return 0;
} }
di << "DDF_ChecLabel : Error" << "\n"; di << "DDF_ChecLabel : Error\n";
return 1; return 1;
} }

View File

@ -84,7 +84,7 @@ static Standard_Integer AbortTran (Draw_Interpretor& di,
DDF_TStack.RemoveFirst(); DDF_TStack.RemoveFirst();
} }
else { else {
di<<"DDF_BasicCommands::AbortTran - No more transaction to abort"<<"\n"; di<<"DDF_BasicCommands::AbortTran - No more transaction to abort\n";
} }
} }
return 0; return 0;
@ -113,7 +113,7 @@ static Standard_Integer CommitTran (Draw_Interpretor& di,
DDF_TStack.RemoveFirst(); DDF_TStack.RemoveFirst();
} }
else { else {
di<<"DDF_BasicCommands::CommitTran - No more transaction to commit"<<"\n"; di<<"DDF_BasicCommands::CommitTran - No more transaction to commit\n";
} }
} }
return 0; return 0;
@ -172,17 +172,17 @@ static Standard_Integer Undo (Draw_Interpretor& di,
DDF_LastDelta = tmp; DDF_LastDelta = tmp;
} }
else { else {
di<<"Undo not applicable HERE and NOW."<<"\n"; di<<"Undo not applicable HERE and NOW.\n";
return 1; return 1;
} }
} }
else { else {
di<<"No undo to apply."<<"\n"; di<<"No undo to apply.\n";
return 1; return 1;
} }
} }
else { else {
di<<"Unknown DF."<<"\n"; di<<"Unknown DF.\n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -116,7 +116,7 @@ static Standard_Integer DDataStd_SetInteger (Draw_Interpretor& di,
TDataStd_Integer::Set(L,Draw::Atoi(arg[3])); TDataStd_Integer::Set(L,Draw::Atoi(arg[3]));
return 0; return 0;
} }
di << "DDataStd_SetInteger : Error" << "\n"; di << "DDataStd_SetInteger : Error\n";
return 1; return 1;
} }
@ -137,7 +137,7 @@ static Standard_Integer DDataStd_SetReal (Draw_Interpretor& di,
TDataStd_Real::Set(L,Draw::Atof(arg[3])); TDataStd_Real::Set(L,Draw::Atof(arg[3]));
return 0; return 0;
} }
di << "DDataStd_SetReal : Error" << "\n"; di << "DDataStd_SetReal : Error\n";
return 1; return 1;
} }
@ -162,7 +162,7 @@ static Standard_Integer DDataStd_SetReference (Draw_Interpretor& di,
TDF_Reference::Set(L,LREF); TDF_Reference::Set(L,LREF);
return 0; return 0;
} }
di << "DDataStd_SetReference : Error" << "\n"; di << "DDataStd_SetReference : Error\n";
return 1; return 1;
} }
@ -184,7 +184,7 @@ static Standard_Integer DDataStd_SetComment (Draw_Interpretor& di,
TDataStd_Comment::Set(L,TCollection_ExtendedString(arg[3],Standard_True)); TDataStd_Comment::Set(L,TCollection_ExtendedString(arg[3],Standard_True));
return 0; return 0;
} }
di << "DDataStd_SetComment : Error" << "\n"; di << "DDataStd_SetComment : Error\n";
return 1; return 1;
} }
@ -209,7 +209,7 @@ static Standard_Integer DDataStd_GetInteger (Draw_Interpretor& di,
di << A->Get(); di << A->Get();
return 0; return 0;
} }
di << "DDataStd_GetInteger : Error" << "\n"; di << "DDataStd_GetInteger : Error\n";
return 1; return 1;
} }
@ -232,7 +232,7 @@ static Standard_Integer DDataStd_GetReal (Draw_Interpretor& di,
di << A->Get(); di << A->Get();
return 0; return 0;
} }
di << "DDataStd_GetReal : Error" << "\n"; di << "DDataStd_GetReal : Error\n";
return 1; return 1;
} }
@ -255,7 +255,7 @@ static Standard_Integer DDataStd_GetReference (Draw_Interpretor& di,
di << entry.ToCString(); di << entry.ToCString();
return 0; return 0;
} }
di << "DDataStd_GetReference : Error" << "\n"; di << "DDataStd_GetReference : Error\n";
return 1; return 1;
} }
@ -277,7 +277,7 @@ static Standard_Integer DDataStd_GetComment (Draw_Interpretor& di,
di << A->Get().ToExtString(); di << A->Get().ToExtString();
return 0; return 0;
} }
di << "DDataStd_GetComment : Error" << "\n"; di << "DDataStd_GetComment : Error\n";
return 1; return 1;
} }
@ -306,7 +306,7 @@ static Standard_Integer DDataStd_Self (Draw_Interpretor& di,
// } // }
return 0; return 0;
} }
di << "Self : Error" << "\n"; di << "Self : Error\n";
return 0; return 0;
} }
@ -543,7 +543,7 @@ static Standard_Integer DDataStd_GetIntArrayValue (Draw_Interpretor& di,
Standard_Integer index = Draw::Atoi(arg[3]); Standard_Integer index = Draw::Atoi(arg[3]);
if (index < A->Lower() || index > A->Upper()) { if (index < A->Lower() || index > A->Upper()) {
di << "Index is out of range" << "\n"; di << "Index is out of range\n";
return 1; return 1;
} else { } else {
di << A->Value(index) << "\n"; di << A->Value(index) << "\n";
@ -605,7 +605,7 @@ static Standard_Integer DDataStd_ChangeIntArray (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_ChangeIntArray: Error" << "\n"; di << "DDataStd_ChangeIntArray: Error\n";
return 0; return 0;
} }
@ -758,7 +758,7 @@ static Standard_Integer DDataStd_GetRealArrayValue (Draw_Interpretor& di,
Standard_Integer index = Draw::Atoi(arg[3]); Standard_Integer index = Draw::Atoi(arg[3]);
if (index < A->Lower() || index > A->Upper()) { if (index < A->Lower() || index > A->Upper()) {
di << "Index is out of range" << "\n"; di << "Index is out of range\n";
return 1; return 1;
} else { } else {
di << A->Value(index) << "\n"; di << A->Value(index) << "\n";
@ -820,7 +820,7 @@ static Standard_Integer DDataStd_ChangeRealArray (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_ChangeRealArray: Error" << "\n"; di << "DDataStd_ChangeRealArray: Error\n";
return 0; return 0;
} }
@ -847,7 +847,7 @@ static Standard_Integer DDataStd_SetVariable (Draw_Interpretor& di,
return 0; return 0;
} }
di << "Wrong arguments" << "\n"; di << "Wrong arguments\n";
return 1; return 1;
} }
@ -868,7 +868,7 @@ static Standard_Integer DDataStd_GetVariable (Draw_Interpretor& di,
Handle(TDataStd_Variable) aV; Handle(TDataStd_Variable) aV;
if (!label.FindAttribute(TDataStd_Variable::GetID(), aV)) if (!label.FindAttribute(TDataStd_Variable::GetID(), aV))
{ {
di << "TDataStd_Variable: no such attribute" << "\n"; di << "TDataStd_Variable: no such attribute\n";
} }
Draw::Set(arg[3],TCollection_AsciiString(Standard_Integer(aV->IsConstant())).ToCString()); Draw::Set(arg[3],TCollection_AsciiString(Standard_Integer(aV->IsConstant())).ToCString());
@ -876,7 +876,7 @@ static Standard_Integer DDataStd_GetVariable (Draw_Interpretor& di,
return 0; return 0;
} }
di << "Wrong arguments" << "\n"; di << "Wrong arguments\n";
return 1; return 1;
} }
@ -909,14 +909,14 @@ static Standard_Integer DDataStd_SetRelation (Draw_Interpretor& di,
} }
if (!label.FindAttribute(TDataStd_Variable::GetID(), aV)) if (!label.FindAttribute(TDataStd_Variable::GetID(), aV))
{ {
di << "No TDataStd_Variable Attribute on label" << "\n"; di << "No TDataStd_Variable Attribute on label\n";
return 1; return 1;
} }
aR->GetVariables().Append(aV); aR->GetVariables().Append(aV);
} }
return 0; return 0;
} }
di << "Usage: SetRelation (DF, entry, expression, var1[, var2, ...])" << "\n"; di << "Usage: SetRelation (DF, entry, expression, var1[, var2, ...])\n";
return 1; return 1;
} }
@ -964,7 +964,7 @@ static Standard_Integer DDataStd_DumpRelation (Draw_Interpretor& di,
di << ")"; di << ")";
return 0; return 0;
} }
di << "Usage: DumpRelation (DF, entry)" << "\n"; di << "Usage: DumpRelation (DF, entry)\n";
return 1; return 1;
} }
@ -1015,7 +1015,7 @@ static Standard_Integer DDataStd_GetFunction (Draw_Interpretor& di,
Handle(TFunction_Function) aF; Handle(TFunction_Function) aF;
if (!label.FindAttribute(TFunction_Function::GetID(), aF)) if (!label.FindAttribute(TFunction_Function::GetID(), aF))
{ {
di << "No TFunction_Function Attribute on label" << "\n"; di << "No TFunction_Function Attribute on label\n";
} }
else else
{ {
@ -1149,7 +1149,7 @@ static Standard_Integer DDataStd_GetExtStringArrayValue (Draw_Interpretor& di,
Standard_Integer index = Draw::Atoi(arg[3]); Standard_Integer index = Draw::Atoi(arg[3]);
if (index < A->Lower() || index > A->Upper()) { if (index < A->Lower() || index > A->Upper()) {
di << "Index is out of range" << "\n"; di << "Index is out of range\n";
return 1; return 1;
} else { } else {
const TCollection_ExtendedString& value = A->Value(index); const TCollection_ExtendedString& value = A->Value(index);
@ -1212,7 +1212,7 @@ static Standard_Integer DDataStd_ChangeExtStrArray (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_ChangeExtStringArray: Error" << "\n"; di << "DDataStd_ChangeExtStringArray: Error\n";
return 0; return 0;
} }
@ -1259,7 +1259,7 @@ static Standard_Integer DDataStd_KeepUTF (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "SetUTFName : String is not kept in DF" << "\n"; di << "SetUTFName : String is not kept in DF\n";
return 1; return 1;
} }
@ -1324,7 +1324,7 @@ static Standard_Integer DDataStd_GetUTFtoFile (Draw_Interpretor& di,
anOS.close(); anOS.close();
return 0; return 0;
} }
di << "GetUTF : Data is not extracted to the specified file " <<"\n"; di << "GetUTF : Data is not extracted to the specified file \n";
return 1; return 1;
} }
@ -1359,7 +1359,7 @@ static Standard_Integer DDataStd_SetByteArray (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetByteArray: Error" << "\n"; di << "DDataStd_SetByteArray: Error\n";
return 1; return 1;
} }
@ -1436,7 +1436,7 @@ static Standard_Integer DDataStd_SetBooleanArray (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetBooleanArray: Error" << "\n"; di << "DDataStd_SetBooleanArray: Error\n";
return 1; return 1;
} }
@ -1463,7 +1463,7 @@ static Standard_Integer DDataStd_SetBooleanArrayValue (Draw_Interpretor& di,
// Check the value. // Check the value.
if (value != 0 && value != 1) { if (value != 0 && value != 1) {
di << "DDataStd_SetBooleanArrayValue: Error! The value should be either 0 or 1." << "\n"; di << "DDataStd_SetBooleanArrayValue: Error! The value should be either 0 or 1.\n";
return 1; return 1;
} }
@ -1501,7 +1501,7 @@ static Standard_Integer DDataStd_SetExtStringList (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetExtStringList: Error" << "\n"; di << "DDataStd_SetExtStringList: Error\n";
return 1; return 1;
} }
// //
@ -1532,7 +1532,7 @@ static Standard_Integer DDataStd_SetReferenceList (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_SetReferenceList: Error" << "\n"; di << "DDataStd_SetReferenceList: Error\n";
return 1; return 1;
} }
@ -1565,7 +1565,7 @@ static Standard_Integer DDataStd_SetBooleanList (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetBooleanList: Error" << "\n"; di << "DDataStd_SetBooleanList: Error\n";
return 1; return 1;
} }
@ -1592,7 +1592,7 @@ static Standard_Integer DDataStd_SetIntegerList (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetIntegerList: Error" << "\n"; di << "DDataStd_SetIntegerList: Error\n";
return 1; return 1;
} }
@ -1619,7 +1619,7 @@ static Standard_Integer DDataStd_SetRealList (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetRealList: Error" << "\n"; di << "DDataStd_SetRealList: Error\n";
return 1; return 1;
} }
@ -1681,7 +1681,7 @@ static Standard_Integer DDataStd_GetByteArrayValue (Draw_Interpretor& di,
Standard_Integer index = Draw::Atoi(arg[3]); Standard_Integer index = Draw::Atoi(arg[3]);
if (index < A->Lower() || index > A->Upper()) { if (index < A->Lower() || index > A->Upper()) {
di << "Index is out of range" << "\n"; di << "Index is out of range\n";
return 1; return 1;
} else { } else {
di << A->Value(index) << "\n"; di << A->Value(index) << "\n";
@ -1750,7 +1750,7 @@ static Standard_Integer DDataStd_GetBooleanArrayValue (Draw_Interpretor& di,
Standard_Integer index = Draw::Atoi(arg[3]); Standard_Integer index = Draw::Atoi(arg[3]);
if (index < A->Lower() || index > A->Upper()) { if (index < A->Lower() || index > A->Upper()) {
di << "Index is out of range" << "\n"; di << "Index is out of range\n";
return 1; return 1;
} else { } else {
di << ((A->Value(index) == Standard_True) ? "True" : "False") << "\n"; di << ((A->Value(index) == Standard_True) ? "True" : "False") << "\n";
@ -1816,7 +1816,7 @@ static Standard_Integer DDataStd_ChangeByteArray (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_ChangeByteArray: Error" << "\n"; di << "DDataStd_ChangeByteArray: Error\n";
return 1; return 1;
} }
@ -1856,10 +1856,10 @@ static Standard_Integer DDataStd_GetBooleanList (Draw_Interpretor& di,
} }
di << "\n"; di << "\n";
} else } else
di << "List is empty" << "\n"; di << "List is empty\n";
return 0; return 0;
} }
di << "DDataStd_GetBooleanList: Error" << "\n"; di << "DDataStd_GetBooleanList: Error\n";
return 1; return 1;
} }
@ -1899,11 +1899,11 @@ static Standard_Integer DDataStd_GetIntegerList (Draw_Interpretor& di,
} }
di << "\n"; di << "\n";
} else } else
di << "List is empty" << "\n"; di << "List is empty\n";
return 0; return 0;
} }
di << "DDataStd_GetIntegerList: Error" << "\n"; di << "DDataStd_GetIntegerList: Error\n";
return 1; return 1;
} }
@ -1943,10 +1943,10 @@ static Standard_Integer DDataStd_GetRealList (Draw_Interpretor& di,
} }
di << "\n"; di << "\n";
} else } else
di << "List is empty" << "\n"; di << "List is empty\n";
return 0; return 0;
} }
di << "DDataStd_GetRealList: Error" << "\n"; di << "DDataStd_GetRealList: Error\n";
return 1; return 1;
} }
@ -1989,11 +1989,11 @@ static Standard_Integer DDataStd_GetExtStringList (Draw_Interpretor& di,
di << "\n"; di << "\n";
} }
else { else {
di << "List is empty" << "\n"; di << "List is empty\n";
} }
return 0; return 0;
} }
di << "DDataStd_GetExtStringList: Error" << "\n"; di << "DDataStd_GetExtStringList: Error\n";
return 1; return 1;
} }
@ -2039,10 +2039,10 @@ static Standard_Integer DDataStd_GetReferenceList (Draw_Interpretor& di,
} }
di << "\n"; di << "\n";
} else } else
di << "List is empty" << "\n"; di << "List is empty\n";
return 0; return 0;
} }
di << "DDataStd_GetReferenceList: Error" << "\n"; di << "DDataStd_GetReferenceList: Error\n";
return 1; return 1;
} }
// //
@ -2080,7 +2080,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di,
cout << "Map extent = " << anAtt->Extent()<<endl; cout << "Map extent = " << anAtt->Extent()<<endl;
return 0; return 0;
} }
di << "DDataStd_SetIntPackedMap : Error" << "\n"; di << "DDataStd_SetIntPackedMap : Error\n";
return 1; return 1;
} }
@ -2111,7 +2111,7 @@ static Standard_Integer DDataStd_GetIntPackedMap (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_GetIntPackedMap : Error" << "\n"; di << "DDataStd_GetIntPackedMap : Error\n";
return 1; return 1;
} }
@ -2154,7 +2154,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_Add (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_ChangeIntPackedMap_Add: Error" << "\n"; di << "DDataStd_ChangeIntPackedMap_Add: Error\n";
return 0; return 0;
} }
@ -2197,7 +2197,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_Rem (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_ChangeIntPackedMap_Rem: Error" << "\n"; di << "DDataStd_ChangeIntPackedMap_Rem: Error\n";
return 0; return 0;
} }
@ -2242,7 +2242,7 @@ static Standard_Integer DDataStd_ChangeIntPackedMap_AddRem (Draw_Interpretor& di
} }
return 0; return 0;
} }
di << "DDataStd_ChangeIntPackedMap_AddRem: Error" << "\n"; di << "DDataStd_ChangeIntPackedMap_AddRem: Error\n";
return 0; return 0;
} }
@ -2278,7 +2278,7 @@ static Standard_Integer DDataStd_SetIntPHugeMap (Draw_Interpretor& di,
cout << "Map extent = " << anAtt->Extent()<<endl; cout << "Map extent = " << anAtt->Extent()<<endl;
return 0; return 0;
} }
di << "DDataStd_SetIntPHugeMap : Error" << "\n"; di << "DDataStd_SetIntPHugeMap : Error\n";
return 1; return 1;
} }
@ -2314,7 +2314,7 @@ static Standard_Integer DDataStd_SetNDataIntegers2 (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetNDataIntegers2 : Error" << "\n"; di << "DDataStd_SetNDataIntegers2 : Error\n";
return 1; return 1;
} }
//================ //================
@ -2354,7 +2354,7 @@ static Standard_Integer DDataStd_SetNDataIntAr2 (Draw_Interpretor& di,
anAtt->SetArrayOfIntegers(aKey, anArr); anAtt->SetArrayOfIntegers(aKey, anArr);
return 0; return 0;
} }
di << "DDataStd_SetNDataIntArrays2 : Error" << "\n"; di << "DDataStd_SetNDataIntArrays2 : Error\n";
return 1; return 1;
} }
@ -2385,7 +2385,7 @@ static Standard_Integer DDataStd_SetAsciiString (Draw_Interpretor& di,
cout << "String = " << anAtt->Get().ToCString() << " is kept in DF" << endl; cout << "String = " << anAtt->Get().ToCString() << " is kept in DF" << endl;
return 0; return 0;
} }
di << "DDataStd_SetAsciiString : Error" << "\n"; di << "DDataStd_SetAsciiString : Error\n";
return 1; return 1;
} }
// //
@ -2411,7 +2411,7 @@ static Standard_Integer DDataStd_GetAsciiString (Draw_Interpretor& di,
cout << "String = " <<anAtt->Get().ToCString() << endl; cout << "String = " <<anAtt->Get().ToCString() << endl;
return 0; return 0;
} }
di << "DDataStd_GetAsciiString : Error" << "\n"; di << "DDataStd_GetAsciiString : Error\n";
return 1; return 1;
} }
@ -2456,7 +2456,7 @@ static Standard_Integer DDataStd_SetNDataIntegers (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetNDataIntegers : Error" << "\n"; di << "DDataStd_SetNDataIntegers : Error\n";
return 1; return 1;
} }
@ -2493,7 +2493,7 @@ static Standard_Integer DDataStd_GetNDIntegers (Draw_Interpretor& di,
return 0; return 0;
} }
di << "DDataStd_GetNDIntegers : Error" << "\n"; di << "DDataStd_GetNDIntegers : Error\n";
return 1; return 1;
} }
@ -2529,7 +2529,7 @@ static Standard_Integer DDataStd_GetNDInteger (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_SetNDataIntegers : Error" << "\n"; di << "DDataStd_SetNDataIntegers : Error\n";
return 1; return 1;
} }
@ -2566,7 +2566,7 @@ static Standard_Integer DDataStd_SetNDataReals (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetNDataReals : Error" << "\n"; di << "DDataStd_SetNDataReals : Error\n";
return 1; return 1;
} }
@ -2601,7 +2601,7 @@ static Standard_Integer DDataStd_GetNDReals (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_GetNDReals : Error" << "\n"; di << "DDataStd_GetNDReals : Error\n";
return 1; return 1;
} }
@ -2637,7 +2637,7 @@ static Standard_Integer DDataStd_GetNDReal (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_GetNDReal : Error" << "\n"; di << "DDataStd_GetNDReal : Error\n";
return 1; return 1;
} }
@ -2674,7 +2674,7 @@ static Standard_Integer DDataStd_SetNDataStrings (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetNDataStrings : Error" << "\n"; di << "DDataStd_SetNDataStrings : Error\n";
return 1; return 1;
} }
@ -2710,7 +2710,7 @@ static Standard_Integer DDataStd_GetNDStrings (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_GetNDStrings : Error" << "\n"; di << "DDataStd_GetNDStrings : Error\n";
return 1; return 1;
} }
@ -2747,7 +2747,7 @@ static Standard_Integer DDataStd_GetNDString (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_GetNDString : Error" << "\n"; di << "DDataStd_GetNDString : Error\n";
return 1; return 1;
} }
@ -2784,7 +2784,7 @@ static Standard_Integer DDataStd_SetNDataBytes (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_SetNDataBytes : Error" << "\n"; di << "DDataStd_SetNDataBytes : Error\n";
return 1; return 1;
} }
@ -2819,7 +2819,7 @@ static Standard_Integer DDataStd_GetNDBytes (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_GetNDBytes : Error" << "\n"; di << "DDataStd_GetNDBytes : Error\n";
return 1; return 1;
} }
@ -2855,7 +2855,7 @@ static Standard_Integer DDataStd_GetNDByte (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_GetNDByte : Error" << "\n"; di << "DDataStd_GetNDByte : Error\n";
return 1; return 1;
} }
//======================== IntArrays ==================================== //======================== IntArrays ====================================
@ -2895,7 +2895,7 @@ static Standard_Integer DDataStd_SetNDataIntAr (Draw_Interpretor& di,
anAtt->SetArrayOfIntegers(aKey, anArr); anAtt->SetArrayOfIntegers(aKey, anArr);
return 0; return 0;
} }
di << "DDataStd_SetNDataIntArrays : Error" << "\n"; di << "DDataStd_SetNDataIntArrays : Error\n";
return 1; return 1;
} }
@ -2933,14 +2933,14 @@ static Standard_Integer DDataStd_GetNDIntArrays (Draw_Interpretor& di,
Standard_Integer upper = anArrValue->Upper(); Standard_Integer upper = anArrValue->Upper();
for(Standard_Integer i = lower; i<=upper;i++) { for(Standard_Integer i = lower; i<=upper;i++) {
Standard_Integer aValue = anArrValue->Value(i); Standard_Integer aValue = anArrValue->Value(i);
cout << "\tValue("<<i<<")"<<" = " <<aValue<<endl; cout << "\tValue("<<i<<") = " <<aValue<<endl;
} }
} else } else
cout << "\tthe specified array is Null "<<endl; cout << "\tthe specified array is Null "<<endl;
} }
return 0; return 0;
} }
di << "DDataStd_GetNDIntArrays : Error" << "\n"; di << "DDataStd_GetNDIntArrays : Error\n";
return 1; return 1;
} }
@ -2978,14 +2978,14 @@ static Standard_Integer DDataStd_GetNDIntArray (Draw_Interpretor& di,
Standard_Integer upper = anArrValue->Upper(); Standard_Integer upper = anArrValue->Upper();
for(Standard_Integer i = lower; i<=upper;i++) { for(Standard_Integer i = lower; i<=upper;i++) {
Standard_Integer aValue = anArrValue->Value(i); Standard_Integer aValue = anArrValue->Value(i);
cout << "\tValue("<<i<<")"<<" = " <<aValue<<endl; cout << "\tValue("<<i<<") = " <<aValue<<endl;
} }
} else } else
cout << "\tthe specified array is Null or not found"<<endl; cout << "\tthe specified array is Null or not found"<<endl;
return 0; return 0;
} }
} }
di << "DDataStd_SetNDataIntArray : Error" << "\n"; di << "DDataStd_SetNDataIntArray : Error\n";
return 1; return 1;
} }
//============================= RealArrays ============================== //============================= RealArrays ==============================
@ -3025,7 +3025,7 @@ static Standard_Integer DDataStd_SetNDataRealAr (Draw_Interpretor& di,
anAtt->SetArrayOfReals(aKey, anArr); anAtt->SetArrayOfReals(aKey, anArr);
return 0; return 0;
} }
di << "DDataStd_SetNDataRealArrays : Error" << "\n"; di << "DDataStd_SetNDataRealArrays : Error\n";
return 1; return 1;
} }
@ -3063,14 +3063,14 @@ static Standard_Integer DDataStd_GetNDRealArrays (Draw_Interpretor& di,
Standard_Integer upper = anArrValue->Upper(); Standard_Integer upper = anArrValue->Upper();
for(Standard_Integer i = lower; i<=upper;i++) { for(Standard_Integer i = lower; i<=upper;i++) {
Standard_Real aValue = anArrValue->Value(i); Standard_Real aValue = anArrValue->Value(i);
cout << "\tValue("<<i<<")"<<" = " <<aValue<<endl; cout << "\tValue("<<i<<") = " <<aValue<<endl;
} }
} else } else
cout << "\tthe specified array is Null "<<endl; cout << "\tthe specified array is Null "<<endl;
} }
return 0; return 0;
} }
di << "DDataStd_GetNDRealArrays : Error" << "\n"; di << "DDataStd_GetNDRealArrays : Error\n";
return 1; return 1;
} }
@ -3108,14 +3108,14 @@ static Standard_Integer DDataStd_GetNDRealArray (Draw_Interpretor& di,
Standard_Integer upper = anArrValue->Upper(); Standard_Integer upper = anArrValue->Upper();
for(Standard_Integer i = lower; i<=upper;i++) { for(Standard_Integer i = lower; i<=upper;i++) {
Standard_Real aValue = anArrValue->Value(i); Standard_Real aValue = anArrValue->Value(i);
cout << "\tValue("<<i<<")"<<" = " <<aValue<<endl; cout << "\tValue("<<i<<") = " <<aValue<<endl;
} }
} else } else
cout << "\tthe specified array is Null or not found"<<endl; cout << "\tthe specified array is Null or not found"<<endl;
return 0; return 0;
} }
} }
di << "DDataStd_SetNDataRealArray : Error" << "\n"; di << "DDataStd_SetNDataRealArray : Error\n";
return 1; return 1;
} }
@ -3240,7 +3240,7 @@ static Standard_Integer DDataStd_GetRefArrayValue (Draw_Interpretor& di,
Standard_Integer index = Draw::Atoi(arg[3]); Standard_Integer index = Draw::Atoi(arg[3]);
if (index < A->Lower() || index > A->Upper()) { if (index < A->Lower() || index > A->Upper()) {
di << "Index is out of range" << "\n"; di << "Index is out of range\n";
return 1; return 1;
} else { } else {
const TDF_Label& value = A->Value(index); const TDF_Label& value = A->Value(index);

View File

@ -47,9 +47,9 @@ static Standard_Integer DDataStd_SetConstraint (Draw_Interpretor& di,
{ {
if (nb < 5) if (nb < 5)
{ {
di << "usage: SetConstraint DF entry keyword geometrie [geometrie ...]" << "\n"; di << "usage: SetConstraint DF entry keyword geometrie [geometrie ...]\n";
di << "or SetConstraint DF entry \"plane\" geometrie - to set plane for existing constraint" << "\n"; di << "or SetConstraint DF entry \"plane\" geometrie - to set plane for existing constraint\n";
di << "or SetConstraint DF entry \"value\" value - to set value for existing constraint" << "\n"; di << "or SetConstraint DF entry \"value\" value - to set value for existing constraint\n";
return 1; return 1;
} }
@ -122,10 +122,10 @@ static Standard_Integer DDataStd_SetConstraint (Draw_Interpretor& di,
else if (strcmp(aT,"offset") == 0) aCT = TDataXtd_OFFSET; else if (strcmp(aT,"offset") == 0) aCT = TDataXtd_OFFSET;
else else
{ {
di << "DDataStd_SetConstraint : unknown type, must be one of:" << "\n"; di << "DDataStd_SetConstraint : unknown type, must be one of:\n";
di << "rad/dia/minr/majr/tan/par/perp/concentric/equal/dist/angle/eqrad/symm/midp/" << "\n"; di << "rad/dia/minr/majr/tan/par/perp/concentric/equal/dist/angle/eqrad/symm/midp/\n";
di << "eqdist/fix/rigid or from/axis/mate/alignf/aligna/axesa/facesa/round/offset" << "\n"; di << "eqdist/fix/rigid or from/axis/mate/alignf/aligna/axesa/facesa/round/offset\n";
di << "or plane/value" << "\n"; di << "or plane/value\n";
return 1; return 1;
} }
@ -186,7 +186,7 @@ static Standard_Integer DDataStd_GetConstraint (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_GetConstraint : Error : not done" << "\n"; di << "DDataStd_GetConstraint : Error : not done\n";
return 1; return 1;
} }
@ -200,7 +200,7 @@ static Standard_Integer DDataStd_SetPattern (Draw_Interpretor& di,
{ {
if (nb < 5) if (nb < 5)
{ {
di << "usage: SetPattern (DF,entry,signature,NSentry[realEntry,intEntry[,NSentry,realEntry,intEntry]])" << "\n"; di << "usage: SetPattern (DF,entry,signature,NSentry[realEntry,intEntry[,NSentry,realEntry,intEntry]])\n";
return 1; return 1;
} }
@ -226,9 +226,9 @@ static Standard_Integer DDataStd_SetPattern (Draw_Interpretor& di,
{ {
if (nb < 7) if (nb < 7)
{ {
di<<"usage:"<<"\n"; di<<"usage:\n";
di<<"SetPattern (DF,entry,signature<=2,NSentry,realEntry,intEntry)"<<"\n"; di<<"SetPattern (DF,entry,signature<=2,NSentry,realEntry,intEntry)\n";
di<<"SetPattern (DF,entry,2<signature<5,NSentry,realEntry,intEntry,NSentry,realEntry,intEntry)"<<"\n"; di<<"SetPattern (DF,entry,2<signature<5,NSentry,realEntry,intEntry,NSentry,realEntry,intEntry)\n";
return 1; return 1;
} }
@ -257,8 +257,8 @@ static Standard_Integer DDataStd_SetPattern (Draw_Interpretor& di,
{ {
if (nb < 10) if (nb < 10)
{ {
di<<"usage:"<<"\n"; di<<"usage:\n";
di<<"SetPattern (DF,entry,2<signature<5,NSentry,realEntry,intEntry,NSentry,realEntry,intEntry)"<<"\n"; di<<"SetPattern (DF,entry,2<signature<5,NSentry,realEntry,intEntry,NSentry,realEntry,intEntry)\n";
return 1; return 1;
} }
@ -288,7 +288,7 @@ static Standard_Integer DDataStd_SetPattern (Draw_Interpretor& di,
{ {
if (nb > 5) if (nb > 5)
{ {
di<<"usage: SetPattern (DF,entry,signature>=5,NSentry)"<<"\n"; di<<"usage: SetPattern (DF,entry,signature>=5,NSentry)\n";
return 1; return 1;
} }
@ -387,7 +387,7 @@ static Standard_Integer DDataStd_DumpPattern (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDataStd_DumpPattern : Error : not done" << "\n"; di << "DDataStd_DumpPattern : Error : not done\n";
return 1; return 1;
} }
@ -411,7 +411,7 @@ static Standard_Integer DDataStd_SetPosition (Draw_Interpretor& di,
TDataXtd_Position::Set(L,aPos); TDataXtd_Position::Set(L,aPos);
return 0; return 0;
} }
di << "Usage: SetPosition (DF, entry, X, Y, Z)" << "\n"; di << "Usage: SetPosition (DF, entry, X, Y, Z)\n";
return 1; return 1;
} }
@ -432,7 +432,7 @@ static Standard_Integer DDataStd_GetPosition (Draw_Interpretor& di,
gp_Pnt aPos; gp_Pnt aPos;
if (!TDataXtd_Position::Get(L, aPos)) if (!TDataXtd_Position::Get(L, aPos))
{ {
di << "There is no TDataStd_Position attribute on this label" << "\n"; di << "There is no TDataStd_Position attribute on this label\n";
return -1; return -1;
} }
@ -441,7 +441,7 @@ static Standard_Integer DDataStd_GetPosition (Draw_Interpretor& di,
Draw::Set(arg[5],TCollection_AsciiString(aPos.Z()).ToCString()); Draw::Set(arg[5],TCollection_AsciiString(aPos.Z()).ToCString());
return 0; return 0;
} }
di << "Usage: GetPosition (DF, entry, X(out), Y(out), Z(out))" << "\n"; di << "Usage: GetPosition (DF, entry, X(out), Y(out), Z(out))\n";
return 1; return 1;
} }

View File

@ -75,7 +75,7 @@ static Standard_Integer DDataStd_SetPoint (Draw_Interpretor& di,
TDataXtd_Point::Set (L,p); TDataXtd_Point::Set (L,p);
} }
else { else {
di << "DDataStd_SetPoint : not a point" << "\n"; di << "DDataStd_SetPoint : not a point\n";
return 1; return 1;
} }
} }
@ -104,7 +104,7 @@ static Standard_Integer DDataStd_SetAxis (Draw_Interpretor& di,
else if (nb == 4) { else if (nb == 4) {
Handle(Geom_Line) LINE = Handle(Geom_Line)::DownCast(DrawTrSurf::Get (arg[3])); Handle(Geom_Line) LINE = Handle(Geom_Line)::DownCast(DrawTrSurf::Get (arg[3]));
if (LINE.IsNull()) { if (LINE.IsNull()) {
di << "DDataStd_SetAxis : not a line" << "\n"; di << "DDataStd_SetAxis : not a line\n";
return 1; return 1;
} }
TDataXtd_Axis::Set (L,LINE->Lin()); TDataXtd_Axis::Set (L,LINE->Lin());
@ -135,7 +135,7 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di,
else if (nb == 4) { else if (nb == 4) {
Handle(Geom_Plane) PLANE = Handle(Geom_Plane)::DownCast(DrawTrSurf::Get (arg[3])); Handle(Geom_Plane) PLANE = Handle(Geom_Plane)::DownCast(DrawTrSurf::Get (arg[3]));
if (PLANE.IsNull()) { if (PLANE.IsNull()) {
di << "DDataStd_SetPlane : not a plane" << "\n"; di << "DDataStd_SetPlane : not a plane\n";
return 1; return 1;
} }
TDataXtd_Plane::Set (L,PLANE->Pln()); TDataXtd_Plane::Set (L,PLANE->Pln());
@ -237,7 +237,7 @@ static Standard_Integer DDataStd_SetGeometry (Draw_Interpretor& di,
{ {
// set NS attribute // set NS attribute
TopoDS_Shape s = DBRep::Get(arg[4]); TopoDS_Shape s = DBRep::Get(arg[4]);
if (s.IsNull()) { di <<"shape not found"<< "\n"; return 1;} if (s.IsNull()) { di <<"shape not found\n"; return 1;}
TNaming_Builder SI (L); TNaming_Builder SI (L);
SI.Generated(s); SI.Generated(s);
} }
@ -260,8 +260,8 @@ static Standard_Integer DDataStd_SetGeometry (Draw_Interpretor& di,
else if (strcmp(aT,"cyl") == 0) aType = TDataXtd_CYLINDER; else if (strcmp(aT,"cyl") == 0) aType = TDataXtd_CYLINDER;
else else
{ {
di << "DDataStd_SetGeometry : unknown type, must be one of:" << "\n"; di << "DDataStd_SetGeometry : unknown type, must be one of:\n";
di << "any/pnt/lin/cir/ell/spl/pln/cyl" << "\n"; di << "any/pnt/lin/cir/ell/spl/pln/cyl\n";
return 1; return 1;
} }
} }
@ -295,7 +295,7 @@ static Standard_Integer DDataStd_GetGeometryType (Draw_Interpretor& di,
Handle(TDataXtd_Geometry) aGA; Handle(TDataXtd_Geometry) aGA;
if (!L.FindAttribute(TDataXtd_Geometry::GetID(),aGA)) if (!L.FindAttribute(TDataXtd_Geometry::GetID(),aGA))
{ {
di << "TDataStd_Geometry : attribute not found" << "\n"; di << "TDataStd_Geometry : attribute not found\n";
return 1; return 1;
} }
@ -313,7 +313,7 @@ static Standard_Integer DDataStd_GetGeometryType (Draw_Interpretor& di,
case TDataXtd_CYLINDER: di <<"cyl"; break; case TDataXtd_CYLINDER: di <<"cyl"; break;
default: default:
{ {
di << "DDataStd_GetGeometry : unknown type" << "\n"; di << "DDataStd_GetGeometry : unknown type\n";
return 1; return 1;
} }
} }

View File

@ -77,7 +77,7 @@ static Standard_Integer DDataStd_PNT (Draw_Interpretor& di,
TDataXtd_Point::Set (L,gp_Pnt(x,y,z)); TDataXtd_Point::Set (L,gp_Pnt(x,y,z));
return 0; return 0;
} }
di << "DDataStd_PNT : Error : not done" << "\n"; di << "DDataStd_PNT : Error : not done\n";
return 1; return 1;
} }
@ -96,7 +96,7 @@ static Standard_Integer DDataStd_Rmdraw (Draw_Interpretor& di,
if (!D3D.IsNull()) dout.RemoveDrawable(D3D); if (!D3D.IsNull()) dout.RemoveDrawable(D3D);
return 0; return 0;
} }
di << "DDataStd_Rmdraw : Error : not done" << "\n"; di << "DDataStd_Rmdraw : Error : not done\n";
return 1; return 1;
} }
@ -125,7 +125,7 @@ static Standard_Integer DDataStd_DrawOwner (Draw_Interpretor& di,
else di << 0; else di << 0;
return 0; return 0;
} }
di << "DDataStd_DrawOwner : Error" << "\n"; di << "DDataStd_DrawOwner : Error\n";
return 1; return 1;
} }
@ -146,7 +146,7 @@ static Standard_Integer DDataStd_DrawDisplay (Draw_Interpretor& di,
DDataStd_DrawPresentation::Display(L); DDataStd_DrawPresentation::Display(L);
return 0; return 0;
} }
di << "DDataStd_DrawDisplay : Error" << "\n"; di << "DDataStd_DrawDisplay : Error\n";
return 1; return 1;
} }
@ -189,7 +189,7 @@ static Standard_Integer DDataStd_DrawErase (Draw_Interpretor& di,
DDataStd_DrawPresentation::Erase(L); DDataStd_DrawPresentation::Erase(L);
return 0; return 0;
} }
di << "DDataStd_DrawErase : Error" << "\n"; di << "DDataStd_DrawErase : Error\n";
return 1; return 1;
} }
@ -210,7 +210,7 @@ static Standard_Integer DDataStd_DrawUpdate (Draw_Interpretor& di,
DDataStd_DrawPresentation::Update(L); DDataStd_DrawPresentation::Update(L);
return 0; return 0;
} }
di << "DDataStd_DrawUpdate : Error" << "\n"; di << "DDataStd_DrawUpdate : Error\n";
return 1; return 1;
} }

View File

@ -71,7 +71,7 @@ static Standard_Integer DDataStd_SetName (Draw_Interpretor& di,
N = TDataStd_Name::Set(L,arg[3]); N = TDataStd_Name::Set(L,arg[3]);
return 0; return 0;
} }
di << "DDataStd_SetName : Error" << "\n"; di << "DDataStd_SetName : Error\n";
return 1; return 1;
} }
@ -97,7 +97,7 @@ static Standard_Integer DDataStd_GetName (Draw_Interpretor& di,
di << s.ToCString(); di << s.ToCString();
return 0; return 0;
} }
di << "DDataStd_SetName : Error" << "\n"; di << "DDataStd_SetName : Error\n";
return 1; return 1;
} }

View File

@ -48,14 +48,14 @@ static Standard_Integer DDataStd_SetShape (Draw_Interpretor& di,
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
if (!DDF::GetDF(arg[1],DF)) return 1; if (!DDF::GetDF(arg[1],DF)) return 1;
TopoDS_Shape s = DBRep::Get(arg[3]); TopoDS_Shape s = DBRep::Get(arg[3]);
if (s.IsNull()) { di <<"shape not found"<< "\n"; return 1;} if (s.IsNull()) { di <<"shape not found\n"; return 1;}
TDF_Label L; TDF_Label L;
DDF::AddLabel(DF, arg[2], L); DDF::AddLabel(DF, arg[2], L);
TNaming_Builder SI (L); TNaming_Builder SI (L);
SI.Generated(s); SI.Generated(s);
return 0; return 0;
} }
di << "DDataStd_SetShape : Error" << "\n"; di << "DDataStd_SetShape : Error\n";
return 1; return 1;
} }

View File

@ -136,7 +136,7 @@ static Standard_Integer DDataStd_NewNoteBook (Draw_Interpretor& di,
TDataStd_NoteBook::New(L); TDataStd_NoteBook::New(L);
return 0; return 0;
} }
di << "DDataStd_NewNoteBook : Error" << "\n"; di << "DDataStd_NewNoteBook : Error\n";
return 1; return 1;
} }

View File

@ -53,7 +53,7 @@ static Standard_Integer DDataStd_SetNode (Draw_Interpretor& di,
return 0; return 0;
} else if (n == 4) { } else if (n == 4) {
if (!Standard_GUID::CheckGUIDFormat(a[3])) { if (!Standard_GUID::CheckGUIDFormat(a[3])) {
di<<"DDataStd_SetNode: The format of GUID is invalid"<<"\n"; di<<"DDataStd_SetNode: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID ID(a[3]); const Standard_GUID ID(a[3]);
@ -61,7 +61,7 @@ static Standard_Integer DDataStd_SetNode (Draw_Interpretor& di,
DDF::ReturnLabel(di,TN->Label()); DDF::ReturnLabel(di,TN->Label());
return 0; return 0;
} }
di << "DDataStd_SetNode : Error" << "\n"; di << "DDataStd_SetNode : Error\n";
return 1; return 1;
} }
@ -84,7 +84,7 @@ static Standard_Integer DDataStd_AppendNode (Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[4])) { if (!Standard_GUID::CheckGUIDFormat(a[4])) {
di<<"DDataStd_AppendNode: The format of GUID is invalid"<<"\n"; di<<"DDataStd_AppendNode: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[4]); const Standard_GUID varID(a[4]);
@ -97,17 +97,17 @@ static Standard_Integer DDataStd_AppendNode (Draw_Interpretor& di,
DDF::AddLabel(DF,a[3],L); DDF::AddLabel(DF,a[3],L);
if ( (L.FindAttribute(ID,child)) if ( (L.FindAttribute(ID,child))
&&(!child->IsRoot()) ){ &&(!child->IsRoot()) ){
di << "DDataStd_AppendNode : Error : childTreeNode don't detach" << "\n"; di << "DDataStd_AppendNode : Error : childTreeNode don't detach\n";
return 1; return 1;
} }
child = TDataStd_TreeNode::Set(L,ID); child = TDataStd_TreeNode::Set(L,ID);
if (!father->Append(child)) return 1; if (!father->Append(child)) return 1;
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
di<<"AppendNode: OK"<<"\n"; di<<"AppendNode: OK\n";
#endif #endif
return 0; return 0;
} }
di << "DDataStd_AppendNode : Error" << "\n"; di << "DDataStd_AppendNode : Error\n";
return 1; return 1;
} }
@ -130,7 +130,7 @@ static Standard_Integer DDataStd_PrependNode (Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[4])) { if (!Standard_GUID::CheckGUIDFormat(a[4])) {
di<<"DDataStd_PrependNode: The format of GUID is invalid"<<"\n"; di<<"DDataStd_PrependNode: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[4]); const Standard_GUID varID(a[4]);
@ -143,17 +143,17 @@ static Standard_Integer DDataStd_PrependNode (Draw_Interpretor& di,
DDF::AddLabel(DF,a[3],L); DDF::AddLabel(DF,a[3],L);
if ( (L.FindAttribute(ID,child)) if ( (L.FindAttribute(ID,child))
&&(!child->IsRoot()) ){ &&(!child->IsRoot()) ){
di << "DDataStd_PrependNode : Error : childTreeNode don't detach" << "\n"; di << "DDataStd_PrependNode : Error : childTreeNode don't detach\n";
return 1; return 1;
} }
child = TDataStd_TreeNode::Set(L,ID); child = TDataStd_TreeNode::Set(L,ID);
if (!father->Prepend(child)) return 1; if (!father->Prepend(child)) return 1;
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
di<<"PrependNode: OK"<<"\n"; di<<"PrependNode: OK\n";
#endif #endif
return 0; return 0;
} }
di << "DDataStd_PrependNode : Error" << "\n"; di << "DDataStd_PrependNode : Error\n";
return 1; return 1;
} }
@ -176,7 +176,7 @@ static Standard_Integer DDataStd_RootNode (Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[3])) { if (!Standard_GUID::CheckGUIDFormat(a[3])) {
di<<"DDataStd_RootNode: The format of GUID is invalid"<<"\n"; di<<"DDataStd_RootNode: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[3]); const Standard_GUID varID(a[3]);
@ -187,7 +187,7 @@ static Standard_Integer DDataStd_RootNode (Draw_Interpretor& di,
DDF::ReturnLabel(di,TN->Root()->Label()); DDF::ReturnLabel(di,TN->Root()->Label());
return 0; return 0;
} }
di << "DDataStd_RootNode : Error" << "\n"; di << "DDataStd_RootNode : Error\n";
return 1; return 1;
} }
@ -210,7 +210,7 @@ static Standard_Integer DDataStd_InsertNodeBefore(Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[4])) { if (!Standard_GUID::CheckGUIDFormat(a[4])) {
di<<"DDataStd_InsertNodeBefore: The format of GUID is invalid"<<"\n"; di<<"DDataStd_InsertNodeBefore: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[4]); const Standard_GUID varID(a[4]);
@ -226,7 +226,7 @@ static Standard_Integer DDataStd_InsertNodeBefore(Draw_Interpretor& di,
if (!current->InsertBefore(TN)) return 1; if (!current->InsertBefore(TN)) return 1;
return 0; return 0;
} }
di << "DDataStd_InsertBefore : Error" << "\n"; di << "DDataStd_InsertBefore : Error\n";
return 1; return 1;
} }
@ -249,7 +249,7 @@ static Standard_Integer DDataStd_InsertNodeAfter(Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[4])) { if (!Standard_GUID::CheckGUIDFormat(a[4])) {
di<<"DDataStd_InsertNodeAfter: The format of GUID is invalid"<<"\n"; di<<"DDataStd_InsertNodeAfter: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[4]); const Standard_GUID varID(a[4]);
@ -264,7 +264,7 @@ static Standard_Integer DDataStd_InsertNodeAfter(Draw_Interpretor& di,
if (!current->InsertAfter(TN)) return 1; if (!current->InsertAfter(TN)) return 1;
return 0; return 0;
} }
di << "DDataStd_InsertNodeAfter : Error" << "\n"; di << "DDataStd_InsertNodeAfter : Error\n";
return 1; return 1;
} }
@ -285,7 +285,7 @@ static Standard_Integer DDataStd_DetachNode (Draw_Interpretor& di,Standard_Integ
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[3])) { if (!Standard_GUID::CheckGUIDFormat(a[3])) {
di<<"DDataStd_DetachNode: The format of GUID is invalid"<<"\n"; di<<"DDataStd_DetachNode: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[3]); const Standard_GUID varID(a[3]);
@ -294,10 +294,10 @@ static Standard_Integer DDataStd_DetachNode (Draw_Interpretor& di,Standard_Integ
if (!DDF::Find(DF,a[2],ID,TN)) return 1; if (!DDF::Find(DF,a[2],ID,TN)) return 1;
if (!TN->Remove()) if (!TN->Remove())
di << "Can't Detach the TreeNode" << "\n"; di << "Can't Detach the TreeNode\n";
return 0; return 0;
} }
di << "DDataStd_DetachNode : Error" << "\n"; di << "DDataStd_DetachNode : Error\n";
return 1; return 1;
} }
@ -384,7 +384,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[4])) { if (!Standard_GUID::CheckGUIDFormat(a[4])) {
di<<"DDataStd_ChildNodeIterate: The format of GUID is invalid"<<"\n"; di<<"DDataStd_ChildNodeIterate: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[4]); const Standard_GUID varID(a[4]);
@ -392,7 +392,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di,
} }
if (!DDF::Find(DF, a[2], ID, TN)) return 1; if (!DDF::Find(DF, a[2], ID, TN)) return 1;
//di<<"TDataStd_ChildNodeIterator: "<<"\n"; //di<<"TDataStd_ChildNodeIterator: \n";
TDataStd_ChildNodeIterator itr(TN, AllLevels); TDataStd_ChildNodeIterator itr(TN, AllLevels);
for (; itr.More(); itr.Next()) { for (; itr.More(); itr.Next()) {
Value = itr.Value(); Value = itr.Value();
@ -406,7 +406,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di,
di<<"\n"; di<<"\n";
return 0; return 0;
} }
di << "DDataStd_ChildNodeIterate : Error" << "\n"; di << "DDataStd_ChildNodeIterate : Error\n";
return 1; return 1;
} }
@ -431,7 +431,7 @@ static Standard_Integer DDataStd_InitChildNodeIterator (Draw_Interpretor& di,
ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID()); ID=Standard_GUID(TDataStd_TreeNode::GetDefaultTreeID());
else{ else{
if (!Standard_GUID::CheckGUIDFormat(a[4])) { if (!Standard_GUID::CheckGUIDFormat(a[4])) {
di<<"DDataStd_ChildNodeIterator: The format of GUID is invalid"<<"\n"; di<<"DDataStd_ChildNodeIterator: The format of GUID is invalid\n";
return 1; return 1;
} }
const Standard_GUID varID(a[4]); const Standard_GUID varID(a[4]);
@ -443,7 +443,7 @@ static Standard_Integer DDataStd_InitChildNodeIterator (Draw_Interpretor& di,
cni.Initialize(TN, AllLevels); cni.Initialize(TN, AllLevels);
return 0; return 0;
} }
di << "DDataStd_InitChildNodeIterator : Error" << "\n"; di << "DDataStd_InitChildNodeIterator : Error\n";
return 1; return 1;
} }
@ -458,11 +458,11 @@ static Standard_Integer DDataStd_ChildNodeMore (Draw_Interpretor& di,
{ {
if (cni.More()) { if (cni.More()) {
//cout<<"TRUE"<<endl; //cout<<"TRUE"<<endl;
di<<"TRUE"<<"\n"; di<<"TRUE\n";
} }
else { else {
//cout<<"FALSE"<<endl; //cout<<"FALSE"<<endl;
di<<"FALSE"<<"\n"; di<<"FALSE\n";
} }
return 0; return 0;
} }

View File

@ -75,7 +75,7 @@ static Standard_Integer DDocStd_ListDocuments (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDocStd_ListDocuments : Error" << "\n"; di << "DDocStd_ListDocuments : Error\n";
return 1; return 1;
} }
@ -96,10 +96,10 @@ static Standard_Integer DDocStd_NewDocument (Draw_Interpretor& di,
D = new TDocStd_Document("dummy"); D = new TDocStd_Document("dummy");
DD = new DDocStd_DrawDocument(D); DD = new DDocStd_DrawDocument(D);
Draw::Set(a[1],DD); Draw::Set(a[1],DD);
di << "document (not handled by application) " << a[1] << " created" << "\n"; di << "document (not handled by application) " << a[1] << " created\n";
DDocStd::ReturnLabel(di,D->Main()); DDocStd::ReturnLabel(di,D->Main());
} }
else di << a[1] << " is already a document" << "\n"; else di << a[1] << " is already a document\n";
return 0; return 0;
} }
if (nb == 3) { if (nb == 3) {
@ -110,13 +110,13 @@ static Standard_Integer DDocStd_NewDocument (Draw_Interpretor& di,
DD = new DDocStd_DrawDocument(D); DD = new DDocStd_DrawDocument(D);
TDataStd_Name::Set(D->GetData()->Root(),a[1]); TDataStd_Name::Set(D->GetData()->Root(),a[1]);
Draw::Set(a[1],DD); Draw::Set(a[1],DD);
di << "document " << a[1] << " created" << "\n"; di << "document " << a[1] << " created\n";
DDocStd::ReturnLabel(di,D->Main()); DDocStd::ReturnLabel(di,D->Main());
} }
else di << a[1] << " is already a document" << "\n"; else di << a[1] << " is already a document\n";
return 0; return 0;
} }
di << "DDocStd_NewDocument : Error" << "\n"; di << "DDocStd_NewDocument : Error\n";
return 1; return 1;
} }
@ -136,7 +136,7 @@ static Standard_Integer DDocStd_Open (Draw_Interpretor& di,
Handle(TDocStd_Document) D; Handle(TDocStd_Document) D;
Standard_Integer insession = A->IsInSession(path); Standard_Integer insession = A->IsInSession(path);
if (insession > 0) { if (insession > 0) {
di <<"document " << insession << " is already in session" << "\n"; di <<"document " << insession << " is already in session\n";
return 0; return 0;
} }
PCDM_ReaderStatus theStatus = A->Open(path,D); PCDM_ReaderStatus theStatus = A->Open(path,D);
@ -149,32 +149,32 @@ static Standard_Integer DDocStd_Open (Draw_Interpretor& di,
switch ( theStatus ) { switch ( theStatus ) {
case PCDM_RS_AlreadyRetrieved: case PCDM_RS_AlreadyRetrieved:
case PCDM_RS_AlreadyRetrievedAndModified: { case PCDM_RS_AlreadyRetrievedAndModified: {
di << " already retrieved " << "\n" ; di << " already retrieved \n" ;
break; break;
} }
case PCDM_RS_NoDriver: { case PCDM_RS_NoDriver: {
di << " could not retrieve , no Driver to make it " <<"\n" ; di << " could not retrieve , no Driver to make it \n" ;
break ; break ;
} }
case PCDM_RS_UnknownDocument: case PCDM_RS_UnknownDocument:
case PCDM_RS_NoModel: { case PCDM_RS_NoModel: {
di << " could not retrieve , Unknown Document or No Model " <<"\n"; di << " could not retrieve , Unknown Document or No Model \n";
break ; break ;
} }
case PCDM_RS_TypeNotFoundInSchema: case PCDM_RS_TypeNotFoundInSchema:
case PCDM_RS_UnrecognizedFileFormat: { case PCDM_RS_UnrecognizedFileFormat: {
di << " could not retrieve , Type not found or Unrecognized File Format" <<"\n"; di << " could not retrieve , Type not found or Unrecognized File Format\n";
break ; break ;
} }
case PCDM_RS_PermissionDenied: { case PCDM_RS_PermissionDenied: {
di << " could not retrieve , permission denied " << "\n" ; di << " could not retrieve , permission denied \n" ;
break; break;
} }
default: default:
di << " could not retrieve " << "\n" ; di << " could not retrieve \n" ;
break; break;
} }
di << "DDocStd_Open : Error" << "\n"; di << "DDocStd_Open : Error\n";
} }
} }
return 1; return 1;
@ -195,13 +195,13 @@ static Standard_Integer DDocStd_Save (Draw_Interpretor& di,
Handle(TDocStd_Application) A; Handle(TDocStd_Application) A;
if (!DDocStd::Find(A)) return 1; if (!DDocStd::Find(A)) return 1;
if (!D->IsSaved()) { if (!D->IsSaved()) {
di << "this document has never been saved" << "\n"; di << "this document has never been saved\n";
return 0; return 0;
} }
A->Save(D); A->Save(D);
return 0; return 0;
} }
di << "DDocStd_Save : Error" << "\n"; di << "DDocStd_Save : Error\n";
return 1; return 1;
} }
@ -224,27 +224,27 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
if (theStatus != PCDM_SS_OK ) { if (theStatus != PCDM_SS_OK ) {
switch ( theStatus ) { switch ( theStatus ) {
case PCDM_SS_DriverFailure: { case PCDM_SS_DriverFailure: {
di << "Error saving document: Could not store , no driver found to make it" << "\n"; di << "Error saving document: Could not store , no driver found to make it\n";
break ; break ;
} }
case PCDM_SS_WriteFailure: { case PCDM_SS_WriteFailure: {
di << "Error saving document: Write access failure" << "\n"; di << "Error saving document: Write access failure\n";
break; break;
} }
case PCDM_SS_Failure: { case PCDM_SS_Failure: {
di << "Error saving document: Write failure" << "\n" ; di << "Error saving document: Write failure\n" ;
break; break;
} }
case PCDM_SS_Doc_IsNull: { case PCDM_SS_Doc_IsNull: {
di << "Error saving document: No document to save" << "\n"; di << "Error saving document: No document to save\n";
break ; break ;
} }
case PCDM_SS_No_Obj: { case PCDM_SS_No_Obj: {
di << "Error saving document: No objects written" << "\n"; di << "Error saving document: No objects written\n";
break; break;
} }
case PCDM_SS_Info_Section_Error: { case PCDM_SS_Info_Section_Error: {
di << "Error saving document: Write info section failure" << "\n" ; di << "Error saving document: Write info section failure\n" ;
break; break;
} }
default: default:
@ -255,7 +255,7 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDocStd_SaveAs : Error not enough argument" << "\n"; di << "DDocStd_SaveAs : Error not enough argument\n";
return 1; return 1;
} }
@ -323,7 +323,7 @@ static Standard_Integer DDocStd_IsInSession (Draw_Interpretor& di,
di << A->IsInSession(a[1]); di << A->IsInSession(a[1]);
return 0; return 0;
} }
di << "DDocStd_IsInSession : Error" << "\n"; di << "DDocStd_IsInSession : Error\n";
return 1; return 1;
} }
@ -348,7 +348,7 @@ static Standard_Integer DDocStd_OSDPath (Draw_Interpretor& di,
di << "Extension : " << path.Extension().ToCString() << "\n"; di << "Extension : " << path.Extension().ToCString() << "\n";
return 0; return 0;
} }
di << "DDocStd_OSDPath : Error" << "\n"; di << "DDocStd_OSDPath : Error\n";
return 1; return 1;
} }
@ -378,7 +378,7 @@ static Standard_Integer DDocStd_Path (Draw_Interpretor& di,
di << "Path : " << PathAsciiString.ToCString() << "\n"; di << "Path : " << PathAsciiString.ToCString() << "\n";
return 0; return 0;
} }
di << "DDocStd_Path : Error" << "\n"; di << "DDocStd_Path : Error\n";
return 1; return 1;
} }
@ -400,7 +400,7 @@ static Standard_Integer DDocStd_AddComment (Draw_Interpretor& di,
D->AddComment(comment); D->AddComment(comment);
return 0; return 0;
} }
di << "DDocStd_AddComment : Wrong arguments number" << "\n"; di << "DDocStd_AddComment : Wrong arguments number\n";
return 1; return 1;
} }
@ -428,7 +428,7 @@ static Standard_Integer DDocStd_PrintComments (Draw_Interpretor& di,
return 0; return 0;
} }
di << "DDocStd_PrintComments : Wrong arguments number" << "\n"; di << "DDocStd_PrintComments : Wrong arguments number\n";
return 1; return 1;
} }

View File

@ -61,7 +61,7 @@ static Standard_Integer DDocStd_Main (Draw_Interpretor& di,Standard_Integer nb,
DDocStd::ReturnLabel(di,DOC->Main()); DDocStd::ReturnLabel(di,DOC->Main());
return 0; return 0;
} }
di << "DDocStd_Main : Error" << "\n"; di << "DDocStd_Main : Error\n";
return 1; return 1;
} }
@ -89,7 +89,7 @@ static Standard_Integer DDocStd_Format (Draw_Interpretor& di,Standard_Integer n,
D->ChangeStorageFormat(a[2]); D->ChangeStorageFormat(a[2]);
return 0; return 0;
} }
di << "DDocStd_Format : Error" << "\n"; di << "DDocStd_Format : Error\n";
return 1; return 1;
} }
@ -109,11 +109,11 @@ static Standard_Integer DDocStd_Copy (Draw_Interpretor& di,Standard_Integer n, c
TDocStd_XLinkTool XLinkTool; TDocStd_XLinkTool XLinkTool;
XLinkTool.Copy(L,XL); XLinkTool.Copy(L,XL);
if (!XLinkTool.IsDone()) { if (!XLinkTool.IsDone()) {
di << "DDocStd_XLinkTool : not done" << "\n"; di << "DDocStd_XLinkTool : not done\n";
} }
return 0; return 0;
} }
di << "DDocStd_XLinkTool : Error" << "\n"; di << "DDocStd_XLinkTool : Error\n";
return 1; return 1;
} }
@ -134,11 +134,11 @@ static Standard_Integer DDocStd_CopyWithLink (Draw_Interpretor& di,Standard_Inte
TDocStd_XLinkTool XLinkTool; TDocStd_XLinkTool XLinkTool;
XLinkTool.CopyWithLink(L,XL); XLinkTool.CopyWithLink(L,XL);
if (!XLinkTool.IsDone()) { if (!XLinkTool.IsDone()) {
di << "DDocStd_CopyWithLink : not done" << "\n"; di << "DDocStd_CopyWithLink : not done\n";
} }
return 0; return 0;
} }
di << "DDocStd_CopyWithLink : Error" << "\n"; di << "DDocStd_CopyWithLink : Error\n";
return 1; return 1;
} }
@ -157,20 +157,20 @@ static Standard_Integer DDocStd_UpdateLink (Draw_Interpretor& di,Standard_Intege
if (!DDocStd::Find(DOC,a[2],TDF_Reference::GetID(),REF)) return 1; if (!DDocStd::Find(DOC,a[2],TDF_Reference::GetID(),REF)) return 1;
XLinkTool.UpdateLink(REF->Label()); XLinkTool.UpdateLink(REF->Label());
if (!XLinkTool.IsDone()) { if (!XLinkTool.IsDone()) {
di << "DDocStd_UpdateXLink : not done" << "\n"; di << "DDocStd_UpdateXLink : not done\n";
} }
} }
else { else {
for (TDocStd_XLinkIterator xit (DOC); xit.More(); xit.Next()) { for (TDocStd_XLinkIterator xit (DOC); xit.More(); xit.Next()) {
XLinkTool.UpdateLink(xit.Value()->Label()); XLinkTool.UpdateLink(xit.Value()->Label());
if (!XLinkTool.IsDone()) { if (!XLinkTool.IsDone()) {
di << "DDocStd_UpdateXLink : not done" << "\n"; di << "DDocStd_UpdateXLink : not done\n";
} }
} }
} }
return 0; return 0;
} }
di << "DDocStd_UpdateXLink : Error" << "\n"; di << "DDocStd_UpdateXLink : Error\n";
return 1; return 1;
} }
@ -220,10 +220,10 @@ static Standard_Integer DDocStd_Undo (Draw_Interpretor& di,Standard_Integer n, c
for (i = 1; i <= step; i++) { for (i = 1; i <= step; i++) {
if (undo) { if (undo) {
if (!D->Undo()) di << "Undo not done" << "\n"; if (!D->Undo()) di << "Undo not done\n";
} }
else { else {
if (!D->Redo()) di << "Redo not done" << "\n"; if (!D->Redo()) di << "Redo not done\n";
} }
} }
@ -305,7 +305,7 @@ static Standard_Integer DDocStd_DumpDocument (Draw_Interpretor& di,
if (D->IsSaved()) if (D->IsSaved())
di << "DOCUMENT : " << TCollection_AsciiString(D->GetName(),'?').ToCString(); di << "DOCUMENT : " << TCollection_AsciiString(D->GetName(),'?').ToCString();
else else
di << "DOCUMENT : " << "not saved"; di << "DOCUMENT : not saved";
di << "\n"; di << "\n";
// format // format
//cout << "FORMAT : " << D->StorageFormat(); //cout << "FORMAT : " << D->StorageFormat();
@ -337,7 +337,7 @@ static Standard_Integer DDocStd_DumpDocument (Draw_Interpretor& di,
if (!TDocStd_Modified::IsEmpty(D->Main())) { if (!TDocStd_Modified::IsEmpty(D->Main())) {
di << "MODIFICATIONS : "; di << "MODIFICATIONS : ";
TDF_MapIteratorOfLabelMap it (D->GetModified()); TDF_MapIteratorOfLabelMap it (D->GetModified());
if (!it.More()) di << "VALID" << "\n"; if (!it.More()) di << "VALID\n";
else { else {
TCollection_AsciiString string; TCollection_AsciiString string;
for (;it.More();it.Next()) { for (;it.More();it.Next()) {
@ -349,7 +349,7 @@ static Standard_Integer DDocStd_DumpDocument (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DDocStd_DumpDocument : Error" << "\n"; di << "DDocStd_DumpDocument : Error\n";
return 1; return 1;
} }
@ -369,7 +369,7 @@ static Standard_Integer DDocStd_SetModified (Draw_Interpretor& di,Standard_Integ
} }
return 0; return 0;
} }
di << "DDocStd_SetModified : Error" << "\n"; di << "DDocStd_SetModified : Error\n";
return 1; return 1;
} }
@ -400,7 +400,7 @@ static Standard_Integer DDocStd_Propagate (Draw_Interpretor& di,Standard_Integer
// D->PurgeModified(); // D->PurgeModified();
// return 0; // return 0;
// } // }
di << "DDocStd_Propagate : not implemented" << "\n"; di << "DDocStd_Propagate : not implemented\n";
return 1; return 1;
} }

View File

@ -63,20 +63,20 @@ static int mtmCreate (Draw_Interpretor& /*di*/, int n, const char** a)
static int mtmAddDocument (Draw_Interpretor& di, int n, const char** a) static int mtmAddDocument (Draw_Interpretor& di, int n, const char** a)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
if(n > 1) { if(n > 1) {
Handle(DDocStd_DrawDocument) aDrawDoc = Handle(DDocStd_DrawDocument) aDrawDoc =
Handle(DDocStd_DrawDocument)::DownCast(Draw::Get(a[1])); Handle(DDocStd_DrawDocument)::DownCast(Draw::Get(a[1]));
if(aDrawDoc.IsNull()) { if(aDrawDoc.IsNull()) {
di << "Error : wrong document name" << "\n"; di << "Error : wrong document name\n";
return 1; return 1;
} }
sMultiTransactionManager->AddDocument(aDrawDoc->GetDocument()); sMultiTransactionManager->AddDocument(aDrawDoc->GetDocument());
} }
else { else {
di << "Error : document name is not defined" << "\n"; di << "Error : document name is not defined\n";
return 1; return 1;
} }
return 0; return 0;
@ -90,7 +90,7 @@ static int mtmAddDocument (Draw_Interpretor& di, int n, const char** a)
static int mtmOpenTransaction (Draw_Interpretor& di, int /*n*/, const char** /*a*/) static int mtmOpenTransaction (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
sMultiTransactionManager->OpenCommand(); sMultiTransactionManager->OpenCommand();
@ -105,7 +105,7 @@ static int mtmOpenTransaction (Draw_Interpretor& di, int /*n*/, const char** /*a
static int mtmCommitTransaction (Draw_Interpretor& di, int n, const char** a) static int mtmCommitTransaction (Draw_Interpretor& di, int n, const char** a)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
if(n > 1) if(n > 1)
@ -123,7 +123,7 @@ static int mtmCommitTransaction (Draw_Interpretor& di, int n, const char** a)
static int mtmAbortTransaction (Draw_Interpretor& di, int /*n*/, const char** /*a*/) static int mtmAbortTransaction (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
sMultiTransactionManager->AbortCommand(); sMultiTransactionManager->AbortCommand();
@ -138,15 +138,15 @@ static int mtmAbortTransaction (Draw_Interpretor& di, int /*n*/, const char** /*
static int mtmDump (Draw_Interpretor& di, int /*n*/, const char** /*a*/) static int mtmDump (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
di << "*** Dump of MTM ***" << "\n"; di << "*** Dump of MTM ***\n";
//sMultiTransactionManager->DumpTransaction(cout); //sMultiTransactionManager->DumpTransaction(cout);
Standard_SStream aStream; Standard_SStream aStream;
sMultiTransactionManager->DumpTransaction(aStream); sMultiTransactionManager->DumpTransaction(aStream);
di << aStream; di << aStream;
di << "\n" << "*** End ***" << "\n"; di << "\n*** End ***\n";
return 0; return 0;
} }
@ -158,7 +158,7 @@ static int mtmDump (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
static int mtmUndo (Draw_Interpretor& di, int /*n*/, const char** /*a*/) static int mtmUndo (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
sMultiTransactionManager->Undo(); sMultiTransactionManager->Undo();
@ -173,7 +173,7 @@ static int mtmUndo (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
static int mtmRedo (Draw_Interpretor& di, int /*n*/, const char** /*a*/) static int mtmRedo (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
sMultiTransactionManager->Redo(); sMultiTransactionManager->Redo();
@ -188,7 +188,7 @@ static int mtmRedo (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
static int mtmNestedMode (Draw_Interpretor& di, int n, const char** a) static int mtmNestedMode (Draw_Interpretor& di, int n, const char** a)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
Standard_Boolean aMode = Standard_False; Standard_Boolean aMode = Standard_False;
@ -206,7 +206,7 @@ static int mtmNestedMode (Draw_Interpretor& di, int n, const char** a)
static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if ( argc <4 ) { di << "ERROR: Too few args" << "\n"; return 0; } if ( argc <4 ) { di << "ERROR: Too few args\n"; return 0; }
Handle(DDF_Browser) browser = Handle(DDF_Browser) browser =
Handle(DDF_Browser)::DownCast (Draw::Get(argv[1], Standard_True)); Handle(DDF_Browser)::DownCast (Draw::Get(argv[1], Standard_True));
if ( browser.IsNull() ) { di << "ERROR: Not a browser: " << argv[1] << "\n"; return 0; } if ( browser.IsNull() ) { di << "ERROR: Not a browser: " << argv[1] << "\n"; return 0; }
@ -219,7 +219,7 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
TDF_AttributeIterator itr(lab,Standard_False); TDF_AttributeIterator itr(lab,Standard_False);
for (Standard_Integer i=1; itr.More() && i < num; i++) itr.Next(); for (Standard_Integer i=1; itr.More() && i < num; i++) itr.Next();
if ( ! itr.More() ) { di << "ERROR: Attribute #" << num << " not found" << "\n"; return 0; } if ( ! itr.More() ) { di << "ERROR: Attribute #" << num << " not found\n"; return 0; }
const Handle(TDF_Attribute)& att = itr.Value(); const Handle(TDF_Attribute)& att = itr.Value();
if ( att->IsKind(STANDARD_TYPE(TDataStd_TreeNode)) ) if ( att->IsKind(STANDARD_TYPE(TDataStd_TreeNode)) )
@ -331,20 +331,20 @@ static Standard_Integer XAttributeValue (Draw_Interpretor& di, Standard_Integer
static int mtmRemoveDocument (Draw_Interpretor& di, int n, const char** a) static int mtmRemoveDocument (Draw_Interpretor& di, int n, const char** a)
{ {
if(sMultiTransactionManager.IsNull()) { if(sMultiTransactionManager.IsNull()) {
di << "Error : manager is not initialised" << "\n"; di << "Error : manager is not initialised\n";
return 1; return 1;
} }
if(n > 1) { if(n > 1) {
Handle(DDocStd_DrawDocument) aDrawDoc = Handle(DDocStd_DrawDocument) aDrawDoc =
Handle(DDocStd_DrawDocument)::DownCast(Draw::Get(a[1])); Handle(DDocStd_DrawDocument)::DownCast(Draw::Get(a[1]));
if(aDrawDoc.IsNull()) { if(aDrawDoc.IsNull()) {
di << "Error : wrong document name" << "\n"; di << "Error : wrong document name\n";
return 1; return 1;
} }
sMultiTransactionManager->RemoveDocument(aDrawDoc->GetDocument()); sMultiTransactionManager->RemoveDocument(aDrawDoc->GetDocument());
} }
else { else {
di << "Error : document name is not defined" << "\n"; di << "Error : document name is not defined\n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -67,7 +67,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
TDF_AttributeDeltaList added, forgoten, resumed, removed, modified; TDF_AttributeDeltaList added, forgoten, resumed, removed, modified;
Handle(TDF_AttributeDelta) AD; Handle(TDF_AttributeDelta) AD;
if (D->GetUndos().IsEmpty()) { if (D->GetUndos().IsEmpty()) {
di << "no UNDO available" << "\n"; di << "no UNDO available\n";
return 0; return 0;
} }
Handle(TDF_Delta) DELTA = D->GetUndos().Last(); Handle(TDF_Delta) DELTA = D->GetUndos().Last();
@ -90,7 +90,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
di << "ADDED :"; di << "ADDED :";
it.Initialize(added); it.Initialize(added);
if (it.More()) di << "\n"; if (it.More()) di << "\n";
else di << " empty" << "\n"; else di << " empty\n";
for (;it.More();it.Next()) { for (;it.More();it.Next()) {
TDF_Tool::Entry (it.Value()->Label(),string); TDF_Tool::Entry (it.Value()->Label(),string);
di << "- " << string.ToCString() << " "; di << "- " << string.ToCString() << " ";
@ -102,7 +102,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
di << "FORGOTEN :"; di << "FORGOTEN :";
it.Initialize(forgoten); it.Initialize(forgoten);
if (it.More()) di << "\n"; if (it.More()) di << "\n";
else di << " empty" << "\n"; else di << " empty\n";
for (;it.More();it.Next()) { for (;it.More();it.Next()) {
TDF_Tool::Entry (it.Value()->Label(),string); TDF_Tool::Entry (it.Value()->Label(),string);
di << "- " << string.ToCString() << " "; di << "- " << string.ToCString() << " ";
@ -114,7 +114,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
di << "RESUMED :"; di << "RESUMED :";
it.Initialize(resumed); it.Initialize(resumed);
if (it.More()) di << "\n"; if (it.More()) di << "\n";
else di << " empty" << "\n"; else di << " empty\n";
for (;it.More();it.Next()) { for (;it.More();it.Next()) {
TDF_Tool::Entry (it.Value()->Label(),string); TDF_Tool::Entry (it.Value()->Label(),string);
di << "- " << string.ToCString() << " "; di << "- " << string.ToCString() << " ";
@ -126,7 +126,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
di << "REMOVED :"; di << "REMOVED :";
it.Initialize(removed); it.Initialize(removed);
if (it.More()) di << "\n"; if (it.More()) di << "\n";
else di << " empty" << "\n"; else di << " empty\n";
for (;it.More();it.Next()) { for (;it.More();it.Next()) {
TDF_Tool::Entry (it.Value()->Label(),string); TDF_Tool::Entry (it.Value()->Label(),string);
di << "- " << string.ToCString() << " "; di << "- " << string.ToCString() << " ";
@ -138,7 +138,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
di << "MODIFIED :"; di << "MODIFIED :";
it.Initialize(modified); it.Initialize(modified);
if (it.More()) di << "\n"; if (it.More()) di << "\n";
else di << " empty" << "\n"; else di << " empty\n";
for (;it.More();it.Next()) { for (;it.More();it.Next()) {
TDF_Tool::Entry (it.Value()->Label(),string); TDF_Tool::Entry (it.Value()->Label(),string);
di << "- " << string.ToCString() << " "; di << "- " << string.ToCString() << " ";
@ -147,7 +147,7 @@ static Standard_Integer DDocStd_DumpCommand (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "TDocStd_DumpCommand : Error" << "\n"; di << "TDocStd_DumpCommand : Error\n";
return 1; return 1;
} }

View File

@ -156,7 +156,7 @@ static Standard_Integer Getentry (Draw_Interpretor& di, Standard_Integer n, cons
TopoDS_Shape S = DBRep::Get(a[2]); TopoDS_Shape S = DBRep::Get(a[2]);
if (S.IsNull()) { if (S.IsNull()) {
di <<"Noone shape selected"<<"\n"; di <<"Noone shape selected\n";
//di << 0; //di << 0;
return 0; return 0;
} }
@ -168,7 +168,7 @@ static Standard_Integer Getentry (Draw_Interpretor& di, Standard_Integer n, cons
else { else {
di <<Name.ToCString(); di <<Name.ToCString();
if (Status == 2) { if (Status == 2) {
di <<"Several shapes have the same name"<<"\n"; di <<"Several shapes have the same name\n";
} }
} }
return 0; 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; if (!DDF::GetDF(a[1],ND)) return 1;
TopoDS_Shape SS = DBRep::Get(a[2]); TopoDS_Shape SS = DBRep::Get(a[2]);
if (SS.IsNull()) { if (SS.IsNull()) {
di <<"Noone shape selected"<<"\n"; di <<"Noone shape selected\n";
//di << 0; //di << 0;
return 0; return 0;
} }
@ -256,7 +256,7 @@ static Standard_Integer Initialshape (Draw_Interpretor& di, Standard_Integer n,
TDF_Tool::Entry(itL.Value(),entry); TDF_Tool::Entry(itL.Value(),entry);
di <<" , "<< entry.ToCString(); di <<" , "<< entry.ToCString();
} }
di <<"."<<"\n"; di <<".\n";
return 0; return 0;
} }
@ -282,7 +282,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
DDF::FindLabel(ND,a[2],Lab); DDF::FindLabel(ND,a[2],Lab);
Handle(TNaming_NamedShape) NS; Handle(TNaming_NamedShape) NS;
if (!Lab.FindAttribute(TNaming_NamedShape::GetID(),NS)) { if (!Lab.FindAttribute(TNaming_NamedShape::GetID(),NS)) {
di <<"No shape"<<"\n"; di <<"No shape\n";
return 0; return 0;
} }
@ -306,7 +306,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
} }
di <<"\n"; di <<"\n";
if (NbShapes == 0) { if (NbShapes == 0) {
di <<"No shape"<<"\n"; di <<"No shape\n";
} }
return 0; return 0;
@ -336,7 +336,7 @@ static Standard_Integer Generatedshape (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "GetShape : Error" << "\n"; di << "GetShape : Error\n";
return 1; return 1;
} }
@ -362,7 +362,7 @@ static Standard_Integer Getshape (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_GetShape : Error" << "\n"; di << "DDataStd_GetShape : Error\n";
return 1; return 1;
} }
//======================================================================= //=======================================================================
@ -410,7 +410,7 @@ static Standard_Integer Getcreationentry (Draw_Interpretor& di, Standard_Integer
TopoDS_Shape SS = DBRep::Get(a[2]); TopoDS_Shape SS = DBRep::Get(a[2]);
if (SS.IsNull()) { if (SS.IsNull()) {
di <<"Noone shape selected"<<"\n"; di <<"Noone shape selected\n";
//di << 0; //di << 0;
return 0; return 0;
} }
@ -431,7 +431,7 @@ static Standard_Integer Getcreationentry (Draw_Interpretor& di, Standard_Integer
else { else {
di <<Name.ToCString(); di <<Name.ToCString();
if (Status == 2) { if (Status == 2) {
di <<"Several shapes have the same name"<<"\n"; di <<"Several shapes have the same name\n";
} }
} }
return 0; return 0;
@ -487,14 +487,14 @@ static Standard_Integer CheckIter (Draw_Interpretor& di,
if(nb == 5) aNew = (Standard_Boolean) atoi(arg[4]); if(nb == 5) aNew = (Standard_Boolean) atoi(arg[4]);
if(aNew) { if(aNew) {
TNaming_NewShapeIterator aNewShapeIter(aNameIter); TNaming_NewShapeIterator aNewShapeIter(aNameIter);
di << "DNaming_CheckIterator : New It is OK" << "\n"; di << "DNaming_CheckIterator : New It is OK\n";
} else { } else {
TNaming_OldShapeIterator oldShapeIter(aNameIter); TNaming_OldShapeIterator oldShapeIter(aNameIter);
di << "DNaming_CheckIterator : Old It is OK" << "\n"; di << "DNaming_CheckIterator : Old It is OK\n";
} }
return 0; return 0;
} }
di << "DNaming_CheckIterator : Error" << "\n"; di << "DNaming_CheckIterator : Error\n";
return 1; return 1;
} }

View File

@ -109,7 +109,7 @@ static Standard_Integer DNaming_AddObject(Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DNaming_AddObject: Error" << "\n"; di << "DNaming_AddObject: Error\n";
return 1; return 1;
} }
@ -293,7 +293,7 @@ static Standard_Integer DNaming_AddFunction(Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DNaming_AddObject: Error" << "\n"; di << "DNaming_AddObject: Error\n";
return 1; return 1;
} }

View File

@ -130,7 +130,7 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n
} }
return 0; return 0;
} }
di << "DNaming_Select : Error" << "\n"; di << "DNaming_Select : Error\n";
return 1; return 1;
} }
// #define DEB_SELN 1 // #define DEB_SELN 1
@ -200,7 +200,7 @@ static Standard_Integer DNaming_SolveSelection (Draw_Interpretor& di, Standard_I
} }
TDF_LabelMap aValidMap; TDF_LabelMap aValidMap;
if(!FillValidMap(L,aValidMap)) if(!FillValidMap(L,aValidMap))
di << "Valid map is empty" << "\n"; di << "Valid map is empty\n";
#ifdef OCCT_DEBUG_SELN #ifdef OCCT_DEBUG_SELN
cout<<"== Valid Label map =="<<endl; cout<<"== Valid Label map =="<<endl;
for (TDF_MapIteratorOfLabelMap mapItr(aValidMap);mapItr.More(); mapItr.Next()) { 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); TNaming_Selector SL (L);
Standard_Boolean isSolved = SL.Solve(aValidMap); Standard_Boolean isSolved = SL.Solve(aValidMap);
if(!isSolved) if(!isSolved)
di << "!!! Solver is failed" <<"\n"; di << "!!! Solver is failed\n";
TopoDS_Shape Res = TNaming_Tool::CurrentShape(SL.NamedShape()); TopoDS_Shape Res = TNaming_Tool::CurrentShape(SL.NamedShape());
Sprintf (name,"%s_%s","new",a[2]); Sprintf (name,"%s_%s","new",a[2]);
Display (name,Res); Display (name,Res);
return 0; return 0;
} }
di << "DNaming_SolveSelection : Error" << "\n"; di << "DNaming_SolveSelection : Error\n";
return 1; return 1;
} }
@ -240,7 +240,7 @@ static Standard_Integer DNaming_DumpSelection (Draw_Interpretor& di,
if (!DDF::FindLabel(DF,a[2],L)) return 1; if (!DDF::FindLabel(DF,a[2],L)) return 1;
Handle(TNaming_Naming) naming; Handle(TNaming_Naming) naming;
if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) { if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) {
di <<"DNaming_DumpSelection : not a selection" << "\n"; di <<"DNaming_DumpSelection : not a selection\n";
return 1; return 1;
} }
DumpNaming(naming, di); DumpNaming(naming, di);
@ -263,7 +263,7 @@ static Standard_Integer DNaming_DumpSelection (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DNaming_DumpSelection : Error" << "\n"; di << "DNaming_DumpSelection : Error\n";
return 1; return 1;
} }
@ -282,7 +282,7 @@ static Standard_Integer DNaming_ArgsSelection (Draw_Interpretor& di,
if (!DDF::FindLabel(DF,a[2],L)) return 1; if (!DDF::FindLabel(DF,a[2],L)) return 1;
Handle(TNaming_Naming) naming; Handle(TNaming_Naming) naming;
if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) { if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) {
di <<"DNaming_DumpSelection : not a selection" << "\n"; di <<"DNaming_DumpSelection : not a selection\n";
return 1; return 1;
} }
TCollection_AsciiString Entry; TCollection_AsciiString Entry;
@ -297,7 +297,7 @@ static Standard_Integer DNaming_ArgsSelection (Draw_Interpretor& di,
di << "\n"; di << "\n";
return 0; return 0;
} }
di << "DNaming_ArgsSelection : Error" << "\n"; di << "DNaming_ArgsSelection : Error\n";
return 1; return 1;
} }
@ -367,7 +367,7 @@ static Standard_Integer DNaming_Attachment (Draw_Interpretor& di,
di << "\n"; di << "\n";
return 0; return 0;
} }
di << "DNaming_Attachment : Error" << "\n"; di << "DNaming_Attachment : Error\n";
return 1; return 1;
} }

View File

@ -86,7 +86,7 @@ static Standard_Integer DNaming_CheckHasSame (Draw_Interpretor& di,
for(itr2.Initialize(M2);itr2.More();itr2.Next()) { for(itr2.Initialize(M2);itr2.More();itr2.Next()) {
const TopoDS_Shape& s2 = itr2.Key(); const TopoDS_Shape& s2 = itr2.Key();
if(s1.IsSame(s2)) 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(); TR.Perform();
if(TR.IsDone()){ if(TR.IsDone()){
di << "DNaming_CopyShape:: Copy is Done " << "\n"; di << "DNaming_CopyShape:: Copy is Done \n";
DNaming_DataMapIteratorOfDataMapOfShapeOfName itrn(aDMapOfShapeOfName); DNaming_DataMapIteratorOfDataMapOfShapeOfName itrn(aDMapOfShapeOfName);
for(;itrn.More();itrn.Next()) { for(;itrn.More();itrn.Next()) {
@ -138,7 +138,7 @@ static Standard_Integer DNaming_TCopyShape (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "DNaming_CopyShape : Error" << "\n"; di << "DNaming_CopyShape : Error\n";
return 1; return 1;
} }
@ -153,7 +153,7 @@ static Standard_Integer DNaming_TCopyTool (Draw_Interpretor& di,
const char** arg) const char** arg)
{ {
if (nb < 2) { if (nb < 2) {
di << "Usage: CopyTool Shape1 [Shape2] ..." << "\n"; di << "Usage: CopyTool Shape1 [Shape2] ...\n";
return 1; return 1;
} }
@ -171,7 +171,7 @@ static Standard_Integer DNaming_TCopyTool (Draw_Interpretor& di,
} }
if (aShape.IsNull()) { 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; continue;
} }

View File

@ -103,7 +103,7 @@ static Standard_Integer DPrsStd_AISRemove (Draw_Interpretor& di,
TPrsStd_AISViewer::Update(L); TPrsStd_AISViewer::Update(L);
return 0; return 0;
} }
di << "DPrsStd_AISRedisplay : Error" << "\n"; di << "DPrsStd_AISRedisplay : Error\n";
return 1; return 1;
} }
@ -128,7 +128,7 @@ static Standard_Integer DPrsStd_AISErase (Draw_Interpretor& di,
TPrsStd_AISViewer::Update(L); TPrsStd_AISViewer::Update(L);
return 0; return 0;
} }
di << "DPrsStd_AISErase : Error" << "\n"; di << "DPrsStd_AISErase : Error\n";
return 1; return 1;
} }
@ -152,7 +152,7 @@ static Standard_Integer DPrsStd_AISUpdate (Draw_Interpretor& di,
TPrsStd_AISViewer::Update(L); TPrsStd_AISViewer::Update(L);
return 0; return 0;
} }
di << "DPrsStd_AISUpdate : Error" << "\n"; di << "DPrsStd_AISUpdate : Error\n";
return 1; return 1;
} }
@ -206,7 +206,7 @@ static Standard_Integer DPrsStd_AISSet (Draw_Interpretor& di,
di<<resS; di<<resS;
return 0; return 0;
} }
di << "DPrsStd_AISSet : Error" << "\n"; di << "DPrsStd_AISSet : Error\n";
return 1; return 1;
} }
@ -271,7 +271,7 @@ static Standard_Integer DPrsStd_AISDriver (Draw_Interpretor& di,
} }
} }
} }
di << "DPrsStd_AISDriver : Error" << "\n"; di << "DPrsStd_AISDriver : Error\n";
return 1; return 1;
} }
@ -293,7 +293,7 @@ static Standard_Integer DPrsStd_AISUnset (Draw_Interpretor& di,
TPrsStd_AISViewer::Update(L); TPrsStd_AISViewer::Update(L);
return 0; return 0;
} }
di << "DPrsStd_AISDriver : Error" << "\n"; di << "DPrsStd_AISDriver : Error\n";
return 1; return 1;
} }
@ -328,7 +328,7 @@ static Standard_Integer DPrsStd_AISTransparency (Draw_Interpretor& di,
di<<prs->Transparency(); di<<prs->Transparency();
} }
else{ else{
di << "DPrsStd_AISTransparency: Warning : Transparency wasn't set" << "\n"; di << "DPrsStd_AISTransparency: Warning : Transparency wasn't set\n";
di<<(-1); di<<(-1);
} }
} }
@ -395,7 +395,7 @@ static Standard_Integer DPrsStd_AISColor (Draw_Interpretor& di,
di<<prs->Color(); di<<prs->Color();
} }
else{ else{
di << "DPrsStd_AISColor: Warning : Color wasn't set" << "\n"; di << "DPrsStd_AISColor: Warning : Color wasn't set\n";
di<<(-1); di<<(-1);
} }
return 0; return 0;
@ -464,7 +464,7 @@ static Standard_Integer DPrsStd_AISMaterial (Draw_Interpretor& di,
di<<prs->Material(); di<<prs->Material();
} }
else{ else{
di << "DPrsStd_AISMaterial: Warning : Material wasn't set" << "\n"; di << "DPrsStd_AISMaterial: Warning : Material wasn't set\n";
di<<(-1); di<<(-1);
} }
} }
@ -516,7 +516,7 @@ static Standard_Integer DPrsStd_AISHasOwnColor (Draw_Interpretor& di,
{ {
if (nb >= 3) { if (nb >= 3) {
if (nb > 3) if (nb > 3)
di << "DPrsStd_AISHasOwnColor : Warning : too many arguments" << "\n"; di << "DPrsStd_AISHasOwnColor : Warning : too many arguments\n";
Handle(TDocStd_Document) D; Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(arg[1],D)) return 1; if (!DDocStd::GetDocument(arg[1],D)) return 1;
@ -550,7 +550,7 @@ static Standard_Integer DPrsStd_AISHasOwnMaterial (Draw_Interpretor& di,
{ {
if (nb >= 3) { if (nb >= 3) {
if (nb > 3) if (nb > 3)
di << "DPrsStd_AISHasOwnMaterial : Warning : too many arguments" << "\n"; di << "DPrsStd_AISHasOwnMaterial : Warning : too many arguments\n";
Handle(TDocStd_Document) D; Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(arg[1],D)) return 1; if (!DDocStd::GetDocument(arg[1],D)) return 1;
@ -584,7 +584,7 @@ static Standard_Integer DPrsStd_AISHasOwnTransparency (Draw_Interpretor& di,
{ {
if (nb >= 3) { if (nb >= 3) {
if (nb > 3) if (nb > 3)
di << "DPrsStd_AISHasOwnTransparency : Warning : too many arguments" << "\n"; di << "DPrsStd_AISHasOwnTransparency : Warning : too many arguments\n";
Handle(TDocStd_Document) D; Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(arg[1],D)) return 1; if (!DDocStd::GetDocument(arg[1],D)) return 1;

View File

@ -85,7 +85,7 @@ static Standard_Integer DPrsStd_AISRepaint (Draw_Interpretor& di,
TPrsStd_AISViewer::Update(acces); TPrsStd_AISViewer::Update(acces);
return 0; return 0;
} }
di << "DPrsStd_AISRepaint : Error" << "\n"; di << "DPrsStd_AISRepaint : Error\n";
return 1; return 1;
} }

View File

@ -82,8 +82,8 @@ static Standard_Integer chronom(Draw_Interpretor& di,
else else
Draw_Chrono = (*a[1] == '1'); Draw_Chrono = (*a[1] == '1');
if (Draw_Chrono) di << "Chronometers activated."<<"\n"; if (Draw_Chrono) di << "Chronometers activated.\n";
else di << "Chronometers desactivated."<<"\n"; else di << "Chronometers desactivated.\n";
} }
else { else {
Handle(Draw_Drawable3D) D = Draw::Get(a[1]); Handle(Draw_Drawable3D) D = Draw::Get(a[1]);
@ -121,8 +121,8 @@ static Standard_Integer dchronom(Draw_Interpretor& I,
else else
Draw_Chrono = (*a[1] == '1'); Draw_Chrono = (*a[1] == '1');
if (Draw_Chrono) I << "Chronometers activated."<<"\n"; if (Draw_Chrono) I << "Chronometers activated.\n";
else I << "Chronometers desactivated."<<"\n"; else I << "Chronometers desactivated.\n";
} }
else { else {
Handle(Draw_Drawable3D) D = Draw::Get(a[1]); Handle(Draw_Drawable3D) D = Draw::Get(a[1]);
@ -186,7 +186,7 @@ static Standard_Integer spy(Draw_Interpretor& di, Standard_Integer n, const char
Draw_Spying = Standard_False; Draw_Spying = Standard_False;
if (n > 1) { if (n > 1) {
if (!Draw_Spyfile.open(a[1],ios::out)) { if (!Draw_Spyfile.open(a[1],ios::out)) {
di << "Cannot open "<<a[1]<<" for writing"<<"\n"; di << "Cannot open "<<a[1]<<" for writing\n";
return 1; return 1;
} }
Draw_Spying = Standard_True; Draw_Spying = Standard_True;
@ -548,44 +548,44 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
int aType = (n > 2 ? Draw::Atoi(a[2]) : 1); int aType = (n > 2 ? Draw::Atoi(a[2]) : 1);
if (aType < 0 || aType > 2) if (aType < 0 || aType > 2)
{ {
di << "unknown op of the command set" << "\n"; di << "unknown op of the command set\n";
return 1; return 1;
} }
else if (aType == 0) else if (aType == 0)
{ {
OSD_MAllocHook::SetCallback(NULL); OSD_MAllocHook::SetCallback(NULL);
di << "callback is unset" << "\n"; di << "callback is unset\n";
} }
else if (aType == 1) else if (aType == 1)
{ {
OSD_MAllocHook::SetCallback(OSD_MAllocHook::GetCollectBySize()); OSD_MAllocHook::SetCallback(OSD_MAllocHook::GetCollectBySize());
di << "callback is set to CollectBySize" << "\n"; di << "callback is set to CollectBySize\n";
} }
else //if (aType == 2) else //if (aType == 2)
{ {
OSD_MAllocHook::SetCallback(OSD_MAllocHook::GetLogFileHandler()); OSD_MAllocHook::SetCallback(OSD_MAllocHook::GetLogFileHandler());
di << "callback is set to LogFileHandler" << "\n"; di << "callback is set to LogFileHandler\n";
} }
} }
else if (strcmp(a[1], "reset") == 0) else if (strcmp(a[1], "reset") == 0)
{ {
OSD_MAllocHook::GetCollectBySize()->Reset(); OSD_MAllocHook::GetCollectBySize()->Reset();
di << "CollectBySize handler is reset" << "\n"; di << "CollectBySize handler is reset\n";
} }
else if (strcmp(a[1], "open") == 0) else if (strcmp(a[1], "open") == 0)
{ {
const char* aFileName = (n > 2 ? a[2] : "mem-log.txt"); const char* aFileName = (n > 2 ? a[2] : "mem-log.txt");
if (!OSD_MAllocHook::GetLogFileHandler()->Open(aFileName)) if (!OSD_MAllocHook::GetLogFileHandler()->Open(aFileName))
{ {
di << "cannot create file " << aFileName << " for writing" << "\n"; di << "cannot create file " << aFileName << " for writing\n";
return 1; return 1;
} }
di << "log file " << aFileName << " is opened for writing" << "\n"; di << "log file " << aFileName << " is opened for writing\n";
} }
else if (strcmp(a[1], "close") == 0) else if (strcmp(a[1], "close") == 0)
{ {
OSD_MAllocHook::GetLogFileHandler()->Close(); OSD_MAllocHook::GetLogFileHandler()->Close();
di << "log file is closed" << "\n"; di << "log file is closed\n";
} }
else if (strcmp(a[1], "report1") == 0) else if (strcmp(a[1], "report1") == 0)
{ {
@ -594,7 +594,7 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
aOutFile = a[2]; aOutFile = a[2];
if (OSD_MAllocHook::GetCollectBySize()->MakeReport(aOutFile)) if (OSD_MAllocHook::GetCollectBySize()->MakeReport(aOutFile))
{ {
di << "report " << aOutFile << " has been created" << "\n"; di << "report " << aOutFile << " has been created\n";
} }
else else
{ {
@ -619,7 +619,7 @@ By default <logfile> is \"mem-log.txt\", <outfile> is \"mem-stat.txt\""
} }
if (OSD_MAllocHook::LogFileHandler::MakeReport(aLogFile, aOutFile, includeAlive)) if (OSD_MAllocHook::LogFileHandler::MakeReport(aLogFile, aOutFile, includeAlive))
{ {
di << "report " << aOutFile << " has been created" << "\n"; di << "report " << aOutFile << " has been created\n";
} }
else else
{ {

View File

@ -135,7 +135,7 @@ static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer argc, const
} }
if(argc == 1) if(argc == 1)
{ {
di << "Pick first corner"<<"\n"; di << "Pick first corner\n";
dout.Select(id,X1,Y1,b); dout.Select(id,X1,Y1,b);
gp_Trsf T; gp_Trsf T;
@ -162,7 +162,7 @@ static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer argc, const
d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1)); d.Draw(gp_Pnt2d(dOX2,dY1),gp_Pnt2d(dX1,dY1));
d.Flush(); d.Flush();
dout.GetPosSize(id,X,Y,W,H); dout.GetPosSize(id,X,Y,W,H);
di << "Pick second corner"<<"\n"; di << "Pick second corner\n";
b = 0; b = 0;
while (b == 0) { while (b == 0) {
dout.Select(id,X2,Y2,b,Standard_False); dout.Select(id,X2,Y2,b,Standard_False);
@ -236,7 +236,7 @@ static Standard_Integer wclick(Draw_Interpretor& di, Standard_Integer, const cha
{ {
Standard_Integer id1,X1,Y1,b; Standard_Integer id1,X1,Y1,b;
dout.Flush(); dout.Flush();
di << "Just click."<<"\n"; di << "Just click.\n";
dout.Select(id1,X1,Y1,b); dout.Select(id1,X1,Y1,b);
return 0; return 0;
} }
@ -273,7 +273,7 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
H = Draw::Atoi(a[6]); H = Draw::Atoi(a[6]);
dout.MakeView(id,a[2],X,Y,W,H); dout.MakeView(id,a[2],X,Y,W,H);
if (!dout.HasView(id)) { if (!dout.HasView(id)) {
di << "View creation failed"<<"\n"; di << "View creation failed\n";
return 1; return 1;
} }
SetTitle(id); SetTitle(id);
@ -289,7 +289,7 @@ static Standard_Integer view(Draw_Interpretor& di, Standard_Integer n, const cha
} }
dout.MakeView(id,a[2],a[3]); dout.MakeView(id,a[2],a[3]);
if (!dout.HasView(id)) { if (!dout.HasView(id)) {
di << "View creation failed"<<"\n"; di << "View creation failed\n";
return 1; return 1;
} }
SetTitle(id); SetTitle(id);
@ -808,12 +808,12 @@ static Standard_Integer dfont(Draw_Interpretor& di,
static Standard_Integer hcolor(Draw_Interpretor& di, Standard_Integer n, const char** a) static Standard_Integer hcolor(Draw_Interpretor& di, Standard_Integer n, const char** a)
{ {
if (n < 4) { if (n < 4) {
di << "code de couleur (Draw.cxx) : " << "\n" ; di << "code de couleur (Draw.cxx) : \n" ;
di << "0 = White,\t 1 = Red,\t 2 = Green,\t 3 = Blue" << "\n" ; di << "0 = White,\t 1 = Red,\t 2 = Green,\t 3 = Blue\n" ;
di << "4 = Cyan,\t 5 = Gold,\t 6 = Magenta,\t 7 = Maroon" << "\n" ; di << "4 = Cyan,\t 5 = Gold,\t 6 = Magenta,\t 7 = Maroon" << "\n" ;
di << "8 = Orange,\t 9 = Pink,\t 10 = Salmon,\t 11 = Violet" << "\n" ; di << "8 = Orange,\t 9 = Pink,\t 10 = Salmon,\t 11 = Violet\n" ;
di << "12 = Yellow,\t 13 = Khaki,\t 14 = Coral" << "\n" ; di << "12 = Yellow,\t 13 = Khaki,\t 14 = Coral\n" ;
di << "1 <= width <= 11, 0 (noir) <= gray <= 1 (blanc)" << "\n" ; di << "1 <= width <= 11, 0 (noir) <= gray <= 1 (blanc)\n" ;
} else { } else {
dout.PostColor(Draw::Atoi(a[1]),Draw::Atoi(a[2]),Draw::Atof(a[3])); dout.PostColor(Draw::Atoi(a[1]),Draw::Atoi(a[2]),Draw::Atof(a[3]));
} }
@ -916,7 +916,7 @@ static Standard_Integer dtext(Draw_Interpretor& di, Standard_Integer n, const ch
Standard_Boolean is3d; Standard_Boolean is3d;
if (n == 2) { if (n == 2) {
Standard_Integer id,X,Y,b; Standard_Integer id,X,Y,b;
di << "Pick position with button 1, other button escape"<<"\n"; di << "Pick position with button 1, other button escape\n";
dout.Select(id,X,Y,b); dout.Select(id,X,Y,b);
if (b != 1) if (b != 1)
return 0; return 0;

View File

@ -34,7 +34,7 @@ static Standard_Integer parsing
(Draw_Interpretor& di, Standard_Integer argc, const char** argv) (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if (argc < 2) { if (argc < 2) {
di << "Usage : " << argv[0] << " string [nbiter]" << "\n"; di << "Usage : " << argv[0] << " string [nbiter]\n";
return 1; return 1;
} }
@ -47,7 +47,7 @@ static Standard_Integer parsing
Units_UnitSentence aUnitSent(aStrTok.ToCString()); Units_UnitSentence aUnitSent(aStrTok.ToCString());
if(!aUnitSent.IsDone()) { if(!aUnitSent.IsDone()) {
di<<"can not create a sentence"<<"\n"; di<<"can not create a sentence\n";
return 1; return 1;
} }
@ -85,7 +85,7 @@ static Standard_Integer converttoSI
(Draw_Interpretor& di, Standard_Integer argc, const char** argv) (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if (argc < 3) { if (argc < 3) {
di<<"Invalid number of parameter, use: unitconvtoSI real string"<<"\n"; di<<"Invalid number of parameter, use: unitconvtoSI real string\n";
return 1; return 1;
} }
@ -107,7 +107,7 @@ static Standard_Integer converttoMDTV
(Draw_Interpretor& di, Standard_Integer argc, const char** argv) (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if (argc < 3) { if (argc < 3) {
di<<"Invalid number of parameter, use: unitconvtoMDTV real string"<<"\n"; di<<"Invalid number of parameter, use: unitconvtoMDTV real string\n";
return 1; return 1;
} }

View File

@ -84,7 +84,7 @@ static Standard_Integer DrawDim_DISTANCE (Draw_Interpretor& di,
} }
} }
} }
di << "DrawDim_DISTANCE : error" << "\n"; di << "DrawDim_DISTANCE : error\n";
return 1; return 1;
} }
@ -122,7 +122,7 @@ static Standard_Integer DrawDim_ANGLE (Draw_Interpretor& di,
} }
} }
} }
di << "DrawDim_PlanarAngle : error" << "\n"; di << "DrawDim_PlanarAngle : error\n";
return 1; return 1;
} }
@ -156,7 +156,7 @@ static Standard_Integer DrawDim_RADIUS (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DrawDim_PlanarRadius : error" << "\n"; di << "DrawDim_PlanarRadius : error\n";
return 1; return 1;
} }
@ -188,7 +188,7 @@ static Standard_Integer DrawDim_CENTER (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DrawDim_CENTER : error" << "\n"; di << "DrawDim_CENTER : error\n";
return 1; return 1;
} }
@ -275,7 +275,7 @@ static Standard_Integer DrawDim_SPLACEMENT (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DrawDim_SPlacement : error" << "\n"; di << "DrawDim_SPlacement : error\n";
return 1; return 1;
} }
@ -309,7 +309,7 @@ static Standard_Integer DrawDim_GPLACEMENT (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DrawDim_Placement : error" << "\n"; di << "DrawDim_Placement : error\n";
return 1; return 1;
} }

View File

@ -1026,7 +1026,7 @@ static void printColor(Draw_Interpretor& di, const Draw_Color& theColor)
case Draw_saumon: di << "salmon " << "\n"; break; case Draw_saumon: di << "salmon " << "\n"; break;
case Draw_violet: di << "violet " << "\n"; break; case Draw_violet: di << "violet " << "\n"; break;
case Draw_jaune: di << "yellow " << "\n"; break; case Draw_jaune: di << "yellow " << "\n"; break;
case Draw_kaki: di << "dark-olive green " << "\n"; break; case Draw_kaki: di << "dark-olive green \n"; break;
case Draw_corail: di << "coral " << "\n"; break; case Draw_corail: di << "coral " << "\n"; break;
} }
} }
@ -1193,7 +1193,7 @@ static void printMarker(Draw_Interpretor& di, const Draw_MarkerShape& theMarker)
case Draw_X: di << "x " << "\n"; break; case Draw_X: di << "x " << "\n"; break;
case Draw_Plus: di << "plus " << "\n"; break; case Draw_Plus: di << "plus " << "\n"; break;
case Draw_Circle: di << "circle " << "\n"; break; case Draw_Circle: di << "circle " << "\n"; break;
case Draw_CircleZoom: di << "circle_zoom " << "\n"; break; case Draw_CircleZoom: di << "circle_zoom \n"; break;
} }
} }

View File

@ -531,7 +531,7 @@ void FairCurve_Batten::Dump(Standard_OStream& o) const
// ================================================================== // ==================================================================
{ {
o << " Batten |"; o.width(7); o<< "Old " << " | " << " New" << endl; o << " Batten |"; o.width(7); o<< "Old | New" << endl;
o << " P1 X |"; o.width(7); o<< OldP1.X() << " | " << NewP1.X() << endl; o << " P1 X |"; o.width(7); o<< OldP1.X() << " | " << NewP1.X() << endl;
o << " Y |"; o.width(7); o<< OldP1.Y() << " | " << NewP1.Y() << endl; o << " Y |"; o.width(7); o<< OldP1.Y() << " | " << NewP1.Y() << endl;
o << " P2 X |"; o.width(7); o<< OldP2.X() << " | " << NewP2.X() << endl; o << " P2 X |"; o.width(7); o<< OldP2.X() << " | " << NewP2.X() << endl;

View File

@ -434,7 +434,7 @@ void FairCurve_MinimalVariation::Dump(Standard_OStream& o) const
//====================================================================================== //======================================================================================
{ {
o << " MVCurve |"; o.width(7); o<< "Old " << " | " << " New" << endl; o << " MVCurve |"; o.width(7); o<< "Old | New" << endl;
o << " P1 X |"; o.width(7); o<< OldP1.X() << " | " << NewP1.X() << endl; o << " P1 X |"; o.width(7); o<< OldP1.X() << " | " << NewP1.X() << endl;
o << " Y |"; o.width(7); o<< OldP1.Y() << " | " << NewP1.Y() << endl; o << " Y |"; o.width(7); o<< OldP1.Y() << " | " << NewP1.Y() << endl;
o << " P2 X |"; o.width(7); o<< OldP2.X() << " | " << NewP2.X() << endl; o << " P2 X |"; o.width(7); o<< OldP2.X() << " | " << NewP2.X() << endl;

View File

@ -100,7 +100,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
char* temp = name; // portage WNT char* temp = name; // portage WNT
DrawTrSurf::Set(temp, P1); DrawTrSurf::Set(temp, P1);
proj.Parameters(i,UU,VV); 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 << " Ses parametres sont: UU = " << UU << "\n";
di << " VV = " << VV << "\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); DrawTrSurf::Set(temp, P1);
di << name << " "; di << name << " ";
UU = proj.Parameter(i); 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"; 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"; di << "Extrema is point : " << P1.X() << " " << P1.Y() << " " << P1.Z() << "\n";
} }
else { 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_Line) L = new Geom_Line(P1,gp_Vec(P1,P2));
Handle(Geom_TrimmedCurve) CT = Handle(Geom_TrimmedCurve) CT =
new Geom_TrimmedCurve(L, 0., P1.Distance(P2)); new Geom_TrimmedCurve(L, 0., P1.Distance(P2));
@ -558,7 +558,7 @@ static Standard_Integer totalextcc(Draw_Interpretor& di, Standard_Integer n, con
} }
else { else {
di << "Curves are infinite and parallel" << "\n"; di << "Curves are infinite and parallel\n";
} }
di << "Minimal distance : " << Ex.TotalLowerDistance() << "\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 { else {
// C-R-R // C-R-R
di << "Curve, radius, radius ???"<<"\n"; di << "Curve, radius, radius ???\n";
return 1; return 1;
} }
} }
@ -308,7 +308,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
else { else {
// P-R-R // P-R-R
di << "Point, radius, radius ???"<<"\n"; di << "Point, radius, radius ???\n";
return 1; return 1;
} }
} }
@ -338,7 +338,7 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
else { else {
// R-C-R // R-C-R
di << "Radius - Curve - Radius ??"<<"\n"; di << "Radius - Curve - Radius ??\n";
return 1; return 1;
} }
} }
@ -364,13 +364,13 @@ static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const
} }
else { else {
// R-P-R // R-P-R
di << "Radius - Point - Radius ??"<<"\n"; di << "Radius - Point - Radius ??\n";
return 1; return 1;
} }
} }
else { else {
// R-R-.. // R-R-..
di << "radius, radius ???"<<"\n"; di << "radius, radius ???\n";
return 1; return 1;
} }
} }
@ -418,7 +418,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
} }
} }
else else
di << "Lin2dTanObl Not done" << "\n"; di << "Lin2dTanObl Not done\n";
} }
else { else {
Geom2dGcc_Lin2d2Tan ct3(Geom2dGcc::Unqualified(C1), Geom2dGcc_Lin2d2Tan ct3(Geom2dGcc::Unqualified(C1),
@ -436,7 +436,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const
} }
} }
else else
di << "Lin2d2Tan Not done" << "\n"; di << "Lin2d2Tan Not done\n";
} }
DrawTrSurf_CurveColor(col); DrawTrSurf_CurveColor(col);
@ -449,12 +449,12 @@ static Standard_Integer interpol (Draw_Interpretor& di,Standard_Integer n, const
//================================================================================== //==================================================================================
{ {
if (n == 1) { if (n == 1) {
di <<"give a name to your curve !" << "\n"; di <<"give a name to your curve !\n";
return 0; return 0;
} }
if (n == 2) { if (n == 2) {
Standard_Integer id,XX,YY,b, i, j; Standard_Integer id,XX,YY,b, i, j;
di << "Pick points "<< "\n"; di << "Pick points \n";
dout.Select(id, XX, YY, b); dout.Select(id, XX, YY, b);
Standard_Real zoom = dout.Zoom(id); Standard_Real zoom = dout.Zoom(id);
if (b != 1) return 0; 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 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 passing points p1 p2 for seg p1 p2 p3 or p1 p2 p3 p4 for cir (p2 p3 is a tgtvec)!\n";
return 0; return 0;
} }

View File

@ -272,7 +272,7 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
ONE = 2; ONE = 2;
} }
else { else {
di << "gproject wait 2 or 3 arguments" << "\n"; di << "gproject wait 2 or 3 arguments\n";
return 1; 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); Projector.GetSurface()->D0(P2d.X(), P2d.Y(), P);
DrawTrSurf::Set(temp, P); DrawTrSurf::Set(temp, P);
DrawTrSurf::Set(temp1, P2d); DrawTrSurf::Set(temp1, P2d);
di<<temp<<" is 3d projected curve"<<"\n"; di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve"<<"\n"; di<<temp1<<" is pcurve\n";
} }
else { else {
Only2d = Only3d = Standard_False; 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); Handle(Geom_Curve) OutCur = new Geom_TrimmedCurve(GeomAdaptor::MakeCurve(hcur->Curve()), Ufin, Udeb);
DrawTrSurf::Set(temp, OutCur); DrawTrSurf::Set(temp, OutCur);
DrawTrSurf::Set(temp1, PCur2d); DrawTrSurf::Set(temp1, PCur2d);
di<<temp<<" is 3d projected curve"<<"\n"; di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve"<<"\n"; di<<temp1<<" is pcurve\n";
return 0; return 0;
} }
else { else {
@ -382,8 +382,8 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
DrawTrSurf::Set(temp, appr.Curve3d()); DrawTrSurf::Set(temp, appr.Curve3d());
} }
DrawTrSurf::Set(temp1, PCur2d); DrawTrSurf::Set(temp1, PCur2d);
di<<temp<<" is 3d projected curve"<<"\n"; di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve"<<"\n"; di<<temp1<<" is pcurve\n";
} }
} }
} }
@ -399,10 +399,10 @@ static Standard_Integer project (Draw_Interpretor& di,
{ {
if ( n == 1) { if ( n == 1) {
di << "project result2d c3d surf [-e p] [-v n] [-t tol]" << "\n"; di << "project result2d c3d surf [-e p] [-v n] [-t tol]\n";
di << " -e p : extent the surface of <p>%" << "\n"; di << " -e p : extent the surface of <p>%\n";
di << " -v n : verify the projection at <n> points." << "\n"; di << " -v n : verify the projection at <n> points.\n";
di << " -t tol : set the tolerance for approximation" << "\n"; di << " -t tol : set the tolerance for approximation\n";
return 0; return 0;
} }
@ -445,7 +445,7 @@ static Standard_Integer project (Draw_Interpretor& di,
GeomProjLib::Curve2d(GC, GS, U1, U2, V1, V2, tolerance); GeomProjLib::Curve2d(GC, GS, U1, U2, V1, V2, tolerance);
if ( G2d.IsNull() ) { if ( G2d.IsNull() ) {
di << "\n" << "Projection Failed" << "\n"; di << "\nProjection Failed\n";
return 1; return 1;
} }
else { else {
@ -453,7 +453,7 @@ static Standard_Integer project (Draw_Interpretor& di,
} }
if ( Verif) { // verify the projection on n points if ( Verif) { // verify the projection on n points
if ( NbPoints <= 0) { if ( NbPoints <= 0) {
di << " n must be positive" << "\n"; di << " n must be positive\n";
return 0; return 0;
} }
gp_Pnt P1,P2; gp_Pnt P1,P2;
@ -494,7 +494,7 @@ Standard_Integer projonplane(Draw_Interpretor& di,
Handle(Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(S); Handle(Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(S);
if ( Pl.IsNull()) { if ( Pl.IsNull()) {
di << " The surface must be a plane" << "\n"; di << " The surface must be a plane\n";
return 1; return 1;
} }
@ -592,7 +592,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
} }
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
@ -610,7 +610,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
} }
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
@ -629,7 +629,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
} }
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
@ -648,12 +648,12 @@ static Standard_Integer bisec (Draw_Interpretor& di,
} }
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
else { 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; return 1;
} }
} }
@ -670,7 +670,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
} }
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
@ -682,13 +682,13 @@ static Standard_Integer bisec (Draw_Interpretor& di,
solution(Bis.ThisSolution(),a[1],0); solution(Bis.ThisSolution(),a[1],0);
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
} }
else { else {
di << " the second arg must be line/circle/point " << "\n"; di << " the second arg must be line/circle/point \n";
} }
} }
else if ( ip1) { else if ( ip1) {
@ -706,7 +706,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
} }
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
@ -718,7 +718,7 @@ static Standard_Integer bisec (Draw_Interpretor& di,
solution(Bis.ThisSolution(),a[1],0); solution(Bis.ThisSolution(),a[1],0);
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
@ -730,25 +730,25 @@ static Standard_Integer bisec (Draw_Interpretor& di,
DrawTrSurf::Set(a[1],new Geom2d_Line(Bis.ThisSolution())); DrawTrSurf::Set(a[1],new Geom2d_Line(Bis.ThisSolution()));
} }
else { else {
di << " Bisec has failed !!" << "\n"; di << " Bisec has failed !!\n";
return 1; return 1;
} }
} }
else { else {
di << " the second arg must be line/circle/point " << "\n"; di << " the second arg must be line/circle/point \n";
return 1; return 1;
} }
} }
else { 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; return 1;
} }
if ( NbSol >= 2) { if ( NbSol >= 2) {
di << "There are " << NbSol << " Solutions." << "\n"; di << "There are " << NbSol << " Solutions.\n";
} }
else { else {
di << "There is " << NbSol << " Solution." << "\n"; di << "There is " << NbSol << " Solution.\n";
} }
return 0; return 0;
@ -819,7 +819,7 @@ static Standard_Integer movelaw (Draw_Interpretor& di, Standard_Integer n, const
Draw::Repaint(); Draw::Repaint();
} }
else { 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); GCPnts_QuasiUniformDeflection PntGen(GAC, defl);
if(!PntGen.IsDone()) { if(!PntGen.IsDone()) {
di << "Points generation failed" << "\n"; di << "Points generation failed\n";
return 1; return 1;
} }
@ -1100,7 +1100,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
ellip = DrawTrSurf::GetBSplineCurve(a[1]); ellip = DrawTrSurf::GetBSplineCurve(a[1]);
if (ellip.IsNull()) if (ellip.IsNull())
{ {
di << " BSpline is NULL "<<"\n"; di << " BSpline is NULL \n";
return 1; return 1;
}*/ }*/
@ -1108,7 +1108,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
ellip = DrawTrSurf::GetCurve(a[1]); ellip = DrawTrSurf::GetCurve(a[1]);
if (ellip.IsNull()) if (ellip.IsNull())
{ {
di << " Curve is NULL "<<"\n"; di << " Curve is NULL \n";
return 1; return 1;
} }
@ -1146,7 +1146,7 @@ static Standard_Integer uniformAbscissa (Draw_Interpretor& di, Standard_Integer
catch (Standard_Failure ) catch (Standard_Failure )
{ {
di << " Standard Failure " <<"\n"; di << " Standard Failure \n";
} }
return 0; return 0;
} }
@ -1194,7 +1194,7 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
catch(Standard_Failure) catch(Standard_Failure)
{ {
di << " Standard Failure "<<"\n"; di << " Standard Failure \n";
} }
try try
@ -1223,7 +1223,7 @@ static Standard_Integer EllipsUniformAbscissa (Draw_Interpretor& di, Standard_In
catch (Standard_Failure ) catch (Standard_Failure )
{ {
di << " Standard Failure " <<"\n"; di << " Standard Failure \n";
} }
return 0; 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 if (n == 8 || n == 9 || n == 12 || n == 13 || n == 16 || n == 17)
else else
{ {
di<<"incorrect number of arguments"<<"\n"; di<<"incorrect number of arguments\n";
return 1; return 1;
} }
// //
if (!Inters.IsDone()) if (!Inters.IsDone())
{ {
di<<"No intersections found!"<<"\n"; di<<"No intersections found!\n";
return 1; return 1;
} }
@ -1681,7 +1681,7 @@ static Standard_Integer intersection (Draw_Interpretor& di,
// //
if (!Inters.IsDone()) if (!Inters.IsDone())
{ {
di<<"No intersections found!"<<"\n"; di<<"No intersections found!\n";
return 1; 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 // argc vaut 1 de plus, puisque argv[0] contient le nom de la commande
if (argc != (waiting+1)) if (argc != (waiting+1))
{ {
di << "Waiting "<< waiting << " arguments" << "\n"; di << "Waiting "<< waiting << " arguments\n";
return Standard_False; return Standard_False;
} }
else else
@ -75,7 +75,7 @@ BattenCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
Handle(DrawFairCurve_Batten) aBatten = new DrawFairCurve_Batten(Bat); Handle(DrawFairCurve_Batten) aBatten = new DrawFairCurve_Batten(Bat);
if (aBatten.IsNull()) { if (aBatten.IsNull()) {
di << " Batten null "<< "\n"; di << " Batten null \n";
return 1; return 1;
} }
Draw::Set(BattenName,aBatten); 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); Handle(DrawFairCurve_MinimalVariation) aMVC = new DrawFairCurve_MinimalVariation(MVC);
if (aMVC.IsNull()) { if (aMVC.IsNull()) {
di << " MVC null "<< "\n"; di << " MVC null \n";
return 1; return 1;
} }
Draw::Set(MVCName, aMVC); 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]); Handle(Geom_Curve) C1 = DrawTrSurf::GetCurve(a[2]);
if ( C1.IsNull()) { if ( C1.IsNull()) {
di << " C1 is not a Curve ==> Command failed" << "\n"; di << " C1 is not a Curve ==> Command failed\n";
return 1; return 1;
} }
Handle(Geom_Curve) C2 = DrawTrSurf::GetCurve(a[3]); Handle(Geom_Curve) C2 = DrawTrSurf::GetCurve(a[3]);
if ( C2.IsNull()) { if ( C2.IsNull()) {
di << " C2 is not a Curve ==> Command failed" << "\n"; di << " C2 is not a Curve ==> Command failed\n";
return 1; return 1;
} }
@ -277,7 +277,7 @@ static Standard_Integer appsurf(Draw_Interpretor& di,
App.Perform( Line, Section); App.Perform( Line, Section);
if ( !App.IsDone()) { if ( !App.IsDone()) {
di << " Approximation aux fraises " << "\n"; di << " Approximation aux fraises \n";
} }
Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots; 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]); aC=DrawTrSurf::GetCurve(a[1]);
if (aC.IsNull()) { if (aC.IsNull()) {
di << "Error: " << a[1] << " is not a curve!" << "\n"; di << "Error: " << a[1] << " is not a curve!\n";
return 0; return 0;
} }
// //
aS=DrawTrSurf::GetSurface(a[2]); aS=DrawTrSurf::GetSurface(a[2]);
if (aS.IsNull()) { if (aS.IsNull()) {
di << "Error: " << a[2] << " is not a surface!" << "\n"; di << "Error: " << a[2] << " is not a surface!\n";
return 0; return 0;
} }
// //
@ -354,7 +354,7 @@ static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const
aPPS.Init(aP, aS, aTol); aPPS.Init(aP, aS, aTol);
bRet=aPPS.IsDone(); bRet=aPPS.IsDone();
if (!bRet) { if (!bRet) {
di << "Error: GeomAPI_ProjectPointOnSurf failed" << "\n"; di << "Error: GeomAPI_ProjectPointOnSurf failed\n";
return 0; return 0;
} }
// //

View File

@ -126,7 +126,7 @@ static Standard_Integer PointsByPick
{ {
Standard_Integer id,XX,YY,b, i; Standard_Integer id,XX,YY,b, i;
di << "Pick points "<< "\n"; di << "Pick points \n";
dout.Select(id, XX, YY, b); dout.Select(id, XX, YY, b);
Standard_Real zoom = dout.Zoom(id); Standard_Real zoom = dout.Zoom(id);
if (b != 1) return 0; if (b != 1) return 0;
@ -253,7 +253,7 @@ static void PointsByFile(Handle(AppDef_HArray1OfMultiPointConstraint)& MPC,
for(i=1; i<=nbc; i++) { for(i=1; i<=nbc; i++) {
iFile >> num >> ordre; iFile >> num >> ordre;
if ((num<1)||(num>nbp)) { if ((num<1)||(num>nbp)) {
di << "Error on point Index in constrainte" << "\n"; di << "Error on point Index in constrainte\n";
return; return;
} }
Constraint = (AppParCurves_Constraint) (ordre+1); Constraint = (AppParCurves_Constraint) (ordre+1);
@ -304,7 +304,7 @@ static void PointsByFile(Handle(AppDef_HArray1OfMultiPointConstraint)& MPC,
for(i=1; i<=nbc; i++) { for(i=1; i<=nbc; i++) {
iFile >> num >> ordre; iFile >> num >> ordre;
if ((num<1)||(num>nbp)) { if ((num<1)||(num>nbp)) {
di << "Error on point Index in constrainte" << "\n"; di << "Error on point Index in constrainte\n";
return; return;
} }
Constraint = (AppParCurves_Constraint) (ordre+1); Constraint = (AppParCurves_Constraint) (ordre+1);
@ -342,11 +342,11 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
Standard_Integer id = 0, DegMax = -1; Standard_Integer id = 0, DegMax = -1;
if (n == 1) { if (n == 1) {
di <<"give a name to your curve !" << "\n"; di <<"give a name to your curve !\n";
return 0; return 0;
} }
if (n == 2) { if (n == 2) {
di <<"give a tolerance to your curve !" << "\n"; di <<"give a tolerance to your curve !\n";
return 0; return 0;
} }
if (n == 3) { if (n == 3) {
@ -381,7 +381,7 @@ static Standard_Integer smoothing (Draw_Interpretor& di,Standard_Integer n, cons
const char* nomfic = a[ific]; const char* nomfic = a[ific];
ifstream iFile(nomfic, ios::in); ifstream iFile(nomfic, ios::in);
if (!iFile) { if (!iFile) {
di << a[ific] <<"do not exist !" << "\n"; di << a[ific] <<"do not exist !\n";
return 1; return 1;
} }
PointsByFile(Points, TABofCC, iFile, di); PointsByFile(Points, TABofCC, iFile, di);
@ -509,20 +509,20 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
Standard_Integer Degree = 8; Standard_Integer Degree = 8;
if (n == 1) { if (n == 1) {
di <<"give a name to your curve !" << "\n"; di <<"give a name to your curve !\n";
return 0; return 0;
} }
if (n == 2) { if (n == 2) {
di <<"give a tolerance to your curve !" << "\n"; di <<"give a tolerance to your curve !\n";
return 0; return 0;
} }
if (n == 3) { if (n == 3) {
di <<"give a max degree!" << "\n"; di <<"give a max degree!\n";
return 0; return 0;
} }
if (n == 4) { if (n == 4) {
di <<"give an option!" << "\n"; di <<"give an option!\n";
return 0; return 0;
} }
if (n >= 5) { if (n >= 5) {
@ -551,7 +551,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
const char* nomfic = a[5]; const char* nomfic = a[5];
ifstream iFile(nomfic, ios::in); ifstream iFile(nomfic, ios::in);
if (!iFile) { if (!iFile) {
di << a[6] <<"do not exist !" << "\n"; di << a[6] <<"do not exist !\n";
return 1; return 1;
} }
PointsByFile(Points, TABofCC, iFile, di); PointsByFile(Points, TABofCC, iFile, di);
@ -603,7 +603,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
Appr.Perform (AML); Appr.Perform (AML);
if (! Appr.IsAllApproximated()) { if (! Appr.IsAllApproximated()) {
di << " No result" << "\n"; di << " No result\n";
} }
AppParCurves_MultiCurve AnMuC = Appr.Value(); AppParCurves_MultiCurve AnMuC = Appr.Value();
ThePoints = new (TColgp_HArray1OfPnt2d) (1, AnMuC.NbPoles() ); ThePoints = new (TColgp_HArray1OfPnt2d) (1, AnMuC.NbPoles() );
@ -621,7 +621,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
Varia.Approximate(); Varia.Approximate();
if (! Varia.IsDone()) { if (! Varia.IsDone()) {
di << " No result" << "\n"; di << " No result\n";
} }
AppParCurves_MultiBSpCurve AnMuC = Varia.Value(); AppParCurves_MultiBSpCurve AnMuC = Varia.Value();
@ -678,7 +678,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
Appr.Perform (AML); Appr.Perform (AML);
if (! Appr.IsAllApproximated()) { if (! Appr.IsAllApproximated()) {
di << " No result" << "\n"; di << " No result\n";
} }
AppParCurves_MultiCurve AnMuC = Appr.Value(); AppParCurves_MultiCurve AnMuC = Appr.Value();
ThePoints = new (TColgp_HArray1OfPnt) (1, AnMuC.NbPoles() ); ThePoints = new (TColgp_HArray1OfPnt) (1, AnMuC.NbPoles() );
@ -696,7 +696,7 @@ static Standard_Integer smoothingbybezier (Draw_Interpretor& di,
Varia.SetTolerance(Abs(Tolerance)); Varia.SetTolerance(Abs(Tolerance));
Varia.Approximate(); Varia.Approximate();
if (! Varia.IsDone()) { if (! Varia.IsDone()) {
di << " No result" << "\n"; di << " No result\n";
} }
AppParCurves_MultiBSpCurve AnMuC = Varia.Value(); AppParCurves_MultiBSpCurve AnMuC = Varia.Value();

View File

@ -586,7 +586,7 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
Draw::Repaint(); Draw::Repaint();
} }
else { else {
di << "Not enought degree of freedom increase degree please" << "\n"; di << "Not enought degree of freedom increase degree please\n";
} }
return 0; return 0;
@ -617,7 +617,7 @@ static Standard_Integer cmovetangent (Draw_Interpretor& di, Standard_Integer n,
Draw::Repaint(); Draw::Repaint();
} }
else { else {
di << "Not enought degree of freedom increase degree please" << "\n"; di << "Not enought degree of freedom increase degree please\n";
} }
return 0; return 0;
@ -787,11 +787,11 @@ static Standard_Integer cremknot (Draw_Interpretor& di, Standard_Integer n, cons
if (!GBs.IsNull()) { if (!GBs.IsNull()) {
if (!GBs->RemoveKnot(index,mult,tol)) if (!GBs->RemoveKnot(index,mult,tol))
di << "Remove knots failed"<<"\n"; di << "Remove knots failed\n";
} }
else { else {
if (!GBs2d->RemoveKnot(index,mult,tol)) if (!GBs2d->RemoveKnot(index,mult,tol))
di << "Remove knots failed"<<"\n"; di << "Remove knots failed\n";
} }
Draw::Repaint(); Draw::Repaint();
@ -1368,7 +1368,7 @@ static Standard_Integer localprop(Draw_Interpretor& di,
} }
} }
else else
di <<"Tangent undefined."<<"\n"; di <<"Tangent undefined.\n";
} }
else { else {
Geom2dLProp_CLProps2d Prop (C2d,2,Precision::Confusion()); Geom2dLProp_CLProps2d Prop (C2d,2,Precision::Confusion());
@ -1395,7 +1395,7 @@ static Standard_Integer localprop(Draw_Interpretor& di,
} }
} }
else else
di <<"Tangent undefined."<<"\n"; di <<"Tangent undefined.\n";
} }
return 0; return 0;
} }
@ -1436,32 +1436,32 @@ static Standard_Integer rawcont(Draw_Interpretor& di, Standard_Integer n, const
Precision::Angular()) ; Precision::Angular()) ;
switch (cont) { switch (cont) {
case GeomAbs_C0: case GeomAbs_C0:
di << " C0 Continuity " << "\n" ; di << " C0 Continuity \n" ;
break ; break ;
case GeomAbs_G1: case GeomAbs_G1:
di << " G1 Continuity " << "\n" ; di << " G1 Continuity \n" ;
break ; break ;
case GeomAbs_C1 : case GeomAbs_C1 :
di << " C1 Continuity " << "\n" ; di << " C1 Continuity \n" ;
break ; break ;
case GeomAbs_G2 : case GeomAbs_G2 :
di << " G2 Continuity " << "\n" ; di << " G2 Continuity \n" ;
break ; break ;
case GeomAbs_C2 : case GeomAbs_C2 :
di << " C2 Continuity " << "\n" ; di << " C2 Continuity \n" ;
break ; break ;
case GeomAbs_C3 : case GeomAbs_C3 :
di << " C3 Continuity " << "\n" ; di << " C3 Continuity \n" ;
break ; break ;
case GeomAbs_CN : case GeomAbs_CN :
di << " CN Continuity " << "\n" ; di << " CN Continuity \n" ;
break ; break ;
default: default:
break ; break ;
} }
} }
else { else {
di << " not C0 continuity " << "\n" ; di << " not C0 continuity \n" ;
} }
return 0 ; return 0 ;
} }
@ -1507,7 +1507,7 @@ static Standard_Integer approxcurveonsurf(Draw_Interpretor& di, Standard_Integer
return 0; return 0;
} }
di << "Approximation failed !" << "\n"; di << "Approximation failed !\n";
return 1; return 1;
} }
@ -1699,7 +1699,7 @@ static Standard_Integer splitc1(Draw_Interpretor& di,
Standard_Real l = ACurve->LastParameter(); Standard_Real l = ACurve->LastParameter();
if ( Precision::IsInfinite(f) || Precision::IsInfinite(l)) { if ( Precision::IsInfinite(f) || Precision::IsInfinite(l)) {
di << " Error: Infinite curves" << "\n"; di << " Error: Infinite curves\n";
return 1; return 1;
} }
@ -1757,7 +1757,7 @@ static Standard_Integer splitc12d(Draw_Interpretor& di,
Standard_Real l = ACurve->LastParameter(); Standard_Real l = ACurve->LastParameter();
if ( Precision::IsInfinite(f) || Precision::IsInfinite(l)) { if ( Precision::IsInfinite(f) || Precision::IsInfinite(l)) {
di << " Error: Infinite curves" << "\n"; di << " Error: Infinite curves\n";
return 1; return 1;
} }
@ -1834,7 +1834,7 @@ static Standard_Integer length(Draw_Interpretor& di,
L = GCPnts_AbscissaPoint::Length(AC, Tol); L = GCPnts_AbscissaPoint::Length(AC, Tol);
} }
else { else {
di << a[1] << "is not a curve" << "\n"; di << a[1] << "is not a curve\n";
return 1; return 1;
} }

View File

@ -123,7 +123,7 @@ static Standard_Integer surface_radius (Draw_Interpretor& di,
di << "Min Radius of Curvature : " << radius << "\n"; di << "Min Radius of Curvature : " << radius << "\n";
} }
else { else {
di << "Min Radius of Curvature : infinite" << "\n"; di << "Min Radius of Curvature : infinite\n";
} }
radius = myProperties.MaxCurvature(); radius = myProperties.MaxCurvature();
@ -133,10 +133,10 @@ static Standard_Integer surface_radius (Draw_Interpretor& di,
di << "Max Radius of Curvature : " << radius << "\n"; di << "Max Radius of Curvature : " << radius << "\n";
} }
else else
di << "Min Radius of Curvature : infinite" << "\n"; di << "Min Radius of Curvature : infinite\n";
} }
else { else {
di << "Curvature not defined." << "\n"; di << "Curvature not defined.\n";
} }
} }
else { else {
@ -548,7 +548,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
Conv(S, U1, U2, V1, V2, Precision::PConfusion()); Conv(S, U1, U2, V1, V2, Precision::PConfusion());
NbU = Conv.NbUPatches(); NbU = Conv.NbUPatches();
NbV = Conv.NbVPatches(); NbV = Conv.NbVPatches();
di << NbU << " X " << NbV << " patches in the result" << "\n"; di << NbU << " X " << NbV << " patches in the result\n";
for (i = 1; i <= NbU; i++) { for (i = 1; i <= NbU; i++) {
for (j = 1; j <= NbV; j++) { for (j = 1; j <= NbV; j++) {
Sprintf(name,"%s_%i_%i",a[1],i,j); Sprintf(name,"%s_%i_%i",a[1],i,j);
@ -561,7 +561,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
GeomConvert_BSplineSurfaceToBezierSurface Conv(S); GeomConvert_BSplineSurfaceToBezierSurface Conv(S);
NbU = Conv.NbUPatches(); NbU = Conv.NbUPatches();
NbV = Conv.NbVPatches(); NbV = Conv.NbVPatches();
di << NbU << " X " << NbV << " patches in the result" << "\n"; di << NbU << " X " << NbV << " patches in the result\n";
for (i = 1; i <= NbU; i++) { for (i = 1; i <= NbU; i++) {
for (j = 1; j <= NbV; j++) { for (j = 1; j <= NbV; j++) {
Sprintf(name,"%s_%i_%i",a[1],i,j); Sprintf(name,"%s_%i_%i",a[1],i,j);
@ -579,7 +579,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2, GeomConvert_BSplineCurveToBezierCurve Conv(C3d, U1, U2,
Precision::PConfusion()); Precision::PConfusion());
NbArc = Conv.NbArcs(); NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n"; di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) { for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i); Sprintf(name,"%s_%i",a[1],i);
char *temp = name ; char *temp = name ;
@ -589,7 +589,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
else { else {
GeomConvert_BSplineCurveToBezierCurve Conv(C3d); GeomConvert_BSplineCurveToBezierCurve Conv(C3d);
NbArc = Conv.NbArcs(); NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n"; di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) { for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i); Sprintf(name,"%s_%i",a[1],i);
char *temp = name ; char *temp = name ;
@ -606,7 +606,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2, Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d, U1, U2,
Precision::PConfusion()); Precision::PConfusion());
NbArc = Conv.NbArcs(); NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n"; di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) { for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i); Sprintf(name,"%s_%i",a[1],i);
char *temp = name ; char *temp = name ;
@ -616,7 +616,7 @@ static Standard_Integer tobezier(Draw_Interpretor& di,
else { else {
Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d); Geom2dConvert_BSplineCurveToBezierCurve Conv(C2d);
NbArc = Conv.NbArcs(); NbArc = Conv.NbArcs();
di << NbArc << " arcs in the result" << "\n"; di << NbArc << " arcs in the result\n";
for (i = 1; i <= NbArc; i++) { for (i = 1; i <= NbArc; i++) {
Sprintf(name,"%s_%i",a[1],i); Sprintf(name,"%s_%i",a[1],i);
char *temp = name ; char *temp = name ;
@ -657,7 +657,7 @@ static Standard_Integer convbz(Draw_Interpretor& di,
BZ(ii,jj) = BZ(ii,jj) =
Handle(Geom_BezierSurface)::DownCast(DrawTrSurf::Get(a[kk])); Handle(Geom_BezierSurface)::DownCast(DrawTrSurf::Get(a[kk]));
if (BZ(ii,jj).IsNull()) { if (BZ(ii,jj).IsNull()) {
di << "the Surface " << kk <<"is not a BezierSurface" << "\n"; di << "the Surface " << kk <<"is not a BezierSurface\n";
return 1; return 1;
} }
kk++; kk++;
@ -667,7 +667,7 @@ static Standard_Integer convbz(Draw_Interpretor& di,
GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol); GeomConvert_CompBezierSurfacesToBSplineSurface Conv(BZ, Tol);
if (! Conv.IsDone()) { if (! Conv.IsDone()) {
di << "Convert Not Done" << "\n"; di << "Convert Not Done\n";
return 1; return 1;
} }
@ -688,7 +688,7 @@ static Standard_Integer convbz(Draw_Interpretor& di,
for (ii=1, kk=3; ii<=NbU; ii++,kk++) { for (ii=1, kk=3; ii<=NbU; ii++,kk++) {
BZ = Handle(Geom_BezierCurve)::DownCast(DrawTrSurf::Get(a[kk])); BZ = Handle(Geom_BezierCurve)::DownCast(DrawTrSurf::Get(a[kk]));
if (BZ.IsNull()) { if (BZ.IsNull()) {
di << "the curve " << kk <<"is not a BezierCurve" << "\n"; di << "the curve " << kk <<"is not a BezierCurve\n";
return 1; return 1;
} }
TColgp_Array1OfPnt Poles(1, BZ->NbPoles()); TColgp_Array1OfPnt Poles(1, BZ->NbPoles());
@ -1193,7 +1193,7 @@ static Standard_Integer rempole (Draw_Interpretor& di, Standard_Integer n, const
if ( !strcasecmp(a[0],"remrowpole")) { if ( !strcasecmp(a[0],"remrowpole")) {
if ( BSpline) { if ( BSpline) {
di << " Error : Cannot remove a polerow on a BSplineSurface " << "\n"; di << " Error : Cannot remove a polerow on a BSplineSurface \n";
} }
else { else {
GBz->RemovePoleRow(NewIndex); GBz->RemovePoleRow(NewIndex);
@ -1201,7 +1201,7 @@ static Standard_Integer rempole (Draw_Interpretor& di, Standard_Integer n, const
} }
else if ( !strcasecmp(a[0],"remcolpole")) { else if ( !strcasecmp(a[0],"remcolpole")) {
if ( BSpline) { if ( BSpline) {
di << " Error : Cannot remove a polecol on a BSplineSurface " << "\n"; di << " Error : Cannot remove a polecol on a BSplineSurface \n";
} }
else { else {
GBz->RemovePoleCol(NewIndex); GBz->RemovePoleCol(NewIndex);
@ -1458,7 +1458,7 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
{ {
// try to find parameters on a Surface // try to find parameters on a Surface
Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]); Handle(Geom_Surface) S = DrawTrSurf::GetSurface(a[1]);
if( S.IsNull() ) { di << "Unknown surface" << "\n"; return 1; } if( S.IsNull() ) { di << "Unknown surface\n"; return 1; }
gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])); gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.; Standard_Real Tol = Draw::Atof(a[5]), U = 0., V = 0.;
Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V); Standard_Boolean res = GeomLib_Tool::Parameters(S,P,Tol,U,V);
@ -1466,41 +1466,41 @@ static Standard_Integer parameters (Draw_Interpretor& di, Standard_Integer n, co
Draw::Set(a[6],U); Draw::Set(a[6],U);
Draw::Set(a[7],V); Draw::Set(a[7],V);
if( !res ) { di << "Wrong point" << "\n"; return 1; } if( !res ) { di << "Wrong point\n"; return 1; }
} }
else if(n == 7) else if(n == 7)
{ {
// try to find parameters on a 3d Curve // try to find parameters on a 3d Curve
Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]); Handle(Geom_Curve) C = DrawTrSurf::GetCurve(a[1]);
if( C.IsNull() ) { di << "Unknown curve" << "\n"; return 1; } if( C.IsNull() ) { di << "Unknown curve\n"; return 1; }
gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])); gp_Pnt P(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4]));
Standard_Real Tol = Draw::Atof(a[5]), U = 0.; Standard_Real Tol = Draw::Atof(a[5]), U = 0.;
Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U); Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
Draw::Set(a[6],U); Draw::Set(a[6],U);
if( !res ) { di << "Wrong point" << "\n"; return 1; } if( !res ) { di << "Wrong point\n"; return 1; }
} }
else if(n == 6) else if(n == 6)
{ {
// try to find parameters on a 2d Curve // try to find parameters on a 2d Curve
Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]); Handle(Geom2d_Curve) C = DrawTrSurf::GetCurve2d(a[1]);
if( C.IsNull() ) { di << "Unknown curve 2d" << "\n"; return 1; } if( C.IsNull() ) { di << "Unknown curve 2d\n"; return 1; }
gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3])); gp_Pnt2d P(Draw::Atof(a[2]), Draw::Atof(a[3]));
Standard_Real Tol = Draw::Atof(a[4]), U = 0.; Standard_Real Tol = Draw::Atof(a[4]), U = 0.;
Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U); Standard_Boolean res = GeomLib_Tool::Parameter(C,P,Tol,U);
Draw::Set(a[5],U); Draw::Set(a[5],U);
if( !res ) { di << "Wrong point" << "\n"; return 1; } if( !res ) { di << "Wrong point\n"; return 1; }
} }
else else
{ {
di << "Invalid parameters!" << "\n"; di << "Invalid parameters!\n";
di << "Usage:" << "\n"; di << "Usage:\n";
di << "parameters Surf X Y Z Tol U V" << "\n"; di << "parameters Surf X Y Z Tol U V\n";
di << "parameters Curv X Y Z Tol U" << "\n"; di << "parameters Curv X Y Z Tol U\n";
di << "parameters Curv2d X Y Tol U" << "\n"; di << "parameters Curv2d X Y Tol U\n";
return 1; return 1;
} }

View File

@ -134,7 +134,7 @@ hout (Draw_Interpretor& di, Standard_Integer n, const char** a)
const char *name = a[2]; const char *name = a[2];
TopoDS_Shape S = DBRep::Get(name); TopoDS_Shape S = DBRep::Get(name);
if (S.IsNull()) { if (S.IsNull()) {
di << name << " is not a shape." << "\n"; di << name << " is not a shape.\n";
return 1; return 1;
} }
HLRTest::Set(a[1],S); HLRTest::Set(a[1],S);
@ -155,13 +155,13 @@ hfil (Draw_Interpretor& di, Standard_Integer n, const char** a)
const char *name1 = a[1]; const char *name1 = a[1];
Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name1); Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name1);
if (HS.IsNull()) { if (HS.IsNull()) {
di << name1 << " is not an OutLiner." << "\n"; di << name1 << " is not an OutLiner.\n";
return 1; return 1;
} }
const char *name2 = a[2]; const char *name2 = a[2];
HLRAlgo_Projector P; HLRAlgo_Projector P;
if (!HLRTest::GetProjector(name2,P)) { if (!HLRTest::GetProjector(name2,P)) {
di << name2 << " is not a projector." << "\n"; di << name2 << " is not a projector.\n";
return 1; return 1;
} }
BRepTopAdaptor_MapOfShapeTool MST; BRepTopAdaptor_MapOfShapeTool MST;
@ -182,7 +182,7 @@ sori (Draw_Interpretor& di, Standard_Integer n, const char** a)
const char *name2 = a[2]; const char *name2 = a[2];
Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name2); Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name2);
if (HS.IsNull()) { if (HS.IsNull()) {
di << name2 << " is not an OutLiner." << "\n"; di << name2 << " is not an OutLiner.\n";
return 1; return 1;
} }
DBRep::Set(name1,HS->OriginalShape()); DBRep::Set(name1,HS->OriginalShape());
@ -202,11 +202,11 @@ sout (Draw_Interpretor& di, Standard_Integer n, const char** a)
const char *name2 = a[2]; const char *name2 = a[2];
Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name2); Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name2);
if (HS.IsNull()) { if (HS.IsNull()) {
di << name2 << " is not an OutLiner." << "\n"; di << name2 << " is not an OutLiner.\n";
return 1; return 1;
} }
if (HS->OutLinedShape().IsNull()) { if (HS->OutLinedShape().IsNull()) {
di << name2 << " has no OutLinedShape." << "\n"; di << name2 << " has no OutLinedShape.\n";
return 1; return 1;
} }
DBRep::Set(name1,HS->OutLinedShape()); DBRep::Set(name1,HS->OutLinedShape());
@ -225,7 +225,7 @@ hloa (Draw_Interpretor& di, Standard_Integer n, const char** a)
const char *name1 = a[1]; const char *name1 = a[1];
Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name1); Handle(HLRTopoBRep_OutLiner) HS = HLRTest::GetOutLiner(name1);
if (HS.IsNull()) { if (HS.IsNull()) {
di << name1 << " is not an OutLiner." << "\n"; di << name1 << " is not an OutLiner.\n";
return 1; return 1;
} }
hider->Load(HS); hider->Load(HS);
@ -247,13 +247,13 @@ hrem (Draw_Interpretor& di, Standard_Integer n, const char** a)
if (HS.IsNull()) { if (HS.IsNull()) {
TopoDS_Shape S = DBRep::Get(name); TopoDS_Shape S = DBRep::Get(name);
if (S.IsNull()) { if (S.IsNull()) {
di << name << " is not an OutLiner and not a shape." << "\n"; di << name << " is not an OutLiner and not a shape.\n";
return 1; return 1;
} }
else { else {
index = hider->Index(S); index = hider->Index(S);
if (index == 0) { if (index == 0) {
di << name << " not loaded shape." << "\n"; di << name << " not loaded shape.\n";
return 1; return 1;
} }
} }
@ -261,18 +261,18 @@ hrem (Draw_Interpretor& di, Standard_Integer n, const char** a)
else { else {
index = hider->Index(HS->OriginalShape()); index = hider->Index(HS->OriginalShape());
if (index == 0) { if (index == 0) {
di << name << " not loaded outliner." << "\n"; di << name << " not loaded outliner.\n";
return 1; return 1;
} }
} }
hider->Remove(index); hider->Remove(index);
di << name << " removed" << "\n"; di << name << " removed\n";
} }
else { else {
while (hider->NbShapes() > 0) { while (hider->NbShapes() > 0) {
hider->Remove(1); hider->Remove(1);
} }
di << " all shapes removed" << "\n"; di << " all shapes removed\n";
} }
return 0; return 0;
} }
@ -289,7 +289,7 @@ sprj (Draw_Interpretor& di, Standard_Integer n, const char** a)
const char *name = a[1]; const char *name = a[1];
HLRAlgo_Projector P; HLRAlgo_Projector P;
if (!HLRTest::GetProjector(name,P)) { if (!HLRTest::GetProjector(name,P)) {
di << name << " is not a projector." << "\n"; di << name << " is not a projector.\n";
return 1; return 1;
} }
hider->Projector(P); hider->Projector(P);
@ -342,9 +342,9 @@ hdbg (Draw_Interpretor& di, Standard_Integer, const char**)
{ {
hider->Debug(!hider->Debug()); hider->Debug(!hider->Debug());
if (hider->Debug()) if (hider->Debug())
di << "debug" << "\n"; di << "debug\n";
else else
di << "no debug" << "\n"; di << "no debug\n";
return 0; return 0;
} }

View File

@ -1436,7 +1436,7 @@ Handle(TColStd_HSequenceOfTransient) IFSelect_WorkSession::SelectionResult
} }
// if (ItemIdent(sel) == 0) // if (ItemIdent(sel) == 0)
if (sel.IsNull()) if (sel.IsNull())
{ cout << " Selection : "<<" Unknown"<<endl; return res; } //cout<<Handle { cout << " Selection : Unknown"<<endl; return res; } //cout<<Handle
return EvalSelection (sel).Content(); return EvalSelection (sel).Content();
} }
@ -3162,7 +3162,7 @@ void IFSelect_WorkSession::DumpSelection
{ {
Handle(Message_Messenger) sout = Message::DefaultMessenger(); Handle(Message_Messenger) sout = Message::DefaultMessenger();
if (ItemIdent(sel) == 0) { if (ItemIdent(sel) == 0) {
sout << "Selection : "<<" Unknown"<<endl; //sout<<Handle sout << "Selection : Unknown"<<endl; //sout<<Handle
return; return;
} }
sout << " ********** Selection"; sout << " ********** Selection";
@ -3427,7 +3427,7 @@ void IFSelect_WorkSession::DumpModel
S << " ******** Loaded File : "<<theloaded.ToCString()<<Interface_MSG::Blanks(32-theloaded.Length())<<" ********"<<endl; S << " ******** Loaded File : "<<theloaded.ToCString()<<Interface_MSG::Blanks(32-theloaded.Length())<<" ********"<<endl;
else S << " ******** No name for Loaded File"<<endl; else S << " ******** No name for Loaded File"<<endl;
if (level == 0) { if (level == 0) {
S<<" ******** Short Dump of Header ********"<<"\n"; S<<" ******** Short Dump of Header ********\n";
S << " *****************************************************************\n\n"; S << " *****************************************************************\n\n";
themodel->DumpHeader(S); S<<endl; themodel->DumpHeader(S); S<<endl;
} }
@ -3440,7 +3440,7 @@ void IFSelect_WorkSession::DumpModel
if (!shar.IsShared(themodel->Value(i))) nbr ++; if (!shar.IsShared(themodel->Value(i))) nbr ++;
} }
S << " *****************************************************************\n"; S << " *****************************************************************\n";
S << " ******** Model : "<<nbent<<" Entities, of which "<<nbr<<" Root(s)"<<"\n"; S << " ******** Model : "<<nbent<<" Entities, of which "<<nbr<<" Root(s)\n";
S << " *****************************************************************\n"<<endl; S << " *****************************************************************\n"<<endl;
if (level <= 0) return; if (level <= 0) return;
@ -3662,7 +3662,7 @@ void IFSelect_WorkSession::EvaluateSelection
if (!IsLoaded()) if (!IsLoaded())
{ sout<< " *** Data for Evaluation not available ***"<<endl; return; } { sout<< " *** Data for Evaluation not available ***"<<endl; return; }
if (ItemIdent(sel) == 0) if (ItemIdent(sel) == 0)
{ sout << " Selection : "<<" Unknown"<<endl; return; } //sout<<Handle { sout << " Selection : Unknown"<<endl; return; } //sout<<Handle
Interface_EntityIterator iter = EvalSelection (sel); Interface_EntityIterator iter = EvalSelection (sel);
ListEntities (iter,1); ListEntities (iter,1);
sout << "**** (Unique) RootResult, Selection : " sout << "**** (Unique) RootResult, Selection : "
@ -3701,9 +3701,9 @@ void IFSelect_WorkSession::EvaluateDispatch
if (!IsLoaded()) if (!IsLoaded())
{ sout<< " *** Data for List not available ***"<<endl; return; } { sout<< " *** Data for List not available ***"<<endl; return; }
if (theshareout->NbDispatches() < numdisp || numdisp <= 0) if (theshareout->NbDispatches() < numdisp || numdisp <= 0)
{ sout<<"Dispatch : "<<" Unknown"<<endl; return; } //sout<<Handle { sout<<"Dispatch : Unknown"<<endl; return; } //sout<<Handle
if (disp->FinalSelection().IsNull()) if (disp->FinalSelection().IsNull())
{ sout<<"Dispatch "<<" : No Final Selection"<<endl; return; }//sout<<Handle { sout<<"Dispatch : No Final Selection"<<endl; return; }//sout<<Handle
sout<<" --- Dispatch Label : "<<disp->Label()<<endl; sout<<" --- Dispatch Label : "<<disp->Label()<<endl;
IFSelect_ShareOutResult eval(disp,thegraph->Graph()); IFSelect_ShareOutResult eval(disp,thegraph->Graph());

View File

@ -137,7 +137,7 @@ void IGESAppli_ToolDrilledHole::OwnDump
S << "Finish diameter size : " << ent->FinishDiaSize() << endl; S << "Finish diameter size : " << ent->FinishDiaSize() << endl;
S << "Plating indication flag : "; S << "Plating indication flag : ";
if (!ent->IsPlating()) S << "NO" << " - "; if (!ent->IsPlating()) S << "NO" << " - ";
else S << "YES" << " - "; else S << "YES - ";
S << "Lower Numbered Layer : " << ent->NbLowerLayer() << " "; S << "Lower Numbered Layer : " << ent->NbLowerLayer() << " ";
S << "Higher Numbered Layer : " << ent->NbHigherLayer() << endl; S << "Higher Numbered Layer : " << ent->NbHigherLayer() << endl;
} }

View File

@ -97,9 +97,9 @@ IGESData_IGESDumper::IGESData_IGESDumper
S<<" ) ****"<<endl; S<<" ) ****"<<endl;
// **** Entity 1234:D2467 ** Type:102 Form:56 ** CompositeCurve ** // **** Entity 1234:D2467 ** Type:102 Form:56 ** CompositeCurve **
S<<"\n"<<"**** Entity "; PrintShort (ent,S); S<<endl; S<<"\n**** Entity "; PrintShort (ent,S); S<<endl;
S<<" Directory Part"<<"\n"; S<<" Directory Part\n";
// ** Status : Blank:1 Subordinate:2 UseFlag:3 Hierarchy:4 // ** Status : Blank:1 Subordinate:2 UseFlag:3 Hierarchy:4
if (own >= 2) if (own >= 2)
S <<"** Status Number : Blank:"<<ent->BlankStatus() S <<"** Status Number : Blank:"<<ent->BlankStatus()
@ -126,7 +126,7 @@ IGESData_IGESDumper::IGESData_IGESDumper
if (ent->HasStructure()) if (ent->HasStructure())
{ S<<"** Structure :"; PrintDNum (ent->Structure(),S); S<<"\n"; } { S<<"** Structure :"; PrintDNum (ent->Structure(),S); S<<"\n"; }
S<<"\n"<<" Graphic Attributes"<<"\n"; S<<"\n Graphic Attributes\n";
if (ent->DefLineFont() == IGESData_DefValue) if (ent->DefLineFont() == IGESData_DefValue)
{ S<<"** LineFont Value:"<<ent->RankLineFont()<<"\n"; } { S<<"** LineFont Value:"<<ent->RankLineFont()<<"\n"; }
else if (ent->DefLineFont() == IGESData_DefReference) else if (ent->DefLineFont() == IGESData_DefReference)
@ -150,7 +150,7 @@ IGESData_IGESDumper::IGESData_IGESDumper
S<<endl; S<<endl;
if (own > 3) { if (own > 3) {
S<<"**** Own Data ****"<<"\n\n"; S<<"**** Own Data ****\n\n";
OwnDump(ent,S,own); OwnDump(ent,S,own);
} }
} }
@ -161,7 +161,7 @@ IGESData_IGESDumper::IGESData_IGESDumper
Standard_Integer nb = iter.NbEntities(); Standard_Integer nb = iter.NbEntities();
Standard_Boolean iasuit = (nb > 0); Standard_Boolean iasuit = (nb > 0);
if (nb > 0) { if (nb > 0) {
S<<"\n"<<"**** Properties (nb:"<<nb<<") ****"<<"\n"; S<<"\n**** Properties (nb:"<<nb<<") ****\n";
for (;iter.More(); iter.Next()) { for (;iter.More(); iter.Next()) {
DeclareAndCast(IGESData_IGESEntity,ent2,iter.Value()); DeclareAndCast(IGESData_IGESEntity,ent2,iter.Value());
Dump (ent2,S,att,-1); Dump (ent2,S,att,-1);
@ -171,14 +171,14 @@ IGESData_IGESDumper::IGESData_IGESDumper
nb = iter.NbEntities(); nb = iter.NbEntities();
if (nb > 0) iasuit = Standard_True; if (nb > 0) iasuit = Standard_True;
if (nb > 0) { if (nb > 0) {
S<<"\n"<<"**** Associativities (nb:"<<nb<<") ****"<<"\n"; S<<"\n**** Associativities (nb:"<<nb<<") ****\n";
for (;iter.More(); iter.Next()) { for (;iter.More(); iter.Next()) {
DeclareAndCast(IGESData_IGESEntity,ent2,iter.Value()); DeclareAndCast(IGESData_IGESEntity,ent2,iter.Value());
Dump(ent2,S,att,-1); Dump(ent2,S,att,-1);
} }
} }
if (iasuit) { if (att <= 1) S << "\n"; } if (iasuit) { if (att <= 1) S << "\n"; }
S<<"\n"<<"**** End of Dump ****"<<"\n"<<endl; S<<"\n**** End of Dump ****\n"<<endl;
} }

View File

@ -78,11 +78,11 @@ void IGESData_IGESModel::DumpHeader
Standard_Integer ns = thestart->Length(); Standard_Integer ns = thestart->Length();
S<<"**** Dump of IGES Model , Start and Global Sections ****"<<endl; S<<"**** Dump of IGES Model , Start and Global Sections ****"<<endl;
if (ns > 0) { if (ns > 0) {
S << "**** Start Section : "<<ns<<" Line(s) ****"<<"\n"; S << "**** Start Section : "<<ns<<" Line(s) ****\n";
for (Standard_Integer i = 1; i <= ns; i ++) for (Standard_Integer i = 1; i <= ns; i ++)
S<<"["<<(i<10 ? " ": "")<<i<<"]:"<<thestart->Value(i)->ToCString()<<endl; S<<"["<<(i<10 ? " ": "")<<i<<"]:"<<thestart->Value(i)->ToCString()<<endl;
} }
S << "\n"<<"**** Global Section ****"<<"\n"; S << "\n**** Global Section ****\n";
char sep = theheader.Separator(); char sep = theheader.Separator();
if (sep == ',') S << "[ 1] Default Separator : " << sep; if (sep == ',') S << "[ 1] Default Separator : " << sep;
else S << "[ 1] Non Default Separator : " << sep; else S << "[ 1] Non Default Separator : " << sep;
@ -128,7 +128,7 @@ void IGESData_IGESModel::DumpHeader
S << "[19] Resolution : " << theheader.Resolution()<<"\n"; S << "[19] Resolution : " << theheader.Resolution()<<"\n";
if (theheader.HasMaxCoord()) if (theheader.HasMaxCoord())
S<<"[20] Maximum Coord : " << theheader.MaxCoord() << "\n\n"; S<<"[20] Maximum Coord : " << theheader.MaxCoord() << "\n\n";
else S<<"[20] Maximum Coord not defined"<<"\n\n"; else S<<"[20] Maximum Coord not defined\n\n";
str = theheader.AuthorName(); str = theheader.AuthorName();
if (!str.IsNull()) S<<"[21] Author : "<<str->ToCString()<<"\n"; if (!str.IsNull()) S<<"[21] Author : "<<str->ToCString()<<"\n";
@ -139,7 +139,7 @@ void IGESData_IGESModel::DumpHeader
<< IGESData_BasicEditor::IGESVersionName(num); << IGESData_BasicEditor::IGESVersionName(num);
num = theheader.DraftingStandard(); num = theheader.DraftingStandard();
S << "\n"<<"[24] Drafting Standard : " << num; S << "\n[24] Drafting Standard : " << num;
if (num > 0) S<< " -> Name : " << IGESData_BasicEditor::DraftingName(num); if (num > 0) S<< " -> Name : " << IGESData_BasicEditor::DraftingName(num);
S<<endl; S<<endl;

View File

@ -266,7 +266,7 @@ void IGESDefs_ToolGenericData::OwnDump
{ {
case 4: case 4:
S << "Types : " << endl; S << "Types : " << endl;
S << "Values : " << "Count = " << ent->NbTypeValuePairs() << endl; S << "Values : Count = " << ent->NbTypeValuePairs() << endl;
S << " [ as level > 4 for content ]" << endl; S << " [ as level > 4 for content ]" << endl;
break; break;
case 5: case 5:

View File

@ -420,7 +420,7 @@ void IGESGeom_ToolBSplineCurve::OwnDump(const Handle(IGESGeom_BSplineCurve)& ent
S << endl << "Control Points (Poles) : "; S << endl << "Control Points (Poles) : ";
IGESData_DumpListXYZL(S ,level,0, upind, ent->Pole, ent->Location()); IGESData_DumpListXYZL(S ,level,0, upind, ent->Pole, ent->Location());
S << endl << "Starting Parameter Value : " << ent->UMin(); S << endl << "Starting Parameter Value : " << ent->UMin();
S << " " << "Ending Parameter Value : " << ent->UMax() << endl; S << " Ending Parameter Value : " << ent->UMax() << endl;
S << "Unit Normal : "; S << "Unit Normal : ";
IGESData_DumpXYZL(S,level, ent->Normal(), ent->Location()); IGESData_DumpXYZL(S,level, ent->Normal(), ent->Location());
S << endl; S << endl;

View File

@ -336,7 +336,7 @@ void IGESGeom_ToolSplineSurface::OwnDump
else S << " (Unspecified)"; else S << " (Unspecified)";
S << endl; S << endl;
S << "Number Of Segments. In U : " S << "Number Of Segments. In U : "
<< nbUSegs << " " << " In V : " << nbVSegs << endl; << nbUSegs << " In V : " << nbVSegs << endl;
S << "The U Break Points : "; S << "The U Break Points : ";
IGESData_DumpVals(S ,level,1, nbUSegs+1,ent->UBreakPoint); IGESData_DumpVals(S ,level,1, nbUSegs+1,ent->UBreakPoint);
S <<endl<< "The V Break Points : "; S <<endl<< "The V Break Points : ";

View File

@ -413,7 +413,7 @@ AffPosition(T2,PParamOnSecond," Point 2 ");
#if 0 #if 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define Debug(q) cout<<"IntRes2d_Intersection"<<"q ="<<q<<endl; #define Debug(q) cout<<"IntRes2d_Intersectionq ="<<q<<endl;
char *DebugPos(const IntRes2d_Position P); char *DebugPos(const IntRes2d_Position P);

View File

@ -277,7 +277,7 @@ static Standard_Integer fastdiscret(Draw_Interpretor& di, Standard_Integer nbarg
//if (nbarg > 4) NbIterations = Draw::Atoi(argv[4]); //if (nbarg > 4) NbIterations = Draw::Atoi(argv[4]);
//MESH.NbIterations() = NbIterations; //MESH.NbIterations() = NbIterations;
di<<"Starting FastDiscret with :"<<"\n"; di<<"Starting FastDiscret with :\n";
di<<" Deflection="<<d<<"\n"; di<<" Deflection="<<d<<"\n";
di<<" Angle="<<0.5<<"\n"; di<<" Angle="<<0.5<<"\n";
@ -349,7 +349,7 @@ static Standard_Integer fastdiscret(Draw_Interpretor& di, Standard_Integer nbarg
DBRep::Set(name,aCompViolating); DBRep::Set(name,aCompViolating);
} }
di<<"FastDiscret completed with :"<<"\n"; di<<"FastDiscret completed with :\n";
di<<" MaxDeflection="<<maxdef<<"\n"; di<<" MaxDeflection="<<maxdef<<"\n";
di<<" NbNodes="<<nbnodes<<"\n"; di<<" NbNodes="<<nbnodes<<"\n";
di<<" NbTriangles="<<nbtriangles<<"\n"; di<<" NbTriangles="<<nbtriangles<<"\n";
@ -459,7 +459,7 @@ static Standard_Integer triangule(Draw_Interpretor& di, Standard_Integer nbarg,
Standard_Real aDeflection = Draw::Atof(argv[3]); Standard_Real aDeflection = Draw::Atof(argv[3]);
if (aDeflection <= 0.) if (aDeflection <= 0.)
{ {
di << " Incorrect value of deflection!" << "\n"; di << " Incorrect value of deflection!\n";
return 1; return 1;
} }
@ -471,7 +471,7 @@ static Standard_Integer triangule(Draw_Interpretor& di, Standard_Integer nbarg,
Standard_Integer nbn, nbl, nbe; Standard_Integer nbn, nbl, nbe;
MeshStats(aShape, nbe, nbl, nbn); MeshStats(aShape, nbe, nbl, nbn);
di<<"(Resultat ("<<nbe<<" mailles) ("<<nbl<<" aretes) ("<<nbn<<" sommets))"<<"\n"; di<<"(Resultat ("<<nbe<<" mailles) ("<<nbl<<" aretes) ("<<nbn<<" sommets))\n";
// passe de verification du maillage. // passe de verification du maillage.
/*Standard_Integer nbc; /*Standard_Integer nbc;
@ -935,8 +935,8 @@ static Standard_Integer trianglesinfo(Draw_Interpretor& di, Standard_Integer n,
} }
di<<"\n"; di<<"\n";
di<<"This shape contains " <<nbtriangles<<" triangles."<<"\n"; di<<"This shape contains " <<nbtriangles<<" triangles.\n";
di<<" " <<nbnodes <<" nodes."<<"\n"; di<<" " <<nbnodes <<" nodes.\n";
di<<"Maximal deflection " <<MaxDeflection<<"\n"; di<<"Maximal deflection " <<MaxDeflection<<"\n";
di<<"\n"; di<<"\n";
#ifdef OCCT_DEBUG_MESH_CHRONO #ifdef OCCT_DEBUG_MESH_CHRONO
@ -953,26 +953,26 @@ static Standard_Integer trianglesinfo(Draw_Interpretor& di, Standard_Integer n,
chPointValid.Show(pointvalid); chIsos.Show(isos); chPointsOnIsos.Show(pointsisos); chPointValid.Show(pointvalid); chIsos.Show(isos); chPointsOnIsos.Show(pointsisos);
if (tot > 0.00001) { if (tot > 0.00001) {
di <<"temps total de maillage: "<<tot <<" seconds"<< "\n"; di <<"temps total de maillage: "<<tot <<" seconds\n";
di <<"dont: "<< "\n"; di <<"dont: \n";
di <<"discretisation des edges: "<<edges <<" seconds---> "<< 100*edges/tot <<" %"<<"\n"; di <<"discretisation des edges: "<<edges <<" seconds---> "<< 100*edges/tot <<" %\n";
di <<"maillage des edges: "<<mailledges <<" seconds---> "<< 100*mailledges/tot <<" %"<<"\n"; di <<"maillage des edges: "<<mailledges <<" seconds---> "<< 100*mailledges/tot <<" %\n";
di <<"controle et points internes: "<<etuinter <<" seconds---> "<< 100*etuinter/tot <<" %"<<"\n"; di <<"controle et points internes: "<<etuinter <<" seconds---> "<< 100*etuinter/tot <<" %\n";
di <<"derniers controles: "<<lastcontrol<<" seconds---> "<< 100*lastcontrol/tot<<" %"<<"\n"; di <<"derniers controles: "<<lastcontrol<<" seconds---> "<< 100*lastcontrol/tot<<" %\n";
di <<"stockage dans la S.D. "<<stock <<" seconds---> "<< 100*stock/tot <<" %"<<"\n"; di <<"stockage dans la S.D. "<<stock <<" seconds---> "<< 100*stock/tot <<" %\n";
di << "\n"; di << "\n";
di <<"et plus precisement: "<<"\n"; di <<"et plus precisement: \n";
di <<"Add 11ere partie : "<<add11 <<" seconds---> "<<100*add11/tot <<" %"<<"\n"; di <<"Add 11ere partie : "<<add11 <<" seconds---> "<<100*add11/tot <<" %\n";
di <<"Add 12ere partie : "<<add12 <<" seconds---> "<<100*add12/tot <<" %"<<"\n"; di <<"Add 12ere partie : "<<add12 <<" seconds---> "<<100*add12/tot <<" %\n";
di <<"Add 2eme partie : "<<add2 <<" seconds---> "<<100*add2/tot <<" %"<<"\n"; di <<"Add 2eme partie : "<<add2 <<" seconds---> "<<100*add2/tot <<" %\n";
di <<"Update : "<<upda <<" seconds---> "<<100*upda/tot <<" %"<<"\n"; di <<"Update : "<<upda <<" seconds---> "<<100*upda/tot <<" %\n";
di <<"AddPoint : "<<addp <<" seconds---> "<<100*addp/tot <<" %"<<"\n"; di <<"AddPoint : "<<addp <<" seconds---> "<<100*addp/tot <<" %\n";
di <<"UniformDeflection "<<unif <<" seconds---> "<<100*unif/tot <<" %"<<"\n"; di <<"UniformDeflection "<<unif <<" seconds---> "<<100*unif/tot <<" %\n";
di <<"Controle : "<<contr <<" seconds---> "<<100*contr/tot <<" %"<<"\n"; di <<"Controle : "<<contr <<" seconds---> "<<100*contr/tot <<" %\n";
di <<"Points Internes: "<<inter <<" seconds---> "<<100*inter/tot <<" %"<<"\n"; di <<"Points Internes: "<<inter <<" seconds---> "<<100*inter/tot <<" %\n";
di <<"calcul des isos et du, dv: "<<isos <<" seconds---> "<<100*isos/tot <<" %"<<"\n"; di <<"calcul des isos et du, dv: "<<isos <<" seconds---> "<<100*isos/tot <<" %\n";
di <<"calcul des points sur isos: "<<pointsisos<<" seconds---> "<<100*pointsisos/tot <<" %"<<"\n"; di <<"calcul des points sur isos: "<<pointsisos<<" seconds---> "<<100*pointsisos/tot <<" %\n";
di <<"IsPointValid: "<<pointvalid<<" seconds---> "<<100*pointvalid/tot <<" %"<<"\n"; di <<"IsPointValid: "<<pointvalid<<" seconds---> "<<100*pointvalid/tot <<" %\n";
di << "\n"; di << "\n";
@ -1126,7 +1126,7 @@ static Standard_Integer veriftriangles(Draw_Interpretor& di, Standard_Integer n,
deflemin = Min(deflemin, defle); deflemin = Min(deflemin, defle);
if (defle > defstock) { if (defle > defstock) {
di <<"face "<< nbface <<" deflection = " << defle <<" pour "<<defstock <<" stockee."<<"\n"; di <<"face "<< nbface <<" deflection = " << defle <<" pour "<<defstock <<" stockee.\n";
} }
} }
} }
@ -1469,7 +1469,7 @@ Standard_Integer vb(Draw_Interpretor& di, Standard_Integer nbarg, const char** a
di<< VB(i, j) << ", "; di<< VB(i, j) << ", ";
} }
} }
di << "\n" << "\n"; di << "\n\n";
} }
} }
return 0; return 0;

View File

@ -118,7 +118,7 @@ void MeshTest_CheckTopology::Perform (Draw_Interpretor& di)
TopLoc_Location aLoc; TopLoc_Location aLoc;
Handle(Poly_Triangulation) aT = BRep_Tool::Triangulation(aFace, aLoc); Handle(Poly_Triangulation) aT = BRep_Tool::Triangulation(aFace, aLoc);
if (aT.IsNull()) { if (aT.IsNull()) {
di << "face " <<iF <<" has no triangulation" << "\n"; di << "face " <<iF <<" has no triangulation\n";
continue; continue;
} }

View File

@ -395,7 +395,7 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a)
// dump info on cross face errors // dump info on cross face errors
Standard_Integer nbErr = aCheck.NbCrossFaceErrors(); Standard_Integer nbErr = aCheck.NbCrossFaceErrors();
if (nbErr > 0) { if (nbErr > 0) {
di << "cross face errors: {face1, node1, face2, node2, distance}" << "\n"; di << "cross face errors: {face1, node1, face2, node2, distance}\n";
for (i=1; i <= nbErr; i++) { for (i=1; i <= nbErr; i++) {
Standard_Integer iF1, n1, iF2, n2; Standard_Integer iF1, n1, iF2, n2;
Standard_Real aVal; Standard_Real aVal;
@ -408,7 +408,7 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a)
// dump info on edges // dump info on edges
Standard_Integer nbAsync = aCheck.NbAsyncEdges(); Standard_Integer nbAsync = aCheck.NbAsyncEdges();
if (nbAsync > 0) { if (nbAsync > 0) {
di << "async edges:" << "\n"; di << "async edges:\n";
for (i=1; i <= nbAsync; i++) { for (i=1; i <= nbAsync; i++) {
Standard_Integer ie = aCheck.GetAsyncEdgeNum(i); Standard_Integer ie = aCheck.GetAsyncEdgeNum(i);
di << ie << " "; di << ie << " ";
@ -419,7 +419,7 @@ static Standard_Integer tricheck (Draw_Interpretor& di, int n, const char ** a)
// dump info on free nodes // dump info on free nodes
Standard_Integer nbFreeNodes = aCheck.NbFreeNodes(); Standard_Integer nbFreeNodes = aCheck.NbFreeNodes();
if (nbFreeNodes > 0) { if (nbFreeNodes > 0) {
di << "free nodes (in pairs: face / node): " << "\n"; di << "free nodes (in pairs: face / node): \n";
for (i=1; i <= nbFreeNodes; i++) { for (i=1; i <= nbFreeNodes; i++) {
Standard_Integer iface, inode; Standard_Integer iface, inode;
aCheck.GetFreeNodeNum(i, iface, inode); aCheck.GetFreeNodeNum(i, iface, inode);

View File

@ -45,7 +45,7 @@ class TCollection_HExtendedString;
//! with previous versions). //! with previous versions).
//! //!
//! User fills the parameter fields in the text of the message by //! User fills the parameter fields in the text of the message by
//! calling corresponding methods Arg() or operators "<<". //! calling corresponding methods Arg() or operators .
//! //!
//! The resulting message, filled with all parameters, can be obtained //! The resulting message, filled with all parameters, can be obtained
//! by method Get(). If some parameters were not filled, the text //! by method Get(). If some parameters were not filled, the text

View File

@ -70,12 +70,12 @@ static Standard_Integer OCC328bug (Draw_Interpretor& di, Standard_Integer argc,
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }
if ( argc != 3) { if ( argc != 3) {
di << "ERROR : Usage : " << argv[0] << " shape mode" << "\n"; di << "ERROR : Usage : " << argv[0] << " shape mode\n";
return 1; return 1;
} }
@ -102,7 +102,7 @@ static Standard_Integer OCC328bug (Draw_Interpretor& di, Standard_Integer argc,
ChoosingMode = 7; ChoosingMode = 7;
} }
if ( ChoosingMode == -1 ) { if ( ChoosingMode == -1 ) {
di << "ERROR : " << argv[1] << " : vrong value of a mode" << "\n"; di << "ERROR : " << argv[1] << " : vrong value of a mode\n";
return 1; return 1;
} }
@ -114,12 +114,12 @@ static Standard_Integer OCC328bug (Draw_Interpretor& di, Standard_Integer argc,
Handle(AIS_InteractiveObject) AISObj; Handle(AIS_InteractiveObject) AISObj;
if(!aMap.IsBound2(aName)) { if(!aMap.IsBound2(aName)) {
di << "Use 'vdisplay' before" << "\n"; di << "Use 'vdisplay' before\n";
return 1; return 1;
} else { } else {
AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName)); AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName));
if(AISObj.IsNull()){ if(AISObj.IsNull()){
di << argv[1] << " : No interactive object" << "\n"; di << argv[1] << " : No interactive object\n";
return 1; return 1;
} }
@ -182,7 +182,7 @@ static Standard_Integer OCC328bug (Draw_Interpretor& di, Standard_Integer argc,
static Standard_Integer OCC159bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC159bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 2) { if ( argc != 2) {
di << "ERROR : Usage : " << argv[0] << " Doc" << "\n"; di << "ERROR : Usage : " << argv[0] << " Doc\n";
return 1; return 1;
} }
@ -197,9 +197,9 @@ static Standard_Integer OCC159bug (Draw_Interpretor& di, Standard_Integer argc,
Handle(TDocStd_Document) OwnerD1 = Owner->GetDocument(); Handle(TDocStd_Document) OwnerD1 = Owner->GetDocument();
if (OwnerD1.IsNull()) { if (OwnerD1.IsNull()) {
di << "DocOwner1 = NULL" << "\n"; di << "DocOwner1 = NULL\n";
} else { } else {
di << "DocOwner1 = NOTNULL" << "\n"; di << "DocOwner1 = NOTNULL\n";
} }
Handle(TDocStd_Application) A; Handle(TDocStd_Application) A;
@ -211,9 +211,9 @@ static Standard_Integer OCC159bug (Draw_Interpretor& di, Standard_Integer argc,
Handle(TDocStd_Document) OwnerD2 = Owner->GetDocument(); Handle(TDocStd_Document) OwnerD2 = Owner->GetDocument();
if (OwnerD2.IsNull()) { if (OwnerD2.IsNull()) {
di << "DocOwner2 = NULL" << "\n"; di << "DocOwner2 = NULL\n";
} else { } else {
di << "DocOwner2 = NOTNULL" << "\n"; di << "DocOwner2 = NOTNULL\n";
} }
Standard_Integer DocRefCount2 = D->GetRefCount(); Standard_Integer DocRefCount2 = D->GetRefCount();
@ -225,7 +225,7 @@ static Standard_Integer OCC159bug (Draw_Interpretor& di, Standard_Integer argc,
static Standard_Integer OCC145bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC145bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 3) { if ( argc != 3) {
di << "ERROR : Usage : " << argv[0] << " Shape MaxNbr" << "\n"; di << "ERROR : Usage : " << argv[0] << " Shape MaxNbr\n";
return 1; return 1;
} }
@ -236,7 +236,7 @@ static Standard_Integer OCC145bug (Draw_Interpretor& di, Standard_Integer argc,
TopoDS_Shape aShape; TopoDS_Shape aShape;
if (!BRepTools::Read(aShape, aFileName.ToCString(), aBld)) { if (!BRepTools::Read(aShape, aFileName.ToCString(), aBld)) {
di << "ERROR :Could not read a shape!!!" << "\n"; di << "ERROR :Could not read a shape!!!\n";
return 1; return 1;
} }
@ -246,7 +246,7 @@ static Standard_Integer OCC145bug (Draw_Interpretor& di, Standard_Integer argc,
for (i = 1; i <= aMaxNbr; i++) { for (i = 1; i <= aMaxNbr; i++) {
BRepBuilderAPI_MakeFace aMF(aWire); BRepBuilderAPI_MakeFace aMF(aWire);
if (!aMF.IsDone()) { if (!aMF.IsDone()) {
di << "ERROR : Could not make a face" << "\n"; di << "ERROR : Could not make a face\n";
return 1; return 1;
} }
} }
@ -257,7 +257,7 @@ static Standard_Integer OCC145bug (Draw_Interpretor& di, Standard_Integer argc,
static Standard_Integer OCC73_SelectionMode (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC73_SelectionMode (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc < 3) { if ( argc < 3) {
di << "ERROR : Usage : " << argv[0] << " DOC entry [SelectionMode]" << "\n"; di << "ERROR : Usage : " << argv[0] << " DOC entry [SelectionMode]\n";
return 1; return 1;
} }
@ -299,13 +299,13 @@ static Standard_Integer OCC10bug (Draw_Interpretor& di, Standard_Integer argc, c
} }
if(argc != 4) { if(argc != 4) {
di << "Usage : " << argv[0] << " name plane Length" << "\n"; di << "Usage : " << argv[0] << " name plane Length\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get( argv[2] ); TopoDS_Shape S = DBRep::Get( argv[2] );
if ( S.IsNull() ) { if ( S.IsNull() ) {
di << "Shape is empty" << "\n"; di << "Shape is empty\n";
return 1; return 1;
} }
@ -378,9 +378,9 @@ static Standard_Integer OCC10bug (Draw_Interpretor& di, Standard_Integer argc, c
di << "getLength = " << getLength << "\n"; di << "getLength = " << getLength << "\n";
if (getLength == Length) { if (getLength == Length) {
di << "OCC10: OK" << "\n"; di << "OCC10: OK\n";
} else { } else {
di << "OCC10: ERROR" << "\n"; di << "OCC10: ERROR\n";
} }
return 0; return 0;
@ -390,12 +390,12 @@ static Standard_Integer OCC74bug_set (Draw_Interpretor& di, Standard_Integer arg
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }
if ( argc != 3) { if ( argc != 3) {
di << "ERROR : Usage : " << argv[0] << " shape mode; set selection mode" << "\n"; di << "ERROR : Usage : " << argv[0] << " shape mode; set selection mode\n";
return 1; return 1;
} }
@ -409,12 +409,12 @@ static Standard_Integer OCC74bug_set (Draw_Interpretor& di, Standard_Integer arg
Standard_Integer SelectMode = Draw::Atoi(argv[2]); Standard_Integer SelectMode = Draw::Atoi(argv[2]);
if(!aMap.IsBound2(aName)) { if(!aMap.IsBound2(aName)) {
di << "Use 'vdisplay' before" << "\n"; di << "Use 'vdisplay' before\n";
return 1; return 1;
} else { } else {
AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName)); AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName));
if(AISObj.IsNull()){ if(AISObj.IsNull()){
di << argv[1] << " : No interactive object" << "\n"; di << argv[1] << " : No interactive object\n";
return 1; return 1;
} }
if (!aContext->HasOpenedContext()) { if (!aContext->HasOpenedContext()) {
@ -434,12 +434,12 @@ static Standard_Integer OCC74bug_get (Draw_Interpretor& di, Standard_Integer arg
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }
if ( argc != 2) { if ( argc != 2) {
di << "ERROR : Usage : " << argv[0] << " shape; get selection mode" << "\n"; di << "ERROR : Usage : " << argv[0] << " shape; get selection mode\n";
return 1; return 1;
} }
@ -449,12 +449,12 @@ static Standard_Integer OCC74bug_get (Draw_Interpretor& di, Standard_Integer arg
Handle(AIS_InteractiveObject) AISObj; Handle(AIS_InteractiveObject) AISObj;
if(!aMap.IsBound2(aName)) { if(!aMap.IsBound2(aName)) {
di << "Use 'vdisplay' before" << "\n"; di << "Use 'vdisplay' before\n";
return 1; return 1;
} else { } else {
AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName)); AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName));
if(AISObj.IsNull()){ if(AISObj.IsNull()){
di << argv[1] << " : No interactive object" << "\n"; di << argv[1] << " : No interactive object\n";
return 1; return 1;
} }
TColStd_ListOfInteger anActivatedModes; TColStd_ListOfInteger anActivatedModes;
@ -475,14 +475,14 @@ static Standard_Integer OCC74bug_get (Draw_Interpretor& di, Standard_Integer arg
static Standard_Integer OCC361bug (Draw_Interpretor& di, Standard_Integer nb, const char ** a) static Standard_Integer OCC361bug (Draw_Interpretor& di, Standard_Integer nb, const char ** a)
{ {
if ( nb != 2) { if ( nb != 2) {
di << "ERROR : Usage : " << a[0] << " Doc" << "\n"; di << "ERROR : Usage : " << a[0] << " Doc\n";
di << "-1" << "\n"; di << "-1\n";
return -1; return -1;
} }
Handle(TDocStd_Document) D; Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(a[1],D)) { if (!DDocStd::GetDocument(a[1],D)) {
di << "-2" << "\n"; di << "-2\n";
return 1; return 1;
} }
@ -504,9 +504,9 @@ static Standard_Integer OCC361bug (Draw_Interpretor& di, Standard_Integer nb, co
aTBox = aBuilder2.NamedShape()->Get(); aTBox = aBuilder2.NamedShape()->Get();
if(aTBox.Orientation() != TopAbs_REVERSED) { if(aTBox.Orientation() != TopAbs_REVERSED) {
di << "1" << "\n"; di << "1\n";
} else { } else {
di << "0" << "\n"; di << "0\n";
} }
return 0; return 0;
} }

View File

@ -52,7 +52,7 @@
static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc < 7 || argc > 8) { if(argc < 7 || argc > 8) {
di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -61,7 +61,7 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -119,13 +119,13 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Shape fuse32, fuse321; TopoDS_Shape fuse32, fuse321;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)" <<"\n"; di << "fuse32 = BRepAlgoAPI_Fuse(rs3, rs2)\n";
di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)" <<"\n"; di << "fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1)\n";
fuse32 = BRepAlgoAPI_Fuse(rs3, rs2); fuse32 = BRepAlgoAPI_Fuse(rs3, rs2);
fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1); fuse321 = BRepAlgoAPI_Fuse(fuse32, rs1);
} else { } else {
di << "fuse32 = BRepAlgo_Fuse(rs3, rs2)" <<"\n"; di << "fuse32 = BRepAlgo_Fuse(rs3, rs2)\n";
di << "fuse321 = BRepAlgo_Fuse(fuse32, rs1)" <<"\n"; di << "fuse321 = BRepAlgo_Fuse(fuse32, rs1)\n";
fuse32 = BRepAlgo_Fuse(rs3, rs2); fuse32 = BRepAlgo_Fuse(rs3, rs2);
fuse321 = BRepAlgo_Fuse(fuse32, rs1); fuse321 = BRepAlgo_Fuse(fuse32, rs1);
} }
@ -133,10 +133,10 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
//Give the mass claculation of the shpae "fuse321" //Give the mass claculation of the shpae "fuse321"
GProp_GProps G; GProp_GProps G;
BRepGProp::VolumeProperties(fuse321, G); BRepGProp::VolumeProperties(fuse321, G);
di<<" "<<"\n"; di<<" \n";
di<<"Mass: "<<G.Mass()<<"\n"<<"\n"; di<<"Mass: "<<G.Mass()<<"\n\n";
di << "Trianglating Faces ....." <<"\n"; di << "Trianglating Faces .....\n";
TopExp_Explorer ExpFace; TopExp_Explorer ExpFace;
for (ExpFace.Init (fuse321,TopAbs_FACE); ExpFace.More(); ExpFace.Next()) for (ExpFace.Init (fuse321,TopAbs_FACE); ExpFace.More(); ExpFace.Next())
@ -148,27 +148,27 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con
Handle(Poly_Triangulation) facing = BRep_Tool::Triangulation(TopologicalFace, loc); Handle(Poly_Triangulation) facing = BRep_Tool::Triangulation(TopologicalFace, loc);
if (facing.IsNull()) if (facing.IsNull())
{ {
di << "Triangulation FAILED for this face" << "\n"; di << "Triangulation FAILED for this face\n";
continue; continue;
} }
di << "No of Triangles = " << facing->NbTriangles() << "\n"; di << "No of Triangles = " << facing->NbTriangles() << "\n";
} }
di<<"Triangulation of all Faces Completed. "<< "\n" << "\n"; di<<"Triangulation of all Faces Completed. \n\n";
TopTools_IndexedDataMapOfShapeListOfShape edgemap; TopTools_IndexedDataMapOfShapeListOfShape edgemap;
TopExp::MapShapesAndAncestors(fuse321, TopAbs_EDGE, TopAbs_SOLID, edgemap); TopExp::MapShapesAndAncestors(fuse321, TopAbs_EDGE, TopAbs_SOLID, edgemap);
di << "No. of Edges: " << edgemap.Extent() << "\n"; di << "No. of Edges: " << edgemap.Extent() << "\n";
ChFi3d_FilletShape FShape = ChFi3d_Rational; ChFi3d_FilletShape FShape = ChFi3d_Rational;
BRepFilletAPI_MakeFillet blend(fuse321,FShape); BRepFilletAPI_MakeFillet blend(fuse321,FShape);
di << "Adding Edges ..... " << "\n"; di << "Adding Edges ..... \n";
for(int i = 1; i <= edgemap.Extent(); i++) for(int i = 1; i <= edgemap.Extent(); i++)
{ {
// cout << "Adding Edge : " << i << endl; // cout << "Adding Edge : " << i << endl;
TopoDS_Edge edg = TopoDS::Edge( edgemap.FindKey(i) ); TopoDS_Edge edg = TopoDS::Edge( edgemap.FindKey(i) );
if(!edg.IsNull()) blend.Add(1, edg); if(!edg.IsNull()) blend.Add(1, edg);
} }
di << "All Edges added ! Now Building the Blend ... " << "\n"; di << "All Edges added ! Now Building the Blend ... \n";
di<<" "<<"\n"; di<<" \n";
blend.Build(); blend.Build();
//DBRep::Set ( argv[1], fuse321 ); //DBRep::Set ( argv[1], fuse321 );
@ -291,7 +291,7 @@ static Standard_Integer OCC486(Draw_Interpretor& di, Standard_Integer argc, cons
//======================================================================= //=======================================================================
static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if (argc != 3) { if (argc != 3) {
di << "Usage : " << argv[0] << " draftAngle slabThick" << "\n"; di << "Usage : " << argv[0] << " draftAngle slabThick\n";
return 1; return 1;
} }
//NOTE: Case:1 - draftAngle = 15, slabThick = 30 --> Fails //NOTE: Case:1 - draftAngle = 15, slabThick = 30 --> Fails
@ -332,7 +332,7 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con
if (!MW.IsDone()) if (!MW.IsDone())
{ {
di << "my Wire not done" << "\n"; di << "my Wire not done\n";
return 1; return 1;
} }
TopoDS_Wire W = MW.Wire(); TopoDS_Wire W = MW.Wire();
@ -340,7 +340,7 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Face F = BRepBuilderAPI_MakeFace(W); TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
if ( F.IsNull()) if ( F.IsNull())
{ {
di << " Error in Face creation " << "\n"; di << " Error in Face creation \n";
return 1; return 1;
} }
@ -358,7 +358,7 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con
BRepPrimAPI_MakePrism slab(F, slabVect, Standard_True); BRepPrimAPI_MakePrism slab(F, slabVect, Standard_True);
if ( ! slab.IsDone() ) if ( ! slab.IsDone() )
{ {
di << " Error in Slab creation " << "\n"; di << " Error in Slab creation \n";
return 1; return 1;
} }
@ -379,17 +379,17 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con
draftSlab.Add(aFace, slabDir, angle, slabPln); draftSlab.Add(aFace, slabDir, angle, slabPln);
if (!draftSlab.AddDone()) if (!draftSlab.AddDone())
{ {
di << " Error in Add " << "\n"; di << " Error in Add \n";
return 1; return 1;
} }
} }
di << "All Faces added. Building... " << "\n"; //cout.flush(); di << "All Faces added. Building... \n"; //cout.flush();
draftSlab.Build(); draftSlab.Build();
di << "Build done..." << "\n"; //cout.flush(); di << "Build done...\n"; //cout.flush();
if (!draftSlab.IsDone()) //--------------> STEP:1 if (!draftSlab.IsDone()) //--------------> STEP:1
{ {
di << " Error in Build " << "\n"; di << " Error in Build \n";
return 1; return 1;
} }
slabShape = draftSlab.Shape(); slabShape = draftSlab.Shape();
@ -398,7 +398,7 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con
} }
catch ( Standard_Failure ) //--------------------> STEP:2 catch ( Standard_Failure ) //--------------------> STEP:2
{ {
di << " Error in Draft Slab " << "\n"; di << " Error in Draft Slab \n";
return 1; return 1;
} }
return 0; return 0;
@ -426,20 +426,20 @@ Standard_Integer performTriangulation (TopoDS_Shape aShape, Draw_Interpretor& di
if (facing.IsNull()) if (facing.IsNull())
{ {
failed++; failed++;
di << "******************** FAILED during Triangulation " << "\n"; di << "******************** FAILED during Triangulation \n";
} }
else else
{ {
di << facing->NbTriangles() << " Triangles" <<"\n"; di << facing->NbTriangles() << " Triangles\n";
} }
} }
di<<"Triangulation of all Faces Completed: "<<"\n"<<"\n"; di<<"Triangulation of all Faces Completed: \n\n";
if (failed == 0) return 1; if (failed == 0) return 1;
di<<"***************************************************"<<"\n"; di<<"***************************************************\n";
di<<"******* ********"<<"\n"; di<<"******* ********\n";
di<<"***** Triangulation FAILED for " << failed << " of " << total << " Faces ******"<<"\n"; di<<"***** Triangulation FAILED for " << failed << " of " << total << " Faces ******\n";
di<<"******* ********"<<"\n"; di<<"******* ********\n";
di<<"***************************************************"<<"\n"; di<<"***************************************************\n";
return 0; return 0;
} }
@ -454,7 +454,7 @@ Standard_Integer performTriangulation (TopoDS_Shape aShape, Draw_Interpretor& di
static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc < 4 || argc > 5) { if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -463,11 +463,11 @@ static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, c
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
#if ! defined(BRepAlgo_def02) #if ! defined(BRepAlgo_def02)
// di << "Error: There is not BRepAlgo_Cut class" << "\n"; // di << "Error: There is not BRepAlgo_Cut class\n";
// return 1; // return 1;
#endif #endif
} }
@ -493,42 +493,42 @@ static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, c
TopoDS_Shape conIn = conMakerIn.Shape(); TopoDS_Shape conIn = conMakerIn.Shape();
TopoDS_Shape conOut = conMakerOut.Shape(); TopoDS_Shape conOut = conMakerOut.Shape();
di << "All primitives created..... Creating Boolean" << "\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape theIn, theOut, theRes; TopoDS_Shape theIn, theOut, theRes;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)" <<"\n"; di << "theIn = BRepAlgoAPI_Fuse(cylIn, conIn)\n";
di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)" <<"\n"; di << "theOut = BRepAlgoAPI_Fuse(cylOut, conOut)\n";
di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)" <<"\n"; di << "theRes = BRepAlgoAPI_Cut(theOut, theIn)\n";
theIn = BRepAlgoAPI_Fuse(cylIn, conIn); theIn = BRepAlgoAPI_Fuse(cylIn, conIn);
theOut = BRepAlgoAPI_Fuse(cylOut, conOut); theOut = BRepAlgoAPI_Fuse(cylOut, conOut);
theRes = BRepAlgoAPI_Cut(theOut, theIn); theRes = BRepAlgoAPI_Cut(theOut, theIn);
} else { } else {
di << "theIn = BRepAlgo_Fuse(cylIn, conIn)" <<"\n"; di << "theIn = BRepAlgo_Fuse(cylIn, conIn)\n";
di << "theOut = BRepAlgo_Fuse(cylOut, conOut)" <<"\n"; di << "theOut = BRepAlgo_Fuse(cylOut, conOut)\n";
theIn = BRepAlgo_Fuse(cylIn, conIn); theIn = BRepAlgo_Fuse(cylIn, conIn);
theOut = BRepAlgo_Fuse(cylOut, conOut); theOut = BRepAlgo_Fuse(cylOut, conOut);
di << "theRes = BRepAlgo_Cut(theOut, theIn)" <<"\n"; di << "theRes = BRepAlgo_Cut(theOut, theIn)\n";
theRes = BRepAlgo_Cut(theOut, theIn); theRes = BRepAlgo_Cut(theOut, theIn);
} }
if (index < argc) DBRep::Set(argv[index++], theIn); if (index < argc) DBRep::Set(argv[index++], theIn);
if (index < argc) DBRep::Set(argv[index++], theOut); if (index < argc) DBRep::Set(argv[index++], theOut);
if (index < argc) DBRep::Set(argv[index++], theRes); if (index < argc) DBRep::Set(argv[index++], theRes);
di << "Booleans Created ! Triangulating !" <<"\n"; di << "Booleans Created ! Triangulating !\n";
performTriangulation(theRes, di); performTriangulation(theRes, di);
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in Shoe Function *****"<<"\n"; di<<"***** Standard_Failure : Exception in Shoe Function *****\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
@ -544,7 +544,7 @@ static Standard_Integer OCC822_1 (Draw_Interpretor& di, Standard_Integer argc, c
static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -553,7 +553,7 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -573,17 +573,17 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
TopoDS_Shape sph = sphereMaker.Shape(); TopoDS_Shape sph = sphereMaker.Shape();
if (index < argc) DBRep::Set(argv[index++], sph); if (index < argc) DBRep::Set(argv[index++], sph);
di << "All primitives created..... Creating Cut Objects" << "\n"; di << "All primitives created..... Creating Cut Objects\n";
TopoDS_Shape fuse; TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(box, sph)" <<"\n"; di << "fuse = BRepAlgoAPI_Fuse(box, sph)\n";
fuse = BRepAlgoAPI_Fuse(box, sph); fuse = BRepAlgoAPI_Fuse(box, sph);
} else { } else {
di << "fuse = BRepAlgo_Fuse(box, sph)" <<"\n"; di << "fuse = BRepAlgo_Fuse(box, sph)\n";
fuse = BRepAlgo_Fuse(box, sph); fuse = BRepAlgo_Fuse(box, sph);
} }
if (index < argc) DBRep::Set(argv[index++], fuse); if (index < argc) DBRep::Set(argv[index++], fuse);
@ -593,11 +593,11 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in HSP Function ******"<<"\n"; di<<"***** Standard_Failure : Exception in HSP Function ******\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
@ -611,7 +611,7 @@ static Standard_Integer OCC822_2 (Draw_Interpretor& di,Standard_Integer argc, co
static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -620,7 +620,7 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -642,31 +642,31 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons
TopoDS_Shape cyl2 = mkCyl2.Shape(); TopoDS_Shape cyl2 = mkCyl2.Shape();
if (index < argc) DBRep::Set(argv[index++], cyl2); if (index < argc) DBRep::Set(argv[index++], cyl2);
di << "All primitives created..... Creating Boolean" << "\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse; TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)" <<"\n"; di << "fuse = BRepAlgoAPI_Fuse(cyl2, cyl1)\n";
fuse = BRepAlgoAPI_Fuse(cyl2, cyl1); fuse = BRepAlgoAPI_Fuse(cyl2, cyl1);
} else { } else {
di << "fuse = BRepAlgo_Fuse(cyl2, cyl1)" <<"\n"; di << "fuse = BRepAlgo_Fuse(cyl2, cyl1)\n";
fuse = BRepAlgo_Fuse(cyl2, cyl1); fuse = BRepAlgo_Fuse(cyl2, cyl1);
} }
if (index < argc) DBRep::Set(argv[index++], fuse); if (index < argc) DBRep::Set(argv[index++], fuse);
di << "Fuse Created ! Triangulating !" <<"\n"; di << "Fuse Created ! Triangulating !\n";
performTriangulation(fuse, di); performTriangulation(fuse, di);
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in TEE Function ******"<<"\n"; di<<"***** Standard_Failure : Exception in TEE Function ******\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
@ -679,7 +679,7 @@ static Standard_Integer OCC823 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -688,7 +688,7 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -706,31 +706,31 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons
TopoDS_Shape sph = sphere.Shape(); TopoDS_Shape sph = sphere.Shape();
if (index < argc) DBRep::Set(argv[index++], sph); if (index < argc) DBRep::Set(argv[index++], sph);
di << "All primitives created..... Creating Boolean" << "\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse; TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)" <<"\n"; di << "fuse = BRepAlgoAPI_Fuse(cyl, sph)\n";
fuse = BRepAlgoAPI_Fuse(cyl, sph); fuse = BRepAlgoAPI_Fuse(cyl, sph);
} else { } else {
di << "fuse = BRepAlgo_Fuse(cyl, sph)" <<"\n"; di << "fuse = BRepAlgo_Fuse(cyl, sph)\n";
fuse = BRepAlgo_Fuse(cyl, sph); fuse = BRepAlgo_Fuse(cyl, sph);
} }
di << "Fuse Created ! Triangulating !" <<"\n"; di << "Fuse Created ! Triangulating !\n";
if (index < argc) DBRep::Set(argv[index++], fuse); if (index < argc) DBRep::Set(argv[index++], fuse);
performTriangulation(fuse, di); performTriangulation(fuse, di);
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in YOU Function ******"<<"\n"; di<<"***** Standard_Failure : Exception in YOU Function ******\n";
di<<"***** ******"<<"\n"; di<<"***** ******\n";
di<<"*********************************************************"<<"\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
@ -748,7 +748,7 @@ static Standard_Integer OCC824 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 6 || argc > 7) { if(argc < 6 || argc > 7) {
di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -757,7 +757,7 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def02) #if ! defined(BRepAlgo_def02)
// di << "Error: There is not BRepAlgo_Cut class" << "\n"; // di << "Error: There is not BRepAlgo_Cut class\n";
// return 1; // return 1;
#endif #endif
} }
@ -790,59 +790,59 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons
TopoDS_Shape sph2 = sphere2.Shape(); TopoDS_Shape sph2 = sphere2.Shape();
if (index < argc) DBRep::Set(argv[index++], sph2); if (index < argc) DBRep::Set(argv[index++], sph2);
di << "All primitives created..... Creating Cut Objects" << "\n"; di << "All primitives created..... Creating Cut Objects\n";
TopoDS_Shape cut1, cut2; TopoDS_Shape cut1, cut2;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)" << "\n"; di << "cut1 = BRepAlgoAPI_Cut(sph1, hsp)\n";
cut1 = BRepAlgoAPI_Cut(sph1, hsp); cut1 = BRepAlgoAPI_Cut(sph1, hsp);
} else { } else {
di << "cut1 = BRepAlgo_Cut(sph1, hsp)" << "\n"; di << "cut1 = BRepAlgo_Cut(sph1, hsp)\n";
cut1 = BRepAlgo_Cut(sph1, hsp); cut1 = BRepAlgo_Cut(sph1, hsp);
} }
if (index < argc) DBRep::Set(argv[index++], cut1); if (index < argc) DBRep::Set(argv[index++], cut1);
di << "CUT 1 Created ! " ; di << "CUT 1 Created ! " ;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)" << "\n"; di << "cut2 = BRepAlgoAPI_Cut(sph2, hsp)\n";
cut2 = BRepAlgoAPI_Cut(sph2, hsp); cut2 = BRepAlgoAPI_Cut(sph2, hsp);
} else { } else {
di << "cut2 = BRepAlgo_Cut(sph2, hsp)" << "\n"; di << "cut2 = BRepAlgo_Cut(sph2, hsp)\n";
cut2 = BRepAlgo_Cut(sph2, hsp); cut2 = BRepAlgo_Cut(sph2, hsp);
} }
if (index < argc) DBRep::Set(argv[index++], cut2); if (index < argc) DBRep::Set(argv[index++], cut2);
di << "CUT 2 Created !" << "\n" << "\n"; di << "CUT 2 Created !\n\n";
GProp_GProps G; GProp_GProps G;
BRepGProp::VolumeProperties(cut1, G); BRepGProp::VolumeProperties(cut1, G);
di<<"CUT 1 Mass = "<<G.Mass()<< "\n" << "\n"; di<<"CUT 1 Mass = "<<G.Mass()<< "\n\n";
BRepGProp::VolumeProperties(cut2, G); BRepGProp::VolumeProperties(cut2, G);
di<<"CUT 2 Mass = "<<G.Mass()<< "\n" << "\n"; di<<"CUT 2 Mass = "<<G.Mass()<< "\n\n";
di << "Trianglating Faces of CUT 1 ....." << "\n"; di << "Trianglating Faces of CUT 1 .....\n";
performTriangulation(cut1, di); performTriangulation(cut1, di);
di << "Trianglating Faces of CUT 2 ....." << "\n"; di << "Trianglating Faces of CUT 2 .....\n";
performTriangulation(cut2, di); performTriangulation(cut2, di);
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<< "\n"; di<<"*********************************************************\n";
di<<"***** ******"<< "\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in HSP Function ******"<< "\n"; di<<"***** Standard_Failure : Exception in HSP Function ******\n";
di<<"***** ******"<< "\n"; di<<"***** ******\n";
di<<"*********************************************************"<< "\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
di<<"*************************************************************"<< "\n"; di<<"*************************************************************\n";
di<<" CUT 1 and CUT 2 gives entirely different results during"<< "\n"; di<<" CUT 1 and CUT 2 gives entirely different results during\n";
di<<" mass computation and face triangulation, eventhough the"<< "\n"; di<<" mass computation and face triangulation, eventhough the\n";
di<<" two spheres are located more or less at the same position."<< "\n"; di<<" two spheres are located more or less at the same position.\n";
di<<"*************************************************************"<< "\n"; di<<"*************************************************************\n";
return 0; return 0;
} }
@ -854,7 +854,7 @@ static Standard_Integer OCC825 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 4 || argc > 5) { if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 result [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -863,7 +863,7 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -896,30 +896,30 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons
TopoDS_Shape sph = sphere.Shape(); TopoDS_Shape sph = sphere.Shape();
if (index < argc) DBRep::Set(argv[index++], sph); if (index < argc) DBRep::Set(argv[index++], sph);
di << "All primitives created..... Creating Boolean" << "\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse; TopoDS_Shape fuse;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse(rev, sph)" << "\n"; di << "fuse = BRepAlgoAPI_Fuse(rev, sph)\n";
fuse = BRepAlgoAPI_Fuse(rev, sph); fuse = BRepAlgoAPI_Fuse(rev, sph);
} else { } else {
di << "fuse = BRepAlgo_Fuse(rev, sph)" << "\n"; di << "fuse = BRepAlgo_Fuse(rev, sph)\n";
fuse = BRepAlgo_Fuse(rev, sph); fuse = BRepAlgo_Fuse(rev, sph);
} }
if (index < argc) DBRep::Set(argv[index++], fuse); if (index < argc) DBRep::Set(argv[index++], fuse);
di << "Fuse Created ! Triangulating !" << "\n"; di << "Fuse Created ! Triangulating !\n";
performTriangulation(fuse, di); performTriangulation(fuse, di);
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<< "\n"; di<<"*********************************************************\n";
di<<"***** ******"<< "\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in SPH Function ******"<< "\n"; di<<"***** Standard_Failure : Exception in SPH Function ******\n";
di<<"***** ******"<< "\n"; di<<"***** ******\n";
di<<"*********************************************************"<< "\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
@ -933,7 +933,7 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons
static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc < 6 || argc > 7) { if(argc < 6 || argc > 7) {
di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " name1 name2 name3 result1 result2 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -942,7 +942,7 @@ static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, cons
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -982,40 +982,40 @@ static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, cons
TopoDS_Shape tor2 = Torus2.Shape(); TopoDS_Shape tor2 = Torus2.Shape();
if (index < argc) DBRep::Set(argv[index++], tor2); if (index < argc) DBRep::Set(argv[index++], tor2);
di << "All primitives created..... Creating Boolean" << "\n"; di << "All primitives created..... Creating Boolean\n";
TopoDS_Shape fuse1, fuse2; TopoDS_Shape fuse1, fuse2;
try try
{ {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)" << "\n"; di << "Fuse1 = BRepAlgoAPI_Fuse(tor1, rev)\n";
fuse1 = BRepAlgoAPI_Fuse(tor1, rev); fuse1 = BRepAlgoAPI_Fuse(tor1, rev);
} else { } else {
di << "Fuse1 = BRepAlgo_Fuse(tor1, rev)" << "\n"; di << "Fuse1 = BRepAlgo_Fuse(tor1, rev)\n";
fuse1 = BRepAlgo_Fuse(tor1, rev); fuse1 = BRepAlgo_Fuse(tor1, rev);
} }
if (index < argc) DBRep::Set(argv[index++], fuse1); if (index < argc) DBRep::Set(argv[index++], fuse1);
di << "Fuse1 Created ! Creating Fuse 2" << "\n"; di << "Fuse1 Created ! Creating Fuse 2\n";
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)" << "\n"; di << "Fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1)\n";
fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1); fuse2 = BRepAlgoAPI_Fuse(tor2, fuse1);
} else { } else {
di << "Fuse2 = BRepAlgo_Fuse(tor2, fuse1)" << "\n"; di << "Fuse2 = BRepAlgo_Fuse(tor2, fuse1)\n";
fuse2 = BRepAlgo_Fuse(tor2, fuse1); fuse2 = BRepAlgo_Fuse(tor2, fuse1);
} }
if (index < argc) DBRep::Set(argv[index++], fuse2); if (index < argc) DBRep::Set(argv[index++], fuse2);
di << "Fuse2 Created ! Triangulating !" << "\n"; di << "Fuse2 Created ! Triangulating !\n";
performTriangulation(fuse2, di); performTriangulation(fuse2, di);
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di<<"*********************************************************"<< "\n"; di<<"*********************************************************\n";
di<<"***** ******"<< "\n"; di<<"***** ******\n";
di<<"***** Standard_Failure : Exception in REV Function ******"<< "\n"; di<<"***** Standard_Failure : Exception in REV Function ******\n";
di<<"***** ******"<< "\n"; di<<"***** ******\n";
di<<"*********************************************************"<< "\n"; di<<"*********************************************************\n";
return 1; return 1;
} }
return 0; return 0;
@ -1053,14 +1053,14 @@ int performBlend (TopoDS_Shape aShape, Standard_Real rad, TopoDS_Shape& bShape,
status = 1; status = 1;
} }
if(status) { if(status) {
di<<"*******************************************************"<< "\n"; di<<"*******************************************************\n";
di<<"****** *******"<< "\n"; di<<"****** *******\n";
di<<"****** Blending Failed (Radius = " << rad << ") *******"<< "\n"; di<<"****** Blending Failed (Radius = " << rad << ") *******\n";
di<<"****** *******"<< "\n"; di<<"****** *******\n";
di<<"*******************************************************"<< "\n"; di<<"*******************************************************\n";
return 1; return 1;
} else { } else {
di<<"Blending successfully performed on all Edges: "<< "\n" << "\n"; di<<"Blending successfully performed on all Edges: \n\n";
} }
bShape = blend.Shape(); bShape = blend.Shape();
return 0; return 0;
@ -1074,7 +1074,7 @@ int performBlend (TopoDS_Shape aShape, Standard_Real rad, TopoDS_Shape& bShape,
static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv) static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, const char ** argv)
{ {
if(argc != 2) { if(argc != 2) {
di << "Usage : " << argv[0] << " shape" << "\n"; di << "Usage : " << argv[0] << " shape\n";
} }
int index = 1; int index = 1;
@ -1117,7 +1117,7 @@ static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, cons
if (!MW.IsDone()) if (!MW.IsDone())
{ {
di << "my Wire not done" << "\n"; di << "my Wire not done\n";
return 1; return 1;
} }
@ -1125,7 +1125,7 @@ static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, cons
TopoDS_Face F = BRepBuilderAPI_MakeFace(W); TopoDS_Face F = BRepBuilderAPI_MakeFace(W);
if ( F.IsNull()) if ( F.IsNull())
{ {
di << " Error in Face creation " << "\n"; di << " Error in Face creation \n";
return 1; return 1;
} }
@ -1139,7 +1139,7 @@ static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, cons
BRepPrimAPI_MakePrism slab(F, slabVect, Standard_True); BRepPrimAPI_MakePrism slab(F, slabVect, Standard_True);
if ( ! slab.IsDone() ) if ( ! slab.IsDone() )
{ {
di << " Error in Slab creation " << "\n"; di << " Error in Slab creation \n";
return 1; return 1;
} }
if (index < argc) DBRep::Set(argv[index++], slab.Shape()); if (index < argc) DBRep::Set(argv[index++], slab.Shape());
@ -1155,7 +1155,7 @@ static Standard_Integer OCC828 (Draw_Interpretor& di,Standard_Integer argc, cons
} }
catch ( Standard_Failure ) catch ( Standard_Failure )
{ {
di << " Error in Draft Slab " << "\n"; di << " Error in Draft Slab \n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -376,7 +376,7 @@ static int pipe_OCC9 (Draw_Interpretor& di,
Standard_Integer n, const char ** a) Standard_Integer n, const char ** a)
{ {
if (n < 6) { if (n < 6) {
di << "Usage: " << a[0] << " result path cur1 cur2 radius [tolerance]" << "\n"; di << "Usage: " << a[0] << " result path cur1 cur2 radius [tolerance]\n";
return 1; return 1;
} }
@ -385,7 +385,7 @@ static int pipe_OCC9 (Draw_Interpretor& di,
for (i=2 ; i<=4; i++) { for (i=2 ; i<=4; i++) {
Handle(Geom_Curve) aC = Handle(Geom_Curve)::DownCast( DrawTrSurf::Get(a[i]) ); Handle(Geom_Curve) aC = Handle(Geom_Curve)::DownCast( DrawTrSurf::Get(a[i]) );
if (aC.IsNull()) { if (aC.IsNull()) {
di << a[i] << " is not a curve" << "\n"; di << a[i] << " is not a curve\n";
return 1; return 1;
} }
aCurveSeq.Append(aC); aCurveSeq.Append(aC);
@ -469,21 +469,21 @@ Standard_Integer OCC157(Draw_Interpretor& di,
//static Standard_Integer findplanarsurface(Draw_Interpretor&, Standard_Integer n, const char ** a) //static Standard_Integer findplanarsurface(Draw_Interpretor&, Standard_Integer n, const char ** a)
{ {
if (n<3) { if (n<3) {
di << "bad number of arguments" <<"\n"; di << "bad number of arguments\n";
return 1; return 1;
} }
// try to read a shape: // try to read a shape:
TopoDS_Shape inputShape=DBRep::Get(a[2]); TopoDS_Shape inputShape=DBRep::Get(a[2]);
if (inputShape.IsNull() || inputShape.ShapeType() != TopAbs_WIRE) { if (inputShape.IsNull() || inputShape.ShapeType() != TopAbs_WIRE) {
di << "Invalid input shape"<< "\n"; di << "Invalid input shape\n";
return 1; return 1;
} }
Standard_Real toler = Draw::Atof(a[3]); Standard_Real toler = Draw::Atof(a[3]);
TopoDS_Wire aWire = TopoDS::Wire(inputShape); TopoDS_Wire aWire = TopoDS::Wire(inputShape);
BRepLib_FindSurface FS(aWire, toler, Standard_True); BRepLib_FindSurface FS(aWire, toler, Standard_True);
if(FS.Found()) { if(FS.Found()) {
di<<"OCC157: OK; Planar surface is found"<<"\n"; di<<"OCC157: OK; Planar surface is found\n";
Handle(Geom_Surface) aSurf = FS.Surface(); Handle(Geom_Surface) aSurf = FS.Surface();
BRepBuilderAPI_MakeFace aMakeFace(aSurf,aWire,Standard_True); BRepBuilderAPI_MakeFace aMakeFace(aSurf,aWire,Standard_True);
if(aMakeFace.IsDone()) { if(aMakeFace.IsDone()) {
@ -526,7 +526,7 @@ Standard_Integer OCC165(Draw_Interpretor& di ,
{ {
if (n > 2) if (n > 2)
{ {
di <<"Usage : " << a[0] << " [file]"<<"\n"; di <<"Usage : " << a[0] << " [file]\n";
return 1; return 1;
} }
di.Eval ("axo"); di.Eval ("axo");
@ -676,7 +676,7 @@ static Standard_Integer OCC305 (Draw_Interpretor& di,Standard_Integer argc, cons
{ {
if (argc != 2) if (argc != 2)
{ {
di <<"Usage : " << argv[0] << " file"<<"\n"; di <<"Usage : " << argv[0] << " file\n";
return 1; return 1;
} }
Standard_CString file = argv[1]; Standard_CString file = argv[1];
@ -760,7 +760,7 @@ static Standard_Integer OCC166 (Draw_Interpretor& di, Standard_Integer /*argc*/,
static Standard_Integer OCC381_Save (Draw_Interpretor& di, Standard_Integer nb, const char ** a) static Standard_Integer OCC381_Save (Draw_Interpretor& di, Standard_Integer nb, const char ** a)
{ {
if (nb != 2) { if (nb != 2) {
di << "Usage: " << a[0] << " Doc" << "\n"; di << "Usage: " << a[0] << " Doc\n";
return 1; return 1;
} }
@ -772,34 +772,34 @@ static Standard_Integer OCC381_Save (Draw_Interpretor& di, Standard_Integer nb,
TCollection_ExtendedString theStatusMessage; TCollection_ExtendedString theStatusMessage;
if (!D->IsSaved()) { if (!D->IsSaved()) {
di << "this document has never been saved" << "\n"; di << "this document has never been saved\n";
return 0; return 0;
} }
PCDM_StoreStatus theStatus = A->Save(D, theStatusMessage); PCDM_StoreStatus theStatus = A->Save(D, theStatusMessage);
if (theStatus != PCDM_SS_OK ) { if (theStatus != PCDM_SS_OK ) {
switch ( theStatus ) { switch ( theStatus ) {
case PCDM_SS_DriverFailure: { case PCDM_SS_DriverFailure: {
di << "Error saving document: Could not store , no driver found to make it" << "\n"; di << "Error saving document: Could not store , no driver found to make it\n";
break ; break ;
} }
case PCDM_SS_WriteFailure: { case PCDM_SS_WriteFailure: {
di << "Error saving document: Write access failure" << "\n"; di << "Error saving document: Write access failure\n";
break; break;
} }
case PCDM_SS_Failure: { case PCDM_SS_Failure: {
di << "Error saving document: Write failure" << "\n" ; di << "Error saving document: Write failure\n" ;
break; break;
} }
case PCDM_SS_Doc_IsNull: { case PCDM_SS_Doc_IsNull: {
di << "Error saving document: No document to save" << "\n"; di << "Error saving document: No document to save\n";
break ; break ;
} }
case PCDM_SS_No_Obj: { case PCDM_SS_No_Obj: {
di << "Error saving document: No objects written" << "\n"; di << "Error saving document: No objects written\n";
break; break;
} }
case PCDM_SS_Info_Section_Error: { case PCDM_SS_Info_Section_Error: {
di << "Error saving document: Write info section failure" << "\n" ; di << "Error saving document: Write info section failure\n" ;
break; break;
} }
default: default:
@ -813,7 +813,7 @@ static Standard_Integer OCC381_Save (Draw_Interpretor& di, Standard_Integer nb,
static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb, const char ** a) static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb, const char ** a)
{ {
if (nb != 3) { if (nb != 3) {
di << "Usage: " << a[0] << " Doc Path" << "\n"; di << "Usage: " << a[0] << " Doc Path\n";
return 1; return 1;
} }
@ -829,27 +829,27 @@ static Standard_Integer OCC381_SaveAs (Draw_Interpretor& di, Standard_Integer nb
if (theStatus != PCDM_SS_OK ) { if (theStatus != PCDM_SS_OK ) {
switch ( theStatus ) { switch ( theStatus ) {
case PCDM_SS_DriverFailure: { case PCDM_SS_DriverFailure: {
di << "Error saving document: Could not store , no driver found to make it" << "\n"; di << "Error saving document: Could not store , no driver found to make it\n";
break ; break ;
} }
case PCDM_SS_WriteFailure: { case PCDM_SS_WriteFailure: {
di << "Error saving document: Write access failure" << "\n"; di << "Error saving document: Write access failure\n";
break; break;
} }
case PCDM_SS_Failure: { case PCDM_SS_Failure: {
di << "Error saving document: Write failure" << "\n" ; di << "Error saving document: Write failure\n" ;
break; break;
} }
case PCDM_SS_Doc_IsNull: { case PCDM_SS_Doc_IsNull: {
di << "Error saving document: No document to save" << "\n"; di << "Error saving document: No document to save\n";
break ; break ;
} }
case PCDM_SS_No_Obj: { case PCDM_SS_No_Obj: {
di << "Error saving document: No objects written" << "\n"; di << "Error saving document: No objects written\n";
break; break;
} }
case PCDM_SS_Info_Section_Error: { case PCDM_SS_Info_Section_Error: {
di << "Error saving document: Write info section failure" << "\n" ; di << "Error saving document: Write info section failure\n" ;
break; break;
} }
default: default:
@ -919,10 +919,10 @@ static Standard_Integer OCC309bug (Draw_Interpretor& di, Standard_Integer nb, co
OSD_Path d = p.CurrentDirectory(); OSD_Path d = p.CurrentDirectory();
TCollection_AsciiString s; TCollection_AsciiString s;
d.SystemName(s); d.SystemName(s);
di << "*" << s.ToCString() << "*" << "\n"; di << "*" << s.ToCString() << "*\n";
d.UpTrek(); d.UpTrek();
d.SystemName(s); d.SystemName(s);
di << "*" << s.ToCString() << "*" <<"\n"; di << "*" << s.ToCString() << "*\n";
return 0; return 0;
} }
@ -951,7 +951,7 @@ static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, co
// return 1; // return 1;
//} //}
if(nb < 1 || nb > 2) { if(nb < 1 || nb > 2) {
di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -977,14 +977,14 @@ static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, co
//#endif //#endif
TopoDS_Shape fuse,comm; TopoDS_Shape fuse,comm;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )" <<"\n"; di << "fuse = BRepAlgoAPI_Fuse( shape1, shape2 )\n";
di << "comm = BRepAlgoAPI_Common( shape1, shape2 )" <<"\n"; di << "comm = BRepAlgoAPI_Common( shape1, shape2 )\n";
fuse = BRepAlgoAPI_Fuse( shape1, shape2 ); fuse = BRepAlgoAPI_Fuse( shape1, shape2 );
comm = BRepAlgoAPI_Common( shape1, shape2 ); comm = BRepAlgoAPI_Common( shape1, shape2 );
} else { } else {
di << "fuse = BRepAlgo_Fuse( shape1, shape2 )" <<"\n"; di << "fuse = BRepAlgo_Fuse( shape1, shape2 )\n";
fuse = BRepAlgo_Fuse( shape1, shape2 ); fuse = BRepAlgo_Fuse( shape1, shape2 );
di << "comm = BRepAlgo_Common( shape1, shape2 )" <<"\n"; di << "comm = BRepAlgo_Common( shape1, shape2 )\n";
comm = BRepAlgo_Common( shape1, shape2 ); comm = BRepAlgo_Common( shape1, shape2 );
} }
@ -996,22 +996,22 @@ static Standard_Integer OCC277bug (Draw_Interpretor& di, Standard_Integer nb, co
static Standard_Integer OCC333bug (Draw_Interpretor& di, Standard_Integer n, const char ** a) static Standard_Integer OCC333bug (Draw_Interpretor& di, Standard_Integer n, const char ** a)
{ {
if( n < 3) { if( n < 3) {
di<<"-1"<<"\n"; di<<"-1\n";
di << "Usage: " << a[0] << " edge1 edge2 [toler domaindist]" << "\n"; di << "Usage: " << a[0] << " edge1 edge2 [toler domaindist]\n";
return 1; return 1;
} }
TopoDS_Shape Sh1 = DBRep::Get(a[1]); TopoDS_Shape Sh1 = DBRep::Get(a[1]);
TopoDS_Shape Sh2 = DBRep::Get(a[2]); TopoDS_Shape Sh2 = DBRep::Get(a[2]);
if(Sh1.IsNull() || Sh2.IsNull()) { if(Sh1.IsNull() || Sh2.IsNull()) {
di<<"-2"<<"\n"; di<<"-2\n";
di<<"Invalid arguments"<<"\n"; di<<"Invalid arguments\n";
return 1; return 1;
} }
TopoDS_Edge e1 = TopoDS::Edge(Sh1); TopoDS_Edge e1 = TopoDS::Edge(Sh1);
TopoDS_Edge e2 = TopoDS::Edge(Sh2); TopoDS_Edge e2 = TopoDS::Edge(Sh2);
if(e1.IsNull() || e2.IsNull()) { if(e1.IsNull() || e2.IsNull()) {
di<<"-3"<<"\n"; di<<"-3\n";
di<<"Invalid type of arguments"<<"\n"; di<<"Invalid type of arguments\n";
return 1; return 1;
} }
Standard_Real aTol = Precision::Confusion(); Standard_Real aTol = Precision::Confusion();
@ -1025,17 +1025,17 @@ static Standard_Integer OCC333bug (Draw_Interpretor& di, Standard_Integer n, con
ShapeAnalysis_Edge sae; ShapeAnalysis_Edge sae;
if(sae.CheckOverlapping(e1,e2,aTol,aDistDomain)) { if(sae.CheckOverlapping(e1,e2,aTol,aDistDomain)) {
if(aDistDomain ==0.0) { if(aDistDomain ==0.0) {
di<<"1"<<"\n"; di<<"1\n";
di<<"Edges is overlaping comletly"<<"\n"; di<<"Edges is overlaping comletly\n";
} else { } else {
di<<"2"<<"\n"; di<<"2\n";
di<<"Edges is overlaped"<<"\n"; di<<"Edges is overlaped\n";
di<<"with tolerance = "<<aTol<<"\n"; di<<"with tolerance = "<<aTol<<"\n";
di<<"on segment length = "<<aDistDomain<<"\n"; di<<"on segment length = "<<aDistDomain<<"\n";
} }
} else { } else {
di<<"3"<<"\n"; di<<"3\n";
di<<"Edges is not overlaped"<<"\n"; di<<"Edges is not overlaped\n";
} }
return 0; return 0;
} }
@ -1215,8 +1215,8 @@ static Standard_Integer OCC377 (Draw_Interpretor& di, Standard_Integer argc, con
di << "Reversed Wire " << i << ": point ( " << p2d.X() << ", " << p2d.Y() << " ) is " << TmpString.ToCString() << "\n"; di << "Reversed Wire " << i << ": point ( " << p2d.X() << ", " << p2d.Y() << " ) is " << TmpString.ToCString() << "\n";
// 4.3. Compare results (they must be same) // 4.3. Compare results (they must be same)
if(stat1 ==stat2) di << "OCC377 OK" << "\n"; if(stat1 ==stat2) di << "OCC377 OK\n";
else {di << "OCC377 FAULTY" << "\n"; return 0;} else {di << "OCC377 FAULTY\n"; return 0;}
} }
} }
catch(Standard_Failure) catch(Standard_Failure)
@ -1455,7 +1455,7 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con
// return 1; // return 1;
//} //}
if(argc < 4 || argc > 5) { if(argc < 4 || argc > 5) {
di << "Usage : " << argv[0] << " shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " shape1 shape2 shape3 [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -1463,9 +1463,9 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con
Standard_Integer IsB = Draw::Atoi(argv[4]); Standard_Integer IsB = Draw::Atoi(argv[4]);
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
// di << "Error: There is not BRepAlgo_Cut class" << "\n"; // di << "Error: There is not BRepAlgo_Cut class\n";
// return 1; // return 1;
} }
} }
@ -1540,10 +1540,10 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con
//#endif //#endif
TopoDS_Shape wedge_common; TopoDS_Shape wedge_common;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)" <<"\n"; di << "wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a)\n";
wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a); wedge_common = BRepAlgoAPI_Fuse(wedge1a , wedge2a);
} else { } else {
di << "wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a)" <<"\n"; di << "wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a)\n";
wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a); wedge_common = BRepAlgo_Fuse(wedge1a , wedge2a);
} }
@ -1555,10 +1555,10 @@ static Standard_Integer OCC578 (Draw_Interpretor& di, Standard_Integer argc, con
//#endif //#endif
TopoDS_Shape sub_etch1; TopoDS_Shape sub_etch1;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)" <<"\n"; di << "sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common)\n";
sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common); sub_etch1 = BRepAlgoAPI_Cut(substrate, wedge_common);
} else { } else {
di << "sub_etch1 = BRepAlgo_Cut(substrate, wedge_common)" <<"\n"; di << "sub_etch1 = BRepAlgo_Cut(substrate, wedge_common)\n";
sub_etch1 = BRepAlgo_Cut(substrate, wedge_common); sub_etch1 = BRepAlgo_Cut(substrate, wedge_common);
} }
@ -1657,12 +1657,12 @@ static Standard_Integer OCC708 (Draw_Interpretor& di, Standard_Integer argc, con
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }
if ( argc != 2) { if ( argc != 2) {
di << "ERROR : Usage : " << argv[0] << " shape ; Deactivate the current transformation" << "\n"; di << "ERROR : Usage : " << argv[0] << " shape ; Deactivate the current transformation\n";
return 1; return 1;
} }
@ -1674,12 +1674,12 @@ static Standard_Integer OCC708 (Draw_Interpretor& di, Standard_Integer argc, con
Handle(AIS_InteractiveObject) AISObj; Handle(AIS_InteractiveObject) AISObj;
if(!aMap.IsBound2(aName)) { if(!aMap.IsBound2(aName)) {
di << "Use 'vdisplay' before" << "\n"; di << "Use 'vdisplay' before\n";
return 1; return 1;
} else { } else {
AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName)); AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap.Find2(aName));
if(AISObj.IsNull()){ if(AISObj.IsNull()){
di << argv[1] << " : No interactive object" << "\n"; di << argv[1] << " : No interactive object\n";
return 1; return 1;
} }
AISObj->ResetTransformation(); AISObj->ResetTransformation();
@ -1766,7 +1766,7 @@ static Standard_Integer OCC909 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Wire awire = TopoDS::Wire(DBRep::Get(argv[1])); //read the wire TopoDS_Wire awire = TopoDS::Wire(DBRep::Get(argv[1])); //read the wire
TopoDS_Face aface = TopoDS::Face(DBRep::Get(argv[2])); //read the face TopoDS_Face aface = TopoDS::Face(DBRep::Get(argv[2])); //read the face
if (awire.IsNull() || aface.IsNull()) { if (awire.IsNull() || aface.IsNull()) {
di << "Null object" << "\n"; di << "Null object\n";
return 1; return 1;
} }
@ -1792,7 +1792,7 @@ static Standard_Integer OCC921 (Draw_Interpretor& di, Standard_Integer argc, con
{ {
if (argc != 2) if (argc != 2)
{ {
di <<"Usage : " << argv[0] << " face"<<"\n"; di <<"Usage : " << argv[0] << " face\n";
return 1; return 1;
} }
Standard_Real u1, u2, v1, v2; Standard_Real u1, u2, v1, v2;
@ -1815,7 +1815,7 @@ static Standard_Integer OCC902(Draw_Interpretor& di, Standard_Integer argc, cons
{ {
if (argc != 2) if (argc != 2)
{ {
di <<"Usage : " << argv[0] << " expression"<<"\n"; di <<"Usage : " << argv[0] << " expression\n";
return 1; return 1;
} }
@ -1873,7 +1873,7 @@ static Standard_Integer OCC1029_AISTransparency (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << arg[0] << " : Error" << "\n"; di << arg[0] << " : Error\n";
return 1; return 1;
} }
@ -1906,7 +1906,7 @@ static Standard_Integer OCC1030_AISColor (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << arg[0] << " : Error" << "\n"; di << arg[0] << " : Error\n";
return 1; return 1;
} }
@ -1940,7 +1940,7 @@ static Standard_Integer OCC1031_AISMaterial (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << arg[0] << " : Error" << "\n"; di << arg[0] << " : Error\n";
return 1; return 1;
} }
@ -1974,7 +1974,7 @@ static Standard_Integer OCC1032_AISWidth (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << arg[0] << " : Error" << "\n"; di << arg[0] << " : Error\n";
return 1; return 1;
} }
@ -2008,7 +2008,7 @@ static Standard_Integer OCC1033_AISMode (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << arg[0] << " : Error" << "\n"; di << arg[0] << " : Error\n";
return 1; return 1;
} }
@ -2042,7 +2042,7 @@ static Standard_Integer OCC1034_AISSelectionMode (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << arg[0] << " : Error" << "\n"; di << arg[0] << " : Error\n";
return 1; return 1;
} }
@ -2059,7 +2059,7 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
// return -1; // return -1;
//} //}
if(argc < 5 || argc > 6) { if(argc < 5 || argc > 6) {
di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " CylinderVariant(=1/2) cylinder1 cylinder2 cutshape [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -2067,7 +2067,7 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
Standard_Integer IsB = Draw::Atoi(argv[5]); Standard_Integer IsB = Draw::Atoi(argv[5]);
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
// di << "Error: There is not BRepAlgo_Cut class" << "\n"; // di << "Error: There is not BRepAlgo_Cut class\n";
// return 1; // return 1;
} }
} }
@ -2098,10 +2098,10 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
// o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); // o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
//#endif //#endif
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())" <<"\n"; di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ());
} else { } else {
di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())" <<"\n"; di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
} }
} else { } else {
@ -2118,10 +2118,10 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co
// o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); // o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
//#endif //#endif
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())" <<"\n"; di << "o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ()); o_cut_shape = BRepAlgoAPI_Cut (o_mc1.Solid (), o_mc2.Solid ());
} else { } else {
di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())" <<"\n"; di << "o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ())\n";
o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ());
} }
} }
@ -2234,7 +2234,7 @@ TopoDS_Shape OCC1077_Bug()
static Standard_Integer OCC1077 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC1077 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc < 1 || argc > 2) { if(argc < 1 || argc > 2) {
di << "Usage : " << argv[0] << " result" << "\n"; di << "Usage : " << argv[0] << " result\n";
return 1; return 1;
} }
@ -2253,7 +2253,7 @@ static Standard_Integer OCC5739_UniAbs (Draw_Interpretor& di, Standard_Integer a
{ {
if (argc < 4) if (argc < 4)
{ {
di << "Usage : " << argv[0] << " name shape step" << "\n"; di << "Usage : " << argv[0] << " name shape step\n";
return 1; return 1;
} }
const char *name = argv[1]; const char *name = argv[1];
@ -2266,7 +2266,7 @@ static Standard_Integer OCC5739_UniAbs (Draw_Interpretor& di, Standard_Integer a
TopoDS_Shape wire = DBRep::Get(argv[2]); TopoDS_Shape wire = DBRep::Get(argv[2]);
if (wire.IsNull() || wire.ShapeType() != TopAbs_WIRE) if (wire.IsNull() || wire.ShapeType() != TopAbs_WIRE)
{ {
di << argv[0] <<" Faulty : incorrect 1st parameter, curve or wire expected"<<"\n"; di << argv[0] <<" Faulty : incorrect 1st parameter, curve or wire expected\n";
return 1; return 1;
} }
adapCurve = new BRepAdaptor_CompCurve(TopoDS::Wire(wire)); adapCurve = new BRepAdaptor_CompCurve(TopoDS::Wire(wire));
@ -2276,7 +2276,7 @@ static Standard_Integer OCC5739_UniAbs (Draw_Interpretor& di, Standard_Integer a
int res; int res;
if (!aUni.IsDone()) if (!aUni.IsDone())
{ {
di << argv[0] <<" : fail"<<"\n"; di << argv[0] <<" : fail\n";
res = 1; res = 1;
} }
else else
@ -2301,7 +2301,7 @@ static Standard_Integer OCC6046 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if (argc != 3) if (argc != 3)
{ {
di << "Usage : " << argv[0] << " nb_of_vectors size" << "\n"; di << "Usage : " << argv[0] << " nb_of_vectors size\n";
return 1; return 1;
} }
@ -2310,7 +2310,7 @@ static Standard_Integer OCC6046 (Draw_Interpretor& di, Standard_Integer argc, co
Standard_Real val = 10; Standard_Real val = 10;
math_Vector **pv = new math_Vector *[nb]; math_Vector **pv = new math_Vector *[nb];
di<<"creating "<<nb<<" vectors "<<sz<<" elements each..."<<"\n"; di<<"creating "<<nb<<" vectors "<<sz<<" elements each...\n";
Standard_Integer i; Standard_Integer i;
for (i=0; i < nb; i++) { for (i=0; i < nb; i++) {
pv[i] = new math_Vector (1, sz, val); pv[i] = new math_Vector (1, sz, val);
@ -2320,8 +2320,8 @@ static Standard_Integer OCC6046 (Draw_Interpretor& di, Standard_Integer argc, co
di<<"\n"; di<<"\n";
} }
} }
di<<" done"<<"\n"; di<<" done\n";
di<<"deleting them ..."<<"\n"; di<<"deleting them ...\n";
for (i=0; i < nb; i++) { for (i=0; i < nb; i++) {
delete pv[i]; delete pv[i];
if ((i % (nb/10)) == 0) { if ((i % (nb/10)) == 0) {
@ -2330,7 +2330,7 @@ static Standard_Integer OCC6046 (Draw_Interpretor& di, Standard_Integer argc, co
di<<"\n"; di<<"\n";
} }
} }
di<<" done"<<"\n"; di<<" done\n";
delete [] pv; delete [] pv;
@ -2341,7 +2341,7 @@ static Standard_Integer OCC5698 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if (argc != 2) if (argc != 2)
{ {
di << "Usage : " << argv[0] << " wire" << "\n"; di << "Usage : " << argv[0] << " wire\n";
return 1; return 1;
} }
TopoDS_Shape shape = DBRep::Get(argv[1],TopAbs_WIRE); TopoDS_Shape shape = DBRep::Get(argv[1],TopAbs_WIRE);
@ -2365,10 +2365,10 @@ static Standard_Integer OCC5698 (Draw_Interpretor& di, Standard_Integer argc, co
if (error_dist > Precision::Confusion()) { if (error_dist > Precision::Confusion()) {
//cout.precision(3); //cout.precision(3);
di<<"error_dist = "<<error_dist<< di<<"error_dist = "<<error_dist<<
" ( "<<error_dist/need_length*100<<" %)"<<"\n"; " ( "<<error_dist/need_length*100<<" %)\n";
return 0; return 0;
} }
di<<"OK"<<"\n"; di<<"OK\n";
return 0; return 0;
} }
@ -2409,7 +2409,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
di << "\n"; di << "\n";
Standard_Integer res, a =4, b = 0 ; Standard_Integer res, a =4, b = 0 ;
res = a / b; res = a / b;
di << " 4 / 0 = " << res << " Does not Caught... KO"<< "\n"; di << " 4 / 0 = " << res << " Does not Caught... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
#if defined(SOLARIS) || defined(_WIN32) #if defined(SOLARIS) || defined(_WIN32)
@ -2418,20 +2418,20 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
catch(Standard_NumericError) catch(Standard_NumericError)
#endif #endif
{ {
di << " Ok"<< "\n"; di << " Ok\n";
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
#ifndef NO_CXX_EXCEPTION #ifndef NO_CXX_EXCEPTION
// this case tests if (...) supersedes (Standard_*), // this case tests if (...) supersedes (Standard_*),
// the normal behaviour is not // the normal behaviour is not
catch(...) { catch(...) {
di<<" unknown exception... (But) Ok"<<"\n"; di<<" unknown exception... (But) Ok\n";
} }
#endif #endif
} }
@ -2445,23 +2445,23 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
di << "\n"; di << "\n";
Standard_Real res, a= 4.0, b=0.0; Standard_Real res, a= 4.0, b=0.0;
res = a / b; res = a / b;
di << " 4.0 / 0.0 = " << res << " Does not Caught... OK"<< "\n"; di << " 4.0 / 0.0 = " << res << " Does not Caught... OK\n";
} }
catch(Standard_DivideByZero) // Solaris, Windows w/o SSE2 catch(Standard_DivideByZero) // Solaris, Windows w/o SSE2
{ {
di << " KO" << "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_NumericError) // Linux, Windows with SSE2 catch(Standard_NumericError) // Linux, Windows with SSE2
{ {
di << " KO" << "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
@ -2477,16 +2477,16 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
res = i + 1; res = i + 1;
//++++ cout << " -- "<<res<<"="<<i<<"+1 Does not Caught... KO"<< endl; //++++ cout << " -- "<<res<<"="<<i<<"+1 Does not Caught... KO"<< endl;
//++++ Succes = Standard_False; //++++ Succes = Standard_False;
di << " "<<res<<"="<<i<<"+1 Does not Caught... (But) Ok"<< "\n"; di << " "<<res<<"="<<i<<"+1 Does not Caught... (But) Ok\n";
} }
catch(Standard_Overflow) { catch(Standard_Overflow) {
di << " Ok"<< "\n"; di << " Ok\n";
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
@ -2503,23 +2503,23 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
(void)sin(1.); //this function tests FPU flags and raises signal (tested on LINUX). (void)sin(1.); //this function tests FPU flags and raises signal (tested on LINUX).
di << "-- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... OK"<< "\n"; di << "-- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... OK\n";
} }
catch(Standard_Overflow) // Solaris, Windows w/o SSE2 catch(Standard_Overflow) // Solaris, Windows w/o SSE2
{ {
di << " KO" << "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_NumericError) // Linux, Windows with SSE2 catch(Standard_NumericError) // Linux, Windows with SSE2
{ {
di << " KO" << "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
@ -2536,23 +2536,23 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
//res = res + 1.; //res = res + 1.;
//++++ cout<<"-- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... KO"<<endl; //++++ cout<<"-- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... KO"<<endl;
//++++ Succes = Standard_False; //++++ Succes = Standard_False;
di<<" -- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... (But) Ok"<<"\n"; di<<" -- "<<res<<"="<<r<<"*"<<r<<" Does not Caught... (But) Ok\n";
} }
catch(Standard_Underflow) // could be on Solaris, Windows w/o SSE2 catch(Standard_Underflow) // could be on Solaris, Windows w/o SSE2
{ {
di << " KO" << "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_NumericError) // could be on Linux, Windows with SSE2 catch(Standard_NumericError) // could be on Linux, Windows with SSE2
{ {
di << " KO" << "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
@ -2566,17 +2566,17 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
di << "\n"; di << "\n";
Standard_Real res, r=-1; Standard_Real res, r=-1;
res = sqrt(r); res = sqrt(r);
di<<" "<<res<<"=sqrt("<<r<<") Does not Caught... OK"<<"\n"; di<<" "<<res<<"=sqrt("<<r<<") Does not Caught... OK\n";
} }
catch(Standard_NumericError) { catch(Standard_NumericError) {
di << " KO"<< "\n"; di << " KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
@ -2590,7 +2590,7 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
di << "\n"; di << "\n";
int* pint=NULL; int* pint=NULL;
*pint = 4; *pint = 4;
di << " Does not Caught... KO"<<"\n"; di << " Does not Caught... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
#ifdef _WIN32 #ifdef _WIN32
@ -2599,12 +2599,12 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
catch(OSD_SIGSEGV) catch(OSD_SIGSEGV)
#endif #endif
{ {
di << " Ok"<< "\n"; di << " Ok\n";
} catch(Standard_Failure) { } catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
@ -2618,26 +2618,26 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co
//cout.flush(); //cout.flush();
di << "\n"; di << "\n";
StackOverflow(); StackOverflow();
di << " Does not Caught... KO"<<"\n"; di << " Does not Caught... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
catch(OSD_Exception_STACK_OVERFLOW) { catch(OSD_Exception_STACK_OVERFLOW) {
di << " Ok"<< "\n"; di << " Ok\n";
} }
catch(Standard_Failure) { catch(Standard_Failure) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl; //cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught ("; di << " Caught (";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di << ")... KO" << "\n"; di << ")... KO\n";
Succes = Standard_False; Succes = Standard_False;
} }
} }
#endif #endif
if(Succes) { if(Succes) {
di << "TestExcept: Successfull completion" << "\n"; di << "TestExcept: Successfull completion\n";
} else { } else {
di << "TestExcept: failure" << "\n"; di << "TestExcept: failure\n";
} }
return 0; return 0;
@ -2671,7 +2671,7 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co
if (argc > 3) if (argc > 3)
{ {
di << "Usage : " << argv[0] << " [nCount] path" << "\n"; di << "Usage : " << argv[0] << " [nCount] path\n";
return 1; return 1;
} }
@ -2686,7 +2686,7 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co
shapeTool->AddShape(AddTestStructure(nCount), Standard_True); shapeTool->AddShape(AddTestStructure(nCount), Standard_True);
STEPControl_StepModelType mode = STEPControl_AsIs; STEPControl_StepModelType mode = STEPControl_AsIs;
if (!Interface_Static::SetIVal("write.step.assembly",1)) { //assembly mode if (!Interface_Static::SetIVal("write.step.assembly",1)) { //assembly mode
di << "Failed to set assembly mode for step data\n" << "\n"; di << "Failed to set assembly mode for step data\n\n";
return 0; return 0;
} }
try { try {
@ -2696,14 +2696,14 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co
} }
} }
catch(OSD_Exception_STACK_OVERFLOW) { catch(OSD_Exception_STACK_OVERFLOW) {
di << "Failed : STACK OVERFLOW\n" << "\n"; di << "Failed : STACK OVERFLOW\n\n";
} }
catch (Standard_Failure) { catch (Standard_Failure) {
di << "Failed :\n" << "\n"; di << "Failed :\n\n";
//cout << Standard_Failure::Caught() << endl; //cout << Standard_Failure::Caught() << endl;
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
} }
di << argv[0] << " : Finish" << "\n"; di << argv[0] << " : Finish\n";
return 0; return 0;
} }
@ -2755,7 +2755,7 @@ static Standard_Integer OCC8169 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if (argc != 4) if (argc != 4)
{ {
di << "Usage : " << argv[0] << " edge1 edge2 plane" << "\n"; di << "Usage : " << argv[0] << " edge1 edge2 plane\n";
return 1; return 1;
} }
TopoDS_Edge theEdge1 = TopoDS::Edge(DBRep::Get(argv[1],TopAbs_EDGE)); TopoDS_Edge theEdge1 = TopoDS::Edge(DBRep::Get(argv[1],TopAbs_EDGE));
@ -2794,7 +2794,7 @@ static Standard_Integer OCC8169 (Draw_Interpretor& di, Standard_Integer argc, co
Standard_Integer i; Standard_Integer i;
for (i=1; i<=NbPoints; i++) { for (i=1; i<=NbPoints; i++) {
gp_Pnt2d aPi = anInter.Point(i); gp_Pnt2d aPi = anInter.Point(i);
di << "Point.X(" << i << ") = " << aPi.X() << " " << "Point.Y(" << i << ") = " << aPi.Y() << "\n" ; di << "Point.X(" << i << ") = " << aPi.X() << " Point.Y(" << i << ") = " << aPi.Y() << "\n" ;
} }
} }
@ -2810,20 +2810,20 @@ static Standard_Integer OCC8169 (Draw_Interpretor& di, Standard_Integer argc, co
Standard_Real aDist = aP1.Distance(aP2); Standard_Real aDist = aP1.Distance(aP2);
di << "aP1.X() = " << aP1.X() << " " << "aP1.Y() = " << aP1.Y() << "\n" ; di << "aP1.X() = " << aP1.X() << " aP1.Y() = " << aP1.Y() << "\n" ;
di << "aP2.X() = " << aP2.X() << " " << "aP2.Y() = " << aP2.Y() << "\n" ; di << "aP2.X() = " << aP2.X() << " aP2.Y() = " << aP2.Y() << "\n" ;
di << "Distance = " << aDist << "\n" ; di << "Distance = " << aDist << "\n" ;
di << "Confusion = " << aConfusion << "\n" ; di << "Confusion = " << aConfusion << "\n" ;
if (aDist > aConfusion) { if (aDist > aConfusion) {
di << "\n" << argv[0] << " Faulty" << "\n" ; di << "\n" << argv[0] << " Faulty\n" ;
} else { } else {
di << "\n" << argv[0] << " OK" << "\n" ; di << "\n" << argv[0] << " OK\n" ;
} }
} else { } else {
di << "\n" << argv[0] << " OK" << "\n" ; di << "\n" << argv[0] << " OK\n" ;
} }
return 0; return 0;
@ -2832,7 +2832,7 @@ static Standard_Integer OCC10138 (Draw_Interpretor& di, Standard_Integer argc, c
{ {
if (argc != 3) if (argc != 3)
{ {
di << "Usage : " << argv[0] << " lower upper" << "\n"; di << "Usage : " << argv[0] << " lower upper\n";
return 1; return 1;
} }
@ -3042,7 +3042,7 @@ static Standard_Integer OCC7639 (Draw_Interpretor& di, Standard_Integer argc, co
if (argc < 3 || IsEvenArgc) if (argc < 3 || IsEvenArgc)
{ {
di << "Usage : " << argv[0] << " index1 value1 ... [indexN valueN]" << "\n"; di << "Usage : " << argv[0] << " index1 value1 ... [indexN valueN]\n";
return 1; return 1;
} }
@ -4529,7 +4529,7 @@ static Standard_Integer OCC12584 (Draw_Interpretor& di, Standard_Integer argc, c
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << " ERROR : use 'vinit' command before " << "\n"; di << argv[0] << " ERROR : use 'vinit' command before \n";
return -1; return -1;
} }
@ -4577,9 +4577,9 @@ static Standard_Integer OCC12584 (Draw_Interpretor& di, Standard_Integer argc, c
if (mode == 2) { if (mode == 2) {
Standard_Boolean IsDisplayed = aContext->IsDisplayed (aCS); Standard_Boolean IsDisplayed = aContext->IsDisplayed (aCS);
if (IsDisplayed) if (IsDisplayed)
di <<"ColorScaleIsDisplayed = " << "1" << "\n"; di <<"ColorScaleIsDisplayed = 1\n";
else else
di <<"ColorScaleIsDisplayed = " << "0" << "\n"; di <<"ColorScaleIsDisplayed = 0\n";
} }
} }
return 0; return 0;
@ -4641,8 +4641,8 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
progress->Show(); progress->Show();
if (readstat != IFSelect_RetDone) { if (readstat != IFSelect_RetDone) {
if (modfic) di<<"Could not read file "<<fnom.ToCString()<<" , abandon"<<"\n"; if (modfic) di<<"Could not read file "<<fnom.ToCString()<<" , abandon\n";
else di<<"No model loaded"<<"\n"; else di<<"No model loaded\n";
return 1; return 1;
} }
// Choice of treatment // Choice of treatment
@ -4665,14 +4665,14 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
} }
if (modepri == 0) { //fin if (modepri == 0) { //fin
di << "Bye and good luck! " << "\n"; di << "Bye and good luck! \n";
break; break;
} }
else if (modepri <= 2) { // 1 : Visible Roots, 2 : All Roots else if (modepri <= 2) { // 1 : Visible Roots, 2 : All Roots
di << "All Geometry Transfer"<<"\n"; di << "All Geometry Transfer\n";
di<<"spline_continuity (read) : "<<Interface_Static::IVal("read.iges.bspline.continuity")<<" (0 : no modif, 1 : C1, 2 : C2)"<<"\n"; di<<"spline_continuity (read) : "<<Interface_Static::IVal("read.iges.bspline.continuity")<<" (0 : no modif, 1 : C1, 2 : C2)\n";
di<<" To modify : command param read.iges.bspline.continuity"<<"\n"; di<<" To modify : command param read.iges.bspline.continuity\n";
Handle(XSControl_WorkSession) thesession = Reader.WS(); Handle(XSControl_WorkSession) thesession = Reader.WS();
thesession->ClearContext(); thesession->ClearContext();
XSDRAW::SetTransferProcess (thesession->MapReader()); XSDRAW::SetTransferProcess (thesession->MapReader());
@ -4702,7 +4702,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
if ( answer == 1 || answer == 3) { if ( answer == 1 || answer == 3) {
TopoDS_Shape shape = Reader.OneShape(); TopoDS_Shape shape = Reader.OneShape();
// save the shape // save the shape
if (shape.IsNull()) { di<<"No Shape produced"<<"\n"; continue; } if (shape.IsNull()) { di<<"No Shape produced\n"; continue; }
char fname[110]; char fname[110];
Sprintf(fname, "%s", rnom.ToCString()); Sprintf(fname, "%s", rnom.ToCString());
di << "Saving shape in variable Draw : " << fname << "\n"; di << "Saving shape in variable Draw : " << fname << "\n";
@ -4714,7 +4714,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
catch(Standard_Failure) { catch(Standard_Failure) {
di << "** Exception : "; di << "** Exception : ";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di<<" ** Skip"<<"\n"; di<<" ** Skip\n";
di << "Saving shape in variable Draw : " << fname << "\n"; di << "Saving shape in variable Draw : " << fname << "\n";
IGESToBRep::WriteShape (shape,1); IGESToBRep::WriteShape (shape,1);
} }
@ -4725,7 +4725,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
for (Standard_Integer inum = 1; inum <= numshape; inum++) { for (Standard_Integer inum = 1; inum <= numshape; inum++) {
// save all the shapes // save all the shapes
TopoDS_Shape shape = Reader.Shape(inum); TopoDS_Shape shape = Reader.Shape(inum);
if (shape.IsNull()) { di<<"No Shape produced"<<"\n"; continue; } if (shape.IsNull()) { di<<"No Shape produced\n"; continue; }
char fname[110]; char fname[110];
Sprintf(fname, "%s_%d", rnom.ToCString(),inum); Sprintf(fname, "%s_%d", rnom.ToCString(),inum);
di << "Saving shape in variable Draw : " << fname << "\n"; di << "Saving shape in variable Draw : " << fname << "\n";
@ -4737,7 +4737,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
catch(Standard_Failure) { catch(Standard_Failure) {
di << "** Exception : "; di << "** Exception : ";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di<<" ** Skip"<<"\n"; di<<" ** Skip\n";
} }
} }
} }
@ -4751,12 +4751,12 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
cout << " give the number of the Entity : " << flush; cout << " give the number of the Entity : " << flush;
nent = XSDRAW::GetEntityNumber(); nent = XSDRAW::GetEntityNumber();
if (!Reader.TransferOne (nent)) di<<"Transfer entity n0 "<<nent<<" : no result"<<"\n"; if (!Reader.TransferOne (nent)) di<<"Transfer entity n0 "<<nent<<" : no result\n";
else { else {
nbs = Reader.NbShapes(); nbs = Reader.NbShapes();
char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nent); char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nent);
di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n"; di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n"; di<<"Now, "<<nbs<<" Shapes produced\n";
TopoDS_Shape sh = Reader.Shape(nbs); TopoDS_Shape sh = Reader.Shape(nbs);
DBRep::Set (shname,sh); DBRep::Set (shname,sh);
} }
@ -4771,9 +4771,9 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
// *r donne xst-model-roots (TOUTES racines) // *r donne xst-model-roots (TOUTES racines)
if( fromtcl && argv[3][0]=='*' && argv[3][1]=='\0' ) { if( fromtcl && argv[3][0]=='*' && argv[3][1]=='\0' ) {
di << "All Geometry Transfer"<<"\n"; di << "All Geometry Transfer\n";
di<<"spline_continuity (read) : "<<Interface_Static::IVal("read.iges.bspline.continuity")<<" (0 : no modif, 1 : C1, 2 : C2)"<<"\n"; di<<"spline_continuity (read) : "<<Interface_Static::IVal("read.iges.bspline.continuity")<<" (0 : no modif, 1 : C1, 2 : C2)\n";
di<<" To modify : command param read.iges.bspline.continuity"<<"\n"; di<<" To modify : command param read.iges.bspline.continuity\n";
Handle(XSControl_WorkSession) thesession = Reader.WS(); Handle(XSControl_WorkSession) thesession = Reader.WS();
thesession->ClearContext(); thesession->ClearContext();
XSDRAW::SetTransferProcess (thesession->MapReader()); XSDRAW::SetTransferProcess (thesession->MapReader());
@ -4801,7 +4801,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
catch(Standard_Failure) { catch(Standard_Failure) {
di << "** Exception : "; di << "** Exception : ";
di << Standard_Failure::Caught()->GetMessageString(); di << Standard_Failure::Caught()->GetMessageString();
di<<" ** Skip"<<"\n"; di<<" ** Skip\n";
di << "Saving shape in variable Draw : " << fname << "\n"; di << "Saving shape in variable Draw : " << fname << "\n";
IGESToBRep::WriteShape (shape,1); IGESToBRep::WriteShape (shape,1);
} }
@ -4820,7 +4820,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
list = XSDRAW::GetList (compart.ToCString()); list = XSDRAW::GetList (compart.ToCString());
} }
if (list.IsNull()) { if (list.IsNull()) {
di<<"No list defined. Give a selection name or * for all visible transferrable roots"<<"\n"; di<<"No list defined. Give a selection name or * for all visible transferrable roots\n";
continue; continue;
} }
} }
@ -4864,12 +4864,12 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer
nent = Reader.Model()->Number(list->Value(ill)); nent = Reader.Model()->Number(list->Value(ill));
if (nent == 0) continue; if (nent == 0) continue;
if (!Reader.TransferOne(nent)) di<<"Transfer entity n0 "<<nent<<" : no result"<<"\n"; if (!Reader.TransferOne(nent)) di<<"Transfer entity n0 "<<nent<<" : no result\n";
else { else {
nbs = Reader.NbShapes(); nbs = Reader.NbShapes();
char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nbs); char shname[30]; Sprintf (shname,"%s_%d",rnom.ToCString(),nbs);
di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n"; di<<"Transfer entity n0 "<<nent<<" OK -> DRAW Shape: "<<shname<<"\n";
di<<"Now, "<<nbs<<" Shapes produced"<<"\n"; di<<"Now, "<<nbs<<" Shapes produced\n";
TopoDS_Shape sh = Reader.Shape(nbs); TopoDS_Shape sh = Reader.Shape(nbs);
DBRep::Set (shname,sh); DBRep::Set (shname,sh);
nbt++; nbt++;
@ -4928,7 +4928,7 @@ static Standard_Integer OCC20627 (Draw_Interpretor& di, Standard_Integer argc, c
{ {
if(argc!=2) if(argc!=2)
{ {
di << "Usage : " << argv[0] << " MaxNbr" << "\n"; di << "Usage : " << argv[0] << " MaxNbr\n";
return -1; return -1;
} }
Standard_Integer aMaxNbr = Draw::Atoi(argv[1]); Standard_Integer aMaxNbr = Draw::Atoi(argv[1]);
@ -4951,7 +4951,7 @@ Standard_Integer OCC22762 (Draw_Interpretor& di, Standard_Integer argc, const ch
{ {
if (argc!=7) if (argc!=7)
{ {
di << "Wrong number of arguments" << "\n"; di << "Wrong number of arguments\n";
return -1; return -1;
} }
Standard_Real X1_Pnt = Draw::Atof(argv[1]); Standard_Real X1_Pnt = Draw::Atof(argv[1]);
@ -4977,7 +4977,7 @@ Standard_Integer OCC17424 (Draw_Interpretor& di, Standard_Integer argc, const ch
{ {
if(argc!=9) if(argc!=9)
{ {
di << "Usage : " << argv[0] << " shape X_Pnt Y_Pnt Z_Pnt X_Dir Y_Dir Z_Dir PInf" << "\n"; di << "Usage : " << argv[0] << " shape X_Pnt Y_Pnt Z_Pnt X_Dir Y_Dir Z_Dir PInf\n";
return -1; return -1;
} }
@ -5035,8 +5035,8 @@ Standard_Integer OCC22301 (Draw_Interpretor& di, Standard_Integer argc, const ch
for (Standard_Integer i = 0; i < 2; i++) for (Standard_Integer i = 0; i < 2; i++)
aPartMask.Add(i); aPartMask.Add(i);
di << "aFullMask = 1111" << "\n"; di << "aFullMask = 1111\n";
di << "aPartMask = 1100" << "\n"; di << "aPartMask = 1100\n";
Standard_Boolean isAffected; Standard_Boolean isAffected;
@ -5262,7 +5262,7 @@ Standard_Integer CR23234 (Draw_Interpretor& di, Standard_Integer argc, const cha
// Check the command arguments // Check the command arguments
if (argc != 2) if (argc != 2)
{ {
di <<"Error: "<<argv[0]<<" - invalid number of arguments"<< "\n"; di <<"Error: "<<argv[0]<<" - invalid number of arguments\n";
di << "Usage : " << argv[0] << " mode(0/1)\n"; di << "Usage : " << argv[0] << " mode(0/1)\n";
return 1; //TCL_ERROR return 1; //TCL_ERROR
} }
@ -5274,7 +5274,7 @@ Standard_Integer CR23234 (Draw_Interpretor& di, Standard_Integer argc, const cha
Handle(AIS_InteractiveContext) aisContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aisContext = ViewerTest::GetAISContext();
if (aisContext.IsNull()) if (aisContext.IsNull())
{ {
di <<"Error: call 'vinit' first"<< "\n"; di <<"Error: call 'vinit' first\n";
return 1; //TCL_ERROR return 1; //TCL_ERROR
} }

View File

@ -44,7 +44,7 @@ static Standard_Integer OCC895 (Draw_Interpretor& di, Standard_Integer argc, con
{ {
if (argc < 2 || argc > 5) if (argc < 2 || argc > 5)
{ {
di << "Usage : " << argv[0] << " result [angle [reverse [order]]]" << "\n"; di << "Usage : " << argv[0] << " result [angle [reverse [order]]]\n";
return 1; return 1;
} }

View File

@ -75,10 +75,10 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
//if ((bend_angle >= M_PI)) { //if ((bend_angle >= M_PI)) {
if ((bend_angle >= M_PI)) { if ((bend_angle >= M_PI)) {
di << "The arguments are invalid." << "\n"; di << "The arguments are invalid.\n";
return 1; return 1;
} }
di << "creating the shape for a bent tube" << "\n"; di << "creating the shape for a bent tube\n";
double radius_l = dia1/2.0; double radius_l = dia1/2.0;
double radius_r = dia2/2.0; double radius_r = dia2/2.0;
@ -313,60 +313,60 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
if (check) { if (check) {
if (!(BRepCheck_Analyzer(wallSolid).IsValid())) if (!(BRepCheck_Analyzer(wallSolid).IsValid()))
di << "The TopoDS_Solid was checked, and it was invalid!" << "\n"; di << "The TopoDS_Solid was checked, and it was invalid!\n";
else else
di << "The TopoDS_Solid was checked, and it was valid." << "\n"; di << "The TopoDS_Solid was checked, and it was valid.\n";
if (!wallSolid.Closed()) if (!wallSolid.Closed())
di << "The TopoDS_Solid is not closed!" << "\n"; di << "The TopoDS_Solid is not closed!\n";
else else
di << "The TopoDS_Solid is closed." << "\n"; di << "The TopoDS_Solid is closed.\n";
if (!wallSolid.Checked()) if (!wallSolid.Checked())
di << "The TopoDS_Solid is not checked!" << "\n"; di << "The TopoDS_Solid is not checked!\n";
else else
di << "The TopoDS_Solid has been checked." << "\n"; di << "The TopoDS_Solid has been checked.\n";
if (wallSolid.Infinite()) if (wallSolid.Infinite())
di << "The TopoDS_Solid is infinite!" << "\n"; di << "The TopoDS_Solid is infinite!\n";
else else
di << "The TopoDS_Solid is finite." << "\n"; di << "The TopoDS_Solid is finite.\n";
} }
di << "The result is a "; di << "The result is a ";
// Check to see if we have a solid // Check to see if we have a solid
switch (wallSolid.ShapeType()) { switch (wallSolid.ShapeType()) {
case (TopAbs_COMPOUND): case (TopAbs_COMPOUND):
di << "TopAbs_COMPOUND" << "\n"; di << "TopAbs_COMPOUND\n";
break; break;
case (TopAbs_COMPSOLID): case (TopAbs_COMPSOLID):
di << "TopAbs_COMPSOLID" << "\n"; di << "TopAbs_COMPSOLID\n";
break; break;
case (TopAbs_SOLID): case (TopAbs_SOLID):
di << "TopAbs_SOLID" << "\n"; di << "TopAbs_SOLID\n";
break; break;
case (TopAbs_SHELL): case (TopAbs_SHELL):
di << "TopAbs_SHELL" << "\n"; di << "TopAbs_SHELL\n";
break; break;
case (TopAbs_FACE): case (TopAbs_FACE):
di << "TopAbs_FACE" << "\n"; di << "TopAbs_FACE\n";
break; break;
case (TopAbs_WIRE): case (TopAbs_WIRE):
di << "TopAbs_WIRE" << "\n"; di << "TopAbs_WIRE\n";
break; break;
case (TopAbs_EDGE): case (TopAbs_EDGE):
di << "TopAbs_EDGE" << "\n"; di << "TopAbs_EDGE\n";
break; break;
case (TopAbs_VERTEX): case (TopAbs_VERTEX):
di << "TopAbs_VERTEX" << "\n"; di << "TopAbs_VERTEX\n";
break; break;
case (TopAbs_SHAPE): case (TopAbs_SHAPE):
di << "TopAbs_SHAPE" << "\n"; di << "TopAbs_SHAPE\n";
} }
di << "Can we turn it into a solid? "; di << "Can we turn it into a solid? ";
try { try {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
di << " yes" << "\n"; di << " yes\n";
} }
catch (Standard_TypeMismatch) { catch (Standard_TypeMismatch) {
di << " no" << "\n"; di << " no\n";
} }
getFaces.Clear(); getFaces.Clear();
@ -400,7 +400,7 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc,
static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if(argc > 7) { if(argc > 7) {
di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]" << "\n"; di << "Usage : " << argv[0] << " [[[[[wT [[[[d1 [[[d2 [[R [length [BRepAlgoAPI/BRepAlgo = 1/0]]]]]]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -409,7 +409,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -438,10 +438,10 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
// mkv 15.07.03 if ((bend_angle >= 2.0*M_PI)) { // mkv 15.07.03 if ((bend_angle >= 2.0*M_PI)) {
if ((bend_angle >= 2.0*M_PI)) { if ((bend_angle >= 2.0*M_PI)) {
di << "The arguments are invalid." << "\n"; di << "The arguments are invalid.\n";
return 1; return 1;
} }
di << "creating the shape for a bent tube" << "\n"; di << "creating the shape for a bent tube\n";
gp_Ax2 origin(gp_Pnt(500.0,-300.0, 100.0), gp_Ax2 origin(gp_Pnt(500.0,-300.0, 100.0),
gp_Dir(0.0, -1.0/sqrt(2.0), -1.0/sqrt(2.0))); gp_Dir(0.0, -1.0/sqrt(2.0), -1.0/sqrt(2.0)));
@ -634,31 +634,31 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
// Check to see if we have a solid // Check to see if we have a solid
switch (SewIt.SewedShape().ShapeType()) { switch (SewIt.SewedShape().ShapeType()) {
case (TopAbs_COMPOUND): case (TopAbs_COMPOUND):
di << "TopAbs_COMPOUND" << "\n"; di << "TopAbs_COMPOUND\n";
break; break;
case (TopAbs_COMPSOLID): case (TopAbs_COMPSOLID):
di << "TopAbs_COMPSOLID" << "\n"; di << "TopAbs_COMPSOLID\n";
break; break;
case (TopAbs_SOLID): case (TopAbs_SOLID):
di << "TopAbs_SOLID" << "\n"; di << "TopAbs_SOLID\n";
break; break;
case (TopAbs_SHELL): case (TopAbs_SHELL):
di << "TopAbs_SHELL" << "\n"; di << "TopAbs_SHELL\n";
break; break;
case (TopAbs_FACE): case (TopAbs_FACE):
di << "TopAbs_FACE" << "\n"; di << "TopAbs_FACE\n";
break; break;
case (TopAbs_WIRE): case (TopAbs_WIRE):
di << "TopAbs_WIRE" << "\n"; di << "TopAbs_WIRE\n";
break; break;
case (TopAbs_EDGE): case (TopAbs_EDGE):
di << "TopAbs_EDGE" << "\n"; di << "TopAbs_EDGE\n";
break; break;
case (TopAbs_VERTEX): case (TopAbs_VERTEX):
di << "TopAbs_VERTEX" << "\n"; di << "TopAbs_VERTEX\n";
break; break;
case (TopAbs_SHAPE): case (TopAbs_SHAPE):
di << "TopAbs_SHAPE" << "\n"; di << "TopAbs_SHAPE\n";
} }
BRep_Builder B; BRep_Builder B;
@ -670,19 +670,19 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
TubeShell = TopoDS::Shell(SewIt.SewedShape()); TubeShell = TopoDS::Shell(SewIt.SewedShape());
B.MakeSolid(wallSolid); B.MakeSolid(wallSolid);
B.Add(wallSolid,TubeShell); B.Add(wallSolid,TubeShell);
di << " yes" << "\n"; di << " yes\n";
} }
catch (Standard_TypeMismatch) { catch (Standard_TypeMismatch) {
di << "Can't convert to shell..." << "\n"; di << "Can't convert to shell...\n";
TopExp_Explorer getSol; TopExp_Explorer getSol;
getSol.Init(SewIt.SewedShape(), TopAbs_SOLID); getSol.Init(SewIt.SewedShape(), TopAbs_SOLID);
if (getSol.More()) { if (getSol.More()) {
di << "First solid found in compound" << "\n"; di << "First solid found in compound\n";
wallSolid = TopoDS::Solid(getSol.Current()); wallSolid = TopoDS::Solid(getSol.Current());
TopoDS_Solid test_solid; TopoDS_Solid test_solid;
while (getSol.More()) while (getSol.More())
{ {
di << "Next solid found in compound" << "\n"; di << "Next solid found in compound\n";
getSol.Next(); getSol.Next();
test_solid = TopoDS::Solid(getSol.Current()); test_solid = TopoDS::Solid(getSol.Current());
//////#if ! defined(BRepAlgoAPI_def01) //////#if ! defined(BRepAlgoAPI_def01)
@ -692,12 +692,12 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
//////#endif //////#endif
////// fuser.Build(); ////// fuser.Build();
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)" <<"\n"; di << "BRepAlgoAPI_Fuse fuser(test_solid, wallSolid)\n";
BRepAlgoAPI_Fuse fuser(test_solid, wallSolid); BRepAlgoAPI_Fuse fuser(test_solid, wallSolid);
fuser.Build(); fuser.Build();
wallSolid = TopoDS::Solid(fuser.Shape()); wallSolid = TopoDS::Solid(fuser.Shape());
} else { } else {
di << "BRepAlgo_Fuse fuser(test_solid, wallSolid)" <<"\n"; di << "BRepAlgo_Fuse fuser(test_solid, wallSolid)\n";
BRepAlgo_Fuse fuser(test_solid, wallSolid); BRepAlgo_Fuse fuser(test_solid, wallSolid);
fuser.Build(); fuser.Build();
wallSolid = TopoDS::Solid(fuser.Shape()); wallSolid = TopoDS::Solid(fuser.Shape());
@ -709,14 +709,14 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
TopExp_Explorer getShel; TopExp_Explorer getShel;
getShel.Init(SewIt.SewedShape(), TopAbs_SHELL); getShel.Init(SewIt.SewedShape(), TopAbs_SHELL);
if (getShel.More()) { if (getShel.More()) {
di << "First shell found in compound" << "\n"; di << "First shell found in compound\n";
B.MakeSolid(wallSolid); B.MakeSolid(wallSolid);
di << "B.Add(wallSolid,TopoDS::Shell(getShel.Current()));" << "\n"; di << "B.Add(wallSolid,TopoDS::Shell(getShel.Current()));\n";
int i = 1; int i = 1;
while (getShel.More()) while (getShel.More())
{ {
di << "Next shell found in compound" << "\n"; di << "Next shell found in compound\n";
di << "B.Add(wallSolid,TopoDS::Shell(getShel.Current()));" << "\n"; di << "B.Add(wallSolid,TopoDS::Shell(getShel.Current()));\n";
Sprintf(name,"shell%d", i++); Sprintf(name,"shell%d", i++);
DBRep::Set(name,getShel.Current()); DBRep::Set(name,getShel.Current());
B.Add(wallSolid,TopoDS::Shell(getShel.Current())); B.Add(wallSolid,TopoDS::Shell(getShel.Current()));
@ -736,52 +736,52 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con
if (check) { if (check) {
if (!(BRepCheck_Analyzer(wallSolid).IsValid())) if (!(BRepCheck_Analyzer(wallSolid).IsValid()))
di << "The TopoDS_Solid was checked, and it was invalid!" << "\n"; di << "The TopoDS_Solid was checked, and it was invalid!\n";
else else
di << "The TopoDS_Solid was checked, and it was valid." << "\n"; di << "The TopoDS_Solid was checked, and it was valid.\n";
if (!wallSolid.Closed()) if (!wallSolid.Closed())
di << "The TopoDS_Solid is not closed!" << "\n"; di << "The TopoDS_Solid is not closed!\n";
else else
di << "The TopoDS_Solid is closed." << "\n"; di << "The TopoDS_Solid is closed.\n";
if (!wallSolid.Checked()) if (!wallSolid.Checked())
di << "The TopoDS_Solid is not checked!" << "\n"; di << "The TopoDS_Solid is not checked!\n";
else else
di << "The TopoDS_Solid has been checked." << "\n"; di << "The TopoDS_Solid has been checked.\n";
if (wallSolid.Infinite()) if (wallSolid.Infinite())
di << "The TopoDS_Solid is infinite!" << "\n"; di << "The TopoDS_Solid is infinite!\n";
else else
di << "The TopoDS_Solid is finite." << "\n"; di << "The TopoDS_Solid is finite.\n";
} }
di << "The result is a "; di << "The result is a ";
// Check to see if we have a solid // Check to see if we have a solid
switch (wallSolid.ShapeType()) { switch (wallSolid.ShapeType()) {
case (TopAbs_COMPOUND): case (TopAbs_COMPOUND):
di << "TopAbs_COMPOUND" << "\n"; di << "TopAbs_COMPOUND\n";
break; break;
case (TopAbs_COMPSOLID): case (TopAbs_COMPSOLID):
di << "TopAbs_COMPSOLID" << "\n"; di << "TopAbs_COMPSOLID\n";
break; break;
case (TopAbs_SOLID): case (TopAbs_SOLID):
di << "TopAbs_SOLID" << "\n"; di << "TopAbs_SOLID\n";
break; break;
case (TopAbs_SHELL): case (TopAbs_SHELL):
di << "TopAbs_SHELL" << "\n"; di << "TopAbs_SHELL\n";
break; break;
case (TopAbs_FACE): case (TopAbs_FACE):
di << "TopAbs_FACE" << "\n"; di << "TopAbs_FACE\n";
break; break;
case (TopAbs_WIRE): case (TopAbs_WIRE):
di << "TopAbs_WIRE" << "\n"; di << "TopAbs_WIRE\n";
break; break;
case (TopAbs_EDGE): case (TopAbs_EDGE):
di << "TopAbs_EDGE" << "\n"; di << "TopAbs_EDGE\n";
break; break;
case (TopAbs_VERTEX): case (TopAbs_VERTEX):
di << "TopAbs_VERTEX" << "\n"; di << "TopAbs_VERTEX\n";
break; break;
case (TopAbs_SHAPE): case (TopAbs_SHAPE):
di << "TopAbs_SHAPE" << "\n"; di << "TopAbs_SHAPE\n";
} }
return 0; return 0;
@ -810,7 +810,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
////////// return 1; ////////// return 1;
//////////} //////////}
if(argc < 3 || argc > 4) { if(argc < 3 || argc > 4) {
di << "Usage : " << argv[0] << " result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " result mesh_delta [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -819,11 +819,11 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def02) #if ! defined(BRepAlgo_def02)
// di << "Error: There is not BRepAlgo_Cut class" << "\n"; // di << "Error: There is not BRepAlgo_Cut class\n";
// return 1; // return 1;
#endif #endif
#if ! defined(BRepAlgo_def03) #if ! defined(BRepAlgo_def03)
// di << "Error: There is not BRepAlgo_Common class" << "\n"; // di << "Error: There is not BRepAlgo_Common class\n";
// return 1; // return 1;
#endif #endif
} }
@ -833,7 +833,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
Standard_Real mesh_delt = Draw::Atof(argv[2]); Standard_Real mesh_delt = Draw::Atof(argv[2]);
if (mesh_delt <= 0.0) if (mesh_delt <= 0.0)
{ {
di<<"Error: mesh_delta must be positive value"<<"\n"; di<<"Error: mesh_delta must be positive value\n";
return -1; return -1;
} }
@ -860,21 +860,21 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Shape cut_shape; TopoDS_Shape cut_shape;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )" <<"\n"; di << "BRepAlgoAPI_Cut cut( fullSolid, internalSolid )\n";
BRepAlgoAPI_Cut cut( fullSolid, internalSolid ); BRepAlgoAPI_Cut cut( fullSolid, internalSolid );
cut_shape = cut.Shape(); cut_shape = cut.Shape();
if ( !cut.IsDone() ) if ( !cut.IsDone() )
{ {
di << "Error: Could not cut volumes" << "\n"; di << "Error: Could not cut volumes\n";
return -1; return -1;
} }
} else { } else {
di << "BRepAlgo_Cut cut( fullSolid, internalSolid )" <<"\n"; di << "BRepAlgo_Cut cut( fullSolid, internalSolid )\n";
BRepAlgo_Cut cut( fullSolid, internalSolid ); BRepAlgo_Cut cut( fullSolid, internalSolid );
cut_shape = cut.Shape(); cut_shape = cut.Shape();
if ( !cut.IsDone() ) if ( !cut.IsDone() )
{ {
di << "Error: Could not cut volumes" << "\n"; di << "Error: Could not cut volumes\n";
return -1; return -1;
} }
} }
@ -890,7 +890,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
} }
if ( found_solid != 1 ) if ( found_solid != 1 )
{ {
di << "Error: Cut operation produced " << found_solid << " solids" << "\n"; di << "Error: Cut operation produced " << found_solid << " solids\n";
return -1; return -1;
} }
DBRep::Set(argv[1],cutSolid); DBRep::Set(argv[1],cutSolid);
@ -913,7 +913,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
Xmax += delt; Xmax += delt;
Ymax += delt; Ymax += delt;
Zmax += delt; Zmax += delt;
di<<"Info: Bounds\n ("<<Xmin<<","<<Ymin<<","<<Zmin<<")\n ("<<Xmax<<","<<Ymax<<","<<Zmax<<")"<<"\n"; di<<"Info: Bounds\n ("<<Xmin<<","<<Ymin<<","<<Zmin<<")\n ("<<Xmax<<","<<Ymax<<","<<Zmax<<")\n";
// grid the bounding box // grid the bounding box
Standard_Integer NumXsubvolumes = (Standard_Integer)((Xmax - Xmin) / mesh_delt); if (NumXsubvolumes <= 0) NumXsubvolumes = 1; Standard_Integer NumXsubvolumes = (Standard_Integer)((Xmax - Xmin) / mesh_delt); if (NumXsubvolumes <= 0) NumXsubvolumes = 1;
@ -992,7 +992,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
TopoDS_Shape aCommonShape; TopoDS_Shape aCommonShape;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))" <<"\n"; di << "BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n";
BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); BRepAlgoAPI_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
if (!common.IsDone()) if (!common.IsDone())
{ {
@ -1001,7 +1001,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
} }
aCommonShape = common.Shape(); aCommonShape = common.Shape();
} else { } else {
di << "BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))" <<"\n"; di << "BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l))\n";
BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l)); BRepAlgo_Common common(copySolid/*cutSolid*/, SubvolumeSolid(l));
if (!common.IsDone()) if (!common.IsDone())
{ {
@ -1022,7 +1022,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
} }
if ( found_solid != 1 ) if ( found_solid != 1 )
{ {
di << "Info: Common operation " << l << " produced " << found_solid << " solids" << "\n"; di << "Info: Common operation " << l << " produced " << found_solid << " solids\n";
} }
else else
{ {
@ -1033,9 +1033,9 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
const Standard_Boolean err = (vol > SubvolumeVol(l)) || (vol <= 0.0); const Standard_Boolean err = (vol > SubvolumeVol(l)) || (vol <= 0.0);
//cout << (err? "ERROR" : "Info") << ": final subvolume " << l << " volume = " << vol << endl; //cout << (err? "ERROR" : "Info") << ": final subvolume " << l << " volume = " << vol << endl;
if (err) if (err)
di << "ERROR" << ": final subvolume " << l << " volume = " << vol << "\n"; di << "ERROR: final subvolume " << l << " volume = " << vol << "\n";
else else
di << "Info" << ": final subvolume " << l << " volume = " << vol << "\n"; di << "Info: final subvolume " << l << " volume = " << vol << "\n";
accumulatedVolume += vol; accumulatedVolume += vol;
if (err) if (err)
{ {

View File

@ -88,7 +88,7 @@ static Standard_Integer BUC60897 (Draw_Interpretor& di, Standard_Integer /*argc*
Geom2dGcc_Circ2d2TanRad aGccCirc2d(aQualifCurve1, aQualifCurve2, 10, 1e-7); Geom2dGcc_Circ2d2TanRad aGccCirc2d(aQualifCurve1, aQualifCurve2, 10, 1e-7);
if(!aGccCirc2d.IsDone()) if(!aGccCirc2d.IsDone())
{ {
di << "Faulty: can not create a circle." << "\n"; di << "Faulty: can not create a circle.\n";
return 1; return 1;
} }
for(Standard_Integer i = 1; i <= aGccCirc2d.NbSolutions(); i++) for(Standard_Integer i = 1; i <= aGccCirc2d.NbSolutions(); i++)
@ -99,34 +99,34 @@ static Standard_Integer BUC60897 (Draw_Interpretor& di, Standard_Integer /*argc*
gp_Pnt2d aPnt2d1, aPnt2d2; gp_Pnt2d aPnt2d1, aPnt2d2;
aGccCirc2d.Tangency1(i, aTmpR1, aTmpR2, aPnt2d1); aGccCirc2d.Tangency1(i, aTmpR1, aTmpR2, aPnt2d1);
aGccCirc2d.Tangency2(i, aTmpR1, aTmpR2, aPnt2d2); aGccCirc2d.Tangency2(i, aTmpR1, aTmpR2, aPnt2d2);
di << "\n" << "tangency1 : X " << aPnt2d1.X() << " Y " << aPnt2d1.Y(); di << "\ntangency1 : X " << aPnt2d1.X() << " Y " << aPnt2d1.Y();
di << "\n" << "tangency2 : X " << aPnt2d2.X() << " Y " << aPnt2d2.Y() << "\n"; di << "\ntangency2 : X " << aPnt2d2.X() << " Y " << aPnt2d2.Y() << "\n";
Sprintf(abuf,"circle_%d",i); Sprintf(abuf,"circle_%d",i);
Handle(Geom2d_Curve) circ_res = new Geom2d_Circle(aCirc2d); Handle(Geom2d_Curve) circ_res = new Geom2d_Circle(aCirc2d);
DrawTrSurf::Set (st, circ_res); DrawTrSurf::Set (st, circ_res);
} }
di << "done" << "\n"; di << "done\n";
return 0; return 0;
} }
static Standard_Integer BUC60889 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60889 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 10) { if(argc != 10) {
di << "Usage : " << argv[0] << " point_1 point_2 name_of_edge bndbox_X1 bndbox_Y1 bndbox_Z1 bndbox_X2 bndbox_Y2 bndbox_Z2" << "\n"; di << "Usage : " << argv[0] << " point_1 point_2 name_of_edge bndbox_X1 bndbox_Y1 bndbox_Z1 bndbox_X2 bndbox_Y2 bndbox_Z2\n";
return 1; return 1;
} else { } else {
gp_Pnt p1, p2; gp_Pnt p1, p2;
if (!(DrawTrSurf::GetPoint(argv[1], p1)) || !(DrawTrSurf::GetPoint(argv[2], p2))) if (!(DrawTrSurf::GetPoint(argv[1], p1)) || !(DrawTrSurf::GetPoint(argv[2], p2)))
{ {
di << "Need two points to define a band" << "\n"; di << "Need two points to define a band\n";
return 1; return 1;
} }
TopoDS_Edge ed = TopoDS::Edge(DBRep::Get(argv[3])); TopoDS_Edge ed = TopoDS::Edge(DBRep::Get(argv[3]));
if (ed.IsNull()) if (ed.IsNull())
{ {
di << "Need an edge to define the band direction" << "\n"; di << "Need an edge to define the band direction\n";
return 1; return 1;
} }
BRepAdaptor_Curve curve(ed); BRepAdaptor_Curve curve(ed);
@ -134,9 +134,9 @@ static Standard_Integer BUC60889 (Draw_Interpretor& di, Standard_Integer argc, c
Bnd_Box bnd_box; Bnd_Box bnd_box;
bnd_box.Update(Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7]), Draw::Atof(argv[8]), Draw::Atof(argv[9])); bnd_box.Update(Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7]), Draw::Atof(argv[8]), Draw::Atof(argv[9]));
if(bnd_box.IsOut(p1, p2, d)) if(bnd_box.IsOut(p1, p2, d))
di << "The band lies out of the box" << "\n"; di << "The band lies out of the box\n";
else else
di << "The band intersects the box" << "\n"; di << "The band intersects the box\n";
return 0; return 0;
} }
@ -145,20 +145,20 @@ static Standard_Integer BUC60889 (Draw_Interpretor& di, Standard_Integer argc, c
static Standard_Integer BUC60852 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60852 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 8) if(argc != 8)
di << "Usage : " << argv[0] << " name_of_edge bndbox_X1 bndbox_Y1 bndbox_Z1 bndbox_X2 bndbox_Y2 bndbox_Z2" << "\n"; di << "Usage : " << argv[0] << " name_of_edge bndbox_X1 bndbox_Y1 bndbox_Z1 bndbox_X2 bndbox_Y2 bndbox_Z2\n";
else { else {
TopoDS_Edge shape = TopoDS::Edge(DBRep::Get(argv[1])); TopoDS_Edge shape = TopoDS::Edge(DBRep::Get(argv[1]));
if(shape.ShapeType() != TopAbs_EDGE) if(shape.ShapeType() != TopAbs_EDGE)
di << "shape must be an edge" << "\n"; di << "shape must be an edge\n";
else { else {
BRepAdaptor_Curve curve(shape); BRepAdaptor_Curve curve(shape);
gp_Lin lin = curve.Line(); gp_Lin lin = curve.Line();
Bnd_Box bnd_box; Bnd_Box bnd_box;
bnd_box.Update(Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7])); bnd_box.Update(Draw::Atof(argv[2]), Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atof(argv[5]), Draw::Atof(argv[6]), Draw::Atof(argv[7]));
if(bnd_box.IsOut(lin)) if(bnd_box.IsOut(lin))
di << "Line that lies on edge does not intersect the box" << "\n"; di << "Line that lies on edge does not intersect the box\n";
else else
di << "Line that lies on edge intersects the box" << "\n"; di << "Line that lies on edge intersects the box\n";
} }
} }
return 0; return 0;
@ -269,7 +269,7 @@ static Standard_Integer BUC60870 (Draw_Interpretor& di, Standard_Integer argc, c
{ {
Standard_Integer i1; Standard_Integer i1;
if (argc != 5) { if (argc != 5) {
di << "Usage : " << argv[0] << " result name_of_shape_1 name_of_shape_2 dev" << "\n"; di << "Usage : " << argv[0] << " result name_of_shape_1 name_of_shape_2 dev\n";
return 1; return 1;
} }
const char *ns1 = (argv[2]), *ns2 = (argv[3]), *ns0 = (argv[1]); const char *ns1 = (argv[2]), *ns2 = (argv[3]), *ns0 = (argv[1]);
@ -311,7 +311,7 @@ static Standard_Integer BUC60870 (Draw_Interpretor& di, Standard_Integer argc, c
} }
} }
} else { } else {
di << "Faulty : found a problem"<< "\n"; di << "Faulty : found a problem\n";
} }
return 0; return 0;
} }
@ -328,7 +328,7 @@ static Standard_Integer BUC60902 (Draw_Interpretor& di, Standard_Integer /*argc*
GeomAPI_Interpolate anInterpolater(aPnts, Standard_False, Precision::Confusion()); GeomAPI_Interpolate anInterpolater(aPnts, Standard_False, Precision::Confusion());
anInterpolater.Perform(); anInterpolater.Perform();
if(!anInterpolater.IsDone()) { if(!anInterpolater.IsDone()) {
di << "Faulty : error in interpolation" << "\n"; di << "Faulty : error in interpolation\n";
return 1; return 1;
} }
Handle(Geom_BSplineCurve) aCur = anInterpolater.Curve(); Handle(Geom_BSplineCurve) aCur = anInterpolater.Curve();
@ -341,7 +341,7 @@ static Standard_Integer BUC60902 (Draw_Interpretor& di, Standard_Integer /*argc*
anInterpolater1.Load(aFirstTang, aLastTang, Standard_False); anInterpolater1.Load(aFirstTang, aLastTang, Standard_False);
anInterpolater1.Perform(); anInterpolater1.Perform();
if(!anInterpolater1.IsDone()) { if(!anInterpolater1.IsDone()) {
di << "Faulty : error in interpolation 1" << "\n"; di << "Faulty : error in interpolation 1\n";
return 1; return 1;
} }
aCur = anInterpolater1.Curve(); aCur = anInterpolater1.Curve();
@ -351,16 +351,16 @@ static Standard_Integer BUC60902 (Draw_Interpretor& di, Standard_Integer /*argc*
di << " Tang1 after compute = " << aFirstTang1.X() << " " << aFirstTang1.Y() << " " << aFirstTang1.Z() << "\n"; di << " Tang1 after compute = " << aFirstTang1.X() << " " << aFirstTang1.Y() << " " << aFirstTang1.Z() << "\n";
di << " Tang2 after compute = " << aLastTang1.X() << " " << aLastTang1.Y() << " " << aLastTang1.Z() << "\n"; di << " Tang2 after compute = " << aLastTang1.X() << " " << aLastTang1.Y() << " " << aLastTang1.Z() << "\n";
if(aFirstTang.IsEqual(aFirstTang1, Precision::Confusion(), Precision::Angular())) { if(aFirstTang.IsEqual(aFirstTang1, Precision::Confusion(), Precision::Angular())) {
di << "First tangent is OK" << "\n"; di << "First tangent is OK\n";
} }
else { else {
di << "Faulty : first tangent is wrong" << "\n"; di << "Faulty : first tangent is wrong\n";
} }
if(aLastTang.IsEqual(aLastTang1, Precision::Confusion(), Precision::Angular())) { if(aLastTang.IsEqual(aLastTang1, Precision::Confusion(), Precision::Angular())) {
di << "Last tangent is OK" << "\n"; di << "Last tangent is OK\n";
} }
else { else {
di << "Faulty : last tangent is wrong" << "\n"; di << "Faulty : last tangent is wrong\n";
} }
return 0; return 0;
} }
@ -368,7 +368,7 @@ static Standard_Integer BUC60902 (Draw_Interpretor& di, Standard_Integer /*argc*
static Standard_Integer BUC60944 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60944 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 2) { if(argc != 2) {
di << "Usage : " << argv[0] << " path" << "\n"; di << "Usage : " << argv[0] << " path\n";
} }
TCollection_AsciiString in(argv[1]); TCollection_AsciiString in(argv[1]);
@ -376,7 +376,7 @@ static Standard_Integer BUC60944 (Draw_Interpretor& di, Standard_Integer argc, c
TCollection_AsciiString out; TCollection_AsciiString out;
aPath->SystemName(out); aPath->SystemName(out);
if(in == out) if(in == out)
di << "The convertion is right." << "\n"; di << "The convertion is right.\n";
else else
di << "Faulty : The convertion is incorrect : " << out.ToCString() << "\n"; di << "Faulty : The convertion is incorrect : " << out.ToCString() << "\n";
di << out.ToCString() << "\n"; di << out.ToCString() << "\n";
@ -524,14 +524,14 @@ Standard_Boolean BuildBoundWires(const TopoDS_Shape &theShell,
static Standard_Integer BUC60868 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60868 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 3) { if (argc != 3) {
di << "Usage : " <<argv[0] << " Result Shell" << "\n"; di << "Usage : " <<argv[0] << " Result Shell\n";
return 1; return 1;
} }
TopoDS_Shape aShell = DBRep::Get(argv[2]); TopoDS_Shape aShell = DBRep::Get(argv[2]);
if (aShell.IsNull()) { if (aShell.IsNull()) {
di << "Faulty : The shape is NULL" << "\n"; di << "Faulty : The shape is NULL\n";
return 1; return 1;
} }
@ -540,7 +540,7 @@ static Standard_Integer BUC60868 (Draw_Interpretor& di, Standard_Integer argc, c
TopoDS_Shape aRes; TopoDS_Shape aRes;
if (aListOfWires.IsEmpty()) if (aListOfWires.IsEmpty())
di << "no bound" << "\n"; di << "no bound\n";
else if (aListOfWires.Extent() == 1) else if (aListOfWires.Extent() == 1)
aRes = aListOfWires.First(); aRes = aListOfWires.First();
else { else {
@ -558,14 +558,14 @@ static Standard_Integer BUC60868 (Draw_Interpretor& di, Standard_Integer argc, c
static Standard_Integer BUC60924 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60924 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 5) { if (argc != 5) {
di << "Usage : " <<argv[0] << " curve X Y Z" << "\n"; di << "Usage : " <<argv[0] << " curve X Y Z\n";
return 1; return 1;
} }
Handle(Geom_Curve) aCurve = DrawTrSurf::GetCurve(argv[1]); Handle(Geom_Curve) aCurve = DrawTrSurf::GetCurve(argv[1]);
if (aCurve.IsNull()) { if (aCurve.IsNull()) {
di << "Faulty : the curve is NULL." << "\n"; di << "Faulty : the curve is NULL.\n";
return 1; return 1;
} }
@ -575,9 +575,9 @@ static Standard_Integer BUC60924 (Draw_Interpretor& di, Standard_Integer argc, c
isPlanar=ShapeAnalysis_Curve::IsPlanar(aCurve,aVec,1e-7); isPlanar=ShapeAnalysis_Curve::IsPlanar(aCurve,aVec,1e-7);
if(isPlanar) if(isPlanar)
di << "The curve is planar !" << "\n"; di << "The curve is planar !\n";
else else
di << "Faulty : the curve is not planar!" << "\n"; di << "Faulty : the curve is not planar!\n";
return 0; return 0;
} }
@ -628,7 +628,7 @@ static Standard_Integer BUC60920(Draw_Interpretor& di, Standard_Integer /*argc*
static Standard_Integer OCC983 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC983 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 2) { if (argc != 2) {
di << "Usage : " << argv[0] << " file" << "\n"; di << "Usage : " << argv[0] << " file\n";
return 1; return 1;
} }
@ -639,16 +639,16 @@ static Standard_Integer OCC983 (Draw_Interpretor& di, Standard_Integer argc, co
if(!aParser.parse(File)) { if(!aParser.parse(File)) {
myDOM=aParser.getDocument(); myDOM=aParser.getDocument();
di<<"Document parsed"<<"\n"; di<<"Document parsed\n";
} else { } else {
di<<"Document not parsed"<<"\n"; di<<"Document not parsed\n";
return 0; return 0;
} }
LDOM_Element root = myDOM.getDocumentElement(); LDOM_Element root = myDOM.getDocumentElement();
if ( root.isNull() ) { if ( root.isNull() ) {
di<<"Root element is null"<<"\n"; di<<"Root element is null\n";
return 0; return 0;
} }
@ -690,7 +690,7 @@ static Standard_Integer OCC983 (Draw_Interpretor& di, Standard_Integer argc, co
static Standard_Integer OCC984 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC984 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 2) { if (argc != 2) {
di << "Usage : " << argv[0] << " file" << "\n"; di << "Usage : " << argv[0] << " file\n";
return 1; return 1;
} }
@ -703,9 +703,9 @@ static Standard_Integer OCC984 (Draw_Interpretor& di, Standard_Integer argc, co
if(!aParser.parse(File)) { if(!aParser.parse(File)) {
myDOM=aParser.getDocument(); myDOM=aParser.getDocument();
di<<"Document parsed"<<"\n"; di<<"Document parsed\n";
} else { } else {
di<<"Document not parsed"<<"\n"; di<<"Document not parsed\n";
} }
return 0; return 0;
@ -715,7 +715,7 @@ static Standard_Integer OCC1786 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if( argc != 2) if( argc != 2)
{ {
di << "Usage : " << argv[0] << " AutoHilight=0/1" << "\n"; di << "Usage : " << argv[0] << " AutoHilight=0/1\n";
return 1; return 1;
} }
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
@ -835,7 +835,7 @@ static Standard_Integer OCC1919_set (Draw_Interpretor& di, Standard_Integer argc
{ {
if( argc != 2) if( argc != 2)
{ {
di << "Usage : " << argv[0] << " LC_NUMERIC" << "\n"; di << "Usage : " << argv[0] << " LC_NUMERIC\n";
return 1; return 1;
} }
TCollection_AsciiString aNumLocale(argv[1]); TCollection_AsciiString aNumLocale(argv[1]);
@ -872,7 +872,7 @@ static Standard_Integer OCC2932_SetIDUAttribute (Draw_Interpretor& di, Standard_
{ {
if( argc != 5) if( argc != 5)
{ {
di << "Usage : " << argv[0] << " (DF, entry, oldLocalID, newLocalID)" << "\n"; di << "Usage : " << argv[0] << " (DF, entry, oldLocalID, newLocalID)\n";
return 1; return 1;
} }
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
@ -903,7 +903,7 @@ static Standard_Integer OCC2932_SetTag (Draw_Interpretor& di, Standard_Integer a
{ {
if( argc != 4) if( argc != 4)
{ {
di << "Usage : " << argv[0] << " (DF, entry, Tag)" << "\n"; di << "Usage : " << argv[0] << " (DF, entry, Tag)\n";
return 1; return 1;
} }
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
@ -921,7 +921,7 @@ static Standard_Integer OCC2932_SetCurrent (Draw_Interpretor& di, Standard_Integ
{ {
if( argc != 3) if( argc != 3)
{ {
di << "Usage : " << argv[0] << " (DF, entry)" << "\n"; di << "Usage : " << argv[0] << " (DF, entry)\n";
return 1; return 1;
} }
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
@ -937,7 +937,7 @@ static Standard_Integer OCC2932_SetExpression (Draw_Interpretor& di, Standard_In
{ {
if( argc != 4) if( argc != 4)
{ {
di << "Usage : " << argv[0] << " (DF, entry, Expression)" << "\n"; di << "Usage : " << argv[0] << " (DF, entry, Expression)\n";
return 1; return 1;
} }
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
@ -955,7 +955,7 @@ static Standard_Integer OCC2932_SetRelation (Draw_Interpretor& di, Standard_Inte
{ {
if( argc != 4) if( argc != 4)
{ {
di << "Usage : " << argv[0] << " (DF, entry, Relation)" << "\n"; di << "Usage : " << argv[0] << " (DF, entry, Relation)\n";
return 1; return 1;
} }
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
@ -972,7 +972,7 @@ static Standard_Integer OCC3277 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if( argc != 2) if( argc != 2)
{ {
di << "Usage : " << argv[0] << " string" << "\n"; di << "Usage : " << argv[0] << " string\n";
return 1; return 1;
} }
TCollection_ExtendedString ExtendedString; TCollection_ExtendedString ExtendedString;
@ -989,7 +989,7 @@ static Standard_Integer OCC6794 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if (argc > 2) if (argc > 2)
{ {
di << "Usage: " << argv[0] << " [nb]" << "\n"; di << "Usage: " << argv[0] << " [nb]\n";
return 1; return 1;
} }

View File

@ -38,7 +38,7 @@ static Standard_Integer BUC60720 (Draw_Interpretor& di,Standard_Integer argc,con
} }
if(argc != 2) { if(argc != 2) {
di << "Usage : " << argv[0] << " 0/1" << "\n"; di << "Usage : " << argv[0] << " 0/1\n";
} }
if(Draw::Atoi(argv[1]) == 0) { if(Draw::Atoi(argv[1]) == 0) {
@ -56,7 +56,7 @@ static Standard_Integer BUC60720 (Draw_Interpretor& di,Standard_Integer argc,con
myAISContext->Display(theObject2); myAISContext->Display(theObject2);
} }
} else { } else {
di << "Usage : " << argv[0] << " 0/1" << "\n"; di << "Usage : " << argv[0] << " 0/1\n";
return -1; return -1;
} }
return 0; return 0;

View File

@ -89,12 +89,12 @@ Standard_EXPORT ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
static Standard_Integer BUC60848 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60848 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 2 ) { if ( argc != 2 ) {
di << "Usage : " << argv[0] << " shape " << "\n"; di << "Usage : " << argv[0] << " shape \n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get( argv[1] ); TopoDS_Shape S = DBRep::Get( argv[1] );
if ( S.IsNull() ) { if ( S.IsNull() ) {
di << "Shape is empty" << "\n"; di << "Shape is empty\n";
return 1; return 1;
} }
GProp_GProps G; GProp_GProps G;
@ -121,8 +121,8 @@ static Standard_Integer BUC60828 (Draw_Interpretor& di, Standard_Integer /*argc*
Standard_Boolean aValue1; Standard_Boolean aValue1;
aValue1=anEdge.Infinite(); aValue1=anEdge.Infinite();
di << "Current flag : " << (Standard_Integer) aValue1 << "\n"; di << "Current flag : " << (Standard_Integer) aValue1 << "\n";
if(aValue1) di << "Flag was set properly." << "\n"; if(aValue1) di << "Flag was set properly.\n";
else di << "Faulty : flag was not set properly." << "\n"; else di << "Faulty : flag was not set properly.\n";
return 0; return 0;
} }
@ -232,7 +232,7 @@ static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, c
} }
if(argc != 6) { if(argc != 6) {
di << "Usage : " << argv[0] << " edge edge plane val text" << "\n"; di << "Usage : " << argv[0] << " edge edge plane val text\n";
return 1; return 1;
} }
@ -264,13 +264,13 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
} }
if(argc != 5) { if(argc != 5) {
di << "Usage : " << argv[0] << " name plane Xlabel Ylabel" << "\n"; di << "Usage : " << argv[0] << " name plane Xlabel Ylabel\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get( argv[2] ); TopoDS_Shape S = DBRep::Get( argv[2] );
if ( S.IsNull() ) { if ( S.IsNull() ) {
di << "Shape is empty" << "\n"; di << "Shape is empty\n";
return 1; return 1;
} }
@ -345,7 +345,7 @@ static Standard_Integer OCC218bug (Draw_Interpretor& di, Standard_Integer argc,
static Standard_Integer OCC295(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC295(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 4) { if(argc != 4) {
di << "Usage : " << argv[0] << " edge_result edge1 edge2" << "\n"; di << "Usage : " << argv[0] << " edge_result edge1 edge2\n";
return 1; return 1;
} }
@ -380,7 +380,7 @@ static Standard_Integer OCC49 (Draw_Interpretor& di, Standard_Integer argc, cons
{ {
if ( argc != 2 ) { if ( argc != 2 ) {
di << "Usage : " << argv[0] << " name" << "\n"; di << "Usage : " << argv[0] << " name\n";
return 1; return 1;
} }
@ -392,9 +392,9 @@ static Standard_Integer OCC49 (Draw_Interpretor& di, Standard_Integer argc, cons
GProp_PrincipalProps Pr = G.PrincipalProperties(); GProp_PrincipalProps Pr = G.PrincipalProperties();
Standard_Boolean Result = Pr.HasSymmetryAxis(); Standard_Boolean Result = Pr.HasSymmetryAxis();
if (Result) { if (Result) {
di << "1" << "\n"; di << "1\n";
} else { } else {
di << "0" << "\n"; di << "0\n";
} }
return 0; return 0;
} }
@ -420,7 +420,7 @@ static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, con
*/ */
if ( argc != 2 ) { if ( argc != 2 ) {
di << "Usage : " << argv[0] << " DependentName" << "\n"; di << "Usage : " << argv[0] << " DependentName\n";
return 1; return 1;
} }
@ -433,7 +433,7 @@ static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, con
OSD_Path Path (argv[1], SysType1); OSD_Path Path (argv[1], SysType1);
} }
catch (Standard_ProgramError) { catch (Standard_ProgramError) {
di << "1" << "\n"; di << "1\n";
return 0; return 0;
} }
} }
@ -444,19 +444,19 @@ static Standard_Integer OCC132 (Draw_Interpretor& di, Standard_Integer argc, con
OSD_Path Path (argv[1], SysType2); OSD_Path Path (argv[1], SysType2);
} }
catch (Standard_ProgramError) { catch (Standard_ProgramError) {
di << "2" << "\n"; di << "2\n";
return 0; return 0;
} }
} }
di << "0" << "\n"; di << "0\n";
return 0; return 0;
} }
static Standard_Integer OCC405 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC405 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 4) { if(argc != 4) {
di << "Usage : " << argv[0] << " edge_result edge1 edge2; merge two edges" << "\n"; di << "Usage : " << argv[0] << " edge_result edge1 edge2; merge two edges\n";
return 1; return 1;
} }
@ -514,7 +514,7 @@ static Standard_Integer OCC405 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(!(argc == 4 || argc == 5)) { if(!(argc == 4 || argc == 5)) {
di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]" << "\n"; di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]\n";
return 1; return 1;
} }
@ -527,7 +527,7 @@ static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, con
if(argc==5) { if(argc==5) {
Standard_Integer ModeOfLimitationInteger = Draw::Atoi(argv[4]); Standard_Integer ModeOfLimitationInteger = Draw::Atoi(argv[4]);
if(!(ModeOfLimitationInteger == 0 || ModeOfLimitationInteger == 1 || ModeOfLimitationInteger == 2)) { if(!(ModeOfLimitationInteger == 0 || ModeOfLimitationInteger == 1 || ModeOfLimitationInteger == 2)) {
di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]" << "\n"; di << "Usage : " << argv[0] << " result part tool [ModeOfLimitation=0/1/2]\n";
return 1; return 1;
} }
//if (ModeOfLimitationInteger == 1) ModeOfLimitation = QAModTopOpe_Reversed; //if (ModeOfLimitationInteger == 1) ModeOfLimitation = QAModTopOpe_Reversed;
@ -539,7 +539,7 @@ static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, con
//TopoDS_Shape res = QAModTopOpe_Limitation(s1,s2,ModeOfLimitation); //TopoDS_Shape res = QAModTopOpe_Limitation(s1,s2,ModeOfLimitation);
TopoDS_Shape res = QANewModTopOpe_Limitation(s1,s2,ModeOfLimitation); TopoDS_Shape res = QANewModTopOpe_Limitation(s1,s2,ModeOfLimitation);
if (res.IsNull()) { if (res.IsNull()) {
di << "Error : result is null" << "\n"; di << "Error : result is null\n";
return 1; return 1;
} }
@ -551,7 +551,7 @@ static Standard_Integer OCC252 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(!(argc == 4 || argc == 5)) { if(!(argc == 4 || argc == 5)) {
di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]" << "\n"; di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]\n";
return 1; return 1;
} }
@ -563,7 +563,7 @@ static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, con
if(argc==5) { if(argc==5) {
Standard_Integer AllowCuttingInteger = Draw::Atoi(argv[4]); Standard_Integer AllowCuttingInteger = Draw::Atoi(argv[4]);
if(!( AllowCuttingInteger == 0 || AllowCuttingInteger == 1)) { if(!( AllowCuttingInteger == 0 || AllowCuttingInteger == 1)) {
di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]" << "\n"; di << "Usage : " << argv[0] << " result part tool [AllowCutting=0/1]\n";
return 1; return 1;
} }
if (AllowCuttingInteger == 1) AllowCutting = Standard_True; if (AllowCuttingInteger == 1) AllowCutting = Standard_True;
@ -572,7 +572,7 @@ static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, con
//TopoDS_Shape res = QAModTopOpe_Glue(s1,s2,AllowCutting); //TopoDS_Shape res = QAModTopOpe_Glue(s1,s2,AllowCutting);
TopoDS_Shape res = QANewModTopOpe_Glue(s1,s2,AllowCutting); TopoDS_Shape res = QANewModTopOpe_Glue(s1,s2,AllowCutting);
if (res.IsNull()) { if (res.IsNull()) {
di << "Error : result is null" << "\n"; di << "Error : result is null\n";
return 1; return 1;
} }
@ -584,7 +584,7 @@ static Standard_Integer OCC307 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 4) { if(argc != 4) {
di << "Usage : " << argv[0] << " edge_result edge1 edge2" << "\n"; di << "Usage : " << argv[0] << " edge_result edge1 edge2\n";
return 1; return 1;
} }
//TCollection_AsciiString fnom(a[1]); //TCollection_AsciiString fnom(a[1]);
@ -631,7 +631,7 @@ static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc < 3) { if(argc < 3) {
di << "Usage : " << argv[0] << " edge_result edge [tol [mode [tolang]]]" << "\n"; di << "Usage : " << argv[0] << " edge_result edge [tol [mode [tolang]]]\n";
return 1; return 1;
} }
TopoDS_Shape Sh = DBRep::Get(argv[2]); TopoDS_Shape Sh = DBRep::Get(argv[2]);
@ -677,7 +677,7 @@ static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, con
return 1; return 1;
} }
if ( argc != 3 ) { if ( argc != 3 ) {
di << "Usage : " << argv[0] << " ArcRadius ArrowSize" << "\n"; di << "Usage : " << argv[0] << " ArcRadius ArrowSize\n";
return 1; return 1;
} }
@ -715,7 +715,7 @@ static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC294 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC294 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc < 4) { if(argc < 4) {
di << "Usage : " << argv[0] << " shape_result shape edge" << "\n"; di << "Usage : " << argv[0] << " shape_result shape edge\n";
return 1; return 1;
} }
TopoDS_Shape Sh1 = DBRep::Get(argv[2]); TopoDS_Shape Sh1 = DBRep::Get(argv[2]);
@ -728,7 +728,7 @@ static Standard_Integer OCC294 (Draw_Interpretor& di, Standard_Integer argc, con
ReShaper.Remove(Sh2); ReShaper.Remove(Sh2);
const TopoDS_Shape& ResultShape = ReShaper.GetResult(); const TopoDS_Shape& ResultShape = ReShaper.GetResult();
if(ResultShape.IsNull()) { if(ResultShape.IsNull()) {
di << "Faulty " << argv[0] << " : " << argv[1] << " - shape_result is null" << "\n"; di << "Faulty " << argv[0] << " : " << argv[1] << " - shape_result is null\n";
return 1; return 1;
} }
@ -744,7 +744,7 @@ static Standard_Integer OCC60 (Draw_Interpretor& di, Standard_Integer argc, cons
return 1; return 1;
} }
if(argc < 5) { if(argc < 5) {
di << "Usage : " << argv[0] << " xmin ymin xmax ymax; selection window" << "\n"; di << "Usage : " << argv[0] << " xmin ymin xmax ymax; selection window\n";
return 1; return 1;
} }
@ -769,11 +769,11 @@ static Standard_Integer OCC70 (Draw_Interpretor& di, Standard_Integer argc, cons
return 1; return 1;
} }
if(argc < 7) { if(argc < 7) {
di << "Usage : " << argv[0] << " x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection" << "\n"; di << "Usage : " << argv[0] << " x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection\n";
return 1; return 1;
} }
if (((argc - 1) % 2) != 0) { if (((argc - 1) % 2) != 0) {
di << "Usage : " << argv[0] << " x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection" << "\n"; di << "Usage : " << argv[0] << " x1 y1 x2 y2 x3 y3 [x y ...]; polygon of selection\n";
return 1; return 1;
} }
@ -796,7 +796,7 @@ static Standard_Integer OCC70 (Draw_Interpretor& di, Standard_Integer argc, cons
static Standard_Integer OCC261 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC261 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 2) { if(argc != 2) {
di << "Usage : " << argv[0] << " Doc" << "\n"; di << "Usage : " << argv[0] << " Doc\n";
return 1; return 1;
} }
@ -812,16 +812,16 @@ static Standard_Integer OCC261 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC710 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC710 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 2) { if(argc != 2) {
di << "Usage : " << argv[0] << " path" << "\n"; di << "Usage : " << argv[0] << " path\n";
} }
TCollection_AsciiString in(argv[1]); TCollection_AsciiString in(argv[1]);
OSD_File* aFile = new OSD_File(in); OSD_File* aFile = new OSD_File(in);
Standard_Boolean anExists = aFile->Exists(); Standard_Boolean anExists = aFile->Exists();
if(anExists == Standard_True) if(anExists == Standard_True)
di << "1" << "\n"; di << "1\n";
else else
di << "0" << "\n"; di << "0\n";
return 0; return 0;
} }
@ -830,11 +830,11 @@ static Standard_Integer OCC710 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC904 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC904 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc != 4) { if(argc != 4) {
di << "Usage : " << argv[0] << " result shape nonmanifoldmode(0/1)" << "\n"; di << "Usage : " << argv[0] << " result shape nonmanifoldmode(0/1)\n";
} }
TopoDS_Shape S = DBRep::Get(argv[2]); TopoDS_Shape S = DBRep::Get(argv[2]);
if (S.IsNull() || S.ShapeType() != TopAbs_SHELL) { if (S.IsNull() || S.ShapeType() != TopAbs_SHELL) {
di << " Shape is null" << "\n"; di << " Shape is null\n";
return 1; return 1;
} }
Standard_Boolean nonmanifmode = (Draw::Atoi(argv[3]) != 0); Standard_Boolean nonmanifmode = (Draw::Atoi(argv[3]) != 0);

View File

@ -128,7 +128,7 @@ static Standard_Integer BUC60842 (Draw_Interpretor& di, Standard_Integer /*argc*
static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv) static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{ {
if (argc != 4 && argc != 5 && argc != 6 && argc != 7) { if (argc != 4 && argc != 5 && argc != 6 && argc != 7) {
di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]" << "\n"; di << "Usage : " << argv[0] << "result_shape name_of_circle name_of_curve [ par1 [ tol ] ]\n";
return 1; return 1;
} }
@ -143,7 +143,7 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]); Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]); Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
if (aCur2d1.IsNull() || aCur2d2.IsNull()) { if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
di << "Faulty : not curves" << "\n"; di << "Faulty : not curves\n";
return 1; return 1;
} }
Standard_Boolean c1IsCircle = Standard_False; Standard_Boolean c1IsCircle = Standard_False;
@ -162,7 +162,7 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
Handle(Geom2d_Line) glin = new Geom2d_Line(lin); Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
DrawTrSurf::Set(argv[1], glin); DrawTrSurf::Set(argv[1], glin);
} else { } else {
di << "Faulty : tangent line is not done." << "\n"; di << "Faulty : tangent line is not done.\n";
} }
} }
else { else {
@ -176,7 +176,7 @@ static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,co
Handle(Geom2d_Line) glin = new Geom2d_Line(lin); Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
DrawTrSurf::Set(argv[1], glin); DrawTrSurf::Set(argv[1], glin);
} else { } else {
di << "Faulty : tangent line is not done." << "\n"; di << "Faulty : tangent line is not done.\n";
} }
} }
return 0; return 0;
@ -186,7 +186,7 @@ static Standard_Integer BUC60970 (Draw_Interpretor& di, Standard_Integer argc, c
{ {
if(argc!=3) if(argc!=3)
{ {
di << "Usage : " << argv[0] << " shape result" <<"\n"; di << "Usage : " << argv[0] << " shape result\n";
return 1; return 1;
} }
@ -290,7 +290,7 @@ static Standard_Integer BUC60818(Draw_Interpretor& di, Standard_Integer argc, c
static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc > 1) { if (argc > 1) {
di<<"Function don't has parameters"<<"\n"; di<<"Function don't has parameters\n";
return 1; return 1;
} }
@ -535,7 +535,7 @@ static Standard_Integer OCC280 (Draw_Interpretor& di, Standard_Integer argc, con
return -1; return -1;
} }
if ( argc != 3) { if ( argc != 3) {
di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view" << "\n"; di << "ERROR : Usage : " << argv[0] << " hlr=0/1 setsurfecedetail=0/1; set perspecrive view\n";
return 1; return 1;
} }
@ -753,7 +753,7 @@ static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/
static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a) static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
{ {
if (n < 2) { if (n < 2) {
di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]"<<"\n"; di<<"Usage: " << a[0] << " shape [ xmin ymin zmin xmax ymax zmax]\n";
return 1; return 1;
} }
TopoDS_Shape S = DBRep::Get(a[1]); TopoDS_Shape S = DBRep::Get(a[1]);
@ -782,7 +782,7 @@ static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const cha
static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv) static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{ {
if (argc < 2) { if (argc < 2) {
di<<"Usage: " << argv[0] << " result"<<"\n"; di<<"Usage: " << argv[0] << " result\n";
return 1; return 1;
} }
@ -829,7 +829,7 @@ static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,cons
} }
catch(Standard_Failure) catch(Standard_Failure)
{ {
di << argv[0] << ": Exception in fillet"<<"\n"; di << argv[0] << ": Exception in fillet\n";
return 2; return 2;
} }
} }
@ -889,7 +889,7 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
const char ** a) const char ** a)
{ {
if(Rake == 0){ if(Rake == 0){
di << "MakeFillet non initialise"<<"\n"; di << "MakeFillet non initialise\n";
return 1 ; return 1 ;
} }
if(narg%2 != 0 || narg < 4) return 1; if(narg%2 != 0 || narg < 4) return 1;
@ -906,7 +906,7 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw"); const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
if (aLawMode) if (aLawMode)
{ {
di<<"INFO: Using law to define variable fillet"<<"\n"; di<<"INFO: Using law to define variable fillet\n";
Handle(Law_Interpol) law = new Law_Interpol; Handle(Law_Interpol) law = new Law_Interpol;
law->Set(uandr); law->Set(uandr);
Rake->Add(law,E); Rake->Add(law,E);
@ -922,7 +922,7 @@ static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
const char **) const char **)
{ {
if(Rake == 0){ if(Rake == 0){
di << "MakeFillet non initialise"<<"\n"; di << "MakeFillet non initialise\n";
return 1 ; return 1 ;
} }
Rake->Build(); Rake->Build();
@ -948,13 +948,13 @@ static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const
{ {
if (n != 3 && n != 4) if (n != 3 && n != 4)
{ {
di << "Usage : " << a[0] << " result shape [-t]" << "\n"; di << "Usage : " << a[0] << " result shape [-t]\n";
return 0; return 0;
} }
Standard_Boolean TrimMode = (n == 4); Standard_Boolean TrimMode = (n == 4);
if (TrimMode) di<<"INFO: Using trimmed curves..."<<"\n"; if (TrimMode) di<<"INFO: Using trimmed curves...\n";
else di<<"INFO: Using non trimmed curves..."<<"\n"; else di<<"INFO: Using non trimmed curves...\n";
TopoDS_Shape S = DBRep::Get(a[2]); TopoDS_Shape S = DBRep::Get(a[2]);
@ -994,7 +994,7 @@ static Standard_Integer OCC606 ( Draw_Interpretor& di, Standard_Integer n, const
} }
catch(Standard_Failure) catch(Standard_Failure)
{ {
di<<"ERROR: Exception in GeomFill_NSections"<<"\n"; di<<"ERROR: Exception in GeomFill_NSections\n";
} }
} }
@ -1010,7 +1010,7 @@ static Standard_Integer OCC813 (Draw_Interpretor& di, Standard_Integer argc,cons
{ {
if (argc < 3) if (argc < 3)
{ {
di << "Usage : " << argv[0] << " U V" << "\n"; di << "Usage : " << argv[0] << " U V\n";
return 1; return 1;
} }
@ -1149,7 +1149,7 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
{ {
if (argc < 3 || argc > 5) if (argc < 3 || argc > 5)
{ {
di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]" << "\n"; di << "Usage : " << argv[0] << " result shape [toler [maxtoler]]\n";
return 1; return 1;
} }
@ -1158,7 +1158,7 @@ static Standard_Integer OCC884 (Draw_Interpretor& di, Standard_Integer argc, con
TopExp_Explorer exp(shape, TopAbs_EDGE); TopExp_Explorer exp(shape, TopAbs_EDGE);
if (!exp.More()) if (!exp.More())
{ {
di<<"Error: no edge found"<<"\n"; di<<"Error: no edge found\n";
return 1; return 1;
} }
@ -1279,7 +1279,7 @@ static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if (argc < 2 || argc > 3) if (argc < 2 || argc > 3)
{ {
di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background" << "\n"; di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background\n";
return 1; return 1;
} }
@ -1301,7 +1301,7 @@ static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, co
else else
{ {
di << "Wrong fill type : " << szType << "\n"; di << "Wrong fill type : " << szType << "\n";
di << "Must be one of CENTERED, TILED, STRETCH, NONE" << "\n"; di << "Must be one of CENTERED, TILED, STRETCH, NONE\n";
return 1; return 1;
} }
} }
@ -1323,7 +1323,7 @@ static Standard_Integer OCC1174_1 (Draw_Interpretor& di, Standard_Integer argc,
{ {
if (argc != 2) if (argc != 2)
{ {
di << "Usage : " << argv[0] << " shape" << "\n"; di << "Usage : " << argv[0] << " shape\n";
return 1; return 1;
} }
@ -1381,7 +1381,7 @@ static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc,
{ {
if (argc != 2) if (argc != 2)
{ {
di << "Usage : " << argv[0] << " shape" << "\n"; di << "Usage : " << argv[0] << " shape\n";
return 1; return 1;
} }
@ -1433,7 +1433,7 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
{ {
if (argc != 4) if (argc != 4)
{ {
di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length" << "\n"; di << "Usage : " << argv[0] << " angle fuse(1 for boss / 0 for slot) length\n";
return 1; return 1;
} }
@ -1494,7 +1494,7 @@ static Standard_Integer OCCN1 (Draw_Interpretor& di, Standard_Integer argc, cons
static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc > 2) { if (argc > 2) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -1525,19 +1525,19 @@ static Standard_Integer OCCN2 (Draw_Interpretor& di, Standard_Integer argc, cons
TopoDS_Shape shape; TopoDS_Shape shape;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)" <<"\n"; di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
BRepAlgoAPI_Section section(cylinder_sh, sphere_sh); BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
section.Build(); section.Build();
if(!section.IsDone()){ if(!section.IsDone()){
di << "Error performing intersection: not done." << "\n"; di << "Error performing intersection: not done.\n";
} }
shape = section.Shape(); shape = section.Shape();
} else { } else {
di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)" <<"\n"; di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)\n";
BRepAlgo_Section section(cylinder_sh, sphere_sh); BRepAlgo_Section section(cylinder_sh, sphere_sh);
section.Build(); section.Build();
if(!section.IsDone()){ if(!section.IsDone()){
di << "Error performing intersection: not done." << "\n"; di << "Error performing intersection: not done.\n";
} }
shape = section.Shape(); shape = section.Shape();
} }
@ -1561,7 +1561,7 @@ static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, co
return 1; return 1;
} }
if(argc != 3) { if(argc != 3) {
di << "Usage : " << argv[0] << " nbpoles result" << "\n"; di << "Usage : " << argv[0] << " nbpoles result\n";
return 1; return 1;
} }
@ -1590,7 +1590,7 @@ static Standard_Integer OCC2569 (Draw_Interpretor& di, Standard_Integer argc, co
static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 10) { if (argc != 10) {
di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection"<<"\n"; di<<"Usage: " << argv[0] << " FinalWare FinalFace InitWare InitFace shape FixReorder FixDegenerated FixConnected FixSelfIntersection\n";
return 1; return 1;
} }

View File

@ -48,7 +48,7 @@
static Standard_Integer OCC267 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC267 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 3) { if ( argc != 3) {
di << "ERROR OCC267: Usage : " << argv[0] << " DOC path" << "\n"; di << "ERROR OCC267: Usage : " << argv[0] << " DOC path\n";
return 1; return 1;
} }
@ -60,9 +60,9 @@ static Standard_Integer OCC267 (Draw_Interpretor& di, Standard_Integer argc, con
PCDM_StoreStatus theStatus = A->SaveAs(D,path); PCDM_StoreStatus theStatus = A->SaveAs(D,path);
if (theStatus == PCDM_SS_OK ) { if (theStatus == PCDM_SS_OK ) {
di << "OCC267 : PCDM_StoreStatus = PCDM_SS_OK" << "\n"; di << "OCC267 : PCDM_StoreStatus = PCDM_SS_OK\n";
} else { } else {
di << "OCC267 : PCDM_StoreStatus = Bad_Store_Status" << "\n"; di << "OCC267 : PCDM_StoreStatus = Bad_Store_Status\n";
} }
return 0; return 0;
@ -71,7 +71,7 @@ static Standard_Integer OCC267 (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer OCC181 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC181 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 5) { if ( argc != 5) {
di << "ERROR OCC181: Usage : " << argv[0] << " FileName path1 path2 verbose=0/1" << "\n"; di << "ERROR OCC181: Usage : " << argv[0] << " FileName path1 path2 verbose=0/1\n";
return 1; return 1;
} }
Standard_CString aFileName = argv[1]; Standard_CString aFileName = argv[1];
@ -97,9 +97,9 @@ static Standard_Integer OCC181 (Draw_Interpretor& di, Standard_Integer argc, con
Standard_Boolean aStatus = aManager.Save(); Standard_Boolean aStatus = aManager.Save();
if (aStatus) { if (aStatus) {
di << "\nOCC181 : Status = TRUE" << "\n"; di << "\nOCC181 : Status = TRUE\n";
} else { } else {
di << "\nOCC181 : Status = FALSE" << "\n"; di << "\nOCC181 : Status = FALSE\n";
} }
return 0; return 0;
@ -121,7 +121,7 @@ static Standard_Real delta_percent (Standard_Real a, Standard_Real b)
static Standard_Integer OCC367 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC367 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 7) { if ( argc != 7) {
di << "ERROR : Usage : " << argv[0] << " shape step goodX goodY goodZ percent_tolerance" << "\n"; di << "ERROR : Usage : " << argv[0] << " shape step goodX goodY goodZ percent_tolerance\n";
return 1; return 1;
} }
@ -208,9 +208,9 @@ static Standard_Integer OCC367 (Draw_Interpretor& di, Standard_Integer argc, con
di << "\n\nFirstEdge = " << FirstEdgeX <<" " << FirstEdgeY <<" " << FirstEdgeZ << "\n"; di << "\n\nFirstEdge = " << FirstEdgeX <<" " << FirstEdgeY <<" " << FirstEdgeZ << "\n";
di << "deltaX = " << deltaX << " deltaY = " << deltaY << " deltaZ = " << deltaZ << "\n"; di << "deltaX = " << deltaX << " deltaY = " << deltaY << " deltaZ = " << deltaZ << "\n";
if (Status) { if (Status) {
di << argv[0] << " : OK" << "\n"; di << argv[0] << " : OK\n";
} else { } else {
di << argv[0] << " : ERROR" << "\n"; di << argv[0] << " : ERROR\n";
} }
return 0; return 0;
@ -220,7 +220,7 @@ static Standard_Integer OCC71bug (Draw_Interpretor& di, Standard_Integer /*argc*
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }

View File

@ -63,17 +63,17 @@
static Standard_Integer OCC230 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC230 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 4) { if ( argc != 4) {
di << "ERROR OCC230: Usage : " << argv[0] << " TrimmedCurve Pnt2d Pnt2d" << "\n"; di << "ERROR OCC230: Usage : " << argv[0] << " TrimmedCurve Pnt2d Pnt2d\n";
return 1; return 1;
} }
gp_Pnt2d P1, P2; gp_Pnt2d P1, P2;
if ( !DrawTrSurf::GetPoint2d(argv[2],P1)) { if ( !DrawTrSurf::GetPoint2d(argv[2],P1)) {
di << "ERROR OCC230: " << argv[2] << " is not Pnt2d" << "\n"; di << "ERROR OCC230: " << argv[2] << " is not Pnt2d\n";
return 1; return 1;
} }
if ( !DrawTrSurf::GetPoint2d(argv[3],P2)) { if ( !DrawTrSurf::GetPoint2d(argv[3],P2)) {
di << "ERROR OCC230: " << argv[3] << " is not Pnt2d" << "\n"; di << "ERROR OCC230: " << argv[3] << " is not Pnt2d\n";
return 1; return 1;
} }
@ -100,9 +100,9 @@ static Standard_Integer OCC23361 (Draw_Interpretor& di, Standard_Integer /*argc*
// points must be equal // points must be equal
if ( ! p2.IsEqual(p3, Precision::Confusion()) ) if ( ! p2.IsEqual(p3, Precision::Confusion()) )
di << "ERROR OCC23361: equivalent transformations does not produce equal points" << "\n"; di << "ERROR OCC23361: equivalent transformations does not produce equal points\n";
else else
di << "OCC23361: OK" << "\n"; di << "OCC23361: OK\n";
return 0; return 0;
} }
@ -300,7 +300,7 @@ static Standard_Boolean OCC23774Test(const TopoDS_Face& grossPlateFace, const To
BRepBuilderAPI_Transform transformer1(mirror1); BRepBuilderAPI_Transform transformer1(mirror1);
transformer1.Perform(originalWire); transformer1.Perform(originalWire);
if(!transformer1.IsDone()) { if(!transformer1.IsDone()) {
di << "Not Done1 " << "\n"; di << "Not Done1 \n";
return Standard_False; return Standard_False;
} }
TopoDS_Shape step1ModifiedShape = transformer1.ModifiedShape(originalWire); TopoDS_Shape step1ModifiedShape = transformer1.ModifiedShape(originalWire);
@ -517,7 +517,7 @@ static Standard_Integer OCC23952intersect (Draw_Interpretor& di, Standard_Intege
static Standard_Integer OCC23683 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv) static Standard_Integer OCC23683 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{ {
if (argc < 2) { if (argc < 2) {
di<<"Usage: " << argv[0] << " invalid number of arguments"<<"\n"; di<<"Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
@ -548,7 +548,7 @@ static int test_offset(Draw_Interpretor& di, Standard_Integer argc, const char**
// Check the command arguments // Check the command arguments
if ( argc != 1 ) if ( argc != 1 )
{ {
di << "Error: " << argv[0] << " - invalid number of arguments" << "\n"; di << "Error: " << argv[0] << " - invalid number of arguments\n";
di << "Usage: type help " << argv[0] << "\n"; di << "Usage: type help " << argv[0] << "\n";
return 1; // TCL_ERROR return 1; // TCL_ERROR
} }
@ -557,8 +557,8 @@ static int test_offset(Draw_Interpretor& di, Standard_Integer argc, const char**
gp_Ax22d Ax2( gp::Origin2d(), gp::DY2d(), gp::DX2d() ); gp_Ax22d Ax2( gp::Origin2d(), gp::DY2d(), gp::DX2d() );
Handle(Geom_Surface) Plane = new Geom_Plane( gp::YOZ() ); Handle(Geom_Surface) Plane = new Geom_Plane( gp::YOZ() );
di << "<<<< Preparing sample surface of revolution based on trimmed curve >>>>" << "\n"; di << "<<<< Preparing sample surface of revolution based on trimmed curve >>>>\n";
di << "-----------------------------------------------------------------------" << "\n"; di << "-----------------------------------------------------------------------\n";
Handle(Geom2d_Circle) C2d1 = new Geom2d_Circle(Ax2, 1.0); Handle(Geom2d_Circle) C2d1 = new Geom2d_Circle(Ax2, 1.0);
Handle(Geom2d_TrimmedCurve) C2d1Trimmed = new Geom2d_TrimmedCurve(C2d1, 0.0, M_PI/2.0); Handle(Geom2d_TrimmedCurve) C2d1Trimmed = new Geom2d_TrimmedCurve(C2d1, 0.0, M_PI/2.0);
@ -571,10 +571,10 @@ static int test_offset(Draw_Interpretor& di, Standard_Integer argc, const char**
DBRep::Set("f1", F1); DBRep::Set("f1", F1);
di << "Result: f1" << "\n"; di << "Result: f1\n";
di << "<<<< Preparing sample surface of revolution based on offset curve >>>>" << "\n"; di << "<<<< Preparing sample surface of revolution based on offset curve >>>>\n";
di << "-----------------------------------------------------------------------" << "\n"; di << "-----------------------------------------------------------------------\n";
Handle(Geom2d_OffsetCurve) C2d2Offset = new Geom2d_OffsetCurve(C2d1Trimmed, -0.5); Handle(Geom2d_OffsetCurve) C2d2Offset = new Geom2d_OffsetCurve(C2d1Trimmed, -0.5);
TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(C2d2Offset, Plane); TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(C2d2Offset, Plane);
@ -586,7 +586,7 @@ static int test_offset(Draw_Interpretor& di, Standard_Integer argc, const char**
DBRep::Set("f2", F2); DBRep::Set("f2", F2);
di << "Result: f2" << "\n"; di << "Result: f2\n";
return 0; return 0;
} }
@ -602,17 +602,17 @@ static int test_offset(Draw_Interpretor& di, Standard_Integer argc, const char**
static Standard_Integer OCC24008 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC24008 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 3) { if (argc != 3) {
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n"; di << "Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
Handle(Geom_Curve) aCurve = DrawTrSurf::GetCurve(argv[1]); Handle(Geom_Curve) aCurve = DrawTrSurf::GetCurve(argv[1]);
Handle(Geom_Surface) aSurf = DrawTrSurf::GetSurface(argv[2]); Handle(Geom_Surface) aSurf = DrawTrSurf::GetSurface(argv[2]);
if (aCurve.IsNull()) { if (aCurve.IsNull()) {
di << "Curve was not read" << "\n"; di << "Curve was not read\n";
return 1; return 1;
} }
if (aSurf.IsNull()) { if (aSurf.IsNull()) {
di << "Surface was not read" << "\n"; di << "Surface was not read\n";
return 1; return 1;
} }
ShapeConstruct_ProjectCurveOnSurface aProj; ShapeConstruct_ProjectCurveOnSurface aProj;
@ -621,11 +621,11 @@ static Standard_Integer OCC24008 (Draw_Interpretor& di, Standard_Integer argc, c
Handle(Geom2d_Curve) aPCurve; Handle(Geom2d_Curve) aPCurve;
aProj.Perform (aCurve, aCurve->FirstParameter(), aCurve->LastParameter(), aPCurve); aProj.Perform (aCurve, aCurve->FirstParameter(), aCurve->LastParameter(), aPCurve);
if (aPCurve.IsNull()) { if (aPCurve.IsNull()) {
di << "PCurve was not created" << "\n"; di << "PCurve was not created\n";
return 1; return 1;
} }
} catch (...) { } catch (...) {
di << "Exception was caught" << "\n"; di << "Exception was caught\n";
} }
return 0; return 0;
} }
@ -1198,7 +1198,7 @@ static Standard_Integer OCC24005 (Draw_Interpretor& theDI, Standard_Integer theN
if (!anInters.IsDone()) if (!anInters.IsDone())
{ {
theDI<<"No intersections found!"<<"\n"; theDI<<"No intersections found!\n";
return 1; return 1;
} }
@ -1315,9 +1315,9 @@ static Standard_Integer OCC24086 (Draw_Interpretor& di, Standard_Integer argc, c
ana.NbFaces(); ana.NbFaces();
if (!(BRepAlgo::IsValid(result))) { if (!(BRepAlgo::IsValid(result))) {
di << "Result was checked and it is INVALID" << "\n"; di << "Result was checked and it is INVALID\n";
} else { } else {
di << "Result was checked and it is VALID" << "\n"; di << "Result was checked and it is VALID\n";
} }
Handle(AIS_InteractiveObject) myShape = new AIS_Shape (result); Handle(AIS_InteractiveObject) myShape = new AIS_Shape (result);
@ -1334,7 +1334,7 @@ static Standard_Integer OCC24086 (Draw_Interpretor& di, Standard_Integer argc, c
static Standard_Integer OCC24945 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC24945 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 1) { if (argc != 1) {
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n"; di << "Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
@ -1368,7 +1368,7 @@ static Standard_Integer OCC24137 (Draw_Interpretor& theDI, Standard_Integer theN
Standard_Integer anArgIter = 1; Standard_Integer anArgIter = 1;
if (theNArg < 5) if (theNArg < 5)
{ {
theDI <<"Usage: " << theArgv[0] << " face vertex U V [N]"<<"\n"; theDI <<"Usage: " << theArgv[0] << " face vertex U V [N]\n";
return 1; return 1;
} }
@ -1591,7 +1591,7 @@ static Standard_Integer OCC23972 (Draw_Interpretor& di,Standard_Integer n, const
static Standard_Integer OCC24370 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv) static Standard_Integer OCC24370 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{ {
if (argc < 5) { if (argc < 5) {
di<<"Usage: " << argv[0] << " invalid number of arguments"<<"\n"; di<<"Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
@ -1707,7 +1707,7 @@ struct QABugs_NHandleClass
{ {
Standard_Integer NHandleProc (Draw_Interpretor& , Standard_Integer , const char** theArgVec) Standard_Integer NHandleProc (Draw_Interpretor& , Standard_Integer , const char** theArgVec)
{ {
std::cerr << "QABugs_NHandleClass[" << this << "] " << "" << theArgVec[0] << "\n"; std::cerr << "QABugs_NHandleClass[" << this << "] " << theArgVec[0] << "\n";
return 0; return 0;
} }
}; };
@ -1718,7 +1718,7 @@ struct QABugs_NHandleClass
static Standard_Integer OCC23951 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC23951 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 2) { if (argc != 2) {
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n"; di << "Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
Handle(TDocStd_Document) aDoc = new TDocStd_Document("dummy");; Handle(TDocStd_Document) aDoc = new TDocStd_Document("dummy");;
@ -1777,7 +1777,7 @@ static Standard_Integer OCC23950 (Draw_Interpretor& di, Standard_Integer argc, c
STEPCAFControl_Writer writer; STEPCAFControl_Writer writer;
if (! writer.Transfer (aDoc, mode)) if (! writer.Transfer (aDoc, mode))
{ {
di << "The document cannot be translated or gives no result" << "\n"; di << "The document cannot be translated or gives no result\n";
return 1; return 1;
} }
@ -1852,11 +1852,11 @@ static Standard_Integer OCC24667 (Draw_Interpretor& di, Standard_Integer n, cons
{ {
if (n == 1) if (n == 1)
{ {
di << "OCC24667 result Wire_spine Profile [Mode [Approx]]" << "\n"; di << "OCC24667 result Wire_spine Profile [Mode [Approx]]\n";
di << "Mode = 0 - CorrectedFrenet," << "\n"; di << "Mode = 0 - CorrectedFrenet,\n";
di << " = 1 - Frenet," << "\n"; di << " = 1 - Frenet,\n";
di << " = 2 - DiscreteTrihedron" << "\n"; di << " = 2 - DiscreteTrihedron\n";
di << "Approx - force C1-approximation if result is C0" << "\n"; di << "Approx - force C1-approximation if result is C0\n";
return 0; return 0;
} }
@ -1936,7 +1936,7 @@ static TopoDS_Shape CreateTestShape (int& theShapeNb)
static Standard_Integer OCC24931 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer OCC24931 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if (argc != 2) { if (argc != 2) {
di << "Usage: " << argv[0] << " invalid number of arguments"<<"\n"; di << "Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
TCollection_ExtendedString aFileName (argv[1]); TCollection_ExtendedString aFileName (argv[1]);
@ -2475,7 +2475,7 @@ class mOcafApplication : public TDocStd_Application
static Standard_Integer OCC23010 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC23010 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if (argc != 2) { if (argc != 2) {
di << "Usage: " << argv[0] << " invalid number of arguments" << "\n"; di << "Usage: " << argv[0] << " invalid number of arguments\n";
return 1; return 1;
} }
std::string fileName=argv[1]; std::string fileName=argv[1];
@ -2585,7 +2585,7 @@ static Standard_Integer OCC25202 ( Draw_Interpretor& theDI,
static Standard_Integer OCC7570 (Draw_Interpretor& di, Standard_Integer n, const char** a) static Standard_Integer OCC7570 (Draw_Interpretor& di, Standard_Integer n, const char** a)
{ {
if (n != 2) { if (n != 2) {
di<<"Usage: "<<a[0]<<" invalid number of arguments"<<"\n"; di<<"Usage: "<<a[0]<<" invalid number of arguments\n";
return 1; return 1;
} }
TopoDS_Shape in_shape (DBRep::Get (a[1])); TopoDS_Shape in_shape (DBRep::Get (a[1]));
@ -2722,7 +2722,7 @@ static Standard_Integer OCC25100 (Draw_Interpretor& di, Standard_Integer argc, c
TopoDS_Shape S = DBRep::Get(argv[1]); TopoDS_Shape S = DBRep::Get(argv[1]);
if ( S.IsNull() ) if ( S.IsNull() )
{ {
di << "Shape is empty" << "\n"; di << "Shape is empty\n";
return 1; return 1;
} }
@ -2772,7 +2772,7 @@ static Standard_Integer OCC25348 (Draw_Interpretor& theDI,
static Standard_Integer OCC25413 (Draw_Interpretor& di, Standard_Integer narg , const char** a) static Standard_Integer OCC25413 (Draw_Interpretor& di, Standard_Integer narg , const char** a)
{ {
if (narg != 2) { if (narg != 2) {
di << "Usage: " << a[0] << " invalid number of arguments" << "\n"; di << "Usage: " << a[0] << " invalid number of arguments\n";
return 1; return 1;
} }
TopoDS_Shape aShape = DBRep::Get (a[1]); TopoDS_Shape aShape = DBRep::Get (a[1]);
@ -3196,7 +3196,7 @@ static ShapeExtend_Status getStatusGap(const Handle(ShapeFix_Wire)& theFix,
static Standard_Integer OCC24881 (Draw_Interpretor& di, Standard_Integer narg , const char** a) static Standard_Integer OCC24881 (Draw_Interpretor& di, Standard_Integer narg , const char** a)
{ {
if (narg < 2) { if (narg < 2) {
di<<"Usage: "<<a[0]<<" invalid number of arguments"<<"\n"; di<<"Usage: "<<a[0]<<" invalid number of arguments\n";
return 1; return 1;
} }
// cout <<"FileName1: " << argv[1] <<endl; // cout <<"FileName1: " << argv[1] <<endl;
@ -3289,7 +3289,7 @@ static Standard_Integer OCC24881 (Draw_Interpretor& di, Standard_Integer narg ,
} }
if (nbOk) if (nbOk)
{ {
di << "Fix_FillGaps_NothingToDo" <<"\n"; di << "Fix_FillGaps_NothingToDo\n";
} }
TColStd_DataMapIteratorOfDataMapOfIntegerInteger aStatusItr(aStatusNbDMap); TColStd_DataMapIteratorOfDataMapOfIntegerInteger aStatusItr(aStatusNbDMap);
@ -3580,12 +3580,12 @@ static Standard_Integer OCC24923(
if (aDeviation > aMaxDeviation) if (aDeviation > aMaxDeviation)
{ {
theDI << "Failed. Number of incorrect results is too huge: " << theDI << "Failed. Number of incorrect results is too huge: " <<
aDeviation * 100 << "% (Max " << aMaxDeviation * 100 << "%)" << "\n"; aDeviation * 100 << "% (Max " << aMaxDeviation * 100 << "%)\n";
return 1; return 1;
} }
theDI << "Deviation of incorrect results is: " << theDI << "Deviation of incorrect results is: " <<
aDeviation * 100 << "% (Max " << aMaxDeviation * 100 << "%)" << "\n"; aDeviation * 100 << "% (Max " << aMaxDeviation * 100 << "%)\n";
theDI << "Test completed\n"; theDI << "Test completed\n";
return 0; return 0;
} }
@ -3604,7 +3604,7 @@ Standard_Integer OCC26446 (Draw_Interpretor& di,
const char** a) const char** a)
{ {
if (n != 4) { if (n != 4) {
di << "Usage: OCC26446 r c1 c2" << "\n"; di << "Usage: OCC26446 r c1 c2\n";
return 1; return 1;
} }
@ -3614,12 +3614,12 @@ Standard_Integer OCC26446 (Draw_Interpretor& di,
Handle(Geom_BSplineCurve)::DownCast(DrawTrSurf::GetCurve(a[3])); Handle(Geom_BSplineCurve)::DownCast(DrawTrSurf::GetCurve(a[3]));
if (aCurve1.IsNull()) { if (aCurve1.IsNull()) {
di << a[2] << " is not a BSpline curve" << "\n"; di << a[2] << " is not a BSpline curve\n";
return 1; return 1;
} }
if (aCurve2.IsNull()) { if (aCurve2.IsNull()) {
di << a[3] << " is not a BSpline curve" << "\n"; di << a[3] << " is not a BSpline curve\n";
return 1; return 1;
} }
@ -4034,7 +4034,7 @@ static Standard_Integer OCC26313(Draw_Interpretor& di,Standard_Integer n,const c
TopoDS_Shape aSrcShape = DBRep::Get(a[2]); TopoDS_Shape aSrcShape = DBRep::Get(a[2]);
if (aSrcShape.IsNull()) { if (aSrcShape.IsNull()) {
di << a[2] << " is not a valid shape" << "\n"; di << a[2] << " is not a valid shape\n";
return 1; return 1;
} }

View File

@ -51,7 +51,7 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
// 1. Verify amount of arguments of the command // 1. Verify amount of arguments of the command
//if (argc < 2) { di << "OCC527 FAULTY. Use : OCC527 shape "; return 0;} //if (argc < 2) { di << "OCC527 FAULTY. Use : OCC527 shape "; return 0;}
if (argc < 2 || argc > 3) { if (argc < 2 || argc > 3) {
di << "Usage : " << argv[0] << " shape [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " shape [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -60,7 +60,7 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
//#if ! defined(BRepAlgo_def04) //#if ! defined(BRepAlgo_def04)
// di << "Error: There is not BRepAlgo_Section class" << "\n"; // di << "Error: There is not BRepAlgo_Section class\n";
// return 1; // return 1;
//#endif //#endif
} }
@ -110,14 +110,14 @@ static Standard_Integer OCC527(Draw_Interpretor& di, Standard_Integer argc, cons
Standard_Boolean IsDone; Standard_Boolean IsDone;
TopoDS_Shape aResult; TopoDS_Shape aResult;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)" <<"\n"; di << "BRepAlgoAPI_Section aSection(aFace,pl,Standard_False)\n";
BRepAlgoAPI_Section aSection(aFace,pl,Standard_False); BRepAlgoAPI_Section aSection(aFace,pl,Standard_False);
aSection.Approximation(Standard_True); aSection.Approximation(Standard_True);
aSection.Build(); aSection.Build();
IsDone = aSection.IsDone(); IsDone = aSection.IsDone();
aResult = aSection.Shape(); aResult = aSection.Shape();
} else { } else {
di << "BRepAlgo_Section aSection(aFace,pl,Standard_False)" <<"\n"; di << "BRepAlgo_Section aSection(aFace,pl,Standard_False)\n";
BRepAlgo_Section aSection(aFace,pl,Standard_False); BRepAlgo_Section aSection(aFace,pl,Standard_False);
aSection.Approximation(Standard_True); aSection.Approximation(Standard_True);
aSection.Build(); aSection.Build();

View File

@ -33,7 +33,7 @@ static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a
{ {
if(argc!=4) if(argc!=4)
{ {
di << "Usage : " << a[0] << " result Shape1 Shape2" << "\n"; di << "Usage : " << a[0] << " result Shape1 Shape2\n";
return -1; return -1;
} }
@ -46,7 +46,7 @@ static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a
GeomInt_IntSS Inter; GeomInt_IntSS Inter;
Inter.Perform(GSF1,GSF2, BRep_Tool::Tolerance(F1)); Inter.Perform(GSF1,GSF2, BRep_Tool::Tolerance(F1));
if (!Inter.IsDone()) { if (!Inter.IsDone()) {
di << "Intersection not done" << "\n"; di << "Intersection not done\n";
return 1; return 1;
} }
Standard_Integer nbsol = Inter.NbLines(); Standard_Integer nbsol = Inter.NbLines();
@ -60,7 +60,7 @@ static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a
return 0; return 0;
} else di << "The first solution is Null!" << "\n"; } else di << "The first solution is Null!" << "\n";
di << "fini" << "\n"; di << "fini\n";
return 0; return 0;
} }
@ -72,7 +72,7 @@ static int BUC60569(Draw_Interpretor& di, Standard_Integer argc, const char ** a
{ {
if(argc!=2) if(argc!=2)
{ {
di << "Usage : " << argv[0] << " shape" << "\n"; di << "Usage : " << argv[0] << " shape\n";
return -1; return -1;
} }
@ -95,7 +95,7 @@ static int BUC60614(Draw_Interpretor& di, Standard_Integer argc, const char ** a
{ {
if(argc!=2) if(argc!=2)
{ {
di << "Usage : "<< argv[0] << " shape" << "\n"; di << "Usage : "<< argv[0] << " shape\n";
return -1; return -1;
} }
@ -138,7 +138,7 @@ static int BUC60609(Draw_Interpretor& di, Standard_Integer argc, const char ** a
} else if ( argc == 5 ) { } else if ( argc == 5 ) {
// BUC60609 shape name U V // BUC60609 shape name U V
} else { } else {
di << "Usage : "<< argv[0] << " shape name [U V]" << "\n"; di << "Usage : "<< argv[0] << " shape name [U V]\n";
return(-1); return(-1);
} }
@ -176,7 +176,7 @@ static int BUC60609(Draw_Interpretor& di, Standard_Integer argc, const char ** a
BRepTools::UVBounds (face, faceUMin,faceUMax,faceVMin,faceVMax); BRepTools::UVBounds (face, faceUMin,faceUMax,faceVMin,faceVMax);
di << "The bounds of the trimmed face:" << "\n"; di << "The bounds of the trimmed face:\n";
di << faceUMin << " <= U <= " << faceUMax << "\n"; di << faceUMin << " <= U <= " << faceUMax << "\n";
di << faceVMin << " <= V <= " << faceVMax << "\n"; di << faceVMin << " <= V <= " << faceVMax << "\n";
@ -184,9 +184,9 @@ static int BUC60609(Draw_Interpretor& di, Standard_Integer argc, const char ** a
TopOpeBRep_PointClassifier PClass; TopOpeBRep_PointClassifier PClass;
di << "Now test the point classifier by inputting U,V values" << "\n"; di << "Now test the point classifier by inputting U,V values\n";
di << "inside or outside the bounds displayed above" << "\n"; di << "inside or outside the bounds displayed above\n";
di << "Type stop to exit" << "\n"; di << "Type stop to exit\n";
// Please register this: // Please register this:
// *********************************************** // ***********************************************
@ -201,25 +201,25 @@ static int BUC60609(Draw_Interpretor& di, Standard_Integer argc, const char ** a
uvSurf = gp_Pnt2d(0.14,5.1); uvSurf = gp_Pnt2d(0.14,5.1);
state = PClass.Classify(face,uvSurf,Precision::PConfusion()); state = PClass.Classify(face,uvSurf,Precision::PConfusion());
if(state == TopAbs_IN || state == TopAbs_ON){ if(state == TopAbs_IN || state == TopAbs_ON){
di << "U=" << 0.14 << " V=" << 5.1 << " classified INSIDE" << "\n"; di << "U=" << 0.14 << " V=" << 5.1 << " classified INSIDE\n";
}else{ }else{
di << "U=" << 0.14 << " V=" << 5.1 << " classified OUTSIDE" << "\n"; di << "U=" << 0.14 << " V=" << 5.1 << " classified OUTSIDE\n";
} }
uvSurf = gp_Pnt2d(1.28,5.1); uvSurf = gp_Pnt2d(1.28,5.1);
state = PClass.Classify(face,uvSurf,Precision::PConfusion()); state = PClass.Classify(face,uvSurf,Precision::PConfusion());
if(state == TopAbs_IN || state == TopAbs_ON){ if(state == TopAbs_IN || state == TopAbs_ON){
di << "U=" << 1.28 << " V=" << 5.1 << " classified INSIDE" << "\n"; di << "U=" << 1.28 << " V=" << 5.1 << " classified INSIDE\n";
}else{ }else{
di << "U=" << 1.28 << " V=" << 5.1 << " classified OUTSIDE" << "\n"; di << "U=" << 1.28 << " V=" << 5.1 << " classified OUTSIDE\n";
} }
} else { } else {
uvSurf = gp_Pnt2d(Draw::Atof(argv[3]),Draw::Atof(argv[4])); uvSurf = gp_Pnt2d(Draw::Atof(argv[3]),Draw::Atof(argv[4]));
state = PClass.Classify(face,uvSurf,Precision::PConfusion()); state = PClass.Classify(face,uvSurf,Precision::PConfusion());
if(state == TopAbs_IN || state == TopAbs_ON){ if(state == TopAbs_IN || state == TopAbs_ON){
di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified INSIDE" << "\n"; di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified INSIDE\n";
}else{ }else{
di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified OUTSIDE" << "\n"; di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified OUTSIDE\n";
} }
} }
return 0; return 0;
@ -314,7 +314,7 @@ Standard_Integer ksection(Draw_Interpretor& di, Standard_Integer n, const char *
Toler2d=Draw::Atof(a[6]); Toler2d=Draw::Atof(a[6]);
RelativeTol=Draw::Atoi(a[7]); RelativeTol=Draw::Atoi(a[7]);
di << "BRepAlgo_BooleanOperations myalgo" << "\n"; di << "BRepAlgo_BooleanOperations myalgo\n";
BRepAlgo_BooleanOperations myalgo; BRepAlgo_BooleanOperations myalgo;
myalgo.Shapes(s1, s2); myalgo.Shapes(s1, s2);
@ -397,7 +397,7 @@ static Standard_Integer BUC60699(Draw_Interpretor& di, Standard_Integer /*n*/, c
static Standard_Integer GER61394(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) static Standard_Integer GER61394(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{ {
if(argc > 2) { if(argc > 2) {
di << "Usage : " << argv[0] << " [1/0]" << "\n"; di << "Usage : " << argv[0] << " [1/0]\n";
return -1; return -1;
} }
@ -530,7 +530,7 @@ static Standard_Integer BUC60726 (Draw_Interpretor& di,Standard_Integer argc, co
} }
if(argc != 2) { if(argc != 2) {
di << "Usage : " << argv[0] << " 0/1" << "\n"; di << "Usage : " << argv[0] << " 0/1\n";
} }
if(Draw::Atoi(argv[1]) == 0) { if(Draw::Atoi(argv[1]) == 0) {
@ -547,7 +547,7 @@ static Standard_Integer BUC60726 (Draw_Interpretor& di,Standard_Integer argc, co
myAISContext->OpenLocalContext(); myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_FACE); myAISContext->ActivateStandardMode(TopAbs_FACE);
} else { } else {
di << "Usage : " << argv[0] << " 0/1" << "\n"; di << "Usage : " << argv[0] << " 0/1\n";
return -1; return -1;
} }
@ -604,7 +604,7 @@ static Standard_Integer BUC60724(Draw_Interpretor& di, Standard_Integer /*argc*/
static Standard_Integer BUC60727(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/ ) static Standard_Integer BUC60727(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/ )
{ {
di <<"Program Test" << "\n"; di <<"Program Test\n";
UnitsAPI::SetLocalSystem(UnitsAPI_MDTV); //length is mm UnitsAPI::SetLocalSystem(UnitsAPI_MDTV); //length is mm
di <<"AnyToLS (3,mm) = " << UnitsAPI::AnyToLS(3.,"mm") << "\n"; // result was WRONG. di <<"AnyToLS (3,mm) = " << UnitsAPI::AnyToLS(3.,"mm") << "\n"; // result was WRONG.
@ -786,12 +786,12 @@ static Standard_Integer BUC60811(Draw_Interpretor& di, Standard_Integer argc, co
Ex.Init(FP, TopAbs_VERTEX); Ex.Init(FP, TopAbs_VERTEX);
TopoDS_Vertex v1 = TopoDS::Vertex(Ex.Current()); TopoDS_Vertex v1 = TopoDS::Vertex(Ex.Current());
fillet.AddFillet(v1, 20); fillet.AddFillet(v1, 20);
di << "\n" << "Error is " << fillet.Status() << "\n"; di << "\nError is " << fillet.Status() << "\n";
// printf("\nError is %d ", fillet.Status()); // printf("\nError is %d ", fillet.Status());
Ex.Next(); Ex.Next();
TopoDS_Vertex V2 = TopoDS::Vertex(Ex.Current()); TopoDS_Vertex V2 = TopoDS::Vertex(Ex.Current());
fillet.AddFillet(V2, 20); fillet.AddFillet(V2, 20);
di << "\n" << "Error is " << fillet.Status() << "\n"; di << "\nError is " << fillet.Status() << "\n";
// printf("\nError is %d ", fillet.Status()); // printf("\nError is %d ", fillet.Status());
fillet.Build(); fillet.Build();
FP1 = fillet.Shape(); FP1 = fillet.Shape();
@ -853,7 +853,7 @@ static int BUC60825(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if(argc > 2) { if(argc > 2) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -862,7 +862,7 @@ static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** a
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -911,11 +911,11 @@ static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** a
// BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape()); // BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
//#endif //#endif
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())" <<"\n"; di << "BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape())\n";
BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape()); BRepAlgoAPI_Fuse result(loft1.Shape(), loft2.Shape());
DBRep::Set("F",result.Shape()); DBRep::Set("F",result.Shape());
} else { } else {
di << "BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape())" <<"\n"; di << "BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape())\n";
BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape()); BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
DBRep::Set("F",result.Shape()); DBRep::Set("F",result.Shape());
} }
@ -1032,7 +1032,7 @@ static Standard_Integer BUC60876_ (Draw_Interpretor& di,
return -1; return -1;
} }
if((argc != 2) && (argc != 3)) { if((argc != 2) && (argc != 3)) {
di<< "usage : " << argv[0] << " shape [mode==1]" << "\n"; di<< "usage : " << argv[0] << " shape [mode==1]\n";
return -1; return -1;
} }
TopoDS_Shape aShape = DBRep::Get(argv[1]); TopoDS_Shape aShape = DBRep::Get(argv[1]);
@ -1066,7 +1066,7 @@ static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** ar
{ {
if(argc > 2) { if(argc > 2) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -1075,7 +1075,7 @@ static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** ar
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -1133,16 +1133,16 @@ static int TestCMD(Draw_Interpretor& di, Standard_Integer argc, const char ** ar
TopoDS_Shape fuse; TopoDS_Shape fuse;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)" <<"\n"; di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)\n";
BRepAlgoAPI_Fuse SFuse(SCyl, SCon); BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
if(! SFuse.IsDone() ) if(! SFuse.IsDone() )
di<<"Error: Boolean fuse operation failed !"<<"\n"; di<<"Error: Boolean fuse operation failed !\n";
fuse = SFuse.Shape(); fuse = SFuse.Shape();
} else { } else {
di << "BRepAlgo_Fuse SFuse(SCyl, SCon)" <<"\n"; di << "BRepAlgo_Fuse SFuse(SCyl, SCon)\n";
BRepAlgo_Fuse SFuse(SCyl, SCon); BRepAlgo_Fuse SFuse(SCyl, SCon);
if(! SFuse.IsDone() ) if(! SFuse.IsDone() )
di<<"Error: Boolean fuse operation failed !"<<"\n"; di<<"Error: Boolean fuse operation failed !\n";
fuse = SFuse.Shape(); fuse = SFuse.Shape();
} }
@ -1164,7 +1164,7 @@ static Standard_Integer statface (Draw_Interpretor& di,Standard_Integer /*argc*/
TopoDS_Shape aShape = DBRep::Get(argv[1]); TopoDS_Shape aShape = DBRep::Get(argv[1]);
if(aShape.IsNull()) if(aShape.IsNull())
{ {
di<<"Invalid input shape"<<"\n"; di<<"Invalid input shape\n";
return 1; return 1;
} }
Handle(Dico_DictionaryOfInteger) aDico = new Dico_DictionaryOfInteger(); Handle(Dico_DictionaryOfInteger) aDico = new Dico_DictionaryOfInteger();
@ -1247,8 +1247,8 @@ static Standard_Integer statface (Draw_Interpretor& di,Standard_Integer /*argc*/
} }
di<<"\n"; di<<"\n";
di<<"Degenerated edges :"<<"\n"; di<<"Degenerated edges :\n";
di<<l<<" -- "<<"Degenerated edges "<<"\n"; di<<l<<" -- Degenerated edges \n";
return 0; return 0;
@ -1259,7 +1259,7 @@ static Standard_Integer statface (Draw_Interpretor& di,Standard_Integer /*argc*/
static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv ) static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{ {
if(argc > 2) { if(argc > 2) {
di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -1268,7 +1268,7 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -1299,11 +1299,11 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co
TopoDS_Shape fsh1; TopoDS_Shape fsh1;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)" <<"\n"; di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n";
BRepAlgoAPI_Fuse fuse1(sh1, sh2); BRepAlgoAPI_Fuse fuse1(sh1, sh2);
fsh1 = fuse1.Shape(); fsh1 = fuse1.Shape();
} else { } else {
di << "BRepAlgo_Fuse fuse1(sh1, sh2)" <<"\n"; di << "BRepAlgo_Fuse fuse1(sh1, sh2)\n";
BRepAlgo_Fuse fuse1(sh1, sh2); BRepAlgo_Fuse fuse1(sh1, sh2);
fsh1 = fuse1.Shape(); fsh1 = fuse1.Shape();
} }
@ -1323,11 +1323,11 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co
TopoDS_Shape fsh2; TopoDS_Shape fsh2;
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)" <<"\n"; di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n";
BRepAlgoAPI_Fuse fuse2(fsh1,sh3); BRepAlgoAPI_Fuse fuse2(fsh1,sh3);
fsh2 = fuse2.Shape(); fsh2 = fuse2.Shape();
} else { } else {
di << "BRepAlgo_Fuse fuse2(fsh1,sh3)" <<"\n"; di << "BRepAlgo_Fuse fuse2(fsh1,sh3)\n";
BRepAlgo_Fuse fuse2(fsh1,sh3); BRepAlgo_Fuse fuse2(fsh1,sh3);
fsh2 = fuse2.Shape(); fsh2 = fuse2.Shape();
} }
@ -1370,7 +1370,7 @@ static Standard_Integer BUC60874(Draw_Interpretor& /*di*/, Standard_Integer /*ar
static int BUC60817(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60817(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) { if(argc!=2) {
di << "Usage : " << argv[0] << " D" << "\n"; di << "Usage : " << argv[0] << " D\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1397,7 +1397,7 @@ static int BUC60817(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int BUC60831_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60831_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) { if(argc!=2) {
di << "Usage : " << argv[0] << " D" << "\n"; di << "Usage : " << argv[0] << " D\n";
di<<-1; di<<-1;
return 0; return 0;
} }
@ -1419,7 +1419,7 @@ static int BUC60831_1(Draw_Interpretor& di, Standard_Integer argc, const char **
static int BUC60831_2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60831_2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=3) { if(argc!=3) {
di << "Usage : " << argv[0] << " D Label" << "\n"; di << "Usage : " << argv[0] << " D Label\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1438,7 +1438,7 @@ static int BUC60831_2(Draw_Interpretor& di, Standard_Integer argc, const char **
static int BUC60836(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60836(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) { if(argc!=2) {
di << "Usage : " << argv[0] << " D" << "\n"; di << "Usage : " << argv[0] << " D\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1508,7 +1508,7 @@ static int BUC60836(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int BUC60847(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60847(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=3) { if(argc!=3) {
di << "Usage : " << argv[0] << " D Shape" << "\n"; di << "Usage : " << argv[0] << " D Shape\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1517,7 +1517,7 @@ static int BUC60847(Draw_Interpretor& di, Standard_Integer argc, const char ** a
if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;} if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
TopoDS_Shape s = DBRep::Get(argv[2]); TopoDS_Shape s = DBRep::Get(argv[2]);
if (s.IsNull()) { di <<"shape not found"<< "\n"; di<<3;return 0;} if (s.IsNull()) { di <<"shape not found\n"; di<<3;return 0;}
TDF_Label L; TDF_Label L;
DDF::AddLabel(aDF, "0:2", L); DDF::AddLabel(aDF, "0:2", L);
TNaming_Builder SI (L); TNaming_Builder SI (L);
@ -1535,7 +1535,7 @@ static int BUC60847(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int BUC60862(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60862(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=3) { if(argc!=3) {
di << "Usage : " << argv[0] << " D Shape" << "\n"; di << "Usage : " << argv[0] << " D Shape\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1544,7 +1544,7 @@ static int BUC60862(Draw_Interpretor& di, Standard_Integer argc, const char ** a
if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;} if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
TopoDS_Shape s = DBRep::Get(argv[2]); TopoDS_Shape s = DBRep::Get(argv[2]);
if (s.IsNull()) { di <<"shape not found"<< "\n"; di<<3;return 0;} if (s.IsNull()) { di <<"shape not found\n"; di<<3;return 0;}
TDF_Label L; TDF_Label L;
DDF::AddLabel(aDF, "0:2", L); DDF::AddLabel(aDF, "0:2", L);
TNaming_Builder SI (L); TNaming_Builder SI (L);
@ -1567,7 +1567,7 @@ static int BUC60867(Draw_Interpretor& di, Standard_Integer argc, const char ** a
Handle(TDocStd_Document) D; Handle(TDocStd_Document) D;
Standard_Integer insession = A->IsInSession(path); Standard_Integer insession = A->IsInSession(path);
if (insession > 0) { if (insession > 0) {
di <<"document " << insession << " is already in session" << "\n"; di <<"document " << insession << " is already in session\n";
di<<2; di<<2;
return 0; return 0;
} }
@ -1583,7 +1583,7 @@ static int BUC60867(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int BUC60910(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60910(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) { if(argc!=2) {
di << "Usage : " << argv[0] << " D" << "\n"; di << "Usage : " << argv[0] << " D\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1611,7 +1611,7 @@ static int BUC60910(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int BUC60925(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60925(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) { if(argc!=2) {
di << "Usage : " << argv[0] << " D" << "\n"; di << "Usage : " << argv[0] << " D\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1639,7 +1639,7 @@ static int BUC60925(Draw_Interpretor& di, Standard_Integer argc, const char ** a
static int BUC60932(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) { static int BUC60932(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) { if(argc!=2) {
di << "Usage : " << argv[0] << " D" << "\n"; di << "Usage : " << argv[0] << " D\n";
di<<1; di<<1;
return 0; return 0;
} }
@ -1684,7 +1684,7 @@ static int AISWidth(Draw_Interpretor& di, Standard_Integer argc, const char ** a
di<<prs->Width(); di<<prs->Width();
} }
else{ else{
di << "AISWidth: Warning : Width wasn't set" << "\n"; di << "AISWidth: Warning : Width wasn't set\n";
di<<(-4); di<<(-4);
} }
} }
@ -1737,7 +1737,7 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c
// return -1; // return -1;
// } // }
if(argc < 2 || argc > 3) { if(argc < 2 || argc > 3) {
di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n"; di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1; return 1;
} }
Standard_Boolean IsBRepAlgoAPI = Standard_True; Standard_Boolean IsBRepAlgoAPI = Standard_True;
@ -1746,7 +1746,7 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c
if (IsB != 1) { if (IsB != 1) {
IsBRepAlgoAPI = Standard_False; IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01) #if ! defined(BRepAlgo_def01)
// di << "Error: There is not BRepAlgo_Fuse class" << "\n"; // di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1; // return 1;
#endif #endif
} }
@ -1793,11 +1793,11 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c
// sh = fuse.Shape(); // sh = fuse.Shape();
if (IsBRepAlgoAPI) { if (IsBRepAlgoAPI) {
di << "BRepAlgoAPI_Fuse fuse(sol, sh)" <<"\n"; di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n";
BRepAlgoAPI_Fuse fuse(sol, sh); BRepAlgoAPI_Fuse fuse(sol, sh);
sh = fuse.Shape(); sh = fuse.Shape();
} else { } else {
di << "BRepAlgo_Fuse fuse(sol, sh)" <<"\n"; di << "BRepAlgo_Fuse fuse(sol, sh)\n";
BRepAlgo_Fuse fuse(sol, sh); BRepAlgo_Fuse fuse(sol, sh);
sh = fuse.Shape(); sh = fuse.Shape();
} }

View File

@ -40,7 +40,7 @@ static Standard_Integer OCC6001 (Draw_Interpretor& di, Standard_Integer argc, co
{ {
if (argc < 4) if (argc < 4)
{ {
di<<"missing parameters"<<"\n"; di<<"missing parameters\n";
return 1; return 1;
} }
const char *name = argv[1]; const char *name = argv[1];
@ -53,7 +53,7 @@ static Standard_Integer OCC6001 (Draw_Interpretor& di, Standard_Integer argc, co
TopoDS_Shape wire = DBRep::Get(argv[2]); TopoDS_Shape wire = DBRep::Get(argv[2]);
if (wire.IsNull() || wire.ShapeType() != TopAbs_WIRE) if (wire.IsNull() || wire.ShapeType() != TopAbs_WIRE)
{ {
di<<"incorrect 1st parameter, curve or wire expected"<<"\n"; di<<"incorrect 1st parameter, curve or wire expected\n";
return 1; return 1;
} }
BRepAdaptor_CompCurve comp_curve(TopoDS::Wire(wire)); BRepAdaptor_CompCurve comp_curve(TopoDS::Wire(wire));

View File

@ -37,7 +37,7 @@ static Standard_Integer OCC281bug (Draw_Interpretor& di, Standard_Integer argc,
return -1; return -1;
} }
if(argc < 4) { if(argc < 4) {
di << "Usage : " << argv[0] << " x y TypeOfMarker(0-12)" << "\n"; di << "Usage : " << argv[0] << " x y TypeOfMarker(0-12)\n";
return 1; return 1;
} }
@ -106,11 +106,11 @@ static Standard_Integer OCC281bug (Draw_Interpretor& di, Standard_Integer argc,
V3d_Coordinate X,Y,Z; V3d_Coordinate X,Y,Z;
aView->ConvertToGrid(x,y,X,Y,Z); aView->ConvertToGrid(x,y,X,Y,Z);
} else { } else {
di << "NOT aViewer->GridEcho()" << "\n"; di << "NOT aViewer->GridEcho()\n";
return 1; return 1;
} }
} else { } else {
di << "NOT aViewer->IsActive()" << "\n"; di << "NOT aViewer->IsActive()\n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -253,7 +253,7 @@ const Standard_Integer Glob_Mults[Glob_NbKnots] =
static Standard_Integer OCC862 (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer OCC862 (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if ( argc != 3) { if ( argc != 3) {
di << "ERROR : Usage : " << argv[0] << " curve1 curve2" << "\n"; di << "ERROR : Usage : " << argv[0] << " curve1 curve2\n";
return 1; return 1;
} }
@ -304,12 +304,12 @@ static Standard_Integer OCC862 (Draw_Interpretor& di, Standard_Integer argc, con
const Standard_Real D = Ex.LowerDistance(); const Standard_Real D = Ex.LowerDistance();
// IMPORTANT: minimal distance here means accuracy reached in intersection // IMPORTANT: minimal distance here means accuracy reached in intersection
di<<"Info: Minimal distance is "<<D<<"\n"; di<<"Info: Minimal distance is "<<D<<"\n";
di<<"Info: Minimal points are ("<<P1.X()<<","<<P1.Y()<<","<<P1.Z()<<"), ("<<P2.X()<<","<<P2.Y()<<","<<P2.Z()<<")"<<"\n"; di<<"Info: Minimal points are ("<<P1.X()<<","<<P1.Y()<<","<<P1.Z()<<"), ("<<P2.X()<<","<<P2.Y()<<","<<P2.Z()<<")\n";
di<<"Info: Minimal parameters are ("<<U1<<"), ("<<U2<<")"<<"\n"; di<<"Info: Minimal parameters are ("<<U1<<"), ("<<U2<<")\n";
} }
else else
{ {
di<<"Error: extrema not found"<<"\n"; di<<"Error: extrema not found\n";
} }
} }

View File

@ -37,7 +37,7 @@
static Standard_Integer OCC162 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC162 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 2 ) { if ( argc != 2 ) {
di << "Usage : " << argv[0] << " name" << "\n"; di << "Usage : " << argv[0] << " name\n";
return 1; return 1;
} }
@ -75,7 +75,7 @@ static Standard_Integer OCC172 (Draw_Interpretor& di, Standard_Integer /*argc*/
static Standard_Integer OCC204 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC204 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 2 ) { if ( argc != 2 ) {
di << "Usage : " << argv[0] << " updateviewer=0/1" << "\n"; di << "Usage : " << argv[0] << " updateviewer=0/1\n";
return 1; return 1;
} }
@ -129,7 +129,7 @@ static Standard_Integer OCC204 (Draw_Interpretor& di, Standard_Integer argc, co
static Standard_Integer OCC1651 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) static Standard_Integer OCC1651 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{ {
if ( argc != 8 ) { if ( argc != 8 ) {
di << "Usage : " << argv[0] << " Shape PntX PntY PntZ DirX DirY DirZ" << "\n"; di << "Usage : " << argv[0] << " Shape PntX PntY PntZ DirX DirY DirZ\n";
return 1; return 1;
} }

View File

@ -81,11 +81,11 @@ static Standard_Integer OCC137 (Draw_Interpretor& di, Standard_Integer argc, con
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }
if ( argc < 2 || argc > 3) { if ( argc < 2 || argc > 3) {
di << "ERROR : Usage : " << argv[0] << " highlight_mode [shape]" << "\n"; di << "ERROR : Usage : " << argv[0] << " highlight_mode [shape]\n";
return 1; return 1;
} }
@ -97,12 +97,12 @@ static Standard_Integer OCC137 (Draw_Interpretor& di, Standard_Integer argc, con
TCollection_AsciiString aName(argv[2]); TCollection_AsciiString aName(argv[2]);
Handle(AIS_InteractiveObject) AISObj; Handle(AIS_InteractiveObject) AISObj;
if(!aMap1.IsBound2(aName)) { if(!aMap1.IsBound2(aName)) {
di << "Use 'vdisplay' before" << "\n"; di << "Use 'vdisplay' before\n";
return 1; return 1;
} else { } else {
AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap1.Find2(aName)); AISObj = Handle(AIS_InteractiveObject)::DownCast(aMap1.Find2(aName));
if(AISObj.IsNull()){ if(AISObj.IsNull()){
di << argv[2] << " : No interactive object" << "\n"; di << argv[2] << " : No interactive object\n";
return 1; return 1;
} }
aMap.Bind(AISObj,aName); aMap.Bind(AISObj,aName);
@ -132,11 +132,11 @@ static Standard_Integer OCC137_z (Draw_Interpretor& di, Standard_Integer argc, c
{ {
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull()) { if(aContext.IsNull()) {
di << argv[0] << "ERROR : use 'vinit' command before " << "\n"; di << argv[0] << "ERROR : use 'vinit' command before \n";
return 1; return 1;
} }
if ( argc != 1 && argc != 2) { if ( argc != 1 && argc != 2) {
di << "ERROR : Usage : " << argv[0] << " [ZDetection_mode]" << "\n"; di << "ERROR : Usage : " << argv[0] << " [ZDetection_mode]\n";
return 1; return 1;
} }
aContext->SetZDetection(((argc == 1 || (argc == 2 && Draw::Atoi(argv[1]) == 1)) ? Standard_True : Standard_False)); aContext->SetZDetection(((argc == 1 || (argc == 2 && Draw::Atoi(argv[1]) == 1)) ? Standard_True : Standard_False));

View File

@ -156,7 +156,7 @@ static Standard_Integer Getentry (Draw_Interpretor& di, Standard_Integer n, cons
TopoDS_Shape S = DBRep::Get(a[2]); TopoDS_Shape S = DBRep::Get(a[2]);
if (S.IsNull()) { if (S.IsNull()) {
di <<"Noone shape selected"<<"\n"; di <<"Noone shape selected\n";
di << 0; di << 0;
return 0; return 0;
} }
@ -168,7 +168,7 @@ static Standard_Integer Getentry (Draw_Interpretor& di, Standard_Integer n, cons
else { else {
di <<Name.ToCString(); di <<Name.ToCString();
if (Status == 2) { if (Status == 2) {
di <<"Several shapes have the same name"<<"\n"; di <<"Several shapes have the same name\n";
} }
} }
return 0; return 0;
@ -188,7 +188,7 @@ static Standard_Integer NamedShape(Draw_Interpretor& di, Standard_Integer n, con
if (!DDF::GetDF(a[1],ND)) return 1; if (!DDF::GetDF(a[1],ND)) return 1;
TopoDS_Shape SS = DBRep::Get(a[2]); TopoDS_Shape SS = DBRep::Get(a[2]);
if (SS.IsNull()) { if (SS.IsNull()) {
di <<"Noone shape selected"<<"\n"; di <<"Noone shape selected\n";
di << 0; di << 0;
return 0; return 0;
} }
@ -259,7 +259,7 @@ static Standard_Integer Initialshape (Draw_Interpretor& di, Standard_Integer n,
TDF_Tool::Entry(itL.Value(),entry); TDF_Tool::Entry(itL.Value(),entry);
di <<" , "<< entry.ToCString(); di <<" , "<< entry.ToCString();
} }
di <<"."<<"\n"; di <<".\n";
return 0; return 0;
} }
@ -286,7 +286,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
DDF::FindLabel(ND,a[2],Lab); DDF::FindLabel(ND,a[2],Lab);
Handle(TNaming_NamedShape) NS; Handle(TNaming_NamedShape) NS;
if (!Lab.FindAttribute(TNaming_NamedShape::GetID(),NS)) { if (!Lab.FindAttribute(TNaming_NamedShape::GetID(),NS)) {
di <<"No shape"<<"\n"; di <<"No shape\n";
return 0; return 0;
} }
@ -310,7 +310,7 @@ static Standard_Integer Exploreshape (Draw_Interpretor& di, Standard_Integer n,
} }
di <<"\n"; di <<"\n";
if (NbShapes == 0) { if (NbShapes == 0) {
di <<"No shape"<<"\n"; di <<"No shape\n";
} }
return 0; return 0;
@ -340,7 +340,7 @@ static Standard_Integer Generatedshape (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "GetShape : Error" << "\n"; di << "GetShape : Error\n";
return 1; return 1;
} }
@ -366,7 +366,7 @@ static Standard_Integer Getshape (Draw_Interpretor& di,
return 0; return 0;
} }
} }
di << "DDataStd_GetShape : Error" << "\n"; di << "DDataStd_GetShape : Error\n";
return 1; return 1;
} }
@ -417,7 +417,7 @@ static Standard_Integer Getcreationentry (Draw_Interpretor& di, Standard_Integer
TopoDS_Shape SS = DBRep::Get(a[2]); TopoDS_Shape SS = DBRep::Get(a[2]);
if (SS.IsNull()) { if (SS.IsNull()) {
di <<"Noone shape selected"<<"\n"; di <<"Noone shape selected\n";
di << 0; di << 0;
return 0; return 0;
} }
@ -438,7 +438,7 @@ static Standard_Integer Getcreationentry (Draw_Interpretor& di, Standard_Integer
else { else {
di <<Name.ToCString(); di <<Name.ToCString();
if (Status == 2) { if (Status == 2) {
di <<"Several shapes have the same name"<<"\n"; di <<"Several shapes have the same name\n";
} }
} }
return 0; return 0;

View File

@ -37,7 +37,7 @@ static Standard_Integer BuildNamedShape (Draw_Interpretor& di,
aShape1 = DBRep::Get (arg[a]); aShape1 = DBRep::Get (arg[a]);
if (anInc == 2) { if (anInc == 2) {
if (a == nb - 1) { if (a == nb - 1) {
di<<"For this type of evolution number of shapes must be even"<<"\n"; di<<"For this type of evolution number of shapes must be even\n";
return 1; return 1;
} }
aShape2 = DBRep::Get(arg[a+1]); aShape2 = DBRep::Get(arg[a+1]);
@ -64,7 +64,7 @@ static Standard_Integer BuildNamedShape (Draw_Interpretor& di,
aBuilder.Select(aShape1,aShape2); aBuilder.Select(aShape1,aShape2);
break; break;
default: default:
di<<"Unknown evolution type"<<"\n"; di<<"Unknown evolution type\n";
return 1; return 1;
} }
} }
@ -73,7 +73,7 @@ static Standard_Integer BuildNamedShape (Draw_Interpretor& di,
// OnlyModif = Draw::Atoi(arg[3]); // OnlyModif = Draw::Atoi(arg[3]);
// } // }
} else { } else {
di<<"Usage: BuildName df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]"<<"\n"; di<<"Usage: BuildName df entry evolution(P[RIMITIVE] G[ENERATED] M[ODIFY] D[ELETE] R[EPLACE] S[ELECTED]) shape1 [shape2 ...]\n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -60,7 +60,7 @@ static Standard_Integer GetNewShapes (Draw_Interpretor& di,
if (!QADNaming::Entry(arg, aLabel)) return 1; if (!QADNaming::Entry(arg, aLabel)) return 1;
Handle(TNaming_NamedShape) aNS; Handle(TNaming_NamedShape) aNS;
if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) { if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) {
di<<"Label has no NamedShape"<<"\n"; di<<"Label has no NamedShape\n";
return 1; return 1;
} }
di<<EvolutionString(aNS->Evolution()); di<<EvolutionString(aNS->Evolution());
@ -76,7 +76,7 @@ static Standard_Integer GetNewShapes (Draw_Interpretor& di,
} }
di<<" "<<a-1; di<<" "<<a-1;
} else { } else {
di<<"Usage: GetNewShapes df entry [res]"<<"\n"; di<<"Usage: GetNewShapes df entry [res]\n";
return 1; return 1;
} }
return 0; return 0;
@ -90,7 +90,7 @@ static Standard_Integer GetOldShapes (Draw_Interpretor& di,
if (!QADNaming::Entry(arg, aLabel)) return 1; if (!QADNaming::Entry(arg, aLabel)) return 1;
Handle(TNaming_NamedShape) aNS; Handle(TNaming_NamedShape) aNS;
if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) { if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) {
di<<"Label has no NamedShape"<<"\n"; di<<"Label has no NamedShape\n";
return 1; return 1;
} }
di<<EvolutionString(aNS->Evolution()); di<<EvolutionString(aNS->Evolution());
@ -106,7 +106,7 @@ static Standard_Integer GetOldShapes (Draw_Interpretor& di,
} }
di<<" "<<a-1; di<<" "<<a-1;
} else { } else {
di<<"Usage: GetOldShapes df entry [res]"<<"\n"; di<<"Usage: GetOldShapes df entry [res]\n";
return 1; return 1;
} }
return 0; return 0;
@ -145,7 +145,7 @@ static Standard_Integer GetAllNewShapes (Draw_Interpretor& di,
if (!QADNaming::Entry(arg, aLabel)) return 1; if (!QADNaming::Entry(arg, aLabel)) return 1;
Handle(TNaming_NamedShape) aNS; Handle(TNaming_NamedShape) aNS;
if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) { if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) {
di<<"Label has no NamedShape"<<"\n"; di<<"Label has no NamedShape\n";
return 1; return 1;
} }
Standard_Integer a; Standard_Integer a;
@ -164,14 +164,14 @@ static Standard_Integer GetAllNewShapes (Draw_Interpretor& di,
} else { // shape } else { // shape
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
if (!DDF::GetDF(arg[1],DF)) { if (!DDF::GetDF(arg[1],DF)) {
di<<"Wrong df"<<"\n"; di<<"Wrong df\n";
return 1; return 1;
} }
TopoDS_Shape aShape = DBRep::Get(arg[2]); TopoDS_Shape aShape = DBRep::Get(arg[2]);
aResult=GetAllNew(aShape,DF->Root(),aName,0); aResult=GetAllNew(aShape,DF->Root(),aName,0);
} }
} else { } else {
di<<"Usage: GetAllNewShapes df entry/shape [res]"<<"\n"; di<<"Usage: GetAllNewShapes df entry/shape [res]\n";
return 1; return 1;
} }
di<<aResult; di<<aResult;
@ -213,7 +213,7 @@ static Standard_Integer GetAllOldShapes (Draw_Interpretor& di,
if (!QADNaming::Entry(arg, aLabel)) return 1; if (!QADNaming::Entry(arg, aLabel)) return 1;
Handle(TNaming_NamedShape) aNS; Handle(TNaming_NamedShape) aNS;
if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) { if (!aLabel.FindAttribute(TNaming_NamedShape::GetID(),aNS)) {
di<<"Label has no NamedShape"<<"\n"; di<<"Label has no NamedShape\n";
return 1; return 1;
} }
Standard_Integer a; Standard_Integer a;
@ -232,14 +232,14 @@ static Standard_Integer GetAllOldShapes (Draw_Interpretor& di,
} else { // shape } else { // shape
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
if (!DDF::GetDF(arg[1],DF)) { if (!DDF::GetDF(arg[1],DF)) {
di<<"Wrong df"<<"\n"; di<<"Wrong df\n";
return 1; return 1;
} }
TopoDS_Shape aShape = DBRep::Get(arg[2]); TopoDS_Shape aShape = DBRep::Get(arg[2]);
aResult=GetAllOld(aShape,DF->Root(),aName,0); aResult=GetAllOld(aShape,DF->Root(),aName,0);
} }
} else { } else {
di<<"Usage: GetAllNewShapes df entry/shape [res]"<<"\n"; di<<"Usage: GetAllNewShapes df entry/shape [res]\n";
return 1; return 1;
} }
di<<aResult; di<<aResult;
@ -254,7 +254,7 @@ static Standard_Integer GetSameShapes (Draw_Interpretor& di,
Standard_Integer aResult = 0; Standard_Integer aResult = 0;
Handle(TDF_Data) DF; Handle(TDF_Data) DF;
if (!DDF::GetDF(arg[1],DF)) { if (!DDF::GetDF(arg[1],DF)) {
di<<"Wrong df"<<"\n"; di<<"Wrong df\n";
return 1; return 1;
} }
TopoDS_Shape aShape = DBRep::Get(arg[2]); TopoDS_Shape aShape = DBRep::Get(arg[2]);
@ -268,7 +268,7 @@ static Standard_Integer GetSameShapes (Draw_Interpretor& di,
} }
} }
} else { } else {
di<<"Usage: GetSameShapes df shape"<<"\n"; di<<"Usage: GetSameShapes df shape\n";
return 1; return 1;
} }
di<<aRes.ToCString(); di<<aRes.ToCString();

View File

@ -128,7 +128,7 @@ static Standard_Integer QADNaming_Select (Draw_Interpretor& di, Standard_Integer
} }
return 0; return 0;
} }
di << "QADNaming_Select : Error" << "\n"; di << "QADNaming_Select : Error\n";
return 1; return 1;
} }
@ -148,7 +148,7 @@ static Standard_Integer QADNaming_SolveSelection (Draw_Interpretor& di, Standard
Standard_Integer i; Standard_Integer i;
for(i=3;i<n;i++) { for(i=3;i<n;i++) {
TDF_Label aValidLab; TDF_Label aValidLab;
if (!DDF::FindLabel(aLabel.Data(),a[i],aValidLab)) di<<"Warning: label "<<a[i]<<" not exists"<<"\n"; if (!DDF::FindLabel(aLabel.Data(),a[i],aValidLab)) di<<"Warning: label "<<a[i]<<" not exists\n";
else valid.Add(aValidLab); else valid.Add(aValidLab);
} }
Standard_Boolean done = SL.Solve(valid); Standard_Boolean done = SL.Solve(valid);
@ -158,7 +158,7 @@ static Standard_Integer QADNaming_SolveSelection (Draw_Interpretor& di, Standard
Display (name,Res); Display (name,Res);
return done?0:1; return done?0:1;
} }
di << "Usage: DumpSelection DF entry [validlabel1 validlabel2 ...]" << "\n"; di << "Usage: DumpSelection DF entry [validlabel1 validlabel2 ...]\n";
return 1; return 1;
} }
@ -177,7 +177,7 @@ static Standard_Integer QADNaming_DumpSelection (Draw_Interpretor& di,
if (!DDF::FindLabel(DF,a[2],L)) return 1; if (!DDF::FindLabel(DF,a[2],L)) return 1;
Handle(TNaming_Naming) naming; Handle(TNaming_Naming) naming;
if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) { if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) {
di <<"QADNaming_DumpSelection : not a selection" << "\n"; di <<"QADNaming_DumpSelection : not a selection\n";
return 1; return 1;
} }
DumpNaming(naming, di); DumpNaming(naming, di);
@ -200,7 +200,7 @@ static Standard_Integer QADNaming_DumpSelection (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "QADNaming_DumpSelection : Error" << "\n"; di << "QADNaming_DumpSelection : Error\n";
return 1; return 1;
} }
@ -219,7 +219,7 @@ static Standard_Integer QADNaming_ArgsSelection (Draw_Interpretor& di,
if (!DDF::FindLabel(DF,a[2],L)) return 1; if (!DDF::FindLabel(DF,a[2],L)) return 1;
Handle(TNaming_Naming) naming; Handle(TNaming_Naming) naming;
if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) { if (!L.FindAttribute(TNaming_Naming::GetID(),naming)) {
di <<"QADNaming_DumpSelection : not a selection" << "\n"; di <<"QADNaming_DumpSelection : not a selection\n";
return 1; return 1;
} }
TCollection_AsciiString Entry; TCollection_AsciiString Entry;
@ -234,7 +234,7 @@ static Standard_Integer QADNaming_ArgsSelection (Draw_Interpretor& di,
di << "\n"; di << "\n";
return 0; return 0;
} }
di << "QADNaming_ArgsSelection : Error" << "\n"; di << "QADNaming_ArgsSelection : Error\n";
return 1; return 1;
} }
@ -302,7 +302,7 @@ static Standard_Integer QADNaming_Attachment (Draw_Interpretor& di,
di << "\n"; di << "\n";
return 0; return 0;
} }
di << "QADNaming_Attachment : Error" << "\n"; di << "QADNaming_Attachment : Error\n";
return 1; return 1;
} }

View File

@ -91,7 +91,7 @@ static Standard_Integer QADNaming_CheckHasSame (Draw_Interpretor& di,
for(itr2.Initialize(M2);itr2.More();itr2.Next()) { for(itr2.Initialize(M2);itr2.More();itr2.Next()) {
const TopoDS_Shape& s2 = itr2.Key(); const TopoDS_Shape& s2 = itr2.Key();
if(s1.IsSame(s2)) 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";
} }
} }
@ -143,7 +143,7 @@ static Standard_Integer QADNaming_TCopyShape (Draw_Interpretor& di,
} }
return 0; return 0;
} }
di << "QADNaming_CopyShape : Error" << "\n"; di << "QADNaming_CopyShape : Error\n";
return 1; return 1;
} }

View File

@ -61,26 +61,26 @@ static int VTrihedronOrigins(Draw_Interpretor& di,
const char ** argv) const char ** argv)
{ {
if(argc != 2){ if(argc != 2){
di <<"Usage : vtri_orig tri_name"<<"\n"; di <<"Usage : vtri_orig tri_name\n";
return 1; return 1;
} }
if(TheAISContext().IsNull()){ if(TheAISContext().IsNull()){
di<<"Make 'vinit' before this method call"<<"\n"; di<<"Make 'vinit' before this method call\n";
return 1; return 1;
} }
//get trihedron from AIS map. //get trihedron from AIS map.
TCollection_AsciiString aName(argv[1]); TCollection_AsciiString aName(argv[1]);
if(!GetMapOfAIS().IsBound2(aName)){ if(!GetMapOfAIS().IsBound2(aName)){
di<<"No object named '"<<argv[1]<<"'"<<"\n"; di<<"No object named '"<<argv[1]<<"'\n";
return 1; return 1;
} }
Handle(AIS_Trihedron) aTrih = Handle(AIS_Trihedron) aTrih =
Handle(AIS_Trihedron)::DownCast(GetMapOfAIS().Find2(aName)); Handle(AIS_Trihedron)::DownCast(GetMapOfAIS().Find2(aName));
if(aTrih.IsNull()){ if(aTrih.IsNull()){
di<<"Trihedron is not found, try another name"<<"\n"; di<<"Trihedron is not found, try another name\n";
return 1; return 1;
} }
@ -104,7 +104,7 @@ static int VTrihedronOrigins(Draw_Interpretor& di,
GetMapOfAIS().Bind(YLine,aName+"_Y"); GetMapOfAIS().Bind(YLine,aName+"_Y");
GetMapOfAIS().Bind(ZLine,aName+"_Z"); GetMapOfAIS().Bind(ZLine,aName+"_Z");
//print names of created objects: //print names of created objects:
di<<argv[1]<<"_X "<<argv[1]<<"_Y "<<argv[1]<<"_Z"<<"\n"; di<<argv[1]<<"_X "<<argv[1]<<"_Y "<<argv[1]<<"_Z\n";
//try to draw them: //try to draw them:
TheAISContext()->Display(XLine); TheAISContext()->Display(XLine);

View File

@ -993,17 +993,17 @@ static void CompSparseArray (Draw_Interpretor& theDI,
Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size) Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size)
{ {
if ( argc != 3) { if ( argc != 3) {
di << "Usage : " << argv[0] << " Repeat Size" << "\n"; di << "Usage : " << argv[0] << " Repeat Size\n";
return 1; return 1;
} }
Repeat = Draw::Atoi(argv[1]); Repeat = Draw::Atoi(argv[1]);
Size = Draw::Atoi(argv[2]); Size = Draw::Atoi(argv[2]);
if ( Repeat < 1 ) { if ( Repeat < 1 ) {
di << "Repeat > 0" << "\n"; di << "Repeat > 0\n";
return 1; return 1;
} }
if ( Size < 1 ) { if ( Size < 1 ) {
di << "Size > 0" << "\n"; di << "Size > 0\n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -951,7 +951,7 @@ void TestPerformanceRandomIterator(Draw_Interpretor& di)
// check that result is the same // check that result is the same
if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) ) if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) )
di << "Error: sequences are not the same at the end!" << "\n"; di << "Error: sequences are not the same at the end!\n";
delete aVector; delete aVector;
delete aCollec; delete aCollec;
@ -1003,7 +1003,7 @@ void TestPerformanceForwardIterator(Draw_Interpretor& di)
// check that result is the same // check that result is the same
if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) ) if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) )
di << "Error: sequences are not the same at the end!" << "\n"; di << "Error: sequences are not the same at the end!\n";
delete aVector; delete aVector;
delete aCollec; delete aCollec;
@ -1055,7 +1055,7 @@ void TestPerformanceBidirIterator(Draw_Interpretor& di)
// check that result is the same // check that result is the same
if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) ) if ( ! std::equal (aVector->begin(), aVector->end(), aCollec->begin()) )
di << "Error: sequences are not the same at the end!" << "\n"; di << "Error: sequences are not the same at the end!\n";
delete aVector; delete aVector;
delete aCollec; delete aCollec;
@ -1140,33 +1140,33 @@ void TestPerformanceMapAccess(Draw_Interpretor& di)
//======================================================================= //=======================================================================
static Standard_Integer QANTestNCollectionPerformance (Draw_Interpretor& di, Standard_Integer, const char**) static Standard_Integer QANTestNCollectionPerformance (Draw_Interpretor& di, Standard_Integer, const char**)
{ {
di << "Testing performance (Size | STL time | OCCT time | STL/OCCT boost)" << "\n"; di << "Testing performance (Size | STL time | OCCT time | STL/OCCT boost)\n";
di << "\n" << "std::vector vs NCollection_Array1 (sort):" << "\n\n"; di << "\nstd::vector vs NCollection_Array1 (sort):\n\n";
TestPerformanceRandomIterator<NCollection_Array1<double>, std::vector<double> >(di); TestPerformanceRandomIterator<NCollection_Array1<double>, std::vector<double> >(di);
di << "\n" << "std::vector vs NCollection_Vector (sort):" << "\n\n"; di << "\nstd::vector vs NCollection_Vector (sort):\n\n";
TestPerformanceRandomIterator<NCollection_Vector<double>, std::vector<double> >(di); TestPerformanceRandomIterator<NCollection_Vector<double>, std::vector<double> >(di);
di << "\n" << "std::vector vs NCollection_Array1 (replace):" << "\n\n"; di << "\nstd::vector vs NCollection_Array1 (replace):\n\n";
TestPerformanceForwardIterator<NCollection_Array1<double>, std::vector<double> >(di); TestPerformanceForwardIterator<NCollection_Array1<double>, std::vector<double> >(di);
di << "\n" << "std::vector vs NCollection_Vector (replace):" << "\n\n"; di << "\nstd::vector vs NCollection_Vector (replace):\n\n";
TestPerformanceForwardIterator<NCollection_Vector<double>, std::vector<double> >(di); TestPerformanceForwardIterator<NCollection_Vector<double>, std::vector<double> >(di);
di << "\n" << "std::list vs NCollection_List (replace):" << "\n\n"; di << "\nstd::list vs NCollection_List (replace):\n\n";
TestPerformanceForwardIterator<NCollection_List<double>, std::list<double> >(di); TestPerformanceForwardIterator<NCollection_List<double>, std::list<double> >(di);
di << "\n" << "std::list vs NCollection_Sequence (replace):" << "\n\n"; di << "\nstd::list vs NCollection_Sequence (replace):\n\n";
TestPerformanceForwardIterator<NCollection_Sequence<double>, std::list<double> >(di); TestPerformanceForwardIterator<NCollection_Sequence<double>, std::list<double> >(di);
di << "\n" << "std::list vs NCollection_Sequence (reverse):" << "\n\n"; di << "\nstd::list vs NCollection_Sequence (reverse):\n\n";
TestPerformanceBidirIterator<NCollection_Sequence<double>, std::list<double> >(di); TestPerformanceBidirIterator<NCollection_Sequence<double>, std::list<double> >(di);
di << "\n" << "std::set vs NCollection_Map (search):" << "\n\n"; di << "\nstd::set vs NCollection_Map (search):\n\n";
TestPerformanceMapAccess<NCollection_Map<int>, int>(di); TestPerformanceMapAccess<NCollection_Map<int>, int>(di);
di << "\n" << "std::set vs NCollection_IndexedMap (search):" << "\n\n"; di << "\nstd::set vs NCollection_IndexedMap (search):\n\n";
TestPerformanceMapAccess<NCollection_IndexedMap<int>, int>(di); TestPerformanceMapAccess<NCollection_IndexedMap<int>, int>(di);
return 0; return 0;

View File

@ -592,13 +592,13 @@ static void TestIndexedDataMap (QANCollection_IDMapFunc& theM)
Standard_Integer CheckArguments1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Lower, Standard_Integer& Upper) Standard_Integer CheckArguments1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Lower, Standard_Integer& Upper)
{ {
if ( argc != 3) { if ( argc != 3) {
di << "Usage : " << argv[0] << " Lower Upper" << "\n"; di << "Usage : " << argv[0] << " Lower Upper\n";
return 1; return 1;
} }
Lower = Draw::Atoi(argv[1]); Lower = Draw::Atoi(argv[1]);
Upper = Draw::Atoi(argv[2]); Upper = Draw::Atoi(argv[2]);
if ( Lower > Upper ) { if ( Lower > Upper ) {
di << "Lower > Upper" << "\n"; di << "Lower > Upper\n";
return 1; return 1;
} }
return 0; return 0;
@ -611,7 +611,7 @@ Standard_Integer CheckArguments1(Draw_Interpretor& di, Standard_Integer argc, co
Standard_Integer CheckArguments2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& LowerRow, Standard_Integer& UpperRow, Standard_Integer& LowerCol, Standard_Integer& UpperCol) Standard_Integer CheckArguments2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& LowerRow, Standard_Integer& UpperRow, Standard_Integer& LowerCol, Standard_Integer& UpperCol)
{ {
if ( argc != 5) { if ( argc != 5) {
di << "Usage : " << argv[0] << " LowerRow UpperRow LowerCol UpperCol" << "\n"; di << "Usage : " << argv[0] << " LowerRow UpperRow LowerCol UpperCol\n";
return 1; return 1;
} }
LowerRow = Draw::Atoi(argv[1]); LowerRow = Draw::Atoi(argv[1]);
@ -619,11 +619,11 @@ Standard_Integer CheckArguments2(Draw_Interpretor& di, Standard_Integer argc, co
LowerCol = Draw::Atoi(argv[3]); LowerCol = Draw::Atoi(argv[3]);
UpperCol = Draw::Atoi(argv[4]); UpperCol = Draw::Atoi(argv[4]);
if ( LowerRow > UpperRow ) { if ( LowerRow > UpperRow ) {
di << "LowerRow > UpperRow" << "\n"; di << "LowerRow > UpperRow\n";
return 1; return 1;
} }
if ( LowerCol > UpperCol ) { if ( LowerCol > UpperCol ) {
di << "LowerCol UpperCol> " << "\n"; di << "LowerCol UpperCol> \n";
return 1; return 1;
} }
return 0; return 0;

View File

@ -114,7 +114,7 @@ static Standard_Integer QANewDBRepNaming_CheckNaming(Draw_Interpretor& di,Standa
TDF_Label L2; TDF_Label L2;
DDF::AddLabel(DF, a[5], L2); DDF::AddLabel(DF, a[5], L2);
if (!L2.FindAttribute(TNaming_NamedShape::GetID(), atiNS)) { if (!L2.FindAttribute(TNaming_NamedShape::GetID(), atiNS)) {
di<<"Error: Cannot find shape on label."<<"\n"; di<<"Error: Cannot find shape on label.\n";
return 1; return 1;
} }
amyNS = atiNS; amyNS = atiNS;
@ -124,12 +124,12 @@ static Standard_Integer QANewDBRepNaming_CheckNaming(Draw_Interpretor& di,Standa
if (!strcmp(a[4],"Viewer")) if (!strcmp(a[4],"Viewer"))
aSelectedShape = ViewerTest::PickShape(TopAbs_SHAPE); aSelectedShape = ViewerTest::PickShape(TopAbs_SHAPE);
else{ else{
di<<"Error: Incorrect argument #4"<<"\n"; di<<"Error: Incorrect argument #4\n";
return 1; return 1;
} }
if (aSelectedShape.IsNull()) { if (aSelectedShape.IsNull()) {
di<<"Nothing has been selected ... try again"<<"\n"; di<<"Nothing has been selected ... try again\n";
return 1; return 1;
} }
@ -152,21 +152,21 @@ static Standard_Integer QANewDBRepNaming_CheckNaming(Draw_Interpretor& di,Standa
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
if(SL.Select(aSubShape, aSelectedShape) == Standard_False) { if(SL.Select(aSubShape, aSelectedShape) == Standard_False) {
// if(SL.Select(aSubShape, amyNS->Get()) == Standard_False) // if(SL.Select(aSubShape, amyNS->Get()) == Standard_False)
di << "Selection error!!!" << "\n"; di << "Selection error!!!\n";
return 1; return 1;
} }
Handle(TNaming_NamedShape) aNS; Handle(TNaming_NamedShape) aNS;
if (!aSubLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) { if (!aSubLabel.FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
di<<"Selection didn't produced a Named Shape ..."<<"\n"; di<<"Selection didn't produced a Named Shape ...\n";
return 1; return 1;
} }
const TopoDS_Shape& aResultOfSelection = TNaming_Tool::GetShape(aNS); const TopoDS_Shape& aResultOfSelection = TNaming_Tool::GetShape(aNS);
if (!aSubShape.IsSame(aResultOfSelection)) { if (!aSubShape.IsSame(aResultOfSelection)) {
di<<"Failure of selection"<<"\n"; di<<"Failure of selection\n";
return 1; return 1;
} }
} catch (Standard_Failure) { } catch (Standard_Failure) {
di<<"!!! Solving Failed !!!" << "\n"; di<<"!!! Solving Failed !!!\n";
continue; continue;
} }
@ -190,7 +190,7 @@ static Standard_Integer QANewDBRepNaming_CheckNaming(Draw_Interpretor& di,Standa
aTrsf.SetTranslation(aTranslation); aTrsf.SetTranslation(aTranslation);
TopLoc_Location aLoc(aTrsf); TopLoc_Location aLoc(aTrsf);
const TDF_Label& anOriginLabel = TNaming_Tool::NamedShape(aSelectedShape, L)->Label(); const TDF_Label& anOriginLabel = TNaming_Tool::NamedShape(aSelectedShape, L)->Label();
if (anOriginLabel.IsNull()) di<<"Origin is null"<<"\n"; if (anOriginLabel.IsNull()) di<<"Origin is null\n";
// TNaming::Displace(anOriginLabel, aLoc); // TNaming::Displace(anOriginLabel, aLoc);
// cout<<"Translate label ";anOriginLabel.EntryDump(cout);cout<<endl; // cout<<"Translate label ";anOriginLabel.EntryDump(cout);cout<<endl;
TDF_ChildIterator Labelitr(L.Root(), Standard_False); TDF_ChildIterator Labelitr(L.Root(), Standard_False);
@ -321,10 +321,10 @@ static Standard_Integer QANewDBRepNaming_CheckSelectShape(Draw_Interpretor& di,
TDF_Label L; TDF_Label L;
DDF::AddLabel(DF, a[2], L); DDF::AddLabel(DF, a[2], L);
di<<"SELECT A SUB-SHAPE ..."<<"\n"; di<<"SELECT A SUB-SHAPE ...\n";
TopoDS_Shape aSelectedShape = ViewerTest::PickShape((TopAbs_ShapeEnum)Draw::Atoi(a[3])); TopoDS_Shape aSelectedShape = ViewerTest::PickShape((TopAbs_ShapeEnum)Draw::Atoi(a[3]));
if (aSelectedShape.IsNull()) { if (aSelectedShape.IsNull()) {
di<<"QANewDBRepNaming_CheckSelectShape(): Nothing is selected ..."<<"\n"; di<<"QANewDBRepNaming_CheckSelectShape(): Nothing is selected ...\n";
return 1; return 1;
} }
// Find the context: // Find the context:

View File

@ -140,7 +140,7 @@ static Standard_Integer QANewDBRepNaming_NameBooleanOperationFeat (Draw_Interpre
break; break;
} }
default: default:
di<<"QANewDBRepNaming_NameBooleanOperation The type of operation must be 1 - fuse, 2 - cut or 3 - common"<<"\n"; di<<"QANewDBRepNaming_NameBooleanOperation The type of operation must be 1 - fuse, 2 - cut or 3 - common\n";
} }
return 0; return 0;

View File

@ -44,29 +44,29 @@ static int dejadraw = 0;
static Standard_Integer LocSet (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer LocSet (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if (argc < 2) { if (argc < 2) {
di << argv[0] << "LocSet a [b [c]]: set location for shape \"a\":" << "\n"; di << argv[0] << "LocSet a [b [c]]: set location for shape \"a\":\n";
di << "- to Null if one argument is given" << "\n"; di << "- to Null if one argument is given\n";
di << "- to location of shape b if two arguments are given" << "\n"; di << "- to location of shape b if two arguments are given\n";
di << "- to difference of locations of shapes b and c if three arguments are given" << "\n"; di << "- to difference of locations of shapes b and c if three arguments are given\n";
return 1; return 1;
} }
TopoDS_Shape a = DBRep::Get ( argv[1] ); TopoDS_Shape a = DBRep::Get ( argv[1] );
if ( a.IsNull() ) { if ( a.IsNull() ) {
di << "No shape named \"" << argv[1] << "\" found" << "\n"; di << "No shape named \"" << argv[1] << "\" found\n";
return 1; return 1;
} }
TopLoc_Location L; TopLoc_Location L;
if ( argc >2 ) { if ( argc >2 ) {
TopoDS_Shape b = DBRep::Get ( argv[2] ); TopoDS_Shape b = DBRep::Get ( argv[2] );
if ( b.IsNull() ) { if ( b.IsNull() ) {
di << "No shape named \"" << argv[2] << "\" found" << "\n"; di << "No shape named \"" << argv[2] << "\" found\n";
return 1; return 1;
} }
if ( argc >3 ) { if ( argc >3 ) {
TopoDS_Shape c = DBRep::Get ( argv[3] ); TopoDS_Shape c = DBRep::Get ( argv[3] );
if ( c.IsNull() ) { if ( c.IsNull() ) {
di << "No shape named \"" << argv[3] << "\" found" << "\n"; di << "No shape named \"" << argv[3] << "\" found\n";
return 1; return 1;
} }
L = b.Location().Multiplied ( c.Location().Inverted() ); L = b.Location().Multiplied ( c.Location().Inverted() );
@ -87,19 +87,19 @@ static Standard_Integer LocSet (Draw_Interpretor& di, Standard_Integer argc, con
static Standard_Integer LocDump (Draw_Interpretor& di, Standard_Integer argc, const char** argv) static Standard_Integer LocDump (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
{ {
if (argc < 2) { if (argc < 2) {
di << argv[0] << "LocDump a: dump location of shape \"a\"" << "\n"; di << argv[0] << "LocDump a: dump location of shape \"a\"\n";
return 1; return 1;
} }
TopoDS_Shape a = DBRep::Get ( argv[1] ); TopoDS_Shape a = DBRep::Get ( argv[1] );
if ( a.IsNull() ) { if ( a.IsNull() ) {
di << "No shape named \"" << argv[1] << "\" found" << "\n"; di << "No shape named \"" << argv[1] << "\" found\n";
return 1; return 1;
} }
TopLoc_Location L = a.Location(); TopLoc_Location L = a.Location();
di << "Location of shape " << argv[1] << ":" << "\n"; di << "Location of shape " << argv[1] << ":\n";
di << "Results in:" << "\n"; di << "Results in:\n";
gp_Trsf T = L.Transformation(); gp_Trsf T = L.Transformation();
TopLoc_Location l ( T ); TopLoc_Location l ( T );
Standard_SStream aSStream; Standard_SStream aSStream;

Some files were not shown because too many files have changed in this diff Show More