当前位置: 首页>>代码示例>>C++>>正文


C++ PropertyEditor::getGradientStops方法代码示例

本文整理汇总了C++中PropertyEditor::getGradientStops方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyEditor::getGradientStops方法的具体用法?C++ PropertyEditor::getGradientStops怎么用?C++ PropertyEditor::getGradientStops使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyEditor的用法示例。


在下文中一共展示了PropertyEditor::getGradientStops方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if


//.........这里部分代码省略.........
	      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;
}
开发者ID:Elavina6,项目名称:drishti,代码行数:101,代码来源:pathgroups.cpp

示例2: helpFile


//.........这里部分代码省略.........


  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;
}
开发者ID:beyondwolfeagle,项目名称:drishti,代码行数:101,代码来源:meshgenerator.cpp


注:本文中的PropertyEditor::getGradientStops方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。