To reverse the curve orientation

What I want to do is I want to reverse the selected curve orientation.

The following is my code:

Handle(AIS_InteractiveContext) pAIS = GetDocument()->GetAISContext();
for (pAIS->InitSelected(); pAIS->MoreSelected(); pAIS->NextSelected())
{
if (pAIS->SelectedShape().ShapeType() == TopAbs_EDGE)
{
TopAbs_Orientation orient;
orient = pAIS->SelectedShape().Orientation(); // orient = TopAbs_FORWARD
pAIS->SelectedShape().Reverse(); //
orient = pAIS->SelectedShape().Orientation(); // orient is still TopAbs_FORWARD

TopoDS_Shape ashape = pAIS->SelectedShape().Reversed(); // I create another shape,
orient = ashape.Orientation(); // this time, orient = TopAbs_REVERSED
}
}

Actually, I would like to change the orientation of the original curve. I don't get another derived curve.

Can anybody give me hint to do it?

Appreciate!

SF. Fan's picture

I don't want(not get) another derived curve.