SplineObject Question



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

    On 24/04/2012 at 17:40, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   13 
    Platform:   Windows  ; Mac  ;  
    Language(s) :

    ---------
    Is it acceptable or possible to AutoAlloc the SplineObject class?

    I try to do

    AutoAlloc<SplineObject>spline(4, SPLINETYPE_LINEAR);

    and I get an error that says argument 2 cannot be converted from LONG to SPLINETYPE.

    Is it not possible to AutoAlloc a SPlineObject?

    Thanks,

    Shawn



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

    On 24/04/2012 at 20:38, xxxxxxxx wrote:

    Blah!  nevermind,  I just realized I have to pass my spline to another function so AutoAlloc won't work for me.  :(



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

    On 14/05/2012 at 13:31, xxxxxxxx wrote:

    Okay I am trying to accomplish this again but getting the same results.  This time I do not plan to pass the SplineObject to anything else.  I still get the same error that parameter cannot convert from LONG to SPLINETYPE.

    Is it not possible to AutoAlloc a SplineObject?

    Thanks,

    Shawn



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

    On 15/05/2012 at 09:59, xxxxxxxx wrote:

    In the 2nd or 3rd line of the error message, you can read something like this:

    m:\blah\resource\_api\ge_autoptr.h(25) : while compiling class template member function 'AutoAlloc<TYPE>::AutoAlloc(LONG,LONG)'
    

    Double-click that line and you'll see that there are several different constructors for AutoAlloc. Because you're passing two parameters to the construction call, the compiler will use this constructor:

    AutoAlloc(LONG p1, LONG p2)     { ptr = TYPE::Alloc(p1,p2); }
    

    Therefore, the second parameter in your call, SPLINETYPE_LINEAR, will be auto-casted from SPLINETYPE to LONG. Then it gets handed over to the actual constructor of the SplineObject class. That one, again, wants the second parameter to be of type SPLINETYPE. But LONG can not be auto-casted back to SPLINETYPE, and that's when the compiler error is thrown.

    Long story short... don't use AutoAlloc in this case ;-)



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

    On 15/05/2012 at 10:24, xxxxxxxx wrote:

    Ah I see!  Thanks Jack.  That helps me understand it better.  :)

    ~Shawn


Log in to reply