本文整理汇总了C++中ofxUIEventArgs::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ ofxUIEventArgs::getParent方法的具体用法?C++ ofxUIEventArgs::getParent怎么用?C++ ofxUIEventArgs::getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofxUIEventArgs
的用法示例。
在下文中一共展示了ofxUIEventArgs::getParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: guiEvent
void GUIAxes::guiEvent(ofxUIEventArgs &e){
// events based on mouse released
if(ofGetMousePressed()){return;}
string name = e.getName();
int axe = getNumAxe(e.getParent());
ofLogNotice("GUI") << e.getParent()->getName() << " // " << e.getName() << "// " << axe ;
// attributes and aggregator modification
if( axe!=-1 && attr[axe]->getSelected().size()>0 ){
if(isAnAttributeList(e.getParent())){
shouldUpdateAggregator = axe;
}
else if (aggr[axe]->getSelected().size()>0 && scaleType[axe]->getSelectedIndeces().size()>0) {
reorderAxe(axe);
}
}
else if(e.getParent() == coordinateType){
for(int i = 0 ; i <3; i++){
reorderAxe(i);
}
}
// mins maxs modifications
else if (e.getKind() == OFX_UI_WIDGET_NUMBERDIALER){
axe = getNumAxe(e.widget);
float s =((ofxUINumberDialer*)e.widget)->getValue();
ofVec3f mask(axe==0?1:0,axe==1?1:0,axe==2?1:0);
if(name.substr(0,name.length()-1)=="min"){
Physics::mins = s*mask + (-mask+ofVec3f(1))*Physics::mins;
}
if(name.substr(0,name.length()-1)=="max"){
Physics::maxs = s*mask + (-mask+ofVec3f(1))*Physics::maxs;
}
scaleType[axe]->getToggles()[2]->setValue(true);
scaleType[axe]->getToggles()[2]->triggerSelf();
Physics::orderByAttributes(attr[axe]->getSelected()[0]->getName()+"."+aggr[axe]->getSelected()[0]->getName(), axe, scaleType[axe]->getSelectedIndeces()[0]);
}
checkOverlapingDDL(e);
}
示例2: guiEvent
void GUIMidi::guiEvent(ofxUIEventArgs & e){
if(e.getParent() == midiPorts){
Midi::i()->midiIn.closePort();
Midi::i()->midiIn.openPort(e.getName());
}
else if(e.widget == midiVelCenter || e.widget == midiVelRange){
Midi::velScale.set(midiVelCenter->getValue() - midiVelRange->getValue()/2.0,midiVelCenter->getValue() + midiVelRange->getValue()/2.0);
}
else if(e.widget == resetNoteMap && !resetNoteMap->getValue()){
Midi::midiNotes.clear();
}
else if(e.widget == midiRadius){
Midi::radius = midiRadius->getValue();
for(auto & m:Midi::midiSpots){
m.radius = Midi::radius;
}
}
else if(e.widget == midiHold){
Midi::hold=midiHold->getValue();
}
else if(e.widget == midiLink2Cam){
Midi::link2Cam = midiLink2Cam->getValue();
}
else if(e.widget == vel2Vol ){
Midi::vel2VolScale.set(vel2Vol->getValueLow(),vel2Vol->getValueHigh());
}
else if(e.widget == midiSpots){
Midi::bMidiSpot = e.getBool();
}
else if(e.widget==randomMidi){
Midi::random = e.getDouble();
}
}