本文整理汇总了C++中Column::GetProximalDendriteSegment方法的典型用法代码示例。如果您正苦于以下问题:C++ Column::GetProximalDendriteSegment方法的具体用法?C++ Column::GetProximalDendriteSegment怎么用?C++ Column::GetProximalDendriteSegment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Column
的用法示例。
在下文中一共展示了Column::GetProximalDendriteSegment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ToggleProximalConnections
void QtUnit::_ToggleProximalConnections(bool flag)
{
if (sensoryGrid == NULL)
return;
if (toggled == flag)
return;
toggled = flag;
Column *col = (Column *)node;
DendriteSegment *segment = col->GetProximalDendriteSegment();
std::vector<Synapse *> prox_syns = segment->GetSynapses();
//int rfs = col->GetRecFieldSz();
//printf("rfs = %d\n", rfs);
for (unsigned int i=0; i<prox_syns.size(); i++) {
QtUnit *src = (QtUnit *)(proxInputGrid->itemAtPosition(
prox_syns[i]->GetY(), prox_syns[i]->GetX())->widget());
if (flag) {
src->SaveBrushColor();
src->setBrushColor(
src->IsActive() ? HIGHLIGHT_ACTIVE :
HIGHLIGHT_INACTIVE
);
} else
src->RestoreBrushColor();
//printf("\t[%d] (%d, %d)\n",
//i, prox_syns[i]->GetX(), prox_syns[i]->GetY());
}
//((QtSensoryRegion *)(proxInputGrid->parentWidget()))->repaint();
proxInputGrid->parentWidget()->repaint();
}
示例2: _ToggleConnections
void QtUnit::_ToggleConnections(bool flag)
{
if (toggled == flag)
return;
toggled = flag;
Column *col = (Column *)node;
DendriteSegment *segment = col->GetProximalDendriteSegment();
std::vector<Synapse *> prox_syns = segment->GetSynapses();
int rfs = col->GetRecFieldSz();
//for (int i=0; i<rfs; i++)
// prox_syns[i]->ShowSynapse(flag);
}
示例3: mousePressEvent
void QtUnit::mousePressEvent(QMouseEvent *event)
{
if (event->button() != Qt::LeftButton)
return;
if (!this->IsClickable())
return;
QVBoxLayout *objGroupLayout = new QVBoxLayout();
QScrollArea *objScroll = new QScrollArea(objDetail);
objScroll->setStyleSheet("background-color: rgb(25, 25, 25);");
objScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
objScroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
QWidget *scrollChild = new QWidget();
QGridLayout *objGrid = new QGridLayout(scrollChild);
objGrid->setSizeConstraint(QLayout::SetMinAndMaxSize);
QLayout *currentLayout = NULL;
QLayoutItem *child = NULL;
if (objDetail) {
if ((currentLayout = objDetail->layout())) {
while ((child = currentLayout->takeAt(0)) != 0)
delete child->widget();
delete currentLayout;
}
}
objGroupLayout->addWidget(objScroll);
QLabel *overlapLab = new QLabel("overlap: ");
QLabel *overlapVal = new QLabel(QString::number(((Column *)node)->GetOverlap()));
objGrid->addWidget(overlapLab, 0, 0);
objGrid->addWidget(overlapVal, 0, 1);
QLabel *synapsesLab = new QLabel("synaptic details");
objGrid->addWidget(synapsesLab, 1, 0, 1, 3);
QLabel *idx = new QLabel("Idx");
QLabel *coord = new QLabel("Coord");
QLabel *firing = new QLabel("Firing");
QLabel *perm = new QLabel("Perm");
objGrid->addWidget(idx, 2, 0);
objGrid->addWidget(coord, 2, 1);
objGrid->addWidget(firing, 2, 2);
objGrid->addWidget(perm, 2, 3);
Column *col = (Column *)node;
DendriteSegment *segment = col->GetProximalDendriteSegment();
std::vector<Synapse *> syns = segment->GetSynapses();
for (int i=0; i<col->GetRecFieldSz(); i++) {
char synCoordStr[32];
memset(synCoordStr, 0, sizeof(synCoordStr));
unsigned int x = syns[i]->GetX(), y = syns[i]->GetY();
snprintf(synCoordStr, sizeof(synCoordStr), "(%d, %d)", x, y);
float p = syns[i]->GetPerm();
QLabel *synIdx = new QLabel(QString("%1: ").arg(i));
QLabel *synCoordLab = new QLabel(synCoordStr);
QLabel *synFiring = new QLabel(QString("%1").arg(syns[i]->IsFiring()? 1 : 0));
QLabel *synPerm = new QLabel(QString("%1: ").arg(p));
objGrid->addWidget(synIdx, 3+i, 0, 1, 1);
objGrid->addWidget(synCoordLab, 3+i, 1, 1, 1);
objGrid->addWidget(synFiring, 3+i, 2, 1, 1);
objGrid->addWidget(synPerm, 3+i, 3, 1, 1);
}
// Note: must add the layout of widget before calling setWidget() or won't
// be visible.
objScroll->setWidget(scrollChild);
objDetail->setLayout(objGroupLayout);
}