• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ resolution函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中resolution函数的典型用法代码示例。如果您正苦于以下问题:C++ resolution函数的具体用法?C++ resolution怎么用?C++ resolution使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: xofxi

scalar KasmiMassonHill::calcHeight(scalar dist, scalar xi0, scalar xi1) const{

	// equal:
	if(xi0 == xi1) return zofxi(xi0);

	// calc x values at boundaries:
	scalar x0 = xofxi(xi0);
	scalar x1 = xofxi(xi1);

	// if close enough, return mean height:
	scalar d0 = mag(x0 - dist);
	scalar d1 = mag(x1 - dist);

	if(d0 <= resolution() && d1 <= resolution()){

		// calc heights
		scalar z0 = zofxi(xi0);
		scalar z1 = zofxi(xi1);

		return d1 / (d0 + d1) * z0 + d0 / (d0 + d1) * z1;

	}

	// calc middle xi and x there:
	scalar xi = 0.5 * (xi0 + xi1);
	scalar x  = xofxi(xi);

	// call again:
	if(x <= dist) return calcHeight(dist,xi,xi1);
	return calcHeight(dist,xi0,xi);

}
开发者ID:acimpoeru,项目名称:terrainBlockMesher,代码行数:32,代码来源:KasmiMassonHill.C


示例2: QPoint

QPoint OutputConfig::position(void) const
{
    if( !isActive())
        return QPoint();
    int index = positionCombo->currentIndex();
    if((Relation)positionCombo->itemData(index).toInt() == Absolute)
        return QPoint(absolutePosX->value(), absolutePosY->value());

    foreach(OutputConfig *config, precedingOutputConfigs)
    {
        if( config->output()->id()
            == positionOutputCombo->itemData( positionOutputCombo->currentIndex()).toUInt())
        {
            QPoint pos = config->position();
            switch( (Relation)positionCombo->itemData(index).toInt())
            {
                case LeftOf:
                    return QPoint( pos.x() - resolution().width(), pos.y());
                case RightOf:
                    return QPoint( pos.x() + config->resolution().width(), pos.y());
                case Over:
                    return QPoint( pos.x(), pos.y() - resolution().height());
                case Under:
                    return QPoint( pos.x(), pos.y() + config->resolution().height());
                case SameAs:
                    return pos;
                default:
                    abort();
            }
        }
    }
    return QPoint(0, 0);
}
开发者ID:Kermit,项目名称:lxqt-config-randr,代码行数:33,代码来源:outputconfig.cpp


示例3: resolution

void KasmiMassonHill::calcAll(){

	// init and fill height list:
	heightTable_ = HashTable<scalar>( a_ / resolution() + 1);
	for(label i = 0; i < heightTable_.size(); i++){
		scalar d = i * resolution();
		heightTable_.set(hkey(d), calcHeight(d, 0., a_));
	}

}
开发者ID:acimpoeru,项目名称:terrainBlockMesher,代码行数:10,代码来源:KasmiMassonHill.C


示例4: fopen

void GeospatialBoundingBox::exportInformationFile()	{

	FILE *file_ptr = fopen(_format("%s.info",file_name.c_str()).c_str(), "w");
	fprintf(file_ptr, "centroid: %f %f %f\n", centroid(0), centroid(1), centroid(2));
	fprintf(file_ptr, "resolution: %f %f %f\n",resolution(0), resolution(1), resolution(2));
	fprintf(file_ptr, "min_pt: %f %f %f\n", min_pt(0), min_pt(1), min_pt(2));
	fprintf(file_ptr, "max_pt: %f %f %f\n", max_pt(0), max_pt(1), max_pt(2));
	fprintf(file_ptr, "points: %d\n", number_of_points);
	fclose(file_ptr);
	return;
}
开发者ID:charalambos,项目名称:StructurePointcloud,代码行数:11,代码来源:GeospatialBoundingBox.cpp


示例5: main

int main(int argc, char *argv[])
{
	BoundingBox	bbox(vcg::Point3i(-20, -20, -20), vcg::Point3i(20, 20, 20));
	vcg::Point3i			resolution(40, 40, 40);
	
	Volume	volume;
	Walker	walker(bbox, resolution);

	typedef vcg::tri::MarchingCubes<Mesh, Walker>					MarchingCubes;
	typedef vcg::tri::ExtendedMarchingCubes<Mesh, Walker> ExtendedMarchingCubes;

	
	
	// MARCHING CUBES
	Mesh		mc_mesh;
	printf("[MARCHING CUBES] Building mesh...");
	MarchingCubes					mc(mc_mesh, walker);
	walker.BuildMesh<MarchingCubes>(mc_mesh, volume, mc);
	vcg::tri::io::ExporterPLY<Mesh>::Save( mc_mesh, "marching_cubes.ply");
	printf("OK!\n");

	// EXTENDED MARCHING CUBES
	Mesh		emc_mesh;
	printf("[EXTENDED MARCHING CUBES] Building mesh...");
	ExtendedMarchingCubes emc(emc_mesh, walker, 30);
	walker.BuildMesh<ExtendedMarchingCubes>(emc_mesh, volume, emc);
	vcg::tri::io::ExporterPLY<Mesh>::Save( emc_mesh, "extended_marching_cubes.ply");
	printf("OK!\n");
};
开发者ID:caomw,项目名称:quality-driven-poisson-guided-autoscanning,代码行数:29,代码来源:main.cpp


示例6: defined

void PocoTimestamp::update()
{
#if defined(NIT_FAMILY_WIN32)

	FILETIME ft;
	GetSystemTimeAsFileTime(&ft);
	ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME
	epoch.LowPart  = 0xD53E8000;
	epoch.HighPart = 0x019DB1DE;

	ULARGE_INTEGER ts;
	ts.LowPart  = ft.dwLowDateTime;
	ts.HighPart = ft.dwHighDateTime;
	ts.QuadPart -= epoch.QuadPart;
	_ts = ts.QuadPart/10;

#else

	struct timeval tv;
	if (gettimeofday(&tv, NULL))
		NIT_THROW_FMT(EX_SYSTEM, "cannot get time of day");
	_ts = TimeVal(tv.tv_sec)*resolution() + tv.tv_usec;

#endif
}
开发者ID:noriter,项目名称:nit,代码行数:25,代码来源:Legacy_Poco.cpp


示例7: resolution

int			resolution(char ***addr_square, t_chain *list, int tetriminos)
{
	int		line;
	int		column;
	char	letter;
	int		i;

	if (check_resolved(addr_square, &letter, &i, tetriminos))
		return (1);
	if (i)
		list = list->next;
	line = -1;
	while ((*addr_square)[++line])
	{
		column = -1;
		while ((*addr_square)[line][++column])
		{
			if (insert_tetrimino(addr_square, list->tetrimino, line, column))
			{
				if (resolution(addr_square, list, tetriminos))
					return (1);
			}
			erase_tetrimino(addr_square, letter);
		}
	}
	return (0);
}
开发者ID:NobuX,项目名称:42,代码行数:27,代码来源:resolution.c


示例8: calc_imaginary

static void calc_imaginary(fitinfo *fit)
{
  assert(fit->datatype == FIT_IMAGINARY);

  /* Generate reflectivity amplitude from the profile */
  reflectivity_imag(fit->p.n, fit->p.d, fit->p.rho,
		    fit->p.mu, fit->beam.lambda, fit->beam.alignment,
		    fit->nQ, fit->fitQ, fit->fitA);

  /* FIXME need to support repeated Q with different resolution. For
     the resolution case, this simply means making sure that enough
   */
  assert(fit->nQ == fit->dataA.n);

  /* Compute the convolution of the reflectivity */
  /* FIXME can you simply convolve the real reflectivity? */
  if (fit->work != NULL) {
    resolution(fit->nQ, fit->fitQ, fit->fitA,
               fit->dataA.n, fit->dataA.Q, fit->dataA.dQ, fit->work);
    memcpy(fit->fitA, fit->work, sizeof(Real)*fit->dataA.n);
  }

  /* FIXME sumsq is now based on data Q values rather than
   * theory Q values, so we have grounding problems. */
  assert(fit->work != NULL);
}
开发者ID:reflectometry,项目名称:garefl,代码行数:26,代码来源:fit.c


示例9: apply_beam_parameters

static void apply_beam_parameters(fitinfo *fit, Real *cross_section,
				  fitdata *data)
{
  /* Account for back absorption, background and intensity.
   * Strictly speaking background and intensity should be
   * applied after resolution is calculated, but mathematically
   * it is equivalent to apply them before or after.  Back absorption,
   * which varies with Q, must be applied before resolution.
   */
  beam_apply(&fit->beam, fit->nQ, fit->fitQ, cross_section);

  /* Compute the convolution of the reflectivity */
  if (fit->work != NULL) {
    /* FIXME We are not allocating enough storage for multiple measurements
       with different resolution.  Make sure that we fail in a controlled
       way until we have a chance to fix this. */
    assert(data->n <= fit->nQ);
    resolution(fit->nQ, fit->fitQ, cross_section,
               data->n, data->Q, data->dQ, fit->work);
    memcpy(cross_section, fit->work, sizeof(Real)*data->n);
  } else {
    assert(data->n == fit->nQ);
    /* FIXME --- with no resolution, need to copy/interpolate raw data
       values at data->Q from the computed values at fit->fitQ.
    */
  }
  /* FIXME sumsq is now based on data Q values rather than
   * theory Q values, so we have grounding problems. */
  assert(fit->work != NULL);
}
开发者ID:reflectometry,项目名称:garefl,代码行数:30,代码来源:fit.c


示例10: url

// Copy constructor with all the parameter and copy constructor for constructor with request and mimetype as parameter.
void tst_QMediaResource::copyConstructor()
{
    // Initialise all the parameters.
    const QUrl url(QString::fromLatin1("http://test.com/test.mp4"));
    const QString mimeType(QLatin1String("video/mp4"));
    const QString amrCodec(QLatin1String("amr"));
    const QString h264Codec(QLatin1String("h264"));

    const qint64 dataSize(23600);
    int audioBitRate = 1, sampleRate = 2, channelCount = 3, videoBitRate = 4;
    QSize resolution(QSize(640, 480));
    QString language("eng");

    // Create the instance with url and mimetype.
    QMediaResource original(url, mimeType);

    // Set all the parameters.
    original.setAudioCodec(amrCodec);
    original.setLanguage(QString("eng"));
    original.setVideoCodec(h264Codec);
    original.setDataSize(dataSize);
    original.setAudioBitRate(audioBitRate);
    original.setSampleRate(sampleRate);
    original.setChannelCount(channelCount);
    original.setVideoBitRate(videoBitRate);
    original.setResolution(resolution);

    // Copy the instance to new object.
    QMediaResource copy(original);

    // Verify all the parameters of the copied object.
    QCOMPARE(copy.url(), url);
    QCOMPARE(copy.mimeType(), mimeType);
    QCOMPARE(copy.audioCodec(), amrCodec);
    QCOMPARE(copy.language(), language );
    QCOMPARE(copy.videoCodec(), h264Codec);
    QCOMPARE(copy.dataSize(), dataSize);
    QCOMPARE(copy.audioBitRate(), audioBitRate);
    QCOMPARE(copy.sampleRate(), sampleRate);
    QCOMPARE(copy.channelCount(), channelCount);
    QCOMPARE(copy.videoBitRate(), videoBitRate);
    QCOMPARE(copy.resolution(), resolution);

    // Compare both the objects are equal.
    QCOMPARE(original == copy, true);
    QCOMPARE(original != copy, false);

    // Initialise the request parameter.
    QNetworkRequest request1(QUrl(QString::fromLatin1("http://test.com/test.mp4")));

    // Constructor with rerquest and mimetype.
    QMediaResource original1(request1, mimeType);

    // Copy the object and verify if both are eqaul or not.
    QMediaResource copy1(original1);
    QCOMPARE(copy1.url(), url);
    QCOMPARE(copy1.mimeType(), mimeType);
    QCOMPARE(copy1.request(), request1);
    QCOMPARE(original1 == copy1, true);
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:61,代码来源:tst_qmediaresource.cpp


示例11: painter

void ZebraPaintEngine::drawText ( const QPointF &p, const QString & text, const QFont &font )
{
  QTransform transform = painter()->worldTransform();

  int xInDots = (int)(transform.dx());
  int yInDots = (int)(transform.dy());

  int carHeight = (font.pointSize() * resolution()) / 72;
  const int minSize = 10;
  if(carHeight < minSize) {
    carHeight = minSize;
  }
  int carWidth = qRound((carHeight * 15.0) / 28.0); // fixed width/height ratio for the scalable A0 font

  QString rotation = transformRotationCmd();
  if(rotation == rotation90Cmd()) {
    xInDots -= carHeight;
  }
  else if(rotation == rotation180Cmd()) {
    yInDots -= carHeight;
    xInDots -= (carWidth * text.length());
  }
  else if(rotation == rotation270Cmd()) {
    yInDots -= (carWidth * text.length());
  }

  QString output = QString(m_CmdPrefix + "FO%1,%2" + m_CmdPrefix + "FW%3").arg(xInDots).arg(yInDots).arg(rotation);
  output += QString(m_CmdPrefix + "A0,%1,0" + m_CmdPrefix + "FD" + text + m_CmdPrefix + "FS\n").arg(carHeight);

  QTextCodec *codec = QTextCodec::codecForName("IBM 850");
  m_printBuffer.append(codec->fromUnicode(output));
}
开发者ID:bunhin,项目名称:openrpt,代码行数:32,代码来源:zebrapaintengine.cpp


示例12: reader

void VolumeSeriesSource::openSeries() {
    if(volumeHandle_)
        delete volumeHandle_;
    volumeHandle_ = 0;

    try {
        TextFileReader reader(filename_.get());
        if (!reader)
            throw tgt::FileNotFoundException("Reading sdat file failed", filename_.get());

        std::string type;
        std::istringstream args;
        std::string format, model;
        tgt::ivec3 resolution(0);
        tgt::vec3 sliceThickness(1.f);
        spreadMin_ = 0.f;
        spreadMax_ = 0.f;

        files_.clear();
        std::string blockfile;

        while (reader.getNextLine(type, args, false)) {
            if (type == "ObjectFileName:") {
                std::string s;
                args >> s;
                LDEBUG(type << " " << s);
                files_.push_back(tgt::FileSystem::dirName(filename_.get()) + "/" + s);
            } else if (type == "Resolution:") {
                args >> resolution[0];
                args >> resolution[1];
                args >> resolution[2];
                LDEBUG(type << " " << resolution[0] << " x " <<
                       resolution[1] << " x " << resolution[2]);
            } else if (type == "SliceThickness:") {
开发者ID:bsmr-opengl,项目名称:voreen,代码行数:34,代码来源:volumeseriessource.cpp


示例13: move

void	move(int keycode, t_init *st)
{
	if (keycode == 123)
	{
		st->x1 += 0.1 / (0.01 * st->zoom);
		st->x2 -= 0.1 / (0.01 * st->zoom);
	}
	if (keycode == 124)
	{
		st->x1 -= 0.1 / (0.01 * st->zoom);
		st->x2 += 0.1 / (0.01 * st->zoom);;
	}
	if (keycode == 125)
	{
		st->y1 -= 0.1 / (0.01 * st->zoom);
		st->y2 += 0.1 / (0.01 * st->zoom);
	}
	if (keycode == 126)
	{
		st->y1 += 0.1 / (0.01 * st->zoom);
		st->y2 -= 0.1 / (0.01 * st->zoom);
	}
	mlx_clear_window(st->mlx, st->win);
	resolution(*st);
	mlx_put_image_to_window(st->mlx, st->win, st->link,
			st->pos_x_image, st->pos_y_image);
}
开发者ID:tandrieu42,项目名称:Fractol,代码行数:27,代码来源:hook.c


示例14: split

int Step::createCsi(
  QString const     &addLine,
  QStringList const &csiParts,  // the partially assembles model
  QPixmap           *pixmap,
  Meta              &meta)
{
  qreal       modelScale = meta.LPub.assem.modelScale.value();
  int         sn = stepNumber.number;
  
  // 1 color x y z a b c d e f g h i foo.dat
  // 0 1     2 3 4 5 6 7 8 9 0 1 2 3 4
  QStringList tokens;
  split(addLine,tokens);
  QString orient;
  if (tokens.size() == 15) {
    for (int i = 5; i < 14; i++) {
      orient += "_" + tokens[i];
    }
  }
  QString key = QString("%1_%2_%3_%4_%5_%6")
                        .arg(csiName()+orient)
                        .arg(sn)
                        .arg(meta.LPub.page.size.valuePixels(0))
                        .arg(resolution())
                        .arg(resolutionType() == DPI ? "DPI" : "DPCM")
                        .arg(modelScale);
  QString fileName = QDir::currentPath() + "/" +
                      Paths::assemDir + "/" + key + ".png";
  QFile csi(fileName);

  bool outOfDate = false;
  
  if (csi.exists()) {
    QDateTime lastModified = QFileInfo(fileName).lastModified();    
    QStringList stack = submodelStack();
    stack << parent->modelName();
    if ( ! isOlder(stack,lastModified)) {
      outOfDate = true;
    }
  }

  if ( ! csi.exists() || outOfDate) {

    int        rc;

    // render the partially assembled model

    rc = renderer->renderCsi(addLine,csiParts, fileName, meta);

    if (rc < 0) {
      return rc;
    }
  } 
  pixmap->load(fileName);
  csiPlacement.size[0] = pixmap->width();
  csiPlacement.size[1] = pixmap->height();

  return 0;
}
开发者ID:nathaneltitane,项目名称:lpub,代码行数:59,代码来源:step.cpp


示例15: resolution

void QSFMLCanvas::resizeGL(int width, int height)
{
  Vector3 resolution(width,height,32);
  
  setResolution(resolution);
  
  glViewport(0,0,width,height);
}
开发者ID:jsmtux,项目名称:Op3nD,代码行数:8,代码来源:QSFMLCanvas.cpp


示例16: _format

void GeospatialBoundingBox::load(int index, std::string *base_file_name)	{

	if (base_file_name)	{
		file_name = (*base_file_name);
	}
	else	{
		file_name = _format("geo_bbox_%d.xyz.info",index);
	}

	FILE *file_ptr = fopen(file_name.c_str(), "r");
	fscanf(file_ptr,"centroid: %f %f %f\n",&centroid(0), &centroid(1), &centroid(2));
	fscanf(file_ptr,"resolution: %f %f %f\n",&resolution(0), &resolution(1), &resolution(2));
	fscanf(file_ptr,"min_pt: %f %f %f\n",&min_pt(0), &min_pt(1), &min_pt(2));
	fscanf(file_ptr,"max_pt: %f %f %f\n",&max_pt(0), &max_pt(1), &max_pt(2));
	fscanf(file_ptr,"points: %d\n", &number_of_points);
	fclose(file_ptr);
	return;
}
开发者ID:charalambos,项目名称:StructurePointcloud,代码行数:18,代码来源:GeospatialBoundingBox.cpp


示例17: customInitString

bool 	ZebraPaintEngine::begin ( QPaintDevice * pdev )
{
  QString init = m_CmdPrefix + "XA" + m_CmdPrefix + "LRY";

  if(!customInitString().isEmpty()) {
    init += customInitString();
  }
  else {
    int height = m_parentPrinter->paperRect().height() * (resolution()/72.0); // ?? doc says that paperRect() is in device coordinates, but we get it in PS points
    int width = m_parentPrinter->paperRect().width() * (resolution()/72.0);
    init += QString(m_CmdPrefix + "LL%1" + m_CmdPrefix + "PW%2" + m_CmdPrefix + "CI8").arg(height).arg(width);
  }

  init += "\n";

  m_printBuffer.append(init);
  return true;
}
开发者ID:bunhin,项目名称:openrpt,代码行数:18,代码来源:zebrapaintengine.cpp


示例18: main

int main ()
{
   char vertex_shader[512];
   char fragment_shader[512];
   char geometry_shader[512];

   
   
   int terminate = 0;
   GLfloat cx, cy;
   bcm_host_init();

   // Clear application state
   memset( state, 0, sizeof( *state ) );
      
   // Start OGLES
   init_ogl(state);


   glm::vec3 resolution((float)state->screen_width,(float)state->screen_height,0.0f);


   cx = state->screen_width/2;
   cy = state->screen_height/2;
   state->verbose=1;

   Shader shader(vertex_shader, fragment_shader,geometry_shader);
   init_shaders(state);
   
   //glBindAttribLocation (shader.Program, 0 , "position");
   shader.linkProg();
   shader.Use();
   state->program=shader.Program;

   GLint resLoc = glGetUniformLocation(shader.Program, "iResolution");
   glUniform3f(resLoc,resolution.x,resolution.y,resolution.z);
   GLfloat currentTime = 0.0f;

   GLint timeLoc = glGetUniformLocation(shader.Program, "time");
   glUniform1f(timeLoc,currentTime);
   
   //draw_mandelbrot_to_texture(state, cx, cy, 0.003);
   while (!terminate)
   {
      int x, y, b;
      currentTime=currentTime+0.02;
      
      timeLoc = glGetUniformLocation(shader.Program, "time");
      glUniform1f(timeLoc,currentTime);
      
      b = get_mouse(state, &x, &y);
      if (b) break;
      draw_triangles(state, cx, cy, 0.003, x, y);
   }
   return 0;
}
开发者ID:Ebiroll,项目名称:pi3d,代码行数:56,代码来源:triangle2.cpp


示例19: han_shot_first

void		han_shot_first(t_init st, char *str)
{
	st = init_all(st, str);
	resolution(st);
	mlx_hook(st.win, 2, 1, key_hook, &st);
	if (ft_strcmp(str, "Julia") == 0)
		mlx_hook(st.win, 6, (1L << 6), motion_hook, &st);
	mlx_mouse_hook(st.win, mouse_hook, &st);
	mlx_put_image_to_window(st.mlx, st.win, st.link,
			st.pos_x_image, st.pos_y_image);
	mlx_loop(st.mlx);
}
开发者ID:tandrieu42,项目名称:Fractol,代码行数:12,代码来源:main.c


示例20: main

int main(int argc, char** argv) {
  Eigen::Matrix<double, 2, 1> minimum(-2, -2);
  Eigen::Matrix<double, 2, 1> maximum(2, 2);
  Eigen::Matrix<double, 2, 1> resolution(0.05, 0.05);
  QApplication app(argc, argv);
  FunctionPlot<NormalDistribution<2>, 2> plot("NormalDistribution2v",
    NormalDistribution<2>(Eigen::Matrix<double, 2, 1>(1.0, 1.0),
    (Eigen::Matrix<double, 2, 2>() << 2, 0, 0, 2).finished()), minimum, maximum,
    resolution);
  plot.show();
  return app.exec();
}
开发者ID:jmaye,项目名称:mrtk,代码行数:12,代码来源:NormalDistribution2vPlot.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ resolve函数代码示例发布时间:2022-05-30
下一篇:
C++ resized函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap