PD: modernize C++11
* use nullptr
This commit is contained in:
@@ -72,7 +72,7 @@ PyMOD_INIT_FUNC(_PartDesign)
|
||||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
PyObject* mod = PartDesign::initModule();
|
||||
|
||||
@@ -175,7 +175,7 @@ bool Body::isAfterInsertPoint(App::DocumentObject* feature) {
|
||||
|
||||
bool Body::isMemberOfMultiTransform(const App::DocumentObject* f)
|
||||
{
|
||||
if (f == NULL)
|
||||
if (f == nullptr)
|
||||
return false;
|
||||
|
||||
// ORIGINAL COMMENT:
|
||||
@@ -195,7 +195,7 @@ bool Body::isMemberOfMultiTransform(const App::DocumentObject* f)
|
||||
|
||||
bool Body::isSolidFeature(const App::DocumentObject* f)
|
||||
{
|
||||
if (f == NULL)
|
||||
if (f == nullptr)
|
||||
return false;
|
||||
|
||||
if (f->getTypeId().isDerivedFrom(PartDesign::Feature::getClassTypeId()) &&
|
||||
@@ -208,7 +208,7 @@ bool Body::isSolidFeature(const App::DocumentObject* f)
|
||||
|
||||
bool Body::isAllowed(const App::DocumentObject* f)
|
||||
{
|
||||
if (f == NULL)
|
||||
if (f == nullptr)
|
||||
return false;
|
||||
|
||||
// TODO: Should we introduce a PartDesign::FeaturePython class? This should then also return true for isSolidFeature()
|
||||
|
||||
@@ -126,13 +126,13 @@ public:
|
||||
* Return the solid feature before the given feature, or before the Tip feature
|
||||
* That is, sketches and datum features are skipped
|
||||
*/
|
||||
App::DocumentObject *getPrevSolidFeature(App::DocumentObject *start = NULL);
|
||||
App::DocumentObject *getPrevSolidFeature(App::DocumentObject *start = nullptr);
|
||||
|
||||
/**
|
||||
* Return the next solid feature after the given feature, or after the Tip feature
|
||||
* That is, sketches and datum features are skipped
|
||||
*/
|
||||
App::DocumentObject *getNextSolidFeature(App::DocumentObject* start = NULL);
|
||||
App::DocumentObject *getNextSolidFeature(App::DocumentObject* start = nullptr);
|
||||
|
||||
// a body is solid if it has features that are solid according to member isSolidFeature.
|
||||
bool isSolid(void);
|
||||
|
||||
@@ -42,7 +42,7 @@ std::string BodyPy::representation(void) const
|
||||
|
||||
PyObject *BodyPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int BodyPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
@@ -57,7 +57,7 @@ PyObject* BodyPy::insertObject(PyObject *args)
|
||||
PyObject* afterPy = Py_False;
|
||||
if (!PyArg_ParseTuple(args, "O!O|O!", &(App::DocumentObjectPy::Type), &featurePy,
|
||||
&targetPy, &PyBool_Type, &afterPy)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
App::DocumentObject* feature = static_cast<App::DocumentObjectPy*>(featurePy)->getDocumentObjectPtr();
|
||||
@@ -68,7 +68,7 @@ PyObject* BodyPy::insertObject(PyObject *args)
|
||||
|
||||
if (!Body::isAllowed(feature)) {
|
||||
PyErr_SetString(PyExc_SystemError, "Only PartDesign features, datum features and sketches can be inserted into a Body");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool after = PyObject_IsTrue(afterPy) ? true : false;
|
||||
@@ -79,7 +79,7 @@ PyObject* BodyPy::insertObject(PyObject *args)
|
||||
}
|
||||
catch (Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_SystemError, e.what());
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Py_Return;
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace Attacher;
|
||||
|
||||
// ============================================================================
|
||||
|
||||
const char* Line::ResizeModeEnums[]= {"Automatic","Manual",NULL};
|
||||
const char* Line::ResizeModeEnums[]= {"Automatic","Manual",nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Line, Part::Datum)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace Attacher;
|
||||
|
||||
// ============================================================================
|
||||
|
||||
const char* Plane::ResizeModeEnums[]= {"Automatic","Manual",NULL};
|
||||
const char* Plane::ResizeModeEnums[]= {"Automatic","Manual",nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Plane, Part::Datum)
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ PROPERTY_SOURCE(PartDesign::Feature,Part::Feature)
|
||||
|
||||
Feature::Feature()
|
||||
{
|
||||
ADD_PROPERTY(BaseFeature,(0));
|
||||
ADD_PROPERTY_TYPE(_Body,(0),"Base",(App::PropertyType)(
|
||||
ADD_PROPERTY(BaseFeature,(nullptr));
|
||||
ADD_PROPERTY_TYPE(_Body,(nullptr),"Base",(App::PropertyType)(
|
||||
App::Prop_ReadOnly|App::Prop_Hidden|App::Prop_Output|App::Prop_Transient),0);
|
||||
Placement.setStatus(App::Property::Hidden, true);
|
||||
BaseFeature.setStatus(App::Property::Hidden, true);
|
||||
@@ -197,7 +197,7 @@ bool Feature::isDatum(const App::DocumentObject* feature)
|
||||
gp_Pln Feature::makePlnFromPlane(const App::DocumentObject* obj)
|
||||
{
|
||||
const App::GeoFeature* plane = static_cast<const App::GeoFeature*>(obj);
|
||||
if (plane == NULL)
|
||||
if (plane == nullptr)
|
||||
throw Base::ValueError("Feature: Null object");
|
||||
|
||||
Base::Vector3d pos = plane->Placement.getValue().getPosition();
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace PartDesign {
|
||||
|
||||
PROPERTY_SOURCE_WITH_EXTENSIONS(PartDesign::Boolean, PartDesign::Feature)
|
||||
|
||||
const char* Boolean::TypeEnums[]= {"Fuse","Cut","Common",NULL};
|
||||
const char* Boolean::TypeEnums[]= {"Fuse","Cut","Common",nullptr};
|
||||
|
||||
Boolean::Boolean()
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ using namespace PartDesign;
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Chamfer, PartDesign::DressUp)
|
||||
|
||||
const char* ChamferTypeEnums[] = {"Equal distance", "Two distances", "Distance and Angle", NULL};
|
||||
const char* ChamferTypeEnums[] = {"Equal distance", "Two distances", "Distance and Angle", nullptr};
|
||||
const App::PropertyQuantityConstraint::Constraints Chamfer::floatSize = {0.0, FLT_MAX, 0.1};
|
||||
const App::PropertyAngle::Constraints Chamfer::floatAngle = {0.0, 180.0, 1.0};
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ Draft::Draft()
|
||||
{
|
||||
ADD_PROPERTY(Angle,(1.5));
|
||||
Angle.setConstraints(&floatAngle);
|
||||
ADD_PROPERTY_TYPE(NeutralPlane,(0),"Draft",(App::PropertyType)(App::Prop_None),"NeutralPlane");
|
||||
ADD_PROPERTY_TYPE(PullDirection,(0),"Draft",(App::PropertyType)(App::Prop_None),"PullDirection");
|
||||
ADD_PROPERTY_TYPE(NeutralPlane,(nullptr),"Draft",(App::PropertyType)(App::Prop_None),"NeutralPlane");
|
||||
ADD_PROPERTY_TYPE(PullDirection,(nullptr),"Draft",(App::PropertyType)(App::Prop_None),"PullDirection");
|
||||
ADD_PROPERTY(Reversed,(0));
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
|
||||
// Pull direction
|
||||
gp_Dir pullDirection;
|
||||
App::DocumentObject* refDirection = PullDirection.getValue();
|
||||
if (refDirection != NULL) {
|
||||
if (refDirection != nullptr) {
|
||||
if (refDirection->getTypeId().isDerivedFrom(PartDesign::Line::getClassTypeId())) {
|
||||
PartDesign::Line* line = static_cast<PartDesign::Line*>(refDirection);
|
||||
Base::Vector3d d = line->getDirection();
|
||||
@@ -155,7 +155,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
|
||||
// Neutral plane
|
||||
gp_Pln neutralPlane;
|
||||
App::DocumentObject* refPlane = NeutralPlane.getValue();
|
||||
if (refPlane == NULL) {
|
||||
if (refPlane == nullptr) {
|
||||
// Try to guess a neutral plane from the first selected face
|
||||
// Get edges of first selected face
|
||||
TopoDS_Shape face = TopShape.getSubShape(SubVals[0].c_str());
|
||||
@@ -229,7 +229,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
|
||||
|
||||
neutralPlane = adapt.Plane();
|
||||
} else if (ref.ShapeType() == TopAbs_EDGE) {
|
||||
if (refDirection != NULL) {
|
||||
if (refDirection != nullptr) {
|
||||
// Create neutral plane through edge normal to pull direction
|
||||
TopoDS_Edge refEdge = TopoDS::Edge(ref);
|
||||
if (refEdge.IsNull())
|
||||
@@ -255,7 +255,7 @@ App::DocumentObjectExecReturn *Draft::execute(void)
|
||||
neutralPlane.Transform(invObjLoc.Transformation());
|
||||
}
|
||||
|
||||
if (refDirection == NULL) {
|
||||
if (refDirection == nullptr) {
|
||||
// Choose pull direction normal to neutral plane
|
||||
pullDirection = neutralPlane.Axis().Direction();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ PROPERTY_SOURCE(PartDesign::DressUp, PartDesign::FeatureAddSub)
|
||||
|
||||
DressUp::DressUp()
|
||||
{
|
||||
ADD_PROPERTY(Base,(0));
|
||||
ADD_PROPERTY(Base,(nullptr));
|
||||
Placement.setStatus(App::Property::ReadOnly, true);
|
||||
|
||||
ADD_PROPERTY_TYPE(SupportTransform,(false),"Base", App::Prop_None,
|
||||
|
||||
@@ -56,7 +56,7 @@ Groove::Groove()
|
||||
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");
|
||||
Angle.setConstraints(&floatAngle);
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Groove",(App::PropertyType)(App::Prop_None),"Reference axis of Groove");
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis,(nullptr),"Groove",(App::PropertyType)(App::Prop_None),"Reference axis of Groove");
|
||||
}
|
||||
|
||||
short Groove::mustExecute() const
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
using namespace PartDesign;
|
||||
|
||||
const char* Helix::ModeEnums[] = { "pitch-height-angle", "pitch-turns-angle", "height-turns-angle", "height-turns-growth", NULL };
|
||||
const char* Helix::ModeEnums[] = { "pitch-height-angle", "pitch-turns-angle", "height-turns-angle", "height-turns-growth", nullptr };
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Helix, PartDesign::ProfileBased)
|
||||
|
||||
@@ -72,7 +72,7 @@ Helix::Helix()
|
||||
QT_TRANSLATE_NOOP("App::Property", "The center point of the helix' start; derived from the reference axis."));
|
||||
ADD_PROPERTY_TYPE(Axis, (Base::Vector3d(0.0, 1.0, 0.0)), group, App::Prop_ReadOnly,
|
||||
QT_TRANSLATE_NOOP("App::Property", "The helix' direction; derived from the reference axis."));
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis, (0), group, App::Prop_None,
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis, (nullptr), group, App::Prop_None,
|
||||
QT_TRANSLATE_NOOP("App::Property", "The reference axis of the helix."));
|
||||
ADD_PROPERTY_TYPE(Mode, (long(initialMode)), group, App::Prop_None,
|
||||
QT_TRANSLATE_NOOP("App::Property", "The helix input mode specifies which properties are set by the user.\n"
|
||||
|
||||
@@ -58,18 +58,18 @@ namespace PartDesign {
|
||||
|
||||
/* TRANSLATOR PartDesign::Hole */
|
||||
|
||||
const char* Hole::DepthTypeEnums[] = { "Dimension", "ThroughAll", /*, "UpToFirst", */ NULL };
|
||||
const char* Hole::ThreadDepthTypeEnums[] = { "Hole Depth", "Dimension", "Tapped (DIN76)", NULL };
|
||||
const char* Hole::ThreadTypeEnums[] = { "None", "ISOMetricProfile", "ISOMetricFineProfile", "UNC", "UNF", "UNEF", NULL};
|
||||
const char* Hole::ClearanceMetricEnums[] = { "Standard", "Close", "Wide", NULL};
|
||||
const char* Hole::ClearanceUTSEnums[] = { "Normal", "Close", "Loose", NULL };
|
||||
const char* Hole::DrillPointEnums[] = { "Flat", "Angled", NULL};
|
||||
const char* Hole::DepthTypeEnums[] = { "Dimension", "ThroughAll", /*, "UpToFirst", */ nullptr };
|
||||
const char* Hole::ThreadDepthTypeEnums[] = { "Hole Depth", "Dimension", "Tapped (DIN76)", nullptr };
|
||||
const char* Hole::ThreadTypeEnums[] = { "None", "ISOMetricProfile", "ISOMetricFineProfile", "UNC", "UNF", "UNEF", nullptr};
|
||||
const char* Hole::ClearanceMetricEnums[] = { "Standard", "Close", "Wide", nullptr};
|
||||
const char* Hole::ClearanceUTSEnums[] = { "Normal", "Close", "Loose", nullptr };
|
||||
const char* Hole::DrillPointEnums[] = { "Flat", "Angled", nullptr};
|
||||
|
||||
/* "None" profile */
|
||||
|
||||
const char* Hole::HoleCutType_None_Enums[] = { "None", "Counterbore", "Countersink", NULL };
|
||||
const char* Hole::ThreadSize_None_Enums[] = { "None", NULL };
|
||||
const char* Hole::ThreadClass_None_Enums[] = { "None", NULL };
|
||||
const char* Hole::HoleCutType_None_Enums[] = { "None", "Counterbore", "Countersink", nullptr };
|
||||
const char* Hole::ThreadSize_None_Enums[] = { "None", nullptr };
|
||||
const char* Hole::ThreadClass_None_Enums[] = { "None", nullptr };
|
||||
|
||||
/* Sources:
|
||||
http://www.engineeringtoolbox.com/metric-threads-d_777.html
|
||||
@@ -482,8 +482,8 @@ const char* Hole::ThreadSize_ISOmetric_Enums[] = { "M1", "M1.1", "M1.2", "M1
|
||||
"M12", "M14", "M16", "M18", "M20",
|
||||
"M22", "M24", "M27", "M30", "M33",
|
||||
"M36", "M39", "M42", "M45", "M48",
|
||||
"M52", "M56", "M60", "M64", "M68", NULL };
|
||||
const char* Hole::ThreadClass_ISOmetric_Enums[] = { "4G", "4H", "5G", "5H", "6G", "6H", "7G", "7H","8G", "8H", NULL };
|
||||
"M52", "M56", "M60", "M64", "M68", nullptr };
|
||||
const char* Hole::ThreadClass_ISOmetric_Enums[] = { "4G", "4H", "5G", "5H", "6G", "6H", "7G", "7H","8G", "8H", nullptr };
|
||||
|
||||
std::vector<std::string> Hole::HoleCutType_ISOmetricfine_Enums = { "None", "Counterbore", "Countersink", "Cheesehead (deprecated)", "Countersink socket screw (deprecated)", "Cap screw (deprecated)" };
|
||||
const char* Hole::ThreadSize_ISOmetricfine_Enums[] = {
|
||||
@@ -529,8 +529,8 @@ const char* Hole::ThreadSize_ISOmetricfine_Enums[] = {
|
||||
"M85x2.0", "M85x3.0", "M85x4.0", "M85x6.0",
|
||||
"M90x2.0", "M90x3.0", "M90x4.0", "M90x6.0",
|
||||
"M95x2.0", "M95x3.0", "M95x4.0", "M95x6.0",
|
||||
"M100x2.0", "M100x3.0", "M100x4.0", "M100x6.0", NULL };
|
||||
const char* Hole::ThreadClass_ISOmetricfine_Enums[] = { "4G", "4H", "5G", "5H", "6G", "6H", "7G", "7H","8G", "8H", NULL };
|
||||
"M100x2.0", "M100x3.0", "M100x4.0", "M100x6.0", nullptr };
|
||||
const char* Hole::ThreadClass_ISOmetricfine_Enums[] = { "4G", "4H", "5G", "5H", "6G", "6H", "7G", "7H","8G", "8H", nullptr };
|
||||
|
||||
// ISO 965-1:2013 ISO general purpose metric screw threads - Tolerances - Part 1
|
||||
// Table 1 - Fundamentral deviations for internal threads ...
|
||||
@@ -596,35 +596,35 @@ const double Hole::ThreadRunout[ThreadRunout_size][2] = {
|
||||
/* Details from https://en.wikipedia.org/wiki/Unified_Thread_Standard */
|
||||
|
||||
/* UTS coarse */
|
||||
const char* Hole::HoleCutType_UNC_Enums[] = { "None", "Counterbore", "Countersink", NULL};
|
||||
const char* Hole::HoleCutType_UNC_Enums[] = { "None", "Counterbore", "Countersink", nullptr};
|
||||
const char* Hole::ThreadSize_UNC_Enums[] = { "#1", "#2", "#3", "#4", "#5", "#6",
|
||||
"#8", "#10", "#12",
|
||||
"1/4", "5/16", "3/8", "7/16", "1/2", "9/16",
|
||||
"5/8", "3/4", "7/8", "1", "1 1/8", "1 1/4",
|
||||
"1 3/8", "1 1/2", "1 3/4", "2", "2 1/4",
|
||||
"2 1/2", "2 3/4", "3", "3 1/4", "3 1/2",
|
||||
"3 3/4", "4", NULL };
|
||||
const char* Hole::ThreadClass_UNC_Enums[] = { "1B", "2B", "3B", NULL };
|
||||
"3 3/4", "4", nullptr };
|
||||
const char* Hole::ThreadClass_UNC_Enums[] = { "1B", "2B", "3B", nullptr };
|
||||
|
||||
/* UTS fine */
|
||||
const char* Hole::HoleCutType_UNF_Enums[] = { "None", "Counterbore", "Countersink", NULL};
|
||||
const char* Hole::HoleCutType_UNF_Enums[] = { "None", "Counterbore", "Countersink", nullptr};
|
||||
const char* Hole::ThreadSize_UNF_Enums[] = { "#0", "#1", "#2", "#3", "#4", "#5", "#6",
|
||||
"#8", "#10", "#12",
|
||||
"1/4", "5/16", "3/8", "7/16", "1/2", "9/16",
|
||||
"5/8", "3/4", "7/8", "1", "1 1/8", "1 1/4",
|
||||
"1 3/8", "1 1/2", NULL };
|
||||
const char* Hole::ThreadClass_UNF_Enums[] = { "1B", "2B", "3B", NULL };
|
||||
"1 3/8", "1 1/2", nullptr };
|
||||
const char* Hole::ThreadClass_UNF_Enums[] = { "1B", "2B", "3B", nullptr };
|
||||
|
||||
/* UTS extrafine */
|
||||
const char* Hole::HoleCutType_UNEF_Enums[] = { "None", "Counterbore", "Countersink", NULL};
|
||||
const char* Hole::HoleCutType_UNEF_Enums[] = { "None", "Counterbore", "Countersink", nullptr};
|
||||
const char* Hole::ThreadSize_UNEF_Enums[] = { "#12", "1/4", "5/16", "3/8", "7/16", "1/2",
|
||||
"9/16", "5/8", "11/16", "3/4", "13/16", "7/8",
|
||||
"15/16", "1", "1 1/16", "1 1/8", "1 1/4",
|
||||
"1 5/16", "1 3/8", "1 7/16", "1 1/2", "1 9/16",
|
||||
"1 5/8", "1 11/16", NULL };
|
||||
const char* Hole::ThreadClass_UNEF_Enums[] = { "1B", "2B", "3B", NULL };
|
||||
"1 5/8", "1 11/16", nullptr };
|
||||
const char* Hole::ThreadClass_UNEF_Enums[] = { "1B", "2B", "3B", nullptr };
|
||||
|
||||
const char* Hole::ThreadDirectionEnums[] = { "Right", "Left", NULL};
|
||||
const char* Hole::ThreadDirectionEnums[] = { "Right", "Left", nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Hole, PartDesign::ProfileBased)
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ const App::PropertyIntegerConstraint::Constraints LinearPattern::intOccurrences
|
||||
|
||||
LinearPattern::LinearPattern()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Direction,(0),"LinearPattern",(App::PropertyType)(App::Prop_None),"Direction");
|
||||
ADD_PROPERTY_TYPE(Direction,(nullptr),"LinearPattern",(App::PropertyType)(App::Prop_None),"Direction");
|
||||
ADD_PROPERTY(Reversed,(0));
|
||||
ADD_PROPERTY(Length,(100.0));
|
||||
ADD_PROPERTY(Occurrences,(3));
|
||||
@@ -81,7 +81,7 @@ const std::list<gp_Trsf> LinearPattern::getTransformations(const std::vector<App
|
||||
bool reversed = Reversed.getValue();
|
||||
|
||||
App::DocumentObject* refObject = Direction.getValue();
|
||||
if (refObject == NULL)
|
||||
if (refObject == nullptr)
|
||||
throw Base::ValueError("No direction reference specified");
|
||||
|
||||
std::vector<std::string> subStrings = Direction.getSubValues();
|
||||
|
||||
@@ -50,8 +50,8 @@ PROPERTY_SOURCE(PartDesign::Loft, PartDesign::ProfileBased)
|
||||
|
||||
Loft::Loft()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Sections,(0),"Loft",App::Prop_None,"List of sections");
|
||||
Sections.setValue(0);
|
||||
ADD_PROPERTY_TYPE(Sections,(nullptr),"Loft",App::Prop_None,"List of sections");
|
||||
Sections.setValue(nullptr);
|
||||
ADD_PROPERTY_TYPE(Ruled,(false),"Loft",App::Prop_None,"Create ruled surface");
|
||||
ADD_PROPERTY_TYPE(Closed,(false),"Loft",App::Prop_None,"Close Last to First Profile");
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ PROPERTY_SOURCE(PartDesign::Mirrored, PartDesign::Transformed)
|
||||
|
||||
Mirrored::Mirrored()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(MirrorPlane,(0),"Mirrored",(App::PropertyType)(App::Prop_None),"Mirror plane");
|
||||
ADD_PROPERTY_TYPE(MirrorPlane,(nullptr),"Mirrored",(App::PropertyType)(App::Prop_None),"Mirror plane");
|
||||
}
|
||||
|
||||
short Mirrored::mustExecute() const
|
||||
@@ -60,7 +60,7 @@ short Mirrored::mustExecute() const
|
||||
const std::list<gp_Trsf> Mirrored::getTransformations(const std::vector<App::DocumentObject*>)
|
||||
{
|
||||
App::DocumentObject* refObject = MirrorPlane.getValue();
|
||||
if (refObject == NULL)
|
||||
if (refObject == nullptr)
|
||||
throw Base::ValueError("No mirror plane reference specified");
|
||||
std::vector<std::string> subStrings = MirrorPlane.getSubValues();
|
||||
if (subStrings.empty())
|
||||
|
||||
@@ -42,7 +42,7 @@ PROPERTY_SOURCE(PartDesign::MultiTransform, PartDesign::Transformed)
|
||||
|
||||
MultiTransform::MultiTransform()
|
||||
{
|
||||
ADD_PROPERTY(Transformations,(0));
|
||||
ADD_PROPERTY(Transformations,(nullptr));
|
||||
Transformations.setSize(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
using namespace PartDesign;
|
||||
|
||||
const char* Pad::TypeEnums[]= {"Length", "UpToLast", "UpToFirst", "UpToFace", "TwoLengths", NULL};
|
||||
const char* Pad::TypeEnums[]= {"Length", "UpToLast", "UpToFirst", "UpToFace", "TwoLengths", nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Pad, PartDesign::FeatureExtrude)
|
||||
|
||||
@@ -52,9 +52,9 @@ Pad::Pad()
|
||||
ADD_PROPERTY_TYPE(Length2, (10.0), "Pad", App::Prop_None, "Pad length in 2nd direction");
|
||||
ADD_PROPERTY_TYPE(UseCustomVector, (false), "Pad", App::Prop_None, "Use custom vector for pad direction");
|
||||
ADD_PROPERTY_TYPE(Direction, (Base::Vector3d(1.0, 1.0, 1.0)), "Pad", App::Prop_None, "Pad direction vector");
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis, (0), "Pad", App::Prop_None, "Reference axis of direction");
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis, (nullptr), "Pad", App::Prop_None, "Reference axis of direction");
|
||||
ADD_PROPERTY_TYPE(AlongSketchNormal, (true), "Pad", App::Prop_None, "Measure pad length along the sketch normal direction");
|
||||
ADD_PROPERTY_TYPE(UpToFace, (0), "Pad", App::Prop_None, "Face where pad will end");
|
||||
ADD_PROPERTY_TYPE(UpToFace, (nullptr), "Pad", App::Prop_None, "Face where pad will end");
|
||||
ADD_PROPERTY_TYPE(Offset, (0.0), "Pad", App::Prop_None, "Offset from face in which pad will end");
|
||||
Offset.setConstraints(&signedLengthConstraint);
|
||||
ADD_PROPERTY_TYPE(TaperAngle, (0.0), "Pad", App::Prop_None, "Taper angle");
|
||||
|
||||
@@ -57,21 +57,21 @@
|
||||
|
||||
using namespace PartDesign;
|
||||
|
||||
const char* Pipe::TypeEnums[] = {"FullPath", "UpToFace", NULL};
|
||||
const char* Pipe::TransitionEnums[] = {"Transformed", "Right corner", "Round corner", NULL};
|
||||
const char* Pipe::ModeEnums[] = {"Standard", "Fixed", "Frenet", "Auxiliary", "Binormal", NULL};
|
||||
const char* Pipe::TransformEnums[] = {"Constant", "Multisection", "Linear", "S-shape", "Interpolation", NULL};
|
||||
const char* Pipe::TypeEnums[] = {"FullPath", "UpToFace", nullptr};
|
||||
const char* Pipe::TransitionEnums[] = {"Transformed", "Right corner", "Round corner", nullptr};
|
||||
const char* Pipe::ModeEnums[] = {"Standard", "Fixed", "Frenet", "Auxiliary", "Binormal", nullptr};
|
||||
const char* Pipe::TransformEnums[] = {"Constant", "Multisection", "Linear", "S-shape", "Interpolation", nullptr};
|
||||
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Pipe, PartDesign::ProfileBased)
|
||||
|
||||
Pipe::Pipe()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Sections,(0),"Sweep",App::Prop_None,"List of sections");
|
||||
Sections.setValue(0);
|
||||
ADD_PROPERTY_TYPE(Spine,(0),"Sweep",App::Prop_None,"Path to sweep along");
|
||||
ADD_PROPERTY_TYPE(Sections,(nullptr),"Sweep",App::Prop_None,"List of sections");
|
||||
Sections.setValue(nullptr);
|
||||
ADD_PROPERTY_TYPE(Spine,(nullptr),"Sweep",App::Prop_None,"Path to sweep along");
|
||||
ADD_PROPERTY_TYPE(SpineTangent,(false),"Sweep",App::Prop_None,"Include tangent edges into path");
|
||||
ADD_PROPERTY_TYPE(AuxillerySpine,(0),"Sweep",App::Prop_None,"Secondary path to orient sweep");
|
||||
ADD_PROPERTY_TYPE(AuxillerySpine,(nullptr),"Sweep",App::Prop_None,"Secondary path to orient sweep");
|
||||
ADD_PROPERTY_TYPE(AuxillerySpineTangent,(false),"Sweep",App::Prop_None,"Include tangent edges into secondary path");
|
||||
ADD_PROPERTY_TYPE(AuxilleryCurvelinear, (true), "Sweep", App::Prop_None,"Calculate normal between equidistant points on both spines");
|
||||
ADD_PROPERTY_TYPE(Mode,(long(0)),"Sweep",App::Prop_None,"Profile mode");
|
||||
|
||||
@@ -39,7 +39,7 @@ using namespace PartDesign;
|
||||
|
||||
/* TRANSLATOR PartDesign::Pocket */
|
||||
|
||||
const char* Pocket::TypeEnums[]= {"Length","ThroughAll","UpToFirst","UpToFace","TwoLengths",NULL};
|
||||
const char* Pocket::TypeEnums[]= {"Length","ThroughAll","UpToFirst","UpToFace","TwoLengths",nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Pocket, PartDesign::FeatureExtrude)
|
||||
|
||||
@@ -53,9 +53,9 @@ Pocket::Pocket()
|
||||
ADD_PROPERTY_TYPE(Length2, (5.0), "Pocket", App::Prop_None, "Pocket length in 2nd direction");
|
||||
ADD_PROPERTY_TYPE(UseCustomVector, (false), "Pocket", App::Prop_None, "Use custom vector for pocket direction");
|
||||
ADD_PROPERTY_TYPE(Direction, (Base::Vector3d(1.0, 1.0, 1.0)), "Pocket", App::Prop_None, "Pocket direction vector");
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis, (0), "Pocket", App::Prop_None, "Reference axis of direction");
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis, (nullptr), "Pocket", App::Prop_None, "Reference axis of direction");
|
||||
ADD_PROPERTY_TYPE(AlongSketchNormal, (true), "Pocket", App::Prop_None, "Measure pocket length along the sketch normal direction");
|
||||
ADD_PROPERTY_TYPE(UpToFace, (0), "Pocket", App::Prop_None, "Face where pocket will end");
|
||||
ADD_PROPERTY_TYPE(UpToFace, (nullptr), "Pocket", App::Prop_None, "Face where pocket will end");
|
||||
ADD_PROPERTY_TYPE(Offset, (0.0), "Pocket", App::Prop_None, "Offset from face in which pocket will end");
|
||||
Offset.setConstraints(&signedLengthConstraint);
|
||||
ADD_PROPERTY_TYPE(TaperAngle, (0.0), "Pocket", App::Prop_None, "Taper angle");
|
||||
@@ -73,7 +73,7 @@ App::DocumentObjectExecReturn *Pocket::execute()
|
||||
// Handle legacy features, these typically have Type set to 3 (previously NULL, now UpToFace),
|
||||
// empty FaceName (because it didn't exist) and a value for Length
|
||||
if (std::string(Type.getValueAsString()) == "UpToFace" &&
|
||||
(UpToFace.getValue() == NULL && Length.getValue() > Precision::Confusion()))
|
||||
(UpToFace.getValue() == nullptr && Length.getValue() > Precision::Confusion()))
|
||||
Type.setValue("Length");
|
||||
|
||||
// Validate parameters
|
||||
|
||||
@@ -53,7 +53,7 @@ const App::PropertyAngle::Constraints PolarPattern::floatAngle = { Base::toDegre
|
||||
|
||||
PolarPattern::PolarPattern()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Axis, (0), "PolarPattern", (App::PropertyType)(App::Prop_None), "Direction");
|
||||
ADD_PROPERTY_TYPE(Axis, (nullptr), "PolarPattern", (App::PropertyType)(App::Prop_None), "Direction");
|
||||
ADD_PROPERTY(Reversed, (0));
|
||||
ADD_PROPERTY(Angle, (360.0));
|
||||
Angle.setConstraints(&floatAngle);
|
||||
@@ -98,7 +98,7 @@ const std::list<gp_Trsf> PolarPattern::getTransformations(const std::vector<App:
|
||||
offset = radians / (occurrences - 1);
|
||||
|
||||
App::DocumentObject* refObject = Axis.getValue();
|
||||
if (refObject == NULL)
|
||||
if (refObject == nullptr)
|
||||
throw Base::ValueError("No axis reference specified");
|
||||
std::vector<std::string> subStrings = Axis.getSubValues();
|
||||
if (subStrings.empty())
|
||||
|
||||
@@ -40,7 +40,7 @@ std::string FeaturePy::representation(void) const
|
||||
|
||||
PyObject *FeaturePy::getCustomAttributes(const char* ) const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int FeaturePy::setCustomAttributes(const char* , PyObject *)
|
||||
|
||||
@@ -55,7 +55,7 @@ Revolution::Revolution()
|
||||
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");
|
||||
Angle.setConstraints(&floatAngle);
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Revolution",(App::Prop_None),"Reference axis of revolution");
|
||||
ADD_PROPERTY_TYPE(ReferenceAxis,(nullptr),"Revolution",(App::Prop_None),"Reference axis of revolution");
|
||||
}
|
||||
|
||||
short Revolution::mustExecute() const
|
||||
|
||||
@@ -69,10 +69,10 @@ PROPERTY_SOURCE(PartDesign::ProfileBased, PartDesign::FeatureAddSub)
|
||||
|
||||
ProfileBased::ProfileBased()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Profile, (0), "SketchBased", App::Prop_None, "Reference to sketch");
|
||||
ADD_PROPERTY_TYPE(Profile, (nullptr), "SketchBased", App::Prop_None, "Reference to sketch");
|
||||
ADD_PROPERTY_TYPE(Midplane, (0), "SketchBased", App::Prop_None, "Extrude symmetric to sketch face");
|
||||
ADD_PROPERTY_TYPE(Reversed, (0), "SketchBased", App::Prop_None, "Reverse extrusion direction");
|
||||
ADD_PROPERTY_TYPE(UpToFace, (0), "SketchBased", (App::PropertyType)(App::Prop_None), "Face where feature will end");
|
||||
ADD_PROPERTY_TYPE(UpToFace, (nullptr), "SketchBased", (App::PropertyType)(App::Prop_None), "Face where feature will end");
|
||||
ADD_PROPERTY_TYPE(AllowMultiFace, (false), "SketchBased", App::Prop_None, "Allow multiple faces in profile");
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ TopoDS_Shape ProfileBased::getVerifiedFace(bool silent) const {
|
||||
if (!shape.hasSubShape(TopAbs_WIRE))
|
||||
shape = shape.makeWires();
|
||||
if (shape.hasSubShape(TopAbs_WIRE))
|
||||
shape = shape.makeFace(0, "Part::FaceMakerBullseye");
|
||||
shape = shape.makeFace(nullptr, "Part::FaceMakerBullseye");
|
||||
else
|
||||
err = "Cannot make face from profile";
|
||||
}
|
||||
@@ -389,7 +389,7 @@ void ProfileBased::onChanged(const App::Property* prop)
|
||||
{
|
||||
if (prop == &Profile) {
|
||||
// if attached to a sketch then mark it as read-only
|
||||
this->Placement.setStatus(App::Property::ReadOnly, Profile.getValue() != 0);
|
||||
this->Placement.setStatus(App::Property::ReadOnly, Profile.getValue() != nullptr);
|
||||
}
|
||||
|
||||
FeatureAddSub::onChanged(prop);
|
||||
@@ -402,7 +402,7 @@ void ProfileBased::getUpToFaceFromLinkSub(TopoDS_Face& upToFace,
|
||||
App::DocumentObject* ref = refFace.getValue();
|
||||
std::vector<std::string> subStrings = refFace.getSubValues();
|
||||
|
||||
if (ref == NULL)
|
||||
if (ref == nullptr)
|
||||
throw Base::ValueError("SketchBased: Up to face: No face selected");
|
||||
|
||||
if (ref->getTypeId().isDerivedFrom(App::Plane::getClassTypeId())) {
|
||||
@@ -1141,11 +1141,11 @@ void ProfileBased::handleChangedPropertyName(Base::XMLReader & reader, const cha
|
||||
|
||||
if (name != "") {
|
||||
App::Document* document = getDocument();
|
||||
DocumentObject* object = document ? document->getObject(name.c_str()) : 0;
|
||||
DocumentObject* object = document ? document->getObject(name.c_str()) : nullptr;
|
||||
Profile.setValue(object, vec);
|
||||
}
|
||||
else {
|
||||
Profile.setValue(0, vec);
|
||||
Profile.setValue(nullptr, vec);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
|
||||
using namespace PartDesign;
|
||||
|
||||
const char* PartDesign::Thickness::ModeEnums[] = {"Skin","Pipe", "RectoVerso",NULL};
|
||||
const char* PartDesign::Thickness::JoinEnums[] = {"Arc", "Intersection",NULL};
|
||||
const char* PartDesign::Thickness::ModeEnums[] = {"Skin","Pipe", "RectoVerso",nullptr};
|
||||
const char* PartDesign::Thickness::JoinEnums[] = {"Arc", "Intersection",nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Thickness, PartDesign::DressUp)
|
||||
|
||||
|
||||
@@ -53,13 +53,13 @@ using namespace PartDesign;
|
||||
|
||||
namespace PartDesign {
|
||||
|
||||
const char* Transformed::OverlapEnums[] = { "Detect", "Overlap mode", "Non-overlap mode", NULL};
|
||||
const char* Transformed::OverlapEnums[] = { "Detect", "Overlap mode", "Non-overlap mode", nullptr};
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Transformed, PartDesign::Feature)
|
||||
|
||||
Transformed::Transformed()
|
||||
{
|
||||
ADD_PROPERTY(Originals,(0));
|
||||
ADD_PROPERTY(Originals,(nullptr));
|
||||
Originals.setSize(0);
|
||||
Placement.setStatus(App::Property::ReadOnly, true);
|
||||
|
||||
@@ -90,7 +90,7 @@ Part::Feature* Transformed::getBaseObject(bool silent) const {
|
||||
const char* err = nullptr;
|
||||
const std::vector<App::DocumentObject*> & originals = Originals.getValues();
|
||||
// NOTE: may be here supposed to be last origin but in order to keep the old behaviour keep here first
|
||||
App::DocumentObject* firstOriginal = originals.empty() ? NULL : originals.front();
|
||||
App::DocumentObject* firstOriginal = originals.empty() ? nullptr : originals.front();
|
||||
if (firstOriginal) {
|
||||
if(firstOriginal->isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||
rv = static_cast<Part::Feature*>(firstOriginal);
|
||||
@@ -115,7 +115,7 @@ App::DocumentObject* Transformed::getSketchObject() const
|
||||
return (static_cast<PartDesign::ProfileBased*>(originals.front()))->getVerifiedSketch(true);
|
||||
}
|
||||
else if (!originals.empty() && originals.front()->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else if (this->getTypeId().isDerivedFrom(LinearPattern::getClassTypeId())) {
|
||||
// if Originals is empty then try the linear pattern's Direction property
|
||||
@@ -133,7 +133,7 @@ App::DocumentObject* Transformed::getSketchObject() const
|
||||
return pattern->MirrorPlane.getValue();
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ PROPERTY_SOURCE(PartDesign::ShapeBinder, Part::Feature)
|
||||
|
||||
ShapeBinder::ShapeBinder()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Support, (0,0), "",(App::PropertyType)(App::Prop_None),"Support of the geometry");
|
||||
ADD_PROPERTY_TYPE(Support, (nullptr,nullptr), "",(App::PropertyType)(App::Prop_None),"Support of the geometry");
|
||||
Placement.setStatus(App::Property::Hidden, true);
|
||||
ADD_PROPERTY_TYPE(TraceSupport, (false), "", App::Prop_None, "Trace support shape");
|
||||
}
|
||||
@@ -303,13 +303,13 @@ PROPERTY_SOURCE(PartDesign::SubShapeBinder, Part::Feature)
|
||||
|
||||
SubShapeBinder::SubShapeBinder()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Support, (0), "",(App::PropertyType)(App::Prop_None), "Support of the geometry");
|
||||
ADD_PROPERTY_TYPE(Support, (nullptr), "",(App::PropertyType)(App::Prop_None), "Support of the geometry");
|
||||
Support.setStatus(App::Property::ReadOnly, true);
|
||||
ADD_PROPERTY_TYPE(Fuse, (false), "Base",App::Prop_None,"Fuse solids from bound shapes");
|
||||
ADD_PROPERTY_TYPE(MakeFace, (true), "Base",App::Prop_None,"Create face using wires from bound shapes");
|
||||
ADD_PROPERTY_TYPE(Offset, (0.0), "Offsetting", App::Prop_None, "2D offset face or wires, 0.0 = no offset");
|
||||
ADD_PROPERTY_TYPE(OffsetJoinType, ((long)0), "Offsetting", App::Prop_None, "Arcs, Tangent, Intersection");
|
||||
static const char*JoinTypeEnum[] = {"Arcs", "Tangent", "Intersection", 0};
|
||||
static const char*JoinTypeEnum[] = {"Arcs", "Tangent", "Intersection", nullptr};
|
||||
OffsetJoinType.setEnums(JoinTypeEnum);
|
||||
ADD_PROPERTY_TYPE(OffsetFill, (false),"Offsetting", App::Prop_None, "True = make face between original wire and offset.");
|
||||
ADD_PROPERTY_TYPE(OffsetOpenResult, (false), "Offsetting", App::Prop_None, "False = make closed offset from open wire.");
|
||||
@@ -324,14 +324,14 @@ SubShapeBinder::SubShapeBinder()
|
||||
"Enable partial loading, which disables auto loading of external document for"
|
||||
"external bound object.");
|
||||
PartialLoad.setStatus(App::Property::PartialTrigger,true);
|
||||
static const char *BindModeEnum[] = {"Synchronized", "Frozen", "Detached", 0};
|
||||
static const char *BindModeEnum[] = {"Synchronized", "Frozen", "Detached", nullptr};
|
||||
BindMode.setEnums(BindModeEnum);
|
||||
|
||||
ADD_PROPERTY_TYPE(Context, (0), "Base", App::Prop_Hidden,
|
||||
ADD_PROPERTY_TYPE(Context, (nullptr), "Base", App::Prop_Hidden,
|
||||
"Stores the context of this binder. It is used for monitoring and auto updating\n"
|
||||
"the relative placement of the bound shape");
|
||||
|
||||
static const char *BindCopyOnChangeEnum[] = {"Disabled", "Enabled", "Mutated", 0};
|
||||
static const char *BindCopyOnChangeEnum[] = {"Disabled", "Enabled", "Mutated", nullptr};
|
||||
BindCopyOnChange.setEnums(BindCopyOnChangeEnum);
|
||||
ADD_PROPERTY_TYPE(BindCopyOnChange, ((long)0), "Base", App::Prop_None,
|
||||
"Disabled: disable copy on change.\n"
|
||||
@@ -351,7 +351,7 @@ SubShapeBinder::SubShapeBinder()
|
||||
App::Prop_Hidden|App::Prop_ReadOnly), "");
|
||||
|
||||
_CopiedLink.setScope(App::LinkScope::Hidden);
|
||||
ADD_PROPERTY_TYPE(_CopiedLink,(0),"Base",(App::PropertyType)(
|
||||
ADD_PROPERTY_TYPE(_CopiedLink,(nullptr),"Base",(App::PropertyType)(
|
||||
App::Prop_Hidden|App::Prop_ReadOnly|App::Prop_NoPersist), "");
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ void SubShapeBinder::clearCopiedObjects() {
|
||||
if(obj)
|
||||
obj->getDocument()->removeObject(obj->getNameInDocument());
|
||||
}
|
||||
_CopiedLink.setValue(0);
|
||||
_CopiedLink.setValue(nullptr);
|
||||
}
|
||||
|
||||
void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
@@ -477,7 +477,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
auto parent = Context.getValue();
|
||||
std::string parentSub = Context.getSubName(false);
|
||||
if(!Relative.getValue())
|
||||
parent = 0;
|
||||
parent = nullptr;
|
||||
else {
|
||||
if(parent && parent->getSubObject(parentSub.c_str())==this) {
|
||||
auto parents = parent->getParents();
|
||||
@@ -486,7 +486,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
parentSub = parents.begin()->second + parentSub;
|
||||
}
|
||||
} else
|
||||
parent = 0;
|
||||
parent = nullptr;
|
||||
if(!parent && parentSub.empty()) {
|
||||
auto parents = getParents();
|
||||
if(parents.size()) {
|
||||
@@ -518,7 +518,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
}
|
||||
}else{
|
||||
Base::Matrix4D mat;
|
||||
auto sobj = resolved->getSubObject(resolvedSub.c_str(),0,&mat);
|
||||
auto sobj = resolved->getSubObject(resolvedSub.c_str(),nullptr,&mat);
|
||||
if(sobj!=this) {
|
||||
FC_LOG(getFullName() << " skip invalid parent " << resolved->getFullName()
|
||||
<< '.' << resolvedSub);
|
||||
@@ -546,7 +546,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
if(init)
|
||||
continue;
|
||||
|
||||
App::DocumentObject *copied = 0;
|
||||
App::DocumentObject *copied = nullptr;
|
||||
|
||||
if(BindCopyOnChange.getValue() == 2 && Support.getSubListValues().size()==1) {
|
||||
if(_CopiedObjs.size())
|
||||
@@ -559,7 +559,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
clearCopiedObjects();
|
||||
|
||||
auto tmpDoc = App::GetApplication().newDocument(
|
||||
"_tmp_binder", 0, false, true);
|
||||
"_tmp_binder", nullptr, false, true);
|
||||
auto objs = tmpDoc->copyObject({obj},true,true);
|
||||
if(objs.size()) {
|
||||
for(auto it=objs.rbegin(); it!=objs.rend(); ++it)
|
||||
@@ -737,7 +737,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
{
|
||||
result = result.makeWires();
|
||||
try {
|
||||
result = result.makeFace(0);
|
||||
result = result.makeFace(nullptr);
|
||||
}catch(...){}
|
||||
}
|
||||
|
||||
@@ -762,7 +762,7 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
|
||||
if(!prop || !prop->isDerivedFrom(App::PropertyMatrix::getClassTypeId())) {
|
||||
if(prop)
|
||||
removeDynamicProperty(name);
|
||||
prop = addDynamicProperty("App::PropertyMatrix",name,"Cache",0,0,false,true);
|
||||
prop = addDynamicProperty("App::PropertyMatrix",name,"Cache",nullptr,0,false,true);
|
||||
}
|
||||
caches.erase(name);
|
||||
static_cast<App::PropertyMatrix*>(prop)->setValue(v.second);
|
||||
@@ -822,13 +822,13 @@ void SubShapeBinder::onChanged(const App::Property *prop) {
|
||||
if(Support.getSubListValues().size()) {
|
||||
update();
|
||||
if(BindMode.getValue() == 2)
|
||||
Support.setValue(0);
|
||||
Support.setValue(nullptr);
|
||||
}
|
||||
}else if(prop == &BindCopyOnChange) {
|
||||
setupCopyOnChange();
|
||||
}else if(prop == &BindMode) {
|
||||
if(BindMode.getValue() == 2)
|
||||
Support.setValue(0);
|
||||
Support.setValue(nullptr);
|
||||
else if(BindMode.getValue() == 0)
|
||||
update();
|
||||
checkPropertyStatus();
|
||||
@@ -869,7 +869,7 @@ void SubShapeBinder::setLinks(std::map<App::DocumentObject *, std::vector<std::s
|
||||
{
|
||||
if(values.empty()) {
|
||||
if(reset) {
|
||||
Support.setValue(0);
|
||||
Support.setValue(nullptr);
|
||||
Shape.setValue(Part::TopoShape());
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -118,8 +118,8 @@ public:
|
||||
|
||||
virtual bool canLinkProperties() const override {return false;}
|
||||
|
||||
virtual App::DocumentObject *getSubObject(const char *subname, PyObject **pyObj=0,
|
||||
Base::Matrix4D *mat=0, bool transform=true, int depth=0) const override;
|
||||
virtual App::DocumentObject *getSubObject(const char *subname, PyObject **pyObj=nullptr,
|
||||
Base::Matrix4D *mat=nullptr, bool transform=true, int depth=0) const override;
|
||||
|
||||
protected:
|
||||
virtual App::DocumentObjectExecReturn* execute(void) override;
|
||||
@@ -141,7 +141,7 @@ protected:
|
||||
|
||||
typedef boost::signals2::scoped_connection Connection;
|
||||
Connection connRecomputedObj;
|
||||
App::Document *contextDoc = 0;
|
||||
App::Document *contextDoc = nullptr;
|
||||
|
||||
std::vector<Connection> copyOnChangeConns;
|
||||
bool hasCopyOnChange = true;
|
||||
|
||||
@@ -102,7 +102,7 @@ PyMOD_INIT_FUNC(PartDesignGui)
|
||||
{
|
||||
if (!Gui::Application::Instance) {
|
||||
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -111,7 +111,7 @@ PyMOD_INIT_FUNC(PartDesignGui)
|
||||
}
|
||||
catch(const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
PyMOD_Return(0);
|
||||
PyMOD_Return(nullptr);
|
||||
}
|
||||
|
||||
PyObject* mod = PartDesignGui::initModule();
|
||||
|
||||
@@ -298,7 +298,7 @@ void CmdPartDesignShapeBinder::activated(int iMsg)
|
||||
PartDesignGui::setEdit(support.getValue());
|
||||
} else {
|
||||
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */true);
|
||||
if (pcActiveBody == 0)
|
||||
if (pcActiveBody == nullptr)
|
||||
return;
|
||||
|
||||
std::string FeatName = getUniqueObjectName("ShapeBinder",pcActiveBody);
|
||||
@@ -350,7 +350,7 @@ void CmdPartDesignSubShapeBinder::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
|
||||
App::DocumentObject *parent = 0;
|
||||
App::DocumentObject *parent = nullptr;
|
||||
std::string parentSub;
|
||||
std::map<App::DocumentObject *, std::vector<std::string> > values;
|
||||
for (auto &sel : Gui::Selection().getCompleteSelection(0)) {
|
||||
@@ -383,7 +383,7 @@ void CmdPartDesignSubShapeBinder::activated(int iMsg)
|
||||
values = std::move(links);
|
||||
}
|
||||
|
||||
PartDesign::SubShapeBinder *binder = 0;
|
||||
PartDesign::SubShapeBinder *binder = nullptr;
|
||||
try {
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Create SubShapeBinder"));
|
||||
if (pcActiveBody) {
|
||||
@@ -2537,14 +2537,14 @@ void CmdPartDesignMultiTransform::activated(int iMsg)
|
||||
PartDesign::Transformed* trFeat = static_cast<PartDesign::Transformed*>(features.front());
|
||||
|
||||
// Move the insert point back one feature
|
||||
App::DocumentObject* oldTip = 0;
|
||||
App::DocumentObject* prevFeature = 0;
|
||||
App::DocumentObject* oldTip = nullptr;
|
||||
App::DocumentObject* prevFeature = nullptr;
|
||||
if (pcActiveBody){
|
||||
oldTip = pcActiveBody->Tip.getValue();
|
||||
prevFeature = pcActiveBody->getPrevSolidFeature(trFeat);
|
||||
}
|
||||
Gui::Selection().clearSelection();
|
||||
if (prevFeature != NULL)
|
||||
if (prevFeature != nullptr)
|
||||
Gui::Selection().addSelection(prevFeature->getDocument()->getName(), prevFeature->getNameInDocument());
|
||||
|
||||
openCommand(QT_TRANSLATE_NOOP("Command", "Convert to MultiTransform feature"));
|
||||
@@ -2594,7 +2594,7 @@ void CmdPartDesignMultiTransform::activated(int iMsg)
|
||||
|
||||
// Make sure the user isn't presented with an empty screen because no transformations are defined yet...
|
||||
App::DocumentObject* prevSolid = pcActiveBody->Tip.getValue();
|
||||
if (prevSolid != NULL) {
|
||||
if (prevSolid != nullptr) {
|
||||
Part::Feature* feat = static_cast<Part::Feature*>(prevSolid);
|
||||
FCMD_OBJ_CMD(Feat,"Shape = "<<getObjectCmd(feat)<<".Shape");
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ App::Part* assertActivePart () {
|
||||
rcCmdMgr.runCommandByName("Std_Part");
|
||||
rv = Gui::Application::Instance->activeView()->getActiveObject<App::Part *> ( PARTKEY );
|
||||
if ( !rv ) {
|
||||
QMessageBox::critical ( 0, QObject::tr( "Part creation failed" ),
|
||||
QMessageBox::critical ( nullptr, QObject::tr( "Part creation failed" ),
|
||||
QObject::tr( "Failed to create a part object." ) );
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void CmdPartDesignBody::activated(int iMsg)
|
||||
}
|
||||
else {
|
||||
partOfBaseFeature = App::Part::getPartOfObject(baseFeature);
|
||||
if (partOfBaseFeature != 0 && partOfBaseFeature != actPart){
|
||||
if (partOfBaseFeature != nullptr && partOfBaseFeature != actPart){
|
||||
//prevent cross-part mess
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Bad base feature"),
|
||||
QObject::tr("Base feature (%1) belongs to other part.")
|
||||
@@ -336,7 +336,7 @@ void CmdPartDesignMigrate::activated(int iMsg)
|
||||
doc, PartDesignGui::Workflow::Modern );
|
||||
} else {
|
||||
// Huh? nothing to migrate?
|
||||
QMessageBox::warning ( 0, QObject::tr ( "Nothing to migrate" ),
|
||||
QMessageBox::warning ( nullptr, QObject::tr ( "Nothing to migrate" ),
|
||||
QObject::tr ( "No PartDesign features found that don't belong to a body."
|
||||
" Nothing to migrate." ) );
|
||||
}
|
||||
@@ -548,16 +548,16 @@ void CmdPartDesignMoveTip::activated(int iMsg)
|
||||
}
|
||||
|
||||
if (!selFeature) {
|
||||
QMessageBox::warning (0, QObject::tr( "Selection error" ),
|
||||
QMessageBox::warning (nullptr, QObject::tr( "Selection error" ),
|
||||
QObject::tr( "Select exactly one PartDesign feature or a body." ) );
|
||||
return;
|
||||
} else if (!body) {
|
||||
QMessageBox::warning (0, QObject::tr( "Selection error" ),
|
||||
QMessageBox::warning (nullptr, QObject::tr( "Selection error" ),
|
||||
QObject::tr( "Couldn't determine a body for the selected feature '%s'.", selFeature->Label.getValue() ) );
|
||||
return;
|
||||
} else if ( !selFeature->isDerivedFrom(PartDesign::Feature::getClassTypeId () ) &&
|
||||
selFeature != body && body->BaseFeature.getValue() != selFeature ) {
|
||||
QMessageBox::warning (0, QObject::tr( "Selection error" ),
|
||||
QMessageBox::warning (nullptr, QObject::tr( "Selection error" ),
|
||||
QObject::tr( "Only a solid feature can be the tip of a body." ) );
|
||||
return;
|
||||
}
|
||||
@@ -844,14 +844,14 @@ void CmdPartDesignMoveFeatureInTree::activated(int iMsg)
|
||||
break;
|
||||
}
|
||||
if ( bodyBase == feat) {
|
||||
QMessageBox::warning (0, QObject::tr( "Selection error" ),
|
||||
QMessageBox::warning (nullptr, QObject::tr( "Selection error" ),
|
||||
QObject::tr( "Impossible to move the base feature of a body." ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!body || ! allFeaturesFromSameBody) {
|
||||
QMessageBox::warning (0, QObject::tr( "Selection error" ),
|
||||
QMessageBox::warning (nullptr, QObject::tr( "Selection error" ),
|
||||
QObject::tr( "Select one or more features from the same body." ) );
|
||||
return;
|
||||
}
|
||||
@@ -929,7 +929,7 @@ void CmdPartDesignMoveFeatureInTree::activated(int iMsg)
|
||||
}
|
||||
}
|
||||
if(failed) {
|
||||
QMessageBox::critical (0, QObject::tr( "Dependency violation" ),
|
||||
QMessageBox::critical (nullptr, QObject::tr( "Dependency violation" ),
|
||||
QObject::tr( "Early feature must not depend on later feature.\n\n")
|
||||
+ QString::fromUtf8(ss.str().c_str()));
|
||||
abortCommand();
|
||||
|
||||
@@ -340,7 +340,7 @@ bool getReferencedSelection(const App::DocumentObject* thisObj, const Gui::Selec
|
||||
|
||||
QString getRefStr(const App::DocumentObject* obj, const std::vector<std::string>& sub)
|
||||
{
|
||||
if (obj == NULL)
|
||||
if (obj == nullptr)
|
||||
return QString::fromLatin1("");
|
||||
|
||||
if (PartDesign::Feature::isDatum(obj))
|
||||
@@ -354,7 +354,7 @@ QString getRefStr(const App::DocumentObject* obj, const std::vector<std::string>
|
||||
|
||||
std::string buildLinkSubPythonStr(const App::DocumentObject* obj, const std::vector<std::string>& subs)
|
||||
{
|
||||
if ( obj == NULL)
|
||||
if ( obj == nullptr)
|
||||
return "None";
|
||||
|
||||
std::string result("[");
|
||||
@@ -369,7 +369,7 @@ std::string buildLinkSubPythonStr(const App::DocumentObject* obj, const std::vec
|
||||
std::string buildLinkSingleSubPythonStr(const App::DocumentObject* obj,
|
||||
const std::vector<std::string>& subs)
|
||||
{
|
||||
if (obj == NULL)
|
||||
if (obj == nullptr)
|
||||
return "None";
|
||||
|
||||
if (PartDesign::Feature::isDatum(obj))
|
||||
@@ -387,7 +387,7 @@ std::string buildLinkListPythonStr(const std::vector<App::DocumentObject*> & obj
|
||||
std::string result("[");
|
||||
|
||||
for (std::vector<App::DocumentObject*>::const_iterator o = objs.begin(); o != objs.end(); o++)
|
||||
result += Gui::Command::getObjectCmd(*o,0,",");
|
||||
result += Gui::Command::getObjectCmd(*o,nullptr,",");
|
||||
result += "]";
|
||||
|
||||
return result;
|
||||
|
||||
@@ -71,7 +71,7 @@ class NoDependentsSelection : public Gui::SelectionFilterGate
|
||||
|
||||
public:
|
||||
NoDependentsSelection(const App::DocumentObject* support_)
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0), support(support_)
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)nullptr), support(support_)
|
||||
{
|
||||
}
|
||||
/**
|
||||
@@ -87,7 +87,7 @@ class CombineSelectionFilterGates: public Gui::SelectionFilterGate
|
||||
|
||||
public:
|
||||
CombineSelectionFilterGates(std::unique_ptr<Gui::SelectionFilterGate> &filter1_, std::unique_ptr<Gui::SelectionFilterGate> &filter2_)
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0), filter1(std::move(filter1_)), filter2(std::move(filter2_))
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)nullptr), filter1(std::move(filter1_)), filter2(std::move(filter2_))
|
||||
{
|
||||
}
|
||||
bool allow(App::Document* pDoc, App::DocumentObject* pObj, const char* sSubName) override;
|
||||
|
||||
@@ -107,13 +107,13 @@ void TaskBooleanParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
if (body.empty())
|
||||
return;
|
||||
App::DocumentObject* pcBody = pcBoolean->getDocument()->getObject(body.c_str());
|
||||
if (pcBody == NULL)
|
||||
if (pcBody == nullptr)
|
||||
return;
|
||||
|
||||
// if the selected object is not a body then get the body it is part of
|
||||
if (!pcBody->getTypeId().isDerivedFrom(PartDesign::Body::getClassTypeId())) {
|
||||
pcBody = PartDesign::Body::findBodyOf(pcBody);
|
||||
if (pcBody == NULL)
|
||||
if (pcBody == nullptr)
|
||||
return;
|
||||
body = pcBody->getNameInDocument();
|
||||
}
|
||||
@@ -139,18 +139,18 @@ void TaskBooleanParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
// Hide base body and added body
|
||||
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(pcBoolean->BaseFeature.getValue()));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->hide();
|
||||
vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(bodies.front()));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->hide();
|
||||
BooleanView->show();
|
||||
} else {
|
||||
// Hide newly added body
|
||||
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(bodies.back()));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->hide();
|
||||
}
|
||||
}
|
||||
@@ -179,12 +179,12 @@ void TaskBooleanParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
// Make bodies visible again
|
||||
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(pcBody));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->show();
|
||||
if (bodies.size() == 0) {
|
||||
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(pcBoolean->BaseFeature.getValue()));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->show();
|
||||
BooleanView->hide();
|
||||
}
|
||||
@@ -212,7 +212,7 @@ void TaskBooleanParameters::onButtonBodyRemove(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if (doc != NULL)
|
||||
if (doc != nullptr)
|
||||
BooleanView->show();
|
||||
selectionMode = bodyRemove;
|
||||
Gui::Selection().clearSelection();
|
||||
@@ -273,12 +273,12 @@ void TaskBooleanParameters::onBodyDeleted(void)
|
||||
// Make bodies visible again
|
||||
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(body));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->show();
|
||||
if (bodies.empty()) {
|
||||
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(
|
||||
Gui::Application::Instance->getViewProvider(pcBoolean->BaseFeature.getValue()));
|
||||
if (vp != NULL)
|
||||
if (vp != nullptr)
|
||||
vp->show();
|
||||
BooleanView->hide();
|
||||
}
|
||||
@@ -303,7 +303,7 @@ void TaskBooleanParameters::exitSelectionMode()
|
||||
{
|
||||
selectionMode = none;
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if (doc != NULL)
|
||||
if (doc != nullptr)
|
||||
doc->setShow(BooleanView->getObject()->getNameInDocument());
|
||||
}
|
||||
|
||||
@@ -378,8 +378,8 @@ bool TaskDlgBooleanParameters::reject()
|
||||
// Show the bodies again
|
||||
PartDesign::Boolean* obj = static_cast<PartDesign::Boolean*>(BooleanView->getObject());
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if (doc != NULL) {
|
||||
if (obj->BaseFeature.getValue() != NULL) {
|
||||
if (doc != nullptr) {
|
||||
if (obj->BaseFeature.getValue() != nullptr) {
|
||||
doc->setShow(obj->BaseFeature.getValue()->getNameInDocument());
|
||||
std::vector<App::DocumentObject*> bodies = obj->Group.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++)
|
||||
|
||||
@@ -49,7 +49,7 @@ class TaskBooleanParameters : public Gui::TaskView::TaskBox, public Gui::Selecti
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskBooleanParameters(ViewProviderBoolean *BooleanView, QWidget *parent=0);
|
||||
TaskBooleanParameters(ViewProviderBoolean *BooleanView, QWidget *parent=nullptr);
|
||||
~TaskBooleanParameters();
|
||||
|
||||
const std::vector<std::string> getBodies(void) const;
|
||||
|
||||
@@ -39,7 +39,7 @@ class TaskChamferParameters : public TaskDressUpParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskChamferParameters(ViewProviderDressUp *DressUpView, QWidget *parent=0);
|
||||
TaskChamferParameters(ViewProviderDressUp *DressUpView, QWidget *parent=nullptr);
|
||||
~TaskChamferParameters();
|
||||
|
||||
virtual void apply();
|
||||
|
||||
@@ -50,7 +50,7 @@ class TaskDatumParameters : public PartGui::TaskAttacher
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *parent = 0);
|
||||
TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *parent = nullptr);
|
||||
~TaskDatumParameters();
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class TaskDraftParameters : public TaskDressUpParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskDraftParameters(ViewProviderDressUp *DressUpView, QWidget *parent=0);
|
||||
TaskDraftParameters(ViewProviderDressUp *DressUpView, QWidget *parent=nullptr);
|
||||
~TaskDraftParameters();
|
||||
|
||||
double getAngle(void) const;
|
||||
|
||||
@@ -59,7 +59,7 @@ TaskDressUpParameters::TaskDressUpParameters(ViewProviderDressUp *DressUpView, b
|
||||
QString::fromLatin1((DressUpView->featureName() + " parameters").c_str()),
|
||||
true,
|
||||
parent)
|
||||
, proxy(0)
|
||||
, proxy(nullptr)
|
||||
, DressUpView(DressUpView)
|
||||
, deleteAction(nullptr)
|
||||
, addAllEdgesAction(nullptr)
|
||||
@@ -410,7 +410,7 @@ void TaskDressUpParameters::exitSelectionMode()
|
||||
|
||||
TaskDlgDressUpParameters::TaskDlgDressUpParameters(ViewProviderDressUp *DressUpView)
|
||||
: TaskDlgFeatureParameters(DressUpView)
|
||||
, parameter(0)
|
||||
, parameter(nullptr)
|
||||
{
|
||||
assert(DressUpView);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class TaskDressUpParameters : public Gui::TaskView::TaskBox, public Gui::Selecti
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskDressUpParameters(ViewProviderDressUp *DressUpView, bool selectEdges, bool selectFaces, QWidget* parent = 0);
|
||||
TaskDressUpParameters(ViewProviderDressUp *DressUpView, bool selectEdges, bool selectFaces, QWidget* parent = nullptr);
|
||||
virtual ~TaskDressUpParameters();
|
||||
|
||||
const std::vector<std::string> getReferences(void) const;
|
||||
|
||||
@@ -362,7 +362,7 @@ void TaskExtrudeParameters::fillDirectionCombo()
|
||||
addAxisToCombo(pcFeat->Profile.getValue(), std::string(), tr("Face normal"), false);
|
||||
|
||||
// add the other entries
|
||||
addAxisToCombo(0, std::string(), tr("Select reference..."));
|
||||
addAxisToCombo(nullptr, std::string(), tr("Select reference..."));
|
||||
|
||||
// we start with the sketch normal as proposal for the custom direction
|
||||
if (pcSketch)
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
TaskFeaturePick(std::vector<App::DocumentObject*> &objects,
|
||||
const std::vector<featureStatus> &status,
|
||||
bool singleFeatureSelect,
|
||||
QWidget *parent = 0);
|
||||
QWidget *parent = nullptr);
|
||||
|
||||
~TaskFeaturePick();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class TaskFilletParameters : public TaskDressUpParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskFilletParameters(ViewProviderDressUp *DressUpView, QWidget *parent=0);
|
||||
TaskFilletParameters(ViewProviderDressUp *DressUpView, QWidget *parent=nullptr);
|
||||
~TaskFilletParameters();
|
||||
|
||||
virtual void apply();
|
||||
|
||||
@@ -194,7 +194,7 @@ void TaskHelixParameters::fillAxisCombo(bool forceRefill)
|
||||
addPartAxes();
|
||||
|
||||
//add "Select reference"
|
||||
addAxisToCombo(0, std::string(), tr("Select reference..."));
|
||||
addAxisToCombo(nullptr, std::string(), tr("Select reference..."));
|
||||
}
|
||||
|
||||
//add current link, if not in list and highlight it
|
||||
@@ -457,7 +457,7 @@ void TaskHelixParameters::onAxisChanged(int num)
|
||||
oldRefName = oldSubRefAxis.front();
|
||||
|
||||
App::PropertyLinkSub& lnk = *(axesInList[num]);
|
||||
if (lnk.getValue() == 0) {
|
||||
if (lnk.getValue() == nullptr) {
|
||||
// enter reference selection mode
|
||||
TaskSketchBasedParameters::onSelectReference(
|
||||
AllowSelection::EDGE |
|
||||
@@ -543,7 +543,7 @@ TaskHelixParameters::~TaskHelixParameters()
|
||||
{
|
||||
try {
|
||||
//hide the parts coordinate system axis for selection
|
||||
PartDesign::Body* body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : 0;
|
||||
PartDesign::Body* body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : nullptr;
|
||||
if (body) {
|
||||
App::Origin* origin = body->getOrigin();
|
||||
ViewProviderOrigin* vpOrigin;
|
||||
@@ -584,7 +584,7 @@ void TaskHelixParameters::getReferenceAxis(App::DocumentObject*& obj, std::vecto
|
||||
|
||||
int num = ui->axis->currentIndex();
|
||||
const App::PropertyLinkSub& lnk = *(axesInList.at(num));
|
||||
if (lnk.getValue() == 0) {
|
||||
if (lnk.getValue() == nullptr) {
|
||||
throw Base::RuntimeError("Still in reference selection mode; reference wasn't selected yet");
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -47,7 +47,7 @@ class TaskHelixParameters : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskHelixParameters(ViewProviderHelix* HelixView, QWidget* parent = 0);
|
||||
TaskHelixParameters(ViewProviderHelix* HelixView, QWidget* parent = nullptr);
|
||||
~TaskHelixParameters();
|
||||
|
||||
virtual void apply() override;
|
||||
|
||||
@@ -52,7 +52,7 @@ class TaskHoleParameters : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskHoleParameters(ViewProviderHole *HoleView, QWidget *parent = 0);
|
||||
TaskHoleParameters(ViewProviderHole *HoleView, QWidget *parent = nullptr);
|
||||
~TaskHoleParameters();
|
||||
|
||||
void apply() override;
|
||||
|
||||
@@ -141,7 +141,7 @@ void TaskLinearPatternParameters::setupUI()
|
||||
// Fill data into dialog elements
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); ++i) {
|
||||
const App::DocumentObject* obj = *i;
|
||||
if (obj != NULL) {
|
||||
if (obj != nullptr) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
item->setData(Qt::UserRole, QString::fromLatin1(obj->getNameInDocument()));
|
||||
@@ -318,7 +318,7 @@ void TaskLinearPatternParameters::onDirectionChanged(int /*num*/)
|
||||
return;
|
||||
PartDesign::LinearPattern* pcLinearPattern = static_cast<PartDesign::LinearPattern*>(getObject());
|
||||
try{
|
||||
if(dirLinks.getCurrentLink().getValue() == 0){
|
||||
if(dirLinks.getCurrentLink().getValue() == nullptr){
|
||||
// enter reference selection mode
|
||||
hideObject();
|
||||
showBase();
|
||||
@@ -330,7 +330,7 @@ void TaskLinearPatternParameters::onDirectionChanged(int /*num*/)
|
||||
pcLinearPattern->Direction.Paste(dirLinks.getCurrentLink());
|
||||
}
|
||||
} catch (Base::Exception &e) {
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromLatin1(e.what()));
|
||||
QMessageBox::warning(nullptr,tr("Error"),QString::fromLatin1(e.what()));
|
||||
}
|
||||
|
||||
kickUpdateViewTimer();
|
||||
|
||||
@@ -50,7 +50,7 @@ class TaskLinearPatternParameters : public TaskTransformedParameters
|
||||
|
||||
public:
|
||||
/// Constructor for task with ViewProvider
|
||||
TaskLinearPatternParameters(ViewProviderTransformed *TransformedView, QWidget *parent = 0);
|
||||
TaskLinearPatternParameters(ViewProviderTransformed *TransformedView, QWidget *parent = nullptr);
|
||||
/// Constructor for task with parent task (MultiTransform mode)
|
||||
TaskLinearPatternParameters(TaskMultiTransformParameters *parentTask, QLayout *layout);
|
||||
virtual ~TaskLinearPatternParameters();
|
||||
|
||||
@@ -48,7 +48,7 @@ class TaskLoftParameters : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskLoftParameters(ViewProviderLoft *LoftView, bool newObj=false, QWidget *parent = 0);
|
||||
TaskLoftParameters(ViewProviderLoft *LoftView, bool newObj=false, QWidget *parent = nullptr);
|
||||
~TaskLoftParameters();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -122,7 +122,7 @@ void TaskMirroredParameters::setupUI()
|
||||
// Fill data into dialog elements
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); ++i) {
|
||||
const App::DocumentObject* obj = *i;
|
||||
if (obj != NULL) {
|
||||
if (obj != nullptr) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
item->setData(Qt::UserRole, QString::fromLatin1(obj->getNameInDocument()));
|
||||
@@ -139,7 +139,7 @@ void TaskMirroredParameters::setupUI()
|
||||
this->fillPlanesCombo(planeLinks,static_cast<Part::Part2DObject*>(sketch));
|
||||
}
|
||||
else {
|
||||
this->fillPlanesCombo(planeLinks, NULL);
|
||||
this->fillPlanesCombo(planeLinks, nullptr);
|
||||
}
|
||||
|
||||
//show the parts coordinate system planes for selection
|
||||
@@ -230,7 +230,7 @@ void TaskMirroredParameters::onPlaneChanged(int /*num*/)
|
||||
setupTransaction();
|
||||
PartDesign::Mirrored* pcMirrored = static_cast<PartDesign::Mirrored*>(getObject());
|
||||
try{
|
||||
if(planeLinks.getCurrentLink().getValue() == 0){
|
||||
if(planeLinks.getCurrentLink().getValue() == nullptr){
|
||||
// enter reference selection mode
|
||||
hideObject();
|
||||
showBase();
|
||||
@@ -242,7 +242,7 @@ void TaskMirroredParameters::onPlaneChanged(int /*num*/)
|
||||
pcMirrored->MirrorPlane.Paste(planeLinks.getCurrentLink());
|
||||
}
|
||||
} catch (Base::Exception &e) {
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromLatin1(e.what()));
|
||||
QMessageBox::warning(nullptr,tr("Error"),QString::fromLatin1(e.what()));
|
||||
}
|
||||
|
||||
recomputeFeature();
|
||||
|
||||
@@ -49,7 +49,7 @@ class TaskMirroredParameters : public TaskTransformedParameters
|
||||
|
||||
public:
|
||||
/// Constructor for task with ViewProvider
|
||||
TaskMirroredParameters(ViewProviderTransformed *TransformedView, QWidget *parent = 0);
|
||||
TaskMirroredParameters(ViewProviderTransformed *TransformedView, QWidget *parent = nullptr);
|
||||
/// Constructor for task with parent task (MultiTransform mode)
|
||||
TaskMirroredParameters(TaskMultiTransformParameters *parentTask, QLayout *layout);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ TaskMultiTransformParameters::TaskMultiTransformParameters(ViewProviderTransform
|
||||
// Fill data into dialog elements
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); i++) {
|
||||
const App::DocumentObject* obj = *i;
|
||||
if (obj != NULL) {
|
||||
if (obj != nullptr) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
item->setData(Qt::UserRole, QString::fromLatin1(obj->getNameInDocument()));
|
||||
@@ -215,9 +215,9 @@ void TaskMultiTransformParameters::closeSubTask()
|
||||
{
|
||||
if (subTask) {
|
||||
exitSelectionMode();
|
||||
disconnect(ui->checkBoxUpdateView, 0, subTask, 0);
|
||||
disconnect(ui->checkBoxUpdateView, nullptr, subTask, nullptr);
|
||||
delete subTask;
|
||||
subTask = NULL;
|
||||
subTask = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class TaskMultiTransformParameters : public TaskTransformedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskMultiTransformParameters(ViewProviderTransformed *TransformedView,QWidget *parent = 0);
|
||||
TaskMultiTransformParameters(ViewProviderTransformed *TransformedView,QWidget *parent = nullptr);
|
||||
virtual ~TaskMultiTransformParameters();
|
||||
|
||||
const std::vector<App::DocumentObject*> getTransformFeatures(void) const;
|
||||
|
||||
@@ -45,7 +45,7 @@ class TaskPadParameters : public TaskExtrudeParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPadParameters(ViewProviderPad *PadView, QWidget *parent = 0, bool newObj=false);
|
||||
TaskPadParameters(ViewProviderPad *PadView, QWidget *parent = nullptr, bool newObj=false);
|
||||
~TaskPadParameters();
|
||||
|
||||
virtual void apply() override;
|
||||
|
||||
@@ -82,7 +82,7 @@ class TaskPipeParameters : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPipeParameters(ViewProviderPipe *PipeView, bool newObj=false, QWidget *parent = 0);
|
||||
TaskPipeParameters(ViewProviderPipe *PipeView, bool newObj=false, QWidget *parent = nullptr);
|
||||
~TaskPipeParameters();
|
||||
|
||||
bool accept();
|
||||
@@ -123,7 +123,7 @@ class TaskPipeOrientation : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPipeOrientation(ViewProviderPipe *PipeView, bool newObj=false, QWidget *parent = 0);
|
||||
TaskPipeOrientation(ViewProviderPipe *PipeView, bool newObj=false, QWidget *parent = nullptr);
|
||||
virtual ~TaskPipeOrientation();
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class TaskPipeScaling : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPipeScaling(ViewProviderPipe *PipeView,bool newObj=false,QWidget *parent = 0);
|
||||
TaskPipeScaling(ViewProviderPipe *PipeView,bool newObj=false,QWidget *parent = nullptr);
|
||||
virtual ~TaskPipeScaling();
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -45,7 +45,7 @@ class TaskPocketParameters : public TaskExtrudeParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskPocketParameters(ViewProviderPocket *PocketView, QWidget *parent = 0, bool newObj=false);
|
||||
TaskPocketParameters(ViewProviderPocket *PocketView, QWidget *parent = nullptr, bool newObj=false);
|
||||
~TaskPocketParameters();
|
||||
|
||||
virtual void apply() override;
|
||||
|
||||
@@ -148,7 +148,7 @@ void TaskPolarPatternParameters::setupUI()
|
||||
// Fill data into dialog elements
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); ++i) {
|
||||
const App::DocumentObject* obj = *i;
|
||||
if (obj != NULL) {
|
||||
if (obj != nullptr) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
item->setData(Qt::UserRole, QString::fromLatin1(obj->getNameInDocument()));
|
||||
@@ -173,7 +173,7 @@ void TaskPolarPatternParameters::setupUI()
|
||||
this->fillAxisCombo(axesLinks, static_cast<Part::Part2DObject*>(sketch));
|
||||
}
|
||||
else {
|
||||
this->fillAxisCombo(axesLinks, NULL);
|
||||
this->fillAxisCombo(axesLinks, nullptr);
|
||||
}
|
||||
|
||||
//show the parts coordinate system axis for selection
|
||||
@@ -318,7 +318,7 @@ void TaskPolarPatternParameters::onAxisChanged(int /*num*/)
|
||||
PartDesign::PolarPattern* pcPolarPattern = static_cast<PartDesign::PolarPattern*>(getObject());
|
||||
|
||||
try{
|
||||
if(axesLinks.getCurrentLink().getValue() == 0){
|
||||
if(axesLinks.getCurrentLink().getValue() == nullptr){
|
||||
// enter reference selection mode
|
||||
hideObject();
|
||||
showBase();
|
||||
@@ -330,7 +330,7 @@ void TaskPolarPatternParameters::onAxisChanged(int /*num*/)
|
||||
pcPolarPattern->Axis.Paste(axesLinks.getCurrentLink());
|
||||
}
|
||||
} catch (Base::Exception &e) {
|
||||
QMessageBox::warning(0,tr("Error"),QString::fromLatin1(e.what()));
|
||||
QMessageBox::warning(nullptr,tr("Error"),QString::fromLatin1(e.what()));
|
||||
}
|
||||
|
||||
kickUpdateViewTimer();
|
||||
|
||||
@@ -50,7 +50,7 @@ class TaskPolarPatternParameters : public TaskTransformedParameters
|
||||
|
||||
public:
|
||||
/// Constructor for task with ViewProvider
|
||||
TaskPolarPatternParameters(ViewProviderTransformed *TransformedView, QWidget *parent = 0);
|
||||
TaskPolarPatternParameters(ViewProviderTransformed *TransformedView, QWidget *parent = nullptr);
|
||||
/// Constructor for task with parent task (MultiTransform mode)
|
||||
TaskPolarPatternParameters(TaskMultiTransformParameters *parentTask, QLayout *layout);
|
||||
virtual ~TaskPolarPatternParameters();
|
||||
|
||||
@@ -334,7 +334,7 @@ TaskBoxPrimitives::~TaskBoxPrimitives()
|
||||
{
|
||||
//hide the parts coordinate system axis for selection
|
||||
try {
|
||||
PartDesign::Body * body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : 0;
|
||||
PartDesign::Body * body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : nullptr;
|
||||
if (body) {
|
||||
App::Origin *origin = body->getOrigin();
|
||||
Gui::ViewProviderOrigin* vpOrigin;
|
||||
|
||||
@@ -48,7 +48,7 @@ class TaskBoxPrimitives : public Gui::TaskView::TaskBox,
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent = 0);
|
||||
TaskBoxPrimitives(ViewProviderPrimitive* vp, QWidget* parent = nullptr);
|
||||
~TaskBoxPrimitives();
|
||||
|
||||
bool setPrimitive(App::DocumentObject *);
|
||||
|
||||
@@ -145,7 +145,7 @@ void TaskRevolutionParameters::fillAxisCombo(bool forceRefill)
|
||||
}
|
||||
|
||||
//add "Select reference"
|
||||
addAxisToCombo(0,std::string(),tr("Select reference..."));
|
||||
addAxisToCombo(nullptr,std::string(),tr("Select reference..."));
|
||||
}//endif forceRefill
|
||||
|
||||
//add current link, if not in list
|
||||
@@ -248,7 +248,7 @@ void TaskRevolutionParameters::onAxisChanged(int num)
|
||||
oldRefName = oldSubRefAxis.front();
|
||||
|
||||
App::PropertyLinkSub &lnk = *(axesInList[num]);
|
||||
if (lnk.getValue() == 0) {
|
||||
if (lnk.getValue() == nullptr) {
|
||||
// enter reference selection mode
|
||||
TaskSketchBasedParameters::onSelectReference(AllowSelection::EDGE |
|
||||
AllowSelection::PLANAR |
|
||||
@@ -317,7 +317,7 @@ void TaskRevolutionParameters::getReferenceAxis(App::DocumentObject*& obj, std::
|
||||
|
||||
int num = ui->axis->currentIndex();
|
||||
const App::PropertyLinkSub &lnk = *(axesInList[num]);
|
||||
if (lnk.getValue() == 0) {
|
||||
if (lnk.getValue() == nullptr) {
|
||||
throw Base::RuntimeError("Still in reference selection mode; reference wasn't selected yet");
|
||||
} else {
|
||||
PartDesign::ProfileBased* pcRevolution = static_cast<PartDesign::ProfileBased*>(vp->getObject());
|
||||
@@ -344,7 +344,7 @@ TaskRevolutionParameters::~TaskRevolutionParameters()
|
||||
{
|
||||
try {
|
||||
//hide the parts coordinate system axis for selection
|
||||
PartDesign::Body * body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : 0;
|
||||
PartDesign::Body * body = vp ? PartDesign::Body::findBodyOf(vp->getObject()) : nullptr;
|
||||
if (body) {
|
||||
App::Origin *origin = body->getOrigin();
|
||||
ViewProviderOrigin* vpOrigin;
|
||||
|
||||
@@ -48,7 +48,7 @@ class TaskRevolutionParameters : public TaskSketchBasedParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskRevolutionParameters(ViewProvider* RevolutionView,QWidget *parent = 0);
|
||||
TaskRevolutionParameters(ViewProvider* RevolutionView,QWidget *parent = nullptr);
|
||||
~TaskRevolutionParameters();
|
||||
|
||||
virtual void apply() override;
|
||||
|
||||
@@ -113,7 +113,7 @@ void TaskScaledParameters::setupUI()
|
||||
// Fill data into dialog elements
|
||||
for (std::vector<App::DocumentObject*>::const_iterator i = originals.begin(); i != originals.end(); ++i) {
|
||||
const App::DocumentObject* obj = *i;
|
||||
if (obj != NULL) {
|
||||
if (obj != nullptr) {
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString::fromUtf8(obj->Label.getValue()));
|
||||
item->setData(Qt::UserRole, QString::fromLatin1(obj->getNameInDocument()));
|
||||
|
||||
@@ -49,7 +49,7 @@ class TaskScaledParameters : public TaskTransformedParameters
|
||||
|
||||
public:
|
||||
/// Constructor for task with ViewProvider
|
||||
TaskScaledParameters(ViewProviderTransformed *TransformedView, QWidget *parent = 0);
|
||||
TaskScaledParameters(ViewProviderTransformed *TransformedView, QWidget *parent = nullptr);
|
||||
/// Constructor for task with parent task (MultiTransform mode)
|
||||
TaskScaledParameters(TaskMultiTransformParameters *parentTask, QLayout *layout);
|
||||
virtual ~TaskScaledParameters();
|
||||
|
||||
@@ -49,7 +49,7 @@ class TaskShapeBinder : public Gui::TaskView::TaskBox, Gui::SelectionObserver
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskShapeBinder(ViewProviderShapeBinder *view,bool newObj=false,QWidget *parent = 0);
|
||||
TaskShapeBinder(ViewProviderShapeBinder *view,bool newObj=false,QWidget *parent = nullptr);
|
||||
~TaskShapeBinder();
|
||||
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ QVariant TaskSketchBasedParameters::setUpToFace(const QString& text)
|
||||
|
||||
// Check whether this is the name of an App::Plane or Part::Datum feature
|
||||
App::DocumentObject* obj = vp->getObject()->getDocument()->getObject(parts[0].toLatin1());
|
||||
if (obj == NULL)
|
||||
if (obj == nullptr)
|
||||
return QVariant();
|
||||
|
||||
if (obj->getTypeId().isDerivedFrom(App::Plane::getClassTypeId())) {
|
||||
|
||||
@@ -36,7 +36,7 @@ class TaskThicknessParameters : public TaskDressUpParameters
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskThicknessParameters(ViewProviderDressUp *DressUpView, QWidget *parent=0);
|
||||
TaskThicknessParameters(ViewProviderDressUp *DressUpView, QWidget *parent=nullptr);
|
||||
~TaskThicknessParameters();
|
||||
|
||||
double getValue(void) const;
|
||||
|
||||
@@ -34,7 +34,7 @@ using namespace Gui::TaskView;
|
||||
namespace bp = boost::placeholders;
|
||||
|
||||
TaskTransformedMessages::TaskTransformedMessages(ViewProviderTransformed *transformedView_)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("document-new"), tr("Transformed feature messages"), true, 0)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("document-new"), tr("Transformed feature messages"), true, nullptr)
|
||||
, transformedView(transformedView_)
|
||||
, ui(new Ui_TaskTransformedMessages)
|
||||
{
|
||||
|
||||
@@ -273,7 +273,7 @@ void TaskTransformedParameters::fillAxisCombo(ComboLinks &combolinks,
|
||||
}
|
||||
|
||||
//add "Select reference"
|
||||
combolinks.addLink(0,std::string(),tr("Select reference..."));
|
||||
combolinks.addLink(nullptr,std::string(),tr("Select reference..."));
|
||||
}
|
||||
|
||||
void TaskTransformedParameters::fillPlanesCombo(ComboLinks &combolinks,
|
||||
@@ -309,7 +309,7 @@ void TaskTransformedParameters::fillPlanesCombo(ComboLinks &combolinks,
|
||||
}
|
||||
|
||||
//add "Select reference"
|
||||
combolinks.addLink(0,std::string(),tr("Select reference..."));
|
||||
combolinks.addLink(nullptr,std::string(),tr("Select reference..."));
|
||||
}
|
||||
|
||||
void TaskTransformedParameters::recomputeFeature() {
|
||||
@@ -453,7 +453,7 @@ void TaskTransformedParameters::indexesMoved()
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TaskDlgTransformedParameters::TaskDlgTransformedParameters(ViewProviderTransformed *TransformedView_)
|
||||
: TaskDlgFeatureParameters(TransformedView_), parameter(0)
|
||||
: TaskDlgFeatureParameters(TransformedView_), parameter(nullptr)
|
||||
{
|
||||
assert(vp);
|
||||
message = new TaskTransformedMessages(getTransformedView());
|
||||
@@ -483,7 +483,7 @@ bool TaskDlgTransformedParameters::reject()
|
||||
|
||||
|
||||
ComboLinks::ComboLinks(QComboBox &combo)
|
||||
: doc(0)
|
||||
: doc(nullptr)
|
||||
{
|
||||
this->_combo = &combo;
|
||||
_combo->clear();
|
||||
@@ -497,7 +497,7 @@ int ComboLinks::addLink(const App::PropertyLinkSub &lnk, QString itemText)
|
||||
this->linksInList.push_back(new App::PropertyLinkSub());
|
||||
App::PropertyLinkSub &newitem = *(linksInList[linksInList.size()-1]);
|
||||
newitem.Paste(lnk);
|
||||
if (newitem.getValue() && this->doc == 0)
|
||||
if (newitem.getValue() && this->doc == nullptr)
|
||||
this->doc = newitem.getValue()->getDocument();
|
||||
return linksInList.size()-1;
|
||||
}
|
||||
@@ -510,7 +510,7 @@ int ComboLinks::addLink(App::DocumentObject *linkObj, std::string linkSubname, Q
|
||||
this->linksInList.push_back(new App::PropertyLinkSub());
|
||||
App::PropertyLinkSub &newitem = *(linksInList[linksInList.size()-1]);
|
||||
newitem.setValue(linkObj,std::vector<std::string>(1,linkSubname));
|
||||
if (newitem.getValue() && this->doc == 0)
|
||||
if (newitem.getValue() && this->doc == nullptr)
|
||||
this->doc = newitem.getValue()->getDocument();
|
||||
return linksInList.size()-1;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
* will go out of sync, and crashes may result.
|
||||
*/
|
||||
ComboLinks(QComboBox &combo);
|
||||
ComboLinks() {_combo = 0; doc = 0;}
|
||||
void setCombo(QComboBox &combo) {assert(_combo == 0); this->_combo = &combo; _combo->clear();}
|
||||
ComboLinks() {_combo = nullptr; doc = nullptr;}
|
||||
void setCombo(QComboBox &combo) {assert(_combo == nullptr); this->_combo = &combo; _combo->clear();}
|
||||
|
||||
/**
|
||||
* @brief addLink adds an item to the combo. Doesn't check for duplicates.
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
QComboBox& combo(void) const {assert(_combo); return *_combo;}
|
||||
|
||||
~ComboLinks() {_combo = 0; clear();}
|
||||
~ComboLinks() {_combo = nullptr; clear();}
|
||||
private:
|
||||
QComboBox* _combo;
|
||||
App::Document* doc;
|
||||
@@ -123,7 +123,7 @@ class TaskTransformedParameters : public Gui::TaskView::TaskBox,
|
||||
|
||||
public:
|
||||
/// Constructor for task with ViewProvider
|
||||
TaskTransformedParameters(ViewProviderTransformed *TransformedView, QWidget *parent = 0);
|
||||
TaskTransformedParameters(ViewProviderTransformed *TransformedView, QWidget *parent = nullptr);
|
||||
/// Constructor for task with parent task (MultiTransform mode)
|
||||
TaskTransformedParameters(TaskMultiTransformParameters *parentTask);
|
||||
virtual ~TaskTransformedParameters();
|
||||
|
||||
@@ -60,7 +60,7 @@ bool setEdit(App::DocumentObject *obj, PartDesign::Body *body) {
|
||||
FC_ERR("invalid object");
|
||||
return false;
|
||||
}
|
||||
if(body == 0) {
|
||||
if(body == nullptr) {
|
||||
body = getBodyFor(obj, false);
|
||||
if(!body) {
|
||||
FC_ERR("no body found");
|
||||
@@ -69,7 +69,7 @@ bool setEdit(App::DocumentObject *obj, PartDesign::Body *body) {
|
||||
}
|
||||
auto *activeView = Gui::Application::Instance->activeView();
|
||||
if(!activeView) return false;
|
||||
App::DocumentObject *parent = 0;
|
||||
App::DocumentObject *parent = nullptr;
|
||||
std::string subname;
|
||||
auto activeBody = activeView->getActiveObject<PartDesign::Body*>(PDBODYKEY,&parent,&subname);
|
||||
if(activeBody != body) {
|
||||
@@ -108,7 +108,7 @@ PartDesign::Body *getBody(bool messageIfNot, bool autoActivate, bool assertModer
|
||||
|
||||
if (!activeBody && singleBodyDocument && autoActivate) {
|
||||
auto bodies = doc->getObjectsOfType(PartDesign::Body::getClassTypeId());
|
||||
App::DocumentObject *body = 0;
|
||||
App::DocumentObject *body = nullptr;
|
||||
if(bodies.size()==1) {
|
||||
body = bodies[0];
|
||||
activeBody = makeBodyActive(body, doc, topParent, subname);
|
||||
@@ -136,14 +136,14 @@ PartDesign::Body * makeBodyActive(App::DocumentObject *body, App::Document *doc,
|
||||
App::DocumentObject **topParent,
|
||||
std::string *subname)
|
||||
{
|
||||
App::DocumentObject *parent = 0;
|
||||
App::DocumentObject *parent = nullptr;
|
||||
std::string sub;
|
||||
|
||||
for(auto &v : body->getParents()) {
|
||||
if(v.first->getDocument()!=doc)
|
||||
continue;
|
||||
if(parent) {
|
||||
body = 0;
|
||||
body = nullptr;
|
||||
break;
|
||||
}
|
||||
parent = v.first;
|
||||
@@ -213,7 +213,7 @@ App::Part* getActivePart() {
|
||||
if ( activeView ) {
|
||||
return activeView->getActiveObject<App::Part*> (PARTKEY);
|
||||
} else {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void fixSketchSupport (Sketcher::SketchObject* sketch)
|
||||
bool reverseSketch = (sketchVector.x + sketchVector.y + sketchVector.z) < 0.0 ;
|
||||
if (reverseSketch) sketchVector *= -1.0;
|
||||
|
||||
App::Plane *plane =0;
|
||||
App::Plane *plane =nullptr;
|
||||
|
||||
if (sketchVector == Base::Vector3d(0,0,1))
|
||||
plane = origin->getXY ();
|
||||
|
||||
@@ -44,11 +44,11 @@ namespace Sketcher {
|
||||
namespace PartDesignGui {
|
||||
|
||||
/// Activate edit mode of the given object
|
||||
bool setEdit(App::DocumentObject *obj, PartDesign::Body *body = 0);
|
||||
bool setEdit(App::DocumentObject *obj, PartDesign::Body *body = nullptr);
|
||||
|
||||
/// Return active body or show a warning message
|
||||
PartDesign::Body *getBody(bool messageIfNot, bool autoActivate=true, bool assertModern=true,
|
||||
App::DocumentObject **topParent=0, std::string *subname=0);
|
||||
App::DocumentObject **topParent=nullptr, std::string *subname=nullptr);
|
||||
|
||||
/// Display a dialog to select or create a Body object when none is active
|
||||
PartDesign::Body * needActiveBodyMessage(App::Document *doc,
|
||||
@@ -63,8 +63,8 @@ PartDesign::Body * needActiveBodyMessage(App::Document *doc,
|
||||
* (currently only subshapebinder)
|
||||
*/
|
||||
PartDesign::Body * makeBodyActive(App::DocumentObject *body, App::Document *doc,
|
||||
App::DocumentObject **topParent=0,
|
||||
std::string *subname=0);
|
||||
App::DocumentObject **topParent=nullptr,
|
||||
std::string *subname=nullptr);
|
||||
|
||||
/// Display error when there are existing Body objects, but none are active
|
||||
void needActiveBodyError(void);
|
||||
@@ -78,7 +78,7 @@ PartDesign::Body * makeBody(App::Document *doc);
|
||||
*/
|
||||
PartDesign::Body *getBodyFor(const App::DocumentObject*, bool messageIfNot,
|
||||
bool autoActivate=true, bool assertModern=true,
|
||||
App::DocumentObject **topParent=0, std::string *subname=0);
|
||||
App::DocumentObject **topParent=nullptr, std::string *subname=nullptr);
|
||||
|
||||
App::Part *getPartFor(const App::DocumentObject*, bool messageIfNot);
|
||||
App::Part *getActivePart();
|
||||
|
||||
@@ -50,7 +50,7 @@ using namespace PartDesignGui;
|
||||
PROPERTY_SOURCE_WITH_EXTENSIONS(PartDesignGui::ViewProvider, PartGui::ViewProviderPart)
|
||||
|
||||
ViewProvider::ViewProvider()
|
||||
:oldWb(""), oldTip(NULL), isSetTipIcon(false)
|
||||
:oldWb(""), oldTip(nullptr), isSetTipIcon(false)
|
||||
{
|
||||
PartGui::ViewProviderAttachExtension::initExtension(this);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ bool ViewProvider::setEdit(int ModNum)
|
||||
TaskDlgFeatureParameters *featureDlg = qobject_cast<TaskDlgFeatureParameters *>(dlg);
|
||||
// NOTE: if the dialog is not partDesigan dialog the featureDlg will be NULL
|
||||
if (featureDlg && featureDlg->viewProvider() != this) {
|
||||
featureDlg = 0; // another feature left open its task panel
|
||||
featureDlg = nullptr; // another feature left open its task panel
|
||||
}
|
||||
if (dlg && !featureDlg) {
|
||||
QMessageBox msgBox;
|
||||
@@ -153,11 +153,11 @@ void ViewProvider::unsetEdit(int ModNum)
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')");
|
||||
}
|
||||
#endif
|
||||
oldTip = NULL;
|
||||
oldTip = nullptr;
|
||||
}
|
||||
else {
|
||||
PartGui::ViewProviderPart::unsetEdit(ModNum);
|
||||
oldTip = NULL;
|
||||
oldTip = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ bool ViewProvider::onDelete(const std::vector<std::string> &)
|
||||
// find surrounding features in the tree
|
||||
Part::BodyBase* body = PartDesign::Body::findBodyOf(getObject());
|
||||
|
||||
if (body != NULL) {
|
||||
if (body != nullptr) {
|
||||
// Deletion from the tree of a feature is handled by Document.removeObject, which has no clue
|
||||
// about what a body is. Therefore, Bodies, although an "activable" container, know nothing
|
||||
// about what happens at Document level with the features they contain.
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
using namespace PartDesignGui;
|
||||
namespace bp = boost::placeholders;
|
||||
|
||||
const char* PartDesignGui::ViewProviderBody::BodyModeEnum[] = {"Through","Tip",NULL};
|
||||
const char* PartDesignGui::ViewProviderBody::BodyModeEnum[] = {"Through","Tip",nullptr};
|
||||
|
||||
PROPERTY_SOURCE_WITH_EXTENSIONS(PartDesignGui::ViewProviderBody,PartGui::ViewProviderPart)
|
||||
|
||||
@@ -318,8 +318,8 @@ void ViewProviderBody::updateOriginDatumSize () {
|
||||
SbVec3f min = bboxOrigins.getMin();
|
||||
|
||||
// obtain an Origin and it's ViewProvider
|
||||
App::Origin* origin = 0;
|
||||
Gui::ViewProviderOrigin* vpOrigin = 0;
|
||||
App::Origin* origin = nullptr;
|
||||
Gui::ViewProviderOrigin* vpOrigin = nullptr;
|
||||
try {
|
||||
origin = body->getOrigin ();
|
||||
assert (origin);
|
||||
@@ -466,7 +466,7 @@ bool ViewProviderBody::canDropObject(App::DocumentObject* obj) const
|
||||
|
||||
App::Part *actPart = PartDesignGui::getActivePart();
|
||||
App::Part* partOfBaseFeature = App::Part::getPartOfObject(obj);
|
||||
if (partOfBaseFeature != 0 && partOfBaseFeature != actPart)
|
||||
if (partOfBaseFeature != nullptr && partOfBaseFeature != actPart)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -42,7 +42,7 @@ using namespace PartDesignGui;
|
||||
|
||||
PROPERTY_SOURCE_WITH_EXTENSIONS(PartDesignGui::ViewProviderBoolean,PartDesignGui::ViewProvider)
|
||||
|
||||
const char* PartDesignGui::ViewProviderBoolean::DisplayEnum[] = {"Result","Tools",NULL};
|
||||
const char* PartDesignGui::ViewProviderBoolean::DisplayEnum[] = {"Result","Tools",nullptr};
|
||||
|
||||
|
||||
ViewProviderBoolean::ViewProviderBoolean()
|
||||
@@ -74,7 +74,7 @@ bool ViewProviderBoolean::setEdit(int ModNum)
|
||||
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
|
||||
TaskDlgBooleanParameters *booleanDlg = qobject_cast<TaskDlgBooleanParameters *>(dlg);
|
||||
if (booleanDlg && booleanDlg->getBooleanView() != this)
|
||||
booleanDlg = 0; // another pad left open its task panel
|
||||
booleanDlg = nullptr; // another pad left open its task panel
|
||||
if (dlg && !booleanDlg) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
|
||||
|
||||
@@ -90,7 +90,7 @@ ViewProviderDatum::ViewProviderDatum()
|
||||
Transparency.setValue (col.a * 100);
|
||||
|
||||
oldWb = "";
|
||||
oldTip = NULL;
|
||||
oldTip = nullptr;
|
||||
}
|
||||
|
||||
ViewProviderDatum::~ViewProviderDatum()
|
||||
@@ -207,7 +207,7 @@ SoDetail* ViewProviderDatum::getDetail(const char* subelement) const
|
||||
return detail;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ViewProviderDatum::isSelectable(void) const
|
||||
@@ -236,7 +236,7 @@ bool ViewProviderDatum::setEdit(int ModNum)
|
||||
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
|
||||
TaskDlgDatumParameters *datumDlg = qobject_cast<TaskDlgDatumParameters *>(dlg);
|
||||
if (datumDlg && datumDlg->getViewProvider() != this)
|
||||
datumDlg = 0; // another datum feature left open its task panel
|
||||
datumDlg = nullptr; // another datum feature left open its task panel
|
||||
if (dlg && !datumDlg) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
|
||||
@@ -284,7 +284,7 @@ bool ViewProviderDatum::doubleClicked(void)
|
||||
PartDesign::Body* activeBody = activeView->getActiveObject<PartDesign::Body*>(PDBODYKEY);
|
||||
auto datumBody = PartDesignGui::getBodyFor(pcDatum, false);
|
||||
|
||||
if (datumBody != NULL) {
|
||||
if (datumBody != nullptr) {
|
||||
if (datumBody != activeBody) {
|
||||
Gui::Command::doCommand(Gui::Command::Gui,
|
||||
"Gui.ActiveDocument.ActiveView.setActiveObject('%s',%s)",
|
||||
|
||||
@@ -83,7 +83,7 @@ ViewProviderDatumCoordinateSystem::ViewProviderDatumCoordinateSystem()
|
||||
autoZoom = new Gui::SoAutoZoomTranslation;
|
||||
autoZoom->ref();
|
||||
|
||||
labelSwitch = 0;
|
||||
labelSwitch = nullptr;
|
||||
}
|
||||
|
||||
ViewProviderDatumCoordinateSystem::~ViewProviderDatumCoordinateSystem()
|
||||
@@ -266,6 +266,6 @@ SoDetail* ViewProviderDatumCoordinateSystem::getDetail(const char* subelement) c
|
||||
detail->setLineIndex(2);
|
||||
return detail;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ bool ViewProviderDressUp::setEdit(int ModNum) {
|
||||
if (dressUp->getBaseObject (/*silent =*/ true)) {
|
||||
return ViewProvider::setEdit(ModNum);
|
||||
} else {
|
||||
QMessageBox::warning ( 0, QObject::tr("Feature error"),
|
||||
QMessageBox::warning ( nullptr, QObject::tr("Feature error"),
|
||||
QObject::tr("%1 misses a base feature.\n"
|
||||
"This feature is broken and can't be edited.")
|
||||
.arg( QString::fromLatin1(dressUp->getNameInDocument()) )
|
||||
@@ -86,10 +86,10 @@ void ViewProviderDressUp::highlightReferences(const bool on)
|
||||
{
|
||||
PartDesign::DressUp* pcDressUp = static_cast<PartDesign::DressUp*>(getObject());
|
||||
Part::Feature* base = pcDressUp->getBaseObject (/*silent =*/ true);
|
||||
if (base == NULL) return;
|
||||
if (base == nullptr) return;
|
||||
PartGui::ViewProviderPart* vp = dynamic_cast<PartGui::ViewProviderPart*>(
|
||||
Gui::Application::Instance->getViewProvider(base));
|
||||
if (vp == NULL) return;
|
||||
if (vp == nullptr) return;
|
||||
|
||||
std::vector<std::string> faces = pcDressUp->Base.getSubValuesStartsWith("Face");
|
||||
std::vector<std::string> edges = pcDressUp->Base.getSubValuesStartsWith("Edge");
|
||||
|
||||
@@ -93,7 +93,7 @@ void ViewProviderHelix::unsetEdit(int ModNum)
|
||||
std::vector<App::DocumentObject*> ViewProviderHelix::claimChildren(void) const {
|
||||
std::vector<App::DocumentObject*> temp;
|
||||
App::DocumentObject* sketch = static_cast<PartDesign::ProfileBased*>(getObject())->Profile.getValue();
|
||||
if (sketch != NULL && sketch->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
if (sketch != nullptr && sketch->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
temp.push_back(sketch);
|
||||
|
||||
return temp;
|
||||
@@ -103,7 +103,7 @@ bool ViewProviderHelix::onDelete(const std::vector<std::string> &s) {
|
||||
PartDesign::ProfileBased* feature = static_cast<PartDesign::ProfileBased*>(getObject());
|
||||
|
||||
// get the Sketch
|
||||
Sketcher::SketchObject *pcSketch = 0;
|
||||
Sketcher::SketchObject *pcSketch = nullptr;
|
||||
if (feature->Profile.getValue())
|
||||
pcSketch = static_cast<Sketcher::SketchObject*>(feature->Profile.getValue());
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ bool ViewProviderHole::setEdit(int ModNum)
|
||||
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
|
||||
TaskDlgHoleParameters *holeDlg = qobject_cast<TaskDlgHoleParameters *>(dlg);
|
||||
if (holeDlg && holeDlg->getHoleView() != this)
|
||||
holeDlg = 0; // another hole left open its task panel
|
||||
holeDlg = nullptr; // another hole left open its task panel
|
||||
if (dlg && !holeDlg) {
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
|
||||
@@ -110,7 +110,7 @@ bool ViewProviderHole::onDelete(const std::vector<std::string> &s)
|
||||
{
|
||||
// get the Sketch
|
||||
PartDesign::Hole* pcHole = static_cast<PartDesign::Hole*>(getObject());
|
||||
Sketcher::SketchObject *pcSketch = 0;
|
||||
Sketcher::SketchObject *pcSketch = nullptr;
|
||||
if (pcHole->Profile.getValue())
|
||||
pcSketch = static_cast<Sketcher::SketchObject*>(pcHole->Profile.getValue());
|
||||
|
||||
|
||||
@@ -54,11 +54,11 @@ std::vector<App::DocumentObject*> ViewProviderLoft::claimChildren(void)const
|
||||
PartDesign::Loft* pcLoft = static_cast<PartDesign::Loft*>(getObject());
|
||||
|
||||
App::DocumentObject* sketch = pcLoft->getVerifiedSketch(true);
|
||||
if (sketch != NULL)
|
||||
if (sketch != nullptr)
|
||||
temp.push_back(sketch);
|
||||
|
||||
for(App::DocumentObject* obj : pcLoft->Sections.getValues()) {
|
||||
if (obj != NULL && obj->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
if (obj != nullptr && obj->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
temp.push_back(obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ void ViewProviderMultiTransform::setupContextMenu(QMenu* menu, QObject* receiver
|
||||
std::vector<App::DocumentObject*> ViewProviderMultiTransform::claimChildren(void) const
|
||||
{
|
||||
PartDesign::MultiTransform* pcMultiTransform = static_cast<PartDesign::MultiTransform*>(getObject());
|
||||
if (pcMultiTransform == NULL)
|
||||
if (pcMultiTransform == nullptr)
|
||||
return std::vector<App::DocumentObject*>(); // TODO: Show error?
|
||||
|
||||
std::vector<App::DocumentObject*> transformFeatures = pcMultiTransform->Transformations.getValues();
|
||||
|
||||
@@ -54,20 +54,20 @@ std::vector<App::DocumentObject*> ViewProviderPipe::claimChildren(void)const
|
||||
PartDesign::Pipe* pcPipe = static_cast<PartDesign::Pipe*>(getObject());
|
||||
|
||||
App::DocumentObject* sketch = pcPipe->getVerifiedSketch(true);
|
||||
if (sketch != NULL)
|
||||
if (sketch != nullptr)
|
||||
temp.push_back(sketch);
|
||||
|
||||
for(App::DocumentObject* obj : pcPipe->Sections.getValues()) {
|
||||
if (obj != NULL && obj->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
if (obj != nullptr && obj->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
temp.push_back(obj);
|
||||
}
|
||||
|
||||
App::DocumentObject* spine = pcPipe->Spine.getValue();
|
||||
if (spine != NULL && spine->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
if (spine != nullptr && spine->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
temp.push_back(spine);
|
||||
|
||||
App::DocumentObject* auxspine = pcPipe->AuxillerySpine.getValue();
|
||||
if (auxspine != NULL && auxspine->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
if (auxspine != nullptr && auxspine->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
temp.push_back(auxspine);
|
||||
|
||||
return temp;
|
||||
|
||||
@@ -39,7 +39,7 @@ std::string ViewProviderPy::representation(void) const
|
||||
|
||||
PyObject *ViewProviderPy::getCustomAttributes(const char* ) const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int ViewProviderPy::setCustomAttributes(const char* , PyObject *)
|
||||
|
||||
@@ -144,7 +144,7 @@ void ViewProviderShapeBinder::highlightReferences(const bool on, bool /*auxiliar
|
||||
|
||||
PartGui::ViewProviderPart* svp = dynamic_cast<PartGui::ViewProviderPart*>(
|
||||
Gui::Application::Instance->getViewProvider(obj));
|
||||
if (svp == NULL) return;
|
||||
if (svp == nullptr) return;
|
||||
|
||||
if (on) {
|
||||
if (!subs.empty() && originalLineColors.empty()) {
|
||||
@@ -348,7 +348,7 @@ void ViewProviderSubShapeBinder::updatePlacement(bool transaction) {
|
||||
|
||||
std::vector<Base::Matrix4D> mats;
|
||||
bool relative = self->Relative.getValue();
|
||||
App::DocumentObject *parent = 0;
|
||||
App::DocumentObject *parent = nullptr;
|
||||
std::string parentSub;
|
||||
if(relative && self->getParents().size()) {
|
||||
const auto &sel = Gui::Selection().getSelection("",0);
|
||||
|
||||
@@ -48,7 +48,7 @@ ViewProviderSketchBased::~ViewProviderSketchBased()
|
||||
std::vector<App::DocumentObject*> ViewProviderSketchBased::claimChildren(void) const {
|
||||
std::vector<App::DocumentObject*> temp;
|
||||
App::DocumentObject* sketch = static_cast<PartDesign::ProfileBased*>(getObject())->Profile.getValue();
|
||||
if (sketch != NULL && sketch->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
if (sketch != nullptr && sketch->isDerivedFrom(Part::Part2DObject::getClassTypeId()))
|
||||
temp.push_back(sketch);
|
||||
|
||||
return temp;
|
||||
@@ -59,7 +59,7 @@ bool ViewProviderSketchBased::onDelete(const std::vector<std::string> &s) {
|
||||
PartDesign::ProfileBased* feature = static_cast<PartDesign::ProfileBased*>(getObject());
|
||||
|
||||
// get the Sketch
|
||||
Sketcher::SketchObject *pcSketch = 0;
|
||||
Sketcher::SketchObject *pcSketch = nullptr;
|
||||
if (feature->Profile.getValue())
|
||||
pcSketch = static_cast<Sketcher::SketchObject*>(feature->Profile.getValue());
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ Gui::ViewProvider *ViewProviderTransformed::startEditing(int ModNum) {
|
||||
auto vp = Gui::Application::Instance->getViewProvider(obj);
|
||||
if(vp)
|
||||
return vp->startEditing(ModNum);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ void Workbench::activated()
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Plane",
|
||||
"PartDesign_CoordinateSystem",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT Part::Feature SUBELEMENT Vertex COUNT 1..",
|
||||
Vertex,
|
||||
@@ -279,7 +279,7 @@ void Workbench::activated()
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Plane",
|
||||
"PartDesign_CoordinateSystem",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT Part::Feature SUBELEMENT Edge COUNT 1..",
|
||||
Edge,
|
||||
@@ -297,7 +297,7 @@ void Workbench::activated()
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Plane",
|
||||
"PartDesign_CoordinateSystem",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT Part::Feature SUBELEMENT Face COUNT 1",
|
||||
Face,
|
||||
@@ -307,7 +307,7 @@ void Workbench::activated()
|
||||
|
||||
const char* Body[] = {
|
||||
"PartDesign_NewSketch",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT PartDesign::Body COUNT 1",
|
||||
Body,
|
||||
@@ -317,7 +317,7 @@ void Workbench::activated()
|
||||
|
||||
const char* Body2[] = {
|
||||
"PartDesign_Boolean",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT PartDesign::Body COUNT 1..",
|
||||
Body2,
|
||||
@@ -331,7 +331,7 @@ void Workbench::activated()
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Point",
|
||||
"PartDesign_CoordinateSystem",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT App::Plane COUNT 1",
|
||||
Plane1,
|
||||
@@ -344,7 +344,7 @@ void Workbench::activated()
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Plane",
|
||||
"PartDesign_CoordinateSystem",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT PartDesign::Plane COUNT 1",
|
||||
Plane2,
|
||||
@@ -356,7 +356,7 @@ void Workbench::activated()
|
||||
"PartDesign_Point",
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Plane",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT PartDesign::Line COUNT 1",
|
||||
Line,
|
||||
@@ -369,7 +369,7 @@ void Workbench::activated()
|
||||
"PartDesign_Line",
|
||||
"PartDesign_Plane",
|
||||
"PartDesign_CoordinateSystem",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT PartDesign::Point COUNT 1",
|
||||
Point,
|
||||
@@ -379,7 +379,7 @@ void Workbench::activated()
|
||||
|
||||
const char* NoSel[] = {
|
||||
"PartDesign_Body",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptySelection(
|
||||
NoSel,
|
||||
"Start Part",
|
||||
@@ -391,7 +391,7 @@ void Workbench::activated()
|
||||
"PartDesign_Chamfer",
|
||||
"PartDesign_Draft",
|
||||
"PartDesign_Thickness",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT Part::Feature SUBELEMENT Face COUNT 2..",
|
||||
Faces,
|
||||
@@ -412,7 +412,7 @@ void Workbench::activated()
|
||||
"PartDesign_SubtractiveLoft",
|
||||
"PartDesign_AdditiveHelix",
|
||||
"PartDesign_SubtractiveHelix",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT Sketcher::SketchObject COUNT 1",
|
||||
Sketch,
|
||||
@@ -426,7 +426,7 @@ void Workbench::activated()
|
||||
"PartDesign_PolarPattern",
|
||||
// "PartDesign_Scaled",
|
||||
"PartDesign_MultiTransform",
|
||||
0};
|
||||
nullptr};
|
||||
Watcher.push_back(new Gui::TaskView::TaskWatcherCommands(
|
||||
"SELECT PartDesign::SketchBased",
|
||||
Transformed,
|
||||
|
||||
Reference in New Issue
Block a user