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


C++ VAL函数代码示例

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


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

示例1: glPushMatrix

void SampleModel::drawLeftHandJoint() {
	glPushMatrix();
	glTranslated(-UPPER_TORSO_RADIUS, 0.6, 0);
	glRotated(20, 0.0, 0.0, -1.0);
	glRotated(90, 0.0, 1.0, 0.0);
	glTranslated(0, 0, -0.2);
	if (VAL(TEXTURESKIN))
		drawTextureCylinder(0.4, 0.2, 0.2);
	else drawCylinder(0.4, 0.2, 0.2);
	glPopMatrix();

	glPushMatrix();
	glTranslated(-UPPER_TORSO_RADIUS - 0.2, 0.8, 0);
	if (VAL(TEXTURESKIN))
		drawTextureSphere(0.4);
	else drawSphere(0.4);
	glPopMatrix();
}
开发者ID:andreajeka,项目名称:HKUST_Animator,代码行数:18,代码来源:sample.cpp

示例2: create_LR_first

struct LocationRef create_LR_first( RStore *in_store, obj item )
{
  struct LocationRef lr;
  struct VMPageRecord *vmpr;
  struct FirstPageHdr *fph = FIRST_PAGE_HDR_OF(VAL(item));

  assert( OBJ_ISA_PTR(item) );

  assert( in_store == fph->area->owner );

  vmpr = fph->vmpr;

  lr.base_page_num = vmpr->ref.base_page_num;
  lr.nth_page = vmpr->ref.nth_page;
  lr.first = vmpr->ref.first;
  lr.offset = VAL(item) - (UINT_32)vmpr->mem_address;
  lr.indirect = 0;
  return lr;
}
开发者ID:Fuhuiang,项目名称:rscheme,代码行数:19,代码来源:xlation.c

示例3: print_list

static void UCL_UNUSED
print_list (ucl_node_t N)
{
  ucl_node_t	M = NULL;
  for (; N; N = M) {
    M = ucl_list_cdr(N);
    fprintf(stderr, "%d, ", VAL(N));
  }
  fprintf(stderr, "\n");
}
开发者ID:marcomaggi,项目名称:ucl,代码行数:10,代码来源:list.c

示例4: REG

void Timer<ID>::init(void) {
  // Set Waveform Generator Mode to Normal
  // Set Prescaler to 0
  REG(timer<ID>::control) = 
    CFG(timer<ID>::control::wgm::normal) |
      CFG(timer<ID>::control::prescaler::template value<1>);
  
  // Set Counter to 0
  REG(timer<ID>::counter) = VAL(timer<ID>::counter, 0);
}
开发者ID:astralien3000,项目名称:aversive--,代码行数:10,代码来源:timer.cpp

示例5: MODHASH

void *hash_set(hash_t tab, void *key, void *val) {
	unsigned h = MODHASH(tab, key);
	list_iter_t i = locate(tab, key, h);

	if (enditer(i)) {
		struct hash_node *ele = (struct hash_node*)malloc(sizeof *ele);
		ele->key = key;
		ele->val = val;
		ele->cont = tab;
		ele->hash = h;
		list_insert(list_container(i), i, ele);
		return 0;
	}
	else {
		void *old = VAL(i);
		VAL(i) = val;
		return old;
	}
}
开发者ID:dongyx,项目名称:hyphen,代码行数:19,代码来源:hash.c

示例6: anysumto

/*
 * anysumto returns the index (0 <= i < n) of the card in hand that brings
 * the s up to t, or -1 if there is none
 */
int
anysumto(CARD hand[], int n, int s, int t)
{
	int i;

	for (i = 0; i < n; i++) {
		if (s + VAL(hand[i].rank) == t)
			return (i);
	}
	return (-1);
}
开发者ID:mikekmv,项目名称:aeriebsd-src,代码行数:15,代码来源:support.c

示例7: setDiffuseColor

void SampleModel::drawEyeBandana() {
	setDiffuseColor(COLOR_RED);
	glPushMatrix();
	glTranslated(0, UPPER_TORSO_RADIUS + HEAD_RADIUS + 0.3, 0);
	drawTorus(0.3, 0.5);
	glPopMatrix();
	if (VAL(NINJATURTLE))
		setDiffuseColor(COLOR_GREEN);
	else
		setDiffuseColor(.940f, .816f, .811f);
}
开发者ID:andreajeka,项目名称:HKUST_Animator,代码行数:11,代码来源:sample.cpp

示例8: fhash_print

void fhash_print(fenv_t *f, fobj_t *p)
{
    ASSERT(p->type == FOBJ_HASH);
    fhash_t *h = &p->u.hash;

    for (int i = 0; i < h->num_kv; i++) {
        fobj_print(f, KEY(h, i));
        printf(" = ");
        fobj_print(f, VAL(h, i));
    }
}
开发者ID:rthelen,项目名称:tyForth,代码行数:11,代码来源:fhash.c

示例9: problema6EleDiagoCor

int problema6EleDiagoCor(matriz* mRes, const matriz* matOri, int a, int b){
	crea_mat(mRes,matOri->ren,1);
	int i;
	for (i = 0; i < matOri->ren; ++i)
	{
		VAL (mRes,i,0)=VAL(matOri,a,b);
		a+=1;
		b+=1;
		if (a>matOri->ren-1)
		{
			a-=matOri->ren;
			b-=matOri->ren;
		}
		if (b>matOri->col-1)
		{
			b-=matOri->col;
		}
	}
	return OK;
}
开发者ID:jdiazrdgz,项目名称:Algoritmia,代码行数:20,代码来源:matriz.c

示例10: main

int main()
{
  _10: LET A$ = "";
  _40: LET B = 12;
  _20: INPUT "What is your name? ", A$;
  _50: INPUT "How old are you? ", B;
  _60: PRINT "Hello ", A$, " who is ", B, " years old";
  _70: LET C$ = STR(B);
  _80: LET D = VAL(C$);
  _90: PRINT "C$ = ", C$, " D = ", D;
}
开发者ID:MCSH,项目名称:basicpp,代码行数:11,代码来源:03.string.cpp

示例11: print

static void print(mtype *arr)
{
	int i;
	for (i = 0; i < n; ++i) {
		int j;
		for (j = 0; j < n; ++j) {
			printf("%.8Lf ", VAL(arr, i, j));
		}
		printf("\n");
	}
}
开发者ID:ccotter,项目名称:libdeterm,代码行数:11,代码来源:lu.c

示例12: problema10Ajedrez

int problema10Ajedrez(matriz* mRes, const matriz* matOri, int a, int b){
	crea_mat(mRes,1,matOri->col);
	int i;
	for (i = 0; i < matOri->col; ++i)
	{
		VAL (mRes,0,i)=VAL(matOri,a,b);
		a+=2;
		b+=1;
		if (a>matOri->ren-1)
		{
			a-=matOri->ren;

		}
		if (b>matOri->col-1)
		{
			b-=matOri->col;
		}
	}
	return OK;
}
开发者ID:jdiazrdgz,项目名称:Algoritmia,代码行数:20,代码来源:matriz.c

示例13: find_blocks

/* create_block_tree:
 * Construct block tree by peeling nodes from block list in state.
 * When done, return root. The block list is empty
 * FIX: use largest block as root
 */
block_t *createBlocktree(Agraph_t * g, circ_state * state)
{
    block_t *bp;
    block_t *next;
    block_t *root;
    int min;
    /* int        ordercnt; */

    find_blocks(g, state);

    bp = state->bl.first;	/* if root chosen, will be first */
    /* Otherwise, just pick first as root */
    root = bp;

    /* Find node with minimum VAL value to find parent block */
    /* FIX: Should be some way to avoid search below.               */
    /* ordercnt = state->orderCount;  */
    for (bp = bp->next; bp; bp = next) {
	Agnode_t *n;
	Agnode_t *parent;
	Agnode_t *child;
	Agraph_t *subg = bp->sub_graph;

	child = n = agfstnode(subg);
	min = VAL(n);
	parent = PARENT(n);
	for (n = agnxtnode(subg, n); n; n = agnxtnode(subg, n)) {
	    if (VAL(n) < min) {
		child = n;
		min = VAL(n);
		parent = PARENT(n);
	    }
	}
	SET_PARENT(parent);
	CHILD(bp) = child;
	next = bp->next;	/* save next since list insertion destroys it */
	appendBlock(&(BLOCK(parent)->children), bp);
    }
    initBlocklist(&state->bl);	/* zero out list */
    return root;
}
开发者ID:Chaduke,项目名称:bah.mod,代码行数:46,代码来源:blocktree.c

示例14: VAL

// We are going to override (is that the right word?) the draw()
// method of ModelerView to draw out RobotArm
void RobotArm::draw()
{
	/* pick up the slider values */

	float theta = VAL( BASE_ROTATION );
	float phi = VAL( LOWER_TILT );
	float psi = VAL( UPPER_TILT );
	float cr = VAL( CLAW_ROTATION );
	float h1 = VAL( BASE_LENGTH );
	float h2 = VAL( LOWER_LENGTH );
	float h3 = VAL( UPPER_LENGTH );
	float pc = VAL( PARTICLE_COUNT );


    // This call takes care of a lot of the nasty projection 
    // matrix stuff
	ModelerView::draw();
	static GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 };
	Mat4f temp = getModelViewMatrix();

	// define the model

	ground(-0.2);
	
	if (true) {
		Ariou();
	} else {
		base(0.8);

	    glTranslatef( 0.0, 0.8, 0.0 );			// move to the top of the base
	    glRotatef( theta, 0.0, 1.0, 0.0 );		// turn the whole assembly around the y-axis. 
		rotation_base(h1);						// draw the rotation base

	    glTranslatef( 0.0, h1, 0.0 );			// move to the top of the base
	    glRotatef( phi, 0.0, 0.0, 1.0 );		// rotate around the z-axis for the lower arm
		glTranslatef( -0.1, 0.0, 0.4 );
		lower_arm(h2);							// draw the lower arm

	    glTranslatef( 0.0, h2, 0.0 );			// move to the top of the lower arm
	    glRotatef( psi, 0.0, 0.0, 1.0 );		// rotate  around z-axis for the upper arm
		upper_arm(h3);							// draw the upper arm

		glTranslatef( 0.0, h3, 0.0 );
		glRotatef(cr, 0.0, 0.0, 1.0);
		claw(1.0);
		SpawnParticles(temp);
	}

	//*** DON'T FORGET TO PUT THIS IN YOUR OWN CODE **/
	endDraw();
}
开发者ID:billytotochan,项目名称:anime,代码行数:53,代码来源:robotarm.cpp

示例15: numofval

/*
 * return the number of cards in h having the given rank value
 */
int
numofval(CARD h[], int n, int v)
{
	int i, j;

	j = 0;
	for (i = 0; i < n; i++) {
		if (VAL(h[i].rank) == v)
			++j;
	}
	return (j);
}
开发者ID:mikekmv,项目名称:aeriebsd-src,代码行数:15,代码来源:support.c


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