Converting Object Types



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

    On 22/10/2005 at 22:19, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.503 
    Platform:      Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Ok, this may be a very basic question,
    but I am writing an expression tag and am trying to pass the BaseObject "op" to a function that asks for a PointObject. After checking that "op" is actually a PointObject with IsInstanceOf(), how can I convince the compiler too that it is not just a BaseObject? Is some sort of convertion required?

    Thanks in advance.

    Aaron



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

    On 23/10/2005 at 06:41, xxxxxxxx wrote:

    you need a type cast:

    static_cast<PointObject*>(op);



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

    On 23/10/2005 at 20:50, xxxxxxxx wrote:

    Ah! Brilliant.   Thankyou Katachi.
    I new there must be an easy way to do this. After a little searching and reading I now know all about type casts, well maybe not quite.
    I've now decided to create and store a second object that is a PointObject replica of the actual BaseObject regardless of its specific type. I'm using the SendModellingCommand() function with CURRENTSTATETOOBJECT. This is going to require me to learn something about allocation, which is new since I'm comming from COFFEE. If anybody has any suggestions or a better way to get a PointObject out of a primitive, please let me know.

    Thanks Again.

    Aaron M


Log in to reply