mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-19 19:14:42 +00:00
Add a new type of parameter: Shot. Added also the mechanism to get the camera from the current trackball position with the usual signal/slot exchange between the parameter dialog and the current glarea.
This commit is contained in:
parent
75b1ef65e5
commit
b3b092c50d
@ -87,6 +87,7 @@ void RichParameterSet::setValue(QString name,const Value& newval){ findParameter
|
||||
QString RichParameterSet::getString(QString name) const { return findParameter(name)->val->getString();}
|
||||
Matrix44f RichParameterSet::getMatrix44(QString name) const { return findParameter(name)->val->getMatrix44f();}
|
||||
Point3f RichParameterSet::getPoint3f(QString name) const { return findParameter(name)->val->getPoint3f();}
|
||||
Shotd RichParameterSet::getShotd(QString name) const { return findParameter(name)->val->getShotd();}
|
||||
float RichParameterSet::getAbsPerc(QString name) const { return findParameter(name)->val->getAbsPerc();}
|
||||
int RichParameterSet::getEnum(QString name) const { return findParameter(name)->val->getEnum();}
|
||||
QList<float> RichParameterSet::getFloatList(QString name) const { return findParameter(name)->val->getFloatList();}
|
||||
@ -209,6 +210,11 @@ void RichParameterCopyConstructor::visit( RichPoint3f& pd )
|
||||
lastCreated = new RichPoint3f(pd.name,pd.val->getPoint3f(),pd.pd->defVal->getPoint3f(),pd.pd->fieldDesc,pd.pd->tooltip);
|
||||
}
|
||||
|
||||
void RichParameterCopyConstructor::visit( RichShotd& pd )
|
||||
{
|
||||
lastCreated = new RichShotd(pd.name,pd.val->getShotd(),pd.pd->defVal->getShotd(),pd.pd->fieldDesc,pd.pd->tooltip);
|
||||
}
|
||||
|
||||
void RichParameterCopyConstructor::visit( RichColor& pd )
|
||||
{
|
||||
lastCreated = new RichColor(pd.name,pd.val->getColor(),pd.pd->defVal->getColor(),pd.pd->fieldDesc,pd.pd->tooltip);
|
||||
@ -316,6 +322,13 @@ void RichParameterXMLVisitor::visit( RichPoint3f& pd )
|
||||
parElem.setAttribute("z",QString::number(p.Z()));
|
||||
}
|
||||
|
||||
void RichParameterXMLVisitor::visit( RichShotd& pd )
|
||||
{
|
||||
fillRichParameterAttribute("RichShotd",pd.name,pd.pd->fieldDesc,pd.pd->tooltip);
|
||||
assert(0); // TODO !!!!
|
||||
}
|
||||
|
||||
|
||||
void RichParameterXMLVisitor::visit( RichColor& pd )
|
||||
{
|
||||
fillRichParameterAttribute("RichColor",pd.name,pd.pd->fieldDesc,pd.pd->tooltip);
|
||||
@ -562,6 +575,13 @@ bool RichParameterFactory::create( const QDomElement& np,RichParameter** par )
|
||||
*par = new RichPoint3f(name, val,desc,tooltip);
|
||||
return true;
|
||||
}
|
||||
if(type=="RichShotd")
|
||||
{
|
||||
Shotd val;
|
||||
assert(0); //TODO!!!!
|
||||
*par = new RichShotd(name, val,desc,tooltip);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -609,6 +629,10 @@ Matrix44fDecoration::Matrix44fDecoration( Matrix44fValue* defvalue,const QString
|
||||
Point3fDecoration::Point3fDecoration( Point3fValue* defvalue,const QString desc /*= QString()*/,const QString tltip /*= QString()*/ ) :ParameterDecoration(defvalue,desc,tltip)
|
||||
{
|
||||
|
||||
}
|
||||
ShotdDecoration::ShotdDecoration( ShotdValue* defvalue,const QString desc /*= QString()*/,const QString tltip /*= QString()*/ ) :ParameterDecoration(defvalue,desc,tltip)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ColorDecoration::ColorDecoration( ColorValue* defvalue,const QString desc /*= QString()*/,const QString tltip/*= QString()*/ ) :ParameterDecoration(defvalue,desc,tltip)
|
||||
@ -832,7 +856,25 @@ RichPoint3f::~RichPoint3f()
|
||||
{
|
||||
|
||||
}
|
||||
//----
|
||||
RichShotd::RichShotd( const QString nm,const vcg::Shotd defval,const QString desc/*=QString()*/,const QString tltip/*=QString()*/ ) :RichParameter(nm,new ShotdValue(defval),new ShotdDecoration(new ShotdValue(defval),desc,tltip))
|
||||
{}
|
||||
|
||||
RichShotd::RichShotd( const QString nm,const vcg::Shotd val,const vcg::Shotd defval,const QString desc/*=QString()*/,const QString tltip/*=QString()*/ ):RichParameter(nm,new ShotdValue(val),new ShotdDecoration(new ShotdValue(defval),desc,tltip))
|
||||
{}
|
||||
void RichShotd::accept( Visitor& v )
|
||||
{
|
||||
v.visit(*this);
|
||||
}
|
||||
|
||||
bool RichShotd::operator==( const RichParameter& rb )
|
||||
{
|
||||
return (rb.val->isShotd() &&(name == rb.name) ); // TODO REAL TEST OF EQUALITY // && (val->getShotd() == rb.val->getShotd()));
|
||||
}
|
||||
|
||||
RichShotd::~RichShotd()
|
||||
{ }
|
||||
//----
|
||||
RichColor::RichColor( const QString nm,const QColor defval,const QString desc,const QString tltip ) :RichParameter(nm,new ColorValue(defval),new ColorDecoration(new ColorValue(defval),desc,tltip))
|
||||
{
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#include <QAction>
|
||||
#include <vcg/math/matrix44.h>
|
||||
#include <vcg/space/color4.h>
|
||||
#include <vcg/math/shot.h>
|
||||
#include <wrap/callback.h>
|
||||
class MeshModel;
|
||||
class MeshDocument;
|
||||
@ -81,6 +82,7 @@ public:
|
||||
virtual QString getString() const {assert(0);return QString();}
|
||||
virtual vcg::Matrix44f getMatrix44f() const {assert(0);return vcg::Matrix44f();}
|
||||
virtual vcg::Point3f getPoint3f() const {assert(0);return vcg::Point3f();}
|
||||
virtual vcg::Shotd getShotd() const {assert(0);return vcg::Shotd();}
|
||||
virtual QColor getColor() const {assert(0);return QColor();}
|
||||
virtual float getAbsPerc() const {assert(0);return float();}
|
||||
virtual int getEnum() const {assert(0);return int();}
|
||||
@ -95,6 +97,7 @@ public:
|
||||
virtual bool isString() const {return false;}
|
||||
virtual bool isMatrix44f() const {return false;}
|
||||
virtual bool isPoint3f() const {return false;}
|
||||
virtual bool isShotd() const {return false;}
|
||||
virtual bool isColor() const {return false;}
|
||||
virtual bool isAbsPerc() const {return false;}
|
||||
virtual bool isEnum() const {return false;}
|
||||
@ -177,14 +180,27 @@ private:
|
||||
class Point3fValue : public Value
|
||||
{
|
||||
public:
|
||||
Point3fValue(const vcg::Point3f& val) : pval(val){};
|
||||
inline vcg::Point3f getPoint3f() const {return pval;}
|
||||
inline bool isPoint3f() const {return true;}
|
||||
inline QString typeName() const {return QString("Point3f");}
|
||||
inline void set(const Value& p) {pval = p.getPoint3f();}
|
||||
~Point3fValue(){}
|
||||
Point3fValue(const vcg::Point3f& val) : pval(val){};
|
||||
inline vcg::Point3f getPoint3f() const {return pval;}
|
||||
inline bool isPoint3f() const {return true;}
|
||||
inline QString typeName() const {return QString("Point3f");}
|
||||
inline void set(const Value& p) {pval = p.getPoint3f();}
|
||||
~Point3fValue(){}
|
||||
private:
|
||||
vcg::Point3f pval;
|
||||
vcg::Point3f pval;
|
||||
};
|
||||
|
||||
class ShotdValue : public Value
|
||||
{
|
||||
public:
|
||||
ShotdValue(const vcg::Shotd& val) : pval(val){};
|
||||
inline vcg::Shotd getShotd() const {return pval;}
|
||||
inline bool isShotd() const {return true;}
|
||||
inline QString typeName() const {return QString("Shotd");}
|
||||
inline void set(const Value& p) {pval = p.getShotd();}
|
||||
~ShotdValue(){}
|
||||
private:
|
||||
vcg::Shotd pval;
|
||||
};
|
||||
|
||||
class ColorValue : public Value
|
||||
@ -355,8 +371,15 @@ public:
|
||||
class Point3fDecoration : public ParameterDecoration
|
||||
{
|
||||
public:
|
||||
Point3fDecoration(Point3fValue* defvalue,const QString desc = QString(),const QString tltip = QString());
|
||||
~Point3fDecoration(){}
|
||||
Point3fDecoration(Point3fValue* defvalue,const QString desc = QString(),const QString tltip = QString());
|
||||
~Point3fDecoration(){}
|
||||
};
|
||||
|
||||
class ShotdDecoration : public ParameterDecoration
|
||||
{
|
||||
public:
|
||||
ShotdDecoration(ShotdValue* defvalue,const QString desc = QString(),const QString tltip = QString());
|
||||
~ShotdDecoration(){}
|
||||
};
|
||||
|
||||
class ColorDecoration : public ParameterDecoration
|
||||
@ -442,6 +465,7 @@ class RichFloat;
|
||||
class RichString;
|
||||
class RichMatrix44f;
|
||||
class RichPoint3f;
|
||||
class RichShotd;
|
||||
class RichColor;
|
||||
class RichAbsPerc;
|
||||
class RichEnum;
|
||||
@ -462,6 +486,7 @@ public:
|
||||
virtual void visit( RichString& pd) = 0;
|
||||
virtual void visit( RichMatrix44f& pd) = 0;
|
||||
virtual void visit( RichPoint3f& pd) = 0;
|
||||
virtual void visit( RichShotd& pd) = 0;
|
||||
virtual void visit( RichColor& pd) = 0;
|
||||
virtual void visit( RichAbsPerc& pd) = 0;
|
||||
virtual void visit( RichEnum& pd) = 0;
|
||||
@ -548,11 +573,20 @@ public:
|
||||
class RichPoint3f : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichPoint3f(const QString nm,const vcg::Point3f defval,const QString desc=QString(),const QString tltip=QString());
|
||||
RichPoint3f(const QString nm,const vcg::Point3f val,const vcg::Point3f defval,const QString desc=QString(),const QString tltip=QString());
|
||||
void accept(Visitor& v);
|
||||
bool operator==(const RichParameter& rb);
|
||||
~RichPoint3f();
|
||||
RichPoint3f(const QString nm,const vcg::Point3f defval,const QString desc=QString(),const QString tltip=QString());
|
||||
RichPoint3f(const QString nm,const vcg::Point3f val,const vcg::Point3f defval,const QString desc=QString(),const QString tltip=QString());
|
||||
void accept(Visitor& v);
|
||||
bool operator==(const RichParameter& rb);
|
||||
~RichPoint3f();
|
||||
};
|
||||
class RichShotd : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichShotd(const QString nm,const vcg::Shotd defval,const QString desc=QString(),const QString tltip=QString());
|
||||
RichShotd(const QString nm,const vcg::Shotd val,const vcg::Shotd defval,const QString desc=QString(),const QString tltip=QString());
|
||||
void accept(Visitor& v);
|
||||
bool operator==(const RichParameter& rb);
|
||||
~RichShotd();
|
||||
};
|
||||
|
||||
class RichColor : public RichParameter
|
||||
@ -658,6 +692,7 @@ public:
|
||||
void visit(RichString& pd);
|
||||
void visit(RichMatrix44f& pd);
|
||||
void visit(RichPoint3f& pd);
|
||||
void visit(RichShotd& pd);
|
||||
void visit(RichColor& pd);
|
||||
void visit(RichAbsPerc& pd);
|
||||
|
||||
@ -692,6 +727,7 @@ public:
|
||||
void visit(RichString& pd);
|
||||
void visit(RichMatrix44f& pd);
|
||||
void visit(RichPoint3f& pd);
|
||||
void visit(RichShotd& pd);
|
||||
void visit(RichColor& pd);
|
||||
void visit(RichAbsPerc& pd);
|
||||
|
||||
@ -748,6 +784,7 @@ public:
|
||||
QString getString(QString name) const;
|
||||
vcg::Matrix44f getMatrix44(QString name) const;
|
||||
vcg::Point3f getPoint3f(QString name) const;
|
||||
vcg::Shotd getShotd(QString name) const;
|
||||
QColor getColor(QString name) const;
|
||||
vcg::Color4b getColor4b(QString name) const;
|
||||
float getAbsPerc(QString name) const;
|
||||
|
||||
@ -1074,6 +1074,11 @@ void GLArea::sendCameraPos(QString name)
|
||||
emit transmitViewDir(name, pos);
|
||||
}
|
||||
|
||||
void GLArea::sendShot(QString name)
|
||||
{
|
||||
Shotd curShot=shotFromTrackball().first;
|
||||
emit transmitShot(name, curShot);
|
||||
}
|
||||
|
||||
Point3f GLArea::getViewDir()
|
||||
{
|
||||
@ -1175,7 +1180,7 @@ void GLArea::loadRaster(int id)
|
||||
|
||||
//TODO temporaneo... poi bisogna creare un defaultShot
|
||||
createOrthoView("Front");
|
||||
Shot* tmpShot = &(shotFromTrackball().first);
|
||||
Shotd* tmpShot = &(shotFromTrackball().first);
|
||||
rm->setShot(*tmpShot);
|
||||
}
|
||||
}
|
||||
@ -1257,7 +1262,7 @@ float GLArea::getCameraDistance()
|
||||
return cameraDist;
|
||||
}
|
||||
|
||||
void GLArea::initializeShot(Shot &shot)
|
||||
void GLArea::initializeShot(Shotd &shot)
|
||||
{
|
||||
//Da vedere
|
||||
shot.Intrinsics.PixelSizeMm[0]=0.036916077;
|
||||
@ -1312,7 +1317,7 @@ void GLArea::loadShotFromTextAlignFile(const QDomDocument &doc)
|
||||
{
|
||||
QDomElement root = doc.documentElement();
|
||||
QDomNode node;
|
||||
Shot shot;
|
||||
Shotd shot;
|
||||
|
||||
node = root.firstChild();
|
||||
|
||||
@ -1362,7 +1367,7 @@ void GLArea::loadShotFromTextAlignFile(const QDomDocument &doc)
|
||||
|
||||
trackball.track.sca =fabs(p2.Z()/p1.Z());
|
||||
|
||||
loadShot(QPair<Shot, float> (shot,trackball.track.sca));
|
||||
loadShot(QPair<Shotd, float> (shot,trackball.track.sca));
|
||||
|
||||
}
|
||||
|
||||
@ -1371,14 +1376,14 @@ ViewState file is an xml file format created by Meshlab with the action "copyToC
|
||||
*/
|
||||
void GLArea::loadViewFromViewStateFile(const QDomDocument &doc)
|
||||
{
|
||||
Shot shot;
|
||||
Shotd shot;
|
||||
QDomElement root = doc.documentElement();
|
||||
QDomNode node = root.firstChild();
|
||||
|
||||
while(!node.isNull())
|
||||
{
|
||||
if (QString::compare(node.nodeName(),"CamParam")==0)
|
||||
ReadShotFromQDomNode<Shot>(shot,node);
|
||||
ReadShotFromQDomNode<Shotd>(shot,node);
|
||||
else if (QString::compare(node.nodeName(),"ViewSettings")==0)
|
||||
{
|
||||
QDomNamedNodeMap attr = node.attributes();
|
||||
@ -1405,13 +1410,13 @@ void GLArea::loadViewFromViewStateFile(const QDomDocument &doc)
|
||||
node = node.nextSibling();
|
||||
}
|
||||
|
||||
loadShot(QPair<Shot, float> (shot,trackball.track.sca));
|
||||
loadShot(QPair<Shotd, float> (shot,trackball.track.sca));
|
||||
}
|
||||
|
||||
void GLArea::viewToClipboard()
|
||||
{
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
Shot shot = shotFromTrackball().first;
|
||||
Shotd shot = shotFromTrackball().first;
|
||||
|
||||
QDomDocument doc("ViewState");
|
||||
QDomElement root = doc.createElement("project");
|
||||
@ -1485,9 +1490,9 @@ void GLArea::viewFromClipboard()
|
||||
loadViewFromViewStateFile(doc);
|
||||
}
|
||||
|
||||
QPair<vcg::Shot<double>,float> GLArea::shotFromTrackball()
|
||||
QPair<vcg::Shotd,float> GLArea::shotFromTrackball()
|
||||
{
|
||||
Shot shot;
|
||||
Shotd shot;
|
||||
initializeShot(shot);
|
||||
|
||||
double viewportYMm=shot.Intrinsics.PixelSizeMm[1]*shot.Intrinsics.ViewportPx[1];
|
||||
@ -1498,11 +1503,11 @@ QPair<vcg::Shot<double>,float> GLArea::shotFromTrackball()
|
||||
//add the translation introduced by gluLookAt() (0,0,cameraDist), in order to have te same view---------------
|
||||
//T(gl)*S*R*T(t) => SR(gl+t) => S R (S^(-1)R^(-1)gl + t)
|
||||
//Add translation S^(-1) R^(-1)(gl)
|
||||
//Shot doesn't introduce scaling
|
||||
//Shotd doesn't introduce scaling
|
||||
//---------------------------------------------------------------------
|
||||
shot.Extrinsics.SetTra( shot.Extrinsics.Tra() + (Inverse(shot.Extrinsics.Rot())*Point3d(0, 0, cameraDist)));
|
||||
|
||||
Shot newShot = track2ShotCPU(shot, &trackball);
|
||||
vcg::Shotd newShot = track2ShotCPU<double>(shot, &trackball);
|
||||
|
||||
////Expressing scaling as a translation along z
|
||||
////k is the ratio between default scale and new scale
|
||||
@ -1520,12 +1525,12 @@ QPair<vcg::Shot<double>,float> GLArea::shotFromTrackball()
|
||||
|
||||
//newShot.Extrinsics.SetTra(t0);
|
||||
|
||||
return QPair<Shot, float> (newShot,trackball.track.sca);
|
||||
return QPair<Shotd, float> (newShot,trackball.track.sca);
|
||||
}
|
||||
|
||||
void GLArea::loadShot(const QPair<vcg::Shot<double>,float> &shotAndScale){
|
||||
void GLArea::loadShot(const QPair<vcg::Shotd,float> &shotAndScale){
|
||||
|
||||
Shot shot = shotAndScale.first;
|
||||
Shotd shot = shotAndScale.first;
|
||||
|
||||
fov = shot.GetFovFromFocal();
|
||||
|
||||
@ -1569,7 +1574,7 @@ void GLArea::loadShot(const QPair<vcg::Shot<double>,float> &shotAndScale){
|
||||
|
||||
void GLArea::createOrthoView(QString dir)
|
||||
{
|
||||
Shot view;
|
||||
Shotd view;
|
||||
initializeShot(view);
|
||||
|
||||
fov =5;
|
||||
@ -1603,13 +1608,13 @@ void GLArea::createOrthoView(QString dir)
|
||||
//add the translation introduced by gluLookAt() (0,0,cameraDist), in order to have te same view---------------
|
||||
//T(gl)*S*R*T(t) => SR(gl+t) => S R (S^(-1)R^(-1)gl + t)
|
||||
//Add translation S^(-1) R^(-1)(gl)
|
||||
//Shot doesn't introduce scaling
|
||||
//Shotd doesn't introduce scaling
|
||||
//---------------------------------------------------------------------
|
||||
view.Extrinsics.SetTra( view.Extrinsics.Tra() + (Inverse(view.Extrinsics.Rot())*Point3d(0, 0, cameraDist)));
|
||||
|
||||
Shot shot = track2ShotCPU(view, &trackball);
|
||||
Shotd shot = track2ShotCPU(view, &trackball);
|
||||
|
||||
QPair<Shot,float> shotAndScale = QPair<Shot,float> (shot, trackball.track.sca);
|
||||
QPair<Shotd,float> shotAndScale = QPair<Shotd,float> (shot, trackball.track.sca);
|
||||
loadShot(shotAndScale);
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class GLArea : public Viewer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
typedef vcg::Shot<double> Shot;
|
||||
//typedef vcg::Shot<double> Shot;
|
||||
|
||||
public:
|
||||
GLArea(MultiViewer_Container *mvcont, RichParameterSet *current);
|
||||
@ -217,12 +217,14 @@ signals :
|
||||
void transmitViewDir(QString name, vcg::Point3f dir);
|
||||
void transmitViewPos(QString name, vcg::Point3f dir);
|
||||
void transmitSurfacePos(QString name,vcg::Point3f dir);
|
||||
void transmitCameraPos(QString name,vcg::Point3f dir);
|
||||
void transmitCameraPos(QString name,vcg::Point3f dir);
|
||||
void transmitShot(QString name, vcg::Shotd);
|
||||
public slots:
|
||||
void sendViewPos(QString name);
|
||||
void sendSurfacePos(QString name);
|
||||
void sendViewDir(QString name);
|
||||
void sendCameraPos(QString name);
|
||||
void sendShot(QString name);
|
||||
|
||||
|
||||
public:
|
||||
@ -342,17 +344,17 @@ private:
|
||||
|
||||
//-----------Shot support----------------------------
|
||||
public:
|
||||
QPair<Shot, float > shotFromTrackball();
|
||||
QPair<vcg::Shotd, float > shotFromTrackball();
|
||||
bool viewFromFile();
|
||||
void createOrthoView(QString);
|
||||
void viewToClipboard();
|
||||
void viewFromClipboard();
|
||||
void loadShot(const QPair<Shot, float> &) ;
|
||||
void loadShot(const QPair<vcg::Shotd, float> &) ;
|
||||
|
||||
private:
|
||||
|
||||
float getCameraDistance();
|
||||
void initializeShot(Shot &shot);
|
||||
void initializeShot(vcg::Shotd &shot);
|
||||
void loadShotFromTextAlignFile(const QDomDocument &doc);
|
||||
void loadViewFromViewStateFile(const QDomDocument &doc);
|
||||
|
||||
|
||||
@ -584,6 +584,72 @@ void Point3fWidget::setWidgetValue( const Value& nv )
|
||||
for(unsigned int ii = 0; ii < 3;++ii)
|
||||
coordSB[ii]->setText(QString::number(nv.getPoint3f()[ii],'g',3));
|
||||
}
|
||||
/********************/
|
||||
// ShotdWidget Implementation
|
||||
|
||||
ShotdWidget::ShotdWidget(QWidget *p, RichShotd* rpf, QWidget *gla_curr): MeshLabWidget(p,rpf)
|
||||
{
|
||||
|
||||
paramName = rpf->name;
|
||||
//int row = gridLay->rowCount() - 1;
|
||||
|
||||
descLab = new QLabel(rpf->pd->fieldDesc,p);
|
||||
descLab->setToolTip(rpf->pd->fieldDesc);
|
||||
gridLay->addWidget(descLab,row,0,Qt::AlignTop);
|
||||
|
||||
QHBoxLayout* lay = new QHBoxLayout(p);
|
||||
|
||||
|
||||
this->setValue(paramName,rp->val->getShotd());
|
||||
if(gla_curr) // if we have a connection to the current glarea we can setup the additional button for getting the current view direction.
|
||||
{
|
||||
getShotButton = new QPushButton("Get shot",p);
|
||||
lay->addWidget(getShotButton);
|
||||
|
||||
connect(getShotButton,SIGNAL(clicked()),this,SLOT(getShot()));
|
||||
connect(gla_curr,SIGNAL(transmitShot(QString,vcg::Shotd)),this,SLOT(setValue(QString,vcg::Shotd)));
|
||||
connect(this,SIGNAL(askShot(QString)),gla_curr,SLOT(sendShot(QString)));
|
||||
}
|
||||
gridLay->addLayout(lay,row,1,Qt::AlignTop);
|
||||
}
|
||||
|
||||
void ShotdWidget::getShot()
|
||||
{
|
||||
emit askShot(paramName);
|
||||
}
|
||||
|
||||
ShotdWidget::~ShotdWidget() {}
|
||||
|
||||
void ShotdWidget::setValue(QString name,Shotd newVal)
|
||||
{
|
||||
if(name==paramName)
|
||||
{
|
||||
curShot=newVal;
|
||||
}
|
||||
}
|
||||
|
||||
vcg::Shotd ShotdWidget::getValue()
|
||||
{
|
||||
return curShot;
|
||||
}
|
||||
|
||||
void ShotdWidget::collectWidgetValue()
|
||||
{
|
||||
rp->val->set(ShotdValue(curShot));
|
||||
}
|
||||
|
||||
void ShotdWidget::resetWidgetValue()
|
||||
{
|
||||
curShot = rp->pd->defVal->getShotd();
|
||||
}
|
||||
|
||||
void ShotdWidget::setWidgetValue( const Value& nv )
|
||||
{
|
||||
curShot = nv.getShotd();
|
||||
}
|
||||
|
||||
/********************/
|
||||
// ComboWidget End Implementation
|
||||
|
||||
ComboWidget::ComboWidget(QWidget *p, RichParameter* rpar) :MeshLabWidget(p,rpar) {
|
||||
}
|
||||
@ -1357,6 +1423,12 @@ void RichParameterToQTableWidgetItemConstructor::visit( RichPoint3f& pd )
|
||||
lastCreated = new QTableWidgetItem(pst/*,lst*/);
|
||||
}
|
||||
|
||||
void RichParameterToQTableWidgetItemConstructor::visit( RichShotd& pd )
|
||||
{
|
||||
assert(0); ///
|
||||
lastCreated = new QTableWidgetItem(QString("TODO")/*,lst*/);
|
||||
}
|
||||
|
||||
void RichParameterToQTableWidgetItemConstructor::visit(RichOpenFile& pd)
|
||||
{
|
||||
lastCreated = new QTableWidgetItem(pd.val->getFileName()/*,lst*/);
|
||||
|
||||
@ -262,6 +262,34 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
//public QHBoxLayout,
|
||||
class ShotdWidget : public MeshLabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ShotdWidget(QWidget *p, RichShotd* rpf, QWidget *gla);
|
||||
~ShotdWidget();
|
||||
QString paramName;
|
||||
vcg::Shotd getValue();
|
||||
|
||||
void collectWidgetValue();
|
||||
void resetWidgetValue();
|
||||
void setWidgetValue(const Value& nv);
|
||||
|
||||
public slots:
|
||||
void getShot();
|
||||
void setValue(QString name, vcg::Shotd val);
|
||||
signals:
|
||||
void askShot(QString);
|
||||
|
||||
protected:
|
||||
vcg::Shotd curShot;
|
||||
QLineEdit * shotLE;
|
||||
QPushButton *getShotButton;
|
||||
QLabel* descLab;
|
||||
};
|
||||
|
||||
|
||||
//public QGridLayout,
|
||||
class DynamicFloatWidget : public MeshLabWidget
|
||||
@ -617,6 +645,7 @@ public:
|
||||
void visit(RichString& pd){lastCreated = new StringWidget(par,&pd);};
|
||||
void visit(RichMatrix44f& /*pd*/){assert(0);/*TO BE IMPLEMENTED*/ /*lastCreated = new Matrix44fWidget(par,&pd);*/};
|
||||
void visit(RichPoint3f& pd){lastCreated = new Point3fWidget(par,&pd,reinterpret_cast<StdParFrame*>(par)->gla);};
|
||||
void visit(RichShotd& pd){lastCreated = new ShotdWidget(par,&pd,reinterpret_cast<StdParFrame*>(par)->gla);};
|
||||
void visit(RichColor& pd){lastCreated = new ColorWidget(par,&pd);};
|
||||
void visit(RichAbsPerc& pd){lastCreated = new AbsPercWidget(par,&pd);};
|
||||
void visit(RichEnum& pd){lastCreated = new EnumWidget(par,&pd);};
|
||||
@ -646,6 +675,7 @@ public:
|
||||
void visit(RichString& pd);
|
||||
void visit(RichMatrix44f& /*pd*/){assert(0);};
|
||||
void visit(RichPoint3f& pd);
|
||||
void visit(RichShotd& pd);
|
||||
void visit(RichColor& pd);
|
||||
void visit(RichAbsPerc& pd);
|
||||
void visit(RichEnum& pd);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user