Tue, 07/23/2002 - 13:21
Hi,
I am writting a kind of simple CAD using OCC.
So I use OCAF & Gnome for that purpose.
Everything works very well for curves : I can create any curves, select it, move it, etc...
Now, I am trying to create a face by joining planar edge (into a wire) or directly by using 3 bezier curves.
The driver that I wrote seem to work well, but nothing appear on the screen...
Can someone help me ?
Here is the code for my driver (::Execute method) :
if(!Label().FindChild(i+1).FindAttribute(TDF_Reference::GetID(), PRef)) return 1; PLab = PRef->Get();
if(!(PLab.FindAttribute(TNaming_NamedShape::GetID(),PNShape) )) Standard_Failure::Raise("BEZIER_SURFACE_DRIVER");
s1=PNShape->Get();
if(s1.ShapeType()!=TopAbs_EDGE) return 1;
E=TopoDS::Edge(s1);
Curve=BRep_Tool::Curve(E,first,last);
c1=Handle(Geom_BezierCurve)::DownCast(Curve);
if(!Label().FindChild(i+1).FindAttribute(TDF_Reference::GetID(), PRef)) return 1; PLab = PRef->Get();
if(!(PLab.FindAttribute(TNaming_NamedShape::GetID(),PNShape) )) Standard_Failure::Raise("BEZIER_SURFACE_DRIVER");
s1=PNShape->Get();
if(s1.ShapeType()!=TopAbs_EDGE) return 1;
E=TopoDS::Edge(s1);
Curve=BRep_Tool::Curve(E,first,last);
c2=Handle(Geom_BezierCurve)::DownCast(Curve);
GeomFill_BezierCurves GFBC;
GFBC.Init(c1,c2,GeomFill_StretchStyle);
BRepLib_MakeFace mkFace(GFBC.Surface());
TopoDS_Shape ResultShape=mkShell.Shape();
TNaming_Builder B(Label());
B.Generated(ResultShape);
Wed, 07/24/2002 - 09:18
This is a self reply to my problem.
I made a tricky but stupid error using handles.
So, my problem is solved.