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


C++ IParamBlock2::SetValue方法代码示例

本文整理汇总了C++中IParamBlock2::SetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock2::SetValue方法的具体用法?C++ IParamBlock2::SetValue怎么用?C++ IParamBlock2::SetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IParamBlock2的用法示例。


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

示例1: hsAssert

Texmap  *plRTProjDirLight::GetProjMap() 
{ 
    // If we don't have one, create one
    plLayerTex  *layer = (plLayerTex *)fProjPB->GetTexmap( kTexmap, 0 );
    if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID )
    {
        layer = new plLayerTex;
        fProjPB->SetValue( kTexmap, 0, (Texmap *)layer );

        IParamBlock2 *bitmapPB = layer->GetParamBlockByID( plLayerTex::kBlkBitmap );
        bitmapPB->SetValue( kBmpUseBitmap, 0, 1 );
    }

    // Backwards compatability here
    PBBitmap    *bitmap = fProjPB->GetBitmap( kProjMap, 0 );
    if( bitmap != nil )
    {
        layer->SetBitmap( &bitmap->bi );
        fProjPB->SetValue( kProjMap, 0, (PBBitmap *)nil );
    }

    if( layer )
    {
        const char* dbgTexName = layer->GetName();

        IParamBlock2 *bitmapPB = layer->GetParamBlockByID(plLayerTex::kBlkBitmap);
        hsAssert(bitmapPB, "LayerTex with no param block");

        int noCompress = fProjPB->GetInt(kProjNoCompress);
        int noMip = fProjPB->GetInt(kProjNoMip);
        bitmapPB->SetValue(kBmpNonCompressed, TimeValue(0), noCompress);
        bitmapPB->SetValue(kBmpNoFilter, TimeValue(0), noMip);
    }
    return (Texmap *)layer;
}
开发者ID:Asteral,项目名称:Plasma,代码行数:35,代码来源:plRTProjDirLight.cpp

示例2: Update

void Mask::Update(TimeValue t, Interval& valid) {		

	if (Param1)
		{
		pblock->SetValue( mask_map1_on, 0, mapOn[0]);
		pblock->SetValue( mask_map2_on, 0, mapOn[1]);
		pblock->SetValue( mask_invert, 0, invertMask);
		Param1 = FALSE;
		}

	if (!ivalid.InInterval(t)) {

		ivalid.SetInfinite();

		pblock->GetValue( mask_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( mask_map2_on, t, mapOn[1], ivalid);
		pblock->GetValue( mask_invert, t, invertMask, ivalid);
		NotifyDependents(FOREVER, PART_TEXMAP, REFMSG_DISPLAY_MATERIAL_CHANGE);
		}
	if (!mapValid.InInterval(t))
	{
		mapValid.SetInfinite();
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,mapValid);
		}
	}
	valid &= mapValid;
	valid &= ivalid;
	}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:30,代码来源:mask.cpp

示例3: Interval

