allow non-sketch based additive and subtractive features

This commit is contained in:
Stefan Tröger 2015-05-10 09:35:29 +02:00
parent fab4ec990c
commit 9a2f5eea65
26 changed files with 115 additions and 203 deletions

View File

@ -40,8 +40,6 @@
#include "FeatureDressUp.h"
#include "FeatureChamfer.h"
#include "FeatureDraft.h"
#include "FeatureSubtractive.h"
#include "FeatureAdditive.h"
#include "FeatureTransformed.h"
#include "FeatureMirrored.h"
#include "FeatureLinearPattern.h"
@ -82,9 +80,8 @@ PyMODINIT_FUNC init_PartDesign()
PartDesign::Feature ::init();
PartDesign::Solid ::init();
PartDesign::DressUp ::init();
PartDesign::FeatureAddSub ::init();
PartDesign::SketchBased ::init();
PartDesign::Subtractive ::init();
PartDesign::Additive ::init();
PartDesign::Transformed ::init();
PartDesign::Mirrored ::init();
PartDesign::LinearPattern ::init();

View File

@ -40,8 +40,12 @@
#include "FeatureDressUp.h"
#include "FeatureChamfer.h"
#include "FeatureDraft.h"
<<<<<<< c3c1399b7e8f8ceea8f3c1288ebfe0b6575f4d90
#include "FeatureSubtractive.h"
#include "FeatureAdditive.h"
=======
#include "FeatureFace.h"
>>>>>>> allow non-sketch based additive and subtractive features
#include "FeatureTransformed.h"
#include "FeatureMirrored.h"
#include "FeatureLinearPattern.h"
@ -49,7 +53,10 @@
#include "FeatureScaled.h"
#include "FeatureMultiTransform.h"
#include "FeatureHole.h"
#include "DatumFeature.h"
#include "DatumPlane.h"
#include "DatumLine.h"
#include "DatumPoint.h"
#include "FeatureBoolean.h"
extern struct PyMethodDef PartDesign_methods[];
@ -81,9 +88,8 @@ void PartDesignExport init_PartDesign()
PartDesign::Feature ::init();
PartDesign::Solid ::init();
PartDesign::DressUp ::init();
PartDesign::FeatureAddSub ::init();
PartDesign::SketchBased ::init();
PartDesign::Subtractive ::init();
PartDesign::Additive ::init();
PartDesign::Transformed ::init();
PartDesign::Mirrored ::init();
PartDesign::LinearPattern ::init();
@ -98,16 +104,15 @@ void PartDesignExport init_PartDesign()
PartDesign::Revolution ::init();
PartDesign::Groove ::init();
PartDesign::Chamfer ::init();
<<<<<<< b1f11745d3f535813e5dea41f7a12b14fbd6389f
PartDesign::Draft ::init();
=======
PartDesign::Face ::init();
PartDesign::Draft ::init();
PartDesign::Datum ::init();
PartDesign::Plane ::init();
PartDesign::Line ::init();
PartDesign::Point ::init();
>>>>>>> Second step for implementing datum features
PartDesign::Boolean ::init();
PartDesign::Point::initHints();
PartDesign::Line ::initHints();
PartDesign::Plane::initHints();
}
} // extern "C"

View File

