constructor initializing problem
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 ! ... }
On Wed, 9 Apr 2008 22:51:28 +0200, J.B.C.Engelen@...1578... wrote:
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!
If Effect derives from some GObject class, its C++ constructors will not get called. Otherwise I'm not sure what the issue would be.
-mental
-----Original Message----- From: MenTaLguY [mailto:mental@...3...] Sent: woensdag 9 april 2008 23:15 To: Engelen, J.B.C. (Johan) Cc: inkscape-devel@lists.sourceforge.net; Walters, K.H.G. (Karel) Subject: Re: [Inkscape-devel] constructor initializing problem
On Wed, 9 Apr 2008 22:51:28 +0200, J.B.C.Engelen@...1578... wrote:
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!
If Effect derives from some GObject class, its C++ constructors will not get called. Otherwise I'm not sure what the issue would be.
Effect is not derived from anything. The constructors are called definitely!
I am very confused.
I did a clean build, and now it works okay. Perhaps my build was in a strange state after renaming the lpebendpath file yesterday.
Sorry for the (luckily!) false alarm.
Johan
-----Original Message----- From: inkscape-devel-bounces@lists.sourceforge.net [mailto:inkscape-devel-bounces@lists.sourceforge.net] On Behalf Of J.B.C.Engelen@...1578... Sent: woensdag 9 april 2008 23:17 To: mental@...3... Cc: inkscape-devel@lists.sourceforge.net; Walters, K.H.G. (Karel) Subject: Re: [Inkscape-devel] constructor initializing problem
-----Original Message----- From: MenTaLguY [mailto:mental@...3...] Sent: woensdag 9 april 2008 23:15 To: Engelen, J.B.C. (Johan) Cc: inkscape-devel@lists.sourceforge.net; Walters, K.H.G. (Karel) Subject: Re: [Inkscape-devel] constructor initializing problem
On Wed, 9 Apr 2008 22:51:28 +0200,
J.B.C.Engelen@...1578... wrote:
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!
If Effect derives from some GObject class, its C++
constructors will
not get called. Otherwise I'm not sure what the issue would be.
Effect is not derived from anything. The constructors are called definitely!
I am very confused.
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java
.sun.com/javaone
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (2)
-
unknown@example.com
-
MenTaLguY