Tue, 07/24/2007 - 11:55
Forums:
This function is used to dumps the topological structure of .
Now,for example:I have a solid box.I want to output the box's topological structure and watch the topological structure.How can I use this function?
I use VC++6.0 tool.
Tue, 07/24/2007 - 14:31
Hi,
try this:
BRepTools::Write(mybox, theFilename);
Greets,
Patrik
Tue, 07/24/2007 - 17:41
I establish a file object like this:ofstream myFile("test.txt"),but it is fail when I use the function BRepTools::Write(mybox, myFile).Is it a problem of parameter of the "myFile"?
Wed, 07/25/2007 - 00:45
If you use BRepTools you don't need a stream object - just your shape and the name of the output file ("test.txt")...
Wed, 07/25/2007 - 06:45
I use BRepTools_ShapeSet::Write (const TopoDS_Shape &S, Standard_OStream &OS) function.The parameter is a ostream object,but the file name("test.txt") is not a this object.So I am still puzzled.
Wed, 07/25/2007 - 10:53
Hi,
here is some source from BRepTools::Write. You can see how to work with ostream:
Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
const Standard_CString File)
{
ofstream os;
// if (!fic.open(File,output)) return Standard_False;
os.open(File, ios::out);
if (!os.rdbuf()->is_open()) return Standard_False;
Standard_Boolean isGood = (os.good() && !os.eof());
if(!isGood)
return isGood;
BRepTools_ShapeSet SS;
SS.Add(Sh);
os << "DBRep_DrawableShape\n"; // for easy Draw read
SS.Write(os);
isGood = os.good();
if(isGood )
SS.Write(Sh,os);
os.flush();
isGood = os.good();
os.close();
isGood = os.good() && isGood;
return isGood;
}
Greets,
Patrik