本文整理汇总了C++中picker函数的典型用法代码示例。如果您正苦于以下问题:C++ picker函数的具体用法?C++ picker怎么用?C++ picker使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了picker函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main( int argcount, char ** args )
{
// An instance of the script
// must be created before any other output.
// the last param automatically save files to the path
openLogin login;
filePicker picker(login,"sys/import","fileImportPick.cgi");
cgiScript script("text/html", false, picker.fileDir().c_str());
writelog("OK - script made");
// attempt to get cookie
if ( login.testLoginStatus() )
{
script.closeHeader();
writelog("Checking for files to delete");
picker.checkForfilesToDelete(script);
writelog("Generating file list");
picker.fileList(script);
writelog("Done");
}
else
{
script.Redirect("signIn.html");
script.closeHeader();
writelog("INVALID ACCESS ATTEMPT");
}
writelog("OK - All Done");
return(0);
}
开发者ID:davidmc,项目名称:w3metasite,代码行数:31,代码来源:fileImportPick.cpp
示例2: selectVisually
void SELECTION_TOOL::select( BOARD_ITEM* aItem )
{
// Modules are treated in a special way - when they are selected, we have to mark
// all the parts that make the module as selected
if( aItem->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( aItem );
module->RunOnChildren( boost::bind( &SELECTION_TOOL::selectVisually, this, _1 ) );
}
if( aItem->Type() == PCB_PAD_T )
{
MODULE* module = static_cast<MODULE*>( aItem->GetParent() );
if( m_selection.items.FindItem( module ) >= 0 )
return;
}
selectVisually( aItem );
ITEM_PICKER picker( aItem );
m_selection.items.PushItem( picker );
if( m_selection.Size() == 1 )
{
// Set as the current item, so the information about selection is displayed
m_frame->SetCurItem( aItem, true );
}
else if( m_selection.Size() == 2 ) // Check only for 2, so it will not be
{ // called for every next selected item
// If multiple items are selected, do not show the information about the selected item
m_frame->SetCurItem( NULL, true );
}
}
开发者ID:hermixy,项目名称:kicad-source-mirror,代码行数:33,代码来源:selection_tool.cpp
示例3: GetCurPart
void LIB_EDIT_FRAME::copySelectedItems()
{
LIB_PART* part = GetCurPart();
if( !part )
return;
m_clipboard.ClearListAndDeleteItems(); // delete previous saved list, if exists
m_clipboard.SetLastCursorPosition( GetScreen()->m_BlockLocate.GetEnd() ); // store the reference point
for( LIB_ITEM& item : part->GetDrawItems() )
{
// We *do not* copy fields because they are unique for the whole component
// so skip them (do not duplicate) if they are flagged selected.
if( item.Type() == LIB_FIELD_T )
item.ClearFlags( SELECTED );
if( !item.IsSelected() )
continue;
// Do not clear the 'selected' flag. It is required to have items drawn when they are pasted.
LIB_ITEM* copy = (LIB_ITEM*) item.Clone();
copy->SetFlags( copy->GetFlags() | UR_TRANSIENT );
ITEM_PICKER picker( copy, UR_NEW );
m_clipboard.PushItem( picker );
}
}
开发者ID:Lotharyx,项目名称:kicad-source-mirror,代码行数:27,代码来源:block_libedit.cpp
示例4: picker
// Assume this has been called with an
// application version selected.
void SoaWg::AddServiceVersionSlot() {
SoaRw *appVer = db.Tb("ApplicationVersion")->FocusRw();
if (appVer == 0)
return;
SoaRw *app = appVer->Ce("Application")->Row();
if (app == 0)
return;
DlgChooseAsset picker(this, app->Children("Service"), "Pick service");
if (picker.exec()) {
db.Tb("Service")->SetFocusedRwByViewId(picker.SelectedRow()->ViewId());
SoaTb *tb = db.Tb("ServiceVersion");
SoaRw *rw = tb->AllocRw(-1, true);
DlgNewAsset dlg(this, this, tb, rw);
if (dlg.exec()) {
tb->AddRw(dlg.Row());
RefreshViews();
}
else
delete rw;
}
}
开发者ID:bcace,项目名称:soabrowser,代码行数:28,代码来源:soawidgetactions.cpp
示例5: SectorItem
void MapScene::addSector(const QVector<IndexedPosition>& points,
const QString& targetCompetition)
{
// Initialisation du secteur
SectorItem* newSector = new SectorItem(targetCompetition);
// Ajout de tous les points dans le secteur
foreach (const IndexedPosition& p, points)
newSector->append(IndexedPosition(p.x() * this->_amplificationRatio,
p.y() * -this->_amplificationRatio,
p.index()));
// Colorisation du secteur
ColorPicker picker(6);
QColor sectorColor(picker.color(this->_sectors.count(), 150));
newSector->setBrush(QBrush(sectorColor));
QPen pen(picker.dark(this->_sectors.count()));
pen.setJoinStyle(Qt::RoundJoin);
pen.setWidthF(1.5);
pen.setCosmetic(true);
newSector->setPen(pen);
newSector->setZValue(-1);
this->_sectors << newSector;
this->addItem(newSector);
}
开发者ID:xaviermawet,项目名称:EcoManagerQwt,代码行数:27,代码来源:MapScene.cpp
示例6: SaveCopyOfZones
/**
* Function SaveCopyOfZones
* creates a copy of zones having a given netcode on a given layer,
* and fill a pick list with pickers to handle these copies
* the UndoRedo status is set to UR_CHANGED for all items in list
* Later, UpdateCopyOfZonesList will change and update these pickers after a zone edition
* @param aPickList = the pick list
* @param aPcb = the Board
* @param aNetCode = the reference netcode. if aNetCode < 0 all netcodes are used
* @param aLayer = the layer of zones. if aLayer < 0, all layers are used
* @return the count of saved copies
*/
int SaveCopyOfZones( PICKED_ITEMS_LIST& aPickList, BOARD* aPcb, int aNetCode, LAYER_NUM aLayer )
{
int copyCount = 0;
for( unsigned ii = 0; ; ii++ )
{
ZONE_CONTAINER* zone = aPcb->GetArea( ii );
if( zone == NULL ) // End of list
break;
if( aNetCode >= 0 && aNetCode != zone->GetNetCode() )
continue;
if( aLayer >= 0 && aLayer != zone->GetLayer() )
continue;
ZONE_CONTAINER* zoneDup = new ZONE_CONTAINER( *zone );
zoneDup->SetParent( aPcb );
ITEM_PICKER picker( zone, UR_CHANGED );
picker.SetLink( zoneDup );
aPickList.PushItem( picker );
copyCount++;
}
return copyCount;
}
开发者ID:Elphel,项目名称:kicad-source-mirror,代码行数:39,代码来源:zones_functions_for_undo_redo.cpp
示例7: getImage
void StylePickerTool::mouseMove(const TPointD &pos, const TMouseEvent &e) {
if (!m_passivePick.getValue()) return;
/*--- PassiveにStyleを拾う機能 ---*/
PaletteController *controller =
TTool::getApplication()->getPaletteController();
TImageP image = getImage(false);
TToonzImageP ti = image;
TVectorImageP vi = image;
TXshSimpleLevel *level =
getApplication()->getCurrentLevel()->getSimpleLevel();
if ((!ti && !vi) || !level || !m_viewer->getGeometry().contains(pos)) {
controller->notifyStylePassivePicked(-1, -1, -1);
return;
}
int subsampling = level->getImageSubsampling(getCurrentFid());
StylePicker picker(image);
TPointD pickPos(TScale(1.0 / subsampling) * pos + TPointD(-0.5, -0.5));
int inkStyleId =
picker.pickStyleId(pickPos, getPixelSize() * getPixelSize(), 1);
int paintStyleId =
picker.pickStyleId(pickPos, getPixelSize() * getPixelSize(), 0);
int tone = picker.pickTone(pickPos);
controller->notifyStylePassivePicked(inkStyleId, paintStyleId, tone);
}
开发者ID:hvfrancesco,项目名称:opentoonz,代码行数:26,代码来源:stylepickertool.cpp
示例8: picker
/*! rectangular rgb picking. The picked color will be an average of pixels in
* specified rectangle
*/
void ImageViewer::rectPickColor(bool putValueToStyleEditor) {
if (!m_isHistogramEnable) return;
if (!m_histogramPopup->isVisible()) return;
StylePicker picker(m_image);
TPoint startPos =
TPoint(m_pressedMousePos.x, height() - 1 - m_pressedMousePos.y);
TPoint endPos = TPoint(m_pos.x(), height() - 1 - m_pos.y());
TRectD area = TRectD(convert(startPos), convert(endPos));
area = area.enlarge(-1, -1);
if (area.getLx() < 2 || area.getLy() < 2) {
m_histogramPopup->updateAverageColor(TPixel32::Transparent);
return;
}
if (m_lutCalibrator && m_lutCalibrator->isValid() && m_fbo) m_fbo->bind();
const TPixel32 pix = picker.pickColor(area.enlarge(-1, -1));
if (m_lutCalibrator && m_lutCalibrator->isValid() && m_fbo) m_fbo->release();
// throw the picked color to the histogram
m_histogramPopup->updateAverageColor(pix);
// throw it to the style editor as well
if (putValueToStyleEditor) setPickedColorToStyleEditor(pix);
}
开发者ID:janisozaur,项目名称:opentoonz,代码行数:30,代码来源:imageviewer.cpp
示例9: DisplayError
void PCB_EDIT_FRAME::Delete_Drawings_All_Layer( PCB_LAYER_ID aLayer )
{
if( IsCopperLayer( aLayer ) )
{
DisplayError( this, _( "Copper layer global delete not allowed!" ) );
return;
}
wxString msg;
msg.Printf( _( "Delete everything on layer %s?" ),
GetChars( GetBoard()->GetLayerName( aLayer ) ) );
if( !IsOK( this, msg ) )
return;
// Step 1: build the list of items to remove.
// because we are using iterators, we cannot modify the drawing list during iterate
// so we are using a 2 steps calculation:
// First, collect items.
// Second, remove items.
std::vector<BOARD_ITEM*> list;
for( auto item : GetBoard()->Drawings() )
{
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_TEXT_T:
case PCB_DIMENSION_T:
case PCB_TARGET_T:
if( item->GetLayer() == aLayer )
list.push_back( item );
break;
default:
wxLogDebug( wxT( "Delete_Drawings_All_Layer() error: unknown type %d" ), item->Type() );
}
}
if( list.size() == 0 ) // No item found
return;
// Step 2: remove items from main list, and move them to the undo list
PICKED_ITEMS_LIST pickList;
ITEM_PICKER picker( NULL, UR_DELETED );
for( auto item : list )
{
item->UnLink();
picker.SetItem( item );
pickList.PushItem( picker );
}
OnModify();
SaveCopyInUndoList(pickList, UR_DELETED);
}
开发者ID:johnbeard,项目名称:kicad,代码行数:58,代码来源:editedge.cpp
示例10: DisplayError
void PCB_EDIT_FRAME::Delete_Drawings_All_Layer( LAYER_ID aLayer )
{
if( IsCopperLayer( aLayer ) )
{
DisplayError( this, _( "Copper layer global delete not allowed!" ) );
return;
}
wxString msg = wxString::Format(
_( "Delete everything on layer %s?" ),
GetChars( GetBoard()->GetLayerName( aLayer ) ) );
if( !IsOK( this, msg ) )
return;
PICKED_ITEMS_LIST pickList;
ITEM_PICKER picker( NULL, UR_DELETED );
BOARD_ITEM* PtNext;
for( BOARD_ITEM* item = GetBoard()->m_Drawings; item; item = PtNext )
{
PtNext = item->Next();
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_TEXT_T:
case PCB_DIMENSION_T:
case PCB_TARGET_T:
if( item->GetLayer() == aLayer )
{
item->UnLink();
picker.SetItem( item );
pickList.PushItem( picker );
}
break;
default:
{
wxString msg;
msg.Printf( wxT("Delete_Drawings_All_Layer() error: unknown type %d"),
item->Type() );
wxMessageBox( msg );
break;
}
}
}
if( pickList.GetCount() )
{
OnModify();
SaveCopyInUndoList(pickList, UR_DELETED);
}
}
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:55,代码来源:editedge.cpp
示例11: ZONE_CONTAINER
void PCB_EDIT_FRAME::duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone )
{
ZONE_CONTAINER* newZone = new ZONE_CONTAINER( GetBoard() );
newZone->Copy( aZone );
newZone->UnFill();
ZONE_SETTINGS zoneSettings;
zoneSettings << *aZone;
bool success;
if( aZone->GetIsKeepout() )
success = InvokeKeepoutAreaEditor( this, &zoneSettings );
else if( aZone->IsOnCopperLayer() )
success = InvokeCopperZonesEditor( this, &zoneSettings );
else
success = InvokeNonCopperZonesEditor( this, aZone, &zoneSettings );
if( success )
{
zoneSettings.ExportSetting( *newZone );
newZone->m_Poly->Hatch();
s_AuxiliaryList.ClearListAndDeleteItems();
s_PickedList.ClearListAndDeleteItems();
SaveCopyOfZones( s_PickedList, GetBoard(), newZone->GetNet(), newZone->GetLayer() );
GetBoard()->Add( newZone );
ITEM_PICKER picker( newZone, UR_NEW );
s_PickedList.PushItem( picker );
GetScreen()->SetCurItem( NULL ); // This outline may be deleted when merging outlines
// Combine zones if possible
GetBoard()->OnAreaPolygonModified( &s_AuxiliaryList, newZone );
// Redraw zones
GetBoard()->RedrawAreasOutlines( m_canvas, aDC, GR_OR, newZone->GetLayer() );
GetBoard()->RedrawFilledAreas( m_canvas, aDC, GR_OR, newZone->GetLayer() );
if( GetBoard()->GetAreaIndex( newZone ) >= 0
&& GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( newZone, true ) )
{
DisplayError( this, _( "Duplicate Zone: The outline of the duplicated zone fails DRC check!" ) );
}
UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
SaveCopyInUndoList( s_PickedList, UR_UNSPECIFIED );
s_PickedList.ClearItemsList();
OnModify();
}
else
delete newZone;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:54,代码来源:zones_by_polygon.cpp
示例12: picker
ScreenCalibrator::PickResult ScreenCalibrator::pickPoint(const Ray& queryRay) const
{
/* Create a ray picker: */
Geometry::RayPicker<Scalar,3> picker(queryRay,Scalar(Vrui::getRayPickCosine()));
/* Process all points: */
for(PointList::const_iterator pIt=trackingPoints.begin();pIt!=trackingPoints.end();++pIt)
picker(*pIt);
for(PointList::const_iterator pIt=floorPoints.begin();pIt!=floorPoints.end();++pIt)
picker(*pIt);
for(PointList::const_iterator pIt=screenPoints.begin();pIt!=screenPoints.end();++pIt)
picker(*pIt);
for(PointList::const_iterator pIt=ballPoints.begin();pIt!=ballPoints.end();++pIt)
picker(*pIt);
/* Return the index of the picked point: */
if(picker.havePickedPoint())
return picker.getPickIndex();
else
return ~PickResult(0);
}
开发者ID:jrevote,项目名称:Vrui,代码行数:21,代码来源:ScreenCalibrator.cpp
示例13: PlotClusters
void PlotClusters(cv::Mat &dataset, const int *const medoids, const int *const assignment, int nData, int nMedoids)
{
float minx = std::numeric_limits<float>::max();
float miny = std::numeric_limits<float>::max();
float maxx = 0;
float maxy = 0;
for(int i=0; i < dataset.rows; i++)
{
cv::Mat tmp = dataset.row(i);
if(tmp.at<float>(0,0) < minx)
minx = tmp.at<float>(0,0);
if(tmp.at<float>(0,0) > maxx)
maxx = tmp.at<float>(0,0);
if(tmp.at<float>(0,1) < miny)
miny = tmp.at<float>(0,1);
if(tmp.at<float>(0,1) > maxy)
maxy = tmp.at<float>(0,1);
}
float xdim = maxx - minx;
float ydim = maxy - miny;
Eigen::MatrixXd colors(nMedoids,3);
ColorPicker picker(nMedoids);
cv::Mat img = cv::Mat::ones(1024,1024,CV_8UC3);
for(int i=0; i < dataset.rows-1; i++)
{
cv::Mat tmp = dataset.row(i);
float x = ((tmp.at<float>(0,0) - minx)/xdim)*1024;
float y = ((tmp.at<float>(0,1) - miny)/ydim)*1024;
cv::Point2f a(x,y);
Color c = picker.getColor(assignment[i]);
cv::circle(img, a, 2, cv::Scalar(c.r_,c.g_,c.b_), -1 );
}
for(int i=0; i < nMedoids; i++)
{
int center_ind = medoids[i];
cv::Mat tmp = dataset.row(medoids[i]);
float x = ((tmp.at<float>(0,0) - minx)/xdim)*1024;
float y = ((tmp.at<float>(0,1) - miny)/ydim)*1024;
cv::Point2f a(x,y);
Color c = picker.getColor(assignment[medoids[i]]);
cv::circle(img, a, 10, cv::Scalar(c.r_,c.g_,c.b_), -1 );
}
cv::imwrite("Clusters.jpg", img);
// cv::imshow("Clusters",img);
// cv::waitKey(0);
}
开发者ID:caomw,项目名称:parallel-clustering,代码行数:53,代码来源:main.cpp
示例14: main
int main( int argcount, char ** args )
{
// DBG
// cout << "\r\n\r\n\r\n" << endl;
// the last param automatically save files to the path
char * ppi = getenv("PATH_INFO"); // where we were invoked
ocString path;
if( ppi ) path = ppi;
// DBG
// cout << " path " << path << endl;
Session_Obj session;
if( path.length() )
{
session.SetData( "LAST_PATH_INFO",path);
session.Synch();
}
else
{
path = session( "LAST_PATH_INFO" );
}
if( path.length() && path[0] == '/' )
{
path = path.substr(1);
}
openLogin login;
filePicker picker(login,path);
cgiScript script("text/html", false, picker.fileDir().c_str());
// attempt to get cookie
if ( login.testLoginStatus() )
{
script.closeHeader();
picker.checkForfilesToDelete(script);
picker.fileList(script);
// DBG
script << picker.debug << endl;
}
else
{
script.closeHeader();
script << "<html><body>" << endl;
script << "Not Logged in <!--";
script << login.getLastError() << endl;
script << " --></body></html>" << endl;
writelog("INVALID ACCESS ATTEMPT - FILE PICK SIGN IN REQUIRED!");
}
writelog("OK - All Done");
return(0);
}
开发者ID:davidmc,项目名称:w3metasite,代码行数:51,代码来源:filePick.cpp
示例15: wxCHECK_RET
void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem, bool aAppend )
{
wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) );
wxCHECK_RET( !( aItem->GetFlags() & STRUCT_DELETED ),
wxT( "Cannot delete item that is already deleted." ) );
// Here, aItem is not null.
SCH_SCREEN* screen = GetScreen();
if( aItem->Type() == SCH_SHEET_PIN_T )
{
// This item is attached to a node, and is not accessible by the global list directly.
SCH_SHEET* sheet = (SCH_SHEET*) aItem->GetParent();
wxCHECK_RET( (sheet != NULL) && (sheet->Type() == SCH_SHEET_T),
wxT( "Sheet label has invalid parent item." ) );
SaveCopyInUndoList( (SCH_ITEM*) sheet, UR_CHANGED, aAppend );
sheet->RemovePin( (SCH_SHEET_PIN*) aItem );
m_canvas->RefreshDrawingRect( sheet->GetBoundingBox() );
}
else
{
PICKED_ITEMS_LIST itemsList;
ITEM_PICKER picker( aItem, UR_DELETED );
aItem->SetFlags( STRUCT_DELETED );
itemsList.PushItem( picker );
screen->Remove( aItem );
if( aItem->IsConnectable() && aItem->Type() != SCH_JUNCTION_T )
{
std::vector< wxPoint > pts;
aItem->GetConnectionPoints( pts );
for( auto point : pts )
{
SCH_ITEM* junction;
if( !screen->IsJunctionNeeded( point )
&& ( junction = screen->GetItem( point, 0, SCH_JUNCTION_T ) ) )
{
ITEM_PICKER picker_juction( junction, UR_DELETED );
junction->SetFlags( STRUCT_DELETED );
itemsList.PushItem( picker_juction );
screen->Remove( junction );
}
}
}
SaveCopyInUndoList( itemsList, UR_DELETED, aAppend );
m_canvas->RefreshDrawingRect( aItem->GetBoundingBox() );
}
}
开发者ID:cpavlina,项目名称:kicad,代码行数:50,代码来源:operations_on_items_lists.cpp
示例16: picker
void
ColorButton::clicked()
{
// Color picker dialog
QColorDialog picker(this);
picker.setCurrentColor(color);
QColor rcolor = picker.getColor(color, this, tr("Choose Color"), QColorDialog::DontUseNativeDialog);
// if we got a good color use it and notify others
if (rcolor.isValid()) {
setColor(rcolor);
colorChosen(color);
}
}
开发者ID:GoldenCheetah,项目名称:GoldenCheetah,代码行数:14,代码来源:ColorButton.cpp
示例17: picker
unsigned int
ScaleTool::getAxisPick() const
{
unsigned int pick = Picker::NO_PICK;
if ( m_active ) {
m_panel->m_viewport->loadPickMatrices( UserInput::mousePos(), 1.f );
Picker picker( 4 );
for ( unsigned int i = 0; i < 3; ++i ) {
picker.setObjectIndex( i );
renderAxis( i );
}
picker.setObjectIndex( 3 );
renderCenter();
pick = picker.getPick();
m_panel->m_viewport->popMatrices();
}
return pick;
}
开发者ID:inequation,项目名称:snow,代码行数:18,代码来源:scaletool.cpp
示例18: picker
component::collision::BodyPicked PickHandler::findCollisionUsingBruteForce(const defaulttype::Vector3& origin,
const defaulttype::Vector3& direction,
double maxLength, core::objectmodel::BaseNode* rootNode)
{
BodyPicked result;
// Look for particles hit by this ray
// msg_info()<<"PickHandler::findCollisionUsingBruteForce" << std::endl;
simulation::MechanicalPickParticlesVisitor picker(sofa::core::ExecParams::defaultInstance(), origin, direction, maxLength, 0 );
//core::objectmodel::BaseNode* rootNode = mouseNode->getRoot(); //sofa::simulation::getSimulation()->getContext()->toBaseNode();
if (rootNode) picker.execute(rootNode->getContext());
else
dmsg_error("PickHandler") << "Root node not found.";
picker.getClosestParticle( result.mstate, result.indexCollisionElement, result.point, result.rayLength );
return result;
}
开发者ID:david-cazier,项目名称:sofa,代码行数:18,代码来源:PickHandler.cpp
示例19: assert
TableIndex *TableIndexFactory::getInstance(const TableIndexScheme &scheme) {
int colCount = (int)scheme.columnIndices.size();
TupleSchema *tupleSchema = scheme.tupleSchema;
assert(tupleSchema);
std::vector<ValueType> keyColumnTypes;
std::vector<int32_t> keyColumnLengths;
std::vector<bool> keyColumnAllowNull(colCount, true);
for (int i = 0; i < colCount; ++i) {
keyColumnTypes.push_back(tupleSchema->columnType(scheme.columnIndices[i]));
keyColumnLengths.push_back(tupleSchema->columnLength(scheme.columnIndices[i]));
}
TupleSchema *keySchema = TupleSchema::createTupleSchema(keyColumnTypes, keyColumnLengths, keyColumnAllowNull, true);
assert(keySchema);
VOLT_TRACE("Creating index for %s.\n%s", scheme.name.c_str(), keySchema->debug().c_str());
TableIndexPicker picker(keySchema, scheme);
TableIndex *retval = picker.getInstance();
return retval;
}
开发者ID:varadharajan,项目名称:voltdb,代码行数:18,代码来源:tableindexfactory.cpp
示例20: GetScreen
void PCB_EDIT_FRAME::Block_Duplicate( bool aIncrement )
{
wxPoint MoveVector = GetScreen()->m_BlockLocate.GetMoveVector();
OnModify();
PICKED_ITEMS_LIST* itemsList = &GetScreen()->m_BlockLocate.GetItems();
PICKED_ITEMS_LIST newList;
newList.m_Status = UR_NEW;
ITEM_PICKER picker( NULL, UR_NEW );
BOARD_ITEM* newitem;
for( unsigned ii = 0; ii < itemsList->GetCount(); ii++ )
{
BOARD_ITEM* item = (BOARD_ITEM*) itemsList->GetPickedItem( ii );
newitem = (BOARD_ITEM*)item->Clone();
if( aIncrement )
newitem->IncrementItemReference();
if( item->Type() == PCB_MODULE_T )
m_Pcb->m_Status_Pcb = 0;
m_Pcb->Add( newitem );
if( newitem )
{
newitem->Move( MoveVector );
picker.SetItem ( newitem );
newList.PushItem( picker );
}
}
if( newList.GetCount() )
SaveCopyInUndoList( newList, UR_NEW );
Compile_Ratsnest( NULL, true );
m_canvas->Refresh( true );
}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:42,代码来源:block.cpp
注:本文中的picker函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论