[Blog] Adding colors and names to your application

If you have to exchange data with other applications via IGES or STEP (or perhaps other formats, if you are a commercial client of the Open CASCADE company), you might want to ...

Read more at http://opencascade.blogspot.com/2008/12/adding-colors-and-names-to-your....

Roman Lygin's picture
Dmitry Khabi's picture

nice sample,
and what about to create a Simple Shape with one ColorAttribute and show it. I can not show the colorized Shape color when use the class XCAFPrs_AISObject. I thought, It doest it itself.

Roman Lygin's picture

Hi Dmitry,
Part 3 will demonstrate visualization. Stay tuned. ;-)

Dmitry Khabi's picture

Nice ;)
only one Question, If you say it's not possibly i can go home
(but please don'tsay it):
Have I really to use XCAFApp_Application ?
1. I have read a Stepfiel in myTDocStd_Document.
2. I created the myXCAFPrs_AISObjects from TDF_Labels (part of myTDocStd_Document).
3. I shown the colorized Shapes (XCAFPrs_AISObjects) witouht any problem with help of command:
4. I add a new TDF_Label with new Shape to the myTDocStd_Document.
5. I dont see any color !!!!
6. I take a original Shape from myXCAFPrs_AISObjects and transfered es. I dont see any color !!!!

I will go home anyway

Roman Lygin's picture

Part 3 (final)

Please rate this article using the voting buttons under its text. Thanks.

Dmitry Khabi's picture

Thank#s for the article.
I have seen a way to shown the colors.
But I have not seen connection between XCAFPrs_AISObject and TPrsStd_AISViewer.. TPrsStd_AISPresentation.
I able able to show XCAFPrs_AISObject in V3d_View with colors without TPrsStd_AISPresentation...
aXCAFPrs_AISObject = new XCAFPrs_AISObject(aTDF_Label);
What the different ???

Roman Lygin's picture

TPrsStd_AISPresentation is a convenience class that helps manage transactions (undo/redo) and persistence, managing basic elements of AIS_InteractiveObject such as material, width, etc. It operates with a driver (TPrsStd_Driver descendant) which can construct an AIS_InteractiveObject descendant.
I believe they can be easily omitted if you manage your interactive contexts on your own.

opencascade.blogspot.com - blog on Open CASCADE