TopExp_Explorer

hello everybody:
I have an application dévellopé in MS2005, as using the librairie of open cascades.
to \" explore the entities topological, geometric cotopoligique,et Geometric of a model BREP \" ,
I want to compile this application with BorlandC++ builder6.0, to make this i use the DLL method

for example:
IN MS2005(dll);
//get all face from shell:
TopoDS_Face face;
TopTools_IndexedMapOfShape faces;
int list_face()
{
TopExp::MapShapes(coquille, TopAbs_FACE, faces);
for(int i=1; i {
face=TopoDS::Face(faces.FindKey(i));
Standard_Integer num_faces=faces.FindIndex(face);
cout }
return true;
}
in Borland C++Builder 6.0
//get all face from a shell
list_face=(int(*)())GetProcAddress(h,\"list_face\");
(*list_face)();(this fonction return all face from shell)
it\'s work without any problem
but when i try to explore the wire from face
i don\'t know how I can make to point on all the
faces because to explore a wire from face in open cascade i\' use this code:
//get all wire from face
TopoDS_Wire contour;
TopTools_IndexedMapOfShape contours;
int list_contour(int num_face(face index) )
{
TopExp::MapShapes(face,TopAbs_WIRE, contours);
for(int num_face=1; num_face {
contour=TopoDS::Wire(contours.FindKey(i));
Standard_Integer num_contours=contours.FindIndex(contour);

}

return true;
}

but when i try this code he point in the one face

please help me i needed for my project

in BOrland juste i try this:
int nomb_face; nomb_face=list_face();
cout

for(int num_face=1; num_face {
(*list_contour)(num_face);
cout

stifan's picture

hello everybody:
I have an application dévellopé in MS2005, as using the librairie of open cascades.
to \" explore the entities topological, cotopoligical,et Geometric of a model BREP \" ,
I want to compile this application with BorlandC++ builder6.0, to make this i use the DLL method

for example:
IN MS2005(dll);
//get all face from shell:
TopoDS_Face face;
TopTools_IndexedMapOfShape faces;
int list_face()
{
TopExp::MapShapes(coquille, TopAbs_FACE, faces);
for(int i=1; i<=faces.Extent(); ++i)
{
face=TopoDS::Face(faces.FindKey(i));
Standard_Integer num_faces=faces.FindIndex(face);

}
return true;
}
in Borland C++Builder 6.0
//get all face from a shell
list_face=(int(*)())GetProcAddress(h,\"list_face\");
(*list_face)();(this fonction return all face from shell)
it\'s work without any problem
but when i try to explore the wire from face
i don't know how I can make to point on all the
faces because to explore a wire from face in open cascade i' use this code:
//get all wire from face
TopoDS_Wire contour;
TopTools_IndexedMapOfShape contours;
int list_contour(int num_face(face index) )
{
TopExp::MapShapes(face,TopAbs_WIRE, contours);
for(int num_face=1; num_face<=contours.Extent(); ++num_face)
{
contour=TopoDS::Wire(contours.FindKey(num_face));
Standard_Integer num_contours=contours.FindIndex(contour);

}

return true;
}

but when i try this code he point in the one face

in BOrland juste i try this:
int nomb_face; nomb_face=list_face();
for(int num_face=1; num_face<=nomb_face; num_face++)
{
(*list_contour)(num_face);//he point in the one face
}
please help me i needed for my project

Fotis Sioutis's picture

I remember some years before i tried to do the same (dll->MSVC, exe->BORLAND) , and try to link using C interface like you do.I think this does not lead anywhere ... (Added complexity, maintaining the MSVC wrapper functions and other problems).My suggestion for you is to try to use the BORLAND BCB6 port of OCC i created in order to avoid the above problem.

Have a look at :

http://www.opencascade.org/org/forum/thread_11161/
http://www.opencascade.org/org/community/projects/?project_id=217

I hope I was of some help to you

stifan's picture

thank you Fotis Sioutis:

I already saw indeed your project, to compile BDS with OCC, you have make a housemaid work.
in our laboratory of research one has speak too on your project.

but my problem, it is that one doesn't have this version of borland (one has Borland C++ Buillder6.0)

is that you can use to put some classes of OCC in a map
and for every class I give it a number.
for example:
TopoDS_Shape - >numbre 1
TopoDS_face -> numbre 2

etc
and in borland I use the dll of this map for the call of the classes of OCC
if you have another idea thank you to tell me.

Fotis Sioutis's picture

There is already OCC for Borland C++ Buillder 6.0 available out there.Look here

http://occ.borland.googlepages.com/opencascadeborlandbdsport

It is OCC 6.1 but i think if you will apply the diffs with 6.2 there will not be many changes needed in order to proceed(tip. you can use the source base from BDS port and merge it with the project files from Builder 6 for even less work).

If you will manage to use OCC for borland then you will not need any kind of maping (occ_class - int) in order to work.You can directly use any occ class in exe and dll (or exe only)

Greetings

stifan's picture

I have try to use the includes and Lib of occ 6.1
with Borland 6.0 from(http://occ.borland.googlepages.com/opencascadeborlandbdsport)

but I have a mistake:

[C++ Fatal Error] Standard_Stream.hxx(19): F1003 Error directive: "check config.h file or compilation options: either HAVE_IOSTREAM or HAVE_IOSTREAM_H should be defined"

Fotis Sioutis's picture

check the WNT compiler DEFINE directive... :)

stifan's picture

thank you for your help:
I have add rightly in the file.h (Unit.h)

#IFNDEF WNT
#DEFINE WNT
#endif
but the mistake remains the same

stifan's picture

ok
now this problem it's resolved but i'have anther problem:

[Linker Error] Unresolved external 'Standard::Free(void *&)' referenced from D:\DOCUMENTS AND SETTINGS\FERID SABLAOUI\BUREAU\SOLUTION\TEST\UNIT1.OBJ

i know this refere to link(.lib), for this reason i added the (.lib) in my project but i have another problem: can'not execute the code (link error)

it's possible to use (.inc and . lib) from your project.
if yes how can i do that think you.

Fotis Sioutis's picture

Standard::Free(void *&) symbol is in .\ros\win32\libd(or lib)\TKernel.lib and links to TKernel.dll. If you have everything set up properly in your project then no such problem should be a matter for you.I believe with a little more searching on your project and on OCC you can work things out.

Greetings

Fotis

stifan's picture

think you for your help:

the problem it's resolved but when i try to use for exemple the class
i have this error:

[C++ Error] Standard_Real.hxx(28): E2175 Too many storage classes in declaration

think you....................very much for your help.

stifan's picture

think you very much

i'ts work without any error .

i'think i suucced to compile OCC6.2 with Borland 6.0

think you for your help