本文整理汇总了C++中gui::MDIView类的典型用法代码示例。如果您正苦于以下问题:C++ MDIView类的具体用法?C++ MDIView怎么用?C++ MDIView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MDIView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: on_fileChooser_fileNameSelected
void TextureMapping::on_fileChooser_fileNameSelected(const QString& s)
{
QImage image;
if (!image.load(s)) {
QMessageBox::warning(this, tr("No image"), tr("The specified file is not a valid image file."));
return;
}
if (!this->grp) {
Gui::Document* doc = Gui::Application::Instance->activeDocument();
if (doc) {
Gui::MDIView* mdi = doc->getActiveView();
if (mdi && mdi->isDerivedFrom(View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* view = static_cast<View3DInventor*>(mdi)->getViewer();
this->grp = static_cast<SoGroup *>(view->getSceneGraph());
this->grp->ref();
this->grp->insertChild(this->tex,1);
if (ui->checkEnv->isChecked())
this->grp->insertChild(this->env,2);
}
}
}
if (!this->grp) {
QMessageBox::warning(this, tr("No 3d view"), tr("No active 3d view found."));
return;
}
SoSFImage texture;
Gui::BitmapFactory().convert(image, texture);
this->tex->image = texture;
//this->tex->filename = (const char*)s.toUtf8();
App::GetApplication().Config()["TextureImage"] = (const char*)s.toUtf8();
}
开发者ID:3DPrinterGuy,项目名称:FreeCAD,代码行数:34,代码来源:TextureMapping.cpp
示例2: unsetCursor
void DrawSketchHandler::unsetCursor(void)
{
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
viewer->getWidget()->setCursor(oldCursor);
}
}
开发者ID:davidlni,项目名称:FreeCAD,代码行数:8,代码来源:DrawSketchHandler.cpp
示例3: getActiveView
Py::Object DocumentPy::getActiveView(void) const
{
Gui::MDIView *view = getDocumentPtr()->getActiveView();
if (view) {
// already incremented in getPyObject().
return Py::Object(view->getPyObject(), true);
} else {
return Py::None();
}
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:10,代码来源:DocumentPyImp.cpp
示例4: Poly
void TaskCreateNodeSet::Poly(void)
{
Gui::Document* doc = Gui::Application::Instance->activeDocument();
Gui::MDIView* view = doc->getActiveView();
if (view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer();
viewer->setEditing(true);
viewer->startSelection(Gui::View3DInventorViewer::Clip);
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback,this);
}
}
开发者ID:DeepSOIC,项目名称:FreeCAD-ellipse,代码行数:11,代码来源:TaskCreateNodeSet.cpp
示例5: rmvSelectionGate
// remove the active SelectionGate
void SelectionSingleton::rmvSelectionGate(void)
{
if (ActiveGate) {
delete ActiveGate;
ActiveGate=0;
Gui::Document* doc = Gui::Application::Instance->activeDocument();
if (doc) {
Gui::MDIView* mdi = doc->getActiveView();
mdi->restoreOverrideCursor();
}
}
}
开发者ID:asosarma,项目名称:FreeCAD_sf_master,代码行数:13,代码来源:Selection.cpp
示例6:
Gui::View3DInventorViewer* MeshSelection::getViewer() const
{
Gui::Document* doc = Gui::Application::Instance->activeDocument();
if (!doc) return 0;
Gui::MDIView* view = doc->getActiveView();
if (view && view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
return viewer;
}
return 0;
}
开发者ID:5263,项目名称:FreeCAD,代码行数:12,代码来源:MeshSelection.cpp
示例7:
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
Gui::MDIView* mdiView = Instance->activeView();
if (mdiView) {
// already incremented in getPyObject().
return mdiView->getPyObject();
}
Py_Return;
}
开发者ID:KeithSloan,项目名称:FreeCAD_sf_master,代码行数:13,代码来源:ApplicationPy.cpp
示例8: getScaleFactor
float SoZoomTranslation::getScaleFactor()
{
// Dividing by 5 seems to work well
Gui::MDIView *mdi = Gui::Application::Instance->activeDocument()->getActiveView();
if (mdi && mdi->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer *viewer = static_cast<Gui::View3DInventor *>(mdi)->getViewer();
this->scale = viewer->getCamera()->getViewVolume(viewer->getCamera()->aspectRatio.getValue()).getWorldToScreenScale(SbVec3f(0.f, 0.f, 0.f), 0.1f) / 5;
return this->scale;
} else {
return this->scale;
}
}
开发者ID:Barleyman,项目名称:FreeCAD_sf_master,代码行数:13,代码来源:SoZoomTranslation.cpp
示例9: setCursor
void DrawSketchHandler::setCursor(const QPixmap &p,int x,int y)
{
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
oldCursor = viewer->getWidget()->cursor();
QCursor cursor(p, x, y);
actCursor = cursor;
viewer->getWidget()->setCursor(cursor);
}
}
开发者ID:davidlni,项目名称:FreeCAD,代码行数:13,代码来源:DrawSketchHandler.cpp
示例10: isActive
bool CmdInspectElement::isActive(void)
{
App::Document* doc = App::GetApplication().getActiveDocument();
if (!doc || doc->countObjectsOfType(Inspection::Feature::getClassTypeId()) == 0)
return false;
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
return !viewer->isEditing();
}
return false;
}
开发者ID:Didier94,项目名称:FreeCAD_sf_master,代码行数:14,代码来源:Command.cpp
示例11: isActive
bool CmdFemDefineNodesSet::isActive(void)
{
// Check for the selected mesh feature (all Mesh types)
if (getSelection().countObjectsOfType(Fem::FemMeshObject::getClassTypeId()) != 1)
return false;
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
return !viewer->isEditing();
}
return false;
}
开发者ID:Barleyman,项目名称:FreeCAD_sf_master,代码行数:14,代码来源:Command.cpp
示例12: activated
void StdCmdEdit::activated(int iMsg)
{
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
if (viewer->isEditingViewProvider()) {
doCommand(Command::Gui,"Gui.activeDocument().resetEdit()");
} else {
if (Selection().getCompleteSelection().size() > 0) {
SelectionSingleton::SelObj obj = Selection().getCompleteSelection()[0];
doCommand(Command::Gui,"Gui.activeDocument().setEdit(\"%s\",0)",obj.FeatName);
}
}
}
}
开发者ID:pedrocalderon,项目名称:FreeCAD_sf_master,代码行数:15,代码来源:CommandDoc.cpp
示例13:
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
Document *pcDoc = Instance->activeDocument();
if (pcDoc) {
Gui::MDIView *pcView = pcDoc->getActiveView();
if (pcView)
// already incremented in getPyObject().
return pcView->getPyObject();
}
Py_Return;
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:15,代码来源:ApplicationPy.cpp
示例14:
PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args, PyObject * /*kwd*/)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
Document *pcDoc = Instance->activeDocument();
if (pcDoc) {
Gui::MDIView *pcView = pcDoc->getActiveView();
if (pcView)
// already incremented in getPyObject().
return pcView->getPyObject();
}
Py_Return;
}
开发者ID:SparkyCola,项目名称:FreeCAD,代码行数:15,代码来源:ApplicationPy.cpp
示例15: activeView
PyObject* DocumentPy::activeView(PyObject *args)
{
if (!PyArg_ParseTuple(args, "")) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
Gui::MDIView *pcView = getDocumentPtr()->getActiveView();
if (pcView){
// already incremented in getPyObject().
return pcView->getPyObject();
} else {
Py_Return;
}
} PY_CATCH;
}
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:15,代码来源:DocumentPyImp.cpp
示例16: sendMsgToFirstView
bool Document::sendMsgToFirstView(const Base::Type& typeId, const char* pMsg, const char** ppReturn)
{
// first try the active view
Gui::MDIView* view = getActiveView();
if (view && view->isDerivedFrom(typeId)) {
if (view->onMsg(pMsg, ppReturn))
return true;
}
// now try the other views
std::list<Gui::MDIView*> views = getMDIViewsOfType(typeId);
for (std::list<Gui::MDIView*>::iterator it = views.begin(); it != views.end(); ++it) {
if ((*it != view) && (*it)->onMsg(pMsg, ppReturn)) {
return true;
}
}
return false;
}
开发者ID:RipCurrent,项目名称:FreeCAD_sf_master,代码行数:19,代码来源:Document.cpp
示例17: activated
void CmdPointsPolyCut::activated(int iMsg)
{
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Points::Feature::getClassTypeId());
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
if (it == docObj.begin()) {
Gui::Document* doc = getActiveGuiDocument();
Gui::MDIView* view = doc->getActiveView();
if (view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer();
viewer->setEditing(true);
viewer->startSelection(Gui::View3DInventorViewer::Lasso);
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), PointsGui::ViewProviderPoints::clipPointsCallback);
}
else {
return;
}
}
Gui::ViewProvider* pVP = getActiveGuiDocument()->getViewProvider( *it );
pVP->startEditing();
}
}
开发者ID:Didier94,项目名称:FreeCAD_sf_master,代码行数:22,代码来源:Command.cpp
示例18: rmvPreselect
void SelectionSingleton::rmvPreselect()
{
if (DocName == "")
return;
SelectionChanges Chng;
Chng.pDocName = DocName.c_str();
Chng.pObjectName = FeatName.c_str();
Chng.pSubName = SubName.c_str();
Chng.Type = SelectionChanges::RmvPreselect;
// reset the current preselection
CurrentPreselection.pDocName =0;
CurrentPreselection.pObjectName = 0;
CurrentPreselection.pSubName = 0;
CurrentPreselection.x = 0.0;
CurrentPreselection.y = 0.0;
CurrentPreselection.z = 0.0;
// notify observing objects
Notify(Chng);
signalSelectionChanged(Chng);
DocName = "";
FeatName= "";
SubName = "";
hx = 0;
hy = 0;
hz = 0;
if (ActiveGate && getMainWindow()) {
Gui::MDIView* mdi = Gui::Application::Instance->activeDocument()->getActiveView();
mdi->restoreOverrideCursor();
}
//Base::Console().Log("Sel : Rmv preselect \n");
}
开发者ID:asosarma,项目名称:FreeCAD_sf_master,代码行数:37,代码来源:Selection.cpp
示例19: activated
void CmdFemDefineNodesSet::activated(int iMsg)
{
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Fem::FemMeshObject::getClassTypeId());
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
if (it == docObj.begin()) {
Gui::Document* doc = getActiveGuiDocument();
Gui::MDIView* view = doc->getActiveView();
if (view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer();
viewer->setEditing(true);
viewer->startSelection(Gui::View3DInventorViewer::Clip);
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback);
}
else {
return;
}
}
//Gui::ViewProvider* pVP = getActiveGuiDocument()->getViewProvider(*it);
//if (pVP->isVisible())
// pVP->startEditing();
}
}
开发者ID:Barleyman,项目名称:FreeCAD_sf_master,代码行数:24,代码来源:Command.cpp
示例20: addSelection
bool SelectionSingleton::addSelection(const char* pDocName, const char* pObjectName, const char* pSubName, float x, float y, float z)
{
// already in ?
if (isSelected(pDocName, pObjectName, pSubName))
return true;
_SelObj temp;
temp.pDoc = getDocument(pDocName);
if (temp.pDoc) {
if(pObjectName)
temp.pObject = temp.pDoc->getObject(pObjectName);
else
temp.pObject = 0;
// check for a Selection Gate
if (ActiveGate) {
if (!ActiveGate->allow(temp.pDoc,temp.pObject,pSubName)) {
if (getMainWindow()) {
getMainWindow()->showMessage(QString::fromAscii("Selection not allowed by filter"),5000);
Gui::MDIView* mdi = Gui::Application::Instance->activeDocument()->getActiveView();
mdi->setOverrideCursor(Qt::ForbiddenCursor);
}
QApplication::beep();
return false;
}
}
temp.DocName = pDocName;
temp.FeatName = pObjectName ? pObjectName : "";
temp.SubName = pSubName ? pSubName : "";
temp.x = x;
temp.y = y;
temp.z = z;
if (temp.pObject)
temp.TypeName = temp.pObject->getTypeId().getName();
_SelList.push_back(temp);
SelectionChanges Chng;
Chng.pDocName = pDocName;
Chng.pObjectName = pObjectName ? pObjectName : "";
Chng.pSubName = pSubName ? pSubName : "";
Chng.x = x;
Chng.y = y;
Chng.z = z;
Chng.Type = SelectionChanges::AddSelection;
Notify(Chng);
signalSelectionChanged(Chng);
Base::Console().Log("Sel : Add Selection \"%s.%s.%s(%f,%f,%f)\"\n",pDocName,pObjectName,pSubName,x,y,z);
// allow selection
return true;
}
else { // neither an existing nor active document available
//assert(0);
// this can often happen when importing .iv files
Base::Console().Error("Cannot add to selection: no document '%s' found.\n", pDocName);
return false;
}
}
开发者ID:asosarma,项目名称:FreeCAD_sf_master,代码行数:67,代码来源:Selection.cpp
注:本文中的gui::MDIView类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论