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


C++ zone函数代码示例

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


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

示例1: tybuilder

/// <summary>
///   <list type="number">
///     <item>Set output type of PrologueI.</item>
///     <item>Load parameters</item>
///   </list>
/// </summary>
void Builder::SetUpMethodBody(Function& fun, MethodDef& method_def) {
  auto const pPrologueI = fun.GetStartBB()->GetFirstI();
  auto const pRefI = pPrologueI->GetNext();
  auto const pBB = pPrologueI->GetBBlock();
  auto& v1 = *pPrologueI->GetVd();

  ValuesTypeBuilder tybuilder(
      method_def.IsStatic()
          ? method_def.CountParams()
          : method_def.CountParams() + 1);

  auto nth = 0;

  // "this" parameter.
  if (!method_def.IsStatic()) {
    tybuilder.Append(method_def.owner_class_def().GetClass());
    nth++;
  }

  foreach (MethodDef::EnumParam, oEnum, method_def) {
    auto const pParamDef = oEnum.Get();
    auto& var = pParamDef->GetVariable();
    auto& varty = var.GetTy();
    tybuilder.Append(varty);
    DEBUG_FORMAT("%s %s", varty, var);

    auto& cell_class = Ty_ClosedCell->Construct(varty);
    //auto& r2 = *NewOutput(varty).StaticCast<Register>();
    auto& r2 = *NewOutput(varty).StaticCast<Register>();
    r2.SetVariable(var);

    auto const pSelectI = new(zone()) SelectI(varty, r2, v1, nth);
    pSelectI->SetSourceInfo(pParamDef->GetSourceInfo());
    pBB->InsertBeforeI(*pSelectI, pRefI);

    auto& r3 = NewRegister();
    auto& vardef_inst = *new(zone()) VarDefI(cell_class, r3, var, r2);
    vardef_inst.set_source_info(pParamDef->source_info());
    pBB->InsertBeforeI(vardef_inst, pRefI);

    ++nth;
  }
开发者ID:eval1749,项目名称:evm,代码行数:48,代码来源:Builder.cpp

示例2: zone

//
// createZone
//
void BSPScene::createZone( shared_ptr<Geometry> geometry, unsigned int uiMaximumDepth, unsigned int uiMinimumTriCount )
{
	// Constructs a BSP given the geometry
	// TODO: Worry about the textures/materials for the BSP

	// This creates a new zone with the given geometry.
	shared_ptr<Zone> zone( new Zone( getNextZoneID(), geometry, uiMaximumDepth, uiMinimumTriCount ) );

	// Adds the zone to our collection of zones to render
	addZone( zone );
}
开发者ID:ejabx,项目名称:katana,代码行数:14,代码来源:bspscene.cpp

示例3: EmitI

const Register& Builder::EmitI(Op const opcode, const Type& outy,
                               const Operand& src1, const Operand& src2) {
  auto& inst = Instruction::New(zone(), opcode);
  auto& out = *NewOutput(outy).StaticCast<Register>();
  inst.set_output(out);
  inst.set_output_type(outy);
  inst.AppendOperand(src1);
  inst.AppendOperand(src2);
  EmitI(inst);
  return out;
}
开发者ID:eval1749,项目名称:evm,代码行数:11,代码来源:Builder.cpp

示例4: FatalErrorIn

void Foam::overlapGgiPolyPatch::calcLocalParallel() const
{
    // Calculate patch-to-zone addressing
    if (localParallelPtr_)
    {
        FatalErrorIn("void overlapGgiPolyPatch::calcLocalParallel() const")
            << "Local parallel switch already calculated"
            << abort(FatalError);
    }

    // If running in serial, all GGIs are local parallel
    // HJ, 1/Jun/2011
    localParallelPtr_ = new bool(false);
    bool& emptyOrComplete = *localParallelPtr_;

    // If running in serial, all GGIs are expanded to zone size.
    // This happens on decomposition and reconstruction where
    // size and shadow size may be zero, but zone size may not
    // HJ, 1/Jun/2011
    if (!Pstream::parRun())
    {
        emptyOrComplete = false;
    }
    else
    {
        // Calculate localisation on master and shadow
        emptyOrComplete =
            (
                zone().size() == size()
             && shadow().zone().size() == shadow().size()
            )
         || (size() == 0 && shadow().size() == 0);

        reduce(emptyOrComplete, andOp<bool>());
    }

    if (debug && Pstream::parRun())
    {
        Info<< "Overlap GGI patch Master: " << name()
            << " Slave: " << shadowName() << " is ";

        if (emptyOrComplete)
        {
           Info<< "local parallel" << endl;
        }
        else
        {
            Info<< "split between multiple processors" << endl;
        }
    }
}
开发者ID:CFDEMproject,项目名称:OpenFOAM-1.6-ext,代码行数:51,代码来源:overlapGgiPolyPatch.C

示例5: PollardRho

int PollardRho(verylong zalpha, verylong zbeta,
               verylong zn, verylong zp, verylong *zx)
{
  long i = 2, j;
  static verylong za0 = 0, za1 = 0, za2 = 0, za3 = 0;
  static verylong zb0 = 0, zb1 = 0, zb2 = 0, zb3 = 0;
  static verylong zx0 = 0, zx1 = 0, zx2 = 0, zx3 = 0;
  static verylong zr = 0, zri = 0;

  zone(&zx0);
  zzero(&za0);
  zzero(&zb0);
  zfi(zalpha, zbeta, zp, zx0, &zx1);
  zai(za0, zn, zx0, &za1);
  zbi(zb0, zn, zx0, &zb1);
  zfi(zalpha, zbeta, zp, zx1, &zx2);
  zai(za1, zn, zx1, &za2);
  zbi(zb1, zn, zx1, &zb2);
  zcopy(za1, &za0);
  zcopy(zb1, &zb0);
  zcopy(zx1, &zx0);
  for (;;) {
    zfi(zalpha, zbeta, zp, zx0, &zx1);
    zai(za0, zn, zx0, &za1);
    zbi(zb0, zn, zx0, &zb1);
    zcopy(za1, &za2);
    zcopy(zb1, &zb2);
    zcopy(zx1, &zx2);
    i++;
    for (j = 0; j < i; j++) {
      zfi(zalpha, zbeta, zp, zx2, &zx3);
      zai(za2, zn, zx2, &za3);
      zbi(zb2, zn, zx2, &zb3);
      zcopy(za3, &za2);
      zcopy(zb3, &zb2);
      zcopy(zx3, &zx2);
    }
    if (zcompare(zx1, zx3) == 0) {
      zsubmod(zb1, zb3, zn, &zr);
      if (zscompare(zr, 0) == 0) return 0;
      zinvmod(zr, zn, &zri);
      zsub(za3, za1, &za0);
      zmulmod(za0, zri, zn, zx);
      return 1;
    }
    zcopy(za1, &za0);
    zcopy(zb1, &zb0);
    zcopy(zx1, &zx0);
  }
}
开发者ID:oghenez,项目名称:mycila,代码行数:50,代码来源:dlp.c

示例6: uid

// Exporting Event data to map. Using the same
// encoding as ODateBookAccessBackend_xml does..
// Thus, we could remove the stuff there and use this
// for it and for all other places..
// Encoding should happen at one place, only ! (eilers)
QMap<int, QString> OEvent::toMap()const {
    QMap<int, QString> retMap;

    retMap.insert( OEvent::FUid, QString::number( uid() ) );
    retMap.insert( OEvent::FCategories, Qtopia::escapeString( Qtopia::Record::idsToString( categories() ) ));
    retMap.insert( OEvent::FDescription, Qtopia::escapeString( description() ) );
    retMap.insert( OEvent::FLocation, Qtopia::escapeString( location() ) );
    retMap.insert( OEvent::FType, isAllDay() ? "AllDay" : "" );
    OPimAlarm alarm = notifiers().alarms()[0];
    retMap.insert( OEvent::FAlarm, QString::number( alarm.dateTime().secsTo(  startDateTime() ) / 60 ) );
    retMap.insert( OEvent::FSound, (alarm.sound() == OPimAlarm::Loud) ? "loud" : "silent" );

    OTimeZone zone(  timeZone().isEmpty() ? OTimeZone::current() : timeZone() );
    retMap.insert( OEvent::FStart, QString::number( zone.fromUTCDateTime( zone.toDateTime(  startDateTime(), OTimeZone::utc() ) ) ) );
    retMap.insert( OEvent::FEnd, QString::number( zone.fromUTCDateTime( zone.toDateTime(  endDateTime(), OTimeZone::utc() ) ) ) );
    retMap.insert( OEvent::FNote, Qtopia::escapeString( note() ) );
    retMap.insert( OEvent::FTimeZone, timeZone().isEmpty() ? QString( "None" ) : timeZone() );
    if( parent() )
	    retMap.insert( OEvent::FRecParent, QString::number( parent() ) );
    if( children().count() ){
            QArray<int> childr = children();
	    QString buf;
            for ( uint i = 0; i < childr.count(); i++ ) {
		    if ( i != 0 ) buf += " ";
		    buf += QString::number( childr[i] );
            }
	    retMap.insert( OEvent::FRecChildren, buf );
    }

    // Add recurrence stuff
    if( hasRecurrence() ){
	    ORecur recur = recurrence();
	    QMap<int, QString> recFields = recur.toMap();
	    retMap.insert( OEvent::FRType, recFields[ORecur::RType] );
	    retMap.insert( OEvent::FRWeekdays, recFields[ORecur::RWeekdays] );
	    retMap.insert( OEvent::FRPosition, recFields[ORecur::RPosition] );
	    retMap.insert( OEvent::FRFreq, recFields[ORecur::RFreq] );
	    retMap.insert( OEvent::FRHasEndDate, recFields[ORecur::RHasEndDate] );
	    retMap.insert( OEvent::FREndDate, recFields[ORecur::EndDate] );
	    retMap.insert( OEvent::FRCreated, recFields[ORecur::Created] );
	    retMap.insert( OEvent::FRExceptions, recFields[ORecur::Exceptions] );
    } else {
	    ORecur recur = recurrence();
	    QMap<int, QString> recFields = recur.toMap();
	    retMap.insert( OEvent::FRType, recFields[ORecur::RType] );
    }

    return retMap;
}
开发者ID:opieproject,项目名称:opie,代码行数:54,代码来源:oevent.cpp

示例7: name

std::ostream& operator<<(std::ostream &s, const LLViewerRegion &region)
{
	s << "{ ";
	s << region.mHost;
	s << " mOriginGlobal = " << region.getOriginGlobal()<< "\n";
    std::string name(region.getName()), zone(region.getZoning());
    if (! name.empty())
    {
        s << " mName         = " << name << '\n';
    }
    if (! zone.empty())
    {
        s << " mZoning       = " << zone << '\n';
    }
	s << "}";
	return s;
}
开发者ID:mightymarc,项目名称:kittyviewer,代码行数:17,代码来源:llviewerregion.cpp

示例8: zone

void GRIBUIDialog::OnRequest(  wxCommandEvent& event )
{
    double lonmax=m_vp->lon_max;
    double lonmin=m_vp->lon_min;
    if( ( fabs( m_vp->lat_max ) < 90. ) && ( fabs( lonmax ) < 360. ) ) {
           if( lonmax < -180. ) lonmax += 360.;
           if( lonmax > 180. ) lonmax -= 360.;
    }
    if( ( fabs( m_vp->lat_min ) < 90. ) && ( fabs( lonmin ) < 360. ) ) {
            if( lonmin < -180. ) lonmin += 360.;
            if( lonmin > 180. ) lonmin -= 360.;
    }
    wxString zone( 
        toSAILDOC( 1, 1, m_vp->lat_max ) + wxT(",") +
        toSAILDOC( 1, 2, m_vp->lat_min ) + wxT(",") +
        toSAILDOC( 2, 2, lonmin ) + wxT(",") +
        toSAILDOC( 2, 1, lonmax ) );

    GribRequestSetting *req_Dialog = new GribRequestSetting( this, pPlugIn->GetRequestConfig(), zone, pPlugIn->GetMailAdresse() );
    
    if( req_Dialog->ShowModal() == wxID_SAVE ) {
        req_Dialog->m_RequestConfigBase.SetChar( 2, (char) ( req_Dialog->m_pModel->GetCurrentSelection() + '0' ) );
        if( req_Dialog->m_pModel->GetCurrentSelection() == 0 ) {
            req_Dialog->m_RequestConfigBase.SetChar( 3, (char) ( req_Dialog->m_pResolution->GetCurrentSelection() + '0' ) );
            req_Dialog->m_pWaves->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 8, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 8, '.' );
            req_Dialog->m_pRainfall->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 9, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 9, '.' );
            req_Dialog->m_pCloudCover->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 10, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 10, '.' );
            req_Dialog->m_pAirTemp->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 11, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 11, '.' );
            req_Dialog->m_pSeaTemp->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 12, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 12, '.' );
            req_Dialog->m_pCurrent->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 13, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 13, '.' );
        } else if( req_Dialog->m_pModel->GetCurrentSelection() == 1 ) 
            req_Dialog->m_RequestConfigBase.SetChar( 3, (char) ( req_Dialog->m_pResolution->GetCurrentSelection() + '0' ) );

        req_Dialog->m_RequestConfigBase.SetChar( 6, 'X' );              //must be always selected
        req_Dialog->m_RequestConfigBase.SetChar( 7, 'X' );

        req_Dialog->m_RequestConfigBase.SetChar( 4, (char) ( req_Dialog->m_pInterval->GetCurrentSelection() + '0' ) );
        req_Dialog->m_RequestConfigBase.SetChar( 5, (char) ( req_Dialog->m_pTimeRange->GetCurrentSelection() + '0' ) );

        pPlugIn->SetRequestConfig( req_Dialog->m_RequestConfigBase );
    }

    req_Dialog->Destroy();
}
开发者ID:bingcheng,项目名称:OpenCPN,代码行数:44,代码来源:GribUIDialog.cpp

