Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • iMSTK iMSTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 83
    • Issues 83
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • iMSTKiMSTK
  • iMSTKiMSTK
  • Issues
  • #104
Closed
Open
Issue created Nov 10, 2016 by Alexis Girault@alexis-giraultContributor

Replace m_type by hardcoding type return in getType()

Right now m_type is stored within each class with a lot of inheritance (geometryMap, sceneobject, geometry...) to help quickly accessing the type from the base class without dynamic casting the object in all possible variances in a switch.

A better way to do this to avoid redundancy in information (storing m_type while a dynamic cast would work) is to define getType() as a static pure virtual function in the base class and implement it in the inheriting classes by hardcoding the return value to the appropriate type.

Could also consider getting rid of Type and looking into typeid(object).name() http://en.cppreference.com/w/cpp/language/typeid

Edited Dec 08, 2020 by Sreekanth Arikatla
Assignee
Assign to
Time tracking