mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-13 00:07:24 +00:00
filter ao and geodesic python rename
This commit is contained in:
parent
3c47961f1c
commit
bc6b6b67c5
@ -74,13 +74,18 @@ QString AmbientOcclusionPlugin::pluginName() const
|
||||
|
||||
QString AmbientOcclusionPlugin::filterName(ActionIDType filterId) const
|
||||
{
|
||||
switch(filterId)
|
||||
{
|
||||
case FP_AMBIENT_OCCLUSION : return QString("Ambient Occlusion");
|
||||
default : assert(0);
|
||||
}
|
||||
switch (filterId) {
|
||||
case FP_AMBIENT_OCCLUSION: return QString("Ambient Occlusion");
|
||||
default: assert(0); return QString();
|
||||
}
|
||||
}
|
||||
|
||||
return QString("");
|
||||
QString AmbientOcclusionPlugin::pythonFilterName(ActionIDType f) const
|
||||
{
|
||||
switch (f) {
|
||||
case FP_AMBIENT_OCCLUSION: return QString("compute_scalar_ambient_occlusion");
|
||||
default: assert(0); return QString();
|
||||
}
|
||||
}
|
||||
|
||||
QString AmbientOcclusionPlugin::filterInfo(ActionIDType filterId) const
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
/****************************************************************************
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005 \/)\/ *
|
||||
* Visual Computing Lab /\/| *
|
||||
* ISTI - Italian National Research Council | *
|
||||
* \ *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
||||
* for more details. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
* MeshLab o o *
|
||||
* A versatile mesh processing toolbox o o *
|
||||
* _ O _ *
|
||||
* Copyright(C) 2005 \/)\/ *
|
||||
* Visual Computing Lab /\/| *
|
||||
* ISTI - Italian National Research Council | *
|
||||
* \ *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
||||
* for more details. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef AMBIENT_OCCLUSION_H
|
||||
#define AMBIENT_OCCLUSION_H
|
||||
@ -35,72 +35,69 @@ class AmbientOcclusionPlugin : public QObject, public FilterPlugin
|
||||
MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_IID)
|
||||
Q_INTERFACES(FilterPlugin)
|
||||
|
||||
// Attributes
|
||||
// Attributes
|
||||
protected:
|
||||
std::vector<vcg::Point3f> viewDirVec;
|
||||
vcg::Point3f cameraDir;
|
||||
GLuint fboDepth,
|
||||
fboResult,
|
||||
depthBufferTex,
|
||||
vertexCoordTex,
|
||||
vertexNormalsTex,
|
||||
*resultBufferTex;
|
||||
std::vector<vcg::Point3f> viewDirVec;
|
||||
vcg::Point3f cameraDir;
|
||||
GLuint fboDepth, fboResult, depthBufferTex, vertexCoordTex, vertexNormalsTex, *resultBufferTex;
|
||||
|
||||
GLenum *resultBufferMRT,
|
||||
colorFormat,
|
||||
dataTypeFP;
|
||||
GLenum *resultBufferMRT, colorFormat, dataTypeFP;
|
||||
|
||||
unsigned int numViews,
|
||||
depthTexArea,
|
||||
numTexPages;
|
||||
unsigned int numViews, depthTexArea, numTexPages;
|
||||
|
||||
bool useGPU, errInit;
|
||||
bool perFace;
|
||||
|
||||
bool useGPU,
|
||||
errInit;
|
||||
bool perFace;
|
||||
public:
|
||||
unsigned int depthTexSize,
|
||||
maxTexSize;
|
||||
unsigned int depthTexSize, maxTexSize;
|
||||
|
||||
// Methods
|
||||
// Methods
|
||||
public:
|
||||
enum { FP_AMBIENT_OCCLUSION } ;
|
||||
enum { FP_AMBIENT_OCCLUSION };
|
||||
|
||||
AmbientOcclusionPlugin();
|
||||
~AmbientOcclusionPlugin();
|
||||
AmbientOcclusionPlugin();
|
||||
~AmbientOcclusionPlugin();
|
||||
|
||||
QString pluginName() const;
|
||||
QString filterName(ActionIDType filter) const;
|
||||
QString filterInfo(ActionIDType filterId) const;
|
||||
FilterArity filterArity(const QAction*) const;
|
||||
int getRequirements (const QAction* action);
|
||||
bool requiresGLContext(const QAction* action) const;
|
||||
FilterClass getClass(const QAction* filter) const;
|
||||
QString pluginName() const;
|
||||
QString filterName(ActionIDType filter) const;
|
||||
QString pythonFilterName(ActionIDType f) const;
|
||||
QString filterInfo(ActionIDType filterId) const;
|
||||
FilterArity filterArity(const QAction*) const;
|
||||
int getRequirements(const QAction* action);
|
||||
bool requiresGLContext(const QAction* action) const;
|
||||
FilterClass getClass(const QAction* filter) const;
|
||||
|
||||
RichParameterList initParameterList(const QAction*, const MeshModel& /*m*/);
|
||||
|
||||
std::map<std::string, QVariant> applyFilter(
|
||||
const QAction* action,
|
||||
const RichParameterList& /*parent*/,
|
||||
MeshDocument& md,
|
||||
unsigned int& postConditionMask,
|
||||
vcg::CallBackPos* cb);
|
||||
|
||||
RichParameterList initParameterList(const QAction*, const MeshModel &/*m*/);
|
||||
std::map<std::string, QVariant> applyFilter(const QAction* action, const RichParameterList & /*parent*/, MeshDocument &md, unsigned int& postConditionMask, vcg::CallBackPos * cb);
|
||||
void initTextures(void);
|
||||
void initGL(vcg::CallBackPos *cb,unsigned int numVertices);
|
||||
bool processGL(MeshModel &m, std::vector<vcg::Point3f> &posVect);
|
||||
bool checkFramebuffer();
|
||||
void initGL(vcg::CallBackPos* cb, unsigned int numVertices);
|
||||
bool processGL(MeshModel& m, std::vector<vcg::Point3f>& posVect);
|
||||
bool checkFramebuffer();
|
||||
|
||||
void vertexCoordsToTexture(MeshModel &m);
|
||||
void vertexCoordsToTexture(MeshModel& m);
|
||||
|
||||
void setCamera(vcg::Point3f camDir,Box3m &meshBBox);
|
||||
void setCamera(vcg::Point3f camDir, Box3m& meshBBox);
|
||||
|
||||
void generateOcclusionHW();
|
||||
void generateOcclusionSW(MeshModel &m);
|
||||
void generateFaceOcclusionSW(MeshModel &m, std::vector<vcg::Point3f> & faceCenterVec);
|
||||
void generateOcclusionHW();
|
||||
void generateOcclusionSW(MeshModel& m);
|
||||
void generateFaceOcclusionSW(MeshModel& m, std::vector<vcg::Point3f>& faceCenterVec);
|
||||
|
||||
void applyOcclusionHW(MeshModel& m);
|
||||
void applyOcclusionSW(MeshModel& m, GLfloat* aoValues);
|
||||
|
||||
void applyOcclusionHW(MeshModel &m);
|
||||
void applyOcclusionSW(MeshModel &m,GLfloat *aoValues);
|
||||
void set_shaders(char* shaderName, GLuint& vs, GLuint& fs, GLuint& pr);
|
||||
|
||||
void set_shaders(char *shaderName,GLuint &vs,GLuint &fs,GLuint &pr);
|
||||
void dumpFloatTexture(QString filename, float* texdata, int elems);
|
||||
|
||||
void dumpFloatTexture(QString filename, float *texdata, int elems);
|
||||
private:
|
||||
bool init;
|
||||
|
||||
bool init;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -61,14 +61,26 @@ QString FilterGeodesic::pluginName() const
|
||||
|
||||
QString FilterGeodesic::filterName(ActionIDType filter) const
|
||||
{
|
||||
switch(filter)
|
||||
{
|
||||
case FP_QUALITY_BORDER_GEODESIC : return QString("Colorize by border distance");
|
||||
case FP_QUALITY_POINT_GEODESIC : return QString("Colorize by geodesic distance from a given point");
|
||||
case FP_QUALITY_SELECTED_GEODESIC : return QString("Colorize by geodesic distance from the selected points");
|
||||
default : assert(0);
|
||||
switch (filter) {
|
||||
case FP_QUALITY_BORDER_GEODESIC: return QString("Colorize by border distance");
|
||||
case FP_QUALITY_POINT_GEODESIC:
|
||||
return QString("Colorize by geodesic distance from a given point");
|
||||
case FP_QUALITY_SELECTED_GEODESIC:
|
||||
return QString("Colorize by geodesic distance from the selected points");
|
||||
default: assert(0); return QString();
|
||||
}
|
||||
}
|
||||
|
||||
QString FilterGeodesic::pythonFilterName(ActionIDType f) const
|
||||
{
|
||||
switch (f) {
|
||||
case FP_QUALITY_BORDER_GEODESIC: return QString("compute_scalar_by_border_distance_per_vertex");
|
||||
case FP_QUALITY_POINT_GEODESIC:
|
||||
return QString("compute_scalar_by_geodesic_distance_from_given_point_per_vertex");
|
||||
case FP_QUALITY_SELECTED_GEODESIC:
|
||||
return QString("compute_scalar_by_geodesic_distance_from_selection_per_vertex");
|
||||
default: assert(0); return QString();
|
||||
}
|
||||
return QString("error!");
|
||||
}
|
||||
|
||||
QString FilterGeodesic::filterInfo(ActionIDType filterId) const
|
||||
|
||||
@ -52,6 +52,7 @@ class FilterGeodesic : public QObject, public FilterPlugin
|
||||
|
||||
QString pluginName() const;
|
||||
QString filterName(ActionIDType filter) const;
|
||||
QString pythonFilterName(ActionIDType f) const;
|
||||
QString filterInfo(ActionIDType filter) const;
|
||||
|
||||
FilterClass getClass(const QAction*) const;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user