Fri, 12/09/2016 - 17:46
I have compiled this sample and it could work now.The problem is ,all the shapes' color was Quantity_Color(1.0, 0.73, 0.2, Quantity_TOC_RGB),which set by aShapePrs in your code after I imported an iges file.
I tried the IGESCAFControl_Reader like this:
IGESCAFControl_Reader Reader;//(XSDRAW::Session(), Standard_False);no libTKXSDRAW.so in the ARM's compiled result.
Standard_Integer status = Reader.ReadFile(strFile.c_str());
if (status != IFSelect_RetDone)
Handle(TDocStd_Document) aDoc;//how to initialize this document in the Qt's android platform?
Standard_Boolean ok = Reader.Transfer(aDoc);
if(ok == Standard_False)
aShape = Reader.OneShape();
Then it crashed in the method "Transfer(aDoc)".
So,what's the problem? Is it related to those questions I asked in the notes? How to display the elements' color in this sample?
Need your help very badly. Thanks very much!
Fri, 12/09/2016 - 18:09
Please erase the extra topic,dear administrator,it is just because the broken network between us.
Sat, 12/10/2016 - 05:05
The last situation is,crash has been fixed by define doc like this:
Handle(TDocStd_Document) aDoc = new TDocStd_Document("IgesReader");
But the shapes' color was still Quantity_Color(1.0, 0.73, 0.2, Quantity_TOC_RGB),although I erased this line:
aShapePrs->SetColor (Quantity_Color(1.0, 0.73, 0.2, Quantity_TOC_RGB));
Sat, 12/10/2016 - 12:08
I have solved this problem according to the chm document.The answer is like this:
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(aDoc->Main());
Standard_Integer iShapesCount = frshapes.Length();
for(Standard_Integer i = 1;i<= iShapesCount;i++)
const TDF_Label& slabel = frshapes.Value(i);
if (myColors->IsSet (slabel,XCAFDoc_ColorGen))
if ( !myColors->GetColor(slabel, XCAFDoc_ColorGen, col) )
TopoDS_Shape TmpShape = myAssembly->GetShape(slabel);
Handle(AIS_Shape) aShapePrs = new AIS_Shape (TmpShape);
myContext->SetDisplayMode (aShapePrs, AIS_Shaded, Standard_False);
I must say that opencascade is great!