本文整理汇总了C++中LabelList类的典型用法代码示例。如果您正苦于以下问题:C++ LabelList类的具体用法?C++ LabelList怎么用?C++ LabelList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LabelList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: READ_STRING
std::auto_ptr<OfflineJob> qmimap4::SetLabelOfflineJob::create(InputStream* pStream)
{
wstring_ptr wstrFolder;
READ_STRING(WSTRING, wstrFolder);
if (!wstrFolder.get())
return std::auto_ptr<OfflineJob>(0);
unsigned int nSize = 0;
READ(&nSize, sizeof(nSize));
if (nSize == 0)
return std::auto_ptr<OfflineJob>(0);
UidList listUid;
listUid.resize(nSize);
READ(&listUid[0], nSize*sizeof(UidList::value_type));
wstring_ptr wstrLabel;
READ_STRING(WSTRING, wstrLabel);
unsigned int nLabelSize = 0;
READ(&nLabelSize, sizeof(nLabelSize));
LabelList listLabel;
listLabel.reserve(nLabelSize);
CONTAINER_DELETER(free, listLabel, &freeWString);
for (unsigned int n = 0; n < nLabelSize; ++n) {
wstring_ptr wstrLabel;
READ_STRING(WSTRING, wstrLabel);
listLabel.push_back(wstrLabel.release());
}
return std::auto_ptr<OfflineJob>(new SetLabelOfflineJob(wstrFolder.get(), listUid,
wstrLabel.get(), const_cast<const WCHAR**>(&listLabel[0]), listLabel.size()));
}
示例2: QLatin1String
void QDesignerFormWindowCommand::updateBuddies(QDesignerFormWindowInterface *form,
const QString &old_name,
const QString &new_name)
{
QExtensionManager* extensionManager = form->core()->extensionManager();
typedef QList<QLabel*> LabelList;
const LabelList label_list = qFindChildren<QLabel*>(form);
if (label_list.empty())
return;
const QString buddyProperty = QLatin1String("buddy");
const QByteArray oldNameU8 = old_name.toUtf8();
const QByteArray newNameU8 = new_name.toUtf8();
const LabelList::const_iterator cend = label_list.constEnd();
for (LabelList::const_iterator it = label_list.constBegin(); it != cend; ++it ) {
if (QDesignerPropertySheetExtension* sheet = qt_extension<QDesignerPropertySheetExtension*>(extensionManager, *it)) {
const int idx = sheet->indexOf(buddyProperty);
if (idx != -1) {
const QByteArray oldBuddy = sheet->property(idx).toByteArray();
if (oldBuddy == oldNameU8)
sheet->setProperty(idx, newNameU8);
}
}
}
}
示例3: GetCharSetNames
/**
* @method GetCharSetNames [void:public]
* @param names [LabelList&] the vector in which to store the names
*
* Erases names, then fills names with the names of all stored
* character sets.
*/
void AssumptionsBlock::GetCharSetNames( LabelList& names )
{
names.erase( names.begin(), names.end() );
IntSetMap::const_iterator i;
for( i = charsets.begin(); i != charsets.end(); i++ )
names.push_back( (*i).first );
}
示例4: quitModule
void quitModule(HINSTANCE hInstance)
{
RemoveBangCommand("!LabelCreate");
RemoveBangCommand("!LabelDebug");
RemoveBangCommand("!LabelLsBoxHook");
for(LabelListIterator it = labelList.begin(); it != labelList.end(); it++)
delete *it;
labelList.clear();
SendMessage(GetLitestepWnd(),
LM_UNREGISTERMESSAGE,
(WPARAM) messageHandler,
(LPARAM) lsMessages);
DestroyWindow(messageHandler);
UnregisterClass("LabelLS", hInstance);
UnregisterClass("LabelMessageHandlerLS", hInstance);
delete systemInfo;
delete defaultSettings;
hbmDesktop = (HBITMAP) SelectObject(hdcDesktop, hbmDesktop);
DeleteDC(hdcDesktop);
DeleteObject(hbmDesktop);
}
示例5:
void
X86CodeGen::munchJUMP(Label *lab)
{
LabelList targets;
targets.push_back(lab);
assem::OPER *op = _aOPER("jmp", "'j0", NULL, NULL);
op->setJumpTargets(targets);
emit(op);
}
示例6:
Label *lookupLabel(const string &name)
{
for(LabelListIterator it = labelList.begin(); it != labelList.end(); it++)
{
if(_stricmp(name.c_str(), (*it)->getName().c_str()) == 0)
return *it;
}
return 0;
}
示例7:
// Find the label whose buddy the widget is.
QLabel *buddyLabelOf(QDesignerFormWindowInterface *fw, QWidget *w)
{
typedef QList<QLabel*> LabelList;
const LabelList labelList = fw->findChildren<QLabel*>();
if (labelList.empty())
return 0;
const LabelList::const_iterator cend = labelList.constEnd();
for (LabelList::const_iterator it = labelList.constBegin(); it != cend; ++it )
if ( (*it)->buddy() == w)
return *it;
return 0;
}
示例8: ofPushStyle
void MoMa::SceneApp::draw( LabelList labelList ) {
for( int l=0; l<labelList.size(); l++ ) {
ofPushStyle();
float labelHue = ofGetStyle().color.getHue();
if( labelList[l].state == UNSELECTED ) {
ofColor unselected; unselected.setHsb( labelHue, 128, 255 );
ofSetColor( unselected, 180 ); ofSetLineWidth( 1.2 );
} else if ( labelList[l].state == HOVERED ) {
ofColor hovered; hovered.setHsb( labelHue, 180, 255 );
ofSetColor( hovered, 180 ); ofSetLineWidth( 3 );
} else if (labelList[l].state == SELECTED) {
ofColor selected; selected.setHsb( labelHue, 240, 255 );
ofSetColor( selected, 200 ); ofSetLineWidth( 3 );
}
float labPos = ofMap( labelList[l].idx, idxMin, idxMax, 0, ofGetWidth() );
ofLine( labPos, 0, labPos, ofGetHeight() ); // We draw labels line & names
ofDrawBitmapString( labelList[l].name, labPos+6, 14 );
ofPopStyle();
}
}
示例9: munchArgs
void
X86CodeGen::munchEXPR(tree::Exp *exp)
{
tree::CALL *call;
if (_M0(CALL_T, call) == exp) {
TempList tsrc;
munchArgs(call->args, &tsrc);
LabelList targets;
targets.push_back(call->func->label);
//eax, ecx, edx will be destoryed in c function
assem::OPER *op = _aOPER("call", "'j0", frame->registers().callerSaves, tsrc);
op->setJumpTargets(targets);
emit(op);
}
}
示例10: QColor
void StarComponent::drawLabels()
{
if( m_hideLabels )
return;
SkyLabeler *labeler = SkyLabeler::Instance();
labeler->setPen( QColor( KStarsData::Instance()->colorScheme()->colorNamed( "SNameColor" ) ) );
int max = int( m_zoomMagLimit * 10.0 );
if ( max < 0 ) max = 0;
if ( max > MAX_LINENUMBER_MAG ) max = MAX_LINENUMBER_MAG;
for ( int i = 0; i <= max; i++ ) {
LabelList* list = m_labelList[ i ];
for ( int j = 0; j < list->size(); j++ ) {
labeler->drawNameLabel( list->at(j).obj, list->at(j).o );
}
list->clear();
}
}
示例11: labelParam
void
BCI2000Viewer::UpdateChannelLabels()
{
if( mFile.IsOpen() )
{
vector<string> signalLabels;
if( mFile.Parameters()->Exists( "ChannelNames" ) )
{
ParamRef labelParam = mFile.Parameter( "ChannelNames" );
for( int k = 0; k < labelParam->NumValues(); ++k )
signalLabels.push_back( labelParam( k ) );
}
for( int i = static_cast<int>( signalLabels.size() ); i < mFile.SignalProperties().Channels(); ++i )
{
ostringstream oss;
oss << i + 1;
signalLabels.push_back( oss.str() );
}
LabelList channelLabels;
int numMarkerChannels = 0;
int j = 1;
while( j < ui->channelList->count()
&& ( ui->channelList->item( j )->flags() & Qt::ItemIsUserCheckable ) )
++j;
int chBase = ++j;
for( ; j < ui->channelList->count()
&& ( ui->channelList->item( j )->flags() & Qt::ItemIsUserCheckable ); ++j )
if( ui->channelList->item( j )->checkState() == Qt::Checked )
channelLabels.push_back(
Label(
static_cast<int>( channelLabels.size() ),
signalLabels[ j - chBase ]
)
);
for( int i = 1; i < ui->channelList->count()
&& ( ui->channelList->item( i )->flags() & Qt::ItemIsUserCheckable ); ++i )
if( ui->channelList->item( i )->checkState() == Qt::Checked )
{
channelLabels.push_back(
Label(
static_cast<int>( channelLabels.size() ),
ui->channelList->item( i )->text().toLocal8Bit().constData()
)
);
++numMarkerChannels;
}
mNumSignalChannels = static_cast<int>( channelLabels.size() ) - numMarkerChannels;
ui->signalDisplay->Display().SetNumMarkerChannels( numMarkerChannels )
.SetChannelLabels( channelLabels )
.SetChannelLabelsVisible( true );
}
else
{
mNumSignalChannels = 0;
ui->signalDisplay->Display().SetNumMarkerChannels( 0 )
.SetChannelLabels( LabelList() );
}
}
示例12: format
void
X86CodeGen::munchCJUMP(tree::CJUMP *cj)
{
tree::CONST *konst;
std::string assem;
TempList tsrc;
const char *cond[] = {"e", "ne",
"l", "g",
"le", "ge"
};
//reverse condition for less or greater
const char *cond_r[] = {"e", "ne",
"ge", "le",
"g", "l"
};
bool reverse = false;
if (_M0(CONST_T, konst) == cj->l) {
assem = format("$%d, 's0", konst->value);
tsrc.push_back(munchExp(cj->r));
reverse = true;
} else if (_M0(CONST_T, konst) == cj->r) {
assem = format("$%d, 's0", konst->value);
tsrc.push_back(munchExp(cj->l));
} else {
assem = "'s1, 's0";
tsrc.push_back(munchExp(cj->l));
tsrc.push_back(munchExp(cj->r));
}
emit(_aOPER("cmpl", assem, TempList(), tsrc));
LabelList targets;
targets.push_back(cj->truelab);
targets.push_back(cj->falselab);
assem = format("j%s", reverse ? cond_r[cj->relop] : cond[cj->relop]);
assem::OPER *op = _aOPER(assem, "'j0", NULL, NULL);
op->setJumpTargets(targets);
emit(op);
}
示例13: blockify
static bool
blockify(Shader &shader, const LabelList &labels)
{
shadir::CodeBlock *activeCodeBlock = nullptr;
auto activeBlockList = &shader.blocks;
auto labelItr = labels.begin();
Label *label = nullptr;
if (labelItr != labels.end()) {
label = labelItr->get();
}
// Iterate over code and find matching labels to generate code blocks
for (auto &ins : shader.code) {
bool insertToCode = true;
while (label && label->first == ins.get()) {
// Most labels will skip current instruction
insertToCode = false;
if (label->type == Label::LoopStart) {
assert(label->linkedLabel);
assert(label->linkedLabel->type == Label::LoopEnd);
// Save the active block list to the LoopEnd label
label->linkedLabel->restoreBlockList = activeBlockList;
// Create a new loop block
auto loopBlock = new shadir::LoopBlock {};
label->linkedBlock = loopBlock;
activeBlockList->emplace_back(loopBlock);
// Set the current block list to the loop inner
activeBlockList = &loopBlock->inner;
activeCodeBlock = nullptr;
} else if (label->type == Label::LoopEnd) {
assert(label->linkedLabel);
assert(label->linkedLabel->type == Label::LoopStart);
assert(label->restoreBlockList);
// Get the matching LoopBlock from the LoopStart label
auto loopBlock = reinterpret_cast<shadir::LoopBlock *>(label->linkedLabel->linkedBlock);
// Restore the previous block list
activeBlockList = label->restoreBlockList;
activeCodeBlock = nullptr;
} else if (label->type == Label::ConditionalStart) {
assert(label->linkedLabel);
assert(label->linkedLabel->type == Label::ConditionalEnd);
// Save the active block list to the ConditionalEnd label
label->linkedLabel->restoreBlockList = activeBlockList;
// Create a new conditional block
auto condBlock = new shadir::ConditionalBlock { ins.get() };
label->linkedBlock = condBlock;
activeBlockList->emplace_back(condBlock);
// Set current block list to the condition inner
activeBlockList = &condBlock->inner;
activeCodeBlock = nullptr;
} else if (label->type == Label::ConditionalElse) {
assert(label->linkedLabel);
assert(label->linkedLabel->type == Label::ConditionalStart);
// Get the matching ConditionalBlock from the ConditionalStart label
auto condBlock = reinterpret_cast<shadir::ConditionalBlock *>(label->linkedLabel->linkedBlock);
// Set current block list to the condition else
activeBlockList = &condBlock->innerElse;
activeCodeBlock = nullptr;
} else if (label->type == Label::ConditionalEnd) {
assert(label->linkedLabel);
assert(label->linkedLabel->type == Label::ConditionalStart);
assert(label->restoreBlockList);
// Get the matching ConditionalBlock from the ConditionalStart label
auto condBlock = reinterpret_cast<shadir::ConditionalBlock *>(label->linkedLabel->linkedBlock);
// Restore the previous block list
activeBlockList = label->restoreBlockList;
activeCodeBlock = nullptr;
// Do not skip the current instruction, add it to a code block
insertToCode = true;
}
// Start comparing to next label!
++labelItr;
if (labelItr != labels.end()) {
label = labelItr->get();
} else {
label = nullptr;
}
}
if (insertToCode) {
assert(activeBlockList);
//.........这里部分代码省略.........
示例14: MessageHandlerProc
LRESULT WINAPI MessageHandlerProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case LM_GETREVID:
{
UINT uLength;
StringCchPrintf((char*)lParam, 64, "%s %s", V_NAME, V_VERSION);
if (SUCCEEDED(StringCchLength((char*)lParam, 64, &uLength)))
return uLength;
lParam = NULL;
return 0;
}
case LM_REFRESH:
{
StringList labelNames = GetRCNameList("Labels");
// refresh the "AllLabels" configuration
delete defaultSettings;
defaultSettings = new LabelSettings();
for(LabelListIterator iter = labelList.begin(); iter != labelList.end(); iter++)
{
if(!(*iter)->getBox())
{
// destroy all labels that no longer exist and that are not in a box
for(StringListIterator it = labelNames.begin(); it != labelNames.end(); it++)
{
if(_stricmp((*it).c_str(), (*iter)->getName().c_str()) == 0)
break;
}
if (it == labelNames.end())
{
labelList.remove(*iter);
delete *iter;
continue;
}
}
// we can reconfigure all other labels, even if they are "boxed"
(*iter)->reconfigure();
}
// create the rest
for(StringListIterator it = labelNames.begin(); it != labelNames.end(); it++)
{
Label *label = lookupLabel(*it);
if (!label)
{
label = new Label(*it);
label->load(hInstance);
labelList.insert(labelList.end(), label);
}
}
return 0;
}
case LM_UPDATEBG:
{
PaintDesktopEx(0, 0, 0, 0, 0, 0, 0, TRUE);
for(LabelListIterator i = labelList.begin(); i != labelList.end(); i++)
{
Label *label = *i;
if(label->getBox() == 0)
label->repaint(true);
}
return 0;
}
case WM_DISPLAYCHANGE:
case WM_SETTINGCHANGE:
{
PostMessage(hWnd, LM_UPDATEBG, 0, 0);
return 0;
}
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
示例15: channelColors
void
AverageDisplay::Initialize( const SignalProperties&, const SignalProperties& )
{
for( size_t i = 0; i < mVisualizations.size(); ++i )
mVisualizations[ i ].Send( CfgID::Visible, false );
mVisualizations.clear();
mChannelIndices.clear();
mPowerSums.clear();
mTargetCodes.clear();
mSignalOfCurrentRun.clear();
#ifdef SET_BASELINE
mBaselines.clear();
mBaselineSamples.clear();
#endif // SET_BASELINE
LabelList markerLabels;
for( int i = 0; i < Parameter( "AvgDisplayMarkers" )->NumRows(); ++i )
{
string markerName = Parameter( "AvgDisplayMarkers" )( i, 0 );
int position =
MeasurementUnits::ReadAsTime( OptionalParameter( markerName, -1 ) )
* Parameter( "SampleBlockSize" );
if( position >= 0 )
markerLabels.push_back( Label( position, markerName ) );
}
int numChannels = Parameter( "AvgDisplayCh" )->NumRows();
mPowerSums.resize( maxPower + 1, vector<vector<vector<float> > >( numChannels ) );
for( int i = 0; i < numChannels; ++i )
{
ostringstream oss;
oss << "AVG" << i;
mVisualizations.push_back( GenericVisualization( oss.str() ) );
GenericVisualization& vis = mVisualizations[ i ];
string windowTitle = Parameter( "AvgDisplayCh" )( i, 1 );
if( windowTitle == "" )
windowTitle = "unknown";
windowTitle += " Average";
vis.Send( CfgID::WindowTitle, windowTitle );
// Note min and max value are interchanged to account for EEG display direction.
vis.Send( CfgID::MinValue, int( Parameter( "AvgDisplayMin" ) ) );
vis.Send( CfgID::MaxValue, int( Parameter( "AvgDisplayMax" ) ) );
vis.Send( CfgID::NumSamples, 0 );
vis.Send( CfgID::GraphType, CfgID::Polyline );
if( !markerLabels.empty() )
vis.Send( CfgID::XAxisMarkers, markerLabels );
ColorList channelColors( sChannelColors );
vis.Send( CfgID::ChannelColors, channelColors );
vis.Send( CfgID::ChannelGroupSize, 0 );
vis.Send( CfgID::ShowBaselines, 1 );
vis.Send( CfgID::Visible, true );
mChannelIndices.push_back( Parameter( "AvgDisplayCh" )( i, 0 ) - 1 );
}
mSignalOfCurrentRun.resize( numChannels );
#ifdef SET_BASELINE
mBaselines.resize( numChannels );
mBaselineSamples.resize( numChannels );
#endif // SET_BASELINE
mLastTargetCode = 0;
}