本文整理汇总了C++中IObjParam::GetModContexts方法的典型用法代码示例。如果您正苦于以下问题:C++ IObjParam::GetModContexts方法的具体用法?C++ IObjParam::GetModContexts怎么用?C++ IObjParam::GetModContexts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjParam
的用法示例。
在下文中一共展示了IObjParam::GetModContexts方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChangeBegin
void EditFaceDataMod::ChangeBegin () {
if (selLevel == SEL_OBJECT) return;
if (efdRestore) {
delete efdRestore;
efdRestore = NULL;
}
// Find the modcontext with the selected faces.
// NOTE that as currently written, this modifier won't
// support setting FaceFloats on more than one node at a time.
ModContextList mcList;
INodeTab nodes;
ip->GetModContexts(mcList,nodes);
int numSelected=0, whichFace;
float value;
bool valueDetermined=true;
EditFaceDataModData *relevantMD;
if (selLevel) {
for (int i = 0; i < mcList.Count(); i++) {
EditFaceDataModData *meshData = (EditFaceDataModData*)mcList[i]->localData;
if (!meshData) continue;
meshData->DescribeSelection (numSelected, whichFace, value, valueDetermined);
if (!numSelected) continue;
relevantMD = meshData;
break;
}
}
nodes.DisposeTemporary ();
if (!numSelected) return;
efdRestore = new EditFaceDataRestore (this, relevantMD);
}
示例2: ClearSelection
void EditFaceDataMod::ClearSelection(int selLevel) {
ModContextList list;
INodeTab nodes;
ip->GetModContexts(list,nodes);
EditFaceDataModData *d;
for (int i=0; i<list.Count(); i++) {
d = (EditFaceDataModData*)list[i]->localData;
if (!d) continue;
// Check if we have anything selected first:
switch (selLevel) {
case SEL_FACE:
if (!d->GetFaceSel().NumberSet()) continue;
else break;
}
if (theHold.Holding() && !d->GetHeld()) theHold.Put (new SelectRestore (this, d));
d->SynchSize ();
switch (selLevel) {
case SEL_FACE:
d->GetFaceSel().ClearAll();
break;
}
}
nodes.DisposeTemporary();
SelectionChanged ();
}
示例3: UpdateDialog
void EditFaceDataMod::UpdateDialog () {
TSTR buf;
int numFaces=0, whichFace=0;
float value = 1.0f;
bool valueDetermined = true;
if (!hParams) return;
ModContextList mcList;
INodeTab nodes;
ip->GetModContexts(mcList,nodes);
if (selLevel) {
for (int i = 0; i < mcList.Count(); i++) {
EditFaceDataModData *meshData = (EditFaceDataModData*)mcList[i]->localData;
if (!meshData) continue;
int numSelectedHere;
meshData->DescribeSelection (numSelectedHere, whichFace, value, valueDetermined);
numFaces += numSelectedHere;
}
}
ISpinnerControl *spin = GetISpinner (GetDlgItem (hParams, IDC_VALUE_SPIN));
ICustButton *but = GetICustButton (GetDlgItem (hParams, IDC_RESET_SELECTION));
switch (selLevel) {
case SEL_FACE:
if (numFaces==1) {
buf.printf (GetString(IDS_FACE_SELECTED), whichFace+1);
} else {
if (numFaces) buf.printf (GetString (IDS_FACES_SELECTED), numFaces);
else buf = GetString (IDS_NO_FACE_SELECTED);
}
but->Enable (numFaces);
spin->Enable (numFaces);
if (numFaces && valueDetermined) {
spin->SetIndeterminate (false);
spin->SetValue (value, FALSE);
} else {
spin->SetIndeterminate (true);
}
break;
case SEL_OBJECT:
buf = GetString (IDS_OBJECT_SELECTED);
spin->Disable();
but->Disable ();
break;
}
SetDlgItemText(hParams,IDC_FACE_SELECTED,buf);
ReleaseISpinner (spin);
ReleaseICustButton (but);
}
示例4: ResetSelection
void EditFaceDataMod::ResetSelection () {
ModContextList list;
INodeTab nodes;
ip->GetModContexts(list,nodes);
EditFaceDataModData *d;
theHold.Begin ();
for (int i=0; i<list.Count(); i++) {
d = (EditFaceDataModData*)list[i]->localData;
if (!d) continue;
EditFaceDataRestore *efd = new EditFaceDataRestore (this, d);
d->ResetFace (d->GetFaceSel());
efd->After ();
theHold.Put (efd);
}
nodes.DisposeTemporary();
theHold.Accept (GetString (IDS_RESET_SELECTED));
ValueChanged ();
}
示例5: InvertSelection
void EditFaceDataMod::InvertSelection(int selLevel) {
ModContextList list;
INodeTab nodes;
ip->GetModContexts(list,nodes);
EditFaceDataModData *d;
for (int i=0; i<list.Count(); i++) {
d = (EditFaceDataModData*)list[i]->localData;
if (!d) continue;
if (theHold.Holding() && !d->GetHeld()) theHold.Put(new SelectRestore(this,d));
d->SynchSize();
switch (selLevel) {
case SEL_FACE:
d->GetFaceSel() = ~d->GetFaceSel();
break;
}
}
nodes.DisposeTemporary();
SelectionChanged ();
}
示例6: DisplayColors
void FaceDataToColorMod::DisplayColors () {
if (!mpInterface) return;
int channel = 0;
if (mpParams) mpParams->GetValue (pb_channel, TimeValue(0), channel, FOREVER);
ModContextList mcList;
INodeTab nodes;
mpInterface->GetModContexts(mcList,nodes);
for (int nd = 0; nd<nodes.Count(); nd++) {
nodes[nd]->SetCVertMode (true);
nodes[nd]->SetShadeCVerts (true);
if (channel) nodes[nd]->SetVertexColorType (nvct_illumination);
else nodes[nd]->SetVertexColorType (nvct_color);
//nodes[nd]->NotifyDependents (FOREVER, PART_DISPLAY, REFMSG_CHANGE);
}
// KLUGE: above notify dependents call only seems to set a limited refresh region. Result looks bad.
// So we do this instead:
NotifyDependents (FOREVER, PART_DISPLAY, REFMSG_CHANGE);
mpInterface->RedrawViews (mpInterface->GetTime());
}
示例7: SelectSubComponent
void EditFaceDataMod::SelectSubComponent (HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert) {
EditFaceDataModData *d = NULL, *od = NULL;
ModContextList mcList;
INodeTab nodes;
ip->GetModContexts(mcList,nodes);
BitArray nsel;
for (int nd=0; nd<mcList.Count(); nd++) {
d = (EditFaceDataModData*) mcList[nd]->localData;
if (d==NULL) continue;
HitRecord *hr = hitRec;
if (!all && (hr->modContext->localData != d)) continue;
for (; hr!=NULL; hr=hr->Next()) if (hr->modContext->localData == d) break;
if (hr==NULL) continue;
Mesh *mesh = d->GetCacheMesh();
MNMesh *mnmesh = d->GetCacheMNMesh();
if (!mesh && !mnmesh) continue;
if (theHold.Holding() && !d->GetHeld()) theHold.Put (new SelectRestore (this, d));
switch (selLevel) {
case SEL_FACE:
nsel = d->GetFaceSel();
for (; hr != NULL; hr=hr->Next()) {
if (d != hr->modContext->localData) continue;
nsel.Set (hr->hitInfo, invert ? !d->GetFaceSel()[hr->hitInfo] : selected);
if (!all) break;
}
d->GetFaceSel() = nsel;
break;
}
}
nodes.DisposeTemporary ();
SelectionChanged ();
}