
Wed, 06/09/2004 - 00:01
Forums:
Hi all,
can anyone tell me how to display several colours (of my personal choice) within one TopoDS_Compound of BSplines, Surfaces and so on. So I want a very colourful graphic visualization.
Do I need the AIS_Shape class or anything else ?
Any hint is very welcome.
Best Regards
MCV
Mon, 06/14/2004 - 23:19
what do u mean ? by my side, i took a compound and for best visualisation i displayed every "shap" (faces, edges and vertices) in differents colors, if u'd like so..i can put the code here
Thu, 06/17/2004 - 12:13
Hi, oh yes your code would be a wonderful help.
Thank you in advance !
MCV
Sat, 06/19/2004 - 01:09
Hi,
how are you ?
How about your answer ? I yearn for it....!
Best Regards
MCV
Sun, 06/20/2004 - 14:58
Hi,
do you have a code example ? Or would you advice the chapter about AIS_Shape ?
Best Regards
MCV
Mon, 06/21/2004 - 19:58
hi,
sorry to be so late...
this is the code :
Quantity_NameOfColor TabOfColor[Number_of_color];
TopExp_Explorer Ex;
int cpt = 0;
for (Ex.Init(mySolid, TopAbs_FACE); Ex.More(); Ex.Next())
{
TopoDS_Face F;
F = TopoDS::Face(Ex.Current());
Handle(AIS_Shape) aisUneForme = new AIS_Shape(F);
aisUneForme->SetColor(TabOfColor[cpt%Number_of_color]);
this->GetAISContext()->Display(aisUneForme);
cpt++;
}
Tue, 06/22/2004 - 17:30
Hi, thank you for your answer.
The code looks quite good, but maybe I was looking for somthing different:
Consider the tutorial (examples/tutorial) or the OCC-documentation.
There is this code "MakeBottle.cxx".
At the end of that program, any line/shape etc is being added to a TopoDS_Compound and returned to the OCC-viewer being implemented with the distribution.
How can I change the attributes of that lines/shapes their, so that I get a colourful picture ? How to choose the individual colour of any geometric entity within the TopoDS_Compound ?
Best Regards.
MCV