当前位置: 首页>>代码示例>>C++>>正文


C++ SELECTION类代码示例

本文整理汇总了C++中SELECTION的典型用法代码示例。如果您正苦于以下问题:C++ SELECTION类的具体用法?C++ SELECTION怎么用?C++ SELECTION使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SELECTION类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: makeSelection

bool EDIT_TOOL::makeSelection( const SELECTION& aSelection )
{
    if( aSelection.Empty() )                        // Try to find an item that could be modified
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionSingle, true );

    return !aSelection.Empty();
}
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:7,代码来源:edit_tool.cpp

示例2: sameNetFunc

bool SELECTION_CONDITIONS::sameNetFunc( const SELECTION& aSelection )
{
    if( aSelection.Empty() )
        return false;

    int netcode = -1;

    for( int i = 0; i < aSelection.Size(); ++i )
    {
        const BOARD_CONNECTED_ITEM* item =
            dynamic_cast<const BOARD_CONNECTED_ITEM*>( aSelection.Item<EDA_ITEM>( i ) );

        if( !item )
            return false;

        if( netcode < 0 )
        {
            netcode = item->GetNetCode();

            if( netcode == NETINFO_LIST::UNCONNECTED )
                return false;
        }
        else if( netcode != item->GetNetCode() )
        {
            return false;
        }
    }

    return true;
}
开发者ID:morio,项目名称:kicad-source-mirror,代码行数:30,代码来源:selection_conditions.cpp

示例3: onlyTypeFunc

bool SELECTION_CONDITIONS::onlyTypeFunc( const SELECTION& aSelection, KICAD_T aType )
{
    if( aSelection.Empty() )
        return false;

    for( int i = 0; i < aSelection.Size(); ++i )
    {
        if( aSelection.Item<EDA_ITEM>( i )->Type() != aType )
            return false;
    }

    return true;
}
开发者ID:morio,项目名称:kicad-source-mirror,代码行数:13,代码来源:selection_conditions.cpp

示例4: OnlyConnectedItems

bool SELECTION_CONDITIONS::OnlyConnectedItems( const SELECTION& aSelection )
{
    if( aSelection.Empty() )
        return false;

    for( int i = 0; i < aSelection.Size(); ++i )
    {
        KICAD_T type = aSelection.Item<EDA_ITEM>( i )->Type();

        if( type != PCB_PAD_T && type != PCB_VIA_T && type != PCB_TRACE_T && type != PCB_ZONE_T )
            return false;
    }

    return true;
}
开发者ID:morio,项目名称:kicad-source-mirror,代码行数:15,代码来源:selection_conditions.cpp

示例5: hoverSelection

bool EDIT_TOOL::hoverSelection( const SELECTION& aSelection, bool aSanitize )
{
    if( aSelection.Empty() )                        // Try to find an item that could be modified
    {
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionCursor, true );

        if( m_selectionTool->CheckLock() == SELECTION_LOCKED )
        {
            m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
            return false;
        }
    }

    if( aSanitize )
        m_selectionTool->SanitizeSelection();

    if( aSelection.Empty() )        // TODO is it necessary?
        m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );

    return !aSelection.Empty();
}
开发者ID:OpenEE,项目名称:micad,代码行数:21,代码来源:edit_tool.cpp

示例6: addCornerCondition

bool POINT_EDITOR::addCornerCondition( const SELECTION& aSelection )
{
    if( aSelection.Size() != 1 )
        return false;

    BOARD_ITEM* item = aSelection.Item<BOARD_ITEM>( 0 );

    // Works only for zones and line segments
    return item->Type() == PCB_ZONE_AREA_T ||
           ( ( item->Type() == PCB_LINE_T || item->Type() == PCB_MODULE_EDGE_T ) &&
               static_cast<DRAWSEGMENT*>( item )->GetShape() == S_SEGMENT );
}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:12,代码来源:point_editor.cpp

示例7: sameLayerFunc