Texmap  *plRTSpotLight::GetProjMap()
{
    if( !fLightPB->GetInt( kUseProjectorBool ) )
        return nil;

    Interval valid = Interval(0,0); 
    if( !GetTex() )
    {
        if( fLightPB->GetInt( kUseProjectorBool ) )
        {
            PBBitmap* bitmap = fLightPB->GetBitmap( kProjMapTexButton, 0 );         
            SetProjMap( &bitmap->bi );
        }
    }

    if( GetTex() )
    {
        const char* dbgTexName = GetTex()->GetName();

        IParamBlock2 *bitmapPB = fTex->GetParamBlockByID(plLayerTex::kBlkBitmap);
        hsAssert(bitmapPB, "LayerTex with no param block");

        int noCompress = fLightPB->GetInt(kProjNoCompress);
        int noMip = fLightPB->GetInt(kProjNoMip);
        bitmapPB->SetValue(kBmpNonCompressed, TimeValue(0), noCompress);
        bitmapPB->SetValue(kBmpNoFilter, TimeValue(0), noMip);
    }

    return (Texmap *)GetTex();
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:30,代码来源:plRealTimeLights.cpp

示例4: Update

void OrenNayarBlinnShader::Update(TimeValue t, Interval &valid) {
	Point3 p, p2;
	if( inUpdate )
		return;
	inUpdate = TRUE;
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();

//		pblock->GetValue( onb_ambient, t, p, ivalid );
//		ambient = LimitColor(Color(p.x,p.y,p.z));
		pblock->GetValue( onb_diffuse, t, p, ivalid );
		diffuse= LimitColor(Color(p.x,p.y,p.z));
		pblock->GetValue( onb_ambient, t, p2, ivalid );
		if( lockAD && (p!=p2)){
			pblock->SetValue( onb_ambient, t, diffuse);
			ambient = diffuse;
		} else {
			pblock->GetValue( onb_ambient, t, p, ivalid );
			ambient = Bound(Color(p.x,p.y,p.z));
		}
		pblock->GetValue( onb_specular, t, p2, ivalid );
		if( lockDS && (p!=p2)){
			pblock->SetValue( onb_specular, t, diffuse);
			specular = diffuse;
		} else {
			pblock->GetValue( onb_specular, t, p, ivalid );
			specular = Bound(Color(p.x,p.y,p.z));
		}
//		pblock->GetValue( onb_specular, t, p, ivalid );
//		specular = LimitColor(Color(p.x,p.y,p.z));

		pblock->GetValue( onb_glossiness, t, glossiness, ivalid );
		LIMIT0_1(glossiness);
		pblock->GetValue( onb_specular_level, t, specularLevel, ivalid );
		LIMITMINMAX(specularLevel,0.0f,9.99f);
		pblock->GetValue( onb_soften, t, softThresh, ivalid); 
		LIMIT0_1(softThresh);

		pblock->GetValue( onb_self_illum_amnt, t, selfIllum, ivalid );
		LIMIT0_1(selfIllum);
		pblock->GetValue( onb_self_illum_color, t, p, ivalid );
		selfIllumClr = LimitColor(Color(p.x,p.y,p.z));

		pblock->GetValue( onb_diffuse_level, t, diffLevel, ivalid );
		LIMITMINMAX(diffLevel,0.0f, 4.00f);
		pblock->GetValue( onb_roughness, t, diffRough, ivalid );
		LIMIT0_1(diffRough);

		// also get the non-animatables in case changed from scripter or other pblock accessors
		pblock->GetValue(onb_ds_lock, t, lockDS, ivalid);
		pblock->GetValue(onb_ad_lock, t, lockAD, ivalid);
		pblock->GetValue(onb_ad_texlock, t, lockADTex, ivalid);
		pblock->GetValue(onb_use_self_illum_color, t, selfIllumClrOn, ivalid);

		curTime = t;
	}
	valid &= ivalid;
	inUpdate = FALSE;
}
开发者ID:2asoft,项目名称:xray,代码行数:59,代码来源:shaderonb.cpp

示例5: DlgProc

BOOL plFootstepSoundComponentProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    IParamBlock2 *pb = pm->GetParamBlock();
    HWND hSurface = GetDlgItem(hWnd, IDC_COMP_FOOTSTEP_SOUND_SURFACE);
    HWND hPick = GetDlgItem(hWnd, IDC_COMP_FOOTSTEP_SOUND_PICK);
    INode *curPick = nil;
    int curSurface = 0;

    switch (msg)
    {
    case WM_INITDIALOG:
        {
            int i;
            for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++)
                ComboBox_AddString(hSurface, plArmatureEffectsMgr::SurfaceStrings[i]);

            curSurface = pb->GetInt(ParamID(plFootstepSoundComponent::kSurface));
            ComboBox_SetCurSel(hSurface, curSurface);

            curPick = pb->GetINode(ParamID(plFootstepSoundComponent::kSurfaceList), 0, curSurface);
            Button_SetText(hPick, (curPick == nil ? "None" : curPick->GetName()));
        }
        return TRUE;


    case WM_COMMAND:
        if (HIWORD(wParam) == BN_CLICKED)
        {
            if (LOWORD(wParam) == IDC_COMP_FOOTSTEP_SOUND_PICK)
            {
                std::vector<Class_ID> cids;
                cids.push_back(RANDOM_SOUND_COMPONENT_ID);
                if (plPick::NodeRefKludge(pb, plFootstepSoundComponent::kNodePicker, &cids, true, false))           
                {
                    curPick = pb->GetINode(ParamID(plFootstepSoundComponent::kNodePicker));
                    curSurface = pb->GetInt(ParamID(plFootstepSoundComponent::kSurface));
                    pb->SetValue(ParamID(plFootstepSoundComponent::kSurfaceList), 0, curPick, curSurface); 
                    Button_SetText(hPick, (curPick == nil ? "None" : curPick->GetName()));
                }
            
                return TRUE;
            }
        }
        else if (LOWORD(wParam) == IDC_COMP_FOOTSTEP_SOUND_SURFACE)
        {
            curSurface = ComboBox_GetCurSel(hSurface);
            curPick = pb->GetINode(ParamID(plFootstepSoundComponent::kSurfaceList), 0, curSurface);
            pb->SetValue(ParamID(plFootstepSoundComponent::kSurface), 0, curSurface);
            Button_SetText(hPick, (curPick == nil ? "None" : curPick->GetName()));
        }
    }

    return FALSE;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:54,代码来源:plFootstepComponent.cpp