示例9: zone

bool EditPanel::CommandPaste(ImageInfoPtr newValue )
{
	if ( mImageInfo == NULL )
	{
		return false;
	}

	wxRect zone( mCursor, newValue->GetSize() );
	ImageInfoPtr old = mImageInfo->CopyToImageInfo( zone );

	if (old)
	{
		ImagePasteCommand* paste = new ImagePasteCommand(this,
			old->Clone(), newValue->Clone(), mCursor );
		return COMMAND->Submit( paste );
	}

	return false;
}
开发者ID:old-games,项目名称:universal-translators-tool,代码行数:19,代码来源:editpanel.cpp

示例10: zone

// FIXME: Use OEvent::fromMap() which makes this obsolete.. (eilers)
void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) {
    /* AllDay is alway in UTC */
    if ( ev.isAllDay() ) {
        OTimeZone utc = OTimeZone::utc();
        ev.setStartDateTime( utc.fromUTCDateTime( start ) );
        ev.setEndDateTime  ( utc.fromUTCDateTime( end   ) );
        ev.setTimeZone( "UTC"); // make sure it is really utc
    } else {
        /* to current date time */
        // qWarning(" Start is %d", start );
        OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() );
        QDateTime date = zone.toDateTime( start );
        qWarning(" Start is %s", date.toString().latin1() );
        ev.setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) );

        date = zone.toDateTime( end );
        ev.setEndDateTime  ( zone.toDateTime( date, OTimeZone::current()   ) );
    }
    if ( rec && rec->doesRecur() ) {
        OTimeZone utc = OTimeZone::utc();
        ORecur recu( *rec ); // call copy c'tor;
        recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() );
        recu.setCreatedDateTime( utc.fromUTCDateTime( created ) );
        recu.setStart( ev.startDateTime().date() );
        ev.setRecurrence( recu );
    }

    if (alarmTime != -1 ) {
        QDateTime dt = ev.startDateTime().addSecs( -1*alarmTime*60 );
        OPimAlarm al( snd ,  dt  );
        ev.notifiers().add( al );
    }
    if ( m_raw.contains( ev.uid() ) || m_rep.contains( ev.uid() ) ) {
        qWarning("already contains assign uid");
        ev.setUid( 1 );
    }
    qWarning("addind %d %s", ev.uid(), ev.description().latin1() );
    if ( ev.hasRecurrence() )
        m_rep.insert( ev.uid(), ev );
    else
        m_raw.insert( ev.uid(), ev );

}
开发者ID:opieproject,项目名称:opie,代码行数:44,代码来源:odatebookaccessbackend_xml.cpp

示例11: zone

void GRIBUIDialog::OnRequest(  wxCommandEvent& event )
{
    double lonmax=m_vp->lon_max;
    double lonmin=m_vp->lon_min;
    if( ( fabs( m_vp->lat_max ) < 90. ) && ( fabs( lonmax ) < 360. ) ) {
           if( lonmax < -180. ) lonmax += 360.;
           if( lonmax > 180. ) lonmax -= 360.;
    }
    if( ( fabs( m_vp->lat_min ) < 90. ) && ( fabs( lonmin ) < 360. ) ) {
            if( lonmin < -180. ) lonmin += 360.;
            if( lonmin > 180. ) lonmin -= 360.;
    }
    wxString zone( 
        toSAILDOC( 1, 1, m_vp->lat_max ) + wxT(",") +
        toSAILDOC( 1, 2, m_vp->lat_min ) + wxT(",") +
        toSAILDOC( 2, 2, lonmin ) + wxT(",") +
        toSAILDOC( 2, 1, lonmax ) );
    ShowSendRequest( zone );
}
开发者ID:IgorMikhal,项目名称:OpenCPN,代码行数:19,代码来源:GribUIDialog.cpp

示例12: zone

Foam::label Foam::overlapGgiPolyPatch::zoneIndex() const
{
    if (zoneIndex_ == -1 && zoneName_ != Foam::word::null)
    {
        // Grab zone patch index
        faceZoneID zone(zoneName_, boundaryMesh().mesh().faceZones());

        if (!zone.active())
        {
            FatalErrorIn("label overlapGgiPolyPatch::zoneIndex() const")
                << "Face zone name " << zoneName_
                << " not found.  Please check your GGI interface definition."
                << abort(FatalError);
        }

        zoneIndex_ = zone.index();
    }

    return zoneIndex_;
}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:20,代码来源:overlapGgiPolyPatch.C

