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

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / Multi level inheritance, wrong virtual function called

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
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

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