Hello, I have a question for you today. I can easily construct a "bent tube" or toridial section with BRepOffsetAPI_MakePipe, however I need to construct a solid similar to this with a linearly varying cross-sectional diameter. This shape is like a conical section that has been bent. I have attempted to use BRepOffsetAPI_MakeEvolved, but did not get the type of shape I was looking for, and when I attempted to use BRepOffsetAPI_MakePipeShell, somthing in the header file clashed with my own code causing errors in code that performs (and compiles!) properly before this header is included. Errors from Linux w/ gcc 3.0.1: wbshape2.cpp: In member function `void WB3D_Shape::SetPosition(gp_Ax3, gp_Ax3)': wbshape2.cpp:104: `BRepBuilderAPI_Transform' undeclared (first use this function) wbshape2.cpp:104: (Each undeclared identifier is reported only once for each function it appears in.) wbshape2.cpp:104: parse error before `(' token wbshape2.cpp:105: `builder' undeclared (first use this function) wbshape2.cpp: In member function `void WB3D_Shape::CreateShape(WB3D_SphereData*)': wbshape2.cpp:170: parse error before `(' token wbshape2.cpp:178: parse error before `(' token Errors from SGI C++ MIPSpro Compilers: Version 7.3.1.2m: cc-1065 CC: ERROR File = wbshape2.cpp, Line = 104 A semicolon is expected at this point. BRepBuilderAPI_Transform builder(Shape,flip*origin); ^ cc-1020 CC: ERROR File = wbshape2.cpp, Line = 105 The identifier "builder" is undefined. Shape = builder.Shape(); ^ cc-1065 CC: ERROR File = wbshape2.cpp, Line = 170 A semicolon is expected at this point. BRepBuilderAPI_Transform builder(Shape,rot); ^ cc-1020 CC: ERROR File = wbshape2.cpp, Line = 171 The identifier "builder" is undefined. Shape = builder.Shape(); ^ cc-1065 CC: ERROR File = wbshape2.cpp, Line = 178 A semicolon is expected at this point. BRepBuilderAPI_Transform builder(Shape,rot); ^ cc-1020 CC: ERROR File = wbshape2.cpp, Line = 179 The identifier "builder" is undefined. Shape = builder.Shape(); ^ 6 errors detected in the compilation of "wbshape2.cpp". This seems to be a clash between names (a bug). However, my main concern is how to create such a shape. I have proposed two possible methods, (which may or may not be possible in OCC) 1) Create a conical section and "bend" it. 2) Use some function in CASCADE to sweep a circular face along a wire while scaling the face from diameter #1 to diameter #2. (I need to generate a solid from this operation.) The documentation for _MakePipeShell and _MakeEvolved did not have enough detail to tell me what these classes were going to build (other classes have had adequate documentation). Thanks, Robert Boehne -- Robert Boehne Software Engineer Ricardo Software Chicago Technical Center TEL: (630)789-0003 x. 238 FAX: (630)789-0127 email: rboehne@ricardo-us.com ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "wb_shape.hpp" #include "wbtextfieldform.hpp" IMPLEMENT_STANDARD_HANDLE(WB3D_Shape,MMgt_TShared) IMPLEMENT_STANDARD_RTTI(WB3D_Shape,MMgt_TShared) IMPLEMENT_STANDARD_TYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Shape) WB3D_Shape::~WB3D_Shape() { conPoints.clear(); } WB3D_Shape::WB3D_Shape() { } void WB3D_Shape::Remove(Handle(AIS_InteractiveContext) thisContext) { list::iterator pointIter; for(pointIter = conPoints.begin(); pointIter != conPoints.end(); ++pointIter) { thisContext->Remove(Handle(conPoint)::DownCast(*pointIter), Standard_False); thisContext->Remove((Handle(conPoint)::DownCast(*pointIter))->getAISPoint(), Standard_False); } thisContext->Remove(Handle(AIS_Shape)::DownCast(aiShape), Standard_True); } void WB3D_Shape::Display(Handle(AIS_InteractiveContext) thisContext) { list::iterator pointIter; for(pointIter = conPoints.begin(); pointIter != conPoints.end(); ++pointIter) { thisContext->Display((*pointIter)->getAISPoint(),0,-1,Standard_False); thisContext->Display((*pointIter),1,5,Standard_False); } thisContext->Display(aiShape,1,-1,Standard_True); } void WB3D_Shape::AddConnectionPoints() { // Create an explorer to add a connection point to // the center of each face. TopExp_Explorer getFaces; getFaces.Init(Shape, TopAbs_FACE); while (getFaces.More()) { Handle(conPoint) cp_Point; cp_Point = new conPoint(TopoDS::Face(getFaces.Current())); if (!cp_Point.IsNull()) conPoints.push_back(cp_Point); getFaces.Next(); } } void WB3D_Shape::SetPosition(gp_Ax3 sourceAxis, gp_Ax3 destAxis) { gp_Trsf flip; flip = gce_MakeRotation(destAxis.Location(), destAxis.XDirection(), M_PI).Value(); gp_Trsf origin; origin.SetDisplacement(sourceAxis, destAxis); BRepBuilderAPI_Transform builder(Shape,flip*origin); Shape = builder.Shape(); } void WB3D_Shape::SetAISShape(Quantity_NameOfColor myColor) { // Create a graphic object aiShape = new AIS_Shape(Shape); // create the presentable object aiShape->Set(Shape); aiShape->SetDisplayMode(AIS_Shaded); aiShape->SetOwner(this); aiShape->SetColor(myColor); } WB3D_Shape::WB3D_Shape(WB3D_Shape& Shape1) { tran= Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; refAxis = Shape1.refAxis; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } double WB3D_Shape::calcVolume(){ // Calculate volume // System of property information GProp_GProps System; BRepGProp::VolumeProperties(this->getSolid(), System); volume = System.Mass(); return(volume); } double WB3D_Shape::calcArea(){ // Calculate surface area // System of property information GProp_GProps System; BRepGProp::SurfaceProperties(this->getSolid(), System); area = System.Mass(); return(area); } void WB3D_Shape::CreateShape(WB3D_SphereData *inputdata) { gp_Pnt Cen(0.0, 0.0, 0.0); if(inputdata->angle > Precision::Confusion()) { if(fabs(inputdata->angle*M_PI/180.0-M_PI) < Precision::Confusion()) { // The sphere is a 180 degree section, and therefore has one flat face TopoDS_Shape bSph1 = BRepPrimAPI_MakeSphere(Cen, inputdata->radius*1.1, inputdata->angle*M_PI/180.0).Solid(); TopoDS_Shape bSph2 = BRepPrimAPI_MakeSphere(Cen, inputdata->radius, inputdata->angle*M_PI/180.0).Solid(); Shape = BRepAlgoAPI_Common(bSph1,bSph2).Shape(); gp_Trsf rot; rot.SetRotation(gp_Ax1(gp_Pnt(0.,0.,0.),gp_Dir(1,0,0)),0.5*M_PI ); BRepBuilderAPI_Transform builder(Shape,rot); Shape = builder.Shape(); } else { // The sphere sweeps out a section not 180 or 360 degree, and therefore has two flat faces Cen.SetY(-4.0*inputdata->radius/3.0/M_PI); Shape = BRepPrimAPI_MakeSphere(Cen, inputdata->radius, inputdata->angle*M_PI/180.0).Solid(); gp_Trsf rot; rot.SetRotation(gp_Ax1(gp_Pnt(0.,0.,0.),gp_Dir(1,0,0)),0.5*M_PI ); BRepBuilderAPI_Transform builder(Shape,rot); Shape = builder.Shape(); } } else { // The sphere is a complete sphere with only one face Cen.SetY(-inputdata->radius); Shape = BRepPrimAPI_MakeSphere(Cen, inputdata->radius).Solid(); } } void WB3D_Shape::CreateShape(WB3D_BoxData *inputdata) { Shape = BRepPrimAPI_MakeBox(gp_Pnt(-0.5*inputdata->delX, -0.5*inputdata->delY,0.0), inputdata->delX, inputdata->delY, inputdata->delZ).Solid(); } void WB3D_Shape::CreateShape(WB3D_CylinderData *inputdata) { double x, y, z; x = y = 0.0; z = -0.5*inputdata->length; // Create the verticies TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->radius*cos(inputdata->angle*M_PI/180.0), y+inputdata->radius*sin(inputdata->angle*M_PI/180.0), z)).Vertex(); TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->radius, y, z)).Vertex(); // Find the center of the circle gp_Pnt circ_center = gp_Pnt(x, y, z); gp_Pln circPlane(0.0,0.0,-100.0,100.0); gp_Circ circle = gce_MakeCirc(circ_center, circPlane.Position().Direction(), inputdata->radius).Value(); // Create edges from the above points and verticies TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(V1, V2); TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(circle, V1, V2); // Create a wire from the edges // then create a face from that wire BRepBuilderAPI_MakeWire myWire(E1); myWire.Add(E2); TopoDS_Wire W = myWire.Wire(); TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp_Pnt(x,y,z),gp_Dir(0.0,0.0,1.0)), W, Standard_True).Face(); Shape = BRepPrimAPI_MakePrism(F, gp_Vec(0.0, 0.0, inputdata->length), Standard_True); } void WB3D_Shape::CreateShape(WB3D_WedgeData *inputdata) { Shape = BRepPrimAPI_MakeWedge(inputdata->len_x, inputdata->len_y, inputdata->len_z, inputdata->len_ltx).Solid(); } void WB3D_Shape::CreateShape(WB3D_ConeData *inputdata) { if (fabs(inputdata->radius1 - inputdata->radius2) < Precision::Confusion()) { Shape = BRepPrimAPI_MakeCylinder(inputdata->radius1, inputdata->height).Solid(); } else { Shape = BRepPrimAPI_MakeCone(inputdata->radius1, inputdata->radius2, inputdata->height).Solid(); } } void WB3D_Shape::CreateShape(WB3D_TorusData *inputdata) { double x, y, z; z = 0.0; x = -inputdata->radius2*0.5-inputdata->radius1*4.0/3.0/M_PI; y = -inputdata->radius1; // Create the verticies TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, z)).Vertex(); TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->radius2, y, z)).Vertex(); // Find the center of the circle gp_Pnt circ_center = gp_Pnt(x+inputdata->radius2, y+inputdata->radius1, z); gp_Pln circPlane(0.0,0.0,-100.0,100.0); gp_Circ circle = gce_MakeCirc(circ_center, -(circPlane.Position().Direction()), inputdata->radius1).Value(); // Create more verticies TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->radius2, y+2.0*inputdata->radius1, z)).Vertex(); TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y+2.0*inputdata->radius1, z)).Vertex(); // Create edges from the above points and verticies TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(V1, V2); TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(circle, V2, V3); TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(V3, V4); TopoDS_Edge E4 = BRepBuilderAPI_MakeEdge(V4, V1); // Create a wire from the edges // then create a face from that wire BRepBuilderAPI_MakeWire myWire(E1); myWire.Add(E2); myWire.Add(E3); myWire.Add(E4); TopoDS_Wire W = myWire.Wire(); TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp_Pnt(x,y,z),gp_Dir(0.0,0.0,1.0)), W, Standard_True).Face(); gp_Ax1 myAxis(gp_Pnt(x, y, z), gce_MakeDir(gp_Pnt(x,y,z),gp_Pnt(x,y+2.0*inputdata->radius1,z)).Value()); TopoDS_Shape bSph2; if (inputdata->angle*M_PI/180.0 < Precision::Confusion()) { bSph2 = BRepPrimAPI_MakeRevol(F, myAxis, Standard_True); } else { bSph2 = BRepPrimAPI_MakeRevol(F, myAxis, inputdata->angle*M_PI/180.0, Standard_True); } TopoDS_Shape bSph1 = BRepPrimAPI_MakeSphere(gp_Pnt(x, y, z), 3.0*(inputdata->radius1+inputdata->radius2)).Solid(); Shape = BRepAlgoAPI_Common(bSph1,bSph2).Shape(); } void WB3D_Shape::CreateShape(WB3D_PrismData *inputdata) { double x, y, z, angle; x = y = z = 0.0; angle = inputdata->ang*M_PI/180.0; x = -inputdata->adjacent/2.0; z = -inputdata->height/2.0; // specify the center point cPnt = gp_Pnt(x, y, z); TopoDS_Wire W = BRepBuilderAPI_MakePolygon(gp_Pnt(x+inputdata->hypot*cos(angle), y+inputdata->hypot*sin(angle), z), gp_Pnt(x+inputdata->adjacent, y, z), gp_Pnt(x, y, z), Standard_True).Wire(); TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp_Pnt(x,y,z),gp_Dir(0.0,0.0,1.0)), W, Standard_True).Face(); Shape = BRepPrimAPI_MakePrism(F, gp_Vec(0.0, 0.0, inputdata->height), Standard_True); } void WB3D_Shape::CreateShape(WB3D_FilletData *inputdata) { double x, y, z, angle, angle_over2; x = -0.5*(inputdata->flat_width); y = 0.0; z = -0.5*(inputdata->corner_length); angle = inputdata->angle*M_PI/180.0; angle_over2 = inputdata->angle*M_PI/360.0; double tan_angle_over_2 = tan(angle_over2); inputdata->radius = inputdata->flat_width * tan_angle_over_2; // Create the verticies TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->flat_width, y, z)).Vertex(); TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, z)).Vertex(); TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->flat_width*cos(angle), y+inputdata->flat_width*sin(angle), z)).Vertex(); // Find the center of the circle double h = sqrt(inputdata->flat_width*inputdata->flat_width*(1.0+tan_angle_over_2*tan_angle_over_2)); double circ_radius = inputdata->flat_width*tan_angle_over_2; gp_Pnt circ_center = gp_Pnt(x+h*cos(angle_over2), y+h*sin(angle_over2), z); gp_Pln circPlane(0.0,0.0,-100.0,100.0); gp_Circ circle = gce_MakeCirc(circ_center, circPlane.Position().Direction(), circ_radius).Value(); // Create edges from the above points and verticies TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(V1, V2); TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(V2, V3); TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(circle, V1, V3); E3.Complement(); E3.Reverse(); // Create a wire from the edges // then create a face from that wire BRepBuilderAPI_MakeWire myWire(E3); myWire.Add(E2); myWire.Add(E1); TopoDS_Wire W = myWire.Wire(); TopoDS_Face F = BRepBuilderAPI_MakeFace(gp_Pln(gp_Pnt(x,y,z),gp_Dir(0.0,0.0,-1.0)), W, Standard_True).Face(); Shape = BRepPrimAPI_MakePrism(F, gp_Vec(0.0, 0.0, inputdata->corner_length), Standard_True); } void WB3D_Shape::CreateShape(WB3D_TaperboxData *inputdata) { double x, y, z; x = -inputdata->bot_length*0.5; y = -inputdata->bot_width*0.5; z = 0.0; // Create the verticies // bottom TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, z)).Vertex(); TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->bot_length, y, z)).Vertex(); TopoDS_Vertex V3 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->bot_length, y+inputdata->bot_width, z)).Vertex(); TopoDS_Vertex V4 = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y+inputdata->bot_width, z)).Vertex(); // top TopoDS_Vertex V5 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->xoffset+0.5*(inputdata->bot_length-inputdata->top_length), y+inputdata->yoffset+0.5*(inputdata->bot_width-inputdata->top_width), z+inputdata->height)).Vertex(); TopoDS_Vertex V6 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->xoffset+inputdata->top_length+0.5*(inputdata->bot_length-inputdata->top_length), y+inputdata->yoffset+0.5*(inputdata->bot_width-inputdata->top_width), z+inputdata->height)).Vertex(); TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->xoffset+inputdata->top_length+0.5*(inputdata->bot_length-inputdata->top_length), y+inputdata->yoffset+inputdata->top_width+0.5*(inputdata->bot_width-inputdata->top_width), z+inputdata->height)).Vertex(); TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(gp_Pnt(x+inputdata->xoffset+0.5*(inputdata->bot_length-inputdata->top_length), y+inputdata->yoffset+inputdata->top_width+0.5*(inputdata->bot_width-inputdata->top_width), z+inputdata->height)).Vertex(); // Create the edges for the bottom face and the top face TopoDS_Edge eBot1 = BRepBuilderAPI_MakeEdge(V1, V2); TopoDS_Edge eBot2 = BRepBuilderAPI_MakeEdge(V2, V3); TopoDS_Edge eBot3 = BRepBuilderAPI_MakeEdge(V3, V4); TopoDS_Edge eBot4 = BRepBuilderAPI_MakeEdge(V4, V1); TopoDS_Edge eTop1 = BRepBuilderAPI_MakeEdge(V5, V8); TopoDS_Edge eTop2 = BRepBuilderAPI_MakeEdge(V8, V7); TopoDS_Edge eTop3 = BRepBuilderAPI_MakeEdge(V7, V6); TopoDS_Edge eTop4 = BRepBuilderAPI_MakeEdge(V6, V5); BRepBuilderAPI_MakeWire mWBot(eBot1); mWBot.Add(eBot2); mWBot.Add(eBot3); mWBot.Add(eBot4); TopoDS_Wire WBot = mWBot.Wire(); BRepBuilderAPI_MakeWire mWTop(eTop1); mWTop.Add(eTop2); mWTop.Add(eTop3); mWTop.Add(eTop4); TopoDS_Wire WTop = mWTop.Wire(); BRepOffsetAPI_ThruSections mTS(Standard_True); mTS.AddWire(mWBot); mTS.AddWire(mWTop); Shape = mTS.Shape(); } void WB3D_Shape::CreateShape(WB3D_TubeData* inputdata) { // bool perforated, absorptive, end1flare, end2flare, end1closed, end2closed; double radius1 = inputdata->diam1/2.0; double radius2 = inputdata->diam2/2.0; if (fabs(radius1 - radius2) < Precision::Confusion()) { Shape = BRepPrimAPI_MakeCylinder(radius1, inputdata->length).Solid(); } else { Shape = BRepPrimAPI_MakeCone(radius1, radius2, inputdata->length).Solid(); } } void WB3D_Shape::CreateShape(WB3D_BentTubeData* inputdata) { cout << "creating the shape for a bent tube" << endl; // bool perforated, absorptive, end1flare, end2flare, end1closed, end2closed; double x, y, z; double radius1 = inputdata->diam1/2.0; double radius2 = inputdata->diam2/2.0; x = y = z = 0.0; cout << "Attempting to build a bent tube shape with dia1 = " << inputdata->diam1 << " dia2 = " << inputdata->diam2 << " len = " << inputdata->length << endl; cout << " bend radius = " << inputdata->radius << " bend angle = " << inputdata->angle << " axial rotation = " << inputdata->axial_rotation << endl; // double radius, angle, axial_rotation; // Data for bent tube gp_Pln facePlane(0.0,0.0,-100.0,100.0); gp_Circ faceCircle = gce_MakeCirc(gp::Origin(), -facePlane.Position().Direction(), radius1).Value(); cout << "created a circle for the first face" << endl; TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(faceCircle); cout << "created an edge for the first face" << endl; BRepBuilderAPI_MakeWire faceWire(E2); cout << "created an wire for the first face" << endl; TopoDS_Face F1 = BRepBuilderAPI_MakeFace(gp_Pln(gp_Pnt(x,y,z),gp_Dir(0.0,0.0,1.0)), faceWire, Standard_True).Face(); cout << "created the first face" << endl; TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(gp_Pnt(x, y, z)).Vertex(); cout << "created a vertex for the beginning of the sweep" << endl; gp_Pnt circ_center = gp_Pnt(inputdata->radius, y, z); cout << "created the circle's center" << endl; gp_Pln circPlane(0.0,-100.0,0.0,100.0); cout << "created a plane with Y=-1" << endl; gp_Circ circle = gce_MakeCirc(circ_center, circPlane.Position().Direction(), inputdata->radius).Value(); cout << "created a circle for the arc to sweep through" << endl; gp_Pnt endPoint(inputdata->radius*(1.0-cos(inputdata->angle)), y, -inputdata->radius*sin(inputdata->angle)); cout << "created the end point for circular arc" << endl; TopoDS_Vertex V2 = BRepBuilderAPI_MakeVertex(endPoint).Vertex(); cout << "created vertex V2" << endl; TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(circle, V1, V2); cout << "created edge E1" << endl; // E1.Complement(); cout << "Complement of edge E1" << endl; // E1.Reverse(); cout << "Reverse()'d edge E1" << endl; // Create a wire from the edges // then create a face from that wire BRepBuilderAPI_MakeWire myWire(E1); cout << "Made a wire from E1" << endl; // BRepOffsetAPI_MakeEvolved myEvol(F1, myWire.Wire(), // GeomAbs_Arc, // Standard_False, // Standard_True, // Standard_False, // 0.0000001); // if(fabs(radius1-radius2) < Precision::Confusion()) // { BRepOffsetAPI_MakePipe myPipe(myWire.Wire(), F1); // } // else // { // BRepOffsetAPI_MakePipeShell myPipe(myWire.Wire()); // myPipe.MakeSolid(); // myPipe.SetMode(F1); // myPipe.Build(); // } cout << "created a MakeEvolved object for a bent tube" << endl; if (myPipe.IsDone()) { cout << "built a MakeEvolved object for a bent tube" << endl; Shape = myPipe.Shape(); cout << "Set the shape to the MakeEvolved result." << endl; } } void WB3D_Shape::CreateShape(WB3D_JBendTubeData* inputdata) { } ///////////////////////////////////////////////////////// // WB3D_Solid ///////////////////////////////////////////////////////// IMPLEMENT_STANDARD_HANDLE(WB3D_Solid,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Solid,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Solid) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Solid) WB3D_Solid::~WB3D_Solid() { conPoints.clear(); } WB3D_Solid::WB3D_Solid(WB3D_Solid& Shape1) { area = Shape1.area; volume = Shape1.volume; tran= Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } WB3D_Solid::WB3D_Solid(Handle(WB3D_Shape) Shape1, double tr, Quantity_NameOfColor myColor) { area = 0.0; volume = 0.0; tran = tr; Shape = Shape1->getSolid(); if (Shape.IsNull()) exit(1); // AddConnectionPoints(); SetAISShape(myColor); } WB3D_Solid::WB3D_Solid(Handle(WB3D_Shape) Shape1, Handle(WB3D_Shape) Shape2, double tr, Quantity_NameOfColor myColor) { area = 0.0; volume = 0.0; tran = tr; BRepAlgoAPI_Fuse Compound(Shape1->getSolid(),Shape2->getSolid()); Shape = Compound.Shape(); if (Shape.IsNull()) exit(1); // AddConnectionPoints(); SetAISShape(myColor); } ///////////////////////////////////////////////////////// // WB3D_Wall ///////////////////////////////////////////////////////// IMPLEMENT_STANDARD_HANDLE(WB3D_Wall,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Wall,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Wall) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Wall) WB3D_Wall::~WB3D_Wall() { conPoints.clear(); } WB3D_Wall::WB3D_Wall(WB3D_Wall& Shape1) { area = Shape1.area; volume = Shape1.volume; tran= Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } WB3D_Wall::WB3D_Wall(Handle(WB3D_Shape) Shape1, double thick, double tr, Quantity_NameOfColor myColor) { area = 0.0; volume = 0.0; tran = tr; BRepOffsetAPI_MakeOffsetShape builder(Shape1->getSolid(), thick, 1.0e-9); builder.Build(); Shape = builder.Shape(); if (Shape.IsNull()) exit(1); // AddConnectionPoints(); SetAISShape(myColor); } IMPLEMENT_STANDARD_HANDLE(WB3D_Sphere,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Sphere,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Sphere) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Sphere) WB3D_Sphere::~WB3D_Sphere() { conPoints.clear(); } WB3D_Sphere::WB3D_Sphere(WB3D_Sphere& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } WB3D_Sphere::WB3D_Sphere(WB3D_SphereData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_MATRABLUE); } WB3D_Sphere::WB3D_Sphere(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_SphereData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_MATRABLUE); } IMPLEMENT_STANDARD_HANDLE(WB3D_Box,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Box,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Box) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Box) WB3D_Box::~WB3D_Box() { conPoints.clear(); } WB3D_Box::WB3D_Box(WB3D_Box& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } int WB3D_Box::Edit(WB3D_BoxData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Box::WB3D_Box(WB3D_BoxData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_DARKVIOLET); } WB3D_Box::WB3D_Box(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_BoxData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_DARKVIOLET); } IMPLEMENT_STANDARD_HANDLE(WB3D_Cylinder,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Cylinder,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Cylinder) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Cylinder) WB3D_Cylinder::~WB3D_Cylinder() { conPoints.clear(); } WB3D_Cylinder::WB3D_Cylinder(WB3D_Cylinder& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } int WB3D_Cylinder::Edit(WB3D_CylinderData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Cylinder::WB3D_Cylinder(WB3D_CylinderData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_GREEN); } WB3D_Cylinder::WB3D_Cylinder(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_CylinderData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, part cylinder is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_GREEN); } IMPLEMENT_STANDARD_HANDLE(WB3D_Wedge,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Wedge,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Wedge) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Wedge) WB3D_Wedge::~WB3D_Wedge() { conPoints.clear(); } WB3D_Wedge::WB3D_Wedge(WB3D_Wedge& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } int WB3D_Wedge::Edit(WB3D_WedgeData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Wedge::WB3D_Wedge(WB3D_WedgeData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_TURQUOISE); } WB3D_Wedge::WB3D_Wedge(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_WedgeData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, wedge is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_TURQUOISE); } IMPLEMENT_STANDARD_HANDLE(WB3D_Cone,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Cone,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Cone) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Cone) WB3D_Cone::~WB3D_Cone() { conPoints.clear(); } WB3D_Cone::WB3D_Cone(WB3D_Cone& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } int WB3D_Cone::Edit(WB3D_ConeData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Cone::WB3D_Cone(WB3D_ConeData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_YELLOWGREEN); } WB3D_Cone::WB3D_Cone(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_ConeData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, cone is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_YELLOWGREEN); } IMPLEMENT_STANDARD_HANDLE(WB3D_Torus,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Torus,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Torus) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Torus) WB3D_Torus::~WB3D_Torus() { conPoints.clear(); } WB3D_Torus::WB3D_Torus(WB3D_Torus& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } int WB3D_Torus::Edit(WB3D_TorusData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Torus::WB3D_Torus(WB3D_TorusData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_DARKGREEN); } WB3D_Torus::WB3D_Torus(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_TorusData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, torus is null" << endl; exit; } AddConnectionPoints(); SetAISShape(Quantity_NOC_DARKGREEN); } IMPLEMENT_STANDARD_HANDLE(WB3D_Prism,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Prism,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Prism) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Prism) WB3D_Prism::~WB3D_Prism() { conPoints.clear(); } WB3D_Prism::WB3D_Prism(WB3D_Prism& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } int WB3D_Prism::Edit(WB3D_PrismData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Prism::WB3D_Prism(WB3D_PrismData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_VIOLETRED4); } WB3D_Prism::WB3D_Prism(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_PrismData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, prism is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_VIOLETRED4); } IMPLEMENT_STANDARD_HANDLE(WB3D_Fillet,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Fillet,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Fillet) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Fillet) WB3D_Fillet::~WB3D_Fillet() { conPoints.clear(); } WB3D_Fillet::WB3D_Fillet(WB3D_Fillet& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } WB3D_Fillet::WB3D_Fillet(WB3D_FilletData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } int WB3D_Fillet::Edit(WB3D_FilletData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } WB3D_Fillet::WB3D_Fillet(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_FilletData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, fillet is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_LAVENDER); } // T A P E R E D B O X IMPLEMENT_STANDARD_HANDLE(WB3D_Taperbox,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_Taperbox,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_Taperbox) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_Taperbox) WB3D_Taperbox::~WB3D_Taperbox() { conPoints.clear(); } WB3D_Taperbox::WB3D_Taperbox(WB3D_Taperbox& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } WB3D_Taperbox::WB3D_Taperbox(WB3D_TaperboxData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_KHAKI); } WB3D_Taperbox::WB3D_Taperbox(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_TaperboxData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, taperbox is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_KHAKI); } int WB3D_Taperbox::Edit(WB3D_TaperboxData* dat, double tr) { conPoints.clear(); tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_KHAKI); } // B E N T T U B E IMPLEMENT_STANDARD_HANDLE(WB3D_BentTube,WB3D_Shape) IMPLEMENT_STANDARD_RTTI(WB3D_BentTube,WB3D_Shape) IMPLEMENT_STANDARD_TYPE(WB3D_BentTube) IMPLEMENT_STANDARD_SUPERTYPE(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(WB3D_Shape) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(MMgt_TShared) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_ENTRY(Standard_Transient) IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() IMPLEMENT_STANDARD_TYPE_END(WB3D_BentTube) WB3D_BentTube::~WB3D_BentTube() { conPoints.clear(); } WB3D_BentTube::WB3D_BentTube(WB3D_BentTube& Shape1) { data = Shape1.data; tran = Shape1.tran; cPnt = Shape1.cPnt; cDir = Shape1.cDir; Shape = Shape1.Shape; aiShape = Shape1.aiShape; aiShape->SetOwner(this); } WB3D_BentTube::WB3D_BentTube(WB3D_BentTubeData* dat, double tr) { tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_KHAKI); } WB3D_BentTube::WB3D_BentTube(gp_Ax3 destAxis, gp_Ax3 sourceAxis, WB3D_BentTubeData* dat, double tr) { tran = tr; CreateShape(dat); SetPosition(sourceAxis, destAxis); if (Shape.IsNull()) { cout << "AArgh, bentTube is null" << endl; exit(1); } AddConnectionPoints(); SetAISShape(Quantity_NOC_KHAKI); } int WB3D_BentTube::Edit(WB3D_BentTubeData* dat, double tr) { conPoints.clear(); tran = tr; CreateShape(dat); if (Shape.IsNull()) exit(1); AddConnectionPoints(); SetAISShape(Quantity_NOC_KHAKI); }