Skip to content

Commit

Permalink
* XMLSerializer works now also for non heap instances
Browse files Browse the repository at this point in the history
* Added additional error info for serializable AntTweakBar


Former-commit-id: f8b2c26
  • Loading branch information
schuellc committed Nov 15, 2013
1 parent ee5453d commit e5fb0c6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2,086 deletions.
2 changes: 1 addition & 1 deletion include/igl/ReAntTweakBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ IGL_INLINE void igl::ReTwBar::TwNewBar(const char *name)
{
// double colon without anything in front of it means look for this in the
// global namespace... I hope...
//this->name = name;
this->name = name;
this->bar = ::TwNewBar(name);
}

Expand Down
6 changes: 2 additions & 4 deletions include/igl/ReAntTweakBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

namespace igl
{

TwType ReTwDefineEnum(
const char *name,
const TwEnumVal *enumValues,
Expand Down Expand Up @@ -155,7 +154,7 @@ namespace igl
public:
TwBar * bar;
// Alec: This causes trouble (not sure why)
//std::string name;
std::string name;
protected:
std::vector<ReTwRWItem> rw_items;
std::vector<ReTwCBItem> cb_items;
Expand Down Expand Up @@ -243,8 +242,7 @@ namespace igl
const std::vector<ReTwRWItem> & get_rw_items();
const std::vector<ReTwCBItem> & get_cb_items();
};

};
}

// List of TwBar functions
//TW_API TwBar * TW_CALL TwNewBar(const char *barName);
Expand Down
16 changes: 14 additions & 2 deletions include/igl/xml/ReAntTweakBarXMLSerialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,17 @@ namespace igl

for(iter = variables.begin(); iter != variables.end(); iter++)
{
if(iter->second == NULL)
{
printf("ERROR: '%s' entry not found... Skipping...\n",iter->first.c_str());
continue;
}

sscanf(iter->second,"%s %[^\n]",type_str,value_str);

if(!bar->type_from_string(type_str,type))
{
printf("ERROR: %s type not found... Skipping...\n",type_str);
printf("ERROR: Type '%s' of '%s' not found... Skipping...\n",type_str,iter->first.c_str());
continue;
}

Expand All @@ -211,11 +217,17 @@ namespace igl

for(iter = cbVariables.begin(); iter != cbVariables.end(); iter++)
{
if(iter->second == NULL)
{
printf("ERROR: '%s' entry not found... Skipping...\n",iter->first.c_str());
continue;
}

sscanf(iter->second,"%s %[^\n]",type_str,value_str);

if(!bar->type_from_string(type_str,type))
{
printf("ERROR: %s type not found... Skipping...\n",type_str);
printf("ERROR: Type '%s' of '%s' not found... Skipping...\n",type_str,iter->first.c_str());
continue;
}

Expand Down
Loading

0 comments on commit e5fb0c6

Please sign in to comment.