Exemplo n.º 1
0
	bool
CParticleAttachCommand::basic_Enable (
	CLxUser_Message		&msg)
{
	CLxUser_Item		 item;
	CSourceItems		 sel(dyna_Int(0));

	return sel.GetFirst (item);
}
Exemplo n.º 2
0
void VCButtonProperties::slotAttachFunction()
{
    FunctionSelection sel(this, false);
    if (sel.exec() == QDialog::Accepted)
    {
        /* Get the first selected function */
        slotSetFunction(sel.selection().at(0));
    }
}
Exemplo n.º 3
0
 static inline A0_n acos(const A0_n a0_n)
 {
   const A0 a0 = { a0_n };
   const A0 as =  { asin(  sqrt(Half<A0>() - Half<A0>()*a0) )}; 
   A0 z1 = Two<A0>() * as;
   const A0 as1 = {asin(a0)}; 
   A0 z2 = ((Pio_4<A0>() - as1)+double_constant<A0, 0x3c91a62633145c07ll>())+ Pio_4<A0>();
   return if_nan_else( gt(abs(a0),One<A0>()), sel( gt(a0,Half<A0>()), z1, z2));
 }
Exemplo n.º 4
0
	static inline A0 finalize(const A0& a0, const A0& x,
				  const A0& c, const A0 & k,
				  const A0& ,const A0& )
	{
	  A0 y = oneminus(((-(x*c)/(Two<A0>()-c))-x));
	  y = fast_ldexp(y, toint(k));
	  // adjust for 2^n n flint
	  return  sel(b_and(is_gtz(a0), is_flint(a0)),  round2even(y), y);
	}
Exemplo n.º 5
0
void QmitkFunctionalitySelectionProvider::FireNodesSelected(const std::vector<mitk::DataNode::Pointer>& nodes )
{
    mitk::DataNodeSelection::Pointer sel(new mitk::DataNodeSelection(nodes));
    m_CurrentSelection = sel;
    berry::SelectionChangedEvent::Pointer event(new berry::SelectionChangedEvent(berry::ISelectionProvider::Pointer(this)
            , m_CurrentSelection));
    m_SelectionEvents.selectionChanged(event);

}
Exemplo n.º 6
0
void VCButtonProperties::slotAttachFunction()
{
    FunctionSelection sel(this, m_doc, m_outputMap, m_inputMap, m_masterTimer, false);
    if (sel.exec() == QDialog::Accepted)
    {
        /* Get the first selected function */
        slotSetFunction(sel.selection().at(0));
    }
}
Exemplo n.º 7
0
//------------------------------------------------------------------------------
bool PropagationStateManager::BuildState()
{
   #ifdef DEBUG_STATE_CONSTRUCTION
      MessageInterface::ShowMessage("Entered BuildState()\n");

      MessageInterface::ShowMessage("StateMap:\n");
      for (Integer index = 0; index < stateSize; ++index)
      {
         MessageInterface::ShowMessage("   %s.%s",
               stateMap[index]->objectName.c_str(),
               stateMap[index]->elementName.c_str());
      }
   #endif
   
   // Determine the size of the propagation state vector
   stateSize = SortVector();
   
   std::map<std::string,Integer> associateMap;
   // Build the associate map
   std::string name;
   for (Integer index = 0; index < stateSize; ++index)
   {
      name = stateMap[index]->objectName;
      if (associateMap.find(name) == associateMap.end())
         associateMap[name] = index;
   }   
   
   state.SetSize(stateSize);
   for (Integer index = 0; index < stateSize; ++index)
   {
      name = stateMap[index]->objectName;
      std::stringstream sel("");
      sel << stateMap[index]->subelement;
      state.SetElementProperties(index, stateMap[index]->elementID, 
            name + "." + stateMap[index]->elementName + "." + sel.str(), 
            associateMap[stateMap[index]->associateName]);
   }
   
   #ifdef DEBUG_STATE_CONSTRUCTION
      MessageInterface::ShowMessage(
            "Propagation state vector has %d elements:\n", stateSize);
      StringArray props = state.GetElementDescriptions();
      for (Integer index = 0; index < stateSize; ++index)
         MessageInterface::ShowMessage("   %d:  %s  --> associate: %d\n", index,
               props[index].c_str(), state.GetAssociateIndex(index));
   #endif
   
   #ifdef DUMP_STATE
      MapObjectsToVector();
      for (Integer i = 0; i < stateSize; ++i)
         MessageInterface::ShowMessage("State[%02d] = %.12lf, %s %d\n", i, state[i], 
               "RefState start =", state.GetAssociateIndex(i));
   #endif   
      
   return true;
}
Exemplo n.º 8
0
void test6(int c) {
	Chan **ca = mkchan(c, 12);

	changeNproc(4);
	go(  mySend(ca[4]) );
	go(  mySend(ca[5]) );
	go(  mySend(ca[6]) );
	go(  mySend(ca[7]) );

	changeNproc(4);
	go(  myRecv(ca[8]) );
	go(  myRecv(ca[9]) );
	go(  myRecv(ca[10]) );
	go(  myRecv(ca[11]) );

	changeNproc(2);
	go(  sel(ca[4], ca[5], ca[6], ca[7], ca[0], ca[1], ca[2], ca[3]) );
	go(  sel(ca[0], ca[1], ca[2], ca[3], ca[8], ca[9], ca[10], ca[11]) );
}
Exemplo n.º 9
0
void RCTransform::intersect(const Eks::Frustum& frus, Selector *s)
  {
  const Eks::Transform &tr = transform();

  Eks::Frustum frusCpy(frus);
  frusCpy.transform(tr.inverse());

  InternalSelector sel(tr, s);
  RCRenderArray::intersect(frusCpy, &sel);
  }
