您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateActive函数代码示例

51自学网 2021-06-03 09:13:13
  C++
这篇教程C++ updateActive函数代码示例写得很实用,希望能帮到您。

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

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

示例1: updateActive

//----------------void oilWaterNode::update(){	repulsionDist	    = 29.0; 	if( bRise ){		repulsionDist	= 30.0; 	}else{		repulsionDist	= 30.0; 	}//	nodeText.update(0.04);		//printf("state is %s/n", nodeStateToStr(state).c_str());		if(state == NODE_ACTIVATING){		nPct += 0.03;		if( nPct > 1.0 ){			nPct = 1.0;			state = NODE_ACTIVE;			globalSnd.play("OIL_WATER_BURST", 0.9, 1.0, 0.0);		}	}		if( nPct >= 0.9 ){		updateActive();	}else{		updateActive();				updateInactive();	}	}
开发者ID:emmanuelgeoffray,项目名称:RideAndFall-037,代码行数:30,


示例2: openCommand

void CmdPartRefineShape::activated(int iMsg){    Gui::WaitCursor wc;    Base::Type partid = Base::Type::fromName("Part::Feature");    std::vector<App::DocumentObject*> objs = Gui::Selection().getObjectsOfType(partid);    openCommand("Refine shape");    for (std::vector<App::DocumentObject*>::iterator it = objs.begin(); it != objs.end(); ++it) {        try {            doCommand(Doc,"App.ActiveDocument.addObject('Part::Feature','%s').Shape="                          "App.ActiveDocument.%s.Shape.removeSplitter()/n"                          "App.ActiveDocument.ActiveObject.Label="                          "App.ActiveDocument.%s.Label/n"                          "Gui.ActiveDocument.%s.hide()/n",                          (*it)->getNameInDocument(),                          (*it)->getNameInDocument(),                          (*it)->getNameInDocument(),                          (*it)->getNameInDocument());            copyVisual("ActiveObject", "ShapeColor", (*it)->getNameInDocument());            copyVisual("ActiveObject", "LineColor", (*it)->getNameInDocument());            copyVisual("ActiveObject", "PointColor", (*it)->getNameInDocument());        }        catch (const Base::Exception& e) {            Base::Console().Warning("%s: %s/n", (*it)->Label.getValue(), e.what());        }    }    commitCommand();    updateActive();}
开发者ID:ADVALAIN596,项目名称:FreeCAD_sf_master,代码行数:28,


示例3: QString

void CmdPointsExport::activated(int iMsg){  QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(),      QString::null, QString(), QObject::tr("Ascii Points (*.asc);;All Files (*.*)"));  if ( fn.isEmpty() )    return;  if (! fn.isEmpty() )  {    QFileInfo fi;    fi.setFile(fn);      openCommand("Export Points");    std::vector<App::DocumentObject*> points = getSelection().getObjectsOfType(Points::Feature::getClassTypeId());    doCommand(Doc,"f = App.ActiveDocument.addObject(/"Points::Export/",/"%s/")", (const char*)fi.baseName().toAscii());    doCommand(Doc,"f.FileName = /"%s/"",(const char*)fn.toAscii());    doCommand(Doc,"l=list()");        for ( std::vector<App::DocumentObject*>::const_iterator it = points.begin(); it != points.end(); ++it )    {      doCommand(Doc,"l.append(App.ActiveDocument.getObject(/"%s/"))",(*it)->getNameInDocument());    }    doCommand(Doc,"f.Sources = l");    commitCommand();    updateActive();  }}
开发者ID:Didier94,项目名称:FreeCAD_sf_master,代码行数:28,


示例4: Q_UNUSED

