mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
implemented XMLMeshWidget
This commit is contained in:
parent
977c6572ba
commit
85f28e2d24
@ -315,9 +315,12 @@ XMLStdParFrame::~XMLStdParFrame()
|
||||
|
||||
void XMLStdParFrame::loadFrameContent(const XMLFilterInfo::XMLMapList& parMap,EnvWrap& envir)
|
||||
{
|
||||
MeshLabXMLStdDialog* dialog = qobject_cast<MeshLabXMLStdDialog*>(parent());
|
||||
if (dialog == NULL)
|
||||
throw MeshLabException("An XMLStdParFrame has not a MeshLabXMLStdDialog's parent");
|
||||
for(XMLFilterInfo::XMLMapList::const_iterator it = parMap.constBegin();it != parMap.constEnd();++it)
|
||||
{
|
||||
XMLMeshLabWidget* widg = XMLMeshLabWidgetFactory::create(*it,envir,this);
|
||||
XMLMeshLabWidget* widg = XMLMeshLabWidgetFactory::create(*it,envir,dialog->curMeshDoc,this);
|
||||
if (widg == NULL)
|
||||
return;
|
||||
xmlfieldwidgets.push_back(widg);
|
||||
@ -453,7 +456,7 @@ void XMLCheckBoxWidget::setVisibility( const bool vis )
|
||||
cb->setVisible(vis);
|
||||
}
|
||||
|
||||
XMLMeshLabWidget* XMLMeshLabWidgetFactory::create(const XMLFilterInfo::XMLMap& widgetTable,EnvWrap& env,QWidget* parent)
|
||||
XMLMeshLabWidget* XMLMeshLabWidgetFactory::create(const XMLFilterInfo::XMLMap& widgetTable,EnvWrap& env,MeshDocument* md,QWidget* parent)
|
||||
{
|
||||
QString guiType = widgetTable[MLXMLElNames::guiType];
|
||||
if (guiType == MLXMLElNames::editTag)
|
||||
@ -477,6 +480,8 @@ XMLMeshLabWidget* XMLMeshLabWidgetFactory::create(const XMLFilterInfo::XMLMap& w
|
||||
if (guiType == MLXMLElNames::enumWidgetTag)
|
||||
return new XMLEnumWidget(widgetTable,env,parent);
|
||||
|
||||
if (guiType == MLXMLElNames::meshWidgetTag)
|
||||
return new XMLMeshWidget(md,widgetTable,env,parent);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1014,11 +1019,17 @@ XMLEnumWidget::XMLEnumWidget( const XMLFilterInfo::XMLMap& xmlWidgetTag,EnvWrap&
|
||||
}
|
||||
}
|
||||
|
||||
void XMLEnumWidget::set( const QString& nwExpStr )
|
||||
{
|
||||
}
|
||||
|
||||
QString XMLEnumWidget::getWidgetExpression()
|
||||
{
|
||||
return enumCombo->itemData(enumCombo->currentIndex()).toString();
|
||||
}
|
||||
|
||||
XMLMeshWidget::XMLMeshWidget( MeshDocument* mdoc,const XMLFilterInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p )
|
||||
:XMLEnumWidget(xmlWidgetTag,envir,p)
|
||||
{
|
||||
foreach(MeshModel* mm,mdoc->meshList)
|
||||
enumCombo->addItem(mm->shortName(),mm->id());
|
||||
int def = env.evalInt(xmlWidgetTag[MLXMLElNames::paramDefExpr]);
|
||||
if (mdoc->getMesh(def))
|
||||
enumCombo->setCurrentIndex(def);
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ class XMLMeshLabWidgetFactory
|
||||
public:
|
||||
//WARNING! this function call constructors that could rise up a set of MeshLabExceptions but it is not able to manage it, so let the exceptions floating up!
|
||||
//IN ANY CASE the callee MUST check if the returned value is not NULL.
|
||||
static XMLMeshLabWidget* create(const XMLFilterInfo::XMLMap& widgetTable,EnvWrap& env,QWidget* parent);
|
||||
static XMLMeshLabWidget* create(const XMLFilterInfo::XMLMap& widgetTable,EnvWrap& env,MeshDocument* md,QWidget* parent);
|
||||
};
|
||||
|
||||
//
|
||||
@ -289,7 +289,7 @@ public:
|
||||
~XMLComboWidget();
|
||||
void updateVisibility(const bool vis);
|
||||
void Init(QWidget *p,QString lab,int newEnum, QStringList values);
|
||||
virtual void set(const QString& nwExpStr) = 0;
|
||||
void set(const QString& nwExpStr) {};
|
||||
virtual QString getWidgetExpression();
|
||||
|
||||
private:
|
||||
@ -315,9 +315,50 @@ public:
|
||||
~XMLEnumWidget(){};
|
||||
|
||||
QString getWidgetExpression();
|
||||
void set(const QString& nwExpStr);
|
||||
};
|
||||
|
||||
class XMLMeshWidget : public XMLEnumWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
XMLMeshWidget(MeshDocument* mdoc,const XMLFilterInfo::XMLMap& xmlWidgetTag,EnvWrap& envir,QWidget* p);
|
||||
~XMLMeshWidget(){};
|
||||
|
||||
private:
|
||||
MeshDocument* md;
|
||||
};
|
||||
|
||||
//class XMLShotfWidget : public MeshLabWidget
|
||||
//{
|
||||
// Q_OBJECT
|
||||
//
|
||||
//public:
|
||||
// ShotfWidget(QWidget *p, RichShotf* rpf, QWidget *gla);
|
||||
// ~ShotfWidget();
|
||||
// QString paramName;
|
||||
// vcg::Shotf getValue();
|
||||
//
|
||||
// void collectWidgetValue();
|
||||
// void resetWidgetValue();
|
||||
// void setWidgetValue(const Value& nv);
|
||||
//
|
||||
// public slots:
|
||||
// void getShot();
|
||||
// void setShotValue(QString name, vcg::Shotf val);
|
||||
//signals:
|
||||
// void askRasterShot(QString);
|
||||
// void askMeshShot(QString);
|
||||
// void askViewerShot(QString);
|
||||
//
|
||||
//protected:
|
||||
// vcg::Shotf curShot;
|
||||
// QLineEdit * shotLE;
|
||||
// QPushButton *getShotButton;
|
||||
// QComboBox *getShotCombo;
|
||||
// QLabel* descLab;
|
||||
//};
|
||||
|
||||
class XMLStdParFrame : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -390,6 +431,7 @@ public:
|
||||
//void dialogEvaluateExpression(const Expression& exp,Value** res);
|
||||
//void expandView(bool exp);
|
||||
|
||||
MeshDocument * curMeshDoc;
|
||||
private slots:
|
||||
void applyClick();
|
||||
void closeClick();
|
||||
@ -411,7 +453,6 @@ private:
|
||||
|
||||
int curmask;
|
||||
MeshModel *curModel;
|
||||
MeshDocument * curMeshDoc;
|
||||
MeshLabXMLFilterContainer* curmfc;
|
||||
MainWindowInterface *curmwi;
|
||||
XMLFilterInfo::XMLMapList curParMap;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user