示例13: sub_changed_hook

/* This function rerenders the subliminal window's entire sub_buffer. It loops
 * through all inferior windows, calling their 'draw_to_sub' function to get them
 * to draw onto its own sub_buffer. After doing this, it alerts any derived
 * classes's hooks.
 */
void window_sub::update_sub()
{
  // If we are not capable of having our sub-buffer updated, return
  if (!sub_buffer || !visible() || !flag(sys_active)) return;

  // If we are at all clipped, clear our sub-buffer so the clipped portions don't
  // get filled with junk. 
  if (flag(vis_positive_clip) || flag(vis_negative_clip)) clear_to_color(sub_buffer, 0);
  
  // Loop through all inferior windows that we are visible to us
  for (base_window* loop = get_parent(); loop && loop != this; loop = loop->superior())
  {
    if (loop->visible() && loop->flag(sys_active))
    {
      // If they are visible and active, draw themselves to us
      loop->draw_to_sub(this, &loop->clipped(), false);
    }
  }

  // Call the hook to inform it our entire surface has been drawn to!
  sub_changed_hook(&zone(0, 0, w(), h()));
}
开发者ID:taliesinb,项目名称:penguin,代码行数:27,代码来源:psublim.cpp

示例14: can_insert_into_block

// This routine checks whether a poylgon can be inserted into a block such that the interior of the polygon does not at all overlap with used space
// in the block.  We COULD do this using boolean operations (E.g. is the intersection of the used block space and our polygon empty?) but we do NOT want
// to.  Why?  Time to do a boolean op is a function of BOTH polygons, and in a lot of cases the block will be HUGELY complex (imagine a giant forest expanse
// with lots of crap already inserted into it) and our test block will be TINY (a quad).  In this case, we get better performance by doing a piece-wise per-side
// test.  
// Side note: using the bulk locator totally violates this principle...we will probably need to replace it with a walk location strategy.
// So we use the zone utility to see what we'll hit as we go along our edges.  
bool	can_insert_into_block(
					Block_2&						block,
					const Polygon_2&				bounds)
{
	// Run a bulk location on the entire block...TBD: there may be blocks where sweeping is worse than marching.
	// Anyway, we get a bunch of pairs of the locate point and the actual part of the arrangement we hit.
	vector<pair<Point_2, CGAL::Object> >	pts;
	CGAL::locate(block, bounds.vertices_begin(), bounds.vertices_end(), back_inserter(pts));
	
	// Quick check: if ANY of our points are inside a non empty face, we are by definition hosed.
	// We can see this now just from the location data.
	Block_2::Face_const_handle ff;
	for(int n = 0; n < pts.size(); ++n)
	if(CGAL::assign(ff,pts[n].second))
	if(ff->data().usage != usage_Empty)
		return false;

	for(int n = 0; n < pts.size(); ++n)
	{
		// We are now going to go through each side and do a zone test.  This will check whether it is 
		// either running along a full area or crashing through it.
		int m = (n+1)%pts.size();
		check_block_visitor	v;
		v.cv = Block_2::X_monotone_curve_2(Segment_2(pts[n].first, pts[m].first));

		CGAL::Arrangement_zone_2<Block_2,check_block_visitor>	zone(block, &v);

		if(v.cv.is_directed_right())
			zone.init_with_hint(v.cv,pts[n].second);
		else
			zone.init_with_hint(v.cv,pts[m].second);

		zone.compute_zone();
		
		if(!v.ok)
			return false;		
	}
	return true;
}
开发者ID:highattack30,项目名称:xptools,代码行数:46,代码来源:BlockAlgs.cpp

示例15: check_block

    void check_block(void **reference, void *block) {
        if (block == _block) {
            if (_thread) {
                intptr_t offset = (intptr_t)reference - (intptr_t)_thread_range.end();
                agc_reference_t ref = { (vm_address_t)block, (vm_address_t)_thread_range.end(), offset };
                _callback(_callback_ctx, ref);
            } else if (!reference) {
                // ???
            } else {
                void *owner = zone()->block_start((void*)reference);
                if (owner) {
                    intptr_t offset = (intptr_t)reference - (intptr_t)owner;
                    agc_reference_t ref = { (vm_address_t)block, (vm_address_t)owner, offset };
                    _callback(_callback_ctx, ref);
                } else {
                    agc_reference_t ref = { (vm_address_t)block, (vm_address_t)reference, 0 };
                    _callback(_callback_ctx, ref);
                }
            }
        }

        MemoryScanner::check_block(reference, block);
    }
开发者ID:takuma104,项目名称:iphone-macruby,代码行数:23,代码来源:agc_interface.cpp


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