For all issues regarding the Forums use, please, refer to the Forum Rules.

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

Related pages

Load Iges Curve

Vincenzo Terranova's picture
Forums: 

I'd like to load an Iges File,where there is a curve.
How can I do?
How Can I modify this code:
SoSeparator* readIGESFile(const char *filename){
//Loading the IGES file
IGESControl_Reader reader;
reader.ReadFile((Standard_CString)filename);
//Translate the whole file
reader.TransferRoots();
//Dichiarazione del nodo che sarà ritornato
SoSeparator *parentNode = new SoSeparator;

/*Translate a list of entities, entity by entity;
Each time you invoke TransferEntity, Transfer or Transferlist, their results are accumulated
and NbShapes increases.
TransferRoots operations automatically clear all existing results before they
start.
reader.NbShapes();
returns the number of shapes recorded in the result.*/

for (int i=1;i {
Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(reader.Shape(i));
sfs->Perform();
shapes.Append(sfs->Shape()); //sfs->Shape() returns the first result in a translation operation.

SoSeparator *newSolid = new SoSeparator;
//occShape2FaceSets(sfs->Shape(), newSolid);

parentNode->addChild(newSolid);
return parentNode;
}
delete currentFileName;
currentFileName = new char[strlen(filename)];
strcpy(currentFileName,filename);

}

This code is performed for loading a Iges file with surface!
Help me!