@ -88,10 +88,8 @@ SET(FeaturesSketchBased_SRCS
FeatureRevolution.h
FeatureGroove.cpp
FeatureGroove.h
FeatureAdditive.cpp
FeatureAdditive.h
FeatureSubtractive.h
FeatureSubtractive.cpp
FeatureAddSub.cpp
FeatureAddSub.h
FeatureHole.h
FeatureHole.cpp
FeatureBoolean.h

View File

@ -26,7 +26,7 @@
#endif
#include "FeatureAdditive.h"
#include "FeatureAddSub.h"
using namespace PartDesign;
@ -34,11 +34,16 @@ using namespace PartDesign;
namespace PartDesign {
PROPERTY_SOURCE(PartDesign::Additive,PartDesign::SketchBased)
PROPERTY_SOURCE(PartDesign::FeatureAddSub, PartDesign::Feature)
Additive::Additive()
FeatureAddSub::FeatureAddSub()
{
ADD_PROPERTY(AddShape,(TopoDS_Shape()));
ADD_PROPERTY(AddSubShape,(TopoDS_Shape()));
}
FeatureAddSub::Type FeatureAddSub::getAddSubType()
{
return addSubType;
}
}

View File

@ -27,22 +27,30 @@
#include <App/PropertyStandard.h>
#include <Mod/Part/App/PropertyTopoShape.h>
#include "FeatureSketchBased.h"
#include "Feature.h"
/// Base class of all additive features in PartDesign
namespace PartDesign
{
class PartDesignExport Additive : public SketchBased
class PartDesignExport FeatureAddSub : public PartDesign::Feature
{
PROPERTY_HEADER(PartDesign::Additive);
PROPERTY_HEADER(PartDesign::FeatureAddSub);
public:
Additive();
enum Type {
Additive = 0,
Subtractive
};
FeatureAddSub();
Part::PropertyPartShape AddShape;
Type getAddSubType();
Part::PropertyPartShape AddSubShape;
protected:
Type addSubType = Additive;
};
} //namespace PartDesign

View File

@ -49,10 +49,12 @@ using namespace PartDesign;
namespace PartDesign {
PROPERTY_SOURCE(PartDesign::Groove, PartDesign::Subtractive)
PROPERTY_SOURCE(PartDesign::Groove, PartDesign::SketchBased)
Groove::Groove()
{
addSubType = FeatureAddSub::Subtractive;
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0f,0.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Base");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0f,1.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Axis");
ADD_PROPERTY_TYPE(Angle,(360.0),"Groove", App::Prop_None, "Angle");
@ -67,7 +69,7 @@ short Groove::mustExecute() const
Base.isTouched() ||
Angle.isTouched())
return 1;
return Subtractive::mustExecute();
return SketchBased::mustExecute();
}
App::DocumentObjectExecReturn *Groove::execute(void)
@ -143,7 +145,7 @@ App::DocumentObjectExecReturn *Groove::execute(void)
TopoDS_Shape result = RevolMaker.Shape();
// set the subtractive shape property for later usage in e.g. pattern
result = refineShapeIfActive(result);
this->SubShape.setValue(result);
this->AddSubShape.setValue(result);
// cut out groove to get one result object
BRepAlgoAPI_Cut mkCut(base, result);

View File

