mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-15 09:04:36 +00:00
using Scalarm instead of MESHLAB_SCALAR
This commit is contained in:
parent
cd68ca846c
commit
0fcd65d86d
@ -30,28 +30,28 @@ namespace vcg
|
||||
{
|
||||
namespace vertex
|
||||
{
|
||||
template <class T> class Coord3m: public Coord<vcg::Point3<MESHLAB_SCALAR>, T> {
|
||||
template <class T> class Coord3m: public Coord<vcg::Point3<Scalarm>, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Coord3m"));T::Name(name);}
|
||||
};
|
||||
|
||||
template <class T> class Normal3m: public Normal<vcg::Point3<MESHLAB_SCALAR>, T> {
|
||||
template <class T> class Normal3m: public Normal<vcg::Point3<Scalarm>, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Normal3m"));T::Name(name);}
|
||||
};
|
||||
|
||||
template <class T> class Qualitym: public Quality<MESHLAB_SCALAR, T> {
|
||||
template <class T> class Qualitym: public Quality<Scalarm, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Qualitym"));T::Name(name);}
|
||||
};
|
||||
|
||||
template <class T> class CurvaturemOcf: public CurvatureOcf<MESHLAB_SCALAR, T> {
|
||||
template <class T> class CurvaturemOcf: public CurvatureOcf<Scalarm, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("CurvaturemOcf"));T::Name(name);}
|
||||
};
|
||||
|
||||
|
||||
template <class T> class CurvatureDirmOcf: public CurvatureDirOcf<CurvatureDirTypeOcf<MESHLAB_SCALAR>, T> {
|
||||
template <class T> class CurvatureDirmOcf: public CurvatureDirOcf<CurvatureDirTypeOcf<Scalarm>, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("CurvatureDirmOcf"));T::Name(name);}
|
||||
};
|
||||
|
||||
template <class T> class RadiusmOcf: public RadiusOcf<MESHLAB_SCALAR, T> {
|
||||
template <class T> class RadiusmOcf: public RadiusOcf<Scalarm, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("RadiusmOcf"));T::Name(name);}
|
||||
};
|
||||
|
||||
@ -59,15 +59,15 @@ public: static void Name(std::vector<std::string> & name){name.push_back(std::st
|
||||
|
||||
namespace face
|
||||
{
|
||||
template <class T> class Normal3m: public NormalAbs<vcg::Point3<MESHLAB_SCALAR>, T> {
|
||||
template <class T> class Normal3m: public NormalAbs<vcg::Point3<Scalarm>, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("Normal3m"));T::Name(name);}
|
||||
};
|
||||
|
||||
template <class T> class QualitymOcf: public QualityOcf<MESHLAB_SCALAR, T> {
|
||||
template <class T> class QualitymOcf: public QualityOcf<Scalarm, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("QualitymOcf"));T::Name(name);}
|
||||
};
|
||||
|
||||
template <class T> class CurvatureDirmOcf: public CurvatureDirOcf<CurvatureDirOcfBaseType<MESHLAB_SCALAR>, T> {
|
||||
template <class T> class CurvatureDirmOcf: public CurvatureDirOcf<CurvatureDirOcfBaseType<Scalarm>, T> {
|
||||
public: static void Name(std::vector<std::string> & name){name.push_back(std::string("CurvatureDirdOcf"));T::Name(name);}
|
||||
};
|
||||
|
||||
|
||||
@ -200,17 +200,17 @@ struct MLPerViewGLOptions : public vcg::RenderingModalityGLOptions
|
||||
_perpoint_pointattenuation_enabled = bset[31];
|
||||
}
|
||||
|
||||
static MESHLAB_SCALAR minPointSize()
|
||||
static Scalarm minPointSize()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
static MESHLAB_SCALAR maxPointSize()
|
||||
static Scalarm maxPointSize()
|
||||
{
|
||||
return 15.0;
|
||||
}
|
||||
|
||||
static MESHLAB_SCALAR maxLineWidth()
|
||||
static Scalarm maxLineWidth()
|
||||
{
|
||||
return 5.0;
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ public:
|
||||
#endif
|
||||
static const QString appName(){return tr("MeshLab"); }
|
||||
static const QString architecturalSuffix(const HW_ARCHITECTURE hw) {return "_" + QString::number(int(hw)) + "bit";}
|
||||
static const QString appArchitecturalName(const HW_ARCHITECTURE hw) {return appName() + architecturalSuffix(hw) + "_" + MeshLabScalarTest<MESHLAB_SCALAR>::floatingPointPrecision();}
|
||||
static const QString appArchitecturalName(const HW_ARCHITECTURE hw) {return appName() + architecturalSuffix(hw) + "_" + MeshLabScalarTest<Scalarm>::floatingPointPrecision();}
|
||||
static const QString appVer();
|
||||
static const QString compilerVersion();
|
||||
static const QString qtVersion();
|
||||
|
||||
@ -156,7 +156,7 @@ bool RichInt::operator==( const RichParameter& rb )
|
||||
|
||||
RichFloat::RichFloat(
|
||||
const QString& nm,
|
||||
const MESHLAB_SCALAR defval,
|
||||
const Scalarm defval,
|
||||
const QString& desc,
|
||||
const QString& tltip) :
|
||||
RichParameter(nm, FloatValue(defval),desc, tltip)
|
||||
@ -333,9 +333,9 @@ bool RichColor::operator==( const RichParameter& rb )
|
||||
|
||||
RichAbsPerc::RichAbsPerc(
|
||||
const QString& nm,
|
||||
const MESHLAB_SCALAR defval,
|
||||
const MESHLAB_SCALAR minval,
|
||||
const MESHLAB_SCALAR maxval,
|
||||
const Scalarm defval,
|
||||
const Scalarm minval,
|
||||
const Scalarm maxval,
|
||||
const QString& desc,
|
||||
const QString& tltip) :
|
||||
RichParameter(nm, AbsPercValue(defval), desc, tltip), min(minval), max(maxval)
|
||||
@ -413,9 +413,9 @@ bool RichEnum::operator==( const RichParameter& rb )
|
||||
|
||||
RichDynamicFloat::RichDynamicFloat(
|
||||
const QString& nm,
|
||||
const MESHLAB_SCALAR defval,
|
||||
const MESHLAB_SCALAR minval,
|
||||
const MESHLAB_SCALAR maxval,
|
||||
const Scalarm defval,
|
||||
const Scalarm minval,
|
||||
const Scalarm maxval,
|
||||
const QString& desc,
|
||||
const QString& tltip ) :
|
||||
RichParameter(nm, DynamicFloatValue(defval),desc, tltip), min(minval), max(maxval)
|
||||
@ -669,7 +669,7 @@ bool RichParameterAdapter::create( const QDomElement& np,RichParameter** par )
|
||||
Matrix44m mm;
|
||||
for(int i=0;i<16;++i)
|
||||
{
|
||||
MESHLAB_SCALAR val = np.attribute(QString("val")+QString::number(i)).toFloat(&corrconv);
|
||||
Scalarm val = np.attribute(QString("val")+QString::number(i)).toFloat(&corrconv);
|
||||
if (!corrconv)
|
||||
return false;
|
||||
mm.V()[i]=val;
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
class RichFloat : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichFloat(const QString& nm, const MESHLAB_SCALAR defval, const QString& desc = QString(), const QString& tltip = QString());
|
||||
RichFloat(const QString& nm, const Scalarm defval, const QString& desc = QString(), const QString& tltip = QString());
|
||||
~RichFloat();
|
||||
|
||||
QString stringType() const;
|
||||
@ -175,7 +175,7 @@ public:
|
||||
class RichAbsPerc : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichAbsPerc(const QString& nm, const MESHLAB_SCALAR defval, const MESHLAB_SCALAR minval, const MESHLAB_SCALAR maxval, const QString& desc = QString(), const QString& tltip = QString());
|
||||
RichAbsPerc(const QString& nm, const Scalarm defval, const Scalarm minval, const Scalarm maxval, const QString& desc = QString(), const QString& tltip = QString());
|
||||
~RichAbsPerc();
|
||||
|
||||
QString stringType() const;
|
||||
@ -183,8 +183,8 @@ public:
|
||||
|
||||
RichAbsPerc* clone() const;
|
||||
bool operator==(const RichParameter& rb);
|
||||
MESHLAB_SCALAR min;
|
||||
MESHLAB_SCALAR max;
|
||||
Scalarm min;
|
||||
Scalarm max;
|
||||
};
|
||||
|
||||
class RichEnum : public RichParameter
|
||||
@ -204,7 +204,7 @@ public:
|
||||
class RichDynamicFloat : public RichParameter
|
||||
{
|
||||
public:
|
||||
RichDynamicFloat(const QString& nm, const MESHLAB_SCALAR defval, const MESHLAB_SCALAR minval, const MESHLAB_SCALAR maxval, const QString& desc = QString(), const QString& tltip = QString());
|
||||
RichDynamicFloat(const QString& nm, const Scalarm defval, const Scalarm minval, const Scalarm maxval, const QString& desc = QString(), const QString& tltip = QString());
|
||||
~RichDynamicFloat();
|
||||
|
||||
QString stringType() const;
|
||||
@ -212,8 +212,8 @@ public:
|
||||
|
||||
RichDynamicFloat* clone() const;
|
||||
bool operator==(const RichParameter& rb);
|
||||
MESHLAB_SCALAR min;
|
||||
MESHLAB_SCALAR max;
|
||||
Scalarm min;
|
||||
Scalarm max;
|
||||
};
|
||||
|
||||
class RichOpenFile : public RichParameter
|
||||
|
||||
@ -90,7 +90,7 @@ int RichParameterList::getInt(const QString& name) const
|
||||
* @return the float of the RichParameter having the given name.
|
||||
* @throws an MLException if the name is not found in the list
|
||||
*/
|
||||
MESHLAB_SCALAR RichParameterList::getFloat(const QString& name) const
|
||||
Scalarm RichParameterList::getFloat(const QString& name) const
|
||||
{
|
||||
return getParameterByName(name).value().getFloat();
|
||||
}
|
||||
@ -144,16 +144,16 @@ Point3m RichParameterList::getPoint3m(const QString& name) const
|
||||
* @return the shot of the RichParameter having the given name.
|
||||
* @throws an MLException if the name is not found in the list
|
||||
*/
|
||||
Shot<MESHLAB_SCALAR> RichParameterList::getShotf(const QString& name) const
|
||||
Shot<Scalarm> RichParameterList::getShotf(const QString& name) const
|
||||
{
|
||||
return Shot<MESHLAB_SCALAR>::Construct(getParameterByName(name).value().getShotf());
|
||||
return Shot<Scalarm>::Construct(getParameterByName(name).value().getShotf());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the float of the RichParameter having the given name.
|
||||
* @throws an MLException if the name is not found in the list
|
||||
*/
|
||||
MESHLAB_SCALAR RichParameterList::getAbsPerc(const QString& name) const
|
||||
Scalarm RichParameterList::getAbsPerc(const QString& name) const
|
||||
{
|
||||
return getParameterByName(name).value().getAbsPerc();
|
||||
}
|
||||
@ -180,7 +180,7 @@ MeshModel * RichParameterList::getMesh(const QString& name) const
|
||||
* @return the float of the RichParameter having the given name.
|
||||
* @throws an MLException if the name is not found in the list
|
||||
*/
|
||||
MESHLAB_SCALAR RichParameterList::getDynamicFloat(const QString& name) const
|
||||
Scalarm RichParameterList::getDynamicFloat(const QString& name) const
|
||||
{
|
||||
return getParameterByName(name).value().getDynamicFloat();
|
||||
}
|
||||
|
||||
@ -99,17 +99,17 @@ public:
|
||||
|
||||
bool getBool(const QString& name) const;
|
||||
int getInt(const QString& name) const;
|
||||
MESHLAB_SCALAR getFloat(const QString& name) const;
|
||||
Scalarm getFloat(const QString& name) const;
|
||||
QString getString(const QString& name) const;
|
||||
Matrix44m getMatrix44(const QString& name) const;
|
||||
Point3m getPoint3m(const QString& name) const;
|
||||
Shotm getShotf(const QString& name) const;
|
||||
QColor getColor(const QString& name) const;
|
||||
vcg::Color4b getColor4b(const QString& name) const;
|
||||
MESHLAB_SCALAR getAbsPerc(const QString& name) const;
|
||||
Scalarm getAbsPerc(const QString& name) const;
|
||||
int getEnum(const QString& name) const;
|
||||
MeshModel* getMesh(const QString& name) const;
|
||||
MESHLAB_SCALAR getDynamicFloat(const QString& name) const;
|
||||
Scalarm getDynamicFloat(const QString& name) const;
|
||||
QString getOpenFileName(const QString& name) const;
|
||||
QString getSaveFileName(const QString& name) const;
|
||||
|
||||
|
||||
@ -45,16 +45,16 @@ public:
|
||||
|
||||
virtual bool getBool() const { assert(0); return bool(); }
|
||||
virtual int getInt() const { assert(0); return int(); }
|
||||
virtual MESHLAB_SCALAR getFloat() const { assert(0); return MESHLAB_SCALAR(); }
|
||||
virtual Scalarm getFloat() const { assert(0); return Scalarm(); }
|
||||
virtual QString getString() const { assert(0); return QString(); }
|
||||
virtual Matrix44m getMatrix44f() const { assert(0); return Matrix44m(); }
|
||||
virtual Point3m getPoint3f() const { assert(0); return Point3m(); }
|
||||
virtual Shotm getShotf() const { assert(0); return Shotm(); }
|
||||
virtual QColor getColor() const { assert(0); return QColor(); }
|
||||
virtual MESHLAB_SCALAR getAbsPerc() const { assert(0); return MESHLAB_SCALAR(); }
|
||||
virtual Scalarm getAbsPerc() const { assert(0); return Scalarm(); }
|
||||
virtual int getEnum() const { assert(0); return int(); }
|
||||
virtual MeshModel* getMesh() const { assert(0); return NULL; }
|
||||
virtual MESHLAB_SCALAR getDynamicFloat() const { assert(0); return MESHLAB_SCALAR(); }
|
||||
virtual Scalarm getDynamicFloat() const { assert(0); return Scalarm(); }
|
||||
virtual QString getFileName() const { assert(0); return QString(); }
|
||||
|
||||
virtual bool isBool() const { return false; }
|
||||
@ -117,7 +117,7 @@ public:
|
||||
FloatValue(const float val) :pval(val) {}
|
||||
~FloatValue() {}
|
||||
|
||||
inline MESHLAB_SCALAR getFloat() const { return pval; }
|
||||
inline Scalarm getFloat() const { return pval; }
|
||||
inline bool isFloat() const { return true; }
|
||||
inline QString typeName() const { return QString("Float"); }
|
||||
inline void set(const Value& p) { pval = p.getFloat(); }
|
||||
@ -125,7 +125,7 @@ public:
|
||||
void fillToXMLElement(QDomElement& element) const;
|
||||
|
||||
private:
|
||||
MESHLAB_SCALAR pval;
|
||||
Scalarm pval;
|
||||
};
|
||||
|
||||
class StringValue : public Value
|
||||
@ -220,7 +220,7 @@ public:
|
||||
AbsPercValue(const float val) :FloatValue(val) {}
|
||||
~AbsPercValue() {}
|
||||
|
||||
inline MESHLAB_SCALAR getAbsPerc() const { return getFloat(); }
|
||||
inline Scalarm getAbsPerc() const { return getFloat(); }
|
||||
inline QString typeName() const { return QString("AbsPerc"); }
|
||||
inline bool isAbsPerc() const { return true; }
|
||||
inline AbsPercValue* clone() const {return new AbsPercValue(*this);}
|
||||
@ -247,7 +247,7 @@ public:
|
||||
DynamicFloatValue(const float val) :FloatValue(val) {}
|
||||
~DynamicFloatValue() {}
|
||||
|
||||
inline MESHLAB_SCALAR getDynamicFloat() const { return getFloat(); }
|
||||
inline Scalarm getDynamicFloat() const { return getFloat(); }
|
||||
inline bool isDynamicFloat() const { return true; }
|
||||
inline QString typeName() const { return QString("DynamicFloat"); }
|
||||
inline DynamicFloatValue* clone() const {return new DynamicFloatValue(*this);}
|
||||
|
||||
@ -64,7 +64,7 @@ public:
|
||||
inline static QString pointDistanceAttenuationParam() {return "MeshLab::Appearance::pointDistanceAttenuation";}
|
||||
bool pointSmooth;
|
||||
inline static QString pointSmoothParam() {return "MeshLab::Appearance::pointSmooth";}
|
||||
MESHLAB_SCALAR pointSize;
|
||||
Scalarm pointSize;
|
||||
inline static QString pointSizeParam() {return "MeshLab::Appearance::pointSize";}
|
||||
bool wheelDirection;
|
||||
inline static QString wheelDirectionParam() {return "MeshLab::Appearance::wheelDirection";}
|
||||
|
||||
@ -675,7 +675,7 @@ void Matrix44fWidget::setValue(QString name, Matrix44m newVal)
|
||||
Matrix44m Matrix44fWidget::getValue()
|
||||
{
|
||||
if (!valid) {
|
||||
MESHLAB_SCALAR val[16];
|
||||
Scalarm val[16];
|
||||
for (unsigned int i = 0; i < 16; ++i)
|
||||
val[i] = coordSB[i]->text().toFloat();
|
||||
return Matrix44m(val);
|
||||
|
||||
@ -149,16 +149,16 @@ void DecorateBackgroundPlugin::decorateDoc(const QAction* a, MeshDocument &m, co
|
||||
{
|
||||
emit this->askViewerShot("backGrid");
|
||||
|
||||
MESHLAB_SCALAR scaleBB = parset->getFloat(BoxRatioParam());
|
||||
MESHLAB_SCALAR majorTick = fabs(parset->getFloat(GridMajorParam()));
|
||||
MESHLAB_SCALAR minorTick = fabs(parset->getFloat(GridMinorParam()));
|
||||
Scalarm scaleBB = parset->getFloat(BoxRatioParam());
|
||||
Scalarm majorTick = fabs(parset->getFloat(GridMajorParam()));
|
||||
Scalarm minorTick = fabs(parset->getFloat(GridMinorParam()));
|
||||
bool backFlag = parset->getBool(GridBackParam());
|
||||
bool shadowFlag = parset->getBool(ShowShadowParam());
|
||||
Color4b backColor = parset->getColor4b(GridColorBackParam());
|
||||
Color4b frontColor = parset->getColor4b(GridColorFrontParam());
|
||||
MESHLAB_SCALAR baseLineWidth = parset->getFloat(GridBaseLineWidthParam());
|
||||
Scalarm baseLineWidth = parset->getFloat(GridBaseLineWidthParam());
|
||||
Box3m bb = m.bbox();
|
||||
MESHLAB_SCALAR scalefactor = std::max(0.1, (scaleBB - 1.0));
|
||||
Scalarm scalefactor = std::max(0.1, (scaleBB - 1.0));
|
||||
bb.Offset((bb.max - bb.min)*(scalefactor/2.0));
|
||||
|
||||
// minortick should never be more than majortick
|
||||
|
||||
@ -184,13 +184,13 @@ void DecorateBasePlugin::decorateMesh(const QAction* a, MeshModel &m, const Rich
|
||||
case DP_SHOW_NORMALS:
|
||||
{
|
||||
glPushAttrib(GL_ENABLE_BIT );
|
||||
MESHLAB_SCALAR NormalLen=rm->getFloat(NormalLength());
|
||||
MESHLAB_SCALAR NormalWid = rm->getFloat(NormalWidth());
|
||||
Scalarm NormalLen=rm->getFloat(NormalLength());
|
||||
Scalarm NormalWid = rm->getFloat(NormalWidth());
|
||||
vcg::Color4b VertNormalColor = rm->getColor4b(NormalVertColor());
|
||||
vcg::Color4b FaceNormalColor = rm->getColor4b(NormalFaceColor());
|
||||
bool showselection = rm->getBool(NormalSelection());
|
||||
|
||||
MESHLAB_SCALAR LineLen = m.cm.bbox.Diag()*NormalLen;
|
||||
Scalarm LineLen = m.cm.bbox.Diag()*NormalLen;
|
||||
|
||||
//query line width range
|
||||
GLfloat widthRange[2];
|
||||
|
||||
@ -162,18 +162,18 @@ void AlignSet::resize(int max_side) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void AlignSet::renderScene(vcg::Shot<MESHLAB_SCALAR> &view, int component) {
|
||||
void AlignSet::renderScene(vcg::Shot<Scalarm> &view, int component) {
|
||||
QSize fbosize(wt,ht);
|
||||
QGLFramebufferObjectFormat frmt;
|
||||
frmt.setInternalTextureFormat(GL_RGBA);
|
||||
frmt.setAttachment(QGLFramebufferObject::Depth);
|
||||
QGLFramebufferObject fbo(fbosize,frmt);
|
||||
|
||||
MESHLAB_SCALAR _near, _far;
|
||||
Scalarm _near, _far;
|
||||
_near = 0.1f;
|
||||
_far = 10000.0f;
|
||||
Box3m bb=Box3m::Construct(mesh->bbox);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::GetNearFarPlanes(view, bb, _near, _far);
|
||||
GlShot< vcg::Shot<Scalarm> >::GetNearFarPlanes(view, bb, _near, _far);
|
||||
//assert(_near <= _far);
|
||||
if(_near <= 0) _near = 0.1f;
|
||||
if(_far < _near) _far = 1000.0f;
|
||||
@ -186,7 +186,7 @@ void AlignSet::renderScene(vcg::Shot<MESHLAB_SCALAR> &view, int component) {
|
||||
|
||||
glViewport(0, 0, wt, ht);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::SetView(shot, 0.5*_near, 2*_far);
|
||||
GlShot< vcg::Shot<Scalarm> >::SetView(shot, 0.5*_near, 2*_far);
|
||||
|
||||
// err = glGetError();
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ class AlignSet {
|
||||
CMeshO* mesh;
|
||||
QImage* image;
|
||||
double imageRatio;
|
||||
vcg::Shot<MESHLAB_SCALAR> shot;
|
||||
vcg::Shot<Scalarm> shot;
|
||||
vcg::Box3<float> box;
|
||||
std::vector<Correspondence> correspList; //List that includes corresponces involving the model
|
||||
double error; //alignment error in px
|
||||
@ -62,7 +62,7 @@ class AlignSet {
|
||||
bool setFocal(double f); //return false if unchanged
|
||||
void setPixelSizeMm(double ccdWidth);
|
||||
|
||||
void renderScene(vcg::Shot<MESHLAB_SCALAR>& shot, int component);
|
||||
void renderScene(vcg::Shot<Scalarm>& shot, int component);
|
||||
void readRender(int component);
|
||||
|
||||
void drawMeshPoints();
|
||||
|
||||
@ -149,9 +149,9 @@ bool AmbientOcclusionPlugin::applyFilter(const QAction * /*filter*/, MeshDocumen
|
||||
depthTexArea = depthTexSize*depthTexSize;
|
||||
numViews = par.getInt("reqViews");
|
||||
errInit = false;
|
||||
MESHLAB_SCALAR dirBias = par.getFloat("dirBias");
|
||||
Scalarm dirBias = par.getFloat("dirBias");
|
||||
Point3m coneDir = par.getPoint3m("coneDir");
|
||||
MESHLAB_SCALAR coneAngle = par.getFloat("coneAngle");
|
||||
Scalarm coneAngle = par.getFloat("coneAngle");
|
||||
|
||||
if(perFace)
|
||||
m.updateDataMask(MeshModel::MM_FACEQUALITY | MeshModel::MM_FACECOLOR);
|
||||
@ -159,10 +159,10 @@ bool AmbientOcclusionPlugin::applyFilter(const QAction * /*filter*/, MeshDocumen
|
||||
m.updateDataMask(MeshModel::MM_VERTQUALITY | MeshModel::MM_VERTCOLOR);
|
||||
|
||||
std::vector<Point3m> unifDirVec;
|
||||
GenNormal<MESHLAB_SCALAR>::Fibonacci(numViews,unifDirVec);
|
||||
GenNormal<Scalarm>::Fibonacci(numViews,unifDirVec);
|
||||
|
||||
std::vector<Point3m> coneDirVec;
|
||||
GenNormal<MESHLAB_SCALAR>::UniformCone(numViews, coneDirVec, math::ToRad(coneAngle), coneDir);
|
||||
GenNormal<Scalarm>::UniformCone(numViews, coneDirVec, math::ToRad(coneAngle), coneDir);
|
||||
|
||||
std::random_shuffle(unifDirVec.begin(),unifDirVec.end());
|
||||
std::random_shuffle(coneDirVec.begin(),coneDirVec.end());
|
||||
|
||||
@ -316,7 +316,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, st
|
||||
Point3m tranVec(0,0,0);
|
||||
Matrix44m trTran,trTranInv;
|
||||
|
||||
MESHLAB_SCALAR Scale= par.getFloat("scale");
|
||||
Scalarm Scale= par.getFloat("scale");
|
||||
trScale.SetScale(Scale,Scale,Scale);
|
||||
|
||||
switch(par.getEnum("scaleCenter"))
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
using namespace std;
|
||||
using namespace vcg;
|
||||
|
||||
int SnapVertexBorder(CMeshO &m, MESHLAB_SCALAR threshold,vcg::CallBackPos * cb);
|
||||
int SnapVertexBorder(CMeshO &m, Scalarm threshold,vcg::CallBackPos * cb);
|
||||
|
||||
CleanFilter::CleanFilter()
|
||||
{
|
||||
@ -274,9 +274,9 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
{
|
||||
case FP_BALL_PIVOTING:
|
||||
{
|
||||
MESHLAB_SCALAR Radius = par.getAbsPerc("BallRadius");
|
||||
MESHLAB_SCALAR Clustering = par.getFloat("Clustering") / 100.0f;
|
||||
MESHLAB_SCALAR CreaseThr = math::ToRad(par.getFloat("CreaseThr"));
|
||||
Scalarm Radius = par.getAbsPerc("BallRadius");
|
||||
Scalarm Clustering = par.getFloat("Clustering") / 100.0f;
|
||||
Scalarm CreaseThr = math::ToRad(par.getFloat("CreaseThr"));
|
||||
bool DeleteFaces = par.getBool("DeleteFaces");
|
||||
if(DeleteFaces)
|
||||
{
|
||||
@ -294,7 +294,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
|
||||
case FP_REMOVE_ISOLATED_DIAMETER:
|
||||
{
|
||||
MESHLAB_SCALAR minCC= par.getAbsPerc("MinComponentDiag");
|
||||
Scalarm minCC= par.getAbsPerc("MinComponentDiag");
|
||||
std::pair<int,int> delInfo= tri::Clean<CMeshO>::RemoveSmallConnectedComponentsDiameter(m.cm,minCC);
|
||||
log("Removed %i connected components out of %i", delInfo.second, delInfo.first);
|
||||
if (par.getBool("removeUnref"))
|
||||
@ -321,7 +321,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
{
|
||||
int deletedFN=0;
|
||||
int deletedVN=0;
|
||||
MESHLAB_SCALAR val=par.getAbsPerc("MaxQualityThr");
|
||||
Scalarm val=par.getAbsPerc("MaxQualityThr");
|
||||
CMeshO::VertexIterator vi;
|
||||
for(vi=m.cm.vert.begin();vi!=m.cm.vert.end();++vi)
|
||||
if(!(*vi).IsD() && (*vi).Q()<val)
|
||||
@ -345,7 +345,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
|
||||
case FP_REMOVE_TVERTEX_COLLAPSE :
|
||||
{
|
||||
MESHLAB_SCALAR threshold = par.getFloat("Threshold");
|
||||
Scalarm threshold = par.getFloat("Threshold");
|
||||
bool repeat = par.getBool("Repeat");
|
||||
int total = tri::Clean<CMeshO>::RemoveTVertexByCollapse(m.cm, threshold, repeat);
|
||||
log("Successfully removed %d t-vertices", total);
|
||||
@ -358,7 +358,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
errorMessage = "Non manifold mesh. Please clean the mesh first.";
|
||||
return false;
|
||||
}
|
||||
MESHLAB_SCALAR threshold = par.getFloat("Threshold");
|
||||
Scalarm threshold = par.getFloat("Threshold");
|
||||
bool repeat = par.getBool("Repeat");
|
||||
int total = tri::Clean<CMeshO>::RemoveTVertexByFlip(m.cm, threshold, repeat);
|
||||
log("Successfully removed %d t-vertices", total);
|
||||
@ -366,7 +366,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
|
||||
case FP_MERGE_WEDGE_TEX :
|
||||
{
|
||||
MESHLAB_SCALAR threshold = par.getFloat("MergeThr");
|
||||
Scalarm threshold = par.getFloat("MergeThr");
|
||||
tri::UpdateTopology<CMeshO>::VertexFace(m.cm);
|
||||
int total = tri::UpdateTexture<CMeshO>::WedgeTexMergeClose(m.cm, threshold);
|
||||
log("Successfully merged %d wedge tex coord distant less than %f", total,threshold);
|
||||
@ -409,7 +409,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
|
||||
case FP_REMOVE_NON_MANIF_VERT :
|
||||
{
|
||||
MESHLAB_SCALAR threshold = par.getFloat("VertDispRatio");
|
||||
Scalarm threshold = par.getFloat("VertDispRatio");
|
||||
int total = tri::Clean<CMeshO>::SplitNonManifoldVertex(m.cm,threshold);
|
||||
log("Successfully split %d non manifold vertices faces", total);
|
||||
m.UpdateBoxAndNormals();
|
||||
@ -440,7 +440,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
|
||||
case FP_SNAP_MISMATCHED_BORDER :
|
||||
{
|
||||
MESHLAB_SCALAR threshold = par.getFloat("EdgeDistRatio");
|
||||
Scalarm threshold = par.getFloat("EdgeDistRatio");
|
||||
int total = SnapVertexBorder(m.cm, threshold,cb);
|
||||
log("Successfully Split %d faces to snap", total);
|
||||
m.clearDataMask(MeshModel::MM_FACEFACETOPO);
|
||||
@ -463,7 +463,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, std::map<
|
||||
}
|
||||
|
||||
|
||||
int SnapVertexBorder(CMeshO &m, MESHLAB_SCALAR threshold, vcg::CallBackPos * cb)
|
||||
int SnapVertexBorder(CMeshO &m, Scalarm threshold, vcg::CallBackPos * cb)
|
||||
{
|
||||
tri::Allocator<CMeshO>::CompactEveryVector(m);
|
||||
|
||||
|
||||
@ -234,12 +234,12 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen
|
||||
{
|
||||
bool use_depth = par.getBool("usedepth");
|
||||
bool onselection = par.getBool("onselection");
|
||||
float eta = par.getFloat("deptheta");
|
||||
Scalarm eta = par.getFloat("deptheta");
|
||||
QColor blank = par.getColor("blankColor");
|
||||
|
||||
|
||||
float depth=0; // depth of point (distance from camera)
|
||||
float pdepth=0; // depth value of projected point (from depth map)
|
||||
Scalarm depth=0; // depth of point (distance from camera)
|
||||
Scalarm pdepth=0; // depth value of projected point (from depth map)
|
||||
|
||||
// get current raster and model
|
||||
RasterModel *raster = md.rm();
|
||||
@ -327,7 +327,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen
|
||||
case FP_MULTIIMAGETRIVIALPROJ :
|
||||
{
|
||||
bool onselection = par.getBool("onselection");
|
||||
float eta = par.getFloat("deptheta");
|
||||
Scalarm eta = par.getFloat("deptheta");
|
||||
bool useangle = par.getBool("useangle");
|
||||
bool usedistance = par.getBool("usedistance");
|
||||
bool useborders = par.getBool("useborders");
|
||||
@ -335,8 +335,8 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen
|
||||
bool usealphamask = par.getBool("usealpha");
|
||||
QColor blank = par.getColor("blankColor");
|
||||
|
||||
float depth=0; // depth of point (distance from camera)
|
||||
float pdepth=0; // depth value of projected point (from depth map)
|
||||
Scalarm depth=0; // depth of point (distance from camera)
|
||||
Scalarm pdepth=0; // depth value of projected point (from depth map)
|
||||
double pweight; // pixel weight
|
||||
MeshModel *model;
|
||||
bool do_project;
|
||||
@ -605,7 +605,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen
|
||||
//bool onselection = par.getBool("onselection");
|
||||
int texsize = par.getInt("texsize");
|
||||
bool dorefill = par.getBool("dorefill");
|
||||
float eta = par.getFloat("deptheta");
|
||||
Scalarm eta = par.getFloat("deptheta");
|
||||
bool useangle = par.getBool("useangle");
|
||||
bool usedistance = par.getBool("usedistance");
|
||||
bool useborders = par.getBool("useborders");
|
||||
@ -616,8 +616,8 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen
|
||||
int textW = texsize;
|
||||
int textH = texsize;
|
||||
|
||||
float depth=0; // depth of point (distance from camera)
|
||||
float pdepth=0; // depth value of projected point (from depth map)
|
||||
Scalarm depth=0; // depth of point (distance from camera)
|
||||
Scalarm pdepth=0; // depth value of projected point (from depth map)
|
||||
double pweight; // pixel weight
|
||||
MeshModel *model;
|
||||
bool do_project;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
using namespace std;
|
||||
using namespace vcg;
|
||||
|
||||
typedef Histogram<MESHLAB_SCALAR> Histogramm;
|
||||
typedef Histogram<Scalarm> Histogramm;
|
||||
|
||||
FilterColorProc::FilterColorProc()
|
||||
{
|
||||
@ -389,7 +389,7 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
|
||||
case CP_THRESHOLDING:
|
||||
{
|
||||
MESHLAB_SCALAR threshold = math::Clamp<MESHLAB_SCALAR>(par.getDynamicFloat("threshold"), 0.0, 255.0);
|
||||
Scalarm threshold = math::Clamp<Scalarm>(par.getDynamicFloat("threshold"), 0.0, 255.0);
|
||||
QColor temp = par.getColor("color1");
|
||||
Color4b c1 = Color4b(temp.red(), temp.green(), temp.blue(), temp.alpha());
|
||||
temp = par.getColor("color2");
|
||||
@ -402,9 +402,9 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
|
||||
case CP_CONTR_BRIGHT:
|
||||
{
|
||||
MESHLAB_SCALAR brightness = par.getDynamicFloat("brightness");
|
||||
MESHLAB_SCALAR contrast = par.getDynamicFloat("contrast");
|
||||
MESHLAB_SCALAR gamma = math::Clamp<MESHLAB_SCALAR>(par.getDynamicFloat("gamma"), 0.1, 5.0);
|
||||
Scalarm brightness = par.getDynamicFloat("brightness");
|
||||
Scalarm contrast = par.getDynamicFloat("contrast");
|
||||
Scalarm gamma = math::Clamp<Scalarm>(par.getDynamicFloat("gamma"), 0.1, 5.0);
|
||||
bool selected = par.getBool("onSelected");
|
||||
|
||||
vcg::tri::UpdateColor<CMeshO>::PerVertexGamma(m->cm, gamma, selected);
|
||||
@ -454,10 +454,10 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
case CP_COLOURISATION:
|
||||
{
|
||||
//reads parameters and normalizes their values in [0,1]
|
||||
MESHLAB_SCALAR luminance = math::Clamp<MESHLAB_SCALAR>(par.getDynamicFloat("luminance")/100, 0.0, 1.0);
|
||||
MESHLAB_SCALAR saturation = math::Clamp<MESHLAB_SCALAR>(par.getDynamicFloat("saturation")/100, 0.0, 1.0);
|
||||
MESHLAB_SCALAR hue = math::Clamp<MESHLAB_SCALAR>(par.getDynamicFloat("hue")/360, 0.0, 1.0);
|
||||
MESHLAB_SCALAR intensity = math::Clamp<MESHLAB_SCALAR>(par.getDynamicFloat("intensity")/100, 0.0, 1.0);
|
||||
Scalarm luminance = math::Clamp<Scalarm>(par.getDynamicFloat("luminance")/100, 0.0, 1.0);
|
||||
Scalarm saturation = math::Clamp<Scalarm>(par.getDynamicFloat("saturation")/100, 0.0, 1.0);
|
||||
Scalarm hue = math::Clamp<Scalarm>(par.getDynamicFloat("hue")/360, 0.0, 1.0);
|
||||
Scalarm intensity = math::Clamp<Scalarm>(par.getDynamicFloat("intensity")/100, 0.0, 1.0);
|
||||
bool selected = par.getBool("onSelected");
|
||||
|
||||
double r, g, b; //converts color from HSL to RGB....
|
||||
@ -560,15 +560,15 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
{
|
||||
m->updateDataMask(MeshModel::MM_VERTCOLOR);
|
||||
|
||||
float RangeMin = par.getFloat("minVal");
|
||||
float RangeMax = par.getFloat("maxVal");
|
||||
Scalarm RangeMin = par.getFloat("minVal");
|
||||
Scalarm RangeMax = par.getFloat("maxVal");
|
||||
bool usePerc = par.getDynamicFloat("perc")>0;
|
||||
|
||||
Histogramm H;
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m->cm, H);
|
||||
|
||||
float PercLo = H.Percentile(par.getDynamicFloat("perc") / 100.f);
|
||||
float PercHi = H.Percentile(1.0 - par.getDynamicFloat("perc") / 100.f);
|
||||
Scalarm PercLo = H.Percentile(par.getDynamicFloat("perc") / 100.0);
|
||||
Scalarm PercHi = H.Percentile(1.0 - par.getDynamicFloat("perc") / 100.0);
|
||||
|
||||
if (par.getBool("zeroSym"))
|
||||
{
|
||||
@ -592,15 +592,15 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
|
||||
case CP_CLAMP_QUALITY:
|
||||
{
|
||||
float RangeMin = par.getFloat("minVal");
|
||||
float RangeMax = par.getFloat("maxVal");
|
||||
Scalarm RangeMin = par.getFloat("minVal");
|
||||
Scalarm RangeMax = par.getFloat("maxVal");
|
||||
bool usePerc = par.getDynamicFloat("perc")>0;
|
||||
|
||||
Histogramm H;
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m->cm, H);
|
||||
|
||||
float PercLo = H.Percentile(par.getDynamicFloat("perc") / 100.f);
|
||||
float PercHi = H.Percentile(1.0 - par.getDynamicFloat("perc") / 100.f);
|
||||
Scalarm PercLo = H.Percentile(par.getDynamicFloat("perc") / 100.0);
|
||||
Scalarm PercHi = H.Percentile(1.0 - par.getDynamicFloat("perc") / 100.0);
|
||||
|
||||
if (par.getBool("zeroSym"))
|
||||
{
|
||||
@ -625,15 +625,15 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
case CP_MAP_FQUALITY_INTO_COLOR:
|
||||
{
|
||||
m->updateDataMask(MeshModel::MM_FACECOLOR);
|
||||
float RangeMin = par.getFloat("minVal");
|
||||
float RangeMax = par.getFloat("maxVal");
|
||||
float perc = par.getDynamicFloat("perc");
|
||||
Scalarm RangeMin = par.getFloat("minVal");
|
||||
Scalarm RangeMax = par.getFloat("maxVal");
|
||||
Scalarm perc = par.getDynamicFloat("perc");
|
||||
bool usePerc = perc>0;
|
||||
|
||||
Histogramm H;
|
||||
tri::Stat<CMeshO>::ComputePerFaceQualityHistogram(m->cm, H);
|
||||
float PercLo = H.Percentile(perc / 100.f);
|
||||
float PercHi = H.Percentile(1.0 - perc / 100.f);
|
||||
Scalarm PercLo = H.Percentile(perc / 100.0);
|
||||
Scalarm PercHi = H.Percentile(1.0 - perc / 100.0);
|
||||
|
||||
// Make the range and percentile symmetric w.r.t. zero, so that
|
||||
// the value zero is always colored in yellow
|
||||
@ -693,9 +693,9 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, std::
|
||||
{
|
||||
m->updateDataMask(MeshModel::MM_FACECOLOR | MeshModel::MM_FACEQUALITY);
|
||||
CMeshO::FaceIterator fi;
|
||||
Distribution<MESHLAB_SCALAR> distrib;
|
||||
MESHLAB_SCALAR minV = 0;
|
||||
MESHLAB_SCALAR maxV = 1.0;
|
||||
Distribution<Scalarm> distrib;
|
||||
Scalarm minV = 0;
|
||||
Scalarm maxV = 1.0;
|
||||
int metric = par.getEnum("Metric");
|
||||
if (metric == 4 || metric == 5)
|
||||
{
|
||||
|
||||
@ -198,8 +198,8 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, std::map
|
||||
case CR_TORUS:
|
||||
{
|
||||
m = md.addNewMesh("", this->filterName(ID(filter)));
|
||||
float hRadius=par.getFloat("hRadius");
|
||||
float vRadius=par.getFloat("vRadius");
|
||||
Scalarm hRadius=par.getFloat("hRadius");
|
||||
Scalarm vRadius=par.getFloat("vRadius");
|
||||
int hSubdiv=par.getInt("hSubdiv");
|
||||
int vSubdiv=par.getInt("vSubdiv");
|
||||
tri::Torus(m->cm,hRadius,vRadius,hSubdiv,vSubdiv);
|
||||
@ -365,20 +365,20 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, std::map
|
||||
|
||||
|
||||
// find extent
|
||||
float dimH = -1000000;
|
||||
float dimV = -1000000;
|
||||
Scalarm dimH = -1000000;
|
||||
Scalarm dimV = -1000000;
|
||||
for (size_t i = 0; i < selected_pts.size(); ++i)
|
||||
{
|
||||
Point3m pp = plane.Projection(selected_pts[i]);
|
||||
float distH = fabs(((pp - centerP) * dirH));
|
||||
float distV = fabs(((pp - centerP) * dirV));
|
||||
Scalarm distH = fabs(((pp - centerP) * dirH));
|
||||
Scalarm distV = fabs(((pp - centerP) * dirV));
|
||||
|
||||
if (distH > dimH)
|
||||
dimH = distH;
|
||||
if (distV > dimV)
|
||||
dimV = distV;
|
||||
}
|
||||
float exScale = par.getFloat("extent");
|
||||
Scalarm exScale = par.getFloat("extent");
|
||||
dimV = dimV * exScale;
|
||||
dimH = dimH * exScale;
|
||||
log("extent on plane [%f, %f]", dimV, dimH);
|
||||
@ -482,7 +482,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, std::map
|
||||
case CR_SPHERE_CAP:
|
||||
{
|
||||
int rec = par.getInt("subdiv");
|
||||
const float angleDeg = par.getFloat("angle");
|
||||
const Scalarm angleDeg = par.getFloat("angle");
|
||||
m = md.addNewMesh("", this->filterName(ID(filter)));
|
||||
m->updateDataMask(MeshModel::MM_FACEFACETOPO);
|
||||
tri::UpdateTopology<CMeshO>::FaceFace(m->cm);
|
||||
@ -492,7 +492,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, std::map
|
||||
case CR_SPHERE:
|
||||
{
|
||||
int rec = par.getInt("subdiv");
|
||||
float radius = par.getFloat("radius");
|
||||
Scalarm radius = par.getFloat("radius");
|
||||
m = md.addNewMesh("", this->filterName(ID(filter)));
|
||||
m->cm.face.EnableFFAdjacency();
|
||||
m->updateDataMask(MeshModel::MM_FACEFACETOPO);
|
||||
@ -503,7 +503,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, std::map
|
||||
|
||||
case CR_BOX:
|
||||
{
|
||||
float sz=par.getFloat("size");
|
||||
Scalarm sz=par.getFloat("size");
|
||||
Box3m b(Point3m(1,1,1)*(-sz/2),Point3m(1,1,1)*(sz/2));
|
||||
m = md.addNewMesh("", this->filterName(ID(filter)));
|
||||
tri::Box<CMeshO>(m->cm,b);
|
||||
@ -512,9 +512,9 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, std::map
|
||||
|
||||
case CR_CONE:
|
||||
{
|
||||
float r0 = par.getFloat("r0");
|
||||
float r1 = par.getFloat("r1");
|
||||
float h = par.getFloat("h");
|
||||
Scalarm r0 = par.getFloat("r0");
|
||||
Scalarm r1 = par.getFloat("r1");
|
||||
Scalarm h = par.getFloat("h");
|
||||
int subdiv = par.getInt("subdiv");
|
||||
m = md.addNewMesh("", this->filterName(ID(filter)));
|
||||
tri::Cone<CMeshO>(m->cm, r0, r1, h, subdiv);
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include <gr/algorithms/PointPairFilter.h>
|
||||
//#include <QtScript>
|
||||
|
||||
using PointType = gr::Point3D<MESHLAB_SCALAR>;
|
||||
using PointType = gr::Point3D<Scalarm>;
|
||||
|
||||
GlobalRegistrationPlugin::GlobalRegistrationPlugin()
|
||||
{
|
||||
@ -93,7 +93,7 @@ void GlobalRegistrationPlugin::initParameterList(const QAction *action,MeshDocum
|
||||
}
|
||||
|
||||
|
||||
using MatrixType = Eigen::Matrix<MESHLAB_SCALAR, 4, 4>;
|
||||
using MatrixType = Eigen::Matrix<Scalarm, 4, 4>;
|
||||
|
||||
struct RealTimeTransformVisitor {
|
||||
CMeshO* mesh = nullptr;
|
||||
|
||||
@ -649,7 +649,7 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, std
|
||||
for (uint i = 0; i < num_cams; ++i)
|
||||
{
|
||||
float f, k1, k2;
|
||||
MESHLAB_SCALAR R[16] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1 };
|
||||
Scalarm R[16] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1 };
|
||||
vcg::Point3f t;
|
||||
|
||||
fgets(line, 100, fp);; if (line[0] == '\0') return false; sscanf(line, "%f %f %f", &f, &k1, &k2);
|
||||
|
||||
@ -404,7 +404,7 @@ bool FilterMeasurePlugin::computeGeometricMeasures(MeshDocument& md, std::map<st
|
||||
log("Mesh Surface Area is %f", Area);
|
||||
|
||||
// edges
|
||||
Distribution<MESHLAB_SCALAR> eDist;
|
||||
Distribution<Scalarm> eDist;
|
||||
tri::Stat<CMeshO>::ComputeFaceEdgeLengthDistribution(m, eDist, false);
|
||||
log("Mesh Total Len of %i Edges is %f Avg Len %f", int(eDist.Cnt()), eDist.Sum(), eDist.Avg());
|
||||
tri::Stat<CMeshO>::ComputeFaceEdgeLengthDistribution(m, eDist, true);
|
||||
@ -523,7 +523,7 @@ bool FilterMeasurePlugin::computeAreaPerimeterOfSelection(MeshDocument& md, std:
|
||||
bool FilterMeasurePlugin::perVertexQualityStat(MeshDocument& md, std::map<std::string, QVariant>& outputValues)
|
||||
{
|
||||
CMeshO &m = md.mm()->cm;
|
||||
Distribution<MESHLAB_SCALAR> DD;
|
||||
Distribution<Scalarm> DD;
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityDistribution(m, DD, false);
|
||||
|
||||
log(" Min %f Max %f", DD.Min(), DD.Max());
|
||||
@ -536,7 +536,7 @@ bool FilterMeasurePlugin::perVertexQualityStat(MeshDocument& md, std::map<std::s
|
||||
bool FilterMeasurePlugin::perFaceQualityStat(MeshDocument& md, std::map<std::string, QVariant>& outputValues)
|
||||
{
|
||||
CMeshO &m = md.mm()->cm;
|
||||
Distribution<MESHLAB_SCALAR> DD;
|
||||
Distribution<Scalarm> DD;
|
||||
tri::Stat<CMeshO>::ComputePerFaceQualityDistribution(m, DD, false);
|
||||
|
||||
log(" Min %f Max %f", DD.Min(), DD.Max());
|
||||
|
||||
@ -1337,7 +1337,7 @@ switch(ID(filter))
|
||||
case 6: tri::UpdateQuality<CMeshO>::VertexConstant(m.cm,0); break;
|
||||
}
|
||||
|
||||
Histogram<MESHLAB_SCALAR> H;
|
||||
Histogram<Scalarm> H;
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m.cm,H);
|
||||
tri::UpdateColor<CMeshO>::PerVertexQualityRamp(m.cm,H.Percentile(0.1f),H.Percentile(0.9f));
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
using namespace GaelMls;
|
||||
using namespace vcg;
|
||||
|
||||
typedef Histogram<MESHLAB_SCALAR> Histogramm;
|
||||
typedef Histogram<Scalarm> Histogramm;
|
||||
|
||||
// Constructor usually performs only two simple tasks of filling the two lists
|
||||
// - typeList: with all the possible id of the filtering actions
|
||||
|
||||
@ -469,11 +469,11 @@ bool AlignSet::RenderShadowMap(void)
|
||||
glUseProgram(depthPrg);
|
||||
|
||||
assert(glGetError() == 0);
|
||||
MESHLAB_SCALAR _near, _far;
|
||||
Scalarm _near, _far;
|
||||
_near=0.1;
|
||||
_far=10000;
|
||||
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::GetNearFarPlanes(shotPro, mesh->bbox, _near, _far);
|
||||
GlShot< vcg::Shot<Scalarm> >::GetNearFarPlanes(shotPro, mesh->bbox, _near, _far);
|
||||
//assert(_near <= _far);
|
||||
if(_near <= 0) _near = 0.1;
|
||||
if(_far < _near) _far = 1000;
|
||||
@ -487,7 +487,7 @@ bool AlignSet::RenderShadowMap(void)
|
||||
|
||||
//glViewport(0, 0, wt, ht);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::SetView(shotPro, 0.5*_near, 2*_far);
|
||||
GlShot< vcg::Shot<Scalarm> >::SetView(shotPro, 0.5*_near, 2*_far);
|
||||
|
||||
vcg::Matrix44f proj_matrix;
|
||||
glGetFloatv(GL_PROJECTION_MATRIX , proj_matrix.V());
|
||||
@ -575,11 +575,11 @@ bool AlignSet::RenderMultiShadowMap(void)
|
||||
glUseProgram(depthPrg);
|
||||
|
||||
assert(glGetError() == 0);
|
||||
MESHLAB_SCALAR _near, _far;
|
||||
Scalarm _near, _far;
|
||||
_near=0.1;
|
||||
_far=10000;
|
||||
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::GetNearFarPlanes(*arcShots[0], mesh->bbox, _near, _far);
|
||||
GlShot< vcg::Shot<Scalarm> >::GetNearFarPlanes(*arcShots[0], mesh->bbox, _near, _far);
|
||||
//assert(_near <= _far);
|
||||
if(_near <= 0) _near = 0.1;
|
||||
if(_far < _near) _far = 1000;
|
||||
@ -593,7 +593,7 @@ bool AlignSet::RenderMultiShadowMap(void)
|
||||
|
||||
//glViewport(0, 0, wt, ht);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::SetView(*arcShots[0], 0.5*_near, 2*_far);
|
||||
GlShot< vcg::Shot<Scalarm> >::SetView(*arcShots[0], 0.5*_near, 2*_far);
|
||||
|
||||
vcg::Matrix44f proj_matrix;
|
||||
glGetFloatv(GL_PROJECTION_MATRIX , proj_matrix.V());
|
||||
@ -678,7 +678,7 @@ bool AlignSet::RenderMultiShadowMap(void)
|
||||
_near=0.1;
|
||||
_far=10000;
|
||||
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::GetNearFarPlanes(*arcShots[1], mesh->bbox, _near, _far);
|
||||
GlShot< vcg::Shot<Scalarm> >::GetNearFarPlanes(*arcShots[1], mesh->bbox, _near, _far);
|
||||
//assert(_near <= _far);
|
||||
if(_near <= 0) _near = 0.1;
|
||||
if(_far < _near) _far = 1000;
|
||||
@ -692,7 +692,7 @@ bool AlignSet::RenderMultiShadowMap(void)
|
||||
|
||||
//glViewport(0, 0, wt, ht);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::SetView(*arcShots[1], 0.5*_near, 2*_far);
|
||||
GlShot< vcg::Shot<Scalarm> >::SetView(*arcShots[1], 0.5*_near, 2*_far);
|
||||
|
||||
glGetFloatv(GL_PROJECTION_MATRIX , proj_matrix.V());
|
||||
proj_matrix.transposeInPlace();
|
||||
@ -774,7 +774,7 @@ bool AlignSet::RenderMultiShadowMap(void)
|
||||
_near=0.1;
|
||||
_far=10000;
|
||||
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::GetNearFarPlanes(*arcShots[2], mesh->bbox, _near, _far);
|
||||
GlShot< vcg::Shot<Scalarm> >::GetNearFarPlanes(*arcShots[2], mesh->bbox, _near, _far);
|
||||
//assert(_near <= _far);
|
||||
if(_near <= 0) _near = 0.1;
|
||||
if(_far < _near) _far = 1000;
|
||||
@ -788,7 +788,7 @@ bool AlignSet::RenderMultiShadowMap(void)
|
||||
|
||||
//glViewport(0, 0, wt, ht);
|
||||
//glClear(GL_DEPTH_BUFFER_BIT);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::SetView(*arcShots[2], 0.5*_near, 2*_far);
|
||||
GlShot< vcg::Shot<Scalarm> >::SetView(*arcShots[2], 0.5*_near, 2*_far);
|
||||
|
||||
|
||||
glGetFloatv(GL_PROJECTION_MATRIX , proj_matrix.V());
|
||||
@ -942,18 +942,18 @@ void AlignSet::resize(int max_side) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void AlignSet::renderScene(vcg::Shot<MESHLAB_SCALAR> &view, int component, bool save) {
|
||||
void AlignSet::renderScene(vcg::Shot<Scalarm> &view, int component, bool save) {
|
||||
QSize fbosize(wt,ht);
|
||||
QGLFramebufferObjectFormat frmt;
|
||||
frmt.setInternalTextureFormat(GL_RGBA);
|
||||
frmt.setAttachment(QGLFramebufferObject::Depth);
|
||||
QGLFramebufferObject fbo(fbosize,frmt);
|
||||
|
||||
MESHLAB_SCALAR _near, _far;
|
||||
Scalarm _near, _far;
|
||||
_near=0.1;
|
||||
_far=10000;
|
||||
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::GetNearFarPlanes(view, mesh->bbox, _near, _far);
|
||||
GlShot< vcg::Shot<Scalarm> >::GetNearFarPlanes(view, mesh->bbox, _near, _far);
|
||||
//assert(_near <= _far);
|
||||
if(_near <= 0) _near = 0.1;
|
||||
if(_far < _near) _far = 1000;
|
||||
@ -966,7 +966,7 @@ void AlignSet::renderScene(vcg::Shot<MESHLAB_SCALAR> &view, int component, bool
|
||||
|
||||
glViewport(0, 0, wt, ht);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
GlShot< vcg::Shot<MESHLAB_SCALAR> >::SetView(view, 0.5*_near, 2*_far);
|
||||
GlShot< vcg::Shot<Scalarm> >::SetView(view, 0.5*_near, 2*_far);
|
||||
|
||||
// err = glGetError();
|
||||
|
||||
|
||||
@ -33,9 +33,9 @@ class AlignSet {
|
||||
CMeshO* mesh;
|
||||
QImage* image;
|
||||
double imageRatio;
|
||||
vcg::Shot<MESHLAB_SCALAR> shot;
|
||||
vcg::Shot<Scalarm> shot;
|
||||
vcg::Box3<float> box;
|
||||
vcg::Shot<MESHLAB_SCALAR> shotPro;
|
||||
vcg::Shot<Scalarm> shotPro;
|
||||
QImage* imagePro;
|
||||
vcg::Matrix44<float> shadPro;
|
||||
QList<PointCorrespondence*> *correspList; //List that includes corresponces involving the model
|
||||
@ -44,7 +44,7 @@ class AlignSet {
|
||||
QImage comb;
|
||||
//Node* node;
|
||||
std::vector<QImage*> arcImages;
|
||||
std::vector<vcg::Shot<MESHLAB_SCALAR>*> arcShots;
|
||||
std::vector<vcg::Shot<Scalarm>*> arcShots;
|
||||
std::vector<float> arcMI;
|
||||
std::vector<vcg::Matrix44<float>> prjMats;
|
||||
|
||||
@ -83,7 +83,7 @@ class AlignSet {
|
||||
bool setFocal(double f); //return false if unchanged
|
||||
void setPixelSizeMm(double ccdWidth);
|
||||
|
||||
void renderScene(vcg::Shot<MESHLAB_SCALAR>& shot, int component, bool save=false);
|
||||
void renderScene(vcg::Shot<Scalarm>& shot, int component, bool save=false);
|
||||
void readRender(int component);
|
||||
|
||||
void drawMeshPoints();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user