mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-15 17:14:39 +00:00
Merge branch 'master' of https://github.com/cnr-isti-vclab/meshlab
This commit is contained in:
commit
cdf64ca22f
@ -24,11 +24,13 @@
|
||||
#include <QMessageBox>
|
||||
#include "mainwindow.h"
|
||||
#include <QString>
|
||||
#include <clocale>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
MeshLabApplication app(argc, argv);
|
||||
std::setlocale(LC_ALL, "C");
|
||||
QLocale::setDefault(QLocale::C);
|
||||
QCoreApplication::setOrganizationName(MeshLabApplication::organization());
|
||||
#if QT_VERSION >= 0x050100
|
||||
|
||||
@ -30,6 +30,7 @@ FIRST RELEASE
|
||||
#include "eqhandle.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <math.h>
|
||||
|
||||
EqHandle::EqHandle(CHART_INFO *environment_info, QColor color, QPointF position,
|
||||
EQUALIZER_HANDLE_TYPE type, EqHandle** handles, qreal* midHandlePercentilePosition, QDoubleSpinBox* spinbox,
|
||||
@ -83,7 +84,7 @@ void EqHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
setCursor(Qt::OpenHandCursor);
|
||||
|
||||
QPointF newPos = event->scenePos();
|
||||
qreal handleOffset = abs(newPos.x()-pos().x());
|
||||
qreal handleOffset = fabs(newPos.x()-pos().x());
|
||||
|
||||
if (handleOffset >= std::numeric_limits<float>::epsilon())
|
||||
{
|
||||
|
||||
@ -203,6 +203,7 @@ void RadianceScalingRendererPlugin::initShaders(bool reload)
|
||||
_rsPass->addUniform("transition");
|
||||
_rsPass->addUniform("enabled");
|
||||
_rsPass->addUniform("invert");
|
||||
_rsPass->addUniform("doubleSide");
|
||||
_rsPass->addUniform("twoLS");
|
||||
_rsPass->addUniform("display");
|
||||
_rsPass->addUniform("grad");
|
||||
@ -231,6 +232,7 @@ void RadianceScalingRendererPlugin::initShaders(bool reload)
|
||||
_rsPass->setUniform1i("enabled", _sDialog->getEnable());
|
||||
_rsPass->setUniform1i("display", _sDialog->getDisplay());
|
||||
_rsPass->setUniform1i("invert", _sDialog->getInvert());
|
||||
_rsPass->setUniform1i("doubleSide", _sDialog->getDoubleSide());
|
||||
_rsPass->setUniform1i("twoLS", _sDialog->getTwoLS());
|
||||
_rsPass->setUniformTexture("grad", 0, _gradTex->format().target(), _gradTex->id());
|
||||
_rsPass->setUniformTexture("norm", 1, _normTex->format().target(), _normTex->id());
|
||||
|
||||
@ -62,6 +62,7 @@ class RadianceScalingRendererPlugin : public QObject, public MeshRenderInterface
|
||||
inline void setEnable(bool enabled);
|
||||
inline void setLit(bool lit);
|
||||
inline void setInvert(int invert);
|
||||
inline void setDoubleSide(int doubleSide);
|
||||
inline void setDisplay(int index);
|
||||
inline void setEnhancement(float enhancement);
|
||||
inline void setTransition(float transition);
|
||||
@ -157,6 +158,12 @@ inline void RadianceScalingRendererPlugin::setInvert(int invert) {
|
||||
_rsPass->disable();
|
||||
}
|
||||
|
||||
inline void RadianceScalingRendererPlugin::setDoubleSide(int doubleSide) {
|
||||
_rsPass->enable();
|
||||
_rsPass->setUniform1i("doubleSide", doubleSide);
|
||||
_rsPass->disable();
|
||||
}
|
||||
|
||||
inline void RadianceScalingRendererPlugin::setDisplay(int index) {
|
||||
if(index==1) {
|
||||
initShaders(false);
|
||||
|
||||
@ -40,6 +40,7 @@ ShaderDialog::ShaderDialog(RadianceScalingRendererPlugin* wrp,QGLWidget* gla,QWi
|
||||
|
||||
connect(_ui.enableCheckBox,SIGNAL(stateChanged(int)),this,SLOT(enableChanged(int)));
|
||||
connect(_ui.invertCheckBox,SIGNAL(stateChanged(int)),this,SLOT(invertChanged(int)));
|
||||
connect(_ui.doubleSideCheckBox, SIGNAL(stateChanged(int)), this, SLOT(doubleSideChanged(int)));
|
||||
connect(_ui.displayBox,SIGNAL(currentIndexChanged(int)),this,SLOT(displayChanged(int)));
|
||||
connect(_ui.enSlider,SIGNAL(valueChanged(int)),this,SLOT(enhancementChanged(int)));
|
||||
connect(_ui.transitionSlider,SIGNAL(valueChanged(int)),this,SLOT(transitionChanged(int)));
|
||||
@ -64,15 +65,19 @@ ShaderDialog::~ShaderDialog() {
|
||||
}
|
||||
|
||||
void ShaderDialog::enableChanged(int) {
|
||||
bool enableChecked = (_ui.enableCheckBox->checkState()==Qt::Checked) ? true : false;
|
||||
|
||||
_wrp->setEnable(enableChecked);
|
||||
_gla->update();
|
||||
bool enableChecked = (_ui.enableCheckBox->checkState()==Qt::Checked) ? true : false;
|
||||
_wrp->setEnable(enableChecked);
|
||||
_gla->update();
|
||||
}
|
||||
|
||||
void ShaderDialog::invertChanged(int) {
|
||||
(_ui.invertCheckBox->checkState()==Qt::Checked) ? _wrp->setInvert(true) : _wrp->setInvert(false);
|
||||
_gla->update();
|
||||
(_ui.invertCheckBox->checkState()==Qt::Checked) ? _wrp->setInvert(true) : _wrp->setInvert(false);
|
||||
_gla->update();
|
||||
}
|
||||
|
||||
void ShaderDialog::doubleSideChanged(int) {
|
||||
(_ui.doubleSideCheckBox->checkState() == Qt::Checked) ? _wrp->setDoubleSide(true) : _wrp->setDoubleSide(false);
|
||||
_gla->update();
|
||||
}
|
||||
|
||||
void ShaderDialog::displayChanged(int index) {
|
||||
|
||||
@ -51,6 +51,7 @@ class ShaderDialog : public QDockWidget {
|
||||
void enableChanged(int);
|
||||
void displayChanged(int);
|
||||
void invertChanged(int);
|
||||
void doubleSideChanged(int);
|
||||
void enhancementChanged(int);
|
||||
void transitionChanged(int);
|
||||
void litChanged(int);
|
||||
@ -63,6 +64,7 @@ class ShaderDialog : public QDockWidget {
|
||||
inline float getEnhancement() const;
|
||||
inline float getTransition() const;
|
||||
inline bool getInvert() const;
|
||||
inline bool getDoubleSide() const;
|
||||
inline bool getTwoLS() const;
|
||||
};
|
||||
|
||||
@ -88,6 +90,10 @@ inline bool ShaderDialog::getInvert() const {
|
||||
return (_ui.invertCheckBox->checkState()==Qt::Checked);
|
||||
}
|
||||
|
||||
inline bool ShaderDialog::getDoubleSide() const {
|
||||
return (_ui.doubleSideCheckBox->checkState() == Qt::Checked);
|
||||
}
|
||||
|
||||
inline bool ShaderDialog::getTwoLS() const {
|
||||
return (_ui.litCheckBox->checkState()==Qt::Checked);
|
||||
}
|
||||
|
||||
@ -1,202 +1,203 @@
|
||||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ShaderDialogClass</class>
|
||||
<widget class="QWidget" name="ShaderDialogClass" >
|
||||
<property name="geometry" >
|
||||
<widget class="QWidget" name="ShaderDialogClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>566</height>
|
||||
<width>430</width>
|
||||
<height>530</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame" >
|
||||
<property name="frameShape" >
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Radiance Scaling parameters</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3" >
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout" >
|
||||
<item row="2" column="1" >
|
||||
<widget class="QComboBox" name="displayBox" >
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="displayBox">
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Lambertian Radiance Scaling</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Lit Sphere Radiance Scaling</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Colored Descriptor</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Grey Descriptor</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string>Display Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QCheckBox" name="enableCheckBox" >
|
||||
<property name="layoutDirection" >
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Enable Radiance Scaling</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QSlider" name="enSlider" >
|
||||
<property name="maximum" >
|
||||
<item row="3" column="1">
|
||||
<widget class="QSlider" name="enSlider">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value" >
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2" >
|
||||
<widget class="QLabel" name="enLabel" >
|
||||
<property name="layoutDirection" >
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="enLabel">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>0.5</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Display Mode:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="enableCheckBox">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable Radiance Scaling</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Enhancement:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<spacer name="horizontalSpacer_2" >
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QCheckBox" name="invertCheckBox" >
|
||||
<property name="text" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="invertCheckBox">
|
||||
<property name="text">
|
||||
<string>Invert Effect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="doubleSideCheckBox">
|
||||
<property name="text">
|
||||
<string>Double side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3" >
|
||||
<item row="2" column="0" >
|
||||
<widget class="QLabel" name="litLabel1" >
|
||||
<property name="text" >
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="litLabel1">
|
||||
<property name="text">
|
||||
<string>Convexities</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QLabel" name="litLabel2" >
|
||||
<property name="text" >
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="litLabel2">
|
||||
<property name="text">
|
||||
<string>Concavities</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QCheckBox" name="litCheckBox" >
|
||||
<property name="layoutDirection" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="litCheckBox">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Use 2 Lit Spheres</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QPushButton" name="loadButton1" >
|
||||
<property name="text" >
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="loadButton1">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" >
|
||||
<widget class="QPushButton" name="loadButton2" >
|
||||
<property name="text" >
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="loadButton2">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="litIcon1" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="litIcon1">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QLabel" name="litIcon2" >
|
||||
<property name="text" >
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="litIcon2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
@ -204,30 +205,30 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="transitionTitle" >
|
||||
<property name="text" >
|
||||
<widget class="QLabel" name="transitionTitle">
|
||||
<property name="text">
|
||||
<string>Transition:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSlider" name="transitionSlider" >
|
||||
<property name="maximum" >
|
||||
<widget class="QSlider" name="transitionSlider">
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value" >
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="transitionLabel" >
|
||||
<property name="text" >
|
||||
<widget class="QLabel" name="transitionLabel">
|
||||
<property name="text">
|
||||
<string>0.5</string>
|
||||
</property>
|
||||
</widget>
|
||||
@ -235,11 +236,11 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer" >
|
||||
<property name="orientation" >
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
|
||||
@ -32,6 +32,7 @@ uniform float enhancement;
|
||||
uniform float transition;
|
||||
uniform bool enabled;
|
||||
uniform bool invert;
|
||||
uniform bool doubleSide;
|
||||
uniform int display;
|
||||
uniform bool twoLS;
|
||||
uniform sampler2D convexLS;
|
||||
@ -215,7 +216,7 @@ void main(void) {
|
||||
if(display==0)
|
||||
{
|
||||
// lambertian lighting
|
||||
float cosineTerm = max(dot(n,l),0.0);
|
||||
float cosineTerm = doubleSide ? max(dot(n,l),-dot(n,l)) : max(dot(n,l),0.0);
|
||||
float warpedTerm = enabled ? cosineTerm*warp(cosineTerm,c) : cosineTerm;
|
||||
gl_FragColor = vec4(m.rgb*warpedTerm,1.0);
|
||||
}
|
||||
|
||||
@ -29,7 +29,10 @@
|
||||
#include <common/filterscript.h>
|
||||
#include <common/meshlabdocumentxml.h>
|
||||
#include <common/mlexception.h>
|
||||
#include <common/filterparameter.h>
|
||||
#include <wrap/qt/qt_thread_safe_memory_info.h>
|
||||
#include "../meshlab/mainwindow.h"
|
||||
#include <clocale>
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
@ -619,11 +622,11 @@ struct OutProject
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
|
||||
FILE* logfp = stdout;
|
||||
FILE* dumpfp = NULL;
|
||||
MeshLabApplication app(argc, argv);
|
||||
std::setlocale(LC_ALL, "C");
|
||||
QLocale::setDefault(QLocale::C);
|
||||
if(argc == 1)
|
||||
{
|
||||
commandline::usage();
|
||||
@ -645,9 +648,17 @@ int main(int argc, char *argv[])
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
QSettings st;
|
||||
QVariant mbvar = st.value("MeshLab::System::maxGPUMemDedicatedToGeometry");
|
||||
std::ptrdiff_t maxgpumem = (std::ptrdiff_t)mbvar.toInt() * (float)(1024 * 1024);
|
||||
QSettings settings(MeshLabApplication::organization(),MeshLabApplication::appArchitecturalName(MeshLabApplication::HW_64BIT));
|
||||
|
||||
QVariant xmlgpupar = settings.value(MainWindowSetting::maximumDedicatedGPUMem());
|
||||
|
||||
QDomDocument doc;
|
||||
doc.setContent(xmlgpupar.toString(), false);
|
||||
|
||||
QDomElement paramelem = doc.firstChild().toElement();
|
||||
int gpumemmb = paramelem.attribute("value").toInt();
|
||||
|
||||
std::ptrdiff_t maxgpumem = (std::ptrdiff_t) gpumemmb * (float)(1024 * 1024);
|
||||
vcg::QtThreadSafeMemoryInfo gpumeminfo(maxgpumem);
|
||||
|
||||
MeshDocument meshDocument;
|
||||
|
||||
@ -83,7 +83,7 @@ void SampleEditPlugin::Decorate(MeshModel &m, GLArea * gla, QPainter *p)
|
||||
else if (pickmode == 1)
|
||||
{
|
||||
NewVertSel.clear();
|
||||
GLPickTri<CMeshO>::PickVert(cur.x(), gla->height() - cur.y(), m.cm, NewVertSel,10,10);
|
||||
GLPickTri<CMeshO>::PickVert(cur.x(), gla->height() - cur.y(), m.cm, NewVertSel,15,15);
|
||||
if (NewVertSel.size() > 0)
|
||||
{
|
||||
curVertPtr = NewVertSel[pIndex];
|
||||
@ -100,9 +100,9 @@ void SampleEditPlugin::Decorate(MeshModel &m, GLArea * gla, QPainter *p)
|
||||
QString line3 = "";
|
||||
|
||||
if (pickmode == 0)
|
||||
line1 = "Face Picking - SPACE for vertex<br>";
|
||||
line1 = "Face Picking - T for vertex<br>";
|
||||
else if (pickmode == 1)
|
||||
line1 = "Vertex Picking - SPACE for face<br>";
|
||||
line1 = "Vertex Picking - T for face<br>";
|
||||
|
||||
if ((curFacePtr != 0) || (curVertPtr != 0))
|
||||
{
|
||||
@ -207,9 +207,9 @@ void SampleEditPlugin::drawFace(CMeshO::FacePointer fp, MeshModel &m, GLArea *gl
|
||||
if (m.hasDataMask(MeshModel::MM_VERTCOLOR))
|
||||
buf += QString(" - color(%1 %2 %3 %4)").arg(QString::number(fp->V(i)->C()[0])).arg(QString::number(fp->V(i)->C()[1])).arg(QString::number(fp->V(i)->C()[2])).arg(QString::number(fp->V(i)->C()[3]));
|
||||
if( m.hasDataMask(MeshModel::MM_WEDGTEXCOORD) )
|
||||
buf +=QString(" - uv(%1 %2) id:%3").arg(QString::number(fp->WT(i).U())).arg(QString::number(fp->WT(i).V())).arg(QString::number(fp->WT(i).N()));
|
||||
buf +=QString(" - [W]uv(%1 %2) id:%3").arg(QString::number(fp->WT(i).U())).arg(QString::number(fp->WT(i).V())).arg(QString::number(fp->WT(i).N()));
|
||||
if( m.hasDataMask(MeshModel::MM_VERTTEXCOORD) )
|
||||
buf +=QString(" - uv(%1 %2) id:%3").arg(QString::number(fp->V(i)->T().U())).arg(QString::number(fp->V(i)->T().V())).arg(QString::number(fp->V(i)->T().N()));
|
||||
buf +=QString(" - [V]uv(%1 %2) id:%3").arg(QString::number(fp->V(i)->T().U())).arg(QString::number(fp->V(i)->T().V())).arg(QString::number(fp->V(i)->T().N()));
|
||||
|
||||
vcg::glLabel::render(p,fp->V(i)->P(),buf);
|
||||
}
|
||||
@ -224,14 +224,14 @@ void SampleEditPlugin::drawVert(CMeshO::VertexPointer vp, MeshModel &m, GLArea *
|
||||
if (m.hasDataMask(MeshModel::MM_VERTCOLOR))
|
||||
buf += QString(" - color(%1 %2 %3 %4)").arg(QString::number(vp->C()[0])).arg(QString::number(vp->C()[1])).arg(QString::number(vp->C()[2])).arg(QString::number(vp->C()[3]));
|
||||
if (m.hasDataMask(MeshModel::MM_VERTTEXCOORD))
|
||||
buf += QString(" - uv(%1 %2) id:%3").arg(QString::number(vp->T().U())).arg(QString::number(vp->T().V())).arg(QString::number(vp->T().N()));
|
||||
buf += QString(" - [V]uv(%1 %2) id:%3").arg(QString::number(vp->T().U())).arg(QString::number(vp->T().V())).arg(QString::number(vp->T().N()));
|
||||
|
||||
vcg::glLabel::render(p, vp->P(), buf);
|
||||
}
|
||||
|
||||
void SampleEditPlugin::keyReleaseEvent(QKeyEvent *e, MeshModel &m, GLArea *gla)
|
||||
{
|
||||
if (e->key() == Qt::Key_Space) // toggle pick mode
|
||||
if (e->key() == Qt::Key_T) // toggle pick mode
|
||||
{
|
||||
pickmode = (pickmode + 1) % 2;
|
||||
curFacePtr = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user