Hi all,
I have a strange problem with initializing the bool called "concatenate_before_pwd2" in my Effect class. I want to set it to 'false' per default, so in the constructor of Effect. A derived class LPEBendPath needs it to be true so does that in the constructor. I think this bool should now evaluate to true for the rest of LPEBendPath's life. But for some reason... it doesn't!
Thanks for enlightening me. Johan
Relevant excerpts from the code follow below. Attached the complete files.
Effect::Effect(LivePathEffectObject *lpeobject) : concatenate_before_pwd2(false) { lpeobj = lpeobject; oncanvasedit_it = 0; }
class LPEBendPath : public Effect, LivePathEffect_group_bbox {
LPEBendPath::LPEBendPath(LivePathEffectObject *lpeobject) : Effect(lpeobject), ... { ... concatenate_before_pwd2 = true; }
Effect* Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) { Effect* neweffect = NULL; ... case BEND_PATH: neweffect = static_cast<Effect*> ( new LPEBendPath(lpeobj) ); break; ... return neweffect; }
std::vectorGeom::Path Effect::doEffect_path (std::vectorGeom::Path & path_in) { std::vectorGeom::Path path_out;
if ( !concatenate_before_pwd2 ) { // this expression for some reason is true for LPEBendPath ! ... }