Hi,
now I can read one IGES file, but how to read two iges files and write this two files in one iges file?
like this?
// Read file 1
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aDoc;
anApp->NewDocument("XmlXCAF", aDoc);
IGESCAFControl_Reader myIgesReader;
Standard_Integer nIgesFaces,nTransFaces;
IFSelect_ReturnStatus status = myIgesReader.ReadFile(argv[1]);
if (status == IFSelect_RetDone)
{
Handle(TColStd_HSequenceOfTransient) myList = myIgesReader.GiveList("iges-faces");
// Übersetzt "MyList" und erhält die Ergebnisse als OpenCASCADE-Form
nIgesFaces = myList->Length();
nTransFaces = myIgesReader.TransferList(myList);
cout<<"IGES Faces: "<Main());
Handle(XCAFDoc_ColorTool) myColorTool = XCAFDoc_DocumentTool::ColorTool(aDoc->Main());
TDF_LabelSequence roots;
myShapeTool->GetFreeShapes(roots);
TDF_Label rootLabel;
rootLabel = roots.Value(1);
Quantity_Color col(0.0f,1.0f,0.0f,Quantity_TOC_RGB);
TDF_Label aColorLabel = myColorTool->AddColor(col);
myColorTool->SetColor(rootLabel, aColorLabel, XCAFDoc_ColorSurf);
Quantity_Color returnCol;
myColorTool->GetColor(rootLabel,XCAFDoc_ColorSurf,returnCol);
TopoDS_Shape aBottle = myIgesReader.OneShape();
// Read file 2
Handle(XCAFApp_Application) anApp2 = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aDoc2;
anApp->NewDocument("XmlXCAF2", aDoc2);
myIgesReader.ReadFile(argv[2]);
Handle(TColStd_HSequenceOfTransient) myList = myIgesReader.GiveList("iges-faces");
// Übersetzt "MyList" und erhält die Ergebnisse als OpenCASCADE-Form
nIgesFaces = myList->Length();
nTransFaces = myIgesReader.TransferList(myList);
cout<<"IGES Faces: "<Main());
Handle(XCAFDoc_ColorTool) myColorTool2 = XCAFDoc_DocumentTool::ColorTool(aDoc2->Main());
TDF_LabelSequence roots2;
myShapeTool->GetFreeShapes(roots2);
TDF_Label rootLabel2;
rootLabel2 = roots2.Value(1);
Quantity_Color col2(0.0f,1.0f,0.0f,Quantity_TOC_RGB);
TDF_Label aColorLabel2 = myColorTool2->AddColor(col2);
myColorTool2->SetColor(rootLabel2, aColorLabel2, XCAFDoc_ColorSurf);
Quantity_Color returnCol2;
myColorTool2->GetColor(rootLabel2,XCAFDoc_ColorSurf,returnCol2);
TopoDS_Shape aBottle2 = myIgesReader.OneShape();
IGESCAFControl_Writer aWriter;
aWriter.SetColorMode(true);
aWriter.SetNameMode(true);
aWriter.Transfer(aDoc);
aWriter.Transfer(aDoc2);
aWriter.Write(argv[3]);
}