bool SELECTION_CONDITIONS::sameLayerFunc( const SELECTION& aSelection )
{
    if( aSelection.Empty() )
        return false;

    LSET layerSet;
    layerSet.set();

    for( int i = 0; i < aSelection.Size(); ++i )
    {
        const BOARD_ITEM* item = dynamic_cast<const BOARD_ITEM*>( aSelection.Item<EDA_ITEM>( i ) );

        if( !item )
            return false;

        layerSet &= item->GetLayerSet();

        if( !layerSet.any() )       // there are no common layers left
            return false;
    }

    return true;
}
开发者ID:morio,项目名称:kicad-source-mirror,代码行数:23,代码来源:selection_conditions.cpp

示例8: onlyTypesFunc

bool SELECTION_CONDITIONS::onlyTypesFunc( const SELECTION& aSelection, const std::vector<KICAD_T>& aTypes )
{
    if( aSelection.Empty() )
        return false;

    for( int i = 0; i < aSelection.Size(); ++i )
    {
        bool valid = false;

        for( std::vector<KICAD_T>::const_iterator it = aTypes.begin(); it != aTypes.end(); ++it )
        {
            if( aSelection.Item<EDA_ITEM>( i )->Type() == *it )
            {
                valid = true;
                break;
            }
        }

        if( !valid )
            return false;
    }

    return true;
}
开发者ID:morio,项目名称:kicad-source-mirror,代码行数:24,代码来源:selection_conditions.cpp

示例9: OnlyConnectedItems

