Exemplo n.º 1
0
bool
PropertySubEditor::eventFilter(QObject* /*watched*/, QEvent* e)
{
	if ( e->type() == QEvent::KeyPress ) // || e->type()==QEvent::AccelOverride)
	{
		QKeyEvent * ev = static_cast<QKeyEvent*>(e);
		PropertyEditor *list = dynamic_cast<PropertyEditor*>( parentWidget()->parentWidget() );
		if (!list)
			return false; //for sanity
		return list->handleKeyPress(ev);
	}
	return false;
}
	EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) {

		plugin=p_plugin;

		set_title(TTR("Single Mesh Import"));
		set_hide_on_ok(false);

		VBoxContainer *vbc = memnew( VBoxContainer );
		add_child(vbc);
		//set_child_rect(vbc);

		HBoxContainer *hbc = memnew( HBoxContainer );
		vbc->add_margin_child(TTR("Source Mesh(es):"),hbc);

		import_path = memnew( LineEdit );
		import_path->set_h_size_flags(SIZE_EXPAND_FILL);
		hbc->add_child(import_path);

		Button * import_choose = memnew( Button );
		import_choose->set_text(" .. ");
		hbc->add_child(import_choose);

		import_choose->connect("pressed", this,"_browse");

		hbc = memnew( HBoxContainer );
		vbc->add_margin_child(TTR("Target Path:"),hbc);

		save_path = memnew( LineEdit );
		save_path->set_h_size_flags(SIZE_EXPAND_FILL);
		hbc->add_child(save_path);

		Button * save_choose = memnew( Button );
		save_choose->set_text(" .. ");
		hbc->add_child(save_choose);

		save_choose->connect("pressed", this,"_browse_target");

		file_select = memnew( EditorFileDialog );
		file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
		file_select->set_mode(EditorFileDialog::MODE_OPEN_FILES);
		file_select->add_filter("*.obj ; Wavefront OBJ");
		add_child(file_select);
		file_select->connect("files_selected", this,"_choose_files");

		save_select = memnew( EditorDirDialog );
		add_child(save_select);
		save_select->connect("dir_selected", this,"_choose_save_dir");

		get_ok()->connect("pressed", this,"_import");
		get_ok()->set_text(TTR("Import"));

		error_dialog = memnew( AcceptDialog );
		add_child(error_dialog);

		options = memnew( _EditorMeshImportOptions );

		option_editor = memnew( PropertyEditor );
		option_editor->hide_top_label();
		vbc->add_margin_child(TTR("Options:"),option_editor,true);
	}
	void _notification(int p_what) {

		if (p_what==NOTIFICATION_ENTER_SCENE) {
			prop_edit->edit(options);
			_update_text();
		}
	}
	void _notification(int p_what) {


		if (p_what==NOTIFICATION_ENTER_TREE) {

			option_editor->edit(options);
		}
	}
