// Created on: 2002-06-17
// Created by: QA Admin
-// Copyright (c) 2002-2012 OPEN CASCADE SAS
+// Copyright (c) 2002-2014 OPEN CASCADE SAS
//
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
//
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
//
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
#include <QABugs.hxx>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include<Draw_Interpretor.hxx>
-#include<TopLoc_Location.hxx>
-#include<TopoDS_Face.hxx>
-#include<TopoDS.hxx>
-#include<DBRep.hxx>
-#include<Geom_Surface.hxx>
-#include<BRep_Tool.hxx>
-#include<GeomInt_IntSS.hxx>
-#include<BRepBuilderAPI_MakeEdge.hxx>
+#include <Draw.hxx>
+#include <Draw_Interpretor.hxx>
+#include <TopLoc_Location.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS.hxx>
+#include <DBRep.hxx>
+#include <Geom_Surface.hxx>
+#include <BRep_Tool.hxx>
+#include <GeomInt_IntSS.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
#include <Standard_ErrorHandler.hxx>
-#include<tcl.h>
+#include <Graphic3d_ClipPlane.hxx>
+
+#include <fstream>
static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
{
if(argc!=4)
{
- di << "Usage : " << a[0] << " result Shape1 Shape2" << "\n";
+ di << "Usage : " << a[0] << " result Shape1 Shape2\n";
return -1;
}
GeomInt_IntSS Inter;
Inter.Perform(GSF1,GSF2, BRep_Tool::Tolerance(F1));
if (!Inter.IsDone()) {
- di << "Intersection not done" << "\n";
+ di << "Intersection not done\n";
return 1;
}
Standard_Integer nbsol = Inter.NbLines();
return 0;
} else di << "The first solution is Null!" << "\n";
- di << "fini" << "\n";
+ di << "fini\n";
return 0;
}
{
if(argc!=2)
{
- di << "Usage : " << argv[0] << " shape" << "\n";
+ di << "Usage : " << argv[0] << " shape\n";
return -1;
}
{
if(argc!=2)
{
- di << "Usage : "<< argv[0] << " shape" << "\n";
+ di << "Usage : "<< argv[0] << " shape\n";
return -1;
}
#include<BRepAdaptor_HSurface.hxx>
#include<TopOpeBRep_PointClassifier.hxx>
#include<Precision.hxx>
-#ifdef WNT
+#ifdef _MSC_VER
#include<stdio.h>
#endif
static int BUC60609(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
-// char file1[100];
gp_Pnt2d uvSurf;
- double U,V;
TopAbs_State state;
- if(argc < 2){
- printf("Usage: %s draw_format_face\n [name] [interactive (0|1)]",argv[0]);
+ if (argc == 3) {
+ // BUC60609 shape name
+ } else if ( argc == 5 ) {
+ // BUC60609 shape name U V
+ } else {
+ di << "Usage : "<< argv[0] << " shape name [U V]\n";
return(-1);
}
- // MKV 30.03.05
-#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
- const Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
-#else
- Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
-#endif
-
- Standard_Character *file1 = new Standard_Character [strlen(DD)+strlen(argv[1])+2];
- sprintf(file1,"%s/%s",DD,argv[1]);
+ TCollection_AsciiString aFilePath(argv[1]);
filebuf fic;
istream in(&fic);
- if (!fic.open(file1,ios::in)) {
- di << "Cannot open file for reading : " << file1 << "\n";
- delete file1;
+ if (!fic.open(aFilePath.ToCString(),ios::in)) {
+ di << "Cannot open file for reading : " << aFilePath << "\n";
return(-1);
}
S.Read(in);
S.Read(theShape,in);
}else{
- di << "Wrong entity type in " << file1 << "\n";
- delete file1;
+ di << "Wrong entity type in " << aFilePath << "\n";
return(-1);
}
}
DBRep::Set(argv[2],face);
}
- Standard_Boolean inter=Standard_False ;
-
- if(argc > 3){
- inter= (atof(argv[3]) == 0) ? Standard_False : Standard_True ;
- }
-
Standard_Real 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 << faceVMin << " <= V <= " << faceVMax << "\n";
TopOpeBRep_PointClassifier PClass;
- di << "Now test the point classifier by inputting U,V values" << "\n";
- di << "inside or outside the bounds displayed above" << "\n";
- di << "Type stop to exit" << "\n";
+ di << "Now test the point classifier by inputting U,V values\n";
+ di << "inside or outside the bounds displayed above\n";
+ di << "Type stop to exit\n";
// Please register this:
// ***********************************************
// Hence IT WOULD BE USEFUL IF TopOpeBRep_PointClassifier COULD
// COPE WITH PERIODIC SURFACES, i.e. U,V +-Period giving same result.
// *************************************************
- if(inter && (argc != 6)) {
-// while(cin){
- di << "Input U: " << "\n";
-// cin >> U;
-// if(!cin) {
- delete file1;
- return(0);
-// }
- di << "Input V: " << "\n";
-// cin >> V;
-// if(!cin) {
- delete file1;
- return(0);
-// }
-
- uvSurf = gp_Pnt2d(U, V);
-
- //gp_Pnt2d uvSurf(0.14,5.1); // outside!!!
- //gp_Pnt2d uvSurf2(1.28,5.1); // inside
-
- state = PClass.Classify(face,uvSurf,Precision::PConfusion());
- if(state == TopAbs_IN || state == TopAbs_ON){
- di << "U=" << U << " V=" << V << " classified INSIDE" << "\n";
- }else{
- di << "U=" << U << " V=" << V << " classified OUTSIDE" << "\n";
- }
-// }
- } else {
- if(argc != 6) {
- uvSurf = gp_Pnt2d(0.14,5.1);
- state = PClass.Classify(face,uvSurf,Precision::PConfusion());
- if(state == TopAbs_IN || state == TopAbs_ON){
- di << "U=" << 0.14 << " V=" << 5.1 << " classified INSIDE" << "\n";
- }else{
- di << "U=" << 0.14 << " V=" << 5.1 << " classified OUTSIDE" << "\n";
- }
- uvSurf = gp_Pnt2d(1.28,5.1);
- state = PClass.Classify(face,uvSurf,Precision::PConfusion());
- if(state == TopAbs_IN || state == TopAbs_ON){
- di << "U=" << 1.28 << " V=" << 5.1 << " classified INSIDE" << "\n";
- }else{
- di << "U=" << 1.28 << " V=" << 5.1 << " classified OUTSIDE" << "\n";
- }
- } else {
- uvSurf = gp_Pnt2d(atof(argv[4]),atof(argv[5]));
- state = PClass.Classify(face,uvSurf,Precision::PConfusion());
- if(state == TopAbs_IN || state == TopAbs_ON){
- di << "U=" << atof(argv[4]) << " V=" << atof(argv[5]) << " classified INSIDE" << "\n";
- }else{
- di << "U=" << atof(argv[4]) << " V=" << atof(argv[5]) << " classified OUTSIDE" << "\n";
- }
+ if (argc == 3) {
+ uvSurf = gp_Pnt2d(0.14,5.1);
+ state = PClass.Classify(face,uvSurf,Precision::PConfusion());
+ if(state == TopAbs_IN || state == TopAbs_ON){
+ di << "U=" << 0.14 << " V=" << 5.1 << " classified INSIDE\n";
+ }else{
+ di << "U=" << 0.14 << " V=" << 5.1 << " classified OUTSIDE\n";
}
- }
- return 0;
-}
-
-#if ! defined(WNT)
-void stringerror(int state)
-{
- printf("%s",((state&ios::eofbit) !=0)? " [eof]": "");
- printf("%s",((state&ios::failbit)!=0)? " [fail]":"");
- printf("%s",((state&ios::badbit) !=0)? " [bad]": "");
- printf("%s\n",(state==ios::goodbit)? " [ok]": "");
-}
-
-
-//#if defined(LIN)
-//#include <strstream>
-//#else
-//#include <strstream.h>
-//#endif
-#ifdef HAVE_IOSTREAM
-#include <iostream>
-#include <sstream>
-using namespace std;
-#elif defined (HAVE_IOSTREAM_H)
-#include <iostream.h>
-#include <strstream.h>
-#else
-#error "check config.h file or compilation options: either HAVE_IOSTREAM or HAVE_IOSTREAM_H should be defined"
-#endif
-static int UKI61075(Draw_Interpretor& /*di*/, Standard_Integer /*argc*/, const char ** /*argv*/) {
- double da,db;
- char buffer1[128];
-#ifndef USE_STL_STREAM
- ostrstream stringout1(buffer1,sizeof(buffer1));
- istrstream stringin1(buffer1,sizeof(buffer1));
-#else
- ostringstream stringout1(buffer1);
- istringstream stringin1(buffer1);
-#endif
- char buffer2[128];
-#ifndef USE_STL_STREAM
- ostrstream stringout2(buffer2,sizeof(buffer2));
- istrstream stringin2(buffer2,sizeof(buffer2));
-#else
- ostringstream stringout2(buffer1);
- istringstream stringin2(buffer1);
-#endif
-
- stringout1.precision(17);
- stringout2.precision(17);
-
- da=-(DBL_MAX);
- db=DBL_MAX;
- printf("Valeurs originales :\n\t%.17lg %.17lg\n",da,db);
-
- stringout1<<da<<' '<<db<<"\n";
-#ifndef USE_STL_STREAM
- buffer1[stringout1.pcount()]='\0';
-#else
- buffer1[stringout1.str().length()]= '\0' ;
-#endif
-
- printf("Valeurs ecrites dans le fichier :\n\t%s",buffer1);
-
- da=db=0.;
- stringin1>>da>>db;
- printf("Valeurs relues :\n\t%.17lg %.17lg",da,db);
- stringerror(stringin1.rdstate());
-
- stringout2<<da<<' '<<db<<"\n";
-#ifndef USE_STL_STREAM
- buffer2[stringout2.pcount()]='\0';
-#else
- buffer2[stringout2.str().length()]='\0';
-#endif
-
- printf("Valeurs reecrites :\n\t%s",buffer2);
-
- da=db=0.;
- stringin2>>da>>db;
- printf("Valeurs relues a nouveau :\n\t%.17lg %.17lg",da,db);
- stringerror(stringin2.rdstate());
-
- return(0);
-}
-#endif
-
-#include<BRepAlgoAPI_Section.hxx>
-#include<BRepAlgo_Section.hxx>
-
-#include<Geom_Plane.hxx>
-#include<DrawTrSurf.hxx>
-
-//static Standard_CString St = " \"trimsphere\"/\"sphere\" [result] [name] [plane]";
-static Standard_CString St = " \"trimsphere\"/\"sphere\" [result] [name] [plane] [BRepAlgoAPI/BRepAlgo = 1/0]";
-static int BUC60585(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
-
- //if(argc<2) {
- // cerr << "Usage : " << argv[0] << St << endl;
- // return -1;
- //}
- if(argc < 2 || argc > 6) {
- di << "Usage : " << argv[0] << " shape1 shape2 shape3 shape4 shape5 shape6 [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
- return 1;
- }
- Standard_Boolean IsBRepAlgoAPI = Standard_True;
- if (argc == 6) {
- Standard_Integer IsB = atoi(argv[5]);
- if (IsB != 1) {
- IsBRepAlgoAPI = Standard_False;
-#if ! defined(BRepAlgo_def04)
-// di << "Error: There is not BRepAlgo_Section class" << "\n";
-// return 1;
-#endif
+ uvSurf = gp_Pnt2d(1.28,5.1);
+ state = PClass.Classify(face,uvSurf,Precision::PConfusion());
+ if(state == TopAbs_IN || state == TopAbs_ON){
+ di << "U=" << 1.28 << " V=" << 5.1 << " classified INSIDE\n";
+ }else{
+ di << "U=" << 1.28 << " V=" << 5.1 << " classified OUTSIDE\n";
}
- }
-
-
- gp_Dir N;
- if(!strcmp(argv[1],"trimsphere")) {
-//////////////////////////////////////////
-// Uncomment for trimmed sphere bug:
-// filename = "trimsphere.topo";
- N=gp_Dir( 0.0, -1.0, 0.0 );
-//////////////////////////////////////////
- } else if(!strcmp(argv[1],"sphere")) {
-
-//////////////////////////////////////////
-// Uncomment for untrimmed sphere bug:
-
-// filename="sphere.topo";
- N=gp_Dir( 0.0, -0.75103523489975432, -0.66026212668838646 );
-
-//////////////////////////////////////////
} else {
- di << "Usage : " << argv[0] << St << "\n";
- return -1;
- }
-
- // MKV 30.03.05
-#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
- const Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
-#else
- Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
-#endif
-
- Standard_Character *filename = new Standard_Character [strlen(DD)+17];
- sprintf(filename,"%s/%s.topo",DD,argv[1]);
-
- filebuf fic;
- istream in(&fic);
- if (!fic.open(filename,ios::in)) {
- di << "Cannot open file for reading : " << filename << "\n";
- delete filename;
- return -1;
- }
-
- // Read in the shape
-
- BRep_Builder B;
- BRepTools_ShapeSet S(B);
- S.Read(in);
- TopoDS_Shape theShape;
- S.Read(theShape,in);
-
- // Create the plane
-
- gp_Pnt O( 2036.25, -97.5, -1460.499755859375 );
- gp_Dir A( 1.0, 0.0, 0.0 );
-
- gp_Ax3 PLA( O, N, A );
- gp_Pln Pl(PLA);
-
- // Perform the section
-
-//#if ! defined(BRepAlgoAPI_def01)
-// BRepAlgoAPI_Section Sec( theShape, Pl, Standard_False);
-//#else
-// BRepAlgo_Section Sec( theShape, Pl, Standard_False);
-//#endif
-
- TopoDS_Shape res;
-
- try{
- OCC_CATCH_SIGNALS
-// Sec.Approximation(Standard_True);
-
- //Sec.Build();
- //if(!Sec.IsDone()){
- // cout << "Error performing intersection: not done." << endl;
- // delete filename;
- // return -1;
- //}
- //res = Sec.Shape();
-
- if (IsBRepAlgoAPI) {
- di << "BRepAlgoAPI_Section Sec( theShape, Pl, Standard_False)" <<"\n";
- BRepAlgoAPI_Section Sec( theShape, Pl, Standard_False);
- Sec.Build();
- if(!Sec.IsDone()){
- di << "Error performing intersection: not done." << "\n";
- delete filename;
- return -1;
- }
- res = Sec.Shape();
- } else {
- di << "BRepAlgo_Section Sec( theShape, Pl, Standard_False)" <<"\n";
- BRepAlgo_Section Sec( theShape, Pl, Standard_False);
- Sec.Build();
- if(!Sec.IsDone()){
- di << "Error performing intersection: not done." << "\n";
- delete filename;
- return -1;
- }
- res = Sec.Shape();
+ uvSurf = gp_Pnt2d(Draw::Atof(argv[3]),Draw::Atof(argv[4]));
+ state = PClass.Classify(face,uvSurf,Precision::PConfusion());
+ if(state == TopAbs_IN || state == TopAbs_ON){
+ di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified INSIDE\n";
+ }else{
+ di << "U=" << Draw::Atof(argv[3]) << " V=" << Draw::Atof(argv[4]) << " classified OUTSIDE\n";
}
-
- }catch(Standard_Failure){
- Handle(Standard_Failure) error = Standard_Failure::Caught();
- di << "Error performing intersection: not done." << "\n";
- delete filename;
- return -1;
- }
-
- if(argc>3) DBRep::Set(argv[3],theShape);
-
- if(argc>2) DBRep::Set(argv[2],res);
-
- if(argc>4) {
- Handle(Geom_Geometry) result;
- Handle(Geom_Plane) C = new Geom_Plane(Pl);
- result=C;
- DrawTrSurf::Set(argv[4],result);
}
-
- di << "Done" << "\n";
-
- delete filename;
-
- return 0;
-}
-
-#include<TopoDS_Compound.hxx>
-
-static int BUC60547(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
- if(argc!=2) {
- di << "Usage : " << argv[0] << " name" << "\n";
- return -1;
- }
-
- Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
- if(myAISContext.IsNull()) {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return -1;
- }
-
- // MKV 30.03.05
-#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
- const Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
-#else
- Standard_Character *DD = Tcl_GetVar(di.Interp(),"Draw_DataDir",TCL_GLOBAL_ONLY);
-#endif
-
- Standard_Character *Ch = new Standard_Character[strlen(argv[1])+3];
-
- Standard_Character *FileName = new Standard_Character[strlen(DD)+13];
-
- TopoDS_Shape free_1,free_2,free_3,free_4;
- BRep_Builder B;
- sprintf(FileName,"%s/%s",DD,"buc60547a.brep");
- BRepTools::Read(free_1,FileName,B);
- sprintf(FileName,"%s/%s",DD,"buc60547b.brep");
- BRepTools::Read(free_2,FileName,B);
- sprintf(FileName,"%s/%s",DD,"buc60547c.brep");
- BRepTools::Read(free_3,FileName,B);
- sprintf(FileName,"%s/%s",DD,"buc60547d.brep");
- BRepTools::Read(free_4,FileName,B);
- sprintf(Ch,"%s_%i",argv[1],1);
- DBRep::Set(Ch,free_1);
- di << Ch << " ";
- sprintf(Ch,"%s_%i",argv[1],2);
- DBRep::Set(Ch,free_2);
- di << Ch << " ";
- sprintf(Ch,"%s_%i",argv[1],3);
- DBRep::Set(Ch,free_3);
- di << Ch << " ";
- sprintf(Ch,"%s_%i",argv[1],4);
- DBRep::Set(Ch,free_4);
- di << Ch << " ";
-
-// Handle(AIS_Shape) S1 = new AIS_Shape(free_1);
-// Handle(AIS_Shape) S2 = new AIS_Shape(free_2);
-// Handle(AIS_Shape) S3 = new AIS_Shape(free_3);
-// Handle(AIS_Shape) S4 = new AIS_Shape(free_4);
-
-// Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
-
-// myAISContext->Display(S1);
-// myAISContext->Display(S2);
-// myAISContext->Display(S3);
-// myAISContext->Display(S4);
-
-// di.Eval("vfit");
-
- TopoDS_Compound Com;
- BRep_Builder bui;
- bui.MakeCompound(Com);
- bui.Add(Com,free_1);
- bui.Add(Com,free_2);
- bui.Add(Com,free_3);
- bui.Add(Com,free_4);
-
- sprintf(Ch,"%s_%c",argv[1],'c');
- DBRep::Set(Ch,Com);
- di << Ch << " ";
-
- Handle(AIS_Shape) SC = new AIS_Shape(Com);
- myAISContext->Display(SC); // nothing on the screen If I save the compound :
-
- sprintf(FileName,"%s/%s",DD,"free.brep");
-
- BRepTools::Write(Com,FileName);
-
- delete Ch;
- delete FileName;
-
return 0;
}
Handle(AIS_Shape) Ve1 = new AIS_Shape(V1);
Handle(AIS_Shape) Ve2 = new AIS_Shape(V2);
- myAIScontext->Display(Ve1);
- myAIScontext->Display(Ve2);
+ myAIScontext->Display(Ve1);
+ myAIScontext->Display(Ve2);
Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0,0,0),gp_Dir(0,0,1));
TCollection_ExtendedString Ext1("Dim1");
- Handle(AIS_LengthDimension) Dim1 = new AIS_LengthDimension(V1,V2,Plane1,atof(a[2]),Ext1);
-
- myAIScontext->SetDisplayMode(Dim1, atof(a[1]));
+ Handle(AIS_LengthDimension) Dim1 = new AIS_LengthDimension(V1,V2,Plane1->Pln());
+ Dim1->SetCustomValue (Draw::Atof(a[2]));
+
+ Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
+ anAspect->MakeArrows3d (Standard_False);
+ anAspect->MakeText3d (Standard_True);
+ anAspect->MakeTextShaded (Standard_True);
+ anAspect->TextAspect()->SetHeight (2.5);
+ anAspect->ArrowAspect()->SetLength (1.0);
+ Dim1->SetDimensionAspect (anAspect);
+
+ myAIScontext->SetDisplayMode(Dim1, Draw::Atoi(a[1]));
myAIScontext->Display(Dim1);
return 0;
}
static Standard_Integer defNbPntMax = 30;
static Standard_Real defTol3d = 1.e-7;
static Standard_Real defTol2d = 1.e-7;
-static Standard_Boolean defRelativeTol=Standard_True;
Standard_Integer NbPntMax = defNbPntMax;
Standard_Real Toler3d =defTol3d;
Standard_Real Toler2d = defTol2d;
-Standard_Boolean RelativeTol= defRelativeTol;
// //== // ksection : operateur section appelant BRepAlgo_BooleanOperation
//== // ksection : operateur section appelant BRepAlgo_BooleanOperations
//=======================================================================
Standard_Integer ksection(Draw_Interpretor& di, Standard_Integer n, const char ** a) {
if (n < 8) {
- di << "Usage : " << a[0] << " resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol" << "\n";
+ di << "Usage : " << a[0] << " resultat shell1 shell2 NbPntMax Toler3d Toler2d" << "\n";
return -1;
}
// a[1]= resultat
// a[4]= NbPntMax
// a[5]= Toler3d
// a[6]= Toler2d
- // a[7]= RelativeTol
TopoDS_Shape s1 = DBRep::Get(a[2],TopAbs_SHELL);
TopoDS_Shape s2 = DBRep::Get(a[3],TopAbs_SHELL);
if (s1.IsNull() || s2.IsNull()) return 1;
- NbPntMax=atoi(a[4]);
- Toler3d=atof(a[5]);
- Toler2d=atof(a[6]);
- RelativeTol=atoi(a[7]);
+ NbPntMax=Draw::Atoi(a[4]);
+ Toler3d=Draw::Atof(a[5]);
+ Toler2d=Draw::Atof(a[6]);
- di << "BRepAlgo_BooleanOperations myalgo" << "\n";
+ di << "BRepAlgo_BooleanOperations myalgo\n";
BRepAlgo_BooleanOperations myalgo;
myalgo.Shapes(s1, s2);
- myalgo.SetApproxParameters(NbPntMax,Toler3d,Toler2d,RelativeTol);
+ myalgo.SetApproxParameters(NbPntMax,Toler3d,Toler2d);
TopoDS_Shape res; res = myalgo.Section();
DBRep::Set(a[1],res);
return 0;
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgo_Fuse.hxx>
-#include <V3d_Plane.hxx>
#include <V3d_View.hxx>
#include <gce_MakePln.hxx>
-static Standard_Integer BUC60698(Draw_Interpretor& di, Standard_Integer argc, const char ** a)
-{
- if(argc > 2) {
- di << "Usage : " << a[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
- return 1;
- }
- Standard_Boolean IsBRepAlgoAPI = Standard_True;
- if (argc == 2) {
- Standard_Integer IsB = atoi(a[1]);
- if (IsB != 1) {
- IsBRepAlgoAPI = Standard_False;
-#if ! defined(BRepAlgo_def01)
-// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
-// return 1;
-#endif
- }
- }
-
- Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
- if(myAISContext.IsNull()) {
- di << "use 'vinit' command before " << a[0] << "\n";
- return -1;
- }
- TopoDS_Solid box = BRepPrimAPI_MakeBox(1,1,1).Solid();
- TopoDS_Shape sphere = BRepPrimAPI_MakeSphere(gp_Pnt(0.5,0.5,0.5),0.6).Shape();
-
-//#if ! defined(BRepAlgoAPI_def01)
-// TopoDS_Shape fuse = BRepAlgoAPI_Fuse(box,sphere).Shape();
-//#else
-// TopoDS_Shape fuse = BRepAlgo_Fuse(box,sphere).Shape();
-//#endif
-
- TopoDS_Shape fuse;
- if (IsBRepAlgoAPI) {
- di << "fuse = BRepAlgoAPI_Fuse(box,sphere).Shape()" <<"\n";
- fuse = BRepAlgoAPI_Fuse(box,sphere).Shape();
- } else {
- di << "fuse = BRepAlgo_Fuse(box,sphere).Shape()" <<"\n";
- fuse = BRepAlgo_Fuse(box,sphere).Shape();
- }
-
- Handle_AIS_Shape theAISShape = new AIS_Shape(fuse);
- myAISContext->Display(theAISShape);
- di.Eval("vfit");
- gp_Pln thegpPln = gce_MakePln(gp_Pnt(0.5,0.5,0.5),gp_Dir(0,0,1));
- Standard_Real A,B,C,D;
- thegpPln.Coefficients(A,B,C,D);
- Handle_V3d_Plane thePlane = new V3d_Plane(A,B,C,D);
- myAISContext->CurrentViewer()->AddPlane (thePlane); // add to defined planes list
- for (myAISContext->CurrentViewer()->InitActiveViews();
- myAISContext->CurrentViewer()->MoreActiveViews ();
- myAISContext->CurrentViewer()->NextActiveViews ()) {
- try {
- OCC_CATCH_SIGNALS
- myAISContext->CurrentViewer()->ActiveView()->SetPlaneOn(thePlane);
- }
- catch(Standard_Failure) {
- di << "SetPlaneOn catched 1" << "\n";
- }
-#ifdef WNT
- catch(...) {
- di << "SetPlaneOn catched 1" << "\n";
- }
-#endif
- }//ActiveView loop
- for (myAISContext->CurrentViewer()->InitDefinedViews();
- myAISContext->CurrentViewer()->MoreDefinedViews ();
- myAISContext->CurrentViewer()->NextDefinedViews ()) {
- try {
- OCC_CATCH_SIGNALS
- myAISContext->CurrentViewer()->DefinedView()->SetPlaneOn(thePlane);
- }
- catch(Standard_Failure) {
- di << "SetPlaneOn catched 1" << "\n";
- }
-#ifdef WNT
- catch(...) {
- di << "SetPlaneOn catched 2" << "\n";
- }
-#endif
- }//DefinedView loop
- myAISContext->UpdateCurrentViewer();
- myAISContext->OpenLocalContext();
- myAISContext->ActivateStandardMode(TopAbs_FACE);
- return 0;
-}
-
static Standard_Integer BUC60699(Draw_Interpretor& di, Standard_Integer /*n*/, const char ** a)
{
static Standard_Integer GER61394(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{
if(argc > 2) {
- di << "Usage : " << argv[0] << " [1/0]" << "\n";
+ di << "Usage : " << argv[0] << " [1/0]\n";
return -1;
}
}
Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
- if((argc == 2) && (atof(argv[1]) == 0))
+ if((argc == 2) && (Draw::Atof(argv[1]) == 0))
myV3dView->SetAntialiasingOff();
else
myV3dView->SetAntialiasingOn();
// Change the background color of the view with the color values <r>,<g>,<b>
// A color value must be defined in the space [0.,1.]
- Standard_Real QuantityOfRed = atoi(argv[1]);
- Standard_Real QuantityOfGreen = atoi(argv[2]);
- Standard_Real QuantityOfBlue = atoi(argv[3]);
+ Standard_Real QuantityOfRed = Draw::Atoi(argv[1]);
+ Standard_Real QuantityOfGreen = Draw::Atoi(argv[2]);
+ Standard_Real QuantityOfBlue = Draw::Atoi(argv[3]);
myV3dView->SetBackgroundColor(Quantity_TOC_RGB,QuantityOfRed,QuantityOfGreen,QuantityOfBlue);
myV3dView->Redraw();
break;
// change the object color with RGB values.
- Standard_Real QuantityOfRed = atof(argv[2]);
- Standard_Real QuantityOfGreen = atof(argv[3]);
- Standard_Real QuantityOfBlue = atof(argv[4]);
+ Standard_Real QuantityOfRed = Draw::Atof(argv[2]);
+ Standard_Real QuantityOfGreen = Draw::Atof(argv[3]);
+ Standard_Real QuantityOfBlue = Draw::Atof(argv[4]);
TopoDS_Shape aShape = DBRep::Get(argv[1]);
Handle(AIS_InteractiveObject) myShape = new AIS_Shape (aShape);
}
if(argc != 2) {
- di << "Usage : " << argv[0] << " 0/1" << "\n";
+ di << "Usage : " << argv[0] << " 0/1\n";
}
- if(atoi(argv[1]) == 0) {
+ if(Draw::Atoi(argv[1]) == 0) {
myAISContext->CloseAllContexts();
BRepPrimAPI_MakeBox B(gp_Pnt(-400.,-400.,-100.),200.,150.,100.);
Handle(AIS_Shape) aBox = new AIS_Shape(B.Shape());
myAISContext->Display(aBox);
- } else if(atoi(argv[1]) == 1) {
+ } else if(Draw::Atoi(argv[1]) == 1) {
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_EDGE);
- } else if(atoi(argv[1]) == 2) {
+ } else if(Draw::Atoi(argv[1]) == 2) {
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode(TopAbs_FACE);
} else {
- di << "Usage : " << argv[0] << " 0/1" << "\n";
+ di << "Usage : " << argv[0] << " 0/1\n";
return -1;
}
#include <BRepBndLib.hxx>
#include <Bnd_HArray1OfBox.hxx>
-static Standard_Integer BUC60729 (Draw_Interpretor& di,Standard_Integer /*argc*/, const char ** /*argv*/ )
+static Standard_Integer BUC60729 (Draw_Interpretor& /*di*/,Standard_Integer /*argc*/, const char ** /*argv*/ )
{
Bnd_Box aMainBox;
TopoDS_Shape aShape = BRepPrimAPI_MakeBox(1,1,1).Solid();
// Bnd_Box __emptyBox; // Box is void !
-// Handle_Bnd_HArray1OfBox __aSetOfBox = new Bnd_HArray1OfBox( 1, siMaxNbrBox, __emptyBox );
+// Handle(Bnd_HArray1OfBox) __aSetOfBox = new Bnd_HArray1OfBox( 1, siMaxNbrBox, __emptyBox );
for (i=1,aExplorer.ReInit(); aExplorer.More(); aExplorer.Next(),i++ )
{
{
TCollection_AsciiString as1("");
TCollection_AsciiString as2('\0');
- if((as1.ToCString()!=NULL) || (as1.ToCString() != ""))
- di << "Faulty : the first string is not zero string : " << as1.ToCString() << "\n";
+ if(as1.ToCString() == NULL || as1.Length() != 0 || as1.ToCString()[0] != '\0')
+ di << "Error : the first string is not zero string : " << as1.ToCString() << "\n";
- if((as2.ToCString()!=NULL) || (as2.ToCString() != ""))
- di << "Faulty : the second string is not zero string : " << as2.ToCString() << "\n";
+ if(as2.ToCString() == NULL || as2.Length() != 0 || as2.ToCString()[0] != '\0')
+ di << "Error : the second string is not zero string : " << as2.ToCString() << "\n";
return 0;
}
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
di <<"AnyToLS (3,mm) = " << UnitsAPI::AnyToLS(3.,"mm") << "\n"; // result was WRONG.
gp_Pnt pt3d(0, 20, 150);
gp_Ax2 anAx2(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 0, 1));
gp_Circ circ(anAx2, 50.0);
- Handle_Geom_Circle gcir = new Geom_Circle(circ);
- Handle_Geom_Plane pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)));
- Handle_Geom2d_Curve gcir1 = GeomAPI::To2d(gcir, pln->Pln());
+ Handle(Geom_Circle) gcir = new Geom_Circle(circ);
+ Handle(Geom_Plane) pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)));
+ Handle(Geom2d_Curve) gcir1 = GeomAPI::To2d(gcir, pln->Pln());
TopoDS_Shape sh1 = BRepBuilderAPI_MakeEdge(gcir1, pln).Shape();
- Handle_AIS_Shape ais1 = new AIS_Shape(sh1);
+ Handle(AIS_Shape) ais1 = new AIS_Shape(sh1);
aContext->SetColor(ais1, Quantity_NOC_INDIANRED);
aContext->Display(ais1);
DBRep::Set("sh0",sh1);
gp_Pnt2d thepoint;
// local_get_2Dpointfrom3Dpoint(pt3d, pln->Pln(), thepoint);
thepoint = ProjLib::Project(pln->Pln(),pt3d);
- Handle_Geom2d_CartesianPoint ThePoint = new Geom2d_CartesianPoint(thepoint);
+ Handle(Geom2d_CartesianPoint) ThePoint = new Geom2d_CartesianPoint(thepoint);
Geom2dAdaptor_Curve acur1(gcir1) ;
Geom2dGcc_QualifiedCurve qcur1(acur1, GccEnt_outside) ;
Geom2dGcc_Circ2d2TanRad cirtanrad(qcur1, ThePoint, 200.0, 0.0001);
printf("\n No. of solutions = %d\n", cirtanrad.NbSolutions());
- Handle_Geom2d_Circle gccc;
+ Handle(Geom2d_Circle) gccc;
if( cirtanrad.NbSolutions() ) {
for( int i = 1; i<=cirtanrad.NbSolutions(); i++) {
gp_Circ2d ccc = cirtanrad.ThisSolution(i);
gccc = new Geom2d_Circle(ccc);
TopoDS_Shape sh = BRepBuilderAPI_MakeEdge(gccc, pln).Shape();
Standard_Character aStr[5];
- sprintf(aStr,"sh%d",i);
+ Sprintf(aStr,"sh%d",i);
DBRep::Set(aStr,sh);
- Handle_AIS_Shape ais = new AIS_Shape(sh);
+ Handle(AIS_Shape) ais = new AIS_Shape(sh);
if( i ==1 )
aContext->SetColor(ais, Quantity_NOC_GREEN);
if( i == 2)
TopoDS_Shape FP1;
TopoDS_Solid solid;
Handle(AIS_Shape) ais1;
- Handle_AIS_Shape ais2;
+ Handle(AIS_Shape) ais2;
Handle(Geom_BezierSurface) BZ1;
TColgp_Array2OfPnt array1(1,3,1,3);
array1.SetValue(1,1,gp_Pnt(0,100,0));
TopoDS_Shell shell;
B.MakeShell(shell);
B.Add(shell, bzf1);
+ shell.Closed (BRep_Tool::IsClosed (shell));
B.MakeSolid(solid);
B.Add(solid,shell);
gp_Dir D(0, 0, 1.0f);
DBRep::Set("FP",FP);
//step 2. offseting the surface.
- Handle_Geom_OffsetSurface offsurf;
+ Handle(Geom_OffsetSurface) offsurf;
offsurf = new Geom_OffsetSurface(BZ1, -100);
BRepBuilderAPI_MakeFace bzf2( offsurf, Precision::Confusion() );
TopoDS_Face F2= bzf2.Face();
- Handle_AIS_Shape ais22 = new AIS_Shape(F2);
+ Handle(AIS_Shape) ais22 = new AIS_Shape(F2);
aContext->Display(ais22);
DBRep::Set("F2",F2);
Ex.Init(FP, TopAbs_VERTEX);
TopoDS_Vertex v1 = TopoDS::Vertex(Ex.Current());
fillet.AddFillet(v1, 20);
- printf("\nError is %d ", fillet.Status());
+ di << "\nError is " << fillet.Status() << "\n";
+// printf("\nError is %d ", fillet.Status());
Ex.Next();
TopoDS_Vertex V2 = TopoDS::Vertex(Ex.Current());
fillet.AddFillet(V2, 20);
- printf("\nError is %d ", fillet.Status());
+ di << "\nError is " << fillet.Status() << "\n";
+// printf("\nError is %d ", fillet.Status());
fillet.Build();
FP1 = fillet.Shape();
ais2 = new AIS_Shape( FP1 );
{
TopoDS_Edge e1 = TopoDS::Edge(Ex.Current());
Standard_Real f = 0.0, l = 0.0;
- Handle_Geom_Curve newBSplin = BRep_Tool::Curve(e1, f, l);
+ Handle(Geom_Curve) newBSplin = BRep_Tool::Curve(e1, f, l);
newBSplin = new Geom_TrimmedCurve(newBSplin, f, l);
Handle(Geom_Curve) projCurve = GeomProjLib::Project(newBSplin,offsurf);
myWire->Add((BRepBuilderAPI_MakeEdge(projCurve)).Edge());
}
- Handle_AIS_Shape ais33 = new AIS_Shape( myWire->Wire() );
+ Handle(AIS_Shape) ais33 = new AIS_Shape( myWire->Wire() );
aContext->Display(ais33);
DBRep::Set("Wire",myWire->Wire());
static int OCC10006(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if(argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
+ di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
-// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
+// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
// BRepAlgo_Fuse result(loft1.Shape(), loft2.Shape());
//#endif
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());
DBRep::Set("F",result.Shape());
} 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());
DBRep::Set("F",result.Shape());
}
}
gp_Ax2 Cone_Ax;
- double R1=8, R2=16, H1=20, H2=40, angle;
+ double R1=8, R2=16;
gp_Pnt P0(0,0,0),
P1(0,0,20), P2(0,0,45);
- angle = 2*M_PI;
Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone (P1, P2, R1, R2).Value();
TopoDS_Shape myshape = BRepBuilderAPI_MakeFace(S, Precision::Confusion()).Shape();
Handle(AIS_Shape) ais1 = new AIS_Shape(myshape);
return 0;
}
-#if ! defined(WNT)
-//#include <fstream.h>
-#ifdef HAVE_FSTREAM
-# include <fstream>
-#elif defined (HAVE_FSTREAM_H)
-# include <fstream.h>
-#endif
-//#include <Standard_Stream.hxx>
//==========================================================================
//function : CoordLoad
// chargement d une face dans l explorer.
//==========================================================================
-static Standard_Integer coordload (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
+static Standard_Integer coordload (Draw_Interpretor& theDi,
+ Standard_Integer theArgsNb,
+ const char** theArgVec)
{
- char line[256];
- char X[30], Y[30];
- int fr;
- TopoDS_Vertex V1,V2;
- TopoDS_Edge Edge;
- TopoDS_Wire Wire;
- TopoDS_Face Face;
-
- if (argc < 3) return 1;
-
- ifstream file(argv[2], ios::in);
- if(!file)
+ if (theArgsNb < 3)
+ {
+ return 1;
+ }
+
+ std::ifstream aFile (theArgVec[2], ios::in);
+ if (!aFile)
+ {
+ theDi << "unable to open " << theArgVec[2] << " for input\n";
+ return 2;
+ }
+
+ char aLine[80];
+ memset (aLine, 0, 40);
+ aFile.getline (aLine, 80);
+
+ gp_Pnt aPnt (0.0, 0.0, 0.0);
+ aLine[40] = '\0';
+ aPnt.SetY (Draw::Atof (&aLine[20]));
+ aLine[20] = '\0';
+ aPnt.SetX (Draw::Atof (aLine));
+ TopoDS_Vertex aVert1 = BRepBuilderAPI_MakeVertex (aPnt);
+ BRepBuilderAPI_MakeWire aMakeWire;
+ for (;;)
+ {
+ memset (aLine, 0, 40);
+ aFile.getline (aLine, 80);
+ if (!aFile)
{
- di<<"unable to open "<<argv[2]<<" for input"<<"\n";
- return 2;
+ break;
}
- BRepBuilderAPI_MakeWire WB;
- file.getline(line,80);
- for(int i=0;i<30;i++) X[i]=Y[i]=0;
- fr = sscanf(line,"%20c%20c",&X,&Y);
- V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(atof(X),atof(Y),0.0));
+ aLine[40] = '\0';
+ aPnt.SetY (Draw::Atof (&aLine[20]));
+ aLine[20] = '\0';
+ aPnt.SetX (Draw::Atof (aLine));
+ TopoDS_Vertex aVert2 = BRepBuilderAPI_MakeVertex (aPnt);
+ aMakeWire.Add (BRepBuilderAPI_MakeEdge (aVert1, aVert2));
+ aVert1 = aVert2;
+ }
+ aFile.close();
- for(;;)
- {
- file.getline(line,80);
- if (!file) break;
- for(int i=0;i<30;i++) X[i]=Y[i]=0;
- fr = sscanf(line,"%20c%20c",&X,&Y);
- V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(atof(X),atof(Y),0.0));
- Edge = BRepBuilderAPI_MakeEdge(V1,V2);
- WB.Add(Edge);
- V1=V2;
+ if (!aMakeWire.IsDone())
+ {
+ DBRep::Set (theArgVec[1], TopoDS_Face());
+ return 0;
}
-
- file.close();
- if (WB.IsDone()) Wire = WB.Wire();
- Face = BRepBuilderAPI_MakeFace(Wire);
- DBRep::Set (argv[1],Face);
+ BRepBuilderAPI_MakeFace aMakeFace (aMakeWire.Wire());
+ DBRep::Set (theArgVec[1], aMakeFace.IsDone() ? aMakeFace.Face() : TopoDS_Face());
return 0;
}
-#endif
static Standard_Integer TestMem (Draw_Interpretor& /*di*/,
Standard_Integer /*nb*/,
return -1;
}
if((argc != 2) && (argc != 3)) {
- di<< "usage : " << argv[0] << " shape [mode==1]" << "\n";
+ di<< "usage : " << argv[0] << " shape [mode==1]\n";
return -1;
}
TopoDS_Shape aShape = DBRep::Get(argv[1]);
Handle(AIS_InteractiveObject) anIO = new AIS_Shape(aShape);
// Handle(AIS_InteractiveObject) anIOa = ViewerTest::GetAISShapeFromName(argv[1]);
- anIO->SetHilightMode((argc == 3) ? atoi(argv[2]) : 1);
+ anIO->SetHilightMode((argc == 3) ? Draw::Atoi(argv[2]) : 1);
aContext->Display(anIO);
return 0;
}
{
if(argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
+ di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
-// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
+// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
TopoDS_Shape fuse;
if (IsBRepAlgoAPI) {
- di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)" <<"\n";
+ di << "BRepAlgoAPI_Fuse SFuse(SCyl, SCon)\n";
BRepAlgoAPI_Fuse SFuse(SCyl, SCon);
if(! SFuse.IsDone() )
- di<<"Error: Boolean fuse operation failed !"<<"\n";
+ di<<"Error: Boolean fuse operation failed !\n";
fuse = SFuse.Shape();
} else {
- di << "BRepAlgo_Fuse SFuse(SCyl, SCon)" <<"\n";
+ di << "BRepAlgo_Fuse SFuse(SCyl, SCon)\n";
BRepAlgo_Fuse SFuse(SCyl, SCon);
if(! SFuse.IsDone() )
- di<<"Error: Boolean fuse operation failed !"<<"\n";
+ di<<"Error: Boolean fuse operation failed !\n";
fuse = SFuse.Shape();
}
TopoDS_Shape aShape = DBRep::Get(argv[1]);
if(aShape.IsNull())
{
- di<<"Invalid input shape"<<"\n";
+ di<<"Invalid input shape\n";
return 1;
}
Handle(Dico_DictionaryOfInteger) aDico = new Dico_DictionaryOfInteger();
Handle(TColStd_HSequenceOfAsciiString) aSequence = new TColStd_HSequenceOfAsciiString;
Standard_CString aString;
- Standard_Integer i=1,j=1,k=1,l=1,aa=1;
+ Standard_Integer i=1,j=1,l=1,aa=1;
TopExp_Explorer expl;
Standard_Real f3d,l3d;
for(expl.Init(aShape,TopAbs_FACE);expl.More();expl.Next())
}
di<<"\n";
- di<<"Degenerated edges :"<<"\n";
- di<<l<<" -- "<<"Degenerated edges "<<"\n";
+ di<<"Degenerated edges :\n";
+ di<<l<<" -- Degenerated edges \n";
return 0;
static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{
if(argc > 2) {
- di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]" << "\n";
+ di << "Usage : " << argv[0] << " [BRepAlgoAPI/BRepAlgo = 1/0]\n";
return 1;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 2) {
- Standard_Integer IsB = atoi(argv[1]);
+ Standard_Integer IsB = Draw::Atoi(argv[1]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
-// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
+// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
TopoDS_Shape fsh1;
if (IsBRepAlgoAPI) {
- di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)" <<"\n";
+ di << "BRepAlgoAPI_Fuse fuse1(sh1, sh2)\n";
BRepAlgoAPI_Fuse fuse1(sh1, sh2);
fsh1 = fuse1.Shape();
} else {
- di << "BRepAlgo_Fuse fuse1(sh1, sh2)" <<"\n";
+ di << "BRepAlgo_Fuse fuse1(sh1, sh2)\n";
BRepAlgo_Fuse fuse1(sh1, sh2);
fsh1 = fuse1.Shape();
}
TopoDS_Shape fsh2;
if (IsBRepAlgoAPI) {
- di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)" <<"\n";
+ di << "BRepAlgoAPI_Fuse fuse2(fsh1,sh3)\n";
BRepAlgoAPI_Fuse fuse2(fsh1,sh3);
fsh2 = fuse2.Shape();
} else {
- di << "BRepAlgo_Fuse fuse2(fsh1,sh3)" <<"\n";
+ di << "BRepAlgo_Fuse fuse2(fsh1,sh3)\n";
BRepAlgo_Fuse fuse2(fsh1,sh3);
fsh2 = fuse2.Shape();
}
DBRep::Set("fsh2",fsh2);
- Handle_AIS_Shape aisp1 = new AIS_Shape(fsh2);
+ Handle(AIS_Shape) aisp1 = new AIS_Shape(fsh2);
// aContext->Display(aisp1);
return 0;
}
static int BUC60817(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) {
- di << "Usage : " << argv[0] << " D" << "\n";
+ di << "Usage : " << argv[0] << " D\n";
di<<1;
return 0;
}
static int BUC60831_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) {
- di << "Usage : " << argv[0] << " D" << "\n";
+ di << "Usage : " << argv[0] << " D\n";
di<<-1;
return 0;
}
static int BUC60831_2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=3) {
- di << "Usage : " << argv[0] << " D Label" << "\n";
+ di << "Usage : " << argv[0] << " D Label\n";
di<<1;
return 0;
}
static int BUC60836(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) {
- di << "Usage : " << argv[0] << " D" << "\n";
+ di << "Usage : " << argv[0] << " D\n";
di<<1;
return 0;
}
static int BUC60847(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=3) {
- di << "Usage : " << argv[0] << " D Shape" << "\n";
+ di << "Usage : " << argv[0] << " D Shape\n";
di<<1;
return 0;
}
if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
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;
DDF::AddLabel(aDF, "0:2", L);
TNaming_Builder SI (L);
static int BUC60862(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=3) {
- di << "Usage : " << argv[0] << " D Shape" << "\n";
+ di << "Usage : " << argv[0] << " D Shape\n";
di<<1;
return 0;
}
if (!DDF::GetDF(argv[1],aDF)) {di<<2;return 0;}
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;
DDF::AddLabel(aDF, "0:2", L);
TNaming_Builder SI (L);
static int BUC60867(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if (argc == 2) {
TCollection_ExtendedString path (argv[1]);
- Handle(TDocStd_Application) A;
- if (!DDocStd::Find(A)) {di<<1;return 0;}
+ Handle(TDocStd_Application) A = DDocStd::GetApplication();
Handle(TDocStd_Document) D;
Standard_Integer insession = A->IsInSession(path);
if (insession > 0) {
- di <<"document " << insession << " is already in session" << "\n";
+ di <<"document " << insession << " is already in session\n";
di<<2;
return 0;
}
static int BUC60910(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) {
- di << "Usage : " << argv[0] << " D" << "\n";
+ di << "Usage : " << argv[0] << " D\n";
di<<1;
return 0;
}
TDF_Label L;
DDF::AddLabel(aDF, "0:2", L);
- Handle(TPrsStd_AISPresentation) AISP = new TPrsStd_AISPresentation;
-
- AISP->Set(L,TDataXtd_Constraint::GetID());
+ Handle(TPrsStd_AISPresentation) AISP =
+ TPrsStd_AISPresentation::Set(L,TDataXtd_Constraint::GetID());
if (AISP->HasOwnMode()) {di<<3;return 0;}
AISP->SetMode(3);
static int BUC60925(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) {
- di << "Usage : " << argv[0] << " D" << "\n";
+ di << "Usage : " << argv[0] << " D\n";
di<<1;
return 0;
}
static int BUC60932(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) {
if(argc!=2) {
- di << "Usage : " << argv[0] << " D" << "\n";
+ di << "Usage : " << argv[0] << " D\n";
di<<1;
return 0;
}
Handle(TPrsStd_AISPresentation) prs;
if(L.FindAttribute( TPrsStd_AISPresentation::GetID(), prs) ) {
if( argc == 4 ) {
- prs->SetWidth(atof(argv[3]));
+ prs->SetWidth(Draw::Atof(argv[3]));
TPrsStd_AISViewer::Update(L);
}
else {
di<<prs->Width();
}
else{
- di << "AISWidth: Warning : Width wasn't set" << "\n";
+ di << "AISWidth: Warning : Width wasn't set\n";
di<<(-4);
}
}
// return -1;
// }
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;
}
Standard_Boolean IsBRepAlgoAPI = Standard_True;
if (argc == 3) {
- Standard_Integer IsB = atoi(a[2]);
+ Standard_Integer IsB = Draw::Atoi(a[2]);
if (IsB != 1) {
IsBRepAlgoAPI = Standard_False;
#if ! defined(BRepAlgo_def01)
-// di << "Error: There is not BRepAlgo_Fuse class" << "\n";
+// di << "Error: There is not BRepAlgo_Fuse class\n";
// return 1;
#endif
}
TopoDS_Face face = TopoDS::Face(list.FindKey(i));
builder.Add(shell, face);
}
+ shell.Closed (BRep_Tool::IsClosed (shell));
BRepPrimAPI_MakeHalfSpace half(shell, gp_Pnt(0, 0, 20));
TopoDS_Solid sol = half.Solid();
// sh = fuse.Shape();
if (IsBRepAlgoAPI) {
- di << "BRepAlgoAPI_Fuse fuse(sol, sh)" <<"\n";
+ di << "BRepAlgoAPI_Fuse fuse(sol, sh)\n";
BRepAlgoAPI_Fuse fuse(sol, sh);
sh = fuse.Shape();
} else {
- di << "BRepAlgo_Fuse fuse(sol, sh)" <<"\n";
+ di << "BRepAlgo_Fuse fuse(sol, sh)\n";
BRepAlgo_Fuse fuse(sol, sh);
sh = fuse.Shape();
}
theCommands.Add("BUC60623","BUC60623 result Shape1 Shape2",__FILE__,BUC60623,group);
theCommands.Add("BUC60569","BUC60569 shape",__FILE__,BUC60569,group);
theCommands.Add("BUC60614","BUC60614 shape",__FILE__,BUC60614,group);
- theCommands.Add("BUC60609","BUC60609 shape [name] [interactive (0|1)]",__FILE__,BUC60609,group);
-#if ! defined(WNT)
- theCommands.Add("UKI61075","UKI61075",__FILE__,UKI61075,group);
-#endif
- theCommands.Add("BUC60585",St,__FILE__,BUC60585,group);
- theCommands.Add("BUC60547","BUC60547 name",__FILE__,BUC60547,group);
+ theCommands.Add("BUC60609","BUC60609 shape name [U V]",__FILE__,BUC60609,group);
theCommands.Add("BUC60632","BUC60632 mode length",__FILE__,BUC60632,group);
theCommands.Add("BUC60652","BUC60652 face",__FILE__,BUC60652,group);
- theCommands.Add("ksection","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
- theCommands.Add("BUC60682","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
- theCommands.Add("BUC60669","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
- theCommands.Add("PRO19626","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
+ theCommands.Add("ksection","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
+ theCommands.Add("BUC60682","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
+ theCommands.Add("BUC60669","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
+ theCommands.Add("PRO19626","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
theCommands.Add("BUC60574","BUC60574 ",__FILE__,BUC60574,group);
- theCommands.Add("BUC60698","BUC60698 [BRepAlgoAPI/BRepAlgo = 1/0]",__FILE__,BUC60698,group);
-
theCommands.Add("BUC60699","BUC60699 ",__FILE__,BUC60699,group);
theCommands.Add("GER61394","GER61394 [1/0]",__FILE__,GER61394,group);
theCommands.Add("GER61351","GER61351 name/object name/r g b/object r g b",__FILE__,setcolor,group);
theCommands.Add("BUC60856","BUC60856",__FILE__,BUC60856,group);
-#if ! defined(WNT)
theCommands.Add("coordload","load coord from file",__FILE__,coordload);
-#endif
theCommands.Add("TestMem","TestMem",__FILE__,TestMem,group);
theCommands.Add("BUC60945","BUC60945",__FILE__,TestMem,group);