bool PCB_SELECTION_CONDITIONS::OnlyConnectedItems( const SELECTION& aSelection )
{
    if( aSelection.Empty() )
        return false;

    for( const auto &item : aSelection )
    {
        auto type = item->Type();

        if( type != PCB_PAD_T && type != PCB_VIA_T && type != PCB_TRACE_T && type != PCB_ZONE_AREA_T )
            return false;
    }

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:15,代码来源:pcb_selection_conditions.cpp

示例10: getModificationPoint

wxPoint EDIT_TOOL::getModificationPoint( const SELECTION& aSelection )
{
    if( aSelection.Size() == 1 )
    {
        return aSelection.Item<BOARD_ITEM>( 0 )->GetPosition() - m_offset;
    }
    else
    {
        // If EDIT_TOOL is not currently active then it means that the cursor position is not
        // updated, so we have to fetch the latest value
        if( m_toolMgr->GetCurrentToolId() != m_toolId )
            m_cursor = getViewControls()->GetCursorPosition();

        return wxPoint( m_cursor.x, m_cursor.y );
    }
}
开发者ID:OpenEE,项目名称:micad,代码行数:16,代码来源:edit_tool.cpp

示例11: sameNetFunc

bool PCB_SELECTION_CONDITIONS::sameNetFunc( const SELECTION& aSelection, bool aAllowUnconnected )
{
    if( aSelection.Empty() )
        return false;

    int netcode = -1;   // -1 stands for 'net code is not yet determined'

    for( const auto& aitem : aSelection )
    {
        int current_netcode = -1;

        const BOARD_CONNECTED_ITEM* item =
            dynamic_cast<const BOARD_CONNECTED_ITEM*>( aitem );

        if( item )
        {
            current_netcode = item->GetNetCode();
        }
        else
        {
            if( !aAllowUnconnected )
                return false;
            else
                // if it is not a BOARD_CONNECTED_ITEM, treat it as if there was no net assigned
                current_netcode = 0;
        }

        assert( current_netcode >= 0 );

        if( netcode < 0 )
        {
            netcode = current_netcode;

            if( netcode == NETINFO_LIST::UNCONNECTED && !aAllowUnconnected )
                return false;
        }
        else if( netcode != current_netcode )
        {
            return false;
        }
    }

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:44,代码来源:pcb_selection_conditions.cpp

示例12: sameLayerFunc

bool PCB_SELECTION_CONDITIONS::sameLayerFunc( const SELECTION& aSelection )
{
    if( aSelection.Empty() )
        return false;

    LSET layerSet;
    layerSet.set();

    for( const auto& i : aSelection )
    {
        auto item = static_cast<BOARD_ITEM*>( i );
        layerSet &= item->GetLayerSet();

        if( !layerSet.any() )       // there are no common layers left
            return false;
    }

    return true;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:19,代码来源:pcb_selection_conditions.cpp

示例13: exitTASEditor

bool exitTASEditor()
{
	if (!askToSaveProject()) return false;

	// destroy window
	taseditorWindow.exit();
	disableGeneralKeyboardInput();
	// release memory
	editor.free();
	pianoRoll.free();
	markersManager.free();
	greenzone.free();
	bookmarks.free();
	branches.free();
	popupDisplay.free();
	history.free();
	playback.stopSeeking();
	selection.free();

	// restore "eoptions"
	eoptions = saved_eoptions;
	// restore autosaves
	EnableAutosave = saved_EnableAutosave;
	DoPriority();
	// restore frame_display
	frame_display = saved_frame_display;
	UpdateCheckedMenuItems();
	// switch off TAS Editor mode
	movieMode = MOVIEMODE_INACTIVE;
	FCEU_DispMessage("TAS Editor disengaged", 0);
	FCEUMOV_CreateCleanMovie();
	return true;
}
开发者ID:Plombo,项目名称:fceux,代码行数:33,代码来源:taseditor.cpp

示例14: handleInputColumnSetUsingPattern

bool EDITOR::handleInputColumnSetUsingPattern(int joy, int button)
{
	if (joy < 0 || joy >= joysticksPerFrame[getInputType(currMovieData)]) return false;

	RowsSelection* current_selection = selection.getCopyOfCurrentRowsSelection();
	if (current_selection->size() == 0) return false;
	RowsSelection::iterator current_selection_begin(current_selection->begin());
	RowsSelection::iterator current_selection_end(current_selection->end());
	int pattern_offset = 0, current_pattern = taseditorConfig.currentPattern;

	for(RowsSelection::iterator it(current_selection_begin); it != current_selection_end; it++)
	{
		// skip lag frames
		if (taseditorConfig.autofirePatternSkipsLag && greenzone.lagLog.getLagInfoAtFrame(*it) == LAGGED_YES)
			continue;
		currMovieData.records[*it].setBitValue(joy, button, patterns[current_pattern][pattern_offset] != 0);
		pattern_offset++;
		if (pattern_offset >= (int)patterns[current_pattern].size())
			pattern_offset -= patterns[current_pattern].size();
	}
	int first_changes = history.registerChanges(MODTYPE_PATTERN, *current_selection_begin, *current_selection->rbegin(), 0, patternsNames[current_pattern].c_str());
	if (first_changes >= 0)
	{
		greenzone.invalidateAndUpdatePlayback(first_changes);
		return true;
	} else
		return false;
}
开发者ID:CharlexH,项目名称:Provenance,代码行数:28,代码来源:editor.cpp

示例15: setMarkers

void EDITOR::setMarkers()
{
	RowsSelection* current_selection = selection.getCopyOfCurrentRowsSelection();
	if (current_selection->size())
	{
		RowsSelection::iterator current_selection_begin(current_selection->begin());
		RowsSelection::iterator current_selection_end(current_selection->end());
		bool changes_made = false;
		for(RowsSelection::iterator it(current_selection_begin); it != current_selection_end; it++)
		{
			if (!markersManager.getMarkerAtFrame(*it))
			{
				if (markersManager.setMarkerAtFrame(*it))
				{
					changes_made = true;
					pianoRoll.redrawRow(*it);
				}
			}
		}
		if (changes_made)
		{
			selection.mustFindCurrentMarker = playback.mustFindCurrentMarker = true;
			history.registerMarkersChange(MODTYPE_MARKER_SET, *current_selection_begin, *current_selection->rbegin());
		}
	}
}
开发者ID:CharlexH,项目名称:Provenance,代码行数:26,代码来源:editor.cpp


注:本文中的SELECTION类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。