Exemplo n.º 5
0
static QWidget * setupPropertyEditor(QWidget *widget, Model *model)
{
    PropertyEditor *properties = new PropertyEditor(widget);

    QString qmlDir = QDir::cleanPath(qApp->applicationDirPath() + QString("/../shared/propertyeditor/"));
    qDebug() << qmlDir;
    properties->setQmlDir(qmlDir);
    model->attachView(properties);
    QWidget *pane = properties->createPropertiesPage();
    pane->setParent(widget);
    widget->show();
    widget->resize(300, 800);
    qApp->processEvents();
    pane->resize(300, 800);
    pane->move(0,0);
    qApp->processEvents();
    QTest::qSleep(100);

    return pane;
}
Exemplo n.º 6
0
void
PreferencesWidget::showHelp()
{
  PropertyEditor propertyEditor;
  QMap<QString, QVariantList> plist;
  QVariantList vlist;

  vlist.clear();
  QFile helpFile(":/preferences.help");
  if (helpFile.open(QFile::ReadOnly))
    {
      QTextStream in(&helpFile);
      QString line = in.readLine();
      while (!line.isNull())
	{
	  if (line == "#begin")
	    {
	      QString keyword = in.readLine();
	      QString helptext;
	      line = in.readLine();
	      while (!line.isNull())
		{
		  helptext += line;
		  helptext += "\n";
		  line = in.readLine();
		  if (line == "#end") break;
		}
	      vlist << keyword << helptext;
	    }
	  line = in.readLine();
	}
    }
  plist["commandhelp"] = vlist;

  QStringList keys;
  keys << "commandhelp";

  propertyEditor.set("Preferences Help", plist, keys);
  propertyEditor.exec();

}
Exemplo n.º 7
0
bool
PathGroups::keyPressEvent(QKeyEvent *event)
{
  for(int i=0; i<m_paths.count(); i++)
    {
      if (m_paths[i]->grabsMouse())
	{
	  if (event->key() == Qt::Key_G)
	    {
	      m_paths[i]->removeFromMouseGrabberPool();
	      return true;
	    }
	  if (event->key() == Qt::Key_C)
	    {
	      bool b = m_paths[i]->closed();
	      m_paths[i]->setClosed(!b);
	      return true;
	    }
	  else if (event->key() == Qt::Key_P)
	    {
	      bool b = m_paths[i]->showPoints();
	      m_paths[i]->setShowPoints(!b);    
	      return true;
	    }
	  else if (event->key() == Qt::Key_L)
	    {
	      bool b = m_paths[i]->showLength();
	      m_paths[i]->setShowLength(!b);    
	      return true;
	    }
	  else if (event->key() == Qt::Key_X)
	    {
	      m_paths[i]->setMoveAxis(PathGroupGrabber::MoveX);
	      return true;
	    }
	  else if (event->key() == Qt::Key_Y)
	    {
	      if (event->modifiers() & Qt::ControlModifier ||
		  event->modifiers() & Qt::MetaModifier)
		m_paths[i]->redo();
	      else
		m_paths[i]->setMoveAxis(PathGroupGrabber::MoveY);
	      return true;
	    }
	  else if (event->key() == Qt::Key_Z)
	    {
	      if (event->modifiers() & Qt::ControlModifier ||
		  event->modifiers() & Qt::MetaModifier)
		m_paths[i]->undo();
	      else
		m_paths[i]->setMoveAxis(PathGroupGrabber::MoveZ);
	      return true;
	    }
	  else if (event->key() == Qt::Key_W)
	    {
	      m_paths[i]->setMoveAxis(PathGroupGrabber::MoveAll);
	      return true;
	    }
	  else if (event->key() == Qt::Key_S)
	    {
	      int idx = m_paths[i]->pointPressed();
	      if (idx > -1)
		{
		  float radx = m_paths[i]->getRadX(idx);
		  if (event->modifiers() & Qt::ShiftModifier)
		    radx--;
		  else
		    radx++;
		  radx = qMax(1.0f, radx);
		  m_paths[i]->setRadX(idx, radx, m_sameForAll);
		  return true;
		}
	    }
	  else if (event->key() == Qt::Key_T)
	    {
	      int idx = m_paths[i]->pointPressed();
	      if (idx > -1)
		{
		  float rady = m_paths[i]->getRadY(idx);
		  if (event->modifiers() & Qt::ShiftModifier)
		    rady--;
		  else
		    rady++;
		  rady = qMax(1.0f, rady);
		  m_paths[i]->setRadY(idx, rady, m_sameForAll);
		}
	      else // switch to tube mode
		{
		  if (event->modifiers() & Qt::ShiftModifier)
		    {
		      m_paths[i]->loadCaption();
		    }
		  else
		    {
		      bool b = m_paths[i]->tube();
		      m_paths[i]->setTube(!b);
		    }
		}

	      return true;
	    }
	  else if (event->key() == Qt::Key_A)
	    {
	      int idx = m_paths[i]->pointPressed();
	      if (idx > -1)
		{
		  float a = m_paths[i]->getAngle(idx);
		  if (event->modifiers() & Qt::ShiftModifier)
		    a--;
		  else
		    a++;
		  m_paths[i]->setAngle(idx, a, m_sameForAll);
		  return true;
		}
	    }
	  else if (event->key() == Qt::Key_Delete ||
		   event->key() == Qt::Key_Backspace ||
		   event->key() == Qt::Key_Backtab)
	    {
	      m_paths[i]->removeFromMouseGrabberPool();
	      m_paths.removeAt(i);
	      return true;
	    }

	  if (event->key() == Qt::Key_Space)
	    {
	      PropertyEditor propertyEditor;
	      QMap<QString, QVariantList> plist;

	      QVariantList vlist;

	      vlist.clear();
	      vlist << QVariant("double");
	      vlist << QVariant(m_paths[i]->opacity());
	      vlist << QVariant(0.0);
	      vlist << QVariant(1.0);
	      vlist << QVariant(0.1); // singlestep
	      vlist << QVariant(1); // decimals
	      plist["opacity"] = vlist;

	      vlist.clear();
	      vlist << QVariant("colorgradient");
	      QGradientStops stops = m_paths[i]->stops();
	      for(int s=0; s<stops.size(); s++)
		{
		  float pos = stops[s].first;
		  QColor color = stops[s].second;
		  int r = color.red();
		  int g = color.green();
		  int b = color.blue();
		  int a = color.alpha();
		  vlist << QVariant(pos);
		  vlist << QVariant(r);
		  vlist << QVariant(g);
		  vlist << QVariant(b);
		  vlist << QVariant(a);
		}
	      plist["color"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->filterPathLen());
	      plist["filter on length"] = vlist;

	      float vmin, vmax;
	      m_paths[i]->userPathlenMinmax(vmin, vmax);
	      vlist.clear();
	      vlist << QVariant("string");
	      vlist << QVariant(QString("%1 %2").arg(vmin).arg(vmax));
	      plist["length bounds"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->scaleType());
	      plist["scale type"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->depthcue());
	      plist["depthcue"] = vlist;

	      vlist.clear();
	      vlist << QVariant("int");
	      vlist << QVariant(m_paths[i]->segments());
	      vlist << QVariant(1);
	      vlist << QVariant(100);
	      plist["smoothness"] = vlist;

	      vlist.clear();
	      vlist << QVariant("int");
	      vlist << QVariant(m_paths[i]->sections());
	      vlist << QVariant(1);
	      vlist << QVariant(100);
	      plist["sections"] = vlist;

	      vlist.clear();
	      vlist << QVariant("int");
	      vlist << QVariant(m_paths[i]->sparseness());
	      vlist << QVariant(1);
	      vlist << QVariant(100);
	      plist["sparseness"] = vlist;

	      vlist.clear();
	      vlist << QVariant("int");
	      vlist << QVariant(m_paths[i]->separation());
	      vlist << QVariant(0);
	      vlist << QVariant(10);
	      plist["screen separation"] = vlist;

	      vlist.clear();
	      vlist << QVariant("combobox");
	      vlist << QVariant(m_paths[i]->capType());
	      vlist << QVariant("flat");
	      vlist << QVariant("round");
	      vlist << QVariant("arrow");
	      plist["cap style"] = vlist;

	      vlist.clear();
	      vlist << QVariant("combobox");
	      vlist << QVariant(m_paths[i]->arrowDirection());
	      vlist << QVariant("forward");
	      vlist << QVariant("backward");
	      plist["arrow direction"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->animate());
	      plist["animate"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->allowInterpolate());
	      plist["interpolate"] = vlist;

	      vlist.clear();
	      vlist << QVariant("int");
	      vlist << QVariant(m_paths[i]->animateSpeed());
	      vlist << QVariant(10);
	      vlist << QVariant(100);
	      plist["animation speed"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->arrowForAll());
	      plist["arrows for all"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_sameForAll);
	      plist["same for all"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->clip());
	      plist["clip"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->allowEditing());
	      plist["allow editing"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->blendMode());
	      plist["blend with volume"] = vlist;

	      vlist.clear();
	      plist["command"] = vlist;

	      vlist.clear();
	      QFile helpFile(":/pathgroups.help");
	      if (helpFile.open(QFile::ReadOnly))
		{
		  QTextStream in(&helpFile);
		  QString line = in.readLine();
		  while (!line.isNull())
		    {
		      if (line == "#begin")
			{
			  QString keyword = in.readLine();
			  QString helptext;
			  line = in.readLine();
			  while (!line.isNull())
			    {
			      helptext += line;
			      helptext += "\n";
			      line = in.readLine();
			      if (line == "#end") break;
			    }
			  vlist << keyword << helptext;
			}
		      line = in.readLine();
		    }
		}	      
	      plist["commandhelp"] = vlist;


	      vlist.clear();
	      QString mesg;
	      float pmin, pmax;
	      m_paths[i]->pathlenMinmax(pmin, pmax);
	      mesg = QString("min/max path lengths : %1 %2\n").arg(pmin).arg(pmax);
	      float mins,maxs;
	      mins = m_paths[i]->minScale();
	      maxs = m_paths[i]->maxScale();
	      mesg += QString("min/max scale : %1 %2\n").arg(mins).arg(maxs);
	      vlist << mesg;
	      plist["message"] = vlist;


	      QStringList keys;
	      keys << "color";
	      keys << "opacity";
	      keys << "depthcue";
	      keys << "gap";
	      keys << "filter on length";
	      keys << "length bounds";
	      keys << "scale type";
	      keys << "gap";
	      keys << "smoothness";
	      keys << "sections";
	      keys << "sparseness";
	      keys << "screen separation";
	      keys << "gap";
	      keys << "cap style";
	      keys << "arrow direction";
	      keys << "arrows for all";
	      keys << "gap";
	      keys << "animate";
	      keys << "interpolate";
	      keys << "animation speed";
	      keys << "gap";
	      keys << "same for all";
	      keys << "clip";
	      keys << "blend with volume";
	      keys << "allow editing";
	      keys << "command";
	      keys << "commandhelp";
	      keys << "message";
	      

	      propertyEditor.set("Path Group Parameters", plist, keys);

	      
	      QMap<QString, QPair<QVariant, bool> > vmap;

	      if (propertyEditor.exec() == QDialog::Accepted)
		vmap = propertyEditor.get();
	      else
		return true;

	      keys = vmap.keys();

	      for(int ik=0; ik<keys.count(); ik++)
		{
		  QPair<QVariant, bool> pair = vmap.value(keys[ik]);


		  if (pair.second)
		    {
		      if (keys[ik] == "color")
			{
			  QGradientStops stops = propertyEditor.getGradientStops(keys[ik]);
			  m_paths[i]->setStops(stops);
			}
		      else if (keys[ik] == "opacity")
			m_paths[i]->setOpacity(pair.first.toDouble());
		      else if (keys[ik] == "scale type")
			m_paths[i]->setScaleType(pair.first.toBool());
		      else if (keys[ik] == "sections")
			m_paths[i]->setSections(pair.first.toInt());
		      else if (keys[ik] == "smoothness")
			m_paths[i]->setSegments(pair.first.toInt());
		      else if (keys[ik] == "sparseness")
			m_paths[i]->setSparseness(pair.first.toInt());
		      else if (keys[ik] == "screen separation")
			m_paths[i]->setSeparation(pair.first.toInt());
		      else if (keys[ik] == "depthcue")
			m_paths[i]->setDepthcue(pair.first.toBool());
		      else if (keys[ik] == "animate")
			m_paths[i]->setAnimate(pair.first.toBool());
		      else if (keys[ik] == "interpolate")
			m_paths[i]->setAllowInterpolate(pair.first.toBool());
		      else if (keys[ik] == "animation speed")
			m_paths[i]->setAnimateSpeed(pair.first.toInt());
		      else if (keys[ik] == "cap style")
			m_paths[i]->setCapType(pair.first.toInt());
		      else if (keys[ik] == "arrow direction")
			m_paths[i]->setArrowDirection(pair.first.toInt());
		      else if (keys[ik] == "arrows for all")
			m_paths[i]->setArrowForAll(pair.first.toBool());
		      else if (keys[ik] == "same for all")
			{
			  m_sameForAll = pair.first.toBool();
			  m_paths[i]->setSameForAll(m_sameForAll);
			}
		      else if (keys[ik] == "clip")
			m_paths[i]->setClip(pair.first.toBool());
		      else if (keys[ik] == "allow editing")
			m_paths[i]->setAllowEditing(pair.first.toBool());
		      else if (keys[ik] == "blend with volume")
			m_paths[i]->setBlendMode(pair.first.toBool());
		      else if (keys[ik] == "filter on length")
			m_paths[i]->setFilterPathLen(pair.first.toBool());
		      else if (keys[ik] == "length bounds")
			{
			  QString vstr = pair.first.toString();
			  QStringList vl = vstr.split(" ", QString::SkipEmptyParts);
			  if (vl.count() == 2)
			    m_paths[i]->setUserPathlenMinmax(vl[0].toDouble(),
							     vl[1].toDouble());
			}
		    }
		}

	      QString cmd = propertyEditor.getCommandString();
	      if (!cmd.isEmpty())
		processCommand(i, cmd);	
	      	      
	      updateGL();
	    }
	}
    }
  
  return true;
}
Exemplo n.º 8
0
bool
ClipObject::commandEditor()
{
  PropertyEditor propertyEditor;
  QMap<QString, QVariantList> plist;
  QVariantList vlist;
  vlist.clear();
  plist["command"] = vlist;


  vlist.clear();
  vlist << QVariant("double");
  vlist << QVariant(m_opacity);
  vlist << QVariant(0.0);
  vlist << QVariant(1.0);
  vlist << QVariant(0.1); // singlestep
  vlist << QVariant(1); // decimals
  plist["opacity"] = vlist;
  
  vlist.clear();
  vlist << QVariant("color");
  Vec pcolor = m_color;
  QColor dcolor = QColor::fromRgbF(pcolor.x,
				   pcolor.y,
				   pcolor.z);
  vlist << dcolor;
  plist["color"] = vlist;
  
  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_apply);
  plist["apply clipping"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(m_tfset);
  vlist << QVariant(-1);
  vlist << QVariant(15);
  plist["tfset"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(m_thickness);
  vlist << QVariant(0);
  vlist << QVariant(200);
  plist["thickness"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_solidColor);
  plist["solid color"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_showSlice);
  plist["show slice"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_showThickness);
  plist["show thickness"] = vlist;

  vlist.clear();
  vlist << QVariant("combobox");
  if (m_viewportType)
    vlist << QVariant(1);
  else
    vlist << QVariant(0);
  vlist << QVariant("orthographic");
  vlist << QVariant("perspective");
  plist["camera type"] = vlist;

  vlist.clear();
  vlist << QVariant("double");
  vlist << QVariant(m_stereo);
  vlist << QVariant(0.0);
  vlist << QVariant(1.0);
  vlist << QVariant(0.1); // singlestep
  vlist << QVariant(1); // decimals
  plist["stereo"] = vlist;
  
  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_showOtherSlice);
  plist["show other slice"] = vlist;


  QString vpstr = QString("%1 %2 %3 %4").\
                  arg(m_viewport.x()).\
                  arg(m_viewport.y()).\
                  arg(m_viewport.z()).\
                  arg(m_viewport.w());
  vlist.clear();
  vlist << QVariant("string");
  vlist << QVariant(vpstr);
  plist["viewport"] = vlist;

  vlist.clear();
  vlist << QVariant("double");
  vlist << QVariant(m_viewportScale);
  vlist << QVariant(0.5);
  vlist << QVariant(30.0);
  vlist << QVariant(0.1); // singlestep
  vlist << QVariant(1); // decimals
  plist["viewport scale"] = vlist;  


  vlist.clear();
  QFile helpFile(":/clipobject.help");
  if (helpFile.open(QFile::ReadOnly))
    {
      QTextStream in(&helpFile);
      QString line = in.readLine();
      while (!line.isNull())
	{
	  if (line == "#begin")
	    {
	      QString keyword = in.readLine();
	      QString helptext;
	      line = in.readLine();
	      while (!line.isNull())
		{
		  helptext += line;
		  helptext += "\n";
		  line = in.readLine();
		  if (line == "#end") break;
		}
	      vlist << keyword << helptext;
	    }
	  line = in.readLine();
	}
    }
  
  plist["commandhelp"] = vlist;
  
  //---------------------
  vlist.clear();
  QString mesg;
  if (m_scale1 < 0 || m_scale2 < 0)
    mesg += QString("scales : %1 %2\n").arg(-m_scale1).arg(-m_scale2);
  else
    mesg += QString("vscales : %1 %2\n").arg(m_scale1).arg(m_scale2);

  mesg += QString("opacity : %1\n").arg(m_opacity);
  mesg += QString("position : %1 %2 %3\n").			\
    arg(m_position.x).arg(m_position.y).arg(m_position.z);

  Quaternion q = orientation();
  Vec axis;
  qreal angle;
  q.getAxisAngle(axis, angle);
  mesg += QString("rotation : %1 %2 %3 : %4\n").			\
    arg(axis.x).arg(axis.y).arg(axis.z).arg(RAD2DEG(angle));
  
  
  mesg += QString("Red axis : %1 %2 %3\n").		\
    arg(m_xaxis.x).arg(m_xaxis.y).arg(m_xaxis.z);
  mesg += QString("Green axis : %1 %2 %3\n").		\
    arg(m_yaxis.x).arg(m_yaxis.y).arg(m_yaxis.z);
  mesg += QString("Blue axis : %1 %2 %3\n").		\
    arg(m_tang.x).arg(m_tang.y).arg(m_tang.z);
  
  vlist << mesg;
  
  plist["message"] = vlist;
  //---------------------



  QStringList keys;
  keys << "apply clipping";
  keys << "solid color";
  keys << "show slice";
  keys << "show thickness";
  keys << "show other slice";
  keys << "gap";
  keys << "color";
  keys << "opacity";
  keys << "gap";
  keys << "viewport";
  keys << "tfset";
  keys << "thickness";
  keys << "viewport scale";
  keys << "camera type";
  keys << "stereo";
  keys << "gap";
  keys << "command";
  keys << "commandhelp";
  keys << "message";
  
  propertyEditor.set("Clip Plane Dialog", plist, keys);
  
  QMap<QString, QPair<QVariant, bool> > vmap;

  if (propertyEditor.exec() == QDialog::Accepted)
    vmap = propertyEditor.get();
  else
    return true;
	      
  keys = vmap.keys();

  for(int ik=0; ik<keys.count(); ik++)
    {
      QPair<QVariant, bool> pair = vmap.value(keys[ik]);
      
      
      if (pair.second)
	{
	  if (keys[ik] == "color")
	    {
	      QColor color = pair.first.value<QColor>();
	      float r = color.redF();
	      float g = color.greenF();
	      float b = color.blueF();
	      m_color = Vec(r,g,b);
	    }
	  else if (keys[ik] == "opacity")
	    m_opacity = pair.first.toDouble();
	  else if (keys[ik] == "solid color")
	    m_solidColor = pair.first.toBool();
	  else if (keys[ik] == "apply clipping")
	    m_apply = pair.first.toBool();
	  else if (keys[ik] == "show slice")
	    m_showSlice = pair.first.toBool();
	  else if (keys[ik] == "show thickness")
	    m_showThickness = pair.first.toBool();
	  else if (keys[ik] == "show other slice")
	    m_showOtherSlice = pair.first.toBool();
	  else if (keys[ik] == "tfset")
	    m_tfset = pair.first.toInt();
	  else if (keys[ik] == "thickness")
	    m_thickness = pair.first.toInt();
	  else if (keys[ik] == "viewport scale")
	    m_viewportScale = pair.first.toDouble();
	  else if (keys[ik] == "camera type")
	    m_viewportType = (pair.first.toInt() == 1);
	  else if (keys[ik] == "stereo")
	    m_stereo = pair.first.toDouble();
	  else if (keys[ik] == "viewport")
	    {
	      vpstr = pair.first.toString();
	      QStringList list = vpstr.split(" ", QString::SkipEmptyParts);
	      if (list.count() == 4)
		{
		  float x = list[0].toFloat();
		  float y = list[1].toFloat();
		  float z = list[2].toFloat();
		  float w = list[3].toFloat();
		  if (x < 0.0f || x > 1.0f ||
		      y < 0.0f || y > 1.0f ||
		      z < 0.0f || z > 1.0f ||
		      w < 0.0f || w > 1.0f)
		    QMessageBox::information(0, "",
		      QString("Values for viewport must be between 0.0 and 1.0 : %1 %2 %3 %4").\
					     arg(x).arg(y).arg(z).arg(w));
		  else
		    m_viewport = QVector4D(x,y,z,w);
		}
	      else if (list.count() == 3)
		{
		  float x = list[0].toFloat();
		  float y = list[1].toFloat();
		  float z = list[2].toFloat();
		  if (x < 0.0f || x > 1.0f ||
		      y < 0.0f || y > 1.0f ||
		      z < 0.0f || z > 1.0f)
		    QMessageBox::information(0, "",
		      QString("Values for viewport must be between 0.0 and 1.0 : %1 %2 %3").\
					     arg(x).arg(y).arg(z));
		  else
		    m_viewport = QVector4D(x,y,z,z);
		}
	      else if (list.count() == 2)
		{
		  float x = list[0].toFloat();
		  float y = list[1].toFloat();
		  if (x < 0.0f || x > 1.0f ||
		      y < 0.0f || y > 1.0f)
		    QMessageBox::information(0, "",
		      QString("Values for viewport must be between 0.0 and 1.0 : %1 %2").\
					     arg(x).arg(y));
		  else
		    m_viewport = QVector4D(x,y,0.5,0.5);
		}
	      else
		{
		  QMessageBox::information(0, "", "Switching off the viewport");
		  m_viewport = QVector4D(-1,-1,-1,-1);
		}
	    }
	}
    }

  QString cmd = propertyEditor.getCommandString();
  if (!cmd.isEmpty())
    return processCommand(cmd);
  else
    return true;

//  if (propertyEditor.exec() == QDialog::Accepted)
//    {
//      QString cmd = propertyEditor.getCommandString();
//      if (!cmd.isEmpty())
//	return processCommand(cmd);
//    }
//  else
//    return true;
}
Exemplo n.º 9
0
PropertyEditor::PropertyEditor(const PropertyEditor& metadata, QObject *parent) : QObject(parent), Ilwis::Identity(metadata.name())
{
    _qmlUrl = metadata._qmlUrl;
}
Exemplo n.º 10
0
	EditorSampleImportDialog(EditorSampleImportPlugin *p_plugin) {

		plugin=p_plugin;


		set_title("Import Audio Samples");

		VBoxContainer *vbc = memnew( VBoxContainer );
		add_child(vbc);
		set_child_rect(vbc);


		HBoxContainer *hbc = memnew( HBoxContainer );
		vbc->add_margin_child("Source Sample(s):",hbc);

		import_path = memnew( LineEdit );
		import_path->set_h_size_flags(SIZE_EXPAND_FILL);
		hbc->add_child(import_path);

		Button * import_choose = memnew( Button );
		import_choose->set_text(" .. ");
		hbc->add_child(import_choose);

		import_choose->connect("pressed", this,"_browse");

		hbc = memnew( HBoxContainer );
		vbc->add_margin_child("Target Path:",hbc);

		save_path = memnew( LineEdit );
		save_path->set_h_size_flags(SIZE_EXPAND_FILL);
		hbc->add_child(save_path);

		Button * save_choose = memnew( Button );
		save_choose->set_text(" .. ");
		hbc->add_child(save_choose);

		save_choose->connect("pressed", this,"_browse_target");

		file_select = memnew(FileDialog);
		file_select->set_access(FileDialog::ACCESS_FILESYSTEM);
		add_child(file_select);
		file_select->set_mode(FileDialog::MODE_OPEN_FILES);
		file_select->connect("files_selected", this,"_choose_files");
		file_select->add_filter("*.wav ; MS Waveform");
		save_select = memnew(	EditorDirDialog );
		add_child(save_select);

	//	save_select->set_mode(FileDialog::MODE_OPEN_DIR);
		save_select->connect("dir_selected", this,"_choose_save_dir");

		get_ok()->connect("pressed", this,"_import");
		get_ok()->set_text("Import");


		error_dialog = memnew ( ConfirmationDialog );
		add_child(error_dialog);
		error_dialog->get_ok()->set_text("Accept");
	//	error_dialog->get_cancel()->hide();

		set_hide_on_ok(false);
		options = memnew( _EditorSampleImportOptions );

		option_editor = memnew( PropertyEditor );
		option_editor->hide_top_label();
		vbc->add_margin_child("Options:",option_editor,true);
	}
