I'm confused. What should go in place of * in the code below? Or is this not the way to do this?

class cTweak {

public:
  import "common.ulb"

  func cTweak()
    cTransform = new @cUT(***)
  endfunc

    complex func go(complex v)
    return cTransform.Iterate(v)
    endfunc

protected:
  UserTransform cTransform

default:
  UserTransform param cUT
    caption = "c-tweak transform"
    default = JLB_LinearUserTransform
  endparam
}
I'm confused. What should go in place of *** in the code below? Or is this not the way to do this? ```` class cTweak { public: import "common.ulb" func cTweak() cTransform = new @cUT(***) endfunc complex func go(complex v) return cTransform.Iterate(v) endfunc protected: UserTransform cTransform default: UserTransform param cUT caption = "c-tweak transform" default = JLB_LinearUserTransform endparam } ````
edited Feb 24 '22 at 10:00 pm
 
0
reply

Well, your cUT parameter is of type UserTransform, so it needs constructor arguments for this type (and any derived class needs to have the same constructor arguments). In the declaration of UserTransform in common.ulb, we have:

; @param pparent a reference to the object creating the new object; typically, 'this'
func UserTransform(Generic pparent)
    Transform.Transform(pparent)
endfunc

So, best to pass "this" as the argument:

func cTweak()
  cTransform = new @cUT(this)
endfunc

Hope this helps!

Well, your cUT parameter is of type UserTransform, so it needs constructor arguments for this type (and any derived class needs to have the same constructor arguments). In the declaration of UserTransform in common.ulb, we have: ; @param pparent a reference to the object creating the new object; typically, 'this' func UserTransform(Generic pparent) Transform.Transform(pparent) endfunc So, best to pass "this" as the argument: func cTweak() cTransform = new @cUT(this) endfunc Hope this helps!

Ultra Fractal author

 
0
reply

Thank you, that's what I had tried first. "this" gives me this error:
6218c79f87781.jpg
and line 13952 is the "this" line:
6218c8463e53e.jpg

I've done this kind of code many times before, but not when the class (of cTweak here) does not descend from any other class.

Thank you, that's what I had tried first. "this" gives me this error: ![6218c79f87781.jpg](serve/attachment&path=6218c79f87781.jpg) and line 13952 is the "this" line: ![6218c8463e53e.jpg](serve/attachment&path=6218c8463e53e.jpg) I've done this kind of code many times before, but not when the class (of cTweak here) does not descend from any other class.
 
0
reply
140
views
2
replies
2
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft