About XDE

I use the following code to read a iges file.
But I cannot retrieve any shapes from shapeTool.

Could anyone know how to use IGESCAFControl_Reader ?

Thank you in advance!

===================================================

Handle(TDocStd_Document) doc;
Handle(TDocStd_Application) A;
if (!DDocStd::Find(A)) {cout A->NewDocument("MDTV-XCAF",doc);
TDataStd_Name::Set(doc->GetData()->Root(),"SGP");

IGESCAFControl_Reader igesReader;

igesReader.SetColorMode (Standard_True);
igesReader.SetNameMode (Standard_True);
igesReader.SetLayerMode (Standard_True);;
IFSelect_ReturnStatus readStat = igesReader.ReadFile("c:\\temp\\BoxTrim.igs");
if(!igesReader.Transfer(doc))
{
cout }

Handle(XCAFDoc_ShapeTool) shapeTool = XCAFDoc_DocumentTool::ShapeTool(doc->Main());

Patrik Mueller's picture

Hi,

assuming the reading itself was successfull, have you tried it with the "GetShape" methods from XCAFDoc_ShapeTool?

Regards,

Patrik

gpsunjp sun's picture

Hi,

I got shapes using GetShapes().

Thank You very much.

Jansen Yu's picture

How to get color of the shape from iges file with XDE?