示例6: OnSetWidthLength

//void RendSpline::UpdateAspect(HWND hWnd, TimeValue t)
//{
//	
//	//ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
//	//
//	//iSpin->SetValue(this->GetAspect((UseViewOrRenderParams(t)== rbViewport)),FALSE);
//	//ReleaseISpinner(iSpin);
//}
void RendSpline::OnSetWidthLength(HWND hWnd, ParamID lengthID, ParamID widthID, TimeValue t, BOOL widthSet)
{
	static BOOL reenter = FALSE;
	if(reenter)
		return;
	reenter = TRUE;
	ISpinnerControl *iSpin = GetISpinner(GetDlgItem(hWnd, IDC_ASPECTSPIN));
	BOOL aspectlocked;
	float length, width;

	if(UseViewOrRenderParams(t) == rbViewport)
		pblock->GetValue(rnd_v2_vpt_aspect_lock,t,aspectlocked,FOREVER);
	else
		pblock->GetValue(rnd_v2_aspect_lock,t,aspectlocked,FOREVER);

	pblock->GetValue(lengthID,t,length,FOREVER);
	pblock->GetValue(widthID,t,width,FOREVER);

	
	if(!aspectlocked)
	{
		CheckAspectLock(t);

		if(width == 0.0f)
		{
			width = EPS;
			//iSpin->SetValue(0.0f, FALSE);
			//iSpin->SetIndeterminate(TRUE);
		}
		else
			iSpin->SetValue(length/width, FALSE);
			
	}
	else
	{
		if(widthSet)
		{
			pblock->SetValue(lengthID,t,mAspect*width);
		}
		else
		{
			if(mAspect == 0.0f)
				mAspect = EPS;
				//pblock->SetValue(widthID,t,0.0f);
			pblock->SetValue(widthID,t,length/mAspect);
		}
	}

	ReleaseISpinner(iSpin);
	reenter = FALSE;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:59,代码来源:rendspline.cpp

示例7: CmdRemoved

void ResponderWait::CmdRemoved(IParamBlock2 *state, int delIdx)
{
    int numCmds = state->Count(kStateCmdParams);
    for (int i = delIdx; i < numCmds; i++)
    {
        IParamBlock2 *pb = GetWaitBlk(state, i);

        int who = pb->GetInt(kWaitWho);

        if (who == delIdx)
            pb->SetValue(kWaitWho, 0, -1);
        if (who > delIdx)
            pb->SetValue(kWaitWho, 0, who-1);
    }
}
开发者ID:Hoikas,项目名称:Plasma,代码行数:15,代码来源:plResponderWait.cpp

示例8: Init

void Noise::Init() {
	if (xyzGen) xyzGen->Reset();
	else ReplaceReference( XYZGEN_REF, GetNewDefaultXYZGen());	
	if (texout) texout->Reset();
	else ReplaceReference( TEXOUT_REF, GetNewDefaultTextureOutput());		
	ivalid.SetEmpty();
	cacheValid.SetEmpty();
	macroRecorder->Disable();  // disable macrorecorder during reset
		SetColor(0, Color(0.0f,0.0f,0.0f), TimeValue(0));
		SetColor(1, Color(1.0f,1.0f,1.0f), TimeValue(0));
		noiseType = NOISE_REGULAR;
#ifndef RENDER_VER
        RegisterDistanceDefault(_T("Noise Params"), _T("Size"), DEFAULT_NOISE_SIZE, IN_TO_M(DEFAULT_NOISE_SIZE));
        float size = GetDistanceDefault(_T("Noise Params"), _T("Size"));
		SetSize(size, TimeValue(0));
#else
		SetSize(DEFAULT_NOISE_SIZE, TimeValue(0));
#endif
		SetPhase(.0f,TimeValue(0));
		SetLevels(3.0f,TimeValue(0));
		pblock->SetValue(noise_hithresh,0,1.0f);
        
	macroRecorder->Enable();
	for (int i=0; i<NSUBTEX; i++) 
		mapOn[i] = 1;
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:26,代码来源:noise.cpp

示例9: IFixOldPB

void plResponderComponent::IFixOldPB()
{
    if (fCompPB)
    {
        if (fCompPB->Count(kResponderState) == 0)
        {
            IParamBlock2 *pb = CreateParameterBlock2(&gStateBlock, nil);
            int idx = fCompPB->Append(kResponderState, 1, (ReferenceTarget**)&pb);
            pb->SetValue(kStateCmdSwitch, 0, idx);
        }
        if (fCompPB->Count(kResponderStateName) == 0)
        {
            char *name = "";
            fCompPB->Append(kResponderStateName, 1, &name);
        }

        // Make sure there is an enabled value for each command in the state
        for (int i = 0; i < fCompPB->Count(kResponderState); i++)
        {
            IParamBlock2* pb = (IParamBlock2*)fCompPB->GetReferenceTarget(kResponderState, 0, i);
            if (pb->Count(kStateCmdEnabled) != pb->Count(kStateCmdParams))
                pb->SetCount(kStateCmdEnabled, pb->Count(kStateCmdParams));
        }
    }
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:25,代码来源:plResponderComponent.cpp

示例10: MoveCommand

void plResponderProc::MoveCommand(int oldIdx, int newIdx)
{
    // Move data
    int insertIdx = (newIdx > oldIdx) ? newIdx+1 : newIdx;
    int deleteIdx = (newIdx < oldIdx) ? oldIdx+1 : oldIdx;

    ReferenceTarget *targ = fStatePB->GetReferenceTarget(kStateCmdParams, 0, oldIdx);
    fStatePB->Insert(kStateCmdParams, insertIdx, 1, &targ);
    fStatePB->Delete(kStateCmdParams, deleteIdx, 1);

    ReferenceTarget *wait = fStatePB->GetReferenceTarget(kStateCmdWait, 0, oldIdx);
    fStatePB->Insert(kStateCmdWait, insertIdx, 1, &wait);
    fStatePB->Delete(kStateCmdWait, deleteIdx, 1);

    BOOL oldEnabled = fStatePB->GetInt(kStateCmdEnabled, 0, oldIdx);
    BOOL newEnabled = fStatePB->GetInt(kStateCmdEnabled, 0, newIdx);
    fStatePB->SetValue(kStateCmdEnabled, 0, oldEnabled, newIdx);
    fStatePB->SetValue(kStateCmdEnabled, 0, newEnabled, oldIdx);

    ResponderWait::CmdMoved(fStatePB, oldIdx, newIdx);

    LoadList();

    // Reselect item
    // (This doesn't send the LBN_SELCHANGE message so we do that manually)
    ListBox_SetCurSel(fhList, newIdx);
    ICreateCmdRollups();
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:28,代码来源:plResponderComponent.cpp

示例11: Update

    /// Called to update the controls of the dialog
    virtual void    Update( TimeValue t, Interval &valid, IParamMap2 *map )
    {
        ICustButton     *bmSelectBtn;
        IParamBlock2    *pblock;
        int             i;
        long            buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME };
        BitmapInfo      bi;


        ParamMap2UserDlgProc::Update( t, valid, map );

        pblock = map->GetParamBlock();
        for( i = plStaticEnvLayer::kBmpFrontBitmap; i <= plStaticEnvLayer::kBmpBottomBitmap; i++ )
        {
            bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), buttons[ i ] ) );
            PBBitmap *pbbm = pblock->GetBitmap( i, t );
            if( pbbm )
                bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() );
            else
                bmSelectBtn->SetText( _T( "None" ) );
            ReleaseICustButton( bmSelectBtn );
        }

        plStaticEnvLayer *layer = (plStaticEnvLayer *)map->GetParamBlock()->GetOwner();
        bi.SetName( layer->GetBaseFilename( t ) );
        SetDlgItemText( map->GetHWnd(), IDC_BASE_FILENAME, bi.Filename() );
        map->Enable( plStaticEnvLayer::kBmpGenerateFaces, ( bi.Name() == NULL || bi.Name()[ 0 ] == 0 ) ? FALSE : TRUE );

        bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_GENERATE_FACES ) );
        bmSelectBtn->SetText( _T( "Generate From Node" ) );
        ReleaseICustButton( bmSelectBtn );

        i = pblock->GetInt( plStaticEnvLayer::kBmpTextureSize, t );
        pblock->SetValue( plStaticEnvLayer::kBmpLastTextureSize, t, i );
    }
