Mon, 09/01/2003 - 13:58
Good day to everyone on that forum,
I most recently encountered an unexplainable problem:
I tried to add a Polygon to a Compound. here is the code:
TopoDS_Compound myComp;
BRep_Builder myBuild;
myBuild.MakeCompound(myComp);
myBuild.add(myComp,myPolygon.Shape()); // this instruction causes compiler-problems
The gcc 2.95.3 compiler then says:
no matching function for call to `BRep_Builder::add (TopoDS_Compound &, const TopoDS_Shape &)'
A quick look at the classbrowser shows, that there is no add-method within the BRep_Builder-class but rather higher inside the inheritance tree TopoDS_Build, which in turn does have an add-method that is defined like this:
void TopoDS_Builder::Add(TopoDS_Shape& S,const TopoDS_Shape& C) const
This should work, doesn`t it ? Why not ?
Am I missing something, or is it an undocumented bug ??
Sincerely and cluelessly
mike
Mon, 09/01/2003 - 17:30
Hello,
In "myBuild.add(myComp,myPolygon.Shape());", from which class is "myPolygon" derived? It should be derived from TopoDS_Shape or TopoDS_Edge, etc. class...
Best Regards
Erki
Mon, 09/01/2003 - 18:55
myPolygon is an BRepBuilderAPI_MakePolygon object.
And BRepBuilderAPI_MakePolygon is derived from BRepBuilderAPI_MakeShape. This one has a Shape()-method that returns a const TopoDS_Shape&.
I do not understand it. You insert the correct object-type, but the compiler still malfunctions.
This is totally not logic.
mike
Mon, 09/01/2003 - 21:57
Check your case:
Add(...) and add(...) are not the same function.
Tue, 09/02/2003 - 00:56
Oh yes, that was it ! Many thanks.
mike