本文整理汇总了C++中createPath函数的典型用法代码示例。如果您正苦于以下问题:C++ createPath函数的具体用法?C++ createPath怎么用?C++ createPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createPath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createPath
void SceneGraphTreeModel::removeNode(NodeUnrecPtr nodeToBeRemoved)
{
NodeRefPtr parent = nodeToBeRemoved->getParent();
TreePath pathOfNode = createPath(nodeToBeRemoved);
if(parent!=NULL)
{
UInt32 ChildIndex(parent->findChild(nodeToBeRemoved));
produceTreeNodesWillBeRemoved(pathOfNode.getParentPath(),std::vector<UInt32>(1, ChildIndex),std::vector<boost::any>(1, nodeToBeRemoved));
parent->subChild(nodeToBeRemoved);
produceTreeNodesRemoved(pathOfNode.getParentPath(),std::vector<UInt32>(1, ChildIndex),std::vector<boost::any>(1, nodeToBeRemoved));
if(parent->getNChildren() == 0)
{
if(parent->getParent() != NULL)
{
std::vector<UInt32> childIndices;
childIndices.push_back(parent->getParent()->findChild(parent));
std::vector<boost::any> ChildUserObjects;
for(UInt32 i(0) ; i< childIndices.size() ; ++i)
{
ChildUserObjects.push_back(boost::any(NodeUnrecPtr(parent->getParent()->getChild(childIndices[i]))));
}
produceTreeNodesChanged(createPath(parent->getParent()), childIndices, ChildUserObjects);
}
}
}
}
示例2: generateKMLForSICD
void generateKMLForSICD(xml::lite::Element* docXML,
six::sicd::ComplexData* data)
{
std::vector<six::LatLonAlt> v;
// Lets go ahead and try to add the ARP poly
v.push_back(data->geoData->scp.llh);
v.push_back(scene::Utilities::ecefToLatLon(data->scpcoa->arpPos));
docXML->addChild(createPath(v, "arpToSceneCenter", "LineString"));
// Time associated with start
six::DateTime dateTime = data->timeline->collectStart;
size_t durationInSeconds = (size_t) data->timeline->collectDuration;
six::Vector3 atTimeX;
for (size_t i = 0; i < durationInSeconds; ++i)
{
atTimeX = data->position->arpPoly(i);
v[1] = scene::Utilities::ecefToLatLon(atTimeX);
xml::lite::Element* arpPolyXML = createPath(v, "arpPoly", "LineString");
six::DateTime dt(dateTime.getTimeInMillis() + i * 1000);
arpPolyXML->addChild(createTimeSnapshot(dt));
docXML->addChild(arpPolyXML);
}
}
示例3: addInputPath
/* MCMC Var-Cov tuning matrix */
st_mcmc_update *initMCMCUpdate(char *dir)
{
st_mcmc_update *mcmc_update;
dir = addInputPath(dir);
char *tuning_file = createPath(dir, "tuning.csv");
gsl_matrix *tuning = readMatrix(tuning_file);
char *fixed_file = createPath(dir, "fixed.csv");
gsl_vector *fixed = readVector(fixed_file);
if(tuning->size1 != tuning->size2 || tuning->size1 != fixed->size) {
printf("Error in initMCMCUpdate\n");
exit(GSL_FAILURE);
}
gsl_vector *z = gsl_vector_alloc(fixed->size);
mcmc_update = (st_mcmc_update *) malloc(sizeof(st_mcmc_update));
mcmc_update->tuning = tuning;
mcmc_update->fixed=fixed;
mcmc_update->z = z;
mcmc_update->always_accept = 1;
int i;
for(i=0; i<fixed->size; i++)
mcmc_update->always_accept *= (int) VGET(mcmc_update->fixed, i);
return(mcmc_update);
}
示例4: createPath
void createPath(TreeNode *root,int sum,vector<int> path,vector<vector<int> >& res){
path.push_back(root->val);
if(!root->left&&!root->right){
if(root->val==sum)
res.push_back(path);
}
else{
if(root->left)
createPath(root->left,sum-root->val,path,res);
if(root->right)
createPath(root->right,sum-root->val,path,res);
}
}
示例5: initPrior
/* Public initialisations functions */
st_parts_at * initPrior(char* dir)
{
dir = addInputPath(dir);
st_parts_at *prior_parts;
char *residual_file= createPath(dir, "residuals.csv");
char *species_prior_file= createPath(dir, "species_prior.csv");
prior_parts = (st_parts_at *) malloc(sizeof(st_part_at));
prior_parts->sps = readMatrix(species_prior_file);
prior_parts->res = readMatrix(residual_file);
return(prior_parts);
}
示例6: TrackSparcsHandle
void
TrackSpArcSItem::init()
{
// Track //
//
inSpiral_ = trackSpArcS_->getInSpiral();
arc_ = trackSpArcS_->getArc();
outSpiral_ = trackSpArcS_->getOutSpiral();
// Selection/Highlighting //
//
//setAcceptHoverEvents(true);
//setFlag(QGraphicsItem::ItemIsMovable, true);
//setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
// Slider //
//
factorHandle_ = new TrackSparcsHandle(this);
updateFactorHandle();
// Color & Path //
//
//updateColor();
setBrush(QBrush(ODD::instance()->colors()->brightGreen()));
setPen(QPen(ODD::instance()->colors()->darkGreen()));
createPath();
}
示例7: createPath
/*
* Update position
*/
void
OSCItem::updatePosition()
{
path_ = createPath(selectedObject_);
path_->translate(pos_ );
setPath(*path_);
}
示例8: prepareGeometryChange
void DiagramDrawItem::setDimension(QPointF newPos)
{
prepareGeometryChange();
myPos2=newPos;
myPolygon=createPath();
setPolygon(myPolygon);
}
示例9: switch
// Constructor
MainMenuItem::MainMenuItem(QWidget *parent, ITEM_TYPE type):QWidget(parent){
int x, y;
// Adjust position and dimention according to the item type
switch (type) {
case START:
this->pos.x = 407; x = 277;
this->pos.y = 220; y = 49;
break;
case INSTRUCTION:
this->pos.x = 395; x = 291;
this->pos.y = 290; y = 36;
break;
case QUIT:
this->pos.x = 488; x = 103;
this->pos.y = 350; y = 37;
break;
case NEXT:
this->pos.x = 965; x = 77;
this->pos.y = 440; y = 25;
break;
case FINISH:
this->pos.x = 960; x = 95;
this->pos.y = 440; y = 25;
break;
default:
break;
}
this->selected = false;
this->type = type;
QString path = createPath();
this->image = new QImage();
this->image->load(path);
this->rect.setRect(pos.x, pos.y, x, y);
}
示例10: createPath
void LayoutSVGShape::updateShapeFromElement()
{
createPath();
m_fillBoundingBox = calculateObjectBoundingBox();
m_strokeBoundingBox = calculateStrokeBoundingBox();
}
示例11: root
void QtResourceViewPrivate::createPaths()
{
if (!m_resourceModel)
return;
const QString root(QLatin1Char(':'));
QMap<QString, QString> contents = m_resourceModel->contents();
QMapIterator<QString, QString> itContents(contents);
while (itContents.hasNext()) {
const QString filePath = itContents.next().key();
const QFileInfo fi(filePath);
QString dirPath = fi.absolutePath();
m_pathToContents[dirPath].append(fi.fileName());
while (!m_pathToParentPath.contains(dirPath) && dirPath != root) { // create all parent paths
const QFileInfo fd(dirPath);
const QString parentDirPath = fd.absolutePath();
m_pathToParentPath[dirPath] = parentDirPath;
m_pathToSubPaths[parentDirPath].append(dirPath);
dirPath = parentDirPath;
}
}
QQueue<QPair<QString, QTreeWidgetItem *> > pathToParentItemQueue;
pathToParentItemQueue.enqueue(qMakePair(root, static_cast<QTreeWidgetItem *>(0)));
while (!pathToParentItemQueue.isEmpty()) {
QPair<QString, QTreeWidgetItem *> pathToParentItem = pathToParentItemQueue.dequeue();
const QString path = pathToParentItem.first;
QTreeWidgetItem *item = createPath(path, pathToParentItem.second);
QStringList subPaths = m_pathToSubPaths.value(path);
QStringListIterator itSubPaths(subPaths);
while (itSubPaths.hasNext())
pathToParentItemQueue.enqueue(qMakePair(itSubPaths.next(), item));
}
}
示例12: checkStatus
int MissionWidget::checkStatus(void){
if(!sendAction->isConnected()){
statusErrorBox->setVisible(true);
lblError->setText("Robot Offline");
return ERROR_ROBOT;
}
QProcess procRun;
procRun.start(createPath("checkCam.sh"));
procRun.waitForFinished( );
QString output( procRun.readAllStandardOutput());
procRun.close();
qDebug()<< "Camera check "+output;
if(!output.compare("live\n"))
return STATUS_OK;
else{
statusErrorBox->setVisible(true);
lblError->setText("Camera Offline");
return ERROR_CAMERA;
}
}
示例13: createPath
void MainWindow::start_game(QString music_name)
{
cur_scene = game;
sound_menu->stop();
Phonon::MediaObject *sound_start = new Phonon::MediaObject(this);
createPath(sound_start, new Phonon::AudioOutput(Phonon::MusicCategory, this));
sound_start->setCurrentSource(Phonon::MediaSource(":/sound/start.mp3"));
sound_start->play();
QDir dir_music(QDir::home().absoluteFilePath(QString(".musicman/songs/%1/").arg(music_name)));
music_guitar = new Phonon::MediaObject(this);
music_guitar->setCurrentSource(Phonon::MediaSource(dir_music.absoluteFilePath("guitar.mp3")));
music_guitar_output =
new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(music_guitar, music_guitar_output);
music_song = new Phonon::MediaObject(this);
music_song->setCurrentSource(Phonon::MediaSource(dir_music.absoluteFilePath("song.mp3")));
music_song_output =
new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(music_song, music_song_output);
canvas = new Canvas(this);
Midi midi(dir_music.absoluteFilePath("notes.musicman").toStdString());
midi.parse();
canvas->setMidi(midi);
canvas->setTotalTime(music_song->totalTime());
canvas->resize(this->size());
canvas->show();
connect(timer, SIGNAL(timeout()), SLOT(redraw_canvas()));
timer->start(20);
}
示例14: time
void Evaluator::createPathWithDate(){
time_t curTime;
time(&curTime);
string subPath = ctime(&curTime);
subPath = subPath.substr(0,10);
createPath(subPath.data());
}
示例15: setAcceptHoverEvents
void
OSCBridgeItem::init()
{
// Hover Events //
//
setAcceptHoverEvents(true);
// setSelectable();
setFlag(ItemIsFocusable);
// Save a tunnel
//
tunnel_ = dynamic_cast<Tunnel *>(bridge_);
if (getTopviewGraph()) // not for profile graph
{
// Text //
//
bridgeTextItem_ = new BridgeTextItem(this, bridge_);
bridgeTextItem_->setZValue(1.0); // stack before siblings
}
road_ = bridge_->getParentRoad();
pos_ = road_->getGlobalPoint(bridge_->getSStart());
updateColor();
updatePosition();
createPath();
}