开发者ID:MareinK,项目名称:Plasma,代码行数:36,代码来源:plStaticEnvLayerBitmapPB.cpp

示例12: Init

void CellTex::Init()
	{
	if (xyzGen) xyzGen->Reset();
	else ReplaceReference(1, GetNewDefaultXYZGen());

	if (texout) texout->Reset();
	else ReplaceReference(2, GetNewDefaultTextureOutput());

    RegisterDistanceDefault(_T("Cellular Params"), _T("Size"), 5.0f, IN_TO_M(5.0f));
    float size = GetDistanceDefault(_T("Cellular Params"), _T("Size"));
	pblock->SetValue(cellular_size,0,size);

/*
	pblock->SetValue(PB_CELLCOL,0,Point3(1,1,1));
	pblock->SetValue(PB_DIVCOL1,0,Point3(.5f,.5f,.5f));
	pblock->SetValue(PB_DIVCOL2,0,Point3(0,0,0));
	pblock->SetValue(PB_SIZE,0,5.0f);
	pblock->SetValue(PB_SPREAD,0,0.5f);
	pblock->SetValue(PB_LOW,0,0.0f);
	pblock->SetValue(PB_MID,0,0.5f);
	pblock->SetValue(PB_HIGH,0,1.0f);
	pblock->SetValue(PB_FRACT,0,0);
	pblock->SetValue(PB_ITER,0,3.0f);
	pblock->SetValue(PB_USECELLMAP,0,1);
	pblock->SetValue(PB_USEDIV1MAP,0,1);
	pblock->SetValue(PB_USEDIV2MAP,0,1);
	pblock->SetValue(PB_SMOOTH,0,0.1f);	
	pblock->SetValue(PB_ADAPT,0,1);	
	if (paramDlg)  
		paramDlg->pmap->SetParamBlock(pblock);
*/
	fract = 0;
	ivalid.SetEmpty();
	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:34,代码来源:celltex.cpp

示例13: AppendTarget

BOOL OrientConstRotation::AppendTarget(INode *target, float weight){

	if (target == NULL){
		float var = 50.0f;
		int ct = pblock->Count(orientation_target_list);
		int ctf = pblock->Count(orientation_target_weight);
		theHold.Begin();
		pblock->SetCount(orientation_target_list, ct + 1);
		pblock->SetValue(orientation_target_list, GetCOREInterface()->GetTime(), target, ct);
		pblock->Append(orientation_target_weight, 1, &var, 1);
		theHold.Accept(GetString(IDS_AG_ORIENTATION_LIST));
		return TRUE;
	}
	else if (!(target->TestForLoop(FOREVER,(ReferenceMaker *) this)!=REF_SUCCEED)) 
	{
		for (int i = 0; i < pblock->Count(orientation_target_list); i++){
			if (target == pblock->GetINode(orientation_target_list, GetCOREInterface()->GetTime(), i)){
				return FALSE; // the target is already in the targetlist
			}
		}
			
		theHold.Begin();
		pblock->Append(orientation_target_list, 1, &target, 1);
		pblock->Append(orientation_target_weight, 1, &weight, 1);
		theHold.Accept(GetString(IDS_AG_ORIENTATION_LIST));
		return TRUE;
	}
	return FALSE;


}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:31,代码来源:orientation_cnstrnt.cpp

示例14: DlgProc

    virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
        int id = LOWORD(wParam);
        int code = HIWORD(wParam);

        IParamBlock2 *pb = map->GetParamBlock();
        HWND cbox = NULL;

        switch (msg)
        {
        case WM_INITDIALOG:
            int i;
            for (i = 0; i < plMAXCameraLayer::kMaxUVSrc; i++)
            {
                cbox = GetDlgItem(hWnd, IDC_CAM_LAYER_UV_SRC);
                SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plMAXCameraLayer::kUVStrings[i]);
            }
            UpdateDisplay(map);
            return TRUE;

        case WM_COMMAND:
            if (id == IDC_CAM_LAYER_UV_SRC)
            {
                pb->SetValue(plMAXCameraLayer::kUVSource, t, SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0));
                return TRUE;
            }
            else if (id == IDC_CAM_LAYER_EXPLICIT_CAM)
            {
                UpdateDisplay(map);
                return TRUE;
            }
            break;
        }
        return FALSE;
    }
开发者ID:Asteral,项目名称:Plasma,代码行数:35,代码来源:plMAXCameraLayer.cpp

示例15: SetPercent

void Planet::SetPercent(float f, TimeValue t) { 
	percent = f; 
	// Also set land as percent/100.
	land = f/100.0f;
//	pblock->SetValue(PB_PERCENT, t, f);
	pblock->SetValue(planet_percent, t, f);
}
开发者ID:2asoft,项目名称:xray,代码行数:7,代码来源:planet.cpp


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