void CmdPartDesignDuplicateSelection::activated(int iMsg){    Q_UNUSED(iMsg);    PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */false);    std::vector<App::DocumentObject*> beforeFeatures = getDocument()->getObjects();    openCommand("Duplicate a PartDesign object");    doCommand(Doc,"FreeCADGui.runCommand('Std_DuplicateSelection')");    if (pcActiveBody) {        // Find the features that were added        std::vector<App::DocumentObject*> afterFeatures = getDocument()->getObjects();        std::vector<App::DocumentObject*> newFeatures;        std::sort(beforeFeatures.begin(), beforeFeatures.end());        std::sort(afterFeatures.begin(), afterFeatures.end());        std::set_difference(afterFeatures.begin(), afterFeatures.end(), beforeFeatures.begin(), beforeFeatures.end(),                            std::back_inserter(newFeatures));        for (auto feature : newFeatures) {            if (PartDesign::Body::isAllowed(feature)) {                doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",                          pcActiveBody->getNameInDocument(), feature->getNameInDocument());                doCommand(Gui,"Gui.activeDocument().hide(/"%s/")", feature->getNameInDocument());            }        }        // Adjust visibility of features        doCommand(Gui,"Gui.activeDocument().show(/"%s/")", newFeatures.back()->getNameInDocument());    }    updateActive();}
开发者ID:crobarcro,项目名称:FreeCAD,代码行数:33,


示例5: getSelection

void CmdPathCompound::activated(int iMsg){    std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();    if (Sel.size() > 0) {        std::ostringstream cmd;        cmd << "[";        Path::Feature *pcPathObject;        for (std::vector<Gui::SelectionSingleton::SelObj>::const_iterator it=Sel.begin();it!=Sel.end();++it) {            if ((*it).pObject->getTypeId().isDerivedFrom(Path::Feature::getClassTypeId())) {                pcPathObject = dynamic_cast<Path::Feature*>((*it).pObject);                cmd << "FreeCAD.activeDocument()." << pcPathObject->getNameInDocument() << ",";            } else {                Base::Console().Error("Only Path objects must be selected before running this command/n");                return;            }        }        cmd << "]";        std::string FeatName = getUniqueObjectName("PathCompound");        openCommand("Create Path Compound");        doCommand(Doc,"FreeCAD.activeDocument().addObject('Path::FeatureCompound','%s')",FeatName.c_str());        doCommand(Doc,"FreeCAD.activeDocument().%s.Group = %s",FeatName.c_str(),cmd.str().c_str());        commitCommand();        updateActive();    } else {        Base::Console().Error("At least one Path object must be selected/n");        return;    }}
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:28,


示例6: mt

LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp){	LLMemType mt(LLMemType::MTYPE_OBJECT);	LLUUID fullid;	fullid.generate();	LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);	if (!objectp)	{// 		llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl;		return NULL;	}	mUUIDObjectMap[fullid] = objectp;	if(objectp->isAvatar())	{		LLVOAvatar *pAvatar = dynamic_cast<LLVOAvatar*>(objectp);		if(pAvatar)			mUUIDAvatarMap[fullid] = pAvatar;	}	mObjects.push_back(objectp);	updateActive(objectp);	return objectp;}
开发者ID:Kiera,项目名称:Crow,代码行数:27,


示例7: mt

LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp,												 const LLUUID &uuid, const U32 local_id, const LLHost &sender){	LLMemType mt(LLMemType::MTYPE_OBJECT);	LLFastTimer t(LLFastTimer::FTM_CREATE_OBJECT);		LLUUID fullid;	if (uuid == LLUUID::null)	{		fullid.generate();	}	else	{		fullid = uuid;	}	LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);	if (!objectp)	{// 		llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl;		return NULL;	}	mUUIDObjectMap[fullid] = objectp;	setUUIDAndLocal(fullid,					local_id,					gMessageSystem->getSenderIP(),					gMessageSystem->getSenderPort());	mObjects.put(objectp);	updateActive(objectp);	return objectp;}
开发者ID:Boy,项目名称:netbook,代码行数:35,


示例8: getSelection

void CmdPartFuse::activated(int iMsg){    unsigned int n = getSelection().countObjectsOfType(Part::Feature::getClassTypeId());    if (n < 2) {        QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),            QObject::tr("Select two shapes or more, please."));        return;    }    std::string FeatName = getUniqueObjectName("Fusion");    std::vector<Gui::SelectionSingleton::SelObj> Sel = getSelection().getSelection();    std::stringstream str;    std::vector<std::string> tempSelNames;    str << "App.activeDocument()." << FeatName << ".Shapes = [";    for (std::vector<Gui::SelectionSingleton::SelObj>::iterator it = Sel.begin(); it != Sel.end(); ++it){        str << "App.activeDocument()." << it->FeatName << ",";        tempSelNames.push_back(it->FeatName);    }    str << "]";    openCommand("Fusion");    doCommand(Doc,"App.activeDocument().addObject(/"Part::MultiFuse/",/"%s/")",FeatName.c_str());    runCommand(Doc,str.str().c_str());    for (std::vector<std::string>::iterator it = tempSelNames.begin(); it != tempSelNames.end(); ++it)        doCommand(Gui,"Gui.activeDocument().%s.Visibility=False",it->c_str());    copyVisual(FeatName.c_str(), "ShapeColor", tempSelNames.front().c_str());    copyVisual(FeatName.c_str(), "DisplayMode", tempSelNames.front().c_str());    updateActive();    commitCommand();}
开发者ID:msocorcim,项目名称:FreeCAD,代码行数:31,


