Type checking



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 11/10/2010 at 08:26, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R12 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Just wondering if there's any difference between these two checks:
    if(ob->IsInstanceOf(Opolygon))
    AND
    if(ob->GetType() == Opolygon)
    Is there any case where an object's instance and type differ?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/10/2010 at 02:02, xxxxxxxx wrote:

    The difference is that with GetType() you check the object type, where with IsInstance you from which class the object is derived from. For instance checking for Ocube is possible but there is no CubeObject or something like this. Also there are objects that are derived from PolygonObject but not of type Opolygon, for instance the Joint object. So if you want to find out if the object is really a polyogn object use GetType() == Opolygon.

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/10/2010 at 10:26, xxxxxxxx wrote:

    Thanks, makes better sense now.


Log in to reply