#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Plane.hxx>
+#include <Geom_BSplineSurface.hxx>
#include <gp_Pln.hxx>
#include <Geom2d_Curve.hxx>
#include <GeomAPI.hxx>
#include <Geom_Axis2Placement.hxx>
#include <V3d_View.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
+#include <PrsDim_LengthDimension.hxx>
+#include <PrsDim_RadiusDimension.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <Extrema_ExtPS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_CompSolid.hxx>
#include <StdSelect_ShapeTypeFilter.hxx>
-#include <QABugs_MyText.hxx>
-#include <Prs3d_Projector.hxx>
#include <HLRAlgo_Projector.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Font_NameOfFont.hxx>
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
- aContext->Display (aisp);
+ aContext->Display (aisp, Standard_False);
}
Handle(Geom2d_Curve) fromcurve2d = GeomAPI::To2d (cir, pln);
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
- aContext->Display (aisp);
+ aContext->Display (aisp, Standard_False);
}
Geom2dAdaptor_Curve acur (curve2d), afromcur (fromcurve2d);
DrawTrSurf::Set(st,glin);
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
- new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
+ new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
+ aContext->Display (aisp, Standard_False);
}
}
+ aContext->UpdateCurrentViewer();
di << " Is Done = \n" << (Standard_Integer) lintan.IsDone();
return 0;
}
static Standard_Integer BUC60843 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{
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;
}
Handle(Geom2d_Curve) aCur2d1 = DrawTrSurf::GetCurve2d(argv[2]);
Handle(Geom2d_Curve) aCur2d2 = DrawTrSurf::GetCurve2d(argv[3]);
if (aCur2d1.IsNull() || aCur2d2.IsNull()) {
- di << "Faulty : not curves" << "\n";
+ di << "Faulty : not curves\n";
return 1;
}
Standard_Boolean c1IsCircle = Standard_False;
Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
DrawTrSurf::Set(argv[1], glin);
} else {
- di << "Faulty : tangent line is not done." << "\n";
+ di << "Faulty : tangent line is not done.\n";
}
}
else {
Handle(Geom2d_Line) glin = new Geom2d_Line(lin);
DrawTrSurf::Set(argv[1], glin);
} else {
- di << "Faulty : tangent line is not done." << "\n";
+ di << "Faulty : tangent line is not done.\n";
}
}
return 0;
{
if(argc!=3)
{
- di << "Usage : " << argv[0] << " shape result" <<"\n";
+ di << "Usage : " << argv[0] << " shape result\n";
return 1;
}
di << "total no of wires are ............. " << i << "\n";
TopoDS_Wire spineWire = bRepSpineWire.Wire();
- aContext->Display(new AIS_Shape(spineWire));
+ aContext->Display (new AIS_Shape(spineWire), Standard_False);
DBRep::Set("slineW",spineWire);
gp_Circ gpCirc(gpAx2, 2.5);
BRepBuilderAPI_MakeWire aMWire(BRepBuilderAPI_MakeEdge(new Geom_Circle(gpCirc)).Edge());
TopoDS_Wire topoWire(aMWire);
- aContext->Display(new AIS_Shape(topoWire));
+ aContext->Display (new AIS_Shape(topoWire), Standard_False);
DBRep::Set("topoW",topoWire);
bRepPipe.Add(topoWire);
bRepPipe.Build();
- aContext->Display(new AIS_Shape(bRepPipe.Shape()));
+ aContext->Display (new AIS_Shape(bRepPipe.Shape()), Standard_True);
DBRep::Set(argv[2],bRepPipe.Shape());
return 0;
}
-static Standard_Integer BUC60818(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
- if(argc!=1)
- {
- di << "Usage : " << argv[0] << "\n";
- return -1;
- }
-
- Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
- if(myAISContext.IsNull())
- {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return -1;
- }
-
- // TRIHEDRON
- Handle(AIS_Trihedron) aTrihedron;
- Handle(Geom_Axis2Placement) aTrihedronAxis=new Geom_Axis2Placement(gp::XOY());
- aTrihedron=new AIS_Trihedron(aTrihedronAxis);
- myAISContext->Display(aTrihedron);
-
- myAISContext->OpenLocalContext();
- myAISContext->Load(aTrihedron,0);
-
- myAISContext->SetAutomaticHilight( Standard_False );
-
- Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
- double Xv,Yv;
- myV3dView->Project(0,0,0,Xv,Yv);
-
- Standard_Integer Xp,Yp;
- myV3dView->Convert(Xv,Yv,Xp,Yp);
-
- myAISContext->MoveTo( Xp,Yp, myV3dView );
- myAISContext->MoveTo( Xp,Yp, myV3dView );
-
- if (myAISContext->HasDetected( ))
- di << "has detected shape : OK" << "\n";
- else di << "has detected shape : bugged - Faulty " << "\n";
-
- myAISContext->SetAutomaticHilight( Standard_True );
-
- return 0;
-}
-
static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if (argc > 1) {
- di<<"Function don't has parameters"<<"\n";
+ di<<"Function don't has parameters\n";
return 1;
}
/***************************************/
//dimension "L 502.51"
/***************************************/
- Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln->Pln());
+ Handle(PrsDim_LengthDimension) len = new PrsDim_LengthDimension(V2, V3, pln->Pln());
anAspect->ArrowAspect()->SetLength (30.0);
len->SetDimensionAspect (anAspect);
- context->Display(len);
+ context->Display (len, Standard_False);
/***************************************/
//dimension "L 90"
/***************************************/
- Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V7, V4, pln->Pln());
+ Handle(PrsDim_LengthDimension) len1 = new PrsDim_LengthDimension(V7, V4, pln->Pln());
len1->SetDimensionAspect (anAspect);
len1->SetFlyout (30.0);
anAspect->ArrowAspect()->SetLength (100.0);
- context->Display(len1);
+ context->Display (len1, Standard_False);
/***************************************/
//dimension "L 150"
/***************************************/
- Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln->Pln());
+ Handle(PrsDim_LengthDimension) len2 = new PrsDim_LengthDimension(V1, V2, pln->Pln());
len2->SetDimensionAspect (anAspect);
- context->Display(len2);
+ context->Display (len2, Standard_False);
/***************************************/
//dimension "R 88.58"
/***************************************/
gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58);
TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) );
- Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1);
+ Handle(PrsDim_RadiusDimension) dim1 = new PrsDim_RadiusDimension(E1);
dim1->SetDimensionAspect (anAspect);
- context->Display(dim1);
+ context->Display (dim1, Standard_False);
/***************************************/
//dimension "R 43.80"
/***************************************/
gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80);
TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1);
- dim1 = new AIS_RadiusDimension(E_cir1);
+ dim1 = new PrsDim_RadiusDimension(E_cir1);
anAspect->ArrowAspect()->SetLength (60.0);
dim1->SetDimensionAspect (anAspect);
- context->Display(dim1);
+ context->Display (dim1, Standard_False);
/***************************************/
//dimension "R 17.86"
/***************************************/
gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86);
TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2);
- dim1 = new AIS_RadiusDimension(E_cir2);
+ dim1 = new PrsDim_RadiusDimension(E_cir2);
anAspect->ArrowAspect()->SetLength (40.0);
dim1->SetDimensionAspect (anAspect);
- context->Display(dim1);
+ context->Display (dim1, Standard_True);
return 0;
}
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
- Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
- Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
- Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
+ Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
+ Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
+ Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
- aContext->Display(ais1);
- aContext->Display(ais2);
- aContext->Display(ais3);
+ aContext->Display (ais1, Standard_False);
+ aContext->Display (ais2, Standard_False);
+ aContext->Display (ais3, Standard_False);
- aContext->AddOrRemoveCurrentObject(ais1);
- aContext->AddOrRemoveCurrentObject(ais2);
- aContext->AddOrRemoveCurrentObject(ais3);
+ aContext->AddOrRemoveSelected (ais1, Standard_False);
+ aContext->AddOrRemoveSelected (ais2, Standard_False);
+ aContext->AddOrRemoveSelected (ais3, Standard_False);
- di << "\n No of currents = " << aContext->NbCurrents();
+ di << "\n No of currents = " << aContext->NbSelected();
- aContext->InitCurrent();
+ aContext->InitSelected();
int count = 1;
- while(aContext->MoreCurrent())
+ while(aContext->MoreSelected())
{
di << "\n count is = " << count++;
- Handle(AIS_InteractiveObject) ais = aContext->Current();
- aContext->AddOrRemoveCurrentObject(ais);
- aContext->InitCurrent();
- }
-
- return 0;
-}
-
-static Standard_Integer BUC60821(Draw_Interpretor& di, Standard_Integer argc,const char ** argv )
-{
-
- if(argc < 3){
- di << "Usage: " << argv[0] << " TextHight1 TextHight2 TextHight2";
- return(-1);
- }
-
- Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
-
- if(aContext.IsNull())
- {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return -1;
+ Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
+ aContext->AddOrRemoveSelected (ais, Standard_False);
+ aContext->InitSelected();
}
- Handle(QABugs_MyText) txt1 = new QABugs_MyText("Gosha1",gp_Pnt(0,0,0),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_RED,Draw::Atoi(argv[1]));
- aContext->Display(txt1);
-
- Handle(QABugs_MyText) txt2 = new QABugs_MyText("Gosha2",gp_Pnt(0,0,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_YELLOW,Draw::Atoi(argv[2]));
- aContext->Display(txt2);
-
- Handle(QABugs_MyText) txt3 = new QABugs_MyText("Gosha3",gp_Pnt(0,100,100),Font_NOF_ASCII_SIMPLEX,Quantity_NOC_SKYBLUE,Draw::Atoi(argv[3]));
- aContext->Display(txt3);
+ aContext->UpdateCurrentViewer();
- return 0;
+ return 0;
}
static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pnt2d& pnt2d)
return -1;
}
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;
}
TCollection_AsciiString anOldName = ViewerTest::GetCurrentViewName();
Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
- if (Draw::Atoi (argv[2]))
- {
- aViewer->SetDefaultSurfaceDetail (V3d_TEX_ALL);
- }
aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
Handle(Aspect_Window) asp = ViewerTest::CurrentView()->Window();
Handle(V3d_View) aNewView = aViewer->CreateView();
return 0;
}
-static Standard_Integer OCC232 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
-{
- Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
- if(aContext.IsNull()) {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return 1;
- }
-
- BRep_Builder builder;
- TopoDS_Compound comp;
- TopoDS_CompSolid cs1, cs2;
-
- builder.MakeCompound(comp);
- builder.MakeCompSolid(cs1);
- builder.MakeCompSolid(cs2);
-
- TopoDS_Shape sh1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), 100, 100, 100).Shape();
- TopoDS_Shape sh2 = BRepPrimAPI_MakeBox(gp_Pnt(100, 0, 0), 100, 100, 100).Shape();
- TopoDS_Shape sh3 = BRepPrimAPI_MakeBox(gp_Pnt(200, 0, 0), 100, 100, 100).Shape();
- builder.Add(cs1, sh1);
- builder.Add(cs1, sh2);
- builder.Add(cs1, sh3);
-
- TopoDS_Shape sh4 = BRepPrimAPI_MakeBox(gp_Pnt(0, 500, 0), 100, 100, 100).Shape();
- TopoDS_Shape sh5 = BRepPrimAPI_MakeBox(gp_Pnt(100, 500, 0), 100, 100, 100).Shape();
- TopoDS_Shape sh6 = BRepPrimAPI_MakeBox(gp_Pnt(200, 500, 0), 100, 100, 100).Shape();
-
- builder.Add(cs2, sh4);
- builder.Add(cs2, sh5);
- builder.Add(cs2, sh6);
-
- builder.Add(comp, cs1);
- builder.Add(comp, cs2);
-
- Handle(AIS_Shape) ais = new AIS_Shape(comp);
- aContext->Display(ais);
-
- TopExp_Explorer exp(comp, TopAbs_COMPSOLID);
- while(exp.More())
- {
- //printf("\n TopAbs_COMPSOLID is there \n");
- di << "\n TopAbs_COMPSOLID is there \n";
- exp.Next();
- }
-
- Handle (StdSelect_ShapeTypeFilter) filt = new StdSelect_ShapeTypeFilter(TopAbs_COMPSOLID);
- aContext->AddFilter(filt);
- aContext->CloseAllContexts();
- aContext->OpenLocalContext();
- aContext->ActivateStandardMode(TopAbs_SOLID);
-
- return 0;
-}
-
static Standard_Integer OCC138LC (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
{
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300,300));
BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500,500));
- Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
- Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
- Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
+ Handle(AIS_InteractiveObject) ais1 = new AIS_Shape(box1.Shape());
+ Handle(AIS_InteractiveObject) ais2 = new AIS_Shape(box2.Shape());
+ Handle(AIS_InteractiveObject) ais3 = new AIS_Shape(box3.Shape());
- aContext->Display(ais1);
- aContext->Display(ais2);
- aContext->Display(ais3);
+ aContext->Display (ais1, Standard_False);
+ aContext->Display (ais2, Standard_False);
+ aContext->Display (ais3, Standard_False);
- aContext->AddOrRemoveSelected(ais1);
- aContext->AddOrRemoveSelected(ais2);
- aContext->AddOrRemoveSelected(ais3);
+ aContext->AddOrRemoveSelected (ais1, Standard_False);
+ aContext->AddOrRemoveSelected (ais2, Standard_False);
+ aContext->AddOrRemoveSelected (ais3, Standard_False);
di << "\n No of selected = " << aContext->NbSelected();
{
di << "\n count is = %d" << count++;
Handle(AIS_InteractiveObject) ais = aContext->SelectedInteractive();
- aContext->AddOrRemoveSelected(ais);
+ aContext->AddOrRemoveSelected (ais, Standard_False);
aContext->InitSelected();
}
- return 0;
-}
-
-static Standard_Integer OCC189 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
-{
- Handle(AIS_InteractiveContext) aContext1 = ViewerTest::GetAISContext();
- if(aContext1.IsNull()) {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return 1;
- }
- Handle(AIS_InteractiveContext) aContext2 = ViewerTest::GetAISContext();
- if(aContext2.IsNull()) {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return 1;
- }
-
- BRepPrimAPI_MakeBox box1(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 100));
- BRepPrimAPI_MakeBox box2(gp_Pnt(120, 120, 120), gp_Pnt(300, 300, 300));
- BRepPrimAPI_MakeBox box3(gp_Pnt(320, 320, 320), gp_Pnt(500, 500, 500));
-
- Handle(AIS_Shape) ais1 = new AIS_Shape(box1.Shape());
- Handle(AIS_Shape) ais2 = new AIS_Shape(box2.Shape());
- Handle(AIS_Shape) ais3 = new AIS_Shape(box3.Shape());
-
- aContext1->Display(ais1);
- aContext1->Display(ais2);
- aContext1->Display(ais3);
-
- aContext2->Display(ais1);
- aContext2->Display(ais2);
- aContext2->Display(ais3);
-
- aContext1->AddOrRemoveCurrentObject(ais1);
- aContext1->AddOrRemoveCurrentObject(ais2);
- aContext1->AddOrRemoveCurrentObject(ais3);
-
- di << "\n Stage : 1";
- di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
- di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
-
- di << "\n aContext1->IsCurrent = " << (Standard_Integer) aContext1->IsCurrent(ais1) << ", aContext2->IsCurrent = " << (Standard_Integer) aContext2->IsCurrent(ais1) << " ";
-
- aContext2->AddOrRemoveCurrentObject(ais1);
- aContext2->AddOrRemoveCurrentObject(ais2);
- aContext2->AddOrRemoveCurrentObject(ais3);
-
- di << "\n Stage : 2";
- di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
- di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
-
- aContext1->InitCurrent();
- int count1 = 1;
- while(aContext1->MoreCurrent())
- {
- di << "\n count1 is = " << count1++;
- Handle(AIS_InteractiveObject) ais = aContext1->Current();
- aContext1->AddOrRemoveCurrentObject(ais);
- aContext1->InitCurrent();
- }
-
- di << "\n Stage : 3";
- di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
- di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents() << "\n\n";
-
- aContext2->InitCurrent();
- int count2 = 1;
- while(aContext2->MoreCurrent())
- {
- di << "\n count2 is = " << count2++;
- Handle(AIS_InteractiveObject) ais = aContext2->Current();
- aContext2->AddOrRemoveCurrentObject(ais);
- aContext2->InitCurrent();
- }
-
- di << "\n\n Stage : 4";
- di << "\n \t No of currents on aContext1 = " << aContext1->NbCurrents();
- di << "\n \t No of currents on aContext2 = " << aContext2->NbCurrents();
+ aContext->UpdateCurrentViewer();
return 0;
}
static Standard_Integer OCC566(Draw_Interpretor& di,Standard_Integer n,const char ** a)
{
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;
}
TopoDS_Shape S = DBRep::Get(a[1]);
static Standard_Integer OCC570 (Draw_Interpretor& di, Standard_Integer argc,const char ** argv)
{
if (argc < 2) {
- di<<"Usage: " << argv[0] << " result"<<"\n";
+ di<<"Usage: " << argv[0] << " result\n";
return 1;
}
DBRep::Set(argv[1],aFinalShape);
}
- catch(Standard_Failure)
+ catch(Standard_Failure const&)
{
- di << argv[0] << ": Exception in fillet"<<"\n";
+ di << argv[0] << ": Exception in fillet\n";
return 2;
}
}
const char ** a)
{
if(Rake == 0){
- di << "MakeFillet non initialise"<<"\n";
+ di << "MakeFillet non initialise\n";
return 1 ;
}
if(narg%2 != 0 || narg < 4) return 1;
const Standard_Boolean aLawMode = !strcmp(a[0],"OCC570evollaw");
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;
law->Set(uandr);
Rake->Add(law,E);
const char **)
{
if(Rake == 0){
- di << "MakeFillet non initialise"<<"\n";
+ di << "MakeFillet non initialise\n";
return 1 ;
}
Rake->Build();
{
if (n != 3 && n != 4)
{
- di << "Usage : " << a[0] << " result shape [-t]" << "\n";
+ di << "Usage : " << a[0] << " result shape [-t]\n";
return 0;
}
Standard_Boolean TrimMode = (n == 4);
- if (TrimMode) di<<"INFO: Using trimmed curves..."<<"\n";
- else di<<"INFO: Using non trimmed curves..."<<"\n";
+ if (TrimMode) di<<"INFO: Using trimmed curves...\n";
+ else di<<"INFO: Using non trimmed curves...\n";
TopoDS_Shape S = DBRep::Get(a[2]);
{
OCC_CATCH_SIGNALS
GeomFill_NSections b_surface1(n_curves1, np);
- b_surface1.ComputeSurface();
Handle(Geom_BSplineSurface) result_surf1 = b_surface1.BSplineSurface();
if (!result_surf1.IsNull())
{
DBRep::Set(a[1],bsp_face1);
}
}
- catch(Standard_Failure)
+ catch(Standard_Failure const&)
{
- di<<"ERROR: Exception in GeomFill_NSections"<<"\n";
+ di<<"ERROR: Exception in GeomFill_NSections\n";
}
}
{
if (argc < 3)
{
- di << "Usage : " << argv[0] << " U V" << "\n";
+ di << "Usage : " << argv[0] << " U V\n";
return 1;
}
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
- aContext->Display (aisp);
+ aContext->Display (aisp, Standard_False);
}
//This does not give any solutions.
DrawTrSurf::Set(st,glin);
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
- new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
+ new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
+ aContext->Display (aisp, Standard_False);
}
}
+ if (!aContext.IsNull())
+ {
+ aContext->UpdateCurrentViewer();
+ }
+
return 0;
}
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(curve2d, pln)).Edge());
- aContext->Display (aisp);
+ aContext->Display (aisp, Standard_False);
}
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(fromcurve2d, pln)).Edge());
- aContext->Display (aisp);
+ aContext->Display (aisp, Standard_False);
}
Geom2dAdaptor_Curve acur(curve2d), afromcur(fromcurve2d);
DrawTrSurf::Set(st,glin);
if(!aContext.IsNull()) {
Handle(AIS_Shape) aisp =
- new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge()); aContext->Display (aisp);
+ new AIS_Shape (BRepBuilderAPI_MakeEdge(GeomAPI::To3d(glin, pln)).Edge());
+ aContext->Display (aisp, Standard_False);
}
}
+ if (!aContext.IsNull())
+ {
+ aContext->UpdateCurrentViewer();
+ }
+
return 0;
}
{
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;
}
TopExp_Explorer exp(shape, TopAbs_EDGE);
if (!exp.More())
{
- di<<"Error: no edge found"<<"\n";
+ di<<"Error: no edge found\n";
return 1;
}
return 0;
}
-#include <Aspect_FillMethod.hxx>
-//=======================================================================
-//function : OCC1188
-//purpose :
-//=======================================================================
-static Standard_Integer OCC1188 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
- if (argc < 2 || argc > 3)
- {
- di << "Usage : " << argv[0] << " imagefile [filltype] : Load image as background" << "\n";
- return 1;
- }
-
- Handle(AIS_InteractiveContext) AISContext = ViewerTest::GetAISContext();
- if(AISContext.IsNull())
- {
- di << "use 'vinit' command before " << argv[0] << "\n";
- return 1;
- }
-
- Aspect_FillMethod aFillType = Aspect_FM_CENTERED;
- if (argc == 3)
- {
- const char* szType = argv[2];
- if (strcmp(szType, "NONE" ) == 0) aFillType = Aspect_FM_NONE;
- else if (strcmp(szType, "CENTERED") == 0) aFillType = Aspect_FM_CENTERED;
- else if (strcmp(szType, "TILED" ) == 0) aFillType = Aspect_FM_TILED;
- else if (strcmp(szType, "STRETCH" ) == 0) aFillType = Aspect_FM_STRETCH;
- else
- {
- di << "Wrong fill type : " << szType << "\n";
- di << "Must be one of CENTERED, TILED, STRETCH, NONE" << "\n";
- return 1;
- }
- }
-
- Handle(V3d_View) V3dView = ViewerTest::CurrentView();
- V3dView->SetBackgroundImage(argv[1], aFillType, Standard_True);
-
- return 0;
-}
-
#include <Graphic3d_MaterialAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_ShadingAspect.hxx>
{
if (argc != 2)
{
- di << "Usage : " << argv[0] << " shape" << "\n";
+ di << "Usage : " << argv[0] << " shape\n";
return 1;
}
Handle(AIS_Shape) anAisIO = new AIS_Shape(aShape);
- Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_RGB);
- Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_RGB);
+ Quantity_Color aColF(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
+ Quantity_Color aColB(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
Handle(Prs3d_Drawer) aDrawer = anAisIO->Attributes();
Handle(Prs3d_ShadingAspect) aShadingAspect = aDrawer->ShadingAspect();
aFront.SetAmbientColor(aColF);
aFront.SetDiffuseColor(aColF);
aFront.SetSpecularColor(aColF);
- aFront.SetEmissiveColor(aColF);
+ aFront.SetEmissiveColor(Quantity_NOC_BLACK);
aFront.SetTransparency(0.0);
aShadingAspect->SetMaterial(aFront,Aspect_TOFM_FRONT_SIDE);
aBack.SetAmbientColor(aColB);
aBack.SetDiffuseColor(aColB);
aBack.SetSpecularColor(aColB);
- aBack.SetEmissiveColor(aColB);
+ aBack.SetEmissiveColor(Quantity_NOC_BLACK);
aBack.SetTransparency(0.0);
aShadingAspect->SetMaterial(aBack,Aspect_TOFM_BACK_SIDE);
aDrawer->SetShadingAspect (aShadingAspect);
- anAISContext->Display(anAisIO, 1, 0);
+ anAISContext->Display (anAisIO, 1, 0, Standard_True);
Standard_Real r, g, b;
- aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_RGB);
+ aShadingAspect->Color(Aspect_TOFM_FRONT_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
di << "Info: color on front side (" << r << "," << g << "," << b << ")\n";
- aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_RGB);
+ aShadingAspect->Color(Aspect_TOFM_BACK_SIDE).Values(r,g,b, Quantity_TOC_sRGB);
di << "Info: color on back side (" << r << "," << g << "," << b << ")\n";
return 0;
{
if (argc != 2)
{
- di << "Usage : " << argv[0] << " shape" << "\n";
+ di << "Usage : " << argv[0] << " shape\n";
return 1;
}
TopoDS_Shape sh = DBRep::Get(argv[1]);
Handle(AIS_Shape) ais = new AIS_Shape(sh);
- AISContext->Display(ais,1,0);
- AISContext->SetMaterial(ais,Graphic3d_NOM_SHINY_PLASTIC);
+ AISContext->Display (ais, 1, 0, Standard_False);
+ AISContext->SetMaterial (ais, Graphic3d_NOM_SHINY_PLASTIC, Standard_False);
- Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_RGB);
- Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_RGB);
+ Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
+ Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
Handle(Prs3d_ShadingAspect) sa = ais->Attributes()->ShadingAspect();
Graphic3d_MaterialAspect front = sa->Material(Aspect_TOFM_FRONT_SIDE);
front.SetAmbientColor(colf);
front.SetDiffuseColor(colf);
front.SetSpecularColor(colf);
- front.SetEmissiveColor(colf);
- front.SetTransparency(0.4);
+ front.SetEmissiveColor(Quantity_NOC_BLACK);
+ front.SetTransparency (0.4f);
sa->SetMaterial(front,Aspect_TOFM_FRONT_SIDE);
Graphic3d_MaterialAspect back = sa->Material(Aspect_TOFM_BACK_SIDE);
back.SetAmbientColor(colb);
back.SetDiffuseColor(colb);
back.SetSpecularColor(colb);
- back.SetEmissiveColor(colb);
- back.SetTransparency(0.2);
+ back.SetEmissiveColor(Quantity_NOC_BLACK);
+ back.SetTransparency (0.2f);
sa->SetMaterial(back,Aspect_TOFM_BACK_SIDE);
- AISContext->Redisplay(ais,1,0);
+ AISContext->Redisplay (ais, 1, 0);
return 0;
}
{
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;
}
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepAlgoAPI_Section.hxx>
-#include <BRepAlgo_Section.hxx>
//=======================================================================
//function : OCCN2
//purpose : BOOLEAN OPERATION
static Standard_Integer OCCN2 (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] << "\n";
return 1;
}
- Standard_Boolean IsBRepAlgoAPI = Standard_True;
- if (argc == 2) {
- Standard_Integer IsB = Draw::Atoi(argv[1]);
- if (IsB != 1) {
- IsBRepAlgoAPI = Standard_False;
-#if ! defined(BRepAlgo_def04)
-#endif
- }
- }
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull())
BRepPrimAPI_MakeSphere sphere(gp_Pnt(60,0,100),50);
TopoDS_Shape sphere_sh = sphere.Shape();
- //BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
- //TopoDS_Shape shape = section.Shape();
-
- TopoDS_Shape shape;
- if (IsBRepAlgoAPI) {
- di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)" <<"\n";
- BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
- section.Build();
- if(!section.IsDone()){
- di << "Error performing intersection: not done." << "\n";
- }
- shape = section.Shape();
- } else {
- di << "BRepAlgo_Section section(cylinder_sh, sphere_sh)" <<"\n";
- BRepAlgo_Section section(cylinder_sh, sphere_sh);
- section.Build();
- if(!section.IsDone()){
- di << "Error performing intersection: not done." << "\n";
- }
- shape = section.Shape();
+ di << "BRepAlgoAPI_Section section(cylinder_sh, sphere_sh)\n";
+ BRepAlgoAPI_Section section(cylinder_sh, sphere_sh);
+ if (!section.IsDone()){
+ di << "Error performing intersection: not done.\n";
}
+ const TopoDS_Shape& shape = section.Shape();
DBRep::Set("OCCN2_cylinder",cylinder_sh);
DBRep::Set("OCCN2_sphere",sphere_sh);
return 1;
}
if(argc != 3) {
- di << "Usage : " << argv[0] << " nbpoles result" << "\n";
+ di << "Usage : " << argv[0] << " nbpoles result\n";
return 1;
}
}
TopoDS_Edge sh = BRepBuilderAPI_MakeEdge(bez).Edge();
Handle(AIS_Shape) ais = new AIS_Shape(sh);
- aContext->Display(ais);
+ aContext->Display (ais, Standard_True);
DrawTrSurf::Set(argv[2],bez);
return 0;
}
static Standard_Integer OCC1642 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
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;
}
IntRes2d_SequenceOfIntersectionPoint points2d;
TColgp_SequenceOfPnt points3d;
- cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
+ std::cout << "\n j =" << j << ", CheckSelfIntersectingEdge = " <<
advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
(Standard_Integer) advWA->CheckSelfIntersectingEdge(j, points2d, points3d);
- ShapeExtend_Status status = ShapeExtend_FAIL1;
+ status = ShapeExtend_FAIL1;
if(advWA->StatusSelfIntersection(status))
status = ShapeExtend_FAIL2;
theCommands.Add ("BUC60842", "BUC60842", __FILE__, BUC60842, group);
theCommands.Add ("BUC60843", "BUC60843 result_shape name_of_circle name_of_curve [ par1 [ tol ] ]", __FILE__, BUC60843, group);
theCommands.Add ("BUC60970", "BUC60970 shape result", __FILE__, BUC60970, group);
- theCommands.Add ("BUC60818", "BUC60818", __FILE__, BUC60818, group);
theCommands.Add ("BUC60915", "BUC60915", __FILE__, BUC60915_1, group);
theCommands.Add ("OCC138", "OCC138", __FILE__, OCC138, group);
- theCommands.Add ("BUC60821","BUC60821",__FILE__,BUC60821,group);
theCommands.Add ("OCC353","OCC353",__FILE__,OCC353,group);
theCommands.Add ("OCC280","OCC280 hlr=0/1 setsurfecedetail=0/1; set perspecrive view",__FILE__,OCC280,group);
- theCommands.Add ("OCC232", "OCC232", __FILE__, OCC232 , group);
theCommands.Add ("OCC138LC", "OCC138LC", __FILE__, OCC138LC, group);
- theCommands.Add ("OCC189", "OCC189", __FILE__, OCC189, group);
theCommands.Add ("OCC566", "OCC566 shape [ xmin ymin zmin xmax ymax zmax] ; print bounding box", __FILE__, OCC566, group);
theCommands.Add ("OCC570", "OCC570 result", __FILE__, OCC570, group);
theCommands.Add ("OCC813", "OCC813 U V", __FILE__, OCC813, group);
theCommands.Add ("OCC814", "OCC814", __FILE__, OCC814, group);
theCommands.Add ("OCC884", "OCC884 result shape [toler [maxtoler]]", __FILE__, OCC884, group);
- theCommands.Add ("OCC1188", "OCC1188 imagefile [filltype] : Load image as background", __FILE__, OCC1188, group);
theCommands.Add ("OCC1174_1", "OCC1174_1 shape", __FILE__, OCC1174_1, group);
theCommands.Add ("OCC1174_2", "OCC1174_2 shape", __FILE__, OCC1174_2, group);