Fix some errors in the PartDesign ViewProvider code
This commit is contained in:
parent
a2359adb2e
commit
3229b322ec
|
@ -37,7 +37,7 @@ namespace PartDesignGui {
|
||||||
*/
|
*/
|
||||||
class PartDesignGuiExport ViewProviderBody : public PartGui::ViewProviderPart
|
class PartDesignGuiExport ViewProviderBody : public PartGui::ViewProviderPart
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderBody);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderBody);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderGroove : public ViewProvider
|
class PartDesignGuiExport ViewProviderGroove : public ViewProvider
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderGroove);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderGroove);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderHole : public ViewProvider
|
class PartDesignGuiExport ViewProviderHole : public ViewProvider
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderHole);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderHole);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
using namespace PartDesignGui;
|
using namespace PartDesignGui;
|
||||||
|
|
||||||
PROPERTY_SOURCE(PartDesignGui::ViewProviderLinearPattern,PartDesignGui::ViewProvider)
|
PROPERTY_SOURCE(PartDesignGui::ViewProviderLinearPattern,PartDesignGui::ViewProviderTransformed)
|
||||||
|
|
||||||
bool ViewProviderLinearPattern::setEdit(int ModNum)
|
bool ViewProviderLinearPattern::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderLinearPattern : public ViewProviderTransformed
|
class PartDesignGuiExport ViewProviderLinearPattern : public ViewProviderTransformed
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderLinearPattern);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderLinearPattern);
|
||||||
public:
|
public:
|
||||||
ViewProviderLinearPattern()
|
ViewProviderLinearPattern()
|
||||||
{ featureName = std::string("LinearPattern");
|
{ featureName = std::string("LinearPattern");
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderMainPart : public PartGui::ViewProviderPart
|
class PartDesignGuiExport ViewProviderMainPart : public PartGui::ViewProviderPart
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderMainPart);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderMainPart);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
using namespace PartDesignGui;
|
using namespace PartDesignGui;
|
||||||
|
|
||||||
PROPERTY_SOURCE(PartDesignGui::ViewProviderMirrored,PartDesignGui::ViewProvider)
|
PROPERTY_SOURCE(PartDesignGui::ViewProviderMirrored,PartDesignGui::ViewProviderTransformed)
|
||||||
|
|
||||||
bool ViewProviderMirrored::setEdit(int ModNum)
|
bool ViewProviderMirrored::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderMirrored : public ViewProviderTransformed
|
class PartDesignGuiExport ViewProviderMirrored : public ViewProviderTransformed
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderMirrored);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderMirrored);
|
||||||
public:
|
public:
|
||||||
ViewProviderMirrored()
|
ViewProviderMirrored()
|
||||||
{ featureName = std::string("Mirrored");
|
{ featureName = std::string("Mirrored");
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
using namespace PartDesignGui;
|
using namespace PartDesignGui;
|
||||||
|
|
||||||
PROPERTY_SOURCE(PartDesignGui::ViewProviderMultiTransform,PartDesignGui::ViewProvider)
|
PROPERTY_SOURCE(PartDesignGui::ViewProviderMultiTransform,PartDesignGui::ViewProviderTransformed)
|
||||||
|
|
||||||
bool ViewProviderMultiTransform::setEdit(int ModNum)
|
bool ViewProviderMultiTransform::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderMultiTransform : public ViewProviderTransformed
|
class PartDesignGuiExport ViewProviderMultiTransform : public ViewProviderTransformed
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderMultiTransform);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderMultiTransform);
|
||||||
public:
|
public:
|
||||||
ViewProviderMultiTransform()
|
ViewProviderMultiTransform()
|
||||||
{ featureName = std::string("MultiTransform");
|
{ featureName = std::string("MultiTransform");
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderPad : public ViewProvider
|
class PartDesignGuiExport ViewProviderPad : public ViewProvider
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderPad);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderPad);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
using namespace PartDesignGui;
|
using namespace PartDesignGui;
|
||||||
|
|
||||||
PROPERTY_SOURCE(PartDesignGui::ViewProviderPolarPattern,PartDesignGui::ViewProvider)
|
PROPERTY_SOURCE(PartDesignGui::ViewProviderPolarPattern,PartDesignGui::ViewProviderTransformed)
|
||||||
|
|
||||||
bool ViewProviderPolarPattern::setEdit(int ModNum)
|
bool ViewProviderPolarPattern::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderPolarPattern : public ViewProviderTransformed
|
class PartDesignGuiExport ViewProviderPolarPattern : public ViewProviderTransformed
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderPolarPattern);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderPolarPattern);
|
||||||
public:
|
public:
|
||||||
ViewProviderPolarPattern()
|
ViewProviderPolarPattern()
|
||||||
{ featureName = std::string("PolarPattern");
|
{ featureName = std::string("PolarPattern");
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderRevolution : public ViewProvider
|
class PartDesignGuiExport ViewProviderRevolution : public ViewProvider
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderRevolution);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderRevolution);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
using namespace PartDesignGui;
|
using namespace PartDesignGui;
|
||||||
|
|
||||||
PROPERTY_SOURCE(PartDesignGui::ViewProviderScaled,PartDesignGui::ViewProvider)
|
PROPERTY_SOURCE(PartDesignGui::ViewProviderScaled,PartDesignGui::ViewProviderTransformed)
|
||||||
|
|
||||||
bool ViewProviderScaled::setEdit(int ModNum)
|
bool ViewProviderScaled::setEdit(int ModNum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace PartDesignGui {
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderScaled : public ViewProviderTransformed
|
class PartDesignGuiExport ViewProviderScaled : public ViewProviderTransformed
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderScaled);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderScaled);
|
||||||
public:
|
public:
|
||||||
ViewProviderScaled()
|
ViewProviderScaled()
|
||||||
{ featureName = std::string("Scaled");
|
{ featureName = std::string("Scaled");
|
||||||
|
|
|
@ -115,24 +115,7 @@ bool ViewProviderTransformed::setEdit(int ModNum)
|
||||||
|
|
||||||
void ViewProviderTransformed::unsetEdit(int ModNum)
|
void ViewProviderTransformed::unsetEdit(int ModNum)
|
||||||
{
|
{
|
||||||
// return to the WB we were in before editing the PartDesign feature
|
ViewProvider::unsetEdit(ModNum);
|
||||||
Gui::Command::assureWorkbench(oldWb.c_str());
|
|
||||||
|
|
||||||
if (ModNum == ViewProvider::Default) {
|
|
||||||
// when pressing ESC make sure to close the dialog
|
|
||||||
Gui::Control().closeDialog();
|
|
||||||
if ((PartDesignGui::ActivePartObject != NULL) && (oldTip != NULL)) {
|
|
||||||
Gui::Selection().clearSelection();
|
|
||||||
Gui::Selection().addSelection(oldTip->getDocument()->getName(), oldTip->getNameInDocument());
|
|
||||||
Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')");
|
|
||||||
oldTip = NULL;
|
|
||||||
} else {
|
|
||||||
oldTip = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
PartGui::ViewProviderPart::unsetEdit(ModNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (pcRejectedRoot->getNumChildren() > 7) {
|
while (pcRejectedRoot->getNumChildren() > 7) {
|
||||||
SoSeparator* sep = static_cast<SoSeparator*>(pcRejectedRoot->getChild(7));
|
SoSeparator* sep = static_cast<SoSeparator*>(pcRejectedRoot->getChild(7));
|
||||||
|
|
|
@ -26,19 +26,13 @@
|
||||||
|
|
||||||
#include "ViewProvider.h"
|
#include "ViewProvider.h"
|
||||||
|
|
||||||
class SoCoordinate3;
|
|
||||||
class SoIndexedFaceSet;
|
|
||||||
class SoMultipleCopy;
|
|
||||||
class SoNormal;
|
|
||||||
class SoSeparator;
|
|
||||||
|
|
||||||
namespace PartDesignGui {
|
namespace PartDesignGui {
|
||||||
|
|
||||||
class TaskDlgTransformedParameters;
|
class TaskDlgTransformedParameters;
|
||||||
|
|
||||||
class PartDesignGuiExport ViewProviderTransformed : public ViewProvider
|
class PartDesignGuiExport ViewProviderTransformed : public ViewProvider
|
||||||
{
|
{
|
||||||
PROPERTY_HEADER(PartGui::ViewProviderTransformed);
|
PROPERTY_HEADER(PartDesignGui::ViewProviderTransformed);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// constructor
|
/// constructor
|
||||||
|
|
Loading…
Reference in New Issue
Block a user