示例9: updateActive

void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, 										   void** user_data, 										   U32 i, 										   const EObjectUpdateType update_type, 										   LLDataPacker* dpp, 										   BOOL just_created){	LLMessageSystem* msg = gMessageSystem;	// ignore returned flags	objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);	if (objectp->isDead())	{		// The update failed		return;	}	updateActive(objectp);	// Also sets the approx. pixel area	objectp->setPixelAreaAndAngle(gAgent);	// Update the image levels of textures for this object.	objectp->updateTextures(gAgent);	if (just_created) 	{		gPipeline.addObject(objectp);	}	else	{		primbackup::getInstance()->prim_update(objectp);	}	// RN: this must be called after we have a drawable 	// (from gPipeline.addObject)	// so that the drawable parent is set properly	findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());	// If we're just wandering around, don't create new objects selected.	if (just_created 		&& update_type != OUT_TERSE_IMPROVED 		&& objectp->mCreateSelected)	{		if ( gToolMgr->getCurrentTool() != gToolPie )		{			//llinfos << "DEBUG selecting " << objectp->mID << " " 			//		<< objectp->mLocalID << llendl;			gSelectMgr->selectObjectAndFamily(objectp);			dialog_refresh_all();		}		objectp->mCreateSelected = false;		gViewerWindow->getWindow()->decBusyCount();		gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW );		primbackup::getInstance()->newprim(objectp);	}}
开发者ID:Boy,项目名称:netbook,代码行数:59,


示例10: updateActive

void LegendTab::setSingle(bool single) {  _single = single;  updateActive();  if (single) {    _autoContents->setTristate(false);    _displayVertically->setTristate(false);  }}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:8,


示例11: openCommand

void CmdRaytracingNewPartSegment::activated(int iMsg){    std::vector<Part::Feature*> parts = Gui::Selection().getObjectsOfType<Part::Feature>();    if (parts.empty()) {        QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),            QObject::tr("Select a Part object."));        return;    }    std::vector<App::DocumentObject*> pages = App::GetApplication().getActiveDocument()        ->getObjectsOfType(Raytracing::RayProject::getClassTypeId());    std::vector<App::DocumentObject*> pages2 = App::GetApplication().getActiveDocument()        ->getObjectsOfType(Raytracing::LuxProject::getClassTypeId());    pages.insert(pages.end(),pages2.begin(),pages2.end());    if (pages.empty()) {        QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No Raytracing project to insert"),            QObject::tr("Create a Raytracing project to insert a view."));        return;    }    std::string ProjName;    if (pages.size() > 1) {        // priority to the elders, if there is a pov project in the selection, it is used first!        pages = Gui::Selection().getObjectsOfType(Raytracing::RayProject::getClassTypeId());        if (pages.size() != 1) {            pages = Gui::Selection().getObjectsOfType(Raytracing::LuxProject::getClassTypeId());            if (pages.size() != 1) {                QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No Raytracing project to insert"),                    QObject::tr("Select a Raytracing project to insert the view."));                return;            }        }    }    ProjName = pages.front()->getNameInDocument();    const char *FeatType;    if (pages.front()->getTypeId().isDerivedFrom(Raytracing::RayProject::getClassTypeId())) {        FeatType = "RayFeature";    } else {        FeatType = "LuxFeature";    }    openCommand("Create view");    for (std::vector<Part::Feature*>::iterator it = parts.begin(); it != parts.end(); ++it) {        std::string FeatName = (*it)->getNameInDocument();        FeatName += "_View";        FeatName = getUniqueObjectName(FeatName.c_str());        doCommand(Doc,"App.activeDocument().addObject('Raytracing::%s','%s')",FeatType,FeatName.c_str());        doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),(*it)->getNameInDocument());        doCommand(Doc,"App.activeDocument().%s.Color = Gui.activeDocument().%s.ShapeColor",FeatName.c_str(),(*it)->getNameInDocument());        doCommand(Doc,"App.activeDocument().%s.Transparency = Gui.activeDocument().%s.Transparency",FeatName.c_str(),(*it)->getNameInDocument());        doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",ProjName.c_str(), FeatName.c_str());    }    updateActive();    commitCommand();}
开发者ID:DanielDTR,项目名称:FreeCAD_sf_master,代码行数:56,


示例12: str

void CmdRaytracingWriteView::activated(int iMsg){    const char* ppReturn=0;    Gui::Application::Instance->sendMsgToActiveView("GetCamera",&ppReturn);    if (ppReturn) {        std::string str(ppReturn);        if (str.find("PerspectiveCamera") == std::string::npos) {            int ret = QMessageBox::warning(Gui::getMainWindow(),                 qApp->translate("CmdRaytracingWriteView","No perspective camera"),                qApp->translate("CmdRaytracingWriteView","The current view camera is not perspective"                                " and thus the result of the povray image later might look different to"                                " what you expect./nDo you want to continue?"),                QMessageBox::Yes|QMessageBox::No);            if (ret != QMessageBox::Yes)                return;        }    }    QStringList filter;    filter << QObject::tr("Povray(*.pov)");    filter << QObject::tr("All Files (*.*)");    QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(),        QObject::tr("Export page"), QString(), filter.join(QLatin1String(";;")));    if (fn.isEmpty())         return;    std::string cFullName = (const char*)fn.toUtf8();    // get all objects of the active document    std::vector<Part::Feature*> DocObjects = getActiveGuiDocument()->getDocument()->        getObjectsOfType<Part::Feature>();    openCommand("Write view");    doCommand(Doc,"import Raytracing,RaytracingGui");    doCommand(Doc,"OutFile = open(unicode('%s','utf-8'),'w')",cFullName.c_str());    doCommand(Doc,"OutFile.write(open(App.getResourceDir()+'Mod/Raytracing/Templates/ProjectStd.pov').read())");    doCommand(Doc,"OutFile.write(RaytracingGui.povViewCamera())");    // go through all document objects    for (std::vector<Part::Feature*>::const_iterator it=DocObjects.begin();it!=DocObjects.end();++it) {        Gui::ViewProvider* vp = getActiveGuiDocument()->getViewProvider(*it);        if (vp && vp->isVisible()) {            App::PropertyColor *pcColor = dynamic_cast<App::PropertyColor *>(vp->getPropertyByName("ShapeColor"));            App::Color col = pcColor->getValue();            doCommand(Doc,"OutFile.write(Raytracing.getPartAsPovray('%s',App.activeDocument().%s.Shape,%f,%f,%f))",                     (*it)->getNameInDocument(),(*it)->getNameInDocument(),col.r,col.g,col.b);        }    }    doCommand(Doc,"OutFile.close()");    doCommand(Doc,"del OutFile");    updateActive();    commitCommand();}
开发者ID:lainegates,项目名称:FreeCAD,代码行数:54,


示例13: getSelection