Exemplo n.º 11
0
	EditorFontImportDialog(EditorFontImportPlugin *p_plugin) {
		plugin=p_plugin;
		VBoxContainer *vbc = memnew( VBoxContainer );
		add_child(vbc);
		set_child_rect(vbc);
		HBoxContainer *hbc = memnew( HBoxContainer);
		vbc->add_child(hbc);
		VBoxContainer *vbl = memnew( VBoxContainer );
		hbc->add_child(vbl);
		hbc->set_v_size_flags(SIZE_EXPAND_FILL);
		vbl->set_h_size_flags(SIZE_EXPAND_FILL);
		VBoxContainer *vbr = memnew( VBoxContainer );
		hbc->add_child(vbr);
		vbr->set_h_size_flags(SIZE_EXPAND_FILL);

		source = memnew( LineEditFileChooser );
		source->get_file_dialog()->set_access(FileDialog::ACCESS_FILESYSTEM);
		source->get_file_dialog()->set_mode(FileDialog::MODE_OPEN_FILE);
		source->get_file_dialog()->add_filter("*.ttf;TrueType");
		source->get_file_dialog()->add_filter("*.otf;OpenType");
		source->get_line_edit()->connect("text_entered",this,"_src_changed");

		vbl->add_margin_child("Source Font:",source);
		font_size = memnew( SpinBox );
		vbl->add_margin_child("Source Font Size:",font_size);
		font_size->set_min(3);
		font_size->set_max(256);
		font_size->set_val(16);
		font_size->connect("value_changed",this,"_font_size_changed");
		dest = memnew( LineEditFileChooser );
		//
		List<String> fl;
		Ref<Font> font= memnew(Font);
		dest->get_file_dialog()->add_filter("*.fnt ; Font" );
		//ResourceSaver::get_recognized_extensions(font,&fl);
		//for(List<String>::Element *E=fl.front();E;E=E->next()) {
		//	dest->get_file_dialog()->add_filter("*."+E->get());
		//}

		vbl->add_margin_child("Dest Resource:",dest);
		HBoxContainer *testhb = memnew( HBoxContainer );
		test_string = memnew( LineEdit );
		test_string->set_text("The quick brown fox jumps over the lazy dog.");
		test_string->set_h_size_flags(SIZE_EXPAND_FILL);
		test_string->set_stretch_ratio(5);

		testhb->add_child(test_string);
		test_color = memnew( ColorPickerButton );
		test_color->set_color(get_color("font_color","Label"));
		test_color->set_h_size_flags(SIZE_EXPAND_FILL);
		test_color->set_stretch_ratio(1);
		test_color->connect("color_changed",this,"_update_text3");
		testhb->add_child(test_color);

		vbl->add_spacer();
		vbl->add_margin_child("Test: ",testhb);
		HBoxContainer *upd_hb = memnew( HBoxContainer );
//		vbl->add_child(upd_hb);
		upd_hb->add_spacer();
		Button *update = memnew( Button);
		upd_hb->add_child(update);
		update->set_text("Update");
		update->connect("pressed",this,"_update");

		options = memnew( _EditorFontImportOptions );
		prop_edit = memnew( PropertyEditor() );
		vbr->add_margin_child("Options:",prop_edit,true);
		options->connect("changed",this,"_prop_changed");

		prop_edit->hide_top_label();

		Panel *panel = memnew( Panel );
		vbc->add_child(panel);
		test_label = memnew( Label );
		test_label->set_autowrap(true);
		panel->add_child(test_label);
		test_label->set_area_as_parent_rect();
		panel->set_v_size_flags(SIZE_EXPAND_FILL);
		test_string->connect("text_changed",this,"_update_text2");
		set_title("Font Import");
		timer = memnew( Timer );
		add_child(timer);
		timer->connect("timeout",this,"_update");
		timer->set_wait_time(0.4);
		timer->set_one_shot(true);

		get_ok()->connect("pressed", this,"_import");
		get_ok()->set_text("Import");

		error_dialog = memnew ( ConfirmationDialog );
		add_child(error_dialog);
		error_dialog->get_ok()->set_text("Accept");
		set_hide_on_ok(false);


	}
