• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ partdesign::Groove类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onUpdateView

void TaskGrooveParameters::onUpdateView(bool on)
{
    if (on) {
        PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
        pcGroove->getDocument()->recomputeFeature(pcGroove);
    }
}
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:7,代码来源:TaskGrooveParameters.cpp


示例2: onReversed

void TaskGrooveParameters::onReversed(bool on)
{
    PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
    pcGroove->Reversed.setValue(on);
    if (updateView())
        pcGroove->getDocument()->recomputeFeature(pcGroove);
}
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:7,代码来源:TaskGrooveParameters.cpp


示例3: onAngleChanged

void TaskGrooveParameters::onAngleChanged(double len)
{
    PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
    pcGroove->Angle.setValue(len);
    if (updateView())
        pcGroove->getDocument()->recomputeFeature(pcGroove);
}
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:7,代码来源:TaskGrooveParameters.cpp


示例4: setEdit

bool ViewProviderGroove::setEdit(int ModNum)
{
    if (ModNum == ViewProvider::Default ) {
        PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(getObject());
        if (pcGroove->getSketchAxisCount() < 0) {
            QMessageBox msgBox;
            msgBox.setIcon(QMessageBox::Critical);
            msgBox.setWindowTitle(QObject::tr("Lost link to base sketch"));
            msgBox.setText(QObject::tr("The object can't be edited because the link to the the base sketch is lost."));
            msgBox.setStandardButtons(QMessageBox::Ok);
            msgBox.exec();
            return false;
        }
        // When double-clicking on the item for this pad the
        // object unsets and sets its edit mode without closing
        // the task panel
        Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
        TaskDlgGrooveParameters *padDlg = qobject_cast<TaskDlgGrooveParameters *>(dlg);
        if (padDlg && padDlg->getGrooveView() != this)
            padDlg = 0; // another pad left open its task panel
        if (dlg && !padDlg) {
            QMessageBox msgBox;
            msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
            msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
            msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
            msgBox.setDefaultButton(QMessageBox::Yes);
            int ret = msgBox.exec();
            if (ret == QMessageBox::Yes)
                Gui::Control().reject();
            else
                return false;
        }

        // clear the selection (convenience)
        Gui::Selection().clearSelection();
        //if (ModNum == 1)
        //    Gui::Command::openCommand("Change Groove parameters");

        // start the edit dialog
        if (padDlg)
            Gui::Control().showDialog(padDlg);
        else
            Gui::Control().showDialog(new TaskDlgGrooveParameters(this));

        return true;
    }
    else {
        return PartGui::ViewProviderPart::setEdit(ModNum);
    }
}
开发者ID:tyl1988,项目名称:FreeCAD_sf_master,代码行数:50,代码来源:ViewProviderGroove.cpp


示例5: onAxisChanged

void TaskGrooveParameters::onAxisChanged(int num)
{
    PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
    Sketcher::SketchObject *pcSketch = static_cast<Sketcher::SketchObject*>(pcGroove->Sketch.getValue());
    if (pcSketch) {
        int maxcount = pcSketch->getAxisCount()+2;
        if (num == 0)
            pcGroove->ReferenceAxis.setValue(pcSketch, std::vector<std::string>(1,"V_Axis"));
        else if (num == 1)
            pcGroove->ReferenceAxis.setValue(pcSketch, std::vector<std::string>(1,"H_Axis"));
        else if (num >= 2 && num < maxcount) {
            QString buf = QString::fromUtf8("Axis%1").arg(num-2);
            std::string str = buf.toStdString();
            pcGroove->ReferenceAxis.setValue(pcSketch, std::vector<std::string>(1,str));
        }
        if (num < maxcount && ui->axis->count() > maxcount)
            ui->axis->setMaxCount(maxcount);
    }
    if (updateView())
        pcGroove->getDocument()->recomputeFeature(pcGroove);
}
开发者ID:c-lutaud,项目名称:FreeCAD_sf_master,代码行数:21,代码来源:TaskGrooveParameters.cpp


示例6: onAxisChanged

void TaskGrooveParameters::onAxisChanged(int num)
{
    PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
    Sketcher::SketchObject *pcSketch = static_cast<Sketcher::SketchObject*>(pcGroove->Sketch.getValue());
    if (pcSketch) {
        App::DocumentObject *oldRefAxis = pcGroove->ReferenceAxis.getValue();
        std::vector<std::string> oldSubRefAxis = pcGroove->ReferenceAxis.getSubValues();

        int maxcount = pcSketch->getAxisCount()+2;
        if (num == 0)
            pcGroove->ReferenceAxis.setValue(pcSketch, std::vector<std::string>(1,"V_Axis"));
        else if (num == 1)
            pcGroove->ReferenceAxis.setValue(pcSketch, std::vector<std::string>(1,"H_Axis"));
        else if (num >= 2 && num < maxcount) {
            QString buf = QString::fromUtf8("Axis%1").arg(num-2);
            std::string str = buf.toStdString();
            pcGroove->ReferenceAxis.setValue(pcSketch, std::vector<std::string>(1,str));
        }
        if (num < maxcount && ui->axis->count() > maxcount)
            ui->axis->setMaxCount(maxcount);

        const std::vector<std::string> &newSubRefAxis = pcGroove->ReferenceAxis.getSubValues();
        if (oldRefAxis != pcSketch ||
            oldSubRefAxis.size() != newSubRefAxis.size() ||
            oldSubRefAxis[0] != newSubRefAxis[0]) {
            bool reversed = pcGroove->suggestReversed();
            if (reversed != pcGroove->Reversed.getValue()) {
                pcGroove->Reversed.setValue(reversed);
                ui->checkBoxReversed->blockSignals(true);
                ui->checkBoxReversed->setChecked(reversed);
                ui->checkBoxReversed->blockSignals(false);
            }
        }
    }
    if (updateView())
        pcGroove->getDocument()->recomputeFeature(pcGroove);
}
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:37,代码来源:TaskGrooveParameters.cpp


示例7: if

TaskGrooveParameters::TaskGrooveParameters(ViewProviderGroove *GrooveView,QWidget *parent)
    : TaskBox(Gui::BitmapFactory().pixmap("PartDesign_Groove"),tr("Groove parameters"),true, parent),GrooveView(GrooveView)
{
    // we need a separate container widget to add all controls to
    proxy = new QWidget(this);
    ui = new Ui_TaskGrooveParameters();
    ui->setupUi(proxy);
    QMetaObject::connectSlotsByName(this);

    connect(ui->grooveAngle, SIGNAL(valueChanged(double)),
            this, SLOT(onAngleChanged(double)));
    connect(ui->axis, SIGNAL(activated(int)),
            this, SLOT(onAxisChanged(int)));
    connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
            this, SLOT(onMidplane(bool)));
    connect(ui->checkBoxReversed, SIGNAL(toggled(bool)),
            this, SLOT(onReversed(bool)));
    connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)),
            this, SLOT(onUpdateView(bool)));

    this->groupLayout()->addWidget(proxy);

    // Temporarily prevent unnecessary feature updates
    ui->grooveAngle->blockSignals(true);
    ui->axis->blockSignals(true);
    ui->checkBoxMidplane->blockSignals(true);
    ui->checkBoxReversed->blockSignals(true);

    PartDesign::Groove* pcGroove = static_cast<PartDesign::Groove*>(GrooveView->getObject());
    double l = pcGroove->Angle.getValue();
    bool mirrored = pcGroove->Midplane.getValue();
    bool reversed = pcGroove->Reversed.getValue();

    ui->grooveAngle->setValue(l);
    ui->grooveAngle->bind(pcGroove->Angle);

    int count=pcGroove->getSketchAxisCount();

    for (int i=ui->axis->count()-1; i >= count+2; i--)
        ui->axis->removeItem(i);
    for (int i=ui->axis->count(); i < count+2; i++)
        ui->axis->addItem(QString::fromLatin1("Sketch axis %1").arg(i-2));

    int pos=-1;

    App::DocumentObject *pcReferenceAxis = pcGroove->ReferenceAxis.getValue();
    const std::vector<std::string> &subReferenceAxis = pcGroove->ReferenceAxis.getSubValues();
    if (pcReferenceAxis && pcReferenceAxis == pcGroove->Sketch.getValue()) {
        assert(subReferenceAxis.size()==1);
        if (subReferenceAxis[0] == "V_Axis")
            pos = 0;
        else if (subReferenceAxis[0] == "H_Axis")
            pos = 1;
        else if (subReferenceAxis[0].size() > 4 && subReferenceAxis[0].substr(0,4) == "Axis")
            pos = 2 + std::atoi(subReferenceAxis[0].substr(4,4000).c_str());
    }

    if (pos < 0 || pos >= ui->axis->count()) {
        ui->axis->addItem(QString::fromLatin1("Undefined"));
        pos = ui->axis->count()-1;
    }

    ui->axis->setCurrentIndex(pos);

    ui->checkBoxMidplane->setChecked(mirrored);
    ui->checkBoxReversed->setChecked(reversed);

    ui->grooveAngle->blockSignals(false);
    ui->axis->blockSignals(false);
    ui->checkBoxMidplane->blockSignals(false);
    ui->checkBoxReversed->blockSignals(false);

    setFocus ();
}
开发者ID:AllenBootung,项目名称:FreeCAD,代码行数:74,代码来源:TaskGrooveParameters.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ partdesign::Pad类代码示例发布时间:2022-05-31
下一篇:
C++ partdesign::Body类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap