this->ui->pushButtonColorChooser->setIcon(QIcon(Color_xpm));
- this->ui->pushButtonSave->setIcon(QIcon(Save_xpm));
+ //this->ui->pushButtonSave->setIcon(QIcon(Save_xpm));
this->ui->pushButtonOpen->setIcon(QIcon(OpenImage_xpm));
+
+ this->ui->comboBoxSave->addItem(QIcon(Save_xpm), QString(""));
+ this->ui->comboBoxSave->addItem(QString("Save surface"));
+ this->ui->comboBoxSave->addItem(QString("Export image stencil"));
+ _ImageSet = false;
}
QtSurfaceRendererPanel::~QtSurfaceRendererPanel()
this->ui->horizontalSliderMaxIso->setRange(range[0], range[1]);
wxMaracasSurfaceRenderingManager::setImageData(img);
+ _ImageSet = true;
}
void QtSurfaceRendererPanel::on_OpacitySlider_valueChanged(int value)
void QtSurfaceRendererPanel::on_checkBox_clicked(bool checked)
{
- this->addRemoveActor(0, checked);
- if(!checked){
+ if(!this->addRemoveActor(0, checked)){
+ this->ui->checkBox->setChecked(false);
+ }else if(!checked){
this->ui->checkBoxBoundingBox->setCheckState(Qt::Unchecked);
this->on_checkBoxBoundingBox_clicked(false);
}
}
void QtSurfaceRendererPanel::onIsoValueChanged(){
- this->changeIsoValue(0, this->ui->horizontalSliderMinIso->value(), this->ui->horizontalSliderMaxIso->value());
+ if(_ImageSet)
+ this->changeIsoValue(0, this->ui->horizontalSliderMinIso->value(), this->ui->horizontalSliderMaxIso->value());
}
-void QtSurfaceRendererPanel::on_pushButtonSave_clicked()
+/*void QtSurfaceRendererPanel::on_pushButtonSave_clicked()
{
QString filename = QFileDialog::getSaveFileName(this,
tr("Save Mesh File"),
QDir::currentPath(),
- tr("Mesh files (*.stl *.ply)") );
+ tr("Mesh files (*.stl *.ply *.vtk)") );
if( !filename.isNull() ){
//filename.append(".stl");
this->saveProp3DSTL(0, filename.toStdString().c_str());
}
-}
+}*/
void QtSurfaceRendererPanel::on_checkBoxBoundingBox_clicked(bool checked)
{
void QtSurfaceRendererPanel::on_pushButtonOpen_clicked()
{
- QString filename = QFileDialog::getOpenFileName(this, tr("Load Mesh File"), QDir::currentPath(), tr("Mesh files (*.stl *.ply)"));
+ QString filename = QFileDialog::getOpenFileName(this, tr("Load Mesh File"), QDir::currentPath(), tr("Mesh files (*.stl *.ply *.vtk)"));
if(!filename.isNull()){
this->loadProp3DSTL(filename.toStdString().c_str());
+ this->ui->checkBox->setCheckState(Qt::Checked);
+ }
+}
+
+void QtSurfaceRendererPanel::on_comboBoxSave_activated(int index)
+{
+ if(index == 1){
+ QString filename = QFileDialog::getSaveFileName(this,
+ tr("Save Mesh File"),
+ QDir::currentPath(),
+ tr("Mesh files (*.stl *.ply *.vtk)") );
+
+ if( !filename.isNull() ){
+ //filename.append(".stl");
+ this->saveProp3DSTL(0, filename.toStdString().c_str());
+ }
+ }else if(index == 2){
+
+ QString filename = QFileDialog::getSaveFileName(this,
+ tr("Save Image File"),
+ QDir::currentPath(),
+ tr("Meta Image file (*.mhd)") );
+
+ if( !filename.isNull() ){
+
+ this->exportImageStencil(0, filename.toStdString().c_str());
+ }
}
+ this->ui->comboBoxSave->setCurrentIndex(0);
}