@ -25,12 +25,12 @@
#define PARTDESIGN_Groove_H
#include <App/PropertyUnits.h>
#include "FeatureSubtractive.h"
#include "FeatureSketchBased.h"
namespace PartDesign
{
class PartDesignExport Groove : public Subtractive
class PartDesignExport Groove : public SketchBased
{
PROPERTY_HEADER(PartDesign::Groove);

View File

@ -52,10 +52,12 @@ const char* Hole::TypeEnums[] = {"Dimension","UpToLast","UpToFirst",NULL};
const char* Hole::HoleTypeEnums[]= {"Simple","Counterbore","Countersunk",NULL};
const char* Hole::ThreadEnums[] = {"None","Metric","MetricFine",NULL};
PROPERTY_SOURCE(PartDesign::Hole, PartDesign::Subtractive)
PROPERTY_SOURCE(PartDesign::Hole, PartDesign::SketchBased)
Hole::Hole()
{
addSubType = FeatureAddSub::Subtractive;
ADD_PROPERTY(Type,((long)0));
Type.setEnums(TypeEnums);
ADD_PROPERTY(HoleType,((long)0));

View File

@ -25,12 +25,12 @@
#define PARTDESIGN_Hole_H
#include <App/PropertyUnits.h>
#include "FeatureSubtractive.h"
#include "FeatureSketchBased.h"
namespace PartDesign
{
class PartDesignExport Hole : public Subtractive
class PartDesignExport Hole : public SketchBased
{
PROPERTY_HEADER(PartDesign::Hole);

View File

@ -30,8 +30,7 @@
#include "FeatureMultiTransform.h"
#include "FeatureScaled.h"
#include "FeatureAdditive.h"
#include "FeatureSubtractive.h"
#include "FeatureAddSub.h"
#include <Mod/Part/App/TopoShape.h>
#include <Base/Console.h>
@ -79,12 +78,12 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
Part::Feature* originalFeature = static_cast<Part::Feature*>(originals.front());
TopoDS_Shape original;
if (originalFeature->getTypeId().isDerivedFrom(PartDesign::Additive::getClassTypeId())) {
PartDesign::Additive* addFeature = static_cast<PartDesign::Additive*>(originalFeature);
original = addFeature->AddShape.getShape()._Shape;
} else if (originalFeature->getTypeId().isDerivedFrom(PartDesign::Subtractive::getClassTypeId())) {
PartDesign::Subtractive* subFeature = static_cast<PartDesign::Subtractive*>(originalFeature);
original = subFeature->SubShape.getShape()._Shape;
if (originalFeature->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
PartDesign::FeatureAddSub* addFeature = static_cast<PartDesign::FeatureAddSub*>(originalFeature);
if(addFeature->getAddSubType() == FeatureAddSub::Additive)
original = addFeature->AddSubShape.getShape()._Shape;
else
original = addFeature->AddSubShape.getShape()._Shape;
}
GProp_GProps props;

View File

@ -58,10 +58,12 @@ using namespace PartDesign;
const char* Pad::TypeEnums[]= {"Length","UpToLast","UpToFirst","UpToFace","TwoLengths",NULL};
PROPERTY_SOURCE(PartDesign::Pad, PartDesign::Additive)
PROPERTY_SOURCE(PartDesign::Pad, PartDesign::SketchBased)
Pad::Pad()
{
addSubType = FeatureAddSub::Additive;
ADD_PROPERTY_TYPE(Type,((long)0),"Pad",App::Prop_None,"Pad type");
Type.setEnums(TypeEnums);
ADD_PROPERTY_TYPE(Length,(100.0),"Pad",App::Prop_None,"Pad length");
@ -78,7 +80,7 @@ short Pad::mustExecute() const
Length2.isTouched() ||
UpToFace.isTouched())
return 1;
return Additive::mustExecute();
return SketchBased::mustExecute();
}
App::DocumentObjectExecReturn *Pad::execute(void)
@ -235,7 +237,9 @@ App::DocumentObjectExecReturn *Pad::execute(void)
// set the additive shape property for later usage in e.g. pattern
prism = refineShapeIfActive(prism);
this->AddShape.setValue(prism);
const char* name = AddSubShape.getName();
const char* name1 = this->getPropertyName(&AddSubShape);
this->AddSubShape.setValue(prism);
if (!base.IsNull()) {
// Let's call algorithm computing a fuse operation:

View File

@ -27,12 +27,13 @@
#include <App/PropertyUnits.h>
#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include "FeatureAdditive.h"
#include "FeatureSketchBased.h"
namespace PartDesign
{
class PartDesignExport Pad : public Additive
class PartDesignExport Pad : public SketchBased
{
PROPERTY_HEADER(PartDesign::Pad);

View File

@ -54,10 +54,12 @@ using namespace PartDesign;
const char* Pocket::TypeEnums[]= {"Length","ThroughAll","UpToFirst","UpToFace",NULL};
PROPERTY_SOURCE(PartDesign::Pocket, PartDesign::Subtractive)
PROPERTY_SOURCE(PartDesign::Pocket, PartDesign::SketchBased)
Pocket::Pocket()
{
addSubType = FeatureAddSub::Subtractive;
ADD_PROPERTY_TYPE(Type,((long)0),"Pocket",App::Prop_None,"Pocket type");
Type.setEnums(TypeEnums);
ADD_PROPERTY_TYPE(Length,(100.0),"Pocket",App::Prop_None,"Pocket length");
@ -72,7 +74,7 @@ short Pocket::mustExecute() const
Length.isTouched() ||
UpToFace.isTouched())
return 1;
return Subtractive::mustExecute();
return SketchBased::mustExecute();
}
App::DocumentObjectExecReturn *Pocket::execute(void)
@ -176,7 +178,8 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
if (!mkCut.IsDone())
return new App::DocumentObjectExecReturn("Pocket: Up to face: Could not get SubShape!");
// FIXME: In some cases this affects the Shape property: It is set to the same shape as the SubShape!!!!
this->SubShape.setValue(mkCut.Shape());
TopoDS_Shape result = refineShapeIfActive(mkCut.Shape());
this->AddSubShape.setValue(result);
this->Shape.setValue(prism);
} else {
TopoDS_Shape prism;
@ -187,7 +190,7 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
// set the subtractive shape property for later usage in e.g. pattern
prism = refineShapeIfActive(prism);
this->SubShape.setValue(prism);
this->AddSubShape.setValue(prism);
// Cut the SubShape out of the base feature
BRepAlgoAPI_Cut mkCut(base, prism);

View File

@ -25,12 +25,12 @@
#define PARTDESIGN_Pocket_H
#include <App/PropertyUnits.h>
#include "FeatureSubtractive.h"
#include "FeatureSketchBased.h"
namespace PartDesign
{
class PartDesignExport Pocket : public Subtractive
class PartDesignExport Pocket : public SketchBased
{
PROPERTY_HEADER(PartDesign::Pocket);

View File

@ -49,10 +49,12 @@ using namespace PartDesign;
namespace PartDesign {
PROPERTY_SOURCE(PartDesign::Revolution, PartDesign::Additive)
PROPERTY_SOURCE(PartDesign::Revolution, PartDesign::SketchBased)
Revolution::Revolution()
{
addSubType = FeatureAddSub::Additive;
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0,0.0,0.0)),"Revolution", App::Prop_ReadOnly, "Base");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0,1.0,0.0)),"Revolution", App::Prop_ReadOnly, "Axis");
ADD_PROPERTY_TYPE(Angle,(360.0),"Revolution", App::Prop_None, "Angle");
@ -67,7 +69,7 @@ short Revolution::mustExecute() const
Base.isTouched() ||
Angle.isTouched())
return 1;
return Additive::mustExecute();
return SketchBased::mustExecute();
}
App::DocumentObjectExecReturn *Revolution::execute(void)
@ -145,7 +147,7 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
TopoDS_Shape result = RevolMaker.Shape();
result = refineShapeIfActive(result);
// set the additive shape property for later usage in e.g. pattern
this->AddShape.setValue(result);
this->AddSubShape.setValue(result);
if (!base.IsNull()) {
// Let's call algorithm computing a fuse operation:

View File

@ -25,12 +25,12 @@
#define PARTDESIGN_Revolution_H
#include <App/PropertyUnits.h>
#include "FeatureAdditive.h"
#include "FeatureSketchBased.h"
namespace PartDesign
{
class PartDesignExport Revolution : public Additive
class PartDesignExport Revolution : public SketchBased
{
PROPERTY_HEADER(PartDesign::Revolution);

View File

@ -29,8 +29,7 @@
#endif
#include "FeatureScaled.h"
#include "FeatureAdditive.h"
#include "FeatureSubtractive.h"
#include "FeatureAddSub.h"
#include <Mod/Part/App/TopoShape.h>
#include <Base/Console.h>
@ -73,12 +72,12 @@ const std::list<gp_Trsf> Scaled::getTransformations(const std::vector<App::Docum
Part::Feature* originalFeature = static_cast<Part::Feature*>(originals.front());
TopoDS_Shape original;
if (originalFeature->getTypeId().isDerivedFrom(PartDesign::Additive::getClassTypeId())) {
PartDesign::Additive* addFeature = static_cast<PartDesign::Additive*>(originalFeature);
original = addFeature->AddShape.getShape()._Shape;
} else if (originalFeature->getTypeId().isDerivedFrom(PartDesign::Subtractive::getClassTypeId())) {
PartDesign::Subtractive* subFeature = static_cast<PartDesign::Subtractive*>(originalFeature);
original = subFeature->SubShape.getShape()._Shape;
if (originalFeature->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
PartDesign::FeatureAddSub* Feature = static_cast<PartDesign::FeatureAddSub*>(originalFeature);
if(Feature->getAddSubType() == FeatureAddSub::Additive)
original = Feature->AddSubShape.getShape()._Shape;
else
original = Feature->AddSubShape.getShape()._Shape;
}
GProp_GProps props;

View File

@ -99,7 +99,7 @@ public:
}
};
PROPERTY_SOURCE(PartDesign::SketchBased, PartDesign::Feature)
PROPERTY_SOURCE(PartDesign::SketchBased, PartDesign::FeatureAddSub)
SketchBased::SketchBased()
{
@ -116,7 +116,7 @@ short SketchBased::mustExecute() const
Reversed.isTouched() ||
UpToFace.isTouched())
return 1;
return PartDesign::Feature::mustExecute();
return PartDesign::FeatureAddSub::mustExecute();
}
void SketchBased::positionBySketch(void)
@ -265,7 +265,7 @@ void SketchBased::onChanged(const App::Property* prop)
this->Placement.setStatus(App::Property::ReadOnly, Sketch.getValue() != 0);
}
Feature::onChanged(prop);
FeatureAddSub::onChanged(prop);
}
bool SketchBased::isInside(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) const

View File

@ -26,7 +26,7 @@
#include <App/PropertyStandard.h>
#include <Mod/Part/App/Part2DObject.h>
#include "Feature.h"
#include "FeatureAddSub.h"
class TopoDS_Shape;
class TopoDS_Face;
@ -37,7 +37,7 @@ class gp_Lin;
namespace PartDesign
{
class PartDesignExport SketchBased : public PartDesign::Feature
class PartDesignExport SketchBased : public PartDesign::FeatureAddSub
{
PROPERTY_HEADER(PartDesign::SketchBased);

View File

@ -1,44 +0,0 @@
/***************************************************************************
* Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
#endif
#include "FeatureSubtractive.h"
namespace PartDesign {
PROPERTY_SOURCE(PartDesign::Subtractive,PartDesign::SketchBased)
Subtractive::Subtractive()
{
ADD_PROPERTY(SubShape,(TopoDS_Shape()));
}
}

View File

@ -1,50 +0,0 @@
/***************************************************************************
* Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef PARTDESIGN_FeatureSubtractive_H
#define PARTDESIGN_FeatureSubtractive_H
#include <App/PropertyStandard.h>
#include <Mod/Part/App/PropertyTopoShape.h>
#include "FeatureSketchBased.h"
namespace PartDesign
{
class PartDesignExport Subtractive : public SketchBased
{
PROPERTY_HEADER(PartDesign::Subtractive);
public:
Subtractive();
Part::PropertyPartShape SubShape;
protected:
};
} //namespace PartDesign
#endif // PARTDESIGN_FeatureSubtractive_H

View File

@ -39,11 +39,11 @@
#include "FeatureTransformed.h"
#include "FeatureMultiTransform.h"
#include "FeatureAdditive.h"
#include "FeatureSubtractive.h"
#include "FeatureAddSub.h"
#include "FeatureMirrored.h"
#include "FeatureLinearPattern.h"
#include "FeaturePolarPattern.h"
#include "FeatureSketchBased.h"
#include <Base/Console.h>
#include <Base/Exception.h>
@ -219,19 +219,15 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
TopoDS_Shape shape;
bool fuse;
if ((*o)->getTypeId().isDerivedFrom(PartDesign::Additive::getClassTypeId())) {
PartDesign::Additive* addFeature = static_cast<PartDesign::Additive*>(*o);
shape = addFeature->AddShape.getShape()._Shape;
if ((*o)->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
PartDesign::FeatureAddSub* feature = static_cast<PartDesign::FeatureAddSub*>(*o);
shape = feature->AddSubShape.getShape()._Shape;
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Shape of additive feature is empty");
fuse = true;
} else if ((*o)->getTypeId().isDerivedFrom(PartDesign::Subtractive::getClassTypeId())) {
PartDesign::Subtractive* subFeature = static_cast<PartDesign::Subtractive*>(*o);
shape = subFeature->SubShape.getShape()._Shape;
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Shape of subtractive feature is empty");
fuse = false;
} else {
fuse = (feature->getAddSubType() == FeatureAddSub::Additive) ? true : false;
}
else {
return new App::DocumentObjectExecReturn("Only additive and subtractive features can be transformed");
}

View File

@ -67,8 +67,6 @@
#include <Mod/PartDesign/App/Body.h>
#include <Mod/Sketcher/App/SketchObject.h>
#include <Mod/Sketcher/Gui/SketchOrientationDialog.h>
#include <Mod/PartDesign/App/FeatureAdditive.h>
#include <Mod/PartDesign/App/FeatureSubtractive.h>
#include <Mod/PartDesign/App/FeatureGroove.h>
#include <Mod/PartDesign/App/FeatureRevolution.h>
#include <Mod/PartDesign/App/FeatureTransformed.h>
@ -1559,14 +1557,10 @@ void prepareTransformed(Gui::Command* cmd, const std::string& which,
// Get a valid original from the user
// First check selections
std::vector<App::DocumentObject*> features = cmd->getSelection().getObjectsOfType(PartDesign::Additive::getClassTypeId());
std::vector<App::DocumentObject*> subtractive = cmd->getSelection().getObjectsOfType(PartDesign::Subtractive::getClassTypeId());
features.insert(features.end(), subtractive.begin(), subtractive.end());
std::vector<App::DocumentObject*> features = cmd->getSelection().getObjectsOfType(PartDesign::FeatureAddSub::getClassTypeId());
// Next create a list of all eligible objects
if (features.size() == 0) {
features = cmd->getDocument()->getObjectsOfType(PartDesign::Additive::getClassTypeId());
subtractive = cmd->getDocument()->getObjectsOfType(PartDesign::Subtractive::getClassTypeId());
features.insert(features.end(), subtractive.begin(), subtractive.end());
features = cmd->getDocument()->getObjectsOfType(PartDesign::FeatureAddSub::getClassTypeId());
// If there is more than one selected or eligible object, show dialog and let user pick one
if (features.size() > 1) {
std::vector<PartDesignGui::TaskFeaturePick::featureStatus> status;

View File

@ -45,9 +45,8 @@
#include <Gui/Selection.h>
#include <Gui/Command.h>
#include <Mod/PartDesign/App/FeatureTransformed.h>
#include <Mod/PartDesign/App/FeatureAdditive.h>
#include <Mod/PartDesign/App/FeatureSubtractive.h>
#include <Mod/PartDesign/App/Body.h>
#include <Mod/PartDesign/App/FeatureAddSub.h>
#include "ReferenceSelection.h"
using namespace PartDesignGui;
@ -105,8 +104,7 @@ const bool TaskTransformedParameters::originalSelected(const Gui::SelectionChang
PartDesign::Transformed* pcTransformed = getObject();
App::DocumentObject* selectedObject = pcTransformed->getDocument()->getObject(msg.pObjectName);
if (selectedObject->isDerivedFrom(PartDesign::Additive::getClassTypeId()) ||
selectedObject->isDerivedFrom(PartDesign::Subtractive::getClassTypeId())) {
if (selectedObject->isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
// Do the same like in TaskDlgTransformedParameters::accept() but without doCommand
std::vector<App::DocumentObject*> originals = pcTransformed->Originals.getValues();

View File

@ -103,13 +103,10 @@ void ViewProvider::unsetEdit(int ModNum)
void ViewProvider::updateData(const App::Property* prop)
{
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId() &&
strcmp(prop->getName(),"AddShape") == 0) {
return;
}
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId() &&
strcmp(prop->getName(),"SubShape") == 0) {
strcmp(prop->getName(),"AddSubShape") == 0) {
return;
}
inherited::updateData(prop);
}

View File

@ -56,9 +56,8 @@
#include <Gui/Application.h>
#include <Gui/Command.h>
#include <Mod/Part/App/TopoShape.h>
#include <Mod/PartDesign/App/FeatureAdditive.h>
#include <Mod/PartDesign/App/FeatureSubtractive.h>
#include <Mod/PartDesign/App/FeatureTransformed.h>
#include <Mod/PartDesign/App/FeatureAddSub.h>
using namespace PartDesignGui;
@ -209,12 +208,9 @@ void ViewProviderTransformed::recomputeFeature(void)
if (o->second.empty()) continue;
TopoDS_Shape shape;
if ((o->first)->getTypeId().isDerivedFrom(PartDesign::Additive::getClassTypeId())) {
PartDesign::Additive* addFeature = static_cast<PartDesign::Additive*>(o->first);
shape = addFeature->AddShape.getShape()._Shape;
} else if ((o->first)->getTypeId().isDerivedFrom(PartDesign::Subtractive::getClassTypeId())) {
PartDesign::Subtractive* subFeature = static_cast<PartDesign::Subtractive*>(o->first);
shape = subFeature->SubShape.getShape()._Shape;
if ((o->first)->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
PartDesign::FeatureAddSub* feature = static_cast<PartDesign::FeatureAddSub*>(o->first);
shape = feature->AddSubShape.getShape()._Shape;
}
if (shape.IsNull()) continue;