Commit 7a34104e authored by Nicolas Philipps's avatar Nicolas Philipps
Browse files

Added autoresetcamera option on TriangularMesh adaptor

--HG--
branch : fw4spl_0.6.1
extra : rebase_source : 703834e331e6fa8b45efd8639e681ba32e4bcdd0
parent 4377ceec
......@@ -102,6 +102,7 @@ protected:
bool m_showClippedPart;
double m_sharpEdgeAngle;
bool m_manageMapperInput;
bool m_autoResetCamera;
vtkAlgorithmOutput *m_mapperInput;
vtkPolyDataNormals *m_normals;
......
......@@ -458,6 +458,7 @@ void TriangularMesh::configuring() throw(fwTools::Failed)
{
assert(m_configuration->getName() == "config");
std::string autoresetcamera = m_configuration->getAttributeValue("autoresetcamera");
std::string color = m_configuration->getAttributeValue("color");
std::string unclippedColor = m_configuration->getAttributeValue("unclippedcolor");
......@@ -465,6 +466,8 @@ void TriangularMesh::configuring() throw(fwTools::Failed)
m_unclippedPartMaterial->ambient()->setRGBA(unclippedColor.empty() ? "#aaaaff44" : unclippedColor );
m_autoResetCamera = (autoresetcamera == "yes");
this->setPickerId ( m_configuration->getAttributeValue ( "picker" ) );
this->setRenderId ( m_configuration->getAttributeValue ( "renderer" ) );
this->setTransformId ( m_configuration->getAttributeValue ( "transform" ) );
......@@ -798,6 +801,11 @@ void TriangularMesh::updateTriangularMesh( ::fwData::TriangularMesh::sptr mesh )
polyData->Delete();
if (m_autoResetCamera)
{
this->getRenderer()->ResetCamera();
}
this->setVtkPipelineModified();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment