Example #1
0
/***************************************************************************
 * GL-MIRROR-2D
 ****************************************************************************/
GlMirror2d::GlMirror2d(gl_node_id nid, uint32 targets, GlAlgo* hrz, GlAlgo* vrt)
    : inherited(nid, targets)
{
    if (hrz) SetChain(hrz, _HRZ_INDEX);
    if (vrt) SetChain(vrt, _VRT_INDEX);

    mFade[0].wrap.SetAlgo(hrz);
    mFade[1].wrap.SetAlgo(vrt);
}
Example #2
0
/***************************************************************************
 * _GL-ELLIPSE-ALGO
 ***************************************************************************/
_GlEllipseAlgo::_GlEllipseAlgo(	gl_node_id nid, uint32 targets, BPoint ptX,
								BPoint ptY, BPoint ptW, BPoint ptH,
								GlAlgo* xC, GlAlgo* yC, GlAlgo* zC)
		: inherited(nid, targets), mPtX(ptX), mPtY(ptY), mPtW(ptW), mPtH(ptH)
{
	SetChain(xC, _X_INDEX);
	SetChain(yC, _Y_INDEX);
	SetChain(zC, _Z_INDEX);
}
Example #3
0
/***************************************************************************
 * _GL-BLEND-1D
 ***************************************************************************/
_GlBlend1d::_GlBlend1d(	gl_node_id nid, GlAlgo1d* blend,
                        vector<GlAlgo1d*>& maps)
    : inherited(GL_BLEND_KEY, nid), mBlendIndex(-1)
{
    if (blend) {
        SetChain(blend, 0);
        mBlendIndex = 0;
    }
    for (uint32 k = 0; k < maps.size(); k++) {
        if (maps[k]) SetChain(maps[k], k + 1);
    }
}
Example #4
0
/***************************************************************************
 * _GL-REPLICATE-FRACTAL-ALGO
 ****************************************************************************/
_GlReplicateAlgo::_GlReplicateAlgo(	gl_node_id nid, uint32 targets,
									const GlRelAbs& depth, GlAlgo* algo)
		: inherited(nid, targets), mDepth(depth)
{
	ArpVALIDATE(mDepth.abs >= 0, mDepth.abs = 0);
	if (algo) SetChain(algo, _ALGO_INDEX);
}
Example #5
0
int Chain::Load(const char* fname, const char* charname)
{
	ClearBuffer();
	FILE* fp = fopen(fname, "r");
	if(!fp)
	{
		cerr << "Chain::Load- error: failed to open " << fname << " to read" << endl;
		return -1;
	}

	fseek(fp, 0, SEEK_END);
	int lexBufferSize = ftell(fp);
	fseek(fp, 0, SEEK_SET);
	ChainMakeLexerBuffers(lexBufferSize, DEFAULT_LEX_LINE_BUFFER_SIZE);

	if(charname && strcmp(charname, ""))
		SetCharName(charname);
	SetChain(this);

	ChainSetInputFile(fp);
	int ret = chparse();

	ChainDeleteLexerBuffers();
	fclose(fp);

//	Dump(cout);
	return ret;
}
Example #6
0
CChain::CChain(const Vector& P0, const Vector& P1, int iNumParticles, int iRigidity, float fParticleRadius, float fParticleMass)
{
    SetColor(0.0f, 1.0f, 0.3f, 0.5f);

    SetChain(P0, P1, iNumParticles, iRigidity, fParticleRadius, fParticleMass);
}
/***************************************************************************
 * _GL-REPLICATE-MAP
 ***************************************************************************/
_GlReplicateMap::_GlReplicateMap(gl_node_id nid, GlAlgo* map, float depth)
		: inherited(GL_REPLICATE_MAP_KEY, nid), mDepth(depth)
{
	if (map) SetChain(map, _MAP_INDEX);
}
Example #8
0
status_t _GlBinaryOp2d::AssignBinary(GlAlgo* lh, GlAlgo* rh)
{
	SetChain(lh, _LH_INDEX);
	SetChain(rh, _RH_INDEX);
	return B_OK;
}