Exemplo n.º 10
0
void WpaGui::disableListedNetwork(bool disabled)
{
	if (networkList->currentRow() < 0 || !disabled)
		return;

	QString sel(networkList->currentItem()->text());

	if (getNetworkDisabled(sel) == 0)
		disableNetwork(sel);
}
Exemplo n.º 11
0
void Ozette::find_in_file(std::string path, Editor::line_t index) {
	// For now we just jump to the specified line. Someday we will get a search
	// regex, so we can put the editor into find mode.
	auto edrec = open_editor(path);
	if (edrec.view) {
		Editor::location_t line(index, 0);
		Editor::Range sel(line, line);
		edrec.view->select(*edrec.window, sel);
	}
}
Exemplo n.º 12
0
void GSDeviceOGL::CreateTextureFX()
{
    GL_PUSH("CreateTextureFX");

    m_vs_cb = new GSUniformBufferOGL(g_vs_cb_index, sizeof(VSConstantBuffer));
    m_ps_cb = new GSUniformBufferOGL(g_ps_cb_index, sizeof(PSConstantBuffer));

    // warning 1 sampler by image unit. So you cannot reuse m_ps_ss...
    m_palette_ss = CreateSampler(false, false, false);
    gl_BindSampler(1, m_palette_ss);

    // Pre compile all Geometry & Vertex Shader
    // It might cost a seconds at startup but it would reduce benchmark pollution
    for (uint32 key = 0; key < countof(m_gs); key++) {
        GSSelector sel(key);
        if (sel.point == sel.sprite)
            m_gs[key] = 0;
        else
            m_gs[key] = CompileGS(GSSelector(key));
    }

    for (uint32 key = 0; key < countof(m_vs); key++) {
        // wildhack is only useful if both TME and FST are enabled.
        VSSelector sel(key);
        if (sel.wildhack && (!sel.tme || !sel.fst))
            m_vs[key] = 0;
        else
            m_vs[key] = CompileVS(sel, !GLLoader::found_GL_ARB_clip_control);
    }

    // Enable all bits for stencil operations. Technically 1 bit is
    // enough but buffer is polluted with noise. Clear will be limited
    // to the mask.
    glStencilMask(0xFF);
    for (uint32 key = 0; key < countof(m_om_dss); key++) {
        m_om_dss[key] = CreateDepthStencil(OMDepthStencilSelector(key));
    }

    // Help to debug FS in apitrace
    m_apitrace = CompilePS(PSSelector());

    GL_POP();
}
Exemplo n.º 13
0
void RCTransform::intersect(const Eks::Line& line, Selector *s)
  {
  const Eks::Transform &tr = transform();

  Eks::Line lineCpy(line);
  lineCpy.transform(tr.inverse());

  InternalSelector sel(tr, s);
  RCRenderArray::intersect(lineCpy, &sel);
  }
// ---------------------------------------------------------------------------
//
// ------------
bool bXMapCloneDetector::detect(clonedetector_prm* prm){
bArray				sel(*(_gapp->selMgr()->elements()));
bArray*				arr;
char				msg[__MESSAGE_STRING_LENGTH_MAX__];
    message_string(kMsgProgress,msg,1);
bProgressWait wt("",msg,true,true,sel.count());
    _gapp->cntMgr()->flush();
    
bGenericGeoElement	*oa,*ob;
bGenericType*		tp;
ivx_rect			vxr;
int					i,j;
bool				flg=false;
    
    for(i=1;i<=sel.count();i++){
        if(!wt.set_progress(i)){
            break;
        }
        sel.get(i,&oa);
        if(oa->contrasted()){
            continue;
        }
        tp=_gapp->typesMgr()->get(oa->getType());
        oa->getBounds(&vxr);
        tp->iterator()->objs_in_rect(&arr,&vxr);
        if(!arr){
            continue;
        }
        for(j=1;j<=arr->count();j++){
            arr->get(j,&ob);
            if(oa==ob){
                continue;
            }
            if(ob->contrasted()){
                continue;
            }
            if(obj_comp(oa,ob,prm)){
                flg=true;
                if(ob->masked()){
                    ob->setmasked(false,true);
                }
                ob->setcontrast(true,true);
            }
        }
        delete arr;
    }
    if(flg){
        b_message_string(kXMapCloneFoundMessageID,msg,getbundle(),0);
    }
    else{
        b_message_string(kXMapNoCloneFoundMessageID,msg,getbundle(),0);
    }
bAlertStop	alrt(msg,"");
    return(true);
}
Exemplo n.º 15
0
//------------------------------------------------------------------------------
bool EstimationStateManager::MapVectorToObjects()
{
   #ifdef DEBUG_OBJECT_UPDATES
      MessageInterface::ShowMessage("Mapping vector to objects\n"
            "   Epoch = %.12lf\n", state.GetEpoch());
   #endif

   for (Integer index = 0; index < stateSize; ++index)
   {
      #ifdef DEBUG_OBJECT_UPDATES
         std::stringstream msg("");
         msg << stateMap[index]->subelement;
         std::string lbl = stateMap[index]->objectName + "." +
            stateMap[index]->elementName + "." + msg.str() + " = ";
         MessageInterface::ShowMessage("   %d: %s%.12lf\n", index, lbl.c_str(),
               state[index]);
      #endif

      switch (stateMap[index]->parameterType)
      {
         case Gmat::REAL_TYPE:
            (stateMap[index]->object)->SetRealParameter(
                   stateMap[index]->parameterID, state[index]);
            break;

         case Gmat::RVECTOR_TYPE:
            stateMap[index]->object->SetRealParameter(
                     stateMap[index]->parameterID, state[index],
                     stateMap[index]->rowIndex);
            break;

         case Gmat::RMATRIX_TYPE:
            stateMap[index]->object->SetRealParameter(
                     stateMap[index]->parameterID, state[index],
                     stateMap[index]->rowIndex, stateMap[index]->colIndex);
            break;

         default:
            std::stringstream sel("");
            sel << stateMap[index]->subelement;
            std::string label = stateMap[index]->objectName + "." +
                  stateMap[index]->elementName + "." + sel.str();
            MessageInterface::ShowMessage(
                  "%s not set; Element type not handled\n",label.c_str());
      }
   }


   GmatEpoch theEpoch = state.GetEpoch();
   for (UnsignedInt i = 0; i < objects.size(); ++i)
      if (epochIDs[i] >= 0)
         objects[i]->SetRealParameter(epochIDs[i], theEpoch);

   return true;
}
// ---------------------------------------------------------------------------
// 
// ------------
void bXMapAgregateIntoLine::make(bGenericType* tp){
_bTrace_("bXMapAgregateIntoLine::make",true);
ivertices			*vxs,*vsb,*poly=NULL;
bGenericGeoElement*	o;
bArray				sel(*(_gapp->selMgr()->elements()));
double				da,db;

	for(int i=1;i<=sel.count();i++){
		sel.get(i,&o);
		o->getVertices(&vxs);
		if(ivs2ivs(vxs,&vsb)==noErr){
			if(poly&&poly->nv>0){
				da=ivx2_dist(&(poly->vx.vx2[poly->nv-1]),&vsb->vx.vx2[0]);
				db=ivx2_dist(&(poly->vx.vx2[poly->nv-1]),&vsb->vx.vx2[vsb->nv-1]);
				if(db<da){
					ivs_reverse(vsb);
				}
			}
			if(poly==NULL){
				poly=vsb;
			}
			else{
_tm_(i+" before "+poly->nv);
				poly=ivs_concat(poly,vsb);
				ivs_free(vsb);
			}
_tm_(i+" after "+poly->nv);
		}
		else{
_te_("ivs2ivs");
		}
	}
    if(!poly){
        return;    
    }
	if(poly->nv<2){
		ivs_free(poly);
		return;
	}
	if(!tp->new_object(&o)){
		ivs_free(poly);
		return;
	}
	if(!InitWithStyle(_gapp,_gapp->layersAccessCtx()->get_current(),o)){
		NSBeep();
	}
	if(!o->setVertices(poly)){
		tp->kill_object(o);
		ivs_free(poly);
		return;
	}

	ivs_free(poly);
}
Exemplo n.º 17
0
void WpaGui::removeListedNetwork()
{
	if (networkList->currentRow() < 0) {
		QMessageBox::information(this, tr("Select A Network"),
					 tr("Select a network from the list "
					    "to remove it.\n"));
		return;
	}
	QString sel(networkList->currentItem()->text());
	removeNetwork(sel);
}
Exemplo n.º 18
0
void Outline::selectRoots()
//-------------------------
{
    OutlineRootSelect sel( this, _sentinel );

    if( sel.process() ) {
        scrollToSelected();
        resetCache();
        reset();
    }
}
Exemplo n.º 19
0
void CSDirection::doDir() {
  if (m_lX > 0 && m_lY > 0 && m_dir) {
    std::unique_ptr<UCHAR[]> sel(new UCHAR[m_lX * m_lY]);
    if (!sel) throw SMemAllocError("in directionMap");
    size_t length = (size_t)(m_lX * m_lY * sizeof(UCHAR));
    memcpy(sel.get(), m_dir.get(), length);
    makeDir(sel.get());
    memcpy(sel.get(), m_dir.get(), length);
    equalizeDir(sel.get(), 3);
  }
}
double
SpreadsheetTable::selectedCellsAverage() const
{
    double avg = 0., sum = 0.;
    int ncells = 0;
    QModelIndexList sel(selectedIndexes());
    for(QModelIndexList::iterator it = sel.begin(); it != sel.end(); ++it, ++ncells)
        sum += model()->data(*it, GetDataRole).toDouble();
    avg = (ncells > 0) ? (sum / double(ncells)) : sum;
    return avg;
}
Exemplo n.º 21
0
void WpaGui::removeSelectedNetwork()
{
	if (networkSelect->count() < 1) {
		QMessageBox::information(this, tr("No Networks"),
			                 tr("There are no networks to remove."
					    "\n"));
		return;
	}
	QString sel(networkSelect->currentText());
	removeNetwork(sel);
}
double
SpreadsheetTable::selectedCellsSum() const
{
    double sum = 0.;

    QModelIndexList sel(selectedIndexes());
    for(QModelIndexList::iterator it = sel.begin(); it != sel.end(); ++it)
        sum += model()->data(*it, GetDataRole).toDouble();

    return sum;
}
Exemplo n.º 23
0
void CSDirection::blurRadius(const int dBlur) {
  if (m_lX > 0 && m_lY > 0 && m_dir) {
    std::unique_ptr<UCHAR[]> sel(new UCHAR[m_lX * m_lY]);
    if (!sel) throw SMemAllocError("in directionMap");
    memcpy(sel.get(), m_dir.get(), m_lX * m_lY * sizeof(UCHAR));
    UCHAR *pSel = sel.get();
    UCHAR *pDir = m_dir.get();
    for (int y = 0; y < m_lY; y++)
      for (int x                    = 0; x < m_lX; x++, pSel++, pDir++)
        if (*pSel > (UCHAR)0) *pDir = blurRadius(sel.get(), x, y, dBlur);
  }
}
mitk::DataNodeSelection::ConstPointer
QmitkDataNodeSelectionProvider::GetDataNodeSelection() const
{
  if (qSelectionModel)
  {
    QmitkDataNodeSelection::ConstPointer sel(new QmitkDataNodeSelection(
        qSelectionModel->selection()));
    return sel;
  }

  return QmitkDataNodeSelection::ConstPointer(new QmitkDataNodeSelection());
}
Exemplo n.º 25
0
Arquivo: tss.cpp Projeto: eladraz/XDK
TaskStateSegment32* TaskStateSegment::getTSS32(uint16 selector)
{
    Selector sel(selector);
    CHECK(sel.isGDTselector());
    GDTR gdt;
    SegmentDescriptor tss(gdt, sel);
    CHECK(tss.isSystem());
    CHECK((tss.getSystemSegmentType() == SegmentDescriptor::SEGMENT_TSS32_FREE) ||
          (tss.getSystemSegmentType() == SegmentDescriptor::SEGMENT_TSS32_BUSY));
    CHECK(tss.getSegmentLimit() >= sizeof(TaskStateSegment32));
    return (TaskStateSegment32*)getPtr(tss.getOffset());
}
Exemplo n.º 26
0
// For the layout engine.
BOOL ClsFlatButton::OnGetMinSize( ClsSize& szMinSize )
{
	// Add room for the frame.
	szMinSize.CX() += ::GetSystemMetrics( SM_CXFRAME ) * 3;

	// For vista and up we use different numbers.
	if ( ClsGetApp()->GetMajorVersion() >= 6 )
	{
		szMinSize.CY() += ::GetSystemMetrics( SM_CYFRAME ) * 1 + 4;
	}
	else
	{
		szMinSize.CY() += ::GetSystemMetrics( SM_CYFRAME ) * 3;
	}

	// Images?
	int cxi = 0, cyi = 0;
	if ( m_hImages && ImageList_GetImageCount( m_hImages ))
	{
		// Get the image size.
		ImageList_GetIconSize( m_hImages, &cxi, &cyi );

		// Make room.
		cxi += 4;

		// Add sizes.
		szMinSize.CX() += cxi;
		szMinSize.CY() += cyi;
	}

	// Do we have a caption?
	ClsString str( GetSafeHWND());
	if ( str.GetStringLength())
	{
		// Setup the DC.
		ClsGetDC dc( this );
		ClsFont font;
		GetFont( font );
		ClsSelector sel( &dc, font );

		// Measure the caption.
		ClsRect rc;
		dc.DrawText( str, rc, DT_CALCRECT );

		// Add the width of the caption.
		szMinSize.CX() += rc.Width() + 4;

		// Adjust the height if necessary.
		if ( rc.Height() > cyi )
			szMinSize.CY() += rc.Height() - cyi;
	}
	return TRUE;
}
Exemplo n.º 27
0
UserRectSel::PanelStrut UserRectSel::select(const RectList& rects, const QPoint& offset, const QColor& color)
{
    UserRectSel sel(rects, offset, color);
    sel.show();
    sel.grabMouse();
    sel.paintCurrent();
    qApp->enter_loop();
    sel.paintCurrent();
    sel.releaseMouse();
    qApp->syncX();
    return sel.current;
}
Exemplo n.º 28
0
/* clears the list
   i don't delete filters here because they have to be deleted
   from the procedure creating them. so this call simply discards
   the pointers stored into the linked list. OBJECTS ARE NOT FREED */
