本文整理汇总了C++中ParamBlockDesc2类的典型用法代码示例。如果您正苦于以下问题:C++ ParamBlockDesc2类的具体用法?C++ ParamBlockDesc2怎么用?C++ ParamBlockDesc2使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParamBlockDesc2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertFRGBAAttrib
//----------------------------------------------------------------------------
bool SceneBuilder::ConvertFRGBAAttrib(IParamBlock2* paramBlock, int index,
std::string &name, PX2::Float4 &value)
{
ParamBlockDesc2 *paramDesc = paramBlock->GetDesc();
if (!paramDesc)
return false;
ParamDef ¶mDef = paramDesc->GetParamDef(paramDesc->IndextoID(index));
Point4 vectorValue;
Interval validInterval;
BOOL retrieved = false;
retrieved = paramBlock->GetValue((ParamID)index, 0 , vectorValue, validInterval);
if(retrieved)
{
TCHAR* valueName = paramDef.int_name;
if (!IsValidName(valueName))
valueName = paramBlock->GetLocalName((ParamID)index );
assertion(IsValidName(valueName), "valueName must be valuable.");
name = std::string(valueName);
value = PX2::Float4(vectorValue.x, vectorValue.y, vectorValue.z,
vectorValue.w);
if(HasAnimation(paramBlock, index))
{
}
}
return true;
}
示例2: GetCOREInterface
IParamMap2 *plResponderProc::ICreateMap(IParamBlock2 *pb)
{
ParamBlockDesc2 *pd = pb->GetDesc();
// Don't show anything if there isn't a UI
if (pd->Count() < 1)
{
pb->ReleaseDesc();
return nil;
}
// Create the rollout
IParamMap2 *map = CreateCPParamMap2(0,
pb,
GetCOREInterface(),
hInstance,
MAKEINTRESOURCE(pd->dlg_template),
GetString(pd->title),
pd->flags,
pd->dlgProc,
NULL,
ROLLUP_CAT_STANDARD);
// Save the rollout in the paramblock
pb->SetMap(map);
pb->ReleaseDesc();
return map;
}
示例3: ConvertIntListBoxAttrib
//----------------------------------------------------------------------------
bool SceneBuilder::ConvertIntListBoxAttrib (IParamBlock2* paramBlock,
int index, std::string &name,
int &value)
{
ParamBlockDesc2 *paramDesc = paramBlock->GetDesc();
if (!paramDesc)
return false;
ParamDef& paramDef = paramDesc->GetParamDef(paramDesc->IndextoID(index));
int intValue;
Interval validInverval;
BOOL retrieved = false;
retrieved = paramBlock->GetValue((ParamID)index, 0, intValue,
validInverval);
if (retrieved)
{
char* valueName = paramDef.int_name;
if (!IsValidName(valueName))
{
valueName = paramBlock->GetLocalName((ParamID)index);
assertion(IsValidName(valueName), "valueName must be valuable.");
}
name = std::string(valueName);
//3ds Max中数组从1开始,这里的index要减1
value = (intValue==-1) ? -1 : (intValue-1);
}
return true;
}
示例4: ConvertFloatAttrib
//----------------------------------------------------------------------------
bool SceneBuilder::ConvertFloatAttrib (IParamBlock2* paramBlock, int index,
std::string &name, float &value)
{
ParamBlockDesc2 *paramDesc = paramBlock->GetDesc();
if(!paramDesc)
return false;
ParamDef ¶mDef = paramDesc->GetParamDef(paramDesc->IndextoID(index));
float floatValue;
Interval validInverval;
BOOL retrieved = paramBlock->GetValue((ParamID)index, 0, floatValue, validInverval);
if(!retrieved)
{
return false;
}
char *valueName = paramDef.int_name;
if (!IsValidName(valueName))
{
valueName = paramBlock->GetLocalName((ParamID)index);
assertion(IsValidName(valueName), "valueName must be valuable.");
}
name = std::string(valueName);
//if (!HasAnimation(paramBlock, index))
{
value = floatValue;
return true;
}
return true;
}
示例5: ValidateReturnType
bool mrShaderFilter::ValidateReturnType(ParamBlockDesc2& pbDesc) {
// Go through all the parameters of the block
int count = pbDesc.Count();
for(int i = 0; i < count; ++i) {
const ParamDef& paramDef = pbDesc.GetParamDef(pbDesc.IndextoID(i));
if(ValidType(paramDef.type))
return true;
}
return false;
}
示例6: ConvertBitMapAttrib
//----------------------------------------------------------------------------
bool SceneBuilder::ConvertBitMapAttrib(IParamBlock2* paramBlock, int index,
std::string &name,
PX2::Texture2D *&tex2d)
{
ParamBlockDesc2 *paramDesc = paramBlock->GetDesc();
if (!paramDesc)
return false;
ParamDef ¶mDef = paramDesc->GetParamDef(paramDesc->IndextoID(index));
PX2_UNUSED(paramDef);
PBBitmap *pb;
Interval validInterval;
char *valueName = 0;
PX2_UNUSED(valueName);
BOOL retrieved = false;
retrieved = paramBlock->GetValue((ParamID)index, 0, pb, validInterval);
char strBitMapName[256];
memset(strBitMapName, 0, 256*sizeof(char));
if (pb)
{
if (BMMGetFullFilename(&pb->bi) == TRUE)
{
strcpy(strBitMapName, pb->bi.Name());
std::string resourcePath;
std::string fullName = std::string(strBitMapName);
std::string::size_type sizeT = fullName.find_first_not_of(mSettings->SrcRootDir);
resourcePath = std::string(strBitMapName).substr(sizeT);
tex2d = PX2::DynamicCast<PX2::Texture2D>(
PX2::ResourceManager::GetSingleton().BlockLoad(strBitMapName));
tex2d->SetResourcePath(resourcePath);
}
}
if (retrieved)
{
valueName = paramDef.int_name;
if (!IsValidName(valueName))
valueName = paramBlock->GetLocalName((ParamID)index);
assertion(IsValidName(valueName), "valueName must be valuable.");
name = valueName;
}
return true;
}
示例7: BeginEditParams
void MorphByBone::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev )
{
this->ip = ip;
TimeValue t = ip->GetTime();
NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT);
NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);
SetAFlag(A_MOD_BEING_EDITED);
moveMode = new MoveModBoxCMode(this,ip);
rotMode = new RotateModBoxCMode(this,ip);
uscaleMode = new UScaleModBoxCMode(this,ip);
nuscaleMode = new NUScaleModBoxCMode(this,ip);
squashMode = new SquashModBoxCMode(this,ip);
selectMode = new SelectModBoxCMode(this,ip);
MorphByBoneDesc.BeginEditParams(ip, this, flags, prev);
morphbybone_param_blk.SetUserDlgProc(morphbybone_mapparams, new MorphByBoneParamsMapDlgProc(this));
morphbybone_param_blk.SetUserDlgProc(morphbybone_mapparamsprop, new MorphByBoneParamsMapDlgProcProp(this));
morphbybone_param_blk.SetUserDlgProc(morphbybone_mapparamscopy, new MorphByBoneParamsMapDlgProcCopy(this));
morphbybone_param_blk.SetUserDlgProc(morphbybone_mapparamsselection, new MorphByBoneParamsMapDlgProcSoftSelection(this));
}
示例8: DlgProc
INT_PTR EllipseTypeInDlgProc::DlgProc(TimeValue t,IParamMap2 *map,HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch (msg)
{
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_TI_CREATE:
{
Matrix3 tm(1);
Point3 pos = theEllispeTypeInBlock.GetPoint3(PB_TI_POS);
float length = theEllispeTypeInBlock.GetFloat(PB_TI_LENGTH);
float width = theEllispeTypeInBlock.GetFloat(PB_TI_WIDTH);
float thickness = theEllispeTypeInBlock.GetFloat(PB_TI_THICKNESS);
tm.SetTrans(pos);
ro->suspendSnap = FALSE;
EllipseObject* new_object = dynamic_cast<EllipseObject*>(ro->ip->NonMouseCreate(tm));
if(new_object)
{
new_object->GetParamBlockByID(ellipse_params)->SetValue(PB_LENGTH, t, length);
new_object->GetParamBlockByID(ellipse_params)->SetValue(PB_WIDTH, t, width);
new_object->GetParamBlockByID(ellipse_params)->SetValue(PB_THICKNESS, t, thickness);
}
return TRUE;
}
}
break;
}
return FALSE;
}
示例9: NotifyRefChanged
RefResult FormationBhvr::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate)
{
switch (message)
{
case REFMSG_CHANGE:
//something changed perhaps a name?.. reset the text.
SetFollowerNodeText();
SetLeaderNodeText();
formation_pblk.InvalidateUI();
break;
case REFMSG_CONTAINER_ELEMENT_NULLED:
if (hTarget == pblock)
{
//was is something in the formation?
if (pblock->LastNotifyParamID() == follower)
{
///okay somebody in the formation was deleted..
INode *n;
int i;
int start = 0;
while (TRUE)
{
for(i=start; i<pblock->Count(follower); i++)
{
pblock->GetValue(follower, 0, n, FOREVER, i);
if(!n)
{
//This one was NULLed so remove from Tabs.
pblock->Delete(follower,i,1);
pblock->Delete(follower_matrix1,i,1);
pblock->Delete(follower_matrix2,i,1);
pblock->Delete(follower_matrix3,i,1);
pblock->Delete(follower_matrix4,i,1);
start = i;
break;
}
}
if (i >= pblock->Count(follower)) break;
}
}
}
//set up the button text due to possible changes.
SetFollowerNodeText();
SetLeaderNodeText();
formation_pblk.InvalidateUI();
break;
}
return REF_SUCCEED;
}
示例10: BeginEditParams
void EllipseObject::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev)
{
SimpleSpline::BeginEditParams(ip, flags, prev);
this->ip = ip;
ellipseObjDesc.BeginEditParams(ip, this, flags, prev);
theEllipseParamBlock.SetUserDlgProc( new EllipseParamDlgProc(this) );
theEllispeTypeInBlock.SetUserDlgProc( new EllipseTypeInDlgProc(this) );
}
示例11: CreateParamDlg
ParamDlg* BerconNoise::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) {
IAutoMParamDlg* masterDlg = BerconNoiseDesc.CreateParamDlgs(hwMtlEdit, imp, this);
texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
masterDlg->AddDlg(texoutDlg);
berconnoise_param_blk.SetUserDlgProc(new BerconNoiseDlgProc(this));
BerconCurve_param_blk.SetUserDlgProc(new BerconCurveDlgProcNOISE(this));
xyz_blk.SetUserDlgProc(new BerconXYZDlgProc(this));
EnableStuff();
return masterDlg;
}
示例12: SetSubTexmap
void BerconGradient::SetSubTexmap(int i, Texmap *m) {
if (i >= SUBMAPCOUNT+gradient->numKeys()) return;
ReplaceReference(i+REF_OFFSET, m);
if (i == MAPTEX_NUM)
gradientmap_param_blk.InvalidateUI(pb_maptex);
else if (i == KEYTEX_NUM)
gradientmap_param_blk.InvalidateUI(pb_keyTex);
else if (i == DISTEX_NUM)
gradientmap_param_blk.InvalidateUI(pb_distex);
ivalid.SetEmpty();
}
示例13: SwapInputs
void Noise::SwapInputs() {
Color t = col[0]; col[0] = col[1]; col[1] = t;
Texmap *x = subTex[0]; subTex[0] = subTex[1]; subTex[1] = x;
pblock->SwapControllers(noise_color1,0,noise_color2,0);
noise_param_blk.InvalidateUI(noise_color1);
noise_param_blk.InvalidateUI(noise_color2);
noise_param_blk.InvalidateUI(noise_map1);
noise_param_blk.InvalidateUI(noise_map2);
macroRecorder->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("color1"), mr_reftarg, this, mr_prop, _T("color2"), mr_reftarg, this);
macroRecorder->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("map1"), mr_reftarg, this, mr_prop, _T("map2"), mr_reftarg, this);
}
示例14: CreateParamDlg
ParamDlg* BerconGradient::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) {
//xyzGenDlg = xyzGen->CreateParamDlg(hwMtlEdit, imp);
IAutoMParamDlg* masterDlg = BerconGradientDesc.CreateParamDlgs(hwMtlEdit, imp, this);
texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
//masterDlg->AddDlg(xyzGenDlg);
masterDlg->AddDlg(texoutDlg);
gradientmap_param_blk.SetUserDlgProc(new BerconGradientDlgProc(this));
BerconCurve_param_blk.SetUserDlgProc(new BerconCurveDlgProcGRADIENT(this));
xyz_blk.SetUserDlgProc(new BerconXYZDlgProc(this));
EnableStuff();
return masterDlg;
}
示例15: SwapInputs
void Speckle::SwapInputs() {
Color t = col[0]; col[0] = col[1]; col[1] = t;
Texmap *x = subTex[0]; subTex[0] = subTex[1]; subTex[1] = x;
// pblock->SwapControllers(PB_COL1, PB_COL2);
pblock->SwapControllers(speckle_color1,0, speckle_color2,0);
speckle_param_blk.InvalidateUI(speckle_color1);
speckle_param_blk.InvalidateUI(speckle_color2);
speckle_param_blk.InvalidateUI(speckle_map1);
speckle_param_blk.InvalidateUI(speckle_map2);
macroRec->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("color1"), mr_reftarg, this, mr_prop, _T("color2"), mr_reftarg, this);
macroRec->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("map1"), mr_reftarg, this, mr_prop, _T("map2"), mr_reftarg, this);
}