Hi !!!
i would to know how to how to display a Graphic3d_group in a 3d view (AIS_InterActiveContext ) ???
thanks .
ekiroglu Mon, 02/24/2003 - 15:51
Hello,
You should first create your own AIS_InteractiveObject, as in the example User_Cylinder.cxx in SampleAISSelect.
Then, you can add the following piece of code to the Compute section of User_Cylinder.cxx :
Create (for example) a local static variable like this :
static const Handle_Graphic3d_AspectLine3d polygonLineAspect =
new Graphic3d_AspectLine3d(Quantity_NOC_RED, Aspect_TOL_SOLID, 1.);
And do the following :
TheGroup->SetPrimitivesAspect(polygonLineAspect);
TheGroup->BeginPrimitives();
TheGroup->Polygon(...);
TheGroup->EndPrimitives();
Mon, 02/24/2003 - 15:51
Hello,
You should first create your own AIS_InteractiveObject, as in the example User_Cylinder.cxx in SampleAISSelect.
Then, you can add the following piece of code to the Compute section of User_Cylinder.cxx :
Handle( Graphic3d_Group ) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
static Graphic3d_Array1OfVertex vertices( 1, 5 );
vertices(1).SetCoord( 200, 0 , 500);
vertices(5).SetCoord( 200, 0 , 500);
vertices(2).SetCoord( 200, 200, 500);
vertices(3).SetCoord( 0, 200, 500);
vertices(4).SetCoord( 0, 0, 500);
TheGroup->Polygon(vertices);
....
Finally,
Handle(User_Cylinder) UC = new User_Cylinder(100, 200);
myAISContext->Display(UC);
I hope this will be helpfull.
Erki
Mon, 02/24/2003 - 17:30
hi Erki !
thanks a lot that was very helpfull me !
bye
Wed, 04/15/2009 - 15:08
TheGroup->Polygon,
how to color?
Wed, 04/15/2009 - 16:07
Create (for example) a local static variable like this :
static const Handle_Graphic3d_AspectLine3d polygonLineAspect =
new Graphic3d_AspectLine3d(Quantity_NOC_RED, Aspect_TOL_SOLID, 1.);
And do the following :
TheGroup->SetPrimitivesAspect(polygonLineAspect);
TheGroup->BeginPrimitives();
TheGroup->Polygon(...);
TheGroup->EndPrimitives();