#28 wrong name in domInputLocal

Andy Lorino

Hi all,

The meta-element name for domInputLocal is set to
"InputLocal", which prevents input elements from beeing
removed from samplers.

Indeed, if you look at domSampler.cpp you'll notice the
following line in domSampler::registerElement() (line 36)

// Add elements: input

...which basically states that children of domSampler
elements have the name "input".

When removing a domInputLocal from its parent
domSampler, using removeFromParent, the two names are
compared and of course do not match.

You can fix this if you change line 33 in
domInputLocal.cpp from :
_Meta->setName( "InputLocal" );

to :
_Meta->setName( "input" );

...but I'm not sure it won't mess things up elsewhere.

Hope this helps.



  • Andy Lorino
    Andy Lorino

    Logged In: YES

    I had realized there would be a problem with similar
    elements and the remove functions.
    This is not a problem anymore though since the latest check
    in in svn I have completely redone the place and remove
    functions, which should not have the same problem.

    If you don't want to get the code from svn then you will
    have to wait for the next release which I am not perfectly
    sure when it will happen.

  • Andy Lorino
    Andy Lorino

    • status: open --> open-fixed
  • Andy Lorino
    Andy Lorino

    Logged In: YES

    Also if you want to patch this correctly instead of using
    the new code add this in the removeElement function instead
    of changing the name like you suggest. (changing the name
    will only help your particular problem, the same issue will
    happen with a lot of other elements, plus adding elements
    may be messed up because of that name change.. probably not
    but what I am about to put would be safer )

    daeElement line 378:
    // Look for a meta element with a matching name
    daeString nm = element->getElementName();
    if ( nm == NULL ) {
    nm = element->getTypeName();
    if ( strcmp(meas[i]->getName(), nm ) == 0)

    Put that there instead of the strcmp that is there now.

  • Andy Lorino
    Andy Lorino

    • status: open-fixed --> closed-fixed