本文整理汇总了C++中IParamBlock::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock::GetValue方法的具体用法?C++ IParamBlock::GetValue怎么用?C++ IParamBlock::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParamBlock
的用法示例。
在下文中一共展示了IParamBlock::GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EndEditParams
void ExtrudeMod::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next)
{
this->ip = NULL;
editMod = NULL;
TimeValue t = ip->GetTime();
ClearAFlag(A_MOD_BEING_EDITED);
NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);
DestroyCPParamMap(pmapParam);
// Save these values in class variables so the next object created will inherit them.
pblock->GetValue(PB_AMOUNT,ip->GetTime(),dlgAmount,FOREVER);
pblock->GetValue(PB_SEGS,ip->GetTime(),dlgSegs,FOREVER);
if (dlgSegs<1) dlgSegs = 1;
pblock->GetValue(PB_CAPSTART,ip->GetTime(),dlgCapStart,FOREVER);
pblock->GetValue(PB_CAPEND,ip->GetTime(),dlgCapEnd,FOREVER);
pblock->GetValue(PB_CAPTYPE,ip->GetTime(),dlgCapType,FOREVER);
pblock->GetValue(PB_OUTPUT,ip->GetTime(),dlgOutput,FOREVER);
pblock->GetValue(PB_MAPPING,ip->GetTime(),dlgMapping,FOREVER);
pblock->GetValue(PB_GEN_MATIDS,ip->GetTime(),dlgGenMatIDs,FOREVER);
pblock->GetValue(PB_USE_SHAPEIDS,ip->GetTime(),dlgUseShapeIDs,FOREVER);
pblock->GetValue(PB_SMOOTH,ip->GetTime(),dlgSmooth,FOREVER);
}
示例2: GetValidity
Interval RelaxMod::GetValidity(TimeValue t) {
int i;
float f;
// Only have to worry about animated parameters.
Interval valid = FOREVER;
pblock->GetValue (PB_RELAX, t, f, valid);
pblock->GetValue (PB_ITER, t, i, valid);
return valid;
}
示例3: GetValidity
Interval ExtrudeMod::GetValidity(TimeValue t)
{
float f;
int i;
Interval valid = FOREVER;
pblock->GetValue(PB_AMOUNT,t,f,valid);
pblock->GetValue(PB_SEGS,t,i,valid);
pblock->GetValue(PB_CAPSTART,t,i,valid);
pblock->GetValue(PB_CAPEND,t,i,valid);
pblock->GetValue(PB_CAPTYPE,t,i,valid);
return valid;
}
示例4: RenderEnd
int OptMod::RenderEnd(TimeValue t)
{
int views, render;
pblock->GetValue(PB_VIEWS,0,views,FOREVER);
#ifndef NO_OUTPUTRENDERER
pblock->GetValue(PB_RENDER,0,render,FOREVER);
#else
render = views;
#endif
ClearAFlag(A_RENDER);
if (views!=render) {
NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE);
}
return 0;
}
示例5: LocalValidity
Interval FExtrudeMod::LocalValidity(TimeValue t)
{
// aszabo|feb.05.02 If we are being edited, return NEVER
// to forces a cache to be built after previous modifier.
if (TestAFlag(A_MOD_BEING_EDITED))
return NEVER;
Interval iv = FOREVER;
float v;
Point3 pt;
pblock->GetValue(PB_AMOUNT,t,v,iv);
pblock->GetValue(PB_SCALE,t,v,iv);
base->GetValue(t,&pt,iv,CTRL_ABSOLUTE);
return iv;
}
示例6: ModifyObject
void AFRMod::ModifyObject (TimeValue t, ModContext &mc, ObjectState *os, INode *node) {
Interval iv = FOREVER;
float f, p, b;
int backface;
Point3 pt1, pt2;
pblock->GetValue(PB_FALLOFF,t,f,iv);
pblock->GetValue(PB_PINCH,t,p,iv);
pblock->GetValue(PB_BUBBLE,t,b,iv);
pblock->GetValue(PB_BACKFACE,t,backface,iv);
p1->GetValue(t,&pt1,iv,CTRL_ABSOLUTE);
p2->GetValue(t,&pt2,iv,CTRL_ABSOLUTE);
if (f==0.0) {
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
return;
}
Tab<Point3> normals;
if (backface) {
// Need to get vertex normals.
if (os->obj->IsSubClassOf(triObjectClassID)) {
TriObject *tobj = (TriObject*)os->obj;
AverageVertexNormals (tobj->GetMesh(), normals);
} else if (os->obj->IsSubClassOf (polyObjectClassID)) {
PolyObject *pobj = (PolyObject *) os->obj;
MNMesh &mesh = pobj->GetMesh();
normals.SetCount (mesh.numv);
Point3 *vn = normals.Addr(0);
for (int i=0; i<mesh.numv; i++) {
if (mesh.v[i].GetFlag (MN_DEAD)) vn[i]=Point3(0,0,0);
else vn[i] = mesh.GetVertexNormal (i);
}
#ifndef NO_PATCHES
} else if (os->obj->IsSubClassOf (patchObjectClassID)) {
PatchObject *pobj = (PatchObject *) os->obj;
normals.SetCount (pobj->NumPoints ());
Point3 *vn = normals.Addr(0);
for (int i=0; i<pobj->NumPoints(); i++) vn[i] = pobj->VertexNormal (i);
#endif
}
}
if (normals.Count()) {
AFRDeformer deformer(mc,f,p,b,pt1,pt2,&normals);
os->obj->Deform(&deformer, TRUE);
} else {
AFRDeformer deformer(mc,f,p,b,pt1,pt2);
os->obj->Deform(&deformer, TRUE);
}
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
}
示例7: LocalValidity
Interval MatMod::LocalValidity(TimeValue t)
{
int i;
Interval valid = FOREVER;
pblock->GetValue(PB_MATID,t,i,valid);
return valid;
}
示例8: ModifyObject
void MatMod::ModifyObject(TimeValue t, ModContext &mc, ObjectState *os, INode *node)
{
Interval valid = FOREVER;
int id;
pblock->GetValue(PB_MATID,t,id,valid);
id--;
if (id<0) id = 0;
if (id>0xffff) id = 0xffff;
// For version 4 and later, we process patch meshes as they are and pass them on. Earlier
// versions converted to TriMeshes (done below). For adding other new types of objects, add
// them here!
#ifndef NO_PATCHES
if(version >= MATMOD_VER4 && os->obj->IsSubClassOf(patchObjectClassID)) {
PatchObject *patchOb = (PatchObject *)os->obj;
PatchMesh &pmesh = patchOb->GetPatchMesh(t);
BOOL useSel = pmesh.selLevel >= PO_PATCH;
for (int i=0; i<pmesh.getNumPatches(); i++) {
if (!useSel || pmesh.patchSel[i]) {
pmesh.setPatchMtlIndex(i,(MtlID)id);
}
}
pmesh.InvalidateGeomCache(); // Do this because there isn't a topo cache in PatchMesh
patchOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else
#endif // NO_PATCHES
// Process PolyObjects
if(os->obj->IsSubClassOf(polyObjectClassID)) {
PolyObject *polyOb = (PolyObject *)os->obj;
MNMesh &mesh = polyOb->GetMesh();
BOOL useSel = mesh.selLevel == MNM_SL_FACE;
for (int i=0; i<mesh.numf; i++) {
if (!useSel || mesh.f[i].GetFlag(MN_SEL)) {
mesh.f[i].material = (MtlID)id;
}
}
polyOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else // If it's a TriObject, process it
if(os->obj->IsSubClassOf(triObjectClassID)) {
TriObject *triOb = (TriObject *)os->obj;
DoMaterialSet(triOb, id);
triOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else // Fallback position: If it can convert to a TriObject, do it!
if(os->obj->CanConvertToType(triObjectClassID)) {
TriObject *triOb = (TriObject *)os->obj->ConvertToType(t, triObjectClassID);
// Now stuff this into the pipeline!
os->obj = triOb;
DoMaterialSet(triOb, id);
triOb->UpdateValidity(TOPO_CHAN_NUM,valid);
}
else
return; // Do nothing if it can't convert to triObject
}
示例9: RenderBegin
int OptMod::RenderBegin(TimeValue t, ULONG flags)
{
int views, render, man;
pblock->GetValue(PB_VIEWS,0,views,FOREVER);
#ifndef NO_OUTPUTRENDERER
pblock->GetValue(PB_RENDER,0,render,FOREVER);
#else
render = views;
#endif
pblock->GetValue(PB_MANUPDATE,0,man,FOREVER);
SetAFlag(A_RENDER);
if (views!=render || man) {
NotifyDependents(FOREVER,PART_ALL,REFMSG_CHANGE);
}
return 0;
}
示例10: LocalValidity
Interval AFRMod::LocalValidity(TimeValue t)
{
// aszabo|feb.05.02 If we are being edited, return NEVER
// to forces a cache to be built after previous modifier.
if (TestAFlag(A_MOD_BEING_EDITED))
return NEVER;
Interval iv = FOREVER;
float v;
Point3 pt;
pblock->GetValue(PB_FALLOFF,t,v,iv);
pblock->GetValue(PB_PINCH,t,v,iv);
pblock->GetValue(PB_BUBBLE,t,v,iv);
p1->GetValue(t,&pt,iv,CTRL_ABSOLUTE);
p2->GetValue(t,&pt,iv,CTRL_ABSOLUTE);
return iv;
}
示例11: EnableControls
void BombObject::EnableControls()
{
if (falloffSpin)
{
BOOL fallOffOn;
pblock->GetValue(PB_FALLOFFON, 0, fallOffOn, FOREVER);
falloffSpin->Enable(fallOffOn);
}
}
示例12: GetValidity
//aszabo|feb.06.02 - When LocalValidity is called by ModifyObject,
// it returns NEVER and thus the object channels are marked non valid
// As a result, the mod stack enters and infinite evaluation of the modifier
// ModifyObject now calls GetValidity and CORE calls LocalValidity to
// allow for building a cache on the input of this modifier when it's
// being edited
Interval MirrorMod::GetValidity(TimeValue t)
{
Interval iv = FOREVER;
Matrix3 mat(1);
tmControl->GetValue(t,&mat,iv,CTRL_RELATIVE);
float o;
pblock->GetValue(PB_OFFSET,t,o,iv);
return iv;
}
示例13: intern
// property accessor functions for a new property 'aspect'
Value*
get_caps_aspect(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid)
{
// compute & return capsule aspect
IParamBlock *pb = ((Object*)obj)->GetParamBlock()->GetParamBlock();
float h, r;
pb->GetValue(CAPS_HEIGHT, t, h, valid);
pb->GetValue(CAPS_RADIUS, t, r, valid);
return Float::intern(r * 2.0f / h);
}
示例14: Update
void WardShader::Update(TimeValue t, Interval &valid) {
Point3 p, p2;
if( inUpdate )
return;
inUpdate = TRUE;
if (!ivalid.InInterval(t)) {
ivalid.SetInfinite();
// pblock->GetValue( PB_AMBIENT_CLR, t, p, ivalid );
// ambient = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( PB_DIFFUSE_CLR, t, p, ivalid );
diffuse= LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( PB_AMBIENT_CLR, t, p2, ivalid );
if( lockAD && (p!=p2)){
pblock->SetValue( PB_AMBIENT_CLR, t, diffuse);
ambient = diffuse;
} else {
pblock->GetValue( PB_AMBIENT_CLR, t, p, ivalid );
ambient = Bound(Color(p.x,p.y,p.z));
}
pblock->GetValue( PB_SPECULAR_CLR, t, p2, ivalid );
if( lockDS && (p!=p2)){
pblock->SetValue( PB_SPECULAR_CLR, t, diffuse);
specular = diffuse;
} else {
pblock->GetValue( PB_SPECULAR_CLR, t, p, ivalid );
specular = Bound(Color(p.x,p.y,p.z));
}
// pblock->GetValue( PB_SPECULAR_CLR, t, p, ivalid );
// specular = LimitColor(Color(p.x,p.y,p.z));
pblock->GetValue( PB_GLOSSINESS_X, t, glossinessX, ivalid );
LIMITMINMAX(glossinessX, 0.0001f, 1.0f );
pblock->GetValue( PB_GLOSSINESS_Y, t, glossinessY, ivalid );
LIMITMINMAX(glossinessY, 0.0001f, 1.0f );
pblock->GetValue( PB_SPECULAR_LEV, t, specLevel, ivalid );
LIMITMINMAX(specLevel,0.0f,4.00f);
pblock->GetValue( PB_DIFFUSE_LEV, t, diffLevel, ivalid );
LIMITMINMAX(diffLevel,0.0f,2.0f);
curTime = t;
}
valid &= ivalid;
inUpdate = FALSE;
}
示例15: NotifyRefChanged
RefResult OptMod::NotifyRefChanged(
Interval changeInt,
RefTargetHandle hTarget,
PartID& partID,
RefMessage message)
{
switch (message) {
case REFMSG_CHANGE: {
if (pmapParam && pmapParam->GetParamBlock()==pblock) {
pmapParam->Invalidate();
}
int man = FALSE;
if (pblock) pblock->GetValue(PB_MANUPDATE,0,man,FOREVER);
if (man) return REF_STOP;
break;
}
case REFMSG_GET_PARAM_DIM: {
GetParamDim *gpd = (GetParamDim*)partID;
switch (gpd->index) {
case PB_FACETHRESH1:
case PB_FACETHRESH2:
case PB_EDGETHRESH1:
case PB_EDGETHRESH2: gpd->dim = stdAngleDim; break;
case PB_MAXEDGE1:
case PB_MAXEDGE2: gpd->dim = stdWorldDim; break;
default: gpd->dim = defaultDim; break;
}
return REF_STOP;
}
case REFMSG_GET_PARAM_NAME: {
GetParamName *gpn = (GetParamName*)partID;
switch (gpn->index) {
case PB_FACETHRESH1: gpn->name = GetString(IDS_RB_FACETHRESHL1); break;
case PB_FACETHRESH2: gpn->name = GetString(IDS_RB_FACETHRESHL2); break;
case PB_EDGETHRESH1: gpn->name = GetString(IDS_RB_EDGETHRESHL1); break;
case PB_EDGETHRESH2: gpn->name = GetString(IDS_RB_EDGETHRESHL2); break;
case PB_BIAS1: gpn->name = GetString(IDS_RB_BIASL1); break;
case PB_BIAS2: gpn->name = GetString(IDS_RB_BIASL2); break;
case PB_MAXEDGE1: gpn->name = GetString(IDS_RB_MAXEDGE1); break;
case PB_MAXEDGE2: gpn->name = GetString(IDS_RB_MAXEDGE2); break;
default: gpn->name = TSTR(_T("")); break;
}
return REF_STOP;
}
}
return REF_SUCCEED;
}