can we use TCollection_IndexedDataMap ?

If yes how do we include headers ? I looked for a .hxx or .h but found nothing but a .gxx which created lots of errors in MS VC++. Any help would be greatly appreciated. Thanks in advance. Omar

Francois Lauzon's picture

No, you can't use TCollection_IndexedDataMap directly. This is a generic cascade class that could be use to instantiate specific class. But you need to use cdl which come with the wok environnement to do that, and the wok will be available in the stable release.

Msaaf Omar's picture

Use maps from cascade. All i use in the maps are integers and floats. I want to stay coherent with cascade. Is there a class i can use ??? Thanks

Francois Lauzon's picture

Yes, you can use TColStd_MapOfInteger and TColStd_Real. There are a lot of other package that instantiate collection stuff, TColStd is one of them, but there is TColQuantity, TColGeom, TColgp to name a few.

Good luck.

Msaaf Omar's picture

The source folders that should contain these classes are empty. Do i have to download any new source ??? Thanks

Francois Lauzon's picture

I think that all the stuff that are generated automaticly from a cdl definition goes into the drv folder. In this case, all the source files ares in $CASROOT\drv\TColStd, but you should only be concern with the include file, $CASROOT\inc\TColStd_MapOfInteger.hxx...

NOTE: If you look at the file $CASROOT\src\TColStd.cdl you will see how the collection classes are instantiate from the generic TCollection classes using the wok environnement.

Msaaf Omar's picture

I have learnt two weeks ago that in order to find the description of a class it is sometimes better, not always though, to read the cdl files. I would have never guessed that there would be header files without cxx files. Because in the directory $CASROOT\src\TColStd, there was only the cdl file. I know now that i have to consult the directory drv too. I am really greatful for this hint..... Thanks Omar Msaaf.

C R Johnson's picture

Are there reasons why I should prefer the Open Cascade containers to the standard STL containers?

Things like map seem to work OK.

I understand that alot of this was written before the STL was available. If Cascade were written today, would it be necessary to include containers? (String classes vs std::string as well)

Maxim ZVEREV's picture


CAS.CADE containers were developed before the STL appeared. But you are free to use STL containers in your code. Only note that all the CAS.CADE libraies use the CAS.CADE containers and in this case you cannot push as a parameter STL containers when the method requires CAS.CADE containers. So, you will need each time to convert STL containers into the CAS.CADE ones when you need to push (or obtain as a return value) such containers and by that way it is preferable to use CAS.CADE containers to avoid such extra-converting. But as I wrote, in all other cases it is just a problem of your wishes - what type of containers you will use.