Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

Multi level inheritance, wrong virtual function called

Multi level inheritance, wrong virtual function called
Laszlo Kudela 2012/10/04 17:11
Hello everyone,

I have a question regarding multi level inheritance.

I have three classes: Object,ObjectEdge,ObjectCircle

Object inherits from MMgt_TShared, ObjectEdge inherits from Object, ObjectCircle inherits from ObjectEdge. There is a virtual function defined in all of these classes, called Get_AIS_Object(). I store the objects in a TColStd_HSequenceOfTransient sequence. In a for loop, I loop through all the members of this sequence and call the Get_AIS_Object() function. Although the function is defined as virtual in every class, when an ObjectCircle comes in the sequence, not the function of this class is called, but the function in the superclass, so ObjectEdge. Is there a problem with multilevel inheritance in OpenCascade?

I double checked the Handle macros in the header and source files, all of them contain the right ancestors.

What is the problem?
Laszlo Kudela 2012/10/04 17:45
The good thing about posting to OpenCascade forums is that I always find the answer right after posting my question :D

The problem was solved by a simple clean and rebuild!
Latest news
  • Open CASCADE CAD Assistant for iOS platform is available!
  • Open CASCADE Technology 6.9.0 is available for download!
  • JT Assistant for Android

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map