Correctly import colors in iges file using xde

Hello,

first of all thank you for this great and powerful piece of software. I´m trying to write an iges/step file import using xde and its working pretty good. There is just one tiny little detail left that is not working correctly.
At the moment i read the files using the IGESCAF/STEPCAFControl_Reader. With the XCAFDoc_DocumentTool::ShapeTool i get all the free shapes, iterate over them and load all the surfaces and trimming curves. With the XCAFDoc_DocumentTool::ColorTool i used to get the color for the shapes which is working fine for step files.
But when i try to load iges files i just don´t get any color for any shape. Calling the GetColors(TDF_LabelSequence...) gives me two colors in the sequence which are defined in the iges file. When i step over all the shapes calling the function GetColor(TopoDS_Shape, XCAFDoc_ColorType, Quantity_Color) it will never get true and won´t ever give me the assigned color. I tried a lot now, but i just couldn´t get it managed to work. Using Roman Lygin´s CAD Exchanger everything looks fine and the colors are right.
I´m really a bit hopeless with this now and i wanted to ask if there is another way the get the color assigned to a shape.

Andrey Betenev's picture

Please attach offending IGES file (or better simplified equivalent sufficient to demonstrate the problem) and indicate the version of OCCT that you are using. This is minimum necessary for anyone to be able to look at your problem.

Bjoern.Oska's picture

Hello,
i´ve attached a file that demonstrates my problem. There should be 4 colors in the scene. I step over the shapes using the freeshapes, the TopoDS_Iterator and the TopExp_Explorer at last. Whenever i call the getColor(...) function from the XCAFDoc_DocumentTool::ColorTool for a shape it returns false, thus i have no color assigned to my shapes.
Thanks in advance.

Attachments: 
Bjoern.Oska's picture

The OCCT Version i´m using is 6.3...

Forum supervisor's picture

Hello Björn,

We have checked your IGES file here using OCCT version 6.4 Draw Test Harness. The results are attached in the archive Result64.zip.
As far as we can see, all colors are transferred correctly, and can be seen both in the 3D viewer (model.bmp) and in the Data Browser (browser.bmp).
In the archive you may find the XCAF document created as a result of your IGES file translation.

If the image in CAD Exchanger looks the same, perhaps this software is based on a newer version of OCCT, not 6.3? ;)

Best regards,
Forum supervisor

Attachments: 
Cauchy Ding's picture

Hi Supervisor,

I also can't get the color information using OCAF. My OCC version is 6.3. Hope we can get the 6.4 or 7.0 asap. Thanks in advance.

Ding

Bjoern.Oska's picture

Thanks for testing. This is indeed a proof that its not and XDE problem^^.
Is there another way than the GetColor(..) function from the ColorTool to get the related color of a shape ?

Bjoern.Oska's picture

Thanks for testing. This is indeed a proof that its not and XDE problem^^.
Is there another way than the GetColor(..) function from the ColorTool to get the related color of a shape ?