示例#1
0
    // Default constructor
 ComputePC::ComputePC()
    : DEN(0.646944444)
 {
    type1 = TypeID::P1;
    type2 = TypeID::P2;
    resultType = TypeID::PC;
    setIndex();
 }
示例#2
0
Flyer::Flyer( CATEGORY cat, Vec2 lc, float h, TileDeck *dk, int ind, int client_id, int internal_id ) : Char(cat,lc,dk, g_flyer_layer, client_id, internal_id ), h(h), v_h(0), gravity(0) {
    setIndex(ind);
    shadow_prop = createShadow(lc);
    addChild(shadow_prop);

    last_loc = loc;
        
}
示例#3
0
 /** Common constructor taking a gnssRinex as reference station data.
  *
  * By default it will delete satellites present in reference station
  * data but missing in input data.
  *
  * @param gData      gnssRinex data object holding reference
  *                   station data.
  * @param difftype   TypeID of data values to be differenced.
  * @param delSats    Boolean value setting if satellites present in
  *                   reference station data but missing in input data
  *                   will be deleted from the later (this is the
  *                   default behaviour).
  */
 DeltaOp( const gnssRinex& gData,
          const TypeID& difftype,
          const bool& delSats = true )
     : refData(gData.body), deleteMissingSats(delSats)
 {
     diffTypes.insert(difftype);
     setIndex();
 };
int construct_candidates(solution_vector partial_solution, float partial_soln_score,
						 queue* private_queue, void* domain_specific_data) {

	color_assignment* partial = (color_assignment*) partial_solution;
	graph_color_data* data = (graph_color_data*) domain_specific_data;

	if (partial->curr_length == data->max_colors)
		return 1;

	list_node* l;
	color_assignment* extension;

	l = data->g->adjacency_list[partial->curr_length];
	bitvector* clashing_colors = create_bitvector(data->max_colors);

	while (l != NULL) {
		if (l->to < partial->curr_length) {
			setIndex(clashing_colors, partial->vertex_colors[l->to]);
		}
		l = l->next;
	}
	bitvector* used_colors = create_bitvector(data->max_colors);
	for (int i = 0; i < partial->curr_length; i++) {
		setIndex(used_colors, partial->vertex_colors[i]);
	}

	for (int i = 0; i < data->max_colors; i++) {
		if (!getIndex(clashing_colors, i)) {
			extension = create_soln_copy(partial);
			extension->vertex_colors[extension->curr_length] = i;
			extension->curr_length++;
			if (getIndex(used_colors, i)) {
				pq_insert_nc(private_queue, partial_soln_score, extension);
			} else {
				pq_insert_nc(private_queue, partial_soln_score + 1, extension);
			}
		}
	}

	destroy_bitvector(clashing_colors);
	destroy_bitvector(used_colors);
	free(partial->vertex_colors);
	free(partial);

	return 0;
}
示例#5
0
 /** Common constructor taking a satTypeValueMap as reference
  *  station data.
  *
  * By default it will delete satellites present in reference station
  * data but missing in input data.
  *
  * @param gData      satTypeValueMap data object holding reference
  *                   station data.
  * @param difftype   TypeID of data values to be differenced.
  * @param delSats    Boolean value setting if satellites present in
  *                   reference station data but missing in input data
  *                   will be deleted from the later (this is the
  *                   default behaviour).
  */
 DeltaOp( const satTypeValueMap& gData,
          const TypeID& difftype,
          const bool& delSats = true )
     : refData(gData), deleteMissingSats(delSats)
 {
     diffTypes.insert(difftype);
     setIndex();
 };
