Hi, I am new to OpenCascade, i have a little problem.
My first app is working as aspected, special thanks to Mr. HuguesDelorme
He helped me with my first problem, rotating was very slow. That is solved.
My problem :
The orginal step file colors are not show'n.
At the moment it is showing a yellow color, but the step file drawing has multiple colors, like black and orange.
Can someone help me with a code snipped ? That would be very appriciated !!
My code attempt so far today :
Handle(TDocStd_Document) doc; STEPCAFControl_Reader aReader; //https://old.opencascade.com/content/getting-part-properties-form-iges-file aReader.SetColorMode(true); aReader.SetNameMode(true); aReader.SetLayerMode(true); aReader.ReadFile("KR6_KR10_R900.stp"); doc = new TDocStd_Document("StepReader"); aReader.Transfer(doc); // Assembly = XCAFDoc_DocumentTool::ShapeTool(doc->Main()); Handle(XCAFDoc_ShapeTool) Assembly = XCAFDoc_DocumentTool::ShapeTool(doc->Main()); TDF_LabelSequence frshapes; Assembly->GetShapes(frshapes); TopoDS_Shape shape = Assembly->GetShape(frshapes.Value(1)); Handle(AIS_Shape) ais_shape = new AIS_Shape(shape); //get a label of shape. TDF_Label aLabel; aLabel = Assembly->FindShape(shape); Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(doc->Main()); TDF_LabelSequence ColLabels; myColors->GetColors(ColLabels); Quantity_Color col; XCAFDoc_ColorType ctype = XCAFDoc_ColorGen ; myColors->GetColor(aLabel,ctype,col); ais_shape->SetColor(col); m_context->Display(ais_shape,0); m_view->Redraw();