now Parameterobject stored in ParameterWidget instead of full ParameterEntryWidget

This commit is contained in:
amarjeetkapoor1 2016-05-25 19:30:52 +05:30
parent 401ef794c4
commit ac6fc5789f
5 changed files with 13 additions and 16 deletions

View file

@ -1,10 +1,10 @@
@Description("The resolution of the curves. Higher values give smoother curves but may increase the model render time.")
@Parameter([10, 20, 30, 50, 100])
@Parameter()
resolution = 30;
@Description("The horizontal radius of the outer ellipse of the sign.")
@Parameter([60 : 200])
radius = 80;
@Parameter([60: 200])
radius = 100;
@Parameter([1 : 10])
@Description("Total height of the sign")

View file

@ -121,10 +121,6 @@ bool ParameterEntryWidget::isDefaultValue()
return object.value == object.defaultValue;
}
void ParameterEntryWidget::applyParameter(Assignment *assignment)
{
object.applyParameter(assignment);
}
void ParameterEntryWidget::setAssignment(Context *ctx, const Assignment *assignment, const ValuePtr defaultValue)
{

View file

@ -35,16 +35,16 @@ class ParameterEntryWidget : public QWidget, public Ui::ParameterEntryWidget
{
Q_OBJECT
ParameterObject object;
public:
ParameterObject object;
ParameterEntryWidget(QWidget *parent = 0);
virtual ~ParameterEntryWidget();
ValuePtr getValue();
bool isDefaultValue();
void setAssignment(class Context *context, const class Assignment *assignment, const ValuePtr defaultValue);
void applyParameter(class Assignment *assignment);
ValuePtr getValue();
bool isDefaultValue();
void setAssignment(class Context *context, const class Assignment *assignment, const ValuePtr defaultValue);
protected slots:
void on_comboBox_activated(int);

View file

@ -106,7 +106,7 @@ void ParameterWidget::applyParameters(FileModule *fileModule)
continue;
}
(*entry).second->applyParameter(&(*it));
(*entry).second->applyParameter(&(*it));
}
}
@ -134,8 +134,8 @@ void ParameterWidget::setParameters(const Module *module)
ParameterEntryWidget *entry = new ParameterEntryWidget();
entry->setAssignment(&ctx, &assignment, defaultValue);
connect(entry, SIGNAL(changed()), this, SLOT(onValueChanged()));
addEntry(entry);
entries[assignment.first] = entry;
addEntry(entry);
entries[assignment.first] = &(entry->object);
}
end();

View file

@ -28,13 +28,14 @@
#include <QTimer>
#include "qtgettext.h"
#include "parameterobject.h"
#include "ui_ParameterWidget.h"
class ParameterWidget : public QWidget, public Ui::ParameterWidget
{
Q_OBJECT
typedef std::map<std::string, class ParameterEntryWidget *> entry_map_t;
typedef std::map<std::string, class ParameterObject *> entry_map_t;
QTimer autoPreviewTimer;
entry_map_t entries;