本文整理汇总了C++中ZONE_CONTAINER::GetSelectedCorner方法的典型用法代码示例。如果您正苦于以下问题:C++ ZONE_CONTAINER::GetSelectedCorner方法的具体用法?C++ ZONE_CONTAINER::GetSelectedCorner怎么用?C++ ZONE_CONTAINER::GetSelectedCorner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZONE_CONTAINER
的用法示例。
在下文中一共展示了ZONE_CONTAINER::GetSelectedCorner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Show_Zone_Corner_Or_Outline_While_Move_Mouse
/// Redraws the zone outline when moving a corner according to the cursor position
void Show_Zone_Corner_Or_Outline_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aPosition, bool aErase )
{
PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) aPanel->GetParent();
ZONE_CONTAINER* zone = (ZONE_CONTAINER*) pcbframe->GetCurItem();
if( aErase ) // Undraw edge in old position
{
zone->Draw( aPanel, aDC, GR_XOR );
}
wxPoint pos = pcbframe->GetCrossHairPosition();
if( zone->IsMoving() )
{
wxPoint offset;
offset = pos - s_CursorLastPosition;
zone->Move( offset );
s_CursorLastPosition = pos;
}
else if( zone->IsDragging() )
{
wxPoint offset = pos - s_CursorLastPosition;
int selection = zone->GetSelectedCorner();
zone->MoveEdge( offset, selection );
s_CursorLastPosition = pos;
}
else
{
zone->Outline()->MoveCorner( zone->GetSelectedCorner(), pos.x, pos.y );
}
zone->Draw( aPanel, aDC, GR_XOR );
}
示例2: Abort_Zone_Move_Corner_Or_Outlines
/**
* Function Abort_Zone_Move_Corner_Or_Outlines
* cancels the Begin_Zone state if at least one EDGE_ZONE has been created.
*/
void Abort_Zone_Move_Corner_Or_Outlines( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) Panel->GetParent();
ZONE_CONTAINER* zone = (ZONE_CONTAINER*) pcbframe->GetCurItem();
if( zone->IsMoving() )
{
wxPoint offset;
offset = s_CornerInitialPosition - s_CursorLastPosition;
zone->Move( offset );
}
else if( zone->IsDragging() )
{
wxPoint offset;
offset = s_CornerInitialPosition - s_CursorLastPosition;
zone->MoveEdge( offset );
}
else
{
if( s_CornerIsNew )
{
zone->Outline()->DeleteCorner( zone->GetSelectedCorner() );
}
else
{
wxPoint pos = s_CornerInitialPosition;
zone->Outline()->MoveCorner( zone->GetSelectedCorner(), pos.x, pos.y );
}
}
Panel->SetMouseCapture( NULL, NULL );
s_AuxiliaryList.ClearListAndDeleteItems();
s_PickedList. ClearListAndDeleteItems();
Panel->Refresh();
pcbframe->SetCurItem( NULL );
zone->ClearFlags();
s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL;
}