示例#6
0
void KUndo2QStack::setClean()
{
    if (!m_macro_stack.isEmpty()) {
        qWarning("KUndo2QStack::setClean(): cannot set clean in the middle of a macro");
        return;
    }

    setIndex(m_index, true);
}
示例#7
0
void
MainWindow::setDefaultIndex(int index) 
{
	if (index == 0)
	{
		setEnableButtons(pushButton[0]);
		setIndex(0);
	}
}
    // Default constructor
 ComputeMelbourneWubbena::ComputeMelbourneWubbena()
    : type3(TypeID::L1), type4(TypeID::L2), DEN1(L1_FREQ + L2_FREQ),
      DEN2(L1_FREQ - L2_FREQ)
 {
    type1 = TypeID::P1;
    type2 = TypeID::P2;
    resultType = TypeID::MWubbena;
    setIndex();
 }
示例#9
0
文件: List.hpp 项目: psde/GosuEx
			void addElement(const TKey& key, TElement* element) {
				pimpl.elements.insert(std::pair<TKey, TElement*>(key, element));
				element->setParent(this);
				element->setX(dispX()+dispWidth()/2);
				element->setRelX(0.5);
				element->setWidth(dispWidth());
				element->hide();
				setIndex(index());
			}
示例#10
0
void Debri::init( int ind ) {
    tex_epsilon = DEFAULT_TEX_EPS;
    setIndex(ind);
    if( index < 13*16 ) setScl(PPC*0.6); else setScl(PPC);
    falling_to_pit = false;
    if( ind == B_ATLAS_ITEM_DARK_MATTER_PARTICLE ) {
        setFragmentShader( g_eye_col_replacer );
    }
}
示例#11
0
void CMainWindow::onSlider (xl::uint id, int _min, int _max, int _curr, bool tracking, xl::ui::CControlPtr ctrl) {
    XL_PARAMETER_NOT_USED(id);
    XL_PARAMETER_NOT_USED(_min);
    XL_PARAMETER_NOT_USED(_max);
    XL_PARAMETER_NOT_USED(tracking);
    assert(id == m_slider->getID());

    setIndex(_curr);
}
示例#12
0
void CMainWindow::cmdPrev () {
    int new_index = m_currIndex;
    if (new_index == 0) {
        new_index = m_cachedImages.size() - 1;
    } else {
        new_index --;
    }
    setIndex(new_index);
}
示例#13
0
void Beam::updateIndex() {
    switch(type) {
    case BEAMTYPE_NORMAL:
        break;
    case BEAMTYPE_BLASTER:
        setIndex( B_ATLAS_BLASTER_FRAGMENT_BASE + ((int)(accum_time*20)%2) );
        break;
    }
}
示例#14
0
TabSwitchWidget::~TabSwitchWidget()
{
    if(!m_buttons.empty())
    {
        int idx = m_buttons[m_active]->property("tabIndex").toInt();
        emit setIndex(idx);
    }
    delete ui;
}
示例#15
0
//private
void MenuHighScoreState::buildMenu(const sf::Font& font)
{
    const float centreX = xy::DefaultSceneSize.x / 2.f;

    const auto& scores = getContext().appInstance.getScores();
    auto list = xy::UI::create<xy::UI::ScoreList>(font);
    list->setAlignment(xy::UI::Alignment::Centre);
    list->setPosition(centreX, 590.f);
    list->setList(scores);
    list->setIndex(getContext().appInstance.getLastScoreIndex());
    m_uiContainer.addControl(list);

    auto upScroll = xy::UI::create<xy::UI::Button>(font, m_textureResource.get("assets/images/ui/scroll_arrow_vertical.png"));
    upScroll->setAlignment(xy::UI::Alignment::Centre);
    upScroll->setPosition(1310, 470.f);
    upScroll->addCallback([list]()
    {
        list->scroll(list->getVerticalSpacing());
    });
    m_uiContainer.addControl(upScroll);

    auto downScroll = xy::UI::create<xy::UI::Button>(font, m_textureResource.get("assets/images/ui/scroll_arrow_vertical.png"));
    downScroll->setAlignment(xy::UI::Alignment::Centre);
    downScroll->setRotation(180.f);
    downScroll->setPosition(1310.f, 720.f);
    downScroll->addCallback([list]()
    {
        list->scroll(-list->getVerticalSpacing());
    });
    m_uiContainer.addControl(downScroll);
    
    auto button = xy::UI::create<xy::UI::Button>(font, m_textureResource.get("assets/images/ui/start_button.png"));
    button->setString("OK");
    button->setAlignment(xy::UI::Alignment::Centre);
    button->setPosition(centreX, 875.f);
    button->addCallback([this]()
    {
        auto msg = m_messageBus.post<xy::Message::UIEvent>(xy::Message::UIMessage);
        msg->type = xy::Message::UIEvent::MenuClosed;
        msg->value = 0.f;
        msg->stateID = (m_endGame) ? States::ID::HighScoresEnd : States::ID::HighScoresMenu;

        if (m_endGame)
        {
            requestStackClear();
            requestStackPush(States::ID::MenuBackground);
        }
        else
        {
            requestStackPop();
            requestStackPush(States::ID::MenuMain);
        }
        
    });
    m_uiContainer.addControl(button);
}
示例#16
0
void	ConnectedTri::read_0000	( Iff & iff )
{
	IndexedTri::read_0000(iff);

	setIndex( iff.read_int32() );

	setNeighborIndex( 0, iff.read_int32() );
	setNeighborIndex( 1, iff.read_int32() );
	setNeighborIndex( 2, iff.read_int32() );
}
void ChoicePropertyComponent::changeIndex()
{
    if (isCustomClass)
    {
        auto newIndex = comboBox.getSelectedId() - 1;

        if (newIndex != getIndex())
            setIndex (newIndex);
    }
}
示例#18
0
void AJArrayArray::put(ExecState* exec, const Identifier& propertyName, AJValue value, PutPropertySlot& slot)
{
    bool ok;
    unsigned index = propertyName.toUInt32(&ok, false);
    if (ok) {
        setIndex(exec, index, value);
        return;
    }
    AJObject::put(exec, propertyName, value, slot);
}
void RectMod_AnimatedSprite::doRenderTick(Delta * delta, ModRectangle * rectangle) {
	currentFrame += static_cast<float>(delta->seconds) * speed;
	if (currentFrame >= renderedFrame + 1) {
		if (renderedFrame == end) {
			renderedFrame = start;
			currentFrame = static_cast<float>(start);
		}
		setIndex(rectangle, renderedFrame);
	}
}
示例#20
0
void JSByteArray::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
    bool ok;
    unsigned index = propertyName.toUInt32(ok);
    if (ok) {
        setIndex(exec, index, value);
        return;
    }
    JSObject::put(exec, propertyName, value, slot);
}
void ChoicePropertyComponent::comboBoxChanged (ComboBox*)
{
    if (isCustomClass)
    {
        const int newIndex = comboBox.getSelectedId() - 1;

        if (newIndex != getIndex())
            setIndex (newIndex);
    }
}
示例#22
0
void
MainWindow::setDefaultIndex(int index) 
{
	if (index == 0)
	{
		setEnableButtons(pushButton[0]);
		setIndex(0);
		//stackedWidget->setCurrentIndex(0);
	}
	else if (index == 1)
	{
		setEnableButtons(pushButton[3]);
		setIndex(DISPLAYTYPE3);
		//setIndex(1);
		//stackedWidget->setCurrentIndex(1);
	}
	else if (index == 2)
	{
		
#if 0
		setEnableButtons(pushButton[14]);
		setIndex(14);
#endif
		//stackedWidget->setCurrentIndex(14);
#if 0
		QString passwd = passWord.at(15);
		Password pword(passwd, new QWidget());
		if(passwd.compare("") != 0)
		{
			//qDebug("Password: %s", passwd.toStdString().c_str());
			if(pword.getStatus()== true)
			{
				setEnableButtons(pushButton[15]);
				setIndex(15);
			}
			else {
				qDebug("Password is not match.");
			}
		}
#endif
	}

}
示例#23
0
SlotPreview::SlotPreview(int index,qreal Scale, QWidget *parent):QLabel(parent)
{
	scale=Scale;
    Final = new QVBoxLayout();
	Final->setContentsMargins(2,2,2,2);
	setIndex(index);
	setLayout(Final);
	setFixedSize(582*scale,135*scale);
	setStyleSheet(QString("SlotPreview{border:%1px solid;}").arg(QString::number(3*scale)));
	setCursor(Qt::PointingHandCursor);
}
示例#24
0
    /* Common constructor
     *
     * @param mLambdas      Maximum deviation allowed before declaring
     *                      cycle slip (in number of Melbourne-Wubbena
     *                      wavelenghts).
     * @param dtMax         Maximum interval of time allowed between two
     *                      successive epochs, in seconds.
     */
 MWCSDetector::MWCSDetector( const double& mLambdas,
                             const double& dtMax,
                             const bool& use )
    : obsType(TypeID::MWubbena), lliType1(TypeID::LLI1),
      lliType2(TypeID::LLI2), resultType1(TypeID::CSL1),
      resultType2(TypeID::CSL2), useLLI(use)
 {
    setDeltaTMax(dtMax);
    setMaxNumLambdas(mLambdas);
    setIndex();
 }
