Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

IGESCAFControl_Reader - hierarchy

James D.'s picture

I have problems with my sourcecode. When I compile this, I have this in my hierarchy:

--OpenCASCADE 6.5...
--- DE 3

I need only the Colorbox, not the original file DE3. I have no idea ...
I read two IGES with IGESControl_Reader and save this after bollean cut in a file3. After this I read this file with IGESCAFControl_Reader give them a color ...

IGESCAFControl_Reader myIgesReader;
Handle(TDocStd_Document) aDoc;
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
anApp->NewDocument("XmlXCAF", aDoc);

if (!myIgesReader.Transfer(aDoc))
std::cout }

TopoDS_Shape myshape = myIgesReader.OneShape();
Handle(XCAFDoc_ShapeTool) myShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
TDF_Label aLabel = myShapeTool->NewShape();

XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->SetShape(aLabel, myshape);
TDataStd_Name::Set(aLabel, "COLORBOX");


(myshape, colLabel, XCAFDoc_ColorGen)
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(aDoc->Main());
Quantity_Color Col(Quantity_NOC_GREEN1);
TDF_Label colLabel = myColors->AddColor(Col);
myColors->SetColor (myshape, Col, XCAFDoc_ColorGen);

IGESCAFControl_Writer aWriter;

James D.'s picture

I solved the problem. I replace the following line:

TDF_Label aLabel = myShapeTool->NewShape();

TopoDS_Shape myshape = ...
with TDF_Label aLabel = myShapeTool->AddShape(myshape);