FilterBankPluginUI::FilterBankPluginUI(QWidget *p_parent,FilterBankPlugin *p_filterbank) : SoundPluginUI(p_parent,p_filterbank) {
	
	CHBox *hb = generate_default_layout();
	
	CVBox *fb_vb = new CVBox(hb);
	
	new PixmapLabel( fb_vb, GET_QPIXMAP(THEME_FILTERBANK__TOP));
	
	CHBox *fb_hb = new CHBox(fb_vb);
	
	new PixmapLabel( fb_hb, GET_QPIXMAP(THEME_FILTERBANK__LEFT));
		
	CVBox *fb_ctrls = new CVBox(fb_hb);
	
	static const PixmapsList ctrl_separators[4]={THEME_FILTERBANK__CONTROLS_TOP,THEME_FILTERBANK__SEPARATOR_1,THEME_FILTERBANK__SEPARATOR_2,THEME_FILTERBANK__SEPARATOR_3};
	
	for (int i=0;i<4;i++) {
		String n_prefix=String("filter_")+String::num(i+1)+"_";
		new PixmapLabel( fb_ctrls, GET_QPIXMAP(ctrl_separators[i]) );		
		CHBox *ctrl_hb = new CHBox(fb_ctrls);
		PropertyEditor *combo = new PropertyEditCombo(ctrl_hb,GET_QPIXMAP( THEME_FILTERBANK__COMBO ) );
		combo->set_property( &p_filterbank->get_port_by_name( n_prefix+"mode" ));
		register_property_editor( combo );
		
		new PixmapLabel( ctrl_hb, GET_QPIXMAP( THEME_FILTERBANK__COMBO_STR_SEPARATOR ) );		
		
		PropertyEditor *str = new PropertyEditLabel(ctrl_hb,GET_QPIXMAP( THEME_FILTERBANK__STR_DISPLAY ) );
		str->set_property( &p_filterbank->get_port_by_name( n_prefix+"stages" ));
		register_property_editor( str );
		PropertyEditor *str_ud = new PropertyEditUpDown(ctrl_hb,PixmapUpDown::Skin( GET_QPIXMAP( THEME_FILTERBANK__STR_UPDOWN ) ) );
		str_ud->set_property( &p_filterbank->get_port_by_name( n_prefix+"stages" ));
		str_ud->add_to_group(str);
		register_property_editor( str_ud );
		
	}
	
	new PixmapLabel( fb_hb, GET_QPIXMAP(THEME_FILTERBANK__CONTROLS_DISPLAY_SEPARATOR));
	
	CVBox *fb_disp_vb = new CVBox(fb_hb);
	
	FilterBankEditor::Skin fbe_sk( GET_QPIXMAP(THEME_FILTERBANK__DISPLAY), QColor(210,220,240), 2 );
	
	FilterBankEditor *fbe = new FilterBankEditor( fb_disp_vb, 4, fbe_sk );
	
	for (int i=0;i<4;i++) {
		String n_prefix=String("filter_")+String::num(i+1)+"_";
		
		fbe->set_cutoff_property( i, &p_filterbank->get_port_by_name( n_prefix+"cutoff" ) );
		fbe->set_resonance_property( i, &p_filterbank->get_port_by_name( n_prefix+"resonance" ) );
		fbe->set_stages_property( i, &p_filterbank->get_port_by_name( n_prefix+"stages" ) );
		fbe->set_mode_property( i, &p_filterbank->get_port_by_name( n_prefix+"mode" ) );
	}
	
	fbe->set_cutoff_offset_property( &p_filterbank->get_port_by_name( "global_cutoff" ) );
	register_property_editor( fbe );
	new PixmapLabel( fb_disp_vb, GET_QPIXMAP(THEME_FILTERBANK__DISPLAY_OCTAVE_SEPARATOR));
	
	CHBox *octave_hb = new CHBox(fb_disp_vb);
	
	PixmapSlider::Skin sl_sk = PixmapSlider::Skin( GET_QPIXMAP(THEME_FILTERBANK__OCTAVE_SLIDER),GET_QPIXMAP(THEME_FILTERBANK__OCTAVE_SLIDER),GET_QPIXMAP(THEME_FILTERBANK__OCTAVE_SLIDER_GRABBER) );
	
	PropertyEditor *octave_sl = new PropertyEditSlider(octave_hb,sl_sk,PixmapSlider::TYPE_HORIZONTAL,0,0);
	octave_sl->set_property( &p_filterbank->get_port_by_name( "global_cutoff" ) );
	register_property_editor( octave_sl );
	
	new PixmapLabel( octave_hb, GET_QPIXMAP(THEME_FILTERBANK__OCTAVE_SEPARATOR));
	
	PropertyEditLabel *octave_label = new PropertyEditLabel(octave_hb,GET_QPIXMAP(THEME_FILTERBANK__OCTAVE_DISPLAY));
	octave_label->set_property( &p_filterbank->get_port_by_name( "global_cutoff" ) );
	register_property_editor( octave_label );
	octave_label->add_to_group(octave_sl);
	octave_label->set_suffix_visible( false );
	
	new PixmapLabel( fb_hb, GET_QPIXMAP(THEME_FILTERBANK__RIGHT));
	
	new PixmapLabel( fb_vb, GET_QPIXMAP(THEME_FILTERBANK__BOTTOM));
	
	
}
Exemplo n.º 13
0
bool
MeshGenerator::getValues(int &depth,
			 int &fillValue,
			 bool &checkForMore,
			 bool &lookInside,
			 QGradientStops &stops,
			 bool doBorder,
			 int &chan,
			 bool &avgColor)
{
  chan = 0;
  depth = 1;
  fillValue = -1;
  checkForMore = true;
  lookInside = false;
  avgColor = false;
  m_useTagColors = false;
  m_scaleModel = 1.0;
  QGradientStops vstops;
  vstops << QGradientStop(0.0, QColor(50 ,50 ,50 ,255))
	 << QGradientStop(0.5, QColor(200,150,100,255))
	 << QGradientStop(1.0, QColor(255,255,255,255));

  if (doBorder) fillValue = 0;
  
  PropertyEditor propertyEditor;
  QMap<QString, QVariantList> plist;
  
  QVariantList vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(avgColor);
  plist["average color"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_useTagColors);
  plist["apply tag colors"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(chan);
  vlist << QVariant(0);
  vlist << QVariant(2);
  plist["mop channel"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(depth);
  vlist << QVariant(0);
  vlist << QVariant(200);
  plist["depth"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(fillValue);
  vlist << QVariant(-1);
  vlist << QVariant(255);
  plist["fillvalue"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(checkForMore);
  plist["greater"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(lookInside);
  plist["look inside"] = vlist;

  vlist.clear();
  vlist << QVariant("float");
  vlist << QVariant(m_scaleModel);
  vlist << QVariant(0.001);
  vlist << QVariant(1.0);
  vlist << QVariant(0.005); // singlestep
  vlist << QVariant(3); // decimals
  plist["scale"] = vlist;

  vlist.clear();
  vlist << QVariant("colorgradient");
  for(int s=0; s<vstops.size(); s++)
    {
      float pos = vstops[s].first;
      QColor color = vstops[s].second;
      int r = color.red();
      int g = color.green();
      int b = color.blue();
      int a = color.alpha();
      vlist << QVariant(pos);
      vlist << QVariant(r);
      vlist << QVariant(g);
      vlist << QVariant(b);
      vlist << QVariant(a);
    }
  plist["color gradient"] = vlist;


  vlist.clear();
  QFile helpFile(":/mesh.help");
  if (helpFile.open(QFile::ReadOnly))
    {
      QTextStream in(&helpFile);
      QString line = in.readLine();
      while (!line.isNull())
	{
	  if (line == "#begin")
	    {
	      QString keyword = in.readLine();
	      QString helptext;
	      line = in.readLine();
	      while (!line.isNull())
		{
		  helptext += line;
		  helptext += "\n";
		  line = in.readLine();
		  if (line == "#end") break;
		}
	      vlist << keyword << helptext;
	    }
	  line = in.readLine();
	}
    }	      
  plist["commandhelp"] = vlist;

  vlist.clear();
  QString mesg;
  mesg += "File : "+m_vfm->fileName()+"\n";
  int d = m_vfm->depth();
  int w = m_vfm->width();
  int h = m_vfm->height();
  mesg += QString("Volume Size : %1 %2 %3\n").arg(h).arg(w).arg(d);
  mesg += QString("Data Min : %1 %2 %3\n").arg(m_dataMin.x).arg(m_dataMin.y).arg(m_dataMin.z);
  mesg += QString("Data Max : %1 %2 %3\n").arg(m_dataMax.x).arg(m_dataMax.y).arg(m_dataMax.z);

  if (m_voxelType > 0)
    mesg += "\n ** Only opacity based surface generation available for unsigned short data **\n";

  mesg += "\n* You can keep on working while this process is running.\n";
  vlist << mesg;
  plist["message"] = vlist;


  QStringList keys;
  keys << "average color";
  keys << "apply tag colors";
  keys << "mop channel";
  keys << "isosurface value";
  keys << "depth";
  keys << "fillvalue";
  keys << "scale";
  keys << "greater";
  keys << "look inside";
  keys << "color gradient";
  keys << "commandhelp";
  keys << "message";

  propertyEditor.set("Mesh Repainting Parameters", plist, keys);
  QMap<QString, QPair<QVariant, bool> > vmap;
  
  if (propertyEditor.exec() == QDialog::Accepted)
    vmap = propertyEditor.get();
  else
    return false;
  
  for(int ik=0; ik<keys.count(); ik++)
    {
      QPair<QVariant, bool> pair = vmap.value(keys[ik]);

      if (pair.second)
	{
	  if (keys[ik] == "average color")
	    avgColor = pair.first.toBool();
	  else if (keys[ik] == "apply tag colors")
	    m_useTagColors = pair.first.toBool();
	  else if (keys[ik] == "mop channel")
	    chan = pair.first.toInt();
	  else if (keys[ik] == "color gradient")
	    vstops = propertyEditor.getGradientStops(keys[ik]);
	  else if (keys[ik] == "scale")
	    m_scaleModel = pair.first.toFloat();
	  else if (keys[ik] == "depth")
	    depth = pair.first.toInt();
	  else if (keys[ik] == "fillvalue")
	    fillValue = pair.first.toInt();
	  else if (keys[ik] == "greater")
	    checkForMore = pair.first.toBool();
	  else if (keys[ik] == "look inside")
	    lookInside = pair.first.toBool();
	}
    }

  stops = resampleGradientStops(vstops);

  return true;
}
Exemplo n.º 14
0
bool
Grids::keyPressEvent(QKeyEvent *event)
{
  for(int i=0; i<m_grids.count(); i++)
    {
      if (m_grids[i]->grabsMouse())
	{
	  if (event->key() == Qt::Key_P)
	    {
	      bool b = m_grids[i]->showPoints();
	      m_grids[i]->setShowPoints(!b);    
	      return true;
	    }
	  else if (event->key() == Qt::Key_N)
	    {
	      bool b = m_grids[i]->showPointNumbers();
	      m_grids[i]->setShowPointNumbers(!b);    
	      return true;
	    }
	  else if (event->key() == Qt::Key_X)
	    {
	      m_grids[i]->setMoveAxis(GridGrabber::MoveX);
	      return true;
	    }
	  else if (event->key() == Qt::Key_Y)
	    {
	      if (event->modifiers() & Qt::ControlModifier ||
		  event->modifiers() & Qt::MetaModifier)
		m_grids[i]->redo();
	      else
		m_grids[i]->setMoveAxis(GridGrabber::MoveY);
	      return true;
	    }
	  else if (event->key() == Qt::Key_Z)
	    {
	      if (event->modifiers() & Qt::ControlModifier ||
		  event->modifiers() & Qt::MetaModifier)
		m_grids[i]->undo();
	      else
		m_grids[i]->setMoveAxis(GridGrabber::MoveZ);
	      return true;
	    }
	  else if (event->key() == Qt::Key_W)
	    {
	      m_grids[i]->setMoveAxis(GridGrabber::MoveAll);
	      return true;
	    }
	  else if (event->key() == Qt::Key_Delete ||
		   event->key() == Qt::Key_Backspace ||
		   event->key() == Qt::Key_Backtab)
	    {
	      m_grids[i]->removeFromMouseGrabberPool();
	      m_grids.removeAt(i);
	      return true;
	    }
	  
	  if (event->key() == Qt::Key_Space)
	    {
	      PropertyEditor propertyEditor;
	      QMap<QString, QVariantList> plist;

	      QVariantList vlist;

	      vlist.clear();
	      vlist << QVariant("double");
	      vlist << QVariant(m_grids[i]->opacity());
	      vlist << QVariant(0.0);
	      vlist << QVariant(1.0);
	      vlist << QVariant(0.1); // singlestep
	      vlist << QVariant(1); // decimals
	      plist["opacity"] = vlist;

	      vlist.clear();
	      vlist << QVariant("color");
	      Vec pcolor = m_grids[i]->color();
	      QColor dcolor = QColor::fromRgbF(pcolor.x,
					       pcolor.y,
					       pcolor.z);
	      vlist << dcolor;
	      plist["color"] = vlist;

	      vlist.clear();
	      plist["command"] = vlist;


	      vlist.clear();
	      QFile helpFile(":/grids.help");
	      if (helpFile.open(QFile::ReadOnly))
		{
		  QTextStream in(&helpFile);
		  QString line = in.readLine();
		  while (!line.isNull())
		    {
		      if (line == "#begin")
			{
			  QString keyword = in.readLine();
			  QString helptext;
			  line = in.readLine();
			  while (!line.isNull())
			    {
			      helptext += line;
			      helptext += "\n";
			      line = in.readLine();
			      if (line == "#end") break;
			    }
			  vlist << keyword << helptext;
			}
		      line = in.readLine();
		    }
		}	      
	      plist["commandhelp"] = vlist;

	      QStringList keys;
	      keys << "color";
	      keys << "opacity";
	      keys << "gap";
	      keys << "command";
	      keys << "commandhelp";
	      

	      propertyEditor.set("Grid Parameters", plist, keys);

	      
	      QMap<QString, QPair<QVariant, bool> > vmap;

	      if (propertyEditor.exec() == QDialog::Accepted)
		vmap = propertyEditor.get();
	      else
		return true;
	      
	      keys = vmap.keys();

	      for(int ik=0; ik<keys.count(); ik++)
		{
		  QPair<QVariant, bool> pair = vmap.value(keys[ik]);


		  if (pair.second)
		    {
		      if (keys[ik] == "color")
			{
			  QColor color = pair.first.value<QColor>();
			  float r = color.redF();
			  float g = color.greenF();
			  float b = color.blueF();
			  pcolor = Vec(r,g,b);
			  m_grids[i]->setColor(pcolor);
			}
		      else if (keys[ik] == "opacity")
			m_grids[i]->setOpacity(pair.first.toDouble());
		    }
		}

	      QString cmd = propertyEditor.getCommandString();
	      if (!cmd.isEmpty())
		processCommand(i, cmd);	
	      
 	      emit updateGL();
	    }
	}
    }
  
  return true;
}