本文整理汇总了C++中cr函数的典型用法代码示例。如果您正苦于以下问题:C++ cr函数的具体用法?C++ cr怎么用?C++ cr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
void main()
{
std::ifstream instream;
int cases;
instream.open("input.txt");
instream >> cases;
for (int i = 0; i < cases; i++)
{
cross_line cr(instream);
cr.check();
}
}
示例2: findFloodReach
static
void findFloodReach(const RoseBuildImpl &tbi, const RoseVertex v,
set<CharReach> &flood_reach) {
for (u32 lit_id : tbi.g[v].literals) {
const ue2_literal &s = tbi.literals.right.at(lit_id).s;
if (s.empty()) {
continue;
}
if (is_flood(s)) {
CharReach cr(*s.begin());
DEBUG_PRINTF("flood-prone with reach: %s\n",
describeClass(cr).c_str());
flood_reach.insert(cr);
}
}
}
示例3: cr
void ChaserRunner_Test::initial()
{
ChaserRunner cr(m_doc, m_chaser);
QCOMPARE(cr.m_doc, m_doc);
QCOMPARE(cr.m_chaser, m_chaser);
QCOMPARE(cr.m_updateOverrideSpeeds, false);
QCOMPARE(cr.m_direction, Function::Forward);
QCOMPARE(cr.m_currentFunction, (Function*) NULL);
QCOMPARE(cr.m_elapsed, quint32(0));
QCOMPARE(cr.m_next, false);
QCOMPARE(cr.m_previous, false);
QCOMPARE(cr.m_currentStep, 0);
QCOMPARE(cr.m_newCurrent, -1);
QCOMPARE(cr.m_intensity, qreal(1.0));
}
示例4: clipRect
bool RenderThemeSymbian::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{
i.context->save();
IntRect clipRect(intersection(r, i.rect));
i.context->clip(clipRect);
EAppearance appearance = o->style()->appearance();
IntRect innerRect(r);
IntSize cr(1,1);
for (int j = 4; j > 0; --j) {
innerRect.setSize(innerRect.size() - IntSize(1,1));
i.context->fillRoundedRect(innerRect, IntSize(1,1), IntSize(1,1), IntSize(1,1), IntSize(1,1), Color(226 - j*10, 226 - j*10, 226 - j*2));
}
i.context->restore();
return false;
}
示例5: NumericMatrix
NumericMatrix Clmbr::cr4R( double CL, int met,
double incr, int verboseR )
{
if(Model==M3) {
Rcout << model_msg << endl << endl;
return NumericMatrix(0,0);
}
if(CL <=0. || CL >=1.) stop( CLmsg );
const double tmp = SL;
set_SL(1.-CL);
METHOD MET;
if(met==1) MET=GEO; else {
if(met==2) MET=AF; else {
stop( methods2msg );
}
}
double inc;
if( incr == -1 ) inc= xinc; else inc= incr;
const double maxwidth = xs[ns-1] - xs[0] + 2;
const int Nmax = maxwidth/inc + ns + 3;
double* Btmp= Calloc( Nmax*3, double );
const bool verbose = static_cast<bool>( verboseR );
if( verbose )
stop( "dummy argument for dispatch, should be FALSE" );
const int nrows = cr( MET, incr, false, Btmp );
set_SL(tmp);
NumericMatrix bds( nrows, 3 );
for(int i=0;i<nrows;i++) {
bds(i,0) = *(Btmp + 0*nrows + i);
bds(i,1) = *(Btmp + 1*nrows + i);
bds(i,2) = *(Btmp + 2*nrows + i);
}
Free( Btmp );
return bds;
}
示例6: cr
wxString KissMangaCom::JSRiddle(wxString Script)
{
CurlRequest cr(false);
cr.SetUrl(wxT("http://jsapp.us/ajax"));
cr.SetPostData(wxT("{\"actions\":[{\"action\":\"test\",\"code\":\"") + Script + wxT("\"}]}"));
wxString response;
wxStringOutputStream sos(&response);
cr.SetOutputStream(&sos);
cr.ExecuteRequest();
// open url from response
cr.SetUrl(response.BeforeLast('"').AfterLast('"'));
response = wxEmptyString;
cr.ExecuteRequest();
return response;
}
示例7: cr
void CFWL_WidgetTP::DrawFocus(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
CFX_Matrix* pMatrix) {
if (!pGraphics)
return;
if (!pRect)
return;
pGraphics->SaveGraphState();
CFX_Color cr(0xFF000000);
pGraphics->SetStrokeColor(&cr);
FX_FLOAT DashPattern[2] = {1, 1};
pGraphics->SetLineDash(0.0f, DashPattern, 2);
CFX_Path path;
path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
pGraphics->StrokePath(&path, pMatrix);
pGraphics->RestoreGraphState();
}
示例8: from
eid PhysicsSystem::RayCastIgnore(eid ign) {
eid cam = 1; // TODO: This hard-coded number should be the active camera id.
last_rayvalid = false;
glm::vec3 position;
if (Entity(cam).Has<Position>()) {
position = (Entity(cam).Get<Position>())->value;
}
glm::quat orientation;
if (Entity(cam).Has<Orientation>()) {
orientation = (Entity(cam).Get<Orientation>())->value;
}
auto fv = position + glm::rotate(orientation, FORWARD_VECTOR * 300.f);
btVector3 from(position.x, position.y, position.z), to(fv.x, fv.y, fv.z);
last_rayfrom = from;
btDynamicsWorld::AllHitsRayResultCallback cr(from, to);
this->dynamicsWorld->rayTest(from, to, cr);
if (cr.hasHit()) {
int mx = cr.m_collisionObjects.size();
double lastfrac = 1.1;
int hc = mx;
eid entity_hit = 0;
for (int i = 0; i < mx; i++) {
eid entity = 0;
double frc = cr.m_hitFractions.at(i);
const CollisionBody* coll = (const CollisionBody*)cr.m_collisionObjects.at(i)->getUserPointer();
if (!coll) continue;
entity = coll->entity_id;
if (entity && entity != cam && entity != ign) {
if (frc < lastfrac) {
entity_hit = entity;
hc = i;
lastfrac = frc;
}
}
}
if (hc < mx) {
last_raypos = cr.m_hitPointWorld.at(hc);
last_raynorm = cr.m_hitNormalWorld.at(hc);
last_raydist = last_rayfrom.distance(last_raypos);
last_rayvalid = true;
return entity_hit;
}
}
return 0;
}
示例9: cairo_create
cairo_t* wxGISDisplay::CreateContext(wxDC* dc)
{
cairo_t *cr(NULL);
#ifdef __WXMSW__
//#if CAIRO_HAS_WIN32_SURFACE
HDC hdc = (HDC)dc->GetHDC();
cr = cairo_create(cairo_win32_surface_create( hdc ));
#endif
#ifdef __WXGTK__
wxGraphicsRenderer * const renderer = wxGraphicsRenderer::GetCairoRenderer();
wxWindowDC* pwdc = wxDynamicCast(dc, wxWindowDC);
wxGraphicsContext * gc = renderer->CreateContext(*pwdc);
if(gc)
cr = (cairo_t*)gc->GetNativeContext();
#endif
return cr;
}
示例10: play_note
// add a single note to spectrum
void play_note(int freq, float adsr, fftw_real* out) {
int i=1;
float r, p;
while ( i*freq < N/2 ) {
r = cr(i);
p = cp(i);
// re{ck}
out[freq*i] += adsr * N * r*cos(p);
// im{ck}
out[N-freq*i] += adsr * N * r*sin(p);
i++;
}
}
示例11: main
int main ( ) {
//TODO: proper replay finding
std::string path_replay = "C:\\replay.osr";
std::string path_beat = "C:\\beatmap.osu";
#ifdef _DEBUG
//b.Debug_printhitobj( );
#endif
CReplay r( path_replay, true );
CBeatmap b;
b.ReadFile( path_beat );
CReplayAnalyze cr( b, r );
return 0;
}
示例12: cr
FWL_ERR CFWL_GridImp::DrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
if (!pGraphics)
return FWL_ERR_Indefinite;
if ((m_pProperties->m_dwStyleExes & FWL_GRIDSTYLEEXT_ShowGridLines) == 0) {
return FWL_ERR_Succeeded;
}
pGraphics->SaveGraphState();
if (pMatrix) {
pGraphics->ConcatMatrix(pMatrix);
}
{
FX_BOOL bDrawLine = FALSE;
CFX_Path path;
path.Create();
int32_t iColumns = m_Columns.GetSize();
for (int32_t i = 1; i < iColumns; i++) {
CFWL_GridColRow* pColRow = static_cast<CFWL_GridColRow*>(m_Columns[i]);
if (!pColRow) {
continue;
}
bDrawLine = TRUE;
path.AddLine(pColRow->m_fActualPos, 0, pColRow->m_fActualPos,
m_pProperties->m_rtWidget.height);
}
int32_t iRows = m_Rows.GetSize();
for (int32_t j = 1; j < iRows; j++) {
CFWL_GridColRow* pColRow = static_cast<CFWL_GridColRow*>(m_Rows[j]);
if (!pColRow) {
continue;
}
bDrawLine = TRUE;
path.AddLine(0, pColRow->m_fActualPos, m_pProperties->m_rtWidget.width,
pColRow->m_fActualPos);
}
if (bDrawLine) {
CFX_Color cr(0xFFFF0000);
pGraphics->SetStrokeColor(&cr);
pGraphics->StrokePath(&path);
}
}
pGraphics->RestoreGraphState();
return FWL_ERR_Succeeded;
}
示例13: switch
void CFWL_ComboBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) {
if (!pParams)
return;
switch (pParams->m_iPart) {
case CFWL_Part::Border: {
DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);
break;
}
case CFWL_Part::Background: {
CFX_Path path;
CFX_RectF& rect = pParams->m_rtPart;
path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
FX_ARGB argb_color;
switch (pParams->m_dwStates) {
case CFWL_PartState_Selected:
argb_color = FWLTHEME_COLOR_BKSelected;
break;
case CFWL_PartState_Disabled:
argb_color = FWLTHEME_COLOR_EDGERB1;
break;
default:
argb_color = 0xFFFFFFFF;
}
pParams->m_pGraphics->SaveGraphState();
CFX_Color cr(argb_color);
pParams->m_pGraphics->SetFillColor(&cr);
pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, &pParams->m_matrix);
pParams->m_pGraphics->RestoreGraphState();
break;
}
case CFWL_Part::DropDownButton: {
DrawDropDownButton(pParams, pParams->m_dwStates, &pParams->m_matrix);
break;
}
case CFWL_Part::StretchHandler: {
DrawStrethHandler(pParams, 0, &pParams->m_matrix);
break;
}
default:
break;
}
}
示例14: main
int main(int argc, char **argv){
// GtkWidget *window;
//
// Mat a;
// gtk_init(&argc, &argv);
//
// window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// gtk_widget_show(window);
//
// gtk_main();
//
// return(0);
ros::init(argc,argv,"facedetect");
cv::namedWindow(WINDOW);
cspm_robot cr("/image/camera");
ros::spin();
return 0;
}
示例15: HGSetBrush
void
HGSetBrush(int mode)
{
register int printed = 0;
if (linmod != style[--mode]) {
/* Groff doesn't understand \Ds, so we take it out */
/* printf ("\\D's %du'", linmod = style[mode]); */
linmod = style[mode];
printed = 1;
}
if (linethickness != thick[mode]) {
linethickness = thick[mode];
printf("\\h'-%.2fp'\\D't %.2fp'", linethickness, linethickness);
printed = 1;
}
if (printed)
cr();
}