本文整理汇总了C++中createPath函数的典型用法代码示例。如果您正苦于以下问题:C++ createPath函数的具体用法?C++ createPath怎么用?C++ createPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createPath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
}
}
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:31,代码来源:OSGSceneGraphTreeModel.cpp
示例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);
}
}
开发者ID:ngageoint,项目名称:six-library,代码行数:28,代码来源:test_parse_xml.cpp
示例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);
}
开发者ID:csgillespie,项目名称:hybrid-pmcmc,代码行数:30,代码来源:init.c
示例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);
}
}
开发者ID:husscc,项目名称:leetcode,代码行数:13,代码来源:PathSumII.cpp
示例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);
}
开发者ID:csgillespie,项目名称:hybrid-pmcmc,代码行数:14,代码来源:init.c
示例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();
}
开发者ID:nixz,项目名称:covise,代码行数:27,代码来源:tracksparcsitem.cpp
示例7: createPath
/*
* Update position
*/
void
OSCItem::updatePosition()
{
path_ = createPath(selectedObject_);
path_->translate(pos_ );
setPath(*path_);
}
开发者ID:dwickeroth,项目名称:covise,代码行数:10,代码来源:oscitem.cpp
示例8: prepareGeometryChange
void DiagramDrawItem::setDimension(QPointF newPos)
{
prepareGeometryChange();
myPos2=newPos;
myPolygon=createPath();
setPolygon(myPolygon);
}
开发者ID:autoscatto,项目名称:retroshare,代码行数:7,代码来源:diagramdrawitem.cpp
示例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);
}
开发者ID:bennettl,项目名称:Metal-Gear,代码行数:36,代码来源:MainMenuItem.cpp
示例10: createPath
void LayoutSVGShape::updateShapeFromElement()
{
createPath();
m_fillBoundingBox = calculateObjectBoundingBox();
m_strokeBoundingBox = calculateStrokeBoundingBox();
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:7,代码来源:LayoutSVGShape.cpp
示例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));
}
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:35,代码来源:qtresourceview.cpp
示例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;
}
}
开发者ID:nautilusRobotics,项目名称:ROV1,代码行数:26,代码来源:missionwidget.cpp
示例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);
}
开发者ID:xhacker,项目名称:musicman,代码行数:35,代码来源:mainwindow.cpp
示例14: time
void Evaluator::createPathWithDate(){
time_t curTime;
time(&curTime);
string subPath = ctime(&curTime);
subPath = subPath.substr(0,10);
createPath(subPath.data());
}
开发者ID:cibobo,项目名称:mydaproject,代码行数:7,代码来源:Evaluator.cpp
示例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();
}
开发者ID:dwickeroth,项目名称:covise,代码行数:29,代码来源:oscbridgeitem.cpp
示例16: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
cur_scene(main)
{
ui->setupUi(this);
ui->verticalLayout->setAlignment(Qt::AlignCenter);
setStyleSheet(QString("QPushButton { font-family: 'Avenir Next'; font-size: 40px; font-weight: bold; }"));
timer = new QTimer(this);
sound_menu = new Phonon::MediaObject(this);
createPath(sound_menu, new Phonon::AudioOutput(Phonon::MusicCategory, this));
sound_menu->setCurrentSource(Phonon::MediaSource(":/sound/menu.mp3"));
QObject::connect(sound_menu, SIGNAL(aboutToFinish()), SLOT(menu_sound_finished()));
sound_menu->setTransitionTime(-270);
sound_menu->play();
musiclist = new QListWidget(this);
musiclist->show();
musiclist->setVisible(false);
musiclist->setStyleSheet(QString("font-family: 'Avenir Next'; font-size: 40px; font-weight: bold;"));
ui->scoreLabel->setVisible(false);
ui->nameEdit->setVisible(false);
}
开发者ID:xhacker,项目名称:musicman,代码行数:27,代码来源:mainwindow.cpp
示例17: generateKML
std::string generateKML(six::Data* data, const sys::Path& outputDir)
{
std::string kmlFile = "visualization.kml";
sys::Path kmlPath(outputDir, kmlFile);
io::FileOutputStream fos(kmlPath.getPath());
xml::lite::Element* root = new xml::lite::Element("kml", KML_URI);
xml::lite::Element* docXML = new xml::lite::Element("Document", KML_URI);
root->addChild(docXML);
// Add name, and open the document
docXML->addChild(new xml::lite::Element("name", KML_URI, data->getName()));
docXML->addChild(new xml::lite::Element("open", KML_URI, "1"));
// Now add some styles
docXML->addChild(createLineStyle("footprint", FOOTPRINT_COLOR, 4));
docXML->addChild(createLineStyle("arpToSceneCenter", "ff0000ff", 2));
docXML->addChild(createLineStyle("arpPoly", "ff00007f", 2));
// Create footprint
const six::LatLonCorners corners(data->getImageCorners());
docXML->addChild(createPath(corners, "footprint", "LinearRing"));
// Specifics to SICD
if (data->getDataType() == six::DataType::COMPLEX)
generateKMLForSICD(docXML, (six::sicd::ComplexData*) data);
root->prettyPrint(fos);
delete root;
fos.close();
return kmlPath.getPath();
}
开发者ID:ngageoint,项目名称:six-library,代码行数:33,代码来源:test_parse_xml.cpp
示例18: merge
void Settings::merge(const boost::property_tree::ptree& from,
boost::property_tree::ptree& to,
bool overwrite)
{
// Is this a single value or a subtree?
if (!from.data().empty()) {
// Single value
if (overwrite || to.data().empty()) {
to.put_value(from.data());
}
return;
}
// Subtree
for (const auto& fromEntry : from) {
// Does the key exist in the destination?
auto toIt = to.find(fromEntry.first);
if (toIt == to.not_found()) {
ptree::ptree child;
// Recurse into the new child
merge(fromEntry.second, child, overwrite);
// Create a path object because ptree uses '.' as a path delimiter
// when strings are used
ptree::ptree::path_type treePath = createPath(fromEntry.first);
to.add_child(treePath, child);
} else {
// Recurse into the subtrees
merge(fromEntry.second, toIt->second, overwrite);
}
}
}
开发者ID:icyerasor,项目名称:joynr,代码行数:33,代码来源:Settings.cpp
示例19: kDebug
void KWQQuizView::audioPlayFile(const KUrl &soundUrl, bool overwrite)
{
static KUrl lastUrl;
KUrl *url = const_cast<KUrl *>(&soundUrl);
if (overwrite)
lastUrl = *url;
if (url->isEmpty()) {
if (lastUrl.isEmpty()) {
m_actionCollection->action("quiz_audio_play")->setEnabled(false);
return;
}
url = &lastUrl;
}
lastUrl = *url;
m_actionCollection->action("quiz_audio_play")->setEnabled(true);
kDebug() << "Attempting to play sound: " << *url;
if (!m_player) {
m_player = new Phonon::MediaObject(this);
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::NoCategory, this);
createPath(m_player, audioOutput);
} else {
m_player->stop();
}
m_player->setCurrentSource(*url);
m_player->play();
}
开发者ID:phedlund,项目名称:kwordquiz,代码行数:30,代码来源:kwqquizview.cpp
示例20: KNMusicBackendThread
KNMusicBackendPhononThread::KNMusicBackendPhononThread(QObject *parent) :
KNMusicBackendThread(parent)
{
//Initial the media object and audio output.
m_mediaObject=new MediaObject;
// m_mediaObject->moveToThread(&m_workingThread);
m_mediaObject->setTickInterval(10);
m_audioOutput=new AudioOutput(MusicCategory);
// m_audioOutput->moveToThread(&m_workingThread);
//Initial the state.
m_state=KNMusic::StoppedState;
//Link the media object and audio output.
createPath(m_mediaObject, m_audioOutput);
//Link signals.
connect(m_mediaObject, &MediaObject::totalTimeChanged,
this, &KNMusicBackendPhononThread::onActionDurationChanged);
connect(m_mediaObject, &MediaObject::tick,
this, &KNMusicBackendPhononThread::onActionPositionChanged);
connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
this, SLOT(onActionStateChanged(State,State)));
connect(m_mediaObject, SIGNAL(finished()),
this, SLOT(onActionFinished()));
}
开发者ID:loki1412,项目名称:Mu,代码行数:27,代码来源:knmusicbackendphononthread.cpp
注:本文中的createPath函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论