Changeset 273 for cpp/frams


Ignore:
Timestamp:
12/18/14 12:45:27 (9 years ago)
Author:
Maciej Komosinski
Message:
  • 'o'-type fields are no longer ignored when saving (serialization like 'x')
  • fixed incorrect paramtab offset generation in ParamObject::makeParamTab()
Location:
cpp/frams
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/model.h

    r269 r273  
    394394void disturb(double amount);
    395395
     396/// build this model using new shapes, based on the provided model that uses old shapes. See also shapeconvert.cpp.
    396397void buildUsingNewShapes(const Model& src_old_shapes, Part::Shape default_shape = Part::SHAPE_CYLINDER, float thickness = 0.2);
    397398
  • cpp/frams/param/param.cpp

    r268 r273  
    263263        if ((flags(i)&PARAM_DONTSAVE) && (!force)) return 0;
    264264        const char *typ = type(i);
    265         if ((*typ == 'p') || (*typ == 'o')) return 0;
     265        if (*typ == 'p') return 0;
    266266
    267267        const char *t, *w;
     
    271271        err |= (fputs(p, f) == EOF); fputc(':', f);
    272272        cr = 0;
    273         if (*typ == 'x')
     273        if ((*typ == 'x')||(*typ == 'o'))
    274274        {
    275275                ExtValue ex;
     
    544544int ParamInterface::set(int i, const char *v)
    545545{
    546         switch (type(i)[0])
     546        char typ=type(i)[0];
     547        switch (typ)
    547548        {
    548549        case 'd': return setInt(i, v);
    549550        case 'f': return setDouble(i, v);
    550551        case 's': { SString t(v); return setString(i, t); }
    551         case 'x':
     552        case 'x': case 'o':
    552553        {
    553554                ExtValue e;
     
    567568                        e.setString(SString(v));
    568569                }
    569                 return setExtValue(i, e);
     570                if (typ=='x')
     571                        return setExtValue(i, e);
     572                else
     573                        return setObject(i, e.getObject());
    570574        }
    571575        }
  • cpp/frams/param/paramobj.cpp

    r197 r273  
    5757                        t->type=maybedup(dupentries,pi->type(i));
    5858                        t->help=maybedup(dupentries,pi->help(i));
    59                         t++;
    60                         n++;
     59                        t++; n++; offs++;
    6160                        if (n>count) break;
    6261                        }
    63                 offs++;
    6462                }
    6563        }
  • cpp/frams/util/extvalue.cpp

    r257 r273  
    105105SString ExtObject::toString() const
    106106{
    107 if (isEmpty()) return SString("<empty object>");
     107if (isEmpty()) return SString("null");
    108108Param tmp_param;
    109109ParamInterface *p=getParamInterface(tmp_param);
     
    187187        return SString::sprintf("^%d",ref);
    188188
    189 if (isEmpty()) return SString();
     189if (isEmpty()) return SString("null");
    190190VectorObject *vec=VectorObject::fromObject(*this,false);
    191191if (vec)
Note: See TracChangeset for help on using the changeset viewer.