Modify /Change surface of a face

Hi,
I was playing around with faces/Edges/Vertices (I am a new user).And got stuck at a point :
I created a face with four Edges.(a plane face was created)
How can I modify the surface of this face so that I can fit in some BSpline surface into it.
Thanks,
Nitin.

LI's picture

Handle(Geom_Surface) gsrf=BRep_Tool::Surface(face);
Handle(Geom_BSplineSurface) gbsrf=NULL;
BRepTools::UVBounds(face,U1,U2,V1,V2);
if (gsrf->DynamicType()==STANDARD_TYPE(Geom_BSplineSurface))
{
gbsrf = Handle(Geom_BSplineSurface)::DownCast(gsrf);
}
else //if (gsrf->DynamicType()==STANDARD_TYPE(Geom_Plane))
{
Handle(Geom_RectangularTrimmedSurface) grtsrf=new Geom_RectangularTrimmedSurface (gsrf,U1,U2,V1,V2);
gbsrf=GeomConvert::SurfaceToBSplineSurface(grtsrf);
}
if (gbsrf.IsNull())return Standard_False;
int umax=5,vmax=5;
if(gbsrf->UDegree()>5)umax=gbsrf->UDegree();
if(gbsrf->VDegree()>5)vmax=gbsrf->VDegree();
if(gbsrf->UDegree()<5||gbsrf->UDegree()<5)gbsrf->IncreaseDegree(umax,vmax);

A plane is not deformable, but a Nurbssurface is. Good luck!