mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
- added support for switching among per wedge/vertex texture coords
This commit is contained in:
parent
2a927cb607
commit
e32c1ed7ef
@ -652,6 +652,7 @@ void MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(MeshMod
|
||||
tmpatts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true;
|
||||
tmpatts[MLRenderingData::ATT_NAMES::ATT_VERTCOLOR] = true;
|
||||
tmpatts[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE] = true;
|
||||
tmpatts[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE] = true;
|
||||
dt.set(MLRenderingData::PR_SOLID,tmpatts);
|
||||
}
|
||||
else
|
||||
@ -664,7 +665,6 @@ void MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(MeshMod
|
||||
tmpatts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true;
|
||||
tmpatts[MLRenderingData::ATT_NAMES::ATT_VERTCOLOR] = true;
|
||||
dt.set(MLRenderingData::PR_WIREFRAME_EDGES,tmpatts);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -747,8 +747,19 @@ void LayerDialog::updateRenderingParametersTab(int meshid,const MLRenderingData&
|
||||
if (tabw != NULL)
|
||||
{
|
||||
tabw->setAssociatedMeshId(meshid);
|
||||
if ((mw != NULL) && (mw->meshDoc() != NULL))
|
||||
tabw->updateVisibility(mw->meshDoc()->getMesh(meshid));
|
||||
MeshModel* mm;
|
||||
if ((mw != NULL) && (mw->meshDoc() != NULL))
|
||||
{
|
||||
mm = mw->meshDoc()->getMesh(meshid);
|
||||
if (mm != NULL)
|
||||
{
|
||||
if (mm->hasDataMask(MeshModel::MM_VERTTEXCOORD) && !(mm->hasDataMask(MeshModel::MM_WEDGTEXCOORD)))
|
||||
tabw->setTextureAction(MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE);
|
||||
else
|
||||
tabw->setTextureAction(MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE);
|
||||
tabw->updateVisibility(mm);
|
||||
}
|
||||
}
|
||||
tabw->updateGUIAccordingToRenderingData(dt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,8 +66,10 @@ void MLRenderingToolbar::toggle( QAction* act)
|
||||
|
||||
void MLRenderingToolbar::setAccordingToRenderingData(const MLRenderingData& dt)
|
||||
{
|
||||
foreach(MLRenderingAction* rendact,_acts)
|
||||
rendact->setChecked(rendact->isRenderingDataEnabled(dt));
|
||||
foreach(MLRenderingAction* rendact, _acts)
|
||||
{
|
||||
rendact->setChecked(rendact->isRenderingDataEnabled(dt));
|
||||
}
|
||||
}
|
||||
|
||||
void MLRenderingToolbar::setAssociatedMeshId( int meshid )
|
||||
@ -388,6 +390,23 @@ void MLRenderingSolidParametersFrame::allTopLevelGuiActions(QList<QAction*>& tpl
|
||||
tplevelactions.append(_texttool->actions());
|
||||
}
|
||||
|
||||
void MLRenderingSolidParametersFrame::setTextureAction(MLRenderingData::ATT_NAMES textattname)
|
||||
{
|
||||
if (textattname == MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE)
|
||||
{
|
||||
MLRenderingPerWedgeTextCoordAction* wedact = new MLRenderingPerWedgeTextCoordAction(_meshid, this);
|
||||
_texttool->setRenderingAction(wedact);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (textattname == MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE)
|
||||
{
|
||||
MLRenderingPerVertTextCoordAction* vertact = new MLRenderingPerVertTextCoordAction(MLRenderingData::PR_SOLID, this);
|
||||
_texttool->setRenderingAction(vertact);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MLRenderingWireParametersFrame::MLRenderingWireParametersFrame( QWidget* parent )
|
||||
:MLRenderingParametersFrame(-1,parent)
|
||||
{
|
||||
@ -468,7 +487,7 @@ void MLRenderingWireParametersFrame::initGui()
|
||||
connect(_dimension,SIGNAL(updateRenderingDataAccordingToAction(int,MLRenderingAction*)),this,SIGNAL(updateRenderingDataAccordingToAction(int,MLRenderingAction*)));
|
||||
connect(_dimension, SIGNAL(updateRenderingDataAccordingToAction(int, MLRenderingAction*, bool)), this, SIGNAL(updateRenderingDataAccordingToAction(int, MLRenderingAction*, bool)));
|
||||
|
||||
QLabel* wirelab = new QLabel("Wire Modality",this);
|
||||
QLabel* wirelab = new QLabel("Polygonal Modality",this);
|
||||
wirelab->setFont(boldfont);
|
||||
layout->addWidget(wirelab,3,0,Qt::AlignLeft);
|
||||
_edgetool = new MLRenderingOnOffToolbar(_meshid,this);
|
||||
@ -1029,6 +1048,15 @@ void MLRenderingParametersTab::actionsList(QList<MLRenderingAction*>& actions)
|
||||
}
|
||||
}
|
||||
|
||||
void MLRenderingParametersTab::setTextureAction(MLRenderingData::ATT_NAMES textattname)
|
||||
{
|
||||
for (QMap<QString, MLRenderingParametersFrame*>::iterator it = _parframe.begin(); it != _parframe.end(); ++it)
|
||||
{
|
||||
if (it.value() != NULL)
|
||||
it.value()->setTextureAction(textattname);
|
||||
}
|
||||
}
|
||||
|
||||
MLRenderingParametersTab::~MLRenderingParametersTab()
|
||||
{
|
||||
for(QMap<QString,MLRenderingParametersFrame*>::iterator it = _parframe.begin();it != _parframe.end();++it)
|
||||
|
||||
@ -236,6 +236,7 @@ public:
|
||||
virtual void getCurrentRenderingDataAccordingToGUI(MLRenderingData& dt) const = 0;
|
||||
virtual void actionsList(QList<MLRenderingAction*>& actions) = 0;
|
||||
virtual void allTopLevelGuiActions(QList<QAction*>& tplevelactions) = 0;
|
||||
virtual void setTextureAction(MLRenderingData::ATT_NAMES textattname) {}
|
||||
virtual void updateVisibility(MeshModel*) {}
|
||||
static MLRenderingParametersFrame* factory(MLRenderingAction* act, int meshid, QWidget* parent);
|
||||
static void destroy(MLRenderingParametersFrame* pf);
|
||||
@ -283,6 +284,7 @@ public:
|
||||
void updateVisibility(MeshModel* mm);
|
||||
void actionsList(QList<MLRenderingAction*>& actions);
|
||||
void allTopLevelGuiActions(QList<QAction*>& tplevelactions);
|
||||
void setTextureAction(MLRenderingData::ATT_NAMES textattname);
|
||||
|
||||
private:
|
||||
void initGui();
|
||||
@ -425,6 +427,7 @@ public:
|
||||
void updatePerMeshRenderingAction(QList<MLRenderingAction*>& acts);
|
||||
void actionsList(QList<MLRenderingAction*>& actions);
|
||||
|
||||
void setTextureAction(MLRenderingData::ATT_NAMES textattname);
|
||||
|
||||
private:
|
||||
void initGui(const QList<MLRenderingAction*>& tab);
|
||||
|
||||
@ -155,11 +155,12 @@ void MLRenderingWireAction::createSisterAction(MLRenderingAction *& sisteract, Q
|
||||
void MLRenderingWireAction::updateRenderingData(MLRenderingData& rd )
|
||||
{
|
||||
rd.set(MLRenderingData::PR_WIREFRAME_TRIANGLES,isChecked());
|
||||
//rd.set(MLRenderingData::PR_WIREFRAME_EDGES, isChecked());
|
||||
}
|
||||
|
||||
bool MLRenderingWireAction::isRenderingDataEnabled( const MLRenderingData& rd ) const
|
||||
{
|
||||
return rd.isPrimitiveActive(MLRenderingData::PR_WIREFRAME_TRIANGLES);
|
||||
return (rd.isPrimitiveActive(MLRenderingData::PR_WIREFRAME_TRIANGLES) /*|| rd.isPrimitiveActive(MLRenderingData::PR_WIREFRAME_EDGES)*/);
|
||||
}
|
||||
|
||||
MLRenderingSolidAction::MLRenderingSolidAction( QObject* parent )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user