void CmdRaytracingResetCamera::activated(int iMsg){    std::vector<App::DocumentObject*> sel = getSelection().getObjectsOfType(Raytracing::RayProject::getClassTypeId());    if (sel.size() != 1) {        sel = getSelection().getObjectsOfType(Raytracing::LuxProject::getClassTypeId());        if (sel.size() != 1) {            QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),                QObject::tr("Select one Raytracing project object."));            return;        }    }    if (sel.front()->getTypeId().isDerivedFrom(Raytracing::RayProject::getClassTypeId())) {        //povray        try {            openCommand("Reset Raytracing Camera");            doCommand(Doc,"import RaytracingGui");            doCommand(Doc,"App.activeDocument().%s.Camera = RaytracingGui.povViewCamera()",sel.front()->getNameInDocument());            commitCommand();            updateActive();        }        catch (...) {            abortCommand();            throw;        }    }    else if (sel.front()->getTypeId().isDerivedFrom(Raytracing::LuxProject::getClassTypeId())) {        //luxrender        try {            openCommand("Reset Raytracing Camera");            doCommand(Doc,"import RaytracingGui");            doCommand(Doc,"App.activeDocument().%s.Camera = RaytracingGui.luxViewCamera()",sel.front()->getNameInDocument());            commitCommand();            updateActive();        }        catch (...) {            abortCommand();            throw;        }    }}
开发者ID:DanielDTR,项目名称:FreeCAD_sf_master,代码行数:41,


示例14: updateActive

// __________________________________________________________________________________________________void KikiGear::actionFinished ( KikiAction * action ){    KikiValve::actionFinished (action);        int actionId = action->getId();        if (actionId == ACTION_PUSH || actionId == ACTION_FALL)    {        if (move_action == NULL)        {            updateActive();        }    }}
开发者ID:Frizlab,项目名称:kiki,代码行数:15,


示例15: ledseqStop

void ledseqStop(led_t led, const ledseq_t *sequence){  int prio = getPrio(sequence);  if(prio<0) return;  xSemaphoreTake(ledseqSem, portMAX_DELAY);  state[led][prio] = LEDSEQ_STOP;  //Stop the seq.  updateActive(led);  xSemaphoreGive(ledseqSem);  //Run the next active sequence (if any...)  runLedseq(timer[led]);}
开发者ID:CarlosRDomin,项目名称:crazyflie-firmware,代码行数:14,


示例16: openCommand

void CmdPartBox::activated(int iMsg){    QString cmd;    cmd = qApp->translate("CmdPartBox","Cube");    openCommand((const char*)cmd.toUtf8());    doCommand(Doc,"App.ActiveDocument.addObject(/"Part::Box/",/"Box/")");    cmd = QString::fromAscii("App.ActiveDocument.ActiveObject.Label = /"%1/"")        .arg(qApp->translate("CmdPartBox","Cube"));    doCommand(Doc,(const char*)cmd.toUtf8());    commitCommand();    updateActive();    doCommand(Gui, "Gui.SendMsgToActiveView(/"ViewFit/")");}
开发者ID:PrLayton,项目名称:SeriousFractal,代码行数:14,


示例17: openCommand

void CmdPartBox3::activated(int iMsg){    openCommand("Part Box Create");    doCommand(Doc,"from FreeCAD import Base");    doCommand(Doc,"import Part");    doCommand(Doc,"__fb__ = App.ActiveDocument.addObject(/"Part::Box/",/"PartBox/")");    doCommand(Doc,"__fb__.Location = Base.Vector(50.0,50.0,50.0)");    doCommand(Doc,"__fb__.Length = 100.0");    doCommand(Doc,"__fb__.Width = 100.0");    doCommand(Doc,"__fb__.Height = 100.0");    doCommand(Doc,"del __fb__");    commitCommand();    updateActive();}
开发者ID:msocorcim,项目名称:FreeCAD,代码行数:14,


示例18: ledseqRun

void ledseqRun(led_t led, const ledseq_t *sequence){  int prio = getPrio(sequence);  if(prio<0) return;  xSemaphoreTake(ledseqSem, portMAX_DELAY);  state[led][prio] = 0;  //Reset the seq. to its first step  updateActive(led);  xSemaphoreGive(ledseqSem);  //Run the first step if the new seq is the active sequence  if(activeSeq[led] == prio)    runLedseq(timer[led]);}
开发者ID:CarlosRDomin,项目名称:crazyflie-firmware,代码行数:15,


示例19: Files

void CmdPartImportCurveNet::activated(int iMsg){    QStringList filter;    filter << QObject::tr("All CAD Files (*.stp *.step *.igs *.iges *.brp *.brep)");    filter << QObject::tr("STEP (*.stp *.step)");    filter << QObject::tr("IGES (*.igs *.iges)");    filter << QObject::tr("BREP (*.brp *.brep)");    filter << QObject::tr("All Files (*.*)");    QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")));    if (!fn.isEmpty()) {        QFileInfo fi; fi.setFile(fn);        openCommand("Part Import Curve Net");        doCommand(Doc,"f = App.activeDocument().addObject(/"Part::CurveNet/",/"%s/")", (const char*)fi.baseName().toAscii());        doCommand(Doc,"f.FileName = /"%s/"",(const char*)fn.toAscii());        commitCommand();        updateActive();    }}
开发者ID:msocorcim,项目名称:FreeCAD,代码行数:19,


示例20: openCommand

void CmdRaytracingNewPartSegment::activated(int iMsg){    std::vector<Part::Feature*> parts = Gui::Selection().getObjectsOfType<Part::Feature>();    if (parts.empty()) {        QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),            QObject::tr("Select a Part object."));        return;    }    std::vector<App::DocumentObject*> pages = App::GetApplication().getActiveDocument()        ->getObjectsOfType(Raytracing::RayProject::getClassTypeId());    if (pages.empty()) {        QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No Povray project to insert"),            QObject::tr("Create a Povray project to insert a view."));        return;    }    std::string ProjName;    if (pages.size() > 1) {        pages = Gui::Selection().getObjectsOfType(Raytracing::RayProject::getClassTypeId());        if (pages.size() != 1) {            QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No Povray project to insert"),                QObject::tr("Select a Povray project to insert the view."));            return;        }    }    ProjName = pages.front()->getNameInDocument();    openCommand("Create view");    for (std::vector<Part::Feature*>::iterator it = parts.begin(); it != parts.end(); ++it) {        std::string FeatName = (*it)->getNameInDocument();        FeatName += "_View";        FeatName = getUniqueObjectName(FeatName.c_str());        doCommand(Doc,"App.activeDocument().addObject('Raytracing::RayFeature','%s')",FeatName.c_str());        doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",FeatName.c_str(),(*it)->getNameInDocument());        doCommand(Doc,"App.activeDocument().%s.Color = Gui.activeDocument().%s.ShapeColor",FeatName.c_str(),(*it)->getNameInDocument());        doCommand(Doc,"App.activeDocument().%s.addObject(App.activeDocument().%s)",ProjName.c_str(), FeatName.c_str());    }    updateActive();    commitCommand();}
开发者ID:lainegates,项目名称:FreeCAD,代码行数:42,


示例21: openCommand

void CmdPartSimpleCopy::activated(int iMsg){    Base::Type partid = Base::Type::fromName("Part::Feature");    std::vector<App::DocumentObject*> objs = Gui::Selection().getObjectsOfType(partid);    openCommand("Create Copy");    for (std::vector<App::DocumentObject*>::iterator it = objs.begin(); it != objs.end(); ++it) {        doCommand(Doc,"App.ActiveDocument.addObject('Part::Feature','%s').Shape="                      "App.ActiveDocument.%s.Shape/n"                      "App.ActiveDocument.ActiveObject.Label="                      "App.ActiveDocument.%s.Label/n",                      (*it)->getNameInDocument(),                      (*it)->getNameInDocument(),                      (*it)->getNameInDocument());        copyVisual("ActiveObject", "ShapeColor", (*it)->getNameInDocument());        copyVisual("ActiveObject", "LineColor", (*it)->getNameInDocument());        copyVisual("ActiveObject", "PointColor", (*it)->getNameInDocument());    }    commitCommand();    updateActive();}
开发者ID:Barleyman,项目名称:FreeCAD_sf_master,代码行数:20,


示例22: hide

void WidgetSelection::setWidget(QWidget *w){    if (m_widget != 0)        m_widget->removeEventFilter(this);    if (w == 0) {        hide();        m_widget = 0;        return;    }    m_widget = w;    m_widget->installEventFilter(this);    updateActive();    updateGeometry();    show();}
开发者ID:hkahn,项目名称:qt5-qttools-nacl,代码行数:20,


示例23: runLedseq

/* Center of the led sequence machine. This function is executed by the FreeRTOS * timer and runs the sequences */static void runLedseq( xTimerHandle xTimer ){  led_t led = (led_t)pvTimerGetTimerID(xTimer);  const ledseq_t *step;  bool leave=false;  if (!ledseqEnabled)    return;  while(!leave) {    int prio = activeSeq[led];    if (prio == LEDSEQ_STOP)      return;    step = &sequences[prio][state[led][prio]];    state[led][prio]++;    xSemaphoreTake(ledseqSem, portMAX_DELAY);    switch(step->action)    {      case LEDSEQ_LOOP:        state[led][prio] = 0;        break;      case LEDSEQ_STOP:        state[led][prio] = LEDSEQ_STOP;        updateActive(led);        break;      default:  //The step is a LED action and a time        ledSet(led, step->value);        if (step->action == 0)          break;        xTimerChangePeriod(xTimer, M2T(step->action), 0);        xTimerStart(xTimer, 0);        leave=true;        break;    }    xSemaphoreGive(ledseqSem);  }}
开发者ID:CarlosRDomin,项目名称:crazyflie-firmware,代码行数:44,



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


C++ updateAnchorPoint函数代码示例
C++ upd函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。