void Linklist::clear() {
#ifdef THREADSAFE
  lock();
#endif
  sel(0);
  length = 0;
  first = NULL;
  last = NULL;
#ifdef THREADSAFE
  unlock();
#endif
}
Exemplo n.º 29
0
void GenerateDlg::SetPlayRange()
{
	wxColor sel(200,200,255);
	wxColor uns(240,240,255);
	wxBitmapButton *tbtn;
	tbtn = (wxBitmapButton*)FindWindow("IDC_PLAY_ALL");
	tbtn->SetBackgroundColour(playSome ? uns : sel);
	tbtn->Enable(playSome);
	tbtn = (wxBitmapButton*)FindWindow("IDC_PLAY_SOME");
	tbtn->Enable(!playSome);
	tbtn->SetBackgroundColour(playSome ? sel : uns);
}
Exemplo n.º 30
0
void GenerateDlg::SetPlayOutput()
{
	wxColor sel(200,200,255);
	wxColor uns(240,240,255);
	wxBitmapButton *tbtn;
	tbtn = (wxBitmapButton*)FindWindow("IDC_DISK");
	tbtn->SetBackgroundColour(playLive ? uns : sel);
	tbtn->Enable(playLive);
	tbtn = (wxBitmapButton*)FindWindow("IDC_PLAY_LIVE");
	tbtn->SetBackgroundColour(playLive ? sel : uns);
	tbtn->Enable(!playLive);
}