示例#25
0
/* ===========================================================================
	PDF Object Initialization sets the base PDF Object char address to 0, 
	the revision number to 0, the object index to 0 and the parent 
	PDF_Object pointer to NULL
	
	@param	none	desc
	@return	int	0 = no error, -1 = error
	==========================================================================*/
int PDF_Object::init() {

	// init
	setAddress(0);
	setRevision(0);
	setIndex(0);
	setParent(NULL);
	setRenderContent("");
	//scale.setUnits(pt);
	return 0;
}
示例#26
0
      // Explicit constructor, taking as input a Position object
      // containing reference station coordinates.
   BasicModel::BasicModel(const Position& RxCoordinates)
   {

      minElev = 10.0;
      pDefaultEphemeris = NULL;
      defaultObservable = TypeID::C1;
      useTGD = false;
      setInitialRxPosition(RxCoordinates);
      setIndex();

   }  // End of 'BasicModel::BasicModel()'
示例#27
0
void XimCandidateWindow::selectCand(const QStringList &list)
{
#if defined(ENABLE_DEBUG)
    qDebug("uim-candwin-qt4: selectCand()");
#endif
    const int index = list[1].toInt();
    needHighlight = (list[2].toInt() == 1);
    setIndex(index);

    updateLabel();
}
示例#28
0
void FeatureData::add(FeatureArray& e)
{
  if (exists(e.getIndex())) { // array at position e.getIndex() already exists
    //enlarge array at position e.getIndex()
    size_t pos = getIndex(e.getIndex());
    m_array.at(pos).merge(e);
  } else {
    m_array.push_back(e);
    setIndex();
  }
}
示例#29
0
文件: qt.cpp 项目: DirtYiCE/uim
void CandidateWindow::selectCand( const QStringList &list )
{
#if defined(ENABLE_DEBUG)
    qDebug( "uim-candwin-qt: selectCand()" );
#endif
    const int index = list[ 1 ].toInt();
    needHilite = (list[ 2 ].toInt() == 1) ? TRUE : FALSE;
    setIndex( index );

    updateLabel();
}
示例#30
0
      // Explicit constructor, taking as input a Position object
      // containing reference station coordinates.
   IonexModel::IonexModel(const Position& RxCoordinates)
      throw(Exception)
   {

      pDefaultMaps = NULL;
      defaultObservable = TypeID::P1;
      useDCB = true;
      setIonoMapType("NONE");
      setInitialRxPosition(RxCoordinates);
      setIndex();

   }  // End of constructor 'IonexModel::IonexModel()'