mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-17 10:04:38 +00:00
- on mesh loading the best rendering tab parameters (according to the mesh primitive) is set by default
This commit is contained in:
parent
78abc399b7
commit
16f381ee86
@ -781,6 +781,34 @@ void LayerDialog::reset()
|
||||
_applytovis->setChecked(false);
|
||||
}
|
||||
|
||||
void LayerDialog::setCurrentTab(const MLRenderingData& dt)
|
||||
{
|
||||
if ((mw == NULL) || (mw->meshDoc() == NULL) || (mw->meshDoc()->mm() == NULL))
|
||||
return;
|
||||
MLRenderingAction* act = NULL;
|
||||
int id = mw->meshDoc()->mm()->id();
|
||||
if (dt.isPrimitiveActive(MLRenderingData::PR_SOLID))
|
||||
{
|
||||
act = new MLRenderingSolidAction(id, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dt.isPrimitiveActive(MLRenderingData::PR_WIREFRAME_EDGES))
|
||||
{
|
||||
act = new MLRenderingWireAction(id, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dt.isPrimitiveActive(MLRenderingData::PR_POINTS))
|
||||
{
|
||||
act = new MLRenderingPointsAction(id, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
actionActivated(act);
|
||||
delete act;
|
||||
}
|
||||
|
||||
void LayerDialog::updateRenderingParametersTab(int meshid,const MLRenderingData& dt )
|
||||
{
|
||||
if (_tabw != NULL)
|
||||
|
||||
@ -117,6 +117,7 @@ public:
|
||||
void updateDecoratorParsView();
|
||||
void updateRenderingParametersTab(int meshid,const MLRenderingData& dt);
|
||||
void reset();
|
||||
void setCurrentTab(const MLRenderingData& dt);
|
||||
MLRenderingParametersTab* createRenderingParametersTab();
|
||||
protected:
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
|
||||
@ -2717,8 +2717,17 @@ bool MainWindow::importMeshWithLayerManagement(QString fileName)
|
||||
globrendtoolbar->setEnabled(false);
|
||||
bool res = importMesh(fileName,false);
|
||||
globrendtoolbar->setEnabled(true);
|
||||
if (layerDialog != NULL)
|
||||
showLayerDlg(layervisible || meshDoc()->meshList.size());
|
||||
if (layerDialog != NULL)
|
||||
{
|
||||
showLayerDlg(layervisible || meshDoc()->meshList.size());
|
||||
MLSceneGLSharedDataContext* cont = currentViewContainer()->sharedDataContext();
|
||||
if ((cont != NULL) && (GLA() != NULL) && (meshDoc() != NULL) && (meshDoc()->mm() != NULL))
|
||||
{
|
||||
MLRenderingData dt;
|
||||
cont->getRenderInfoPerMeshView(meshDoc()->mm()->id(), GLA()->context(), dt);
|
||||
layerDialog->setCurrentTab(dt);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user