mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
RichPoint3f split into RichPosition and RichDirection
This commit is contained in:
parent
a615bf05f3
commit
8b490fc2e8
@ -324,9 +324,9 @@ bool RichMatrix44f::operator==( const RichParameter& rb )
|
||||
return (rb.value().isMatrix44f() &&(pName == rb.name()) && (value().getMatrix44f() == rb.value().getMatrix44f()));
|
||||
}
|
||||
|
||||
/**** RichPoint3f Class ****/
|
||||
/**** RichPosition Class ****/
|
||||
|
||||
RichPoint3f::RichPoint3f(
|
||||
RichPosition::RichPosition(
|
||||
const QString& nm,
|
||||
const Point3m& defval,
|
||||
const QString& desc,
|
||||
@ -337,21 +337,53 @@ RichPoint3f::RichPoint3f(
|
||||
{
|
||||
}
|
||||
|
||||
RichPoint3f::~RichPoint3f()
|
||||
RichPosition::~RichPosition()
|
||||
{
|
||||
}
|
||||
|
||||
QString RichPoint3f::stringType() const
|
||||
QString RichPosition::stringType() const
|
||||
{
|
||||
return "RichPoint3f";
|
||||
return "RichPosition";
|
||||
}
|
||||
|
||||
RichPoint3f* RichPoint3f::clone() const
|
||||
RichPosition* RichPosition::clone() const
|
||||
{
|
||||
return new RichPoint3f(*this);
|
||||
return new RichPosition(*this);
|
||||
}
|
||||
|
||||
bool RichPoint3f::operator==( const RichParameter& rb )
|
||||
bool RichPosition::operator==( const RichParameter& rb )
|
||||
{
|
||||
return (rb.value().isPoint3f() &&(pName == rb.name()) && (value().getPoint3f() == rb.value().getPoint3f()));
|
||||
}
|
||||
|
||||
/**** RichDirection Class ****/
|
||||
|
||||
RichDirection::RichDirection(
|
||||
const QString& nm,
|
||||
const Point3m& defval,
|
||||
const QString& desc,
|
||||
const QString& tltip,
|
||||
bool hidden,
|
||||
const QString& category) :
|
||||
RichParameter(nm, Point3fValue(defval), desc, tltip, hidden, category)
|
||||
{
|
||||
}
|
||||
|
||||
RichDirection::~RichDirection()
|
||||
{
|
||||
}
|
||||
|
||||
QString RichDirection::stringType() const
|
||||
{
|
||||
return "RichDirection";
|
||||
}
|
||||
|
||||
RichDirection* RichDirection::clone() const
|
||||
{
|
||||
return new RichDirection(*this);
|
||||
}
|
||||
|
||||
bool RichDirection::operator==(const RichParameter& rb)
|
||||
{
|
||||
return (rb.value().isPoint3f() &&(pName == rb.name()) && (value().getPoint3f() == rb.value().getPoint3f()));
|
||||
}
|
||||
@ -835,7 +867,7 @@ bool RichParameterAdapter::create( const QDomElement& np,RichParameter** par )
|
||||
if (!corrconv)
|
||||
return false;
|
||||
|
||||
*par = new RichPoint3f(name, val,desc,tooltip);
|
||||
*par = new RichPosition(name, val,desc,tooltip);
|
||||
return true;
|
||||
}
|
||||
if(type=="RichShotf") {
|
||||
|
||||
@ -188,21 +188,39 @@ public:
|
||||
bool operator==(const RichParameter& rb);
|
||||
};
|
||||
|
||||
class RichPoint3f : public RichParameter
|
||||
class RichPosition : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichPoint3f(
|
||||
RichPosition(
|
||||
const QString& nm,
|
||||
const Point3m& defval,
|
||||
const QString& desc = QString(),
|
||||
const QString& tltip = QString(),
|
||||
bool hidden = false,
|
||||
const QString& category = QString());
|
||||
~RichPoint3f();
|
||||
~RichPosition();
|
||||
|
||||
QString stringType() const;
|
||||
|
||||
RichPoint3f* clone() const;
|
||||
RichPosition* clone() const;
|
||||
bool operator==(const RichParameter& rb);
|
||||
};
|
||||
|
||||
class RichDirection : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichDirection(
|
||||
const QString& nm,
|
||||
const Point3m& defval,
|
||||
const QString& desc = QString(),
|
||||
const QString& tltip = QString(),
|
||||
bool hidden = false,
|
||||
const QString& category = QString());
|
||||
~RichDirection();
|
||||
|
||||
QString stringType() const;
|
||||
|
||||
RichDirection* clone() const;
|
||||
bool operator==(const RichParameter& rb);
|
||||
};
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ void pymeshlab::FunctionParameter::printDefaultValue(std::ostream& o) const
|
||||
<< "[" << v[12] << ", " << v[13] << ", " << v[14] << ", " << v[15] << "]]";
|
||||
return;
|
||||
}
|
||||
if (parameter->isOfType<RichPoint3f>()) {
|
||||
if (parameter->isOfType<RichPosition>() || parameter->isOfType<RichDirection>()) {
|
||||
o << "[" << parameter->value().getPoint3f().X() << ", "
|
||||
<< parameter->value().getPoint3f().Y() << ", "
|
||||
<< parameter->value().getPoint3f().Z() << "]";
|
||||
|
||||
@ -44,7 +44,9 @@ QString pymeshlab::computePythonTypeString(const RichParameter& par)
|
||||
return PYTHON_TYPE_STRING;
|
||||
if (par.isOfType<RichMatrix44f>())
|
||||
return PYTHON_TYPE_MATRIX44F;
|
||||
if (par.isOfType<RichPoint3f>())
|
||||
if (par.isOfType<RichPosition>())
|
||||
return PYTHON_TYPE_POINT3F;
|
||||
if (par.isOfType<RichDirection>())
|
||||
return PYTHON_TYPE_POINT3F;
|
||||
if (par.isOfType<RichShotf>())
|
||||
return PYTHON_TYPE_SHOTF;
|
||||
|
||||
@ -139,7 +139,7 @@ QTableWidgetItem* MeshLabOptionsDialog::createQTableWidgetItemFromRichParameter(
|
||||
assert(0);
|
||||
return nullptr;
|
||||
}
|
||||
else if (pd.isOfType<RichPoint3f>()){
|
||||
else if (pd.isOfType<RichPosition>() || pd.isOfType<RichDirection>()){
|
||||
vcg::Point3f pp = pd.value().getPoint3f();
|
||||
QString pst = "P3(" + QString::number(pp.X()) + "," + QString::number(pp.Y()) + "," + QString::number(pp.Z()) + ")";
|
||||
return new QTableWidgetItem(pst);
|
||||
|
||||
@ -266,8 +266,11 @@ RichParameterWidget* RichParameterListFrame::createWidgetFromRichParameter(
|
||||
else if (pd.isOfType<RichMatrix44f>()){
|
||||
return new Matrix44fWidget(parent, (const RichMatrix44f&)pd, (const RichMatrix44f&)def, reinterpret_cast<RichParameterListFrame*>(parent)->gla);
|
||||
}
|
||||
else if (pd.isOfType<RichPoint3f>()){
|
||||
return new Point3fWidget(parent, (const RichPoint3f&)pd, (const RichPoint3f&)def, reinterpret_cast<RichParameterListFrame*>(parent)->gla);
|
||||
else if (pd.isOfType<RichPosition>()){
|
||||
return new PositionWidget(parent, (const RichPosition&)pd, (const RichPosition&)def, reinterpret_cast<RichParameterListFrame*>(parent)->gla);
|
||||
}
|
||||
else if (pd.isOfType<RichDirection>()){
|
||||
return new DirectionWidget(parent, (const RichDirection&)pd, (const RichDirection&)def, reinterpret_cast<RichParameterListFrame*>(parent)->gla);
|
||||
}
|
||||
else if (pd.isOfType<RichShotf>()){
|
||||
return new ShotfWidget(parent, (const RichShotf&)pd, (const RichShotf&)def, reinterpret_cast<RichParameterListFrame*>(parent)->gla);
|
||||
|
||||
@ -458,10 +458,10 @@ void AbsPercWidget::addWidgetToGridLayout( QGridLayout* lay,const int r )
|
||||
}
|
||||
|
||||
/******************************************/
|
||||
// Point3fWidget Implementation
|
||||
// PositionWidget Implementation
|
||||
/******************************************/
|
||||
|
||||
Point3fWidget::Point3fWidget(QWidget *p, const RichPoint3f& rpf, const RichPoint3f& rdef, QWidget *gla_curr):
|
||||
PositionWidget::PositionWidget(QWidget *p, const RichPosition& rpf, const RichPosition& rdef, QWidget *gla_curr):
|
||||
RichParameterWidget(p,rpf, rdef)
|
||||
{
|
||||
//qDebug("Creating a Point3fWidget");
|
||||
@ -490,16 +490,7 @@ Point3fWidget::Point3fWidget(QWidget *p, const RichPoint3f& rpf, const RichPoint
|
||||
this->setValue(paramName,rp->value().getPoint3f());
|
||||
if(gla_curr) // if we have a connection to the current glarea we can setup the additional button for getting the current view direction.
|
||||
{
|
||||
getPoint3Button = new QPushButton("Get",this);
|
||||
getPoint3Button->setMaximumWidth(getPoint3Button->sizeHint().width()/2);
|
||||
|
||||
getPoint3Button->setFlat(true);
|
||||
getPoint3Button->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred);
|
||||
//getPoint3Button->setMinimumWidth(getPoint3Button->sizeHint().width());
|
||||
//this->addWidget(getPoint3Button,0,Qt::AlignHCenter);
|
||||
vlay->addWidget(getPoint3Button);
|
||||
QStringList names;
|
||||
names << "View Dir.";
|
||||
names << "View Pos.";
|
||||
names << "Surf. Pos.";
|
||||
names << "Raster Camera Pos.";
|
||||
@ -511,46 +502,57 @@ Point3fWidget::Point3fWidget(QWidget *p, const RichPoint3f& rpf, const RichPoint
|
||||
//this->addWidget(getPoint3Combo,0,Qt::AlignHCenter);
|
||||
vlay->addWidget(getPoint3Combo);
|
||||
|
||||
connect(getPoint3Button,SIGNAL(clicked()),this,SLOT(getPoint()));
|
||||
connect(getPoint3Combo,SIGNAL(currentIndexChanged(int)),this,SLOT(getPoint()));
|
||||
connect(gla_curr,SIGNAL(transmitViewDir(QString,Point3m)),this,SLOT(setValue(QString,Point3m)));
|
||||
connect(gla_curr,SIGNAL(transmitShot(QString,Shotm)),this,SLOT(setShotValue(QString,Shotm)));
|
||||
//connect(getPoint3Combo,SIGNAL(currentIndexChanged(int)),this,SLOT(getPoint()));
|
||||
connect(gla_curr,SIGNAL(transmitSurfacePos(QString,Point3m)),this,SLOT(setValue(QString,Point3m)));
|
||||
connect(gla_curr,SIGNAL(transmitCameraPos(QString, Point3m)),this,SLOT(setValue(QString, Point3m)));
|
||||
connect(gla_curr,SIGNAL(transmitShot(QString,Shotm)),this,SLOT(setShotValue(QString,Shotm)));
|
||||
connect(gla_curr,SIGNAL(transmitTrackballPos(QString, Point3m)),this,SLOT(setValue(QString, Point3m)));
|
||||
connect(this,SIGNAL(askViewDir(QString)),gla_curr,SLOT(sendViewDir(QString)));
|
||||
connect(this,SIGNAL(askViewPos(QString)),gla_curr,SLOT(sendViewerShot(QString)));
|
||||
connect(this,SIGNAL(askSurfacePos(QString)),gla_curr,SLOT(sendSurfacePos(QString)));
|
||||
connect(this,SIGNAL(askCameraPos(QString)),gla_curr,SLOT(sendRasterShot(QString)));
|
||||
connect(this,SIGNAL(askTrackballPos(QString)),gla_curr,SLOT(sendTrackballPos(QString)));
|
||||
|
||||
getPoint3Button = new QPushButton("Get",this);
|
||||
getPoint3Button->setMaximumWidth(getPoint3Button->sizeHint().width()/2);
|
||||
|
||||
getPoint3Button->setFlat(true);
|
||||
getPoint3Button->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred);
|
||||
connect(getPoint3Button,SIGNAL(clicked()),this,SLOT(getPoint()));
|
||||
|
||||
vlay->addWidget(getPoint3Button);
|
||||
}
|
||||
//gridLay->addLayout(lay,row,1,Qt::AlignTop);
|
||||
}
|
||||
|
||||
Point3fWidget::~Point3fWidget()
|
||||
PositionWidget::~PositionWidget()
|
||||
{
|
||||
//qDebug("Deallocating a point3fwidget");
|
||||
this->disconnect();
|
||||
}
|
||||
|
||||
void Point3fWidget::getPoint()
|
||||
void PositionWidget::getPoint()
|
||||
{
|
||||
int index = getPoint3Combo->currentIndex();
|
||||
//qDebug("Got signal %i",index);
|
||||
switch(index)
|
||||
{
|
||||
case 0: emit askViewDir(paramName); break;
|
||||
case 1: emit askViewPos(paramName); break;
|
||||
case 2: emit askSurfacePos(paramName); break;
|
||||
case 3: emit askCameraPos(paramName); break;
|
||||
case 4: emit askTrackballPos(paramName); break;
|
||||
case 0:
|
||||
emit askViewPos(paramName);
|
||||
break;
|
||||
case 1:
|
||||
emit askSurfacePos(paramName);
|
||||
break;
|
||||
case 2:
|
||||
emit askCameraPos(paramName);
|
||||
break;
|
||||
case 3:
|
||||
emit askTrackballPos(paramName);
|
||||
break;
|
||||
default : assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Point3fWidget::setValue(QString name,Point3m newVal)
|
||||
void PositionWidget::setValue(QString name,Point3m newVal)
|
||||
{
|
||||
//qDebug("setValue parametername: %s ", qUtf8Printable(name));
|
||||
if(name==paramName)
|
||||
{
|
||||
for(int i =0;i<3;++i)
|
||||
@ -558,35 +560,159 @@ void Point3fWidget::setValue(QString name,Point3m newVal)
|
||||
}
|
||||
}
|
||||
|
||||
void Point3fWidget::setShotValue(QString name, Shotm newValShot)
|
||||
void PositionWidget::setShotValue(QString name, Shotm newValShot)
|
||||
{
|
||||
vcg::Point3f p = newValShot.GetViewPoint();
|
||||
setValue(name,p);
|
||||
}
|
||||
|
||||
vcg::Point3f Point3fWidget::getValue()
|
||||
vcg::Point3f PositionWidget::getValue()
|
||||
{
|
||||
return vcg::Point3f(coordSB[0]->text().toFloat(),coordSB[1]->text().toFloat(),coordSB[2]->text().toFloat());
|
||||
}
|
||||
|
||||
void Point3fWidget::collectWidgetValue()
|
||||
void PositionWidget::collectWidgetValue()
|
||||
{
|
||||
rp->setValue(Point3fValue(vcg::Point3f(coordSB[0]->text().toFloat(),coordSB[1]->text().toFloat(),coordSB[2]->text().toFloat())));
|
||||
}
|
||||
|
||||
void Point3fWidget::resetWidgetValue()
|
||||
void PositionWidget::resetWidgetValue()
|
||||
{
|
||||
for(unsigned int ii = 0; ii < 3;++ii)
|
||||
coordSB[ii]->setText(QString::number(rp->value().getPoint3f()[ii],'g',3));
|
||||
}
|
||||
|
||||
void Point3fWidget::setWidgetValue( const Value& nv )
|
||||
void PositionWidget::setWidgetValue( const Value& nv )
|
||||
{
|
||||
for(unsigned int ii = 0; ii < 3;++ii)
|
||||
coordSB[ii]->setText(QString::number(nv.getPoint3f()[ii],'g',3));
|
||||
}
|
||||
|
||||
void Point3fWidget::addWidgetToGridLayout( QGridLayout* lay,const int r )
|
||||
void PositionWidget::addWidgetToGridLayout( QGridLayout* lay,const int r )
|
||||
{
|
||||
if (lay != NULL)
|
||||
{
|
||||
lay->addWidget(descLab,r,0);
|
||||
lay->addLayout(vlay,r,1);
|
||||
}
|
||||
RichParameterWidget::addWidgetToGridLayout(lay,r);
|
||||
}
|
||||
|
||||
/******************************************/
|
||||
// DirectionWidget Implementation
|
||||
/******************************************/
|
||||
|
||||
DirectionWidget::DirectionWidget(QWidget *p, const RichDirection& rpf, const RichDirection& rdef, QWidget *gla_curr):
|
||||
RichParameterWidget(p,rpf, rdef)
|
||||
{
|
||||
paramName = rpf.name();
|
||||
descLab = new QLabel(rpf.fieldDescription(),this);
|
||||
descLab->setToolTip(rpf.fieldDescription());
|
||||
|
||||
vlay = new QHBoxLayout();
|
||||
vlay->setSpacing(0);
|
||||
for(int i =0;i<3;++i)
|
||||
{
|
||||
coordSB[i]= new QLineEdit(this);
|
||||
QFont baseFont=coordSB[i]->font();
|
||||
if(baseFont.pixelSize() != -1) baseFont.setPixelSize(baseFont.pixelSize()*3/4);
|
||||
else baseFont.setPointSize(baseFont.pointSize()*3/4);
|
||||
coordSB[i]->setFont(baseFont);
|
||||
coordSB[i]->setMaximumWidth(coordSB[i]->sizeHint().width()/2);
|
||||
coordSB[i]->setValidator(new QDoubleValidator());
|
||||
coordSB[i]->setAlignment(Qt::AlignRight);
|
||||
coordSB[i]->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Preferred);
|
||||
vlay->addWidget(coordSB[i]);
|
||||
connect(coordSB[i],SIGNAL(textChanged(QString)),p,SIGNAL(parameterChanged()));
|
||||
}
|
||||
this->setValue(paramName,rp->value().getPoint3f());
|
||||
if(gla_curr) // if we have a connection to the current glarea we can setup the additional button for getting the current view direction.
|
||||
{
|
||||
QStringList names;
|
||||
names << "View Dir.";
|
||||
names << "Raster Camera Dir.";
|
||||
|
||||
getPoint3Combo = new QComboBox(this);
|
||||
getPoint3Combo->addItems(names);
|
||||
vlay->addWidget(getPoint3Combo);
|
||||
|
||||
//connect(getPoint3Combo,SIGNAL(currentIndexChanged(int)),this,SLOT(getPoint()));
|
||||
connect(gla_curr,SIGNAL(transmitViewDir(QString,Point3m)),this,SLOT(setValue(QString,Point3m)));
|
||||
connect(gla_curr,SIGNAL(transmitShot(QString,Shotm)),this,SLOT(setShotValue(QString,Shotm)));
|
||||
connect(this,SIGNAL(askViewDir(QString)),gla_curr,SLOT(sendViewDir(QString)));
|
||||
connect(this,SIGNAL(askCameraDir(QString)),gla_curr,SLOT(sendRasterShot(QString)));
|
||||
|
||||
getPoint3Button = new QPushButton("Get",this);
|
||||
getPoint3Button->setMaximumWidth(getPoint3Button->sizeHint().width()/2);
|
||||
|
||||
getPoint3Button->setFlat(true);
|
||||
getPoint3Button->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred);
|
||||
connect(getPoint3Button,SIGNAL(clicked()),this,SLOT(getPoint()));
|
||||
|
||||
vlay->addWidget(getPoint3Button);
|
||||
}
|
||||
}
|
||||
|
||||
DirectionWidget::~DirectionWidget()
|
||||
{
|
||||
//qDebug("Deallocating a point3fwidget");
|
||||
this->disconnect();
|
||||
}
|
||||
|
||||
void DirectionWidget::getPoint()
|
||||
{
|
||||
int index = getPoint3Combo->currentIndex();
|
||||
switch(index)
|
||||
{
|
||||
case 0:
|
||||
emit askViewDir(paramName);
|
||||
break;
|
||||
case 1:
|
||||
emit askCameraDir(paramName);
|
||||
break;
|
||||
|
||||
default : assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
void DirectionWidget::setValue(QString name,Point3m newVal)
|
||||
{
|
||||
if(name==paramName)
|
||||
{
|
||||
for(int i =0;i<3;++i)
|
||||
coordSB[i]->setText(QString::number(newVal[i],'g',4));
|
||||
}
|
||||
}
|
||||
|
||||
void DirectionWidget::setShotValue(QString name, Shotm newValShot)
|
||||
{
|
||||
vcg::Point3f p = newValShot.GetViewDir();
|
||||
setValue(name,p);
|
||||
}
|
||||
|
||||
vcg::Point3f DirectionWidget::getValue()
|
||||
{
|
||||
return vcg::Point3f(coordSB[0]->text().toFloat(),coordSB[1]->text().toFloat(),coordSB[2]->text().toFloat());
|
||||
}
|
||||
|
||||
void DirectionWidget::collectWidgetValue()
|
||||
{
|
||||
rp->setValue(Point3fValue(vcg::Point3f(coordSB[0]->text().toFloat(),coordSB[1]->text().toFloat(),coordSB[2]->text().toFloat())));
|
||||
}
|
||||
|
||||
void DirectionWidget::resetWidgetValue()
|
||||
{
|
||||
for(unsigned int ii = 0; ii < 3;++ii)
|
||||
coordSB[ii]->setText(QString::number(rp->value().getPoint3f()[ii],'g',3));
|
||||
}
|
||||
|
||||
void DirectionWidget::setWidgetValue( const Value& nv )
|
||||
{
|
||||
for(unsigned int ii = 0; ii < 3;++ii)
|
||||
coordSB[ii]->setText(QString::number(nv.getPoint3f()[ii],'g',3));
|
||||
}
|
||||
|
||||
void DirectionWidget::addWidgetToGridLayout( QGridLayout* lay,const int r )
|
||||
{
|
||||
if (lay != NULL)
|
||||
{
|
||||
|
||||
@ -196,12 +196,12 @@ protected:
|
||||
QGridLayout* vlay;
|
||||
};
|
||||
|
||||
class Point3fWidget : public RichParameterWidget
|
||||
class PositionWidget : public RichParameterWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Point3fWidget(QWidget *p, const RichPoint3f& rpf, const RichPoint3f& rdef, QWidget *gla);
|
||||
~Point3fWidget();
|
||||
PositionWidget(QWidget *p, const RichPosition& rpf, const RichPosition& rdef, QWidget *gla);
|
||||
~PositionWidget();
|
||||
QString paramName;
|
||||
vcg::Point3f getValue();
|
||||
|
||||
@ -215,7 +215,6 @@ public:
|
||||
void setValue(QString name, Point3m val);
|
||||
void setShotValue(QString name, Shotm val);
|
||||
signals:
|
||||
void askViewDir(QString);
|
||||
void askViewPos(QString);
|
||||
void askSurfacePos(QString);
|
||||
void askCameraPos(QString);
|
||||
@ -229,6 +228,36 @@ protected:
|
||||
QHBoxLayout* vlay;
|
||||
};
|
||||
|
||||
class DirectionWidget : public RichParameterWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DirectionWidget(QWidget *p, const RichDirection& rpf, const RichDirection& rdef, QWidget *gla);
|
||||
~DirectionWidget();
|
||||
QString paramName;
|
||||
vcg::Point3f getValue();
|
||||
|
||||
void addWidgetToGridLayout(QGridLayout* lay,const int r);
|
||||
void collectWidgetValue();
|
||||
void resetWidgetValue();
|
||||
void setWidgetValue(const Value& nv);
|
||||
|
||||
public slots:
|
||||
void getPoint();
|
||||
void setValue(QString name, Point3m val);
|
||||
void setShotValue(QString name, Shotm val);
|
||||
signals:
|
||||
void askViewDir(QString);
|
||||
void askCameraDir(QString);
|
||||
|
||||
protected:
|
||||
QLineEdit * coordSB[3];
|
||||
QComboBox *getPoint3Combo;
|
||||
QPushButton *getPoint3Button;
|
||||
QLabel* descLab;
|
||||
QHBoxLayout* vlay;
|
||||
};
|
||||
|
||||
class Matrix44fWidget : public RichParameterWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -135,7 +135,7 @@ RichParameterList AmbientOcclusionPlugin::initParameterList(const QAction *actio
|
||||
" - 1 means that all the light cames from the specified cone of directions <br>"
|
||||
" - other values mix the two set of lighting directions "));
|
||||
parlst.addParam(RichInt ("reqViews",AMBOCC_DEFAULT_NUM_VIEWS,"Requested views", "Number of different views uniformly placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
|
||||
parlst.addParam(RichPoint3f("coneDir",Point3m(0,1,0),"Lighting Direction", "Number of different views placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
|
||||
parlst.addParam(RichDirection("coneDir",Point3m(0,1,0),"Lighting Direction", "Number of different views placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
|
||||
parlst.addParam(RichFloat("coneAngle",30,"Cone amplitude", "Number of different views uniformly placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
|
||||
parlst.addParam(RichBool("useGPU",AMBOCC_USEGPU_BY_DEFAULT,"Use GPU acceleration","Only works for per-vertex AO. In order to use GPU-Mode, your hardware must support FBOs, FP32 Textures and Shaders. Normally increases the performance by a factor of 4x-5x"));
|
||||
//parlst.addParam(RichBool("useVBO",AMBOCC_USEVBO_BY_DEFAULT,"Use VBO if supported","By using VBO, Meshlab loads all the vertex structure in the VRam, greatly increasing rendering speed (for both CPU and GPU mode). Disable it if problem occurs"));
|
||||
|
||||
@ -112,8 +112,8 @@ RichParameterList FilterCameraPlugin::initParameterList(const QAction *action, c
|
||||
rotCenter.push_back("custom point");
|
||||
parlst.addParam(RichEnum("rotCenter", 0, rotCenter, tr("Center of rotation:"), tr("Choose a method")));
|
||||
parlst.addParam(RichDynamicFloat("angle",0,-360,360,"Rotation Angle","Angle of rotation (in <b>degree</b>). If snapping is enabled this value is rounded according to the snap value"));
|
||||
parlst.addParam(RichPoint3f("customAxis",Point3m(0,0,0),"Custom axis","This rotation axis is used only if the 'custom axis' option is chosen."));
|
||||
parlst.addParam(RichPoint3f("customCenter",Point3m(0,0,0),"Custom center","This rotation center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichDirection("customAxis",Point3m(0,0,0),"Custom axis","This rotation axis is used only if the 'custom axis' option is chosen."));
|
||||
parlst.addParam(RichPosition("customCenter",Point3m(0,0,0),"Custom center","This rotation center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichBool ("toallRaster", false, "Apply to all active Raster layers", "Apply the same scaling to all the active Raster layers: it is taken into account only if 'Raster Camera' is selected"));
|
||||
parlst.addParam(RichBool ("toall", false, "Apply to all active Raster and visible Mesh layers", "Apply the same scaling to all the layers, including any visible 3D layer"));
|
||||
}
|
||||
@ -129,7 +129,7 @@ RichParameterList FilterCameraPlugin::initParameterList(const QAction *action, c
|
||||
scaleCenter.push_back("camera viewpoint");
|
||||
scaleCenter.push_back("custom point");
|
||||
parlst.addParam(RichEnum("scaleCenter", 0, scaleCenter, tr("Center of scaling:"), tr("Choose a method")));
|
||||
parlst.addParam(RichPoint3f("customCenter",Point3m(0,0,0),"Custom center","This scaling center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichPosition("customCenter",Point3m(0,0,0),"Custom center","This scaling center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichFloat("scale", 1.0, "Scale factor", "The scale factor that has to be applied to the camera"));
|
||||
parlst.addParam(RichBool ("toallRaster", false, "Apply to all active Raster layers", "Apply the same scaling to all the active Raster layers: it is taken into account only if 'Raster Camera' is selected"));
|
||||
parlst.addParam(RichBool ("toall", false, "Apply to all active Raster and visible Mesh layers", "Apply the same scaling to all the layers, including any visible 3D layer"));
|
||||
|
||||
@ -281,7 +281,7 @@ RichParameterList FilterColorProc::initParameterList(const QAction *a, const Mes
|
||||
par.addParam(RichColor("color1", color1, "Color 1:", "Sets the first color to mix with Perlin Noise function."));
|
||||
par.addParam(RichColor("color2", color2, "Color 2:", "Sets the second color to mix with Perlin Noise function."));
|
||||
par.addParam(RichDynamicFloat("freq", 10.0f, 0.1f, 100.0f,"Frequency:","Frequency of the Perlin Noise function, expressed as multiples of mesh bbox (frequency 10 means a noise period of bbox diagonal / 10). High frequencies produces many small splashes of colours, while low frequencies produces few big splashes."));
|
||||
par.addParam(RichPoint3f("offset", Point3f(0.0f, 0.0f, 0.0f), "Offset", "This values is the XYZ frequency offset of the Noise function (offset 1 means 1 period shift)."));
|
||||
par.addParam(RichPosition("offset", Point3f(0.0f, 0.0f, 0.0f), "Offset", "This values is the XYZ frequency offset of the Noise function (offset 1 means 1 period shift)."));
|
||||
par.addParam(RichBool("onSelected", false, "Only on selection", "If checked, only affects selected vertices"));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ RichParameterList FilterDirt::initParameterList(const QAction* filter, const Mes
|
||||
switch(ID(filter)){
|
||||
|
||||
case FP_DIRT:{
|
||||
par.addParam(RichPoint3f("dust_dir", Point3m(0, 1, 0), "Direction", "Direction of the dust source"));
|
||||
par.addParam(RichDirection("dust_dir", Point3m(0, 1, 0), "Direction", "Direction of the dust source"));
|
||||
par.addParam(RichInt("nparticles", 3, "max particles x face", "Max Number of Dust Particles to Generate Per Face"));
|
||||
par.addParam(RichFloat("slippiness", 1.0f, "s", "The surface slippines(large s means less sticky)"));
|
||||
par.addParam(RichFloat("adhesion", 0.2f, "k", "Factor to model the general adhesion"));
|
||||
@ -114,8 +114,8 @@ RichParameterList FilterDirt::initParameterList(const QAction* filter, const Mes
|
||||
break;
|
||||
}
|
||||
case FP_CLOUD_MOVEMENT:{
|
||||
par.addParam(RichPoint3f("gravity_dir", Point3m(0, -1, 0), "g", "Direction of gravity"));
|
||||
par.addParam(RichPoint3f("force_dir", Point3m(0, 0, 0), "force", "Direction of the force acting on the points cloud"));
|
||||
par.addParam(RichDirection("gravity_dir", Point3m(0, -1, 0), "g", "Direction of gravity"));
|
||||
par.addParam(RichDirection("force_dir", Point3m(0, 0, 0), "force", "Direction of the force acting on the points cloud"));
|
||||
par.addParam(RichInt("steps", 1, "s", "Simulation Steps"));
|
||||
par.addParam(RichDynamicFloat("adhesion", 1.0f, 0.0f, 1.0f, "adhesion", "Factor to model the general adhesion."));
|
||||
par.addParam(RichFloat("velocity", 0, "v", "Initial velocity of the particle"));
|
||||
|
||||
@ -238,7 +238,7 @@ RichParameterList FilterGeodesic::initParameterList(const QAction *action, const
|
||||
switch(ID(action))
|
||||
{
|
||||
case FP_QUALITY_POINT_GEODESIC :
|
||||
parlst.addParam(RichPoint3f("startPoint",m.cm.bbox.min,"Starting point","The starting point from which geodesic distance has to be computed. If it is not a surface vertex, the closest vertex to the specified point is used as starting seed point."));
|
||||
parlst.addParam(RichPosition("startPoint",m.cm.bbox.min,"Starting point","The starting point from which geodesic distance has to be computed. If it is not a surface vertex, the closest vertex to the specified point is used as starting seed point."));
|
||||
parlst.addParam(RichAbsPerc("maxDistance",m.cm.bbox.Diag(),0,m.cm.bbox.Diag()*2,"Max Distance","If not zero it indicates a cut off value to be used during geodesic distance computation."));
|
||||
break;
|
||||
case FP_QUALITY_SELECTED_GEODESIC :
|
||||
|
||||
@ -261,7 +261,7 @@ RichParameterList FilterIONXSPlugin::nxsParameters() const
|
||||
params.addParam(RichInt("skiplevels", 0, "Skip levels",
|
||||
"Decimation skipped for n levels. Use for meshes with large textures "
|
||||
"and very few vertices."));
|
||||
params.addParam(RichPoint3f("origin", Point3m(0,0,0), "Origin", "new origin for the model"));
|
||||
params.addParam(RichPosition("origin", Point3m(0,0,0), "Origin", "new origin for the model"));
|
||||
params.addParam(RichBool("center", false, "Center", "Set origin in the bounding box center", true));
|
||||
params.addParam(RichBool("pow_2_textures", false, "Pow 2 textures", "Create textures to be power of 2", true));
|
||||
params.addParam(RichBool("deepzoom", false, "Deepzoom",
|
||||
|
||||
@ -534,8 +534,8 @@ RichParameterList ExtraMeshFilterPlugin::initParameterList(const QAction * actio
|
||||
rotCenter.push_back("custom point");
|
||||
parlst.addParam(RichEnum("rotCenter", 0, rotCenter, tr("Center of rotation:"), tr("Choose a method")));
|
||||
parlst.addParam(RichDynamicFloat("angle",0,-360,360,"Rotation Angle","Angle of rotation (in <b>degree</b>). If snapping is enabled this value is rounded according to the snap value"));
|
||||
parlst.addParam(RichPoint3f("customAxis",Point3f(0,0,0),"Custom axis","This rotation axis is used only if the 'custom axis' option is chosen."));
|
||||
parlst.addParam(RichPoint3f("customCenter",Point3f(0,0,0),"Custom center","This rotation center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichDirection("customAxis",Point3f(0,0,0),"Custom axis","This rotation axis is used only if the 'custom axis' option is chosen."));
|
||||
parlst.addParam(RichPosition("customCenter",Point3f(0,0,0),"Custom center","This rotation center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichBool("snapFlag", false, "Snap angle", "If selected, before starting the filter will remove any unreferenced vertex (for which curvature values are not defined)"));
|
||||
parlst.addParam(RichFloat("snapAngle",30,"Snapping Value","This value is used to snap the rotation angle (i.e. if the snapping value is 30, 227 becomes 210)."));
|
||||
parlst.addParam(RichBool ("Freeze",true,"Freeze Matrix","The transformation is explicitly applied, and the vertex coordinates are actually changed"));
|
||||
@ -561,7 +561,7 @@ RichParameterList ExtraMeshFilterPlugin::initParameterList(const QAction * actio
|
||||
parlst.addParam(RichDynamicFloat("axisX",0,-5.0*bb.Diag(),5.0*bb.Diag(),"X Axis","when using [XYZ translation], amount of translation along the X axis (in model units)"));
|
||||
parlst.addParam(RichDynamicFloat("axisY",0,-5.0*bb.Diag(),5.0*bb.Diag(),"Y Axis","when using [XYZ translation], amount of translation along the Y axis (in model units)"));
|
||||
parlst.addParam(RichDynamicFloat("axisZ",0,-5.0*bb.Diag(),5.0*bb.Diag(),"Z Axis","when using [XYZ translation], amount of translation along the Z axis (in model units)"));
|
||||
parlst.addParam(RichPoint3f("newOrigin", Point3f(0, 0, 0), "New Origin:", "when using [Set new Origin], this is the location of the new Origin."));
|
||||
parlst.addParam(RichPosition("newOrigin", Point3f(0, 0, 0), "New Origin:", "when using [Set new Origin], this is the location of the new Origin."));
|
||||
parlst.addParam(RichBool ("Freeze",true,"Freeze Matrix","The transformation is explicitly applied, and the vertex coordinates are actually changed"));
|
||||
parlst.addParam(RichBool ("allLayers",false,"Apply to all visible Layers","If selected the filter will be applied to all visible mesh layers"));
|
||||
}
|
||||
@ -578,7 +578,7 @@ RichParameterList ExtraMeshFilterPlugin::initParameterList(const QAction * actio
|
||||
scaleCenter.push_back("barycenter");
|
||||
scaleCenter.push_back("custom point");
|
||||
parlst.addParam(RichEnum("scaleCenter", 0, scaleCenter, tr("Center of scaling:"), tr("Choose a method")));
|
||||
parlst.addParam(RichPoint3f("customCenter",Point3f(0,0,0),"Custom center","This scaling center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichPosition("customCenter",Point3f(0,0,0),"Custom center","This scaling center is used only if the 'custom point' option is chosen."));
|
||||
parlst.addParam(RichBool("unitFlag",false,"Scale to Unit bbox","If selected, the object is scaled to a box whose sides are at most 1 unit length"));
|
||||
parlst.addParam(RichBool ("Freeze",true,"Freeze Matrix","The transformation is explicitly applied, and the vertex coordinates are actually changed"));
|
||||
parlst.addParam(RichBool ("allLayers",false,"Apply to all visible Layers","If selected the filter will be applied to all visible mesh layers"));
|
||||
@ -599,7 +599,7 @@ RichParameterList ExtraMeshFilterPlugin::initParameterList(const QAction * actio
|
||||
parlst.addParam(RichInt ("K",(int)10,"Neighbour num","The number of neighbors used to estimate normals."));
|
||||
parlst.addParam(RichInt ("smoothIter",0,"Smooth Iteration","The number of smoothing iteration done on the p used to estimate and propagate normals."));
|
||||
parlst.addParam(RichBool("flipFlag",false,"Flip normals w.r.t. viewpoint","If the 'viewpoint' (i.e. scanner position) is known, it can be used to disambiguate normals orientation, so that all the normals will be oriented in the same direction."));
|
||||
parlst.addParam(RichPoint3f("viewPos",m.cm.shot.Extrinsics.Tra(),"Viewpoint Pos.","The viewpoint position can be set by hand (i.e. getting the current viewpoint) or it can be retrieved from mesh camera, if the viewpoint position is stored there."));
|
||||
parlst.addParam(RichDirection("viewPos",m.cm.shot.Extrinsics.Tra(),"Viewpoint Pos.","The viewpoint position can be set by hand (i.e. getting the current viewpoint) or it can be retrieved from mesh camera, if the viewpoint position is stored there."));
|
||||
break;
|
||||
|
||||
case FP_NORMAL_SMOOTH_POINTCLOUD:
|
||||
@ -625,7 +625,7 @@ RichParameterList ExtraMeshFilterPlugin::initParameterList(const QAction * actio
|
||||
{
|
||||
QStringList axis = QStringList() <<"X Axis"<<"Y Axis"<<"Z Axis"<<"Custom Axis";
|
||||
parlst.addParam(RichEnum ("planeAxis", 0, axis, tr("Plane perpendicular to"), tr("The Slicing plane will be done perpendicular to the axis")));
|
||||
parlst.addParam(RichPoint3f("customAxis",Point3f(0,1,0),"Custom axis","Specify a custom axis, this is only valid if the above parameter is set to Custom"));
|
||||
parlst.addParam(RichDirection("customAxis",Point3f(0,1,0),"Custom axis","Specify a custom axis, this is only valid if the above parameter is set to Custom"));
|
||||
parlst.addParam(RichFloat ("planeOffset", 0.0, "Cross plane offset", "Specify an offset of the cross-plane. The offset corresponds to the distance from the point specified in the plane reference parameter. By default (Cross plane offset == 0)"));
|
||||
parlst.addParam(RichEnum ("relativeTo",2,QStringList()<<"Bounding box center"<<"Bounding box min"<<"Origin","plane reference","Specify the reference from which the planes are shifted"));
|
||||
parlst.addParam(RichBool("createSectionSurface",false,"Create also section surface","If selected, in addition to a layer with the section polyline, it will be created also a layer with a triangulated version of the section polyline. This only works if the section polyline is closed"));
|
||||
|
||||
@ -182,7 +182,7 @@ RichParameterList QhullPlugin::initParameterList(const QAction *action,const Mes
|
||||
false,
|
||||
"Use ViewPoint from Mesh Camera",
|
||||
"Uses the ViewPoint from the camera associated to the current mesh\n if there is no camera, an error occurs"));
|
||||
parlst.addParam(RichPoint3f("viewpoint",
|
||||
parlst.addParam(RichDirection("viewpoint",
|
||||
Point3f(0.0f, 0.0f, 0.0f),
|
||||
"ViewPoint",
|
||||
"if UseCamera is true, this value is ignored"));
|
||||
|
||||
@ -211,7 +211,7 @@ RichParameterList SelectionFilterPlugin::initParameterList(const QAction *action
|
||||
{
|
||||
parlst.addParam(RichDynamicFloat("anglelimit", 75.0f, 0.0f, 180.0f, "angle threshold (deg)", "faces with normal at higher angle w.r.t. the view direction are selected"));
|
||||
parlst.addParam(RichBool ("usecamera", false, "Use ViewPoint from Mesh Camera", "Uses the ViewPoint from the camera associated to the current mesh\n if there is no camera, an error occurs"));
|
||||
parlst.addParam(RichPoint3f("viewpoint", Point3f(0.0f, 0.0f, 0.0f), "ViewPoint", "if UseCamera is true, this value is ignored"));
|
||||
parlst.addParam(RichDirection("viewpoint", Point3f(0.0f, 0.0f, 0.0f), "ViewPoint", "if UseCamera is true, this value is ignored"));
|
||||
} break;
|
||||
|
||||
case FP_SELECT_UGLY :
|
||||
|
||||
@ -359,7 +359,7 @@ RichParameterList FilterUnsharp::initParameterList(const QAction *action, const
|
||||
break;
|
||||
case FP_DEPTH_SMOOTH:
|
||||
parlst.addParam(RichInt ("stepSmoothNum", (int) 3,"Smoothing steps", "The number of times that the whole algorithm (normal smoothing + vertex fitting) is iterated."));
|
||||
parlst.addParam(RichPoint3f ("viewPoint", Point3f(0,0,0),"Viewpoint", "The position of the view point that is used to get the constraint direction."));
|
||||
parlst.addParam(RichDirection ("viewPoint", Point3f(0,0,0),"Viewpoint", "The position of the view point that is used to get the constraint direction."));
|
||||
parlst.addParam(RichAbsPerc ("delta", 1.0, 0, 1.0, "Strength", "How much smoothing is applied: 0 (no smooth) e 1 (full smooth)"));
|
||||
parlst.addParam(RichBool ("Selected",md.mm()->cm.sfn>0,"Affect only selection","If checked the filter is performed only on the selected area"));
|
||||
break;
|
||||
@ -369,7 +369,7 @@ RichParameterList FilterUnsharp::initParameterList(const QAction *action, const
|
||||
tr("Step:"),
|
||||
tr("The purpose of this filter is to <b>constrain</b> any smoothing algorithm to moving vertices only along a give line of sight.<br> First you should store current vertex position, than after applying one of the many smoothing algorithms you should re start this filter and blend the original positions with the smoothed results.<br>"
|
||||
"Given a view point <i>vp</i> , the smoothed vertex position <i>vs</i> and the original position <i>v</i>, The new vertex position is computed as the projection of <i>vs</i> on the line connecting <i>v</i> and <i>vp</i>.")));
|
||||
parlst.addParam(RichPoint3f ("viewPoint", Point3f(0,0,0),"Viewpoint", "The position of the view point that is used to get the constraint direction."));
|
||||
parlst.addParam(RichDirection ("viewPoint", Point3f(0,0,0),"Viewpoint", "The position of the view point that is used to get the constraint direction."));
|
||||
parlst.addParam(RichBool ("Selected",md.mm()->cm.sfn>0,"Affect only selected faces","If checked the filter is performed only on the selected faces"));
|
||||
break;
|
||||
case FP_TAUBIN_SMOOTH:
|
||||
@ -397,8 +397,8 @@ RichParameterList FilterUnsharp::initParameterList(const QAction *action, const
|
||||
}
|
||||
break;
|
||||
case FP_SCALAR_HARMONIC_FIELD:
|
||||
parlst.addParam(RichPoint3f("point1", md.mm()->cm.bbox.min, "Point 1", "A vertex on the mesh that represent one harmonic field boundary condition."));
|
||||
parlst.addParam(RichPoint3f("point2", md.mm()->cm.bbox.max, "Point 2", "A vertex on the mesh that represent one harmonic field boundary condition."));
|
||||
parlst.addParam(RichPosition("point1", md.mm()->cm.bbox.min, "Point 1", "A vertex on the mesh that represent one harmonic field boundary condition."));
|
||||
parlst.addParam(RichPosition("point2", md.mm()->cm.bbox.max, "Point 2", "A vertex on the mesh that represent one harmonic field boundary condition."));
|
||||
parlst.addParam(RichDynamicFloat("value1", 0.0f, 0.0f, 1.0f, "value for the 1st point", "Harmonic field value for the vertex."));
|
||||
parlst.addParam(RichDynamicFloat("value2", 1.0f, 0.0f, 1.0f, "value for the 2nd point", "Harmonic field value for the vertex."));
|
||||
parlst.addParam(RichBool("colorize", true, "Colorize", "Colorize the mesh to provide an indication of the obtained harmonic field."));
|
||||
|
||||
@ -189,9 +189,9 @@ RichParameterList U3DIOPlugin::initSaveParameter(const QString &, const MeshMode
|
||||
m.cm.bbox.Center(),m.cm.bbox.Diag());
|
||||
Point3m pos = _param._campar->_obj_pos;
|
||||
Point3m dir(0.0f,0.0f,-1.0f * _param._campar->_obj_bbox_diag);
|
||||
par.addParam(RichPoint3f("position_val",dir, "Camera Position",
|
||||
par.addParam(RichPosition("position_val",dir, "Camera Position",
|
||||
"The position in which the camera is set. The default value is derived by the 3d mesh's bounding box."));
|
||||
par.addParam(RichPoint3f("target_val",pos, "Camera target point",
|
||||
par.addParam(RichDirection("target_val",pos, "Camera target point",
|
||||
"The point towards the camera is seeing. The default value is derived by the 3d mesh's bounding box."));
|
||||
par.addParam(RichFloat("fov_val",60.0f,
|
||||
"Camera's FOV Angle 0..180","Camera's FOV Angle. The values' range is between 0-180 degree. The default value is 60."));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user