TD: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:07:44 +01:00
parent d1d4b996e7
commit e8f9c8a1d3
146 changed files with 320 additions and 320 deletions

View File

@@ -77,7 +77,7 @@ PyMOD_INIT_FUNC(TechDraw)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = TechDraw::initModule();
Base::Console().Log("Loading TechDraw module... done\n");

View File

@@ -419,8 +419,8 @@ private:
Py::String dxfReturn;
try {
App::DocumentObject* obj = 0;
TechDraw::DrawViewPart* dvp = 0;
App::DocumentObject* obj = nullptr;
TechDraw::DrawViewPart* dvp = nullptr;
TechDraw::DXFOutput dxfOut;
std::string dxfText;
std::stringstream ss;
@@ -477,8 +477,8 @@ private:
std::string grpHead2 = "\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"4\">\n";
std::string grpTail = "</g>\n";
try {
App::DocumentObject* obj = 0;
TechDraw::DrawViewPart* dvp = 0;
App::DocumentObject* obj = nullptr;
TechDraw::DrawViewPart* dvp = nullptr;
TechDraw::SVGOutput svgOut;
std::string svgText;
std::stringstream ss;
@@ -636,8 +636,8 @@ private:
try {
ImpExpDxfWrite writer(filePath);
writer.init();
App::DocumentObject* obj = 0;
TechDraw::DrawViewPart* dvp = 0;
App::DocumentObject* obj = nullptr;
TechDraw::DrawViewPart* dvp = nullptr;
if (PyObject_TypeCheck(viewObj, &(TechDraw::DrawViewPartPy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(viewObj)->getDocumentObjectPtr();
dvp = static_cast<TechDraw::DrawViewPart*>(obj);
@@ -670,8 +670,8 @@ private:
try {
ImpExpDxfWrite writer(filePath);
writer.init();
App::DocumentObject* obj = 0;
TechDraw::DrawPage* dp = 0;
App::DocumentObject* obj = nullptr;
TechDraw::DrawPage* dp = nullptr;
if (PyObject_TypeCheck(pageObj, &(TechDraw::DrawPagePy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(pageObj)->getDocumentObjectPtr();
dp = static_cast<TechDraw::DrawPage*>(obj);
@@ -1041,7 +1041,7 @@ private:
Py::Object project(const Py::Tuple& args)
{
PyObject *pcObjShape;
PyObject *pcObjDir=0;
PyObject *pcObjDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "O!|O!",
&(Part::TopoShapePy::Type), &pcObjShape,
@@ -1066,7 +1066,7 @@ private:
Py::Object projectEx(const Py::Tuple& args)
{
PyObject *pcObjShape;
PyObject *pcObjDir=0;
PyObject *pcObjDir=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "O!|O!",
&(TopoShapePy::Type), &pcObjShape,
@@ -1097,23 +1097,23 @@ private:
Py::Object projectToSVG(const Py::Tuple& args, const Py::Dict& keys)
{
static char* argNames[] = {"topoShape", "direction", "type", "tolerance", "vStyle", "v0Style", "v1Style", "hStyle", "h0Style", "h1Style", NULL};
PyObject *pcObjShape = 0;
PyObject *pcObjDir = 0;
const char *extractionTypePy = 0;
static char* argNames[] = {"topoShape", "direction", "type", "tolerance", "vStyle", "v0Style", "v1Style", "hStyle", "h0Style", "h1Style", nullptr};
PyObject *pcObjShape = nullptr;
PyObject *pcObjDir = nullptr;
const char *extractionTypePy = nullptr;
ProjectionAlgos::ExtractionType extractionType = ProjectionAlgos::Plain;
const float tol = 0.1f;
PyObject* vStylePy = 0;
PyObject* vStylePy = nullptr;
ProjectionAlgos::XmlAttributes vStyle;
PyObject* v0StylePy = 0;
PyObject* v0StylePy = nullptr;
ProjectionAlgos::XmlAttributes v0Style;
PyObject* v1StylePy = 0;
PyObject* v1StylePy = nullptr;
ProjectionAlgos::XmlAttributes v1Style;
PyObject* hStylePy = 0;
PyObject* hStylePy = nullptr;
ProjectionAlgos::XmlAttributes hStyle;
PyObject* h0StylePy = 0;
PyObject* h0StylePy = nullptr;
ProjectionAlgos::XmlAttributes h0Style;
PyObject* h1StylePy = 0;
PyObject* h1StylePy = nullptr;
ProjectionAlgos::XmlAttributes h1Style;
// Get the arguments
@@ -1167,8 +1167,8 @@ private:
Py::Object projectToDXF(const Py::Tuple& args)
{
PyObject *pcObjShape;
PyObject *pcObjDir=0;
const char *type=0;
PyObject *pcObjDir=nullptr;
const char *type=nullptr;
float scale=1.0f;
float tol=0.1f;

View File

@@ -38,7 +38,7 @@ const char* ArrowPropEnum::ArrowTypeEnums[]= { "Filled Arrow",
"Fork",
"Filled Triangle",
"None",
NULL};
nullptr};
const std::vector<std::string> ArrowPropEnum::ArrowTypeIcons = { ":icons/arrowfilled.svg",
":icons/arrowopen.svg",

View File

@@ -47,7 +47,7 @@ PyObject *CenterLinePy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'CenterLine'.");
return 0;
return nullptr;
}
// constructor method
@@ -59,17 +59,17 @@ int CenterLinePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* CenterLinePy::clone(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::CenterLine* geom = this->getCenterLinePtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create clone of CenterLine");
return 0;
return nullptr;
}
TechDraw::CenterLinePy* geompy = static_cast<TechDraw::CenterLinePy*>(cpy);
@@ -86,17 +86,17 @@ PyObject* CenterLinePy::clone(PyObject *args)
PyObject* CenterLinePy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::CenterLine* geom = this->getCenterLinePtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of CenterLine");
return 0;
return nullptr;
}
TechDraw::CenterLinePy* geompy = static_cast<TechDraw::CenterLinePy*>(cpy);
@@ -413,7 +413,7 @@ void CenterLinePy::setPoints(Py::Object arg)
PyObject *CenterLinePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int CenterLinePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -288,7 +288,7 @@ void CosmeticVertex::createNewTag()
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(0)));
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
@@ -552,7 +552,7 @@ void CosmeticEdge::createNewTag()
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(0)));
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
@@ -1427,7 +1427,7 @@ void CenterLine::createNewTag()
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(0)));
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
@@ -1617,7 +1617,7 @@ void GeomFormat::createNewTag()
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(0)));
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);

View File

@@ -61,7 +61,7 @@ PyObject *CosmeticEdgePy::PyMake(struct _typeobject *, PyObject *, PyObject *)
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'CosmeticEdge'.");
return 0;
return nullptr;
}
// constructor method
@@ -74,17 +74,17 @@ int CosmeticEdgePy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* CosmeticEdgePy::clone(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::CosmeticEdge* geom = this->getCosmeticEdgePtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create clone of CosmeticEdge");
return 0;
return nullptr;
}
TechDraw::CosmeticEdgePy* geompy = static_cast<TechDraw::CosmeticEdgePy*>(cpy);
@@ -101,17 +101,17 @@ PyObject* CosmeticEdgePy::clone(PyObject *args)
PyObject* CosmeticEdgePy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::CosmeticEdge* geom = this->getCosmeticEdgePtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of CosmeticEdge");
return 0;
return nullptr;
}
TechDraw::CosmeticEdgePy* geompy = static_cast<TechDraw::CosmeticEdgePy*>(cpy);
@@ -377,7 +377,7 @@ void CosmeticEdgePy::setCenter(Py::Object arg)
PyObject *CosmeticEdgePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int CosmeticEdgePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -47,10 +47,10 @@ CosmeticExtension::CosmeticExtension()
{
static const char *cgroup = "Cosmetics";
EXTENSION_ADD_PROPERTY_TYPE(CosmeticVertexes, (0), cgroup, App::Prop_Output, "CosmeticVertex Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(CosmeticEdges, (0), cgroup, App::Prop_Output, "CosmeticEdge Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(CenterLines ,(0),cgroup,App::Prop_Output,"Geometry format Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(GeomFormats ,(0),cgroup,App::Prop_Output,"Geometry format Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(CosmeticVertexes, (nullptr), cgroup, App::Prop_Output, "CosmeticVertex Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(CosmeticEdges, (nullptr), cgroup, App::Prop_Output, "CosmeticEdge Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(CenterLines ,(nullptr),cgroup,App::Prop_Output,"Geometry format Save/Restore");
EXTENSION_ADD_PROPERTY_TYPE(GeomFormats ,(nullptr),cgroup,App::Prop_Output,"Geometry format Save/Restore");
initExtensionType(CosmeticExtension::getExtensionClassTypeId());
}

View File

@@ -43,7 +43,7 @@ std::string CosmeticExtensionPy::representation(void) const
PyObject *CosmeticExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int CosmeticExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -52,7 +52,7 @@ PyObject *CosmeticVertexPy::PyMake(struct _typeobject *, PyObject *, PyObject *)
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'CosmeticVertex'.");
return 0;
return nullptr;
}
// constructor method
@@ -64,18 +64,18 @@ int CosmeticVertexPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* CosmeticVertexPy::clone(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::CosmeticVertex* geom = this->getCosmeticVertexPtr();
// geom->dump("CEPYI::clone");
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create clone of CosmeticVertex");
return 0;
return nullptr;
}
TechDraw::CosmeticVertexPy* geompy = static_cast<TechDraw::CosmeticVertexPy*>(cpy);
@@ -92,18 +92,18 @@ PyObject* CosmeticVertexPy::clone(PyObject *args)
PyObject* CosmeticVertexPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::CosmeticVertex* geom = this->getCosmeticVertexPtr();
// geom->dump("CEPYI::copy");
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of CosmeticVertex");
return 0;
return nullptr;
}
TechDraw::CosmeticVertexPy* geompy = static_cast<TechDraw::CosmeticVertexPy*>(cpy);
@@ -238,7 +238,7 @@ void CosmeticVertexPy::setStyle(Py::Object arg)
PyObject *CosmeticVertexPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int CosmeticVertexPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -343,7 +343,7 @@ DrawViewDimension* DrawDimHelper::makeDistDim(DrawViewPart* dvp,
TechDraw::DrawPage* page = dvp->findParentPage();
std::string pageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
App::Document* doc = dvp->getDocument();
std::string dimName = doc->getUniqueObjectName("Dimension");
if (extent) {

View File

@@ -94,7 +94,7 @@ DrawGeomHatch::DrawGeomHatch(void)
{
static const char *vgroup = "GeomHatch";
ADD_PROPERTY_TYPE(Source,(0),vgroup,(App::PropertyType)(App::Prop_None),"The View + Face to be crosshatched");
ADD_PROPERTY_TYPE(Source,(nullptr),vgroup,(App::PropertyType)(App::Prop_None),"The View + Face to be crosshatched");
Source.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(FilePattern ,(prefGeomHatchFile()),vgroup,App::Prop_None,"The crosshatch pattern file for this area");
ADD_PROPERTY_TYPE(PatIncluded, (""), vgroup,App::Prop_None,

View File

@@ -42,7 +42,7 @@ std::string DrawGeomHatchPy::representation(void) const
PyObject *DrawGeomHatchPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawGeomHatchPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -59,7 +59,7 @@ DrawHatch::DrawHatch(void)
{
static const char *vgroup = "Hatch";
ADD_PROPERTY_TYPE(Source, (0), vgroup, (App::PropertyType)(App::Prop_None), "The View + Face to be hatched");
ADD_PROPERTY_TYPE(Source, (nullptr), vgroup, (App::PropertyType)(App::Prop_None), "The View + Face to be hatched");
Source.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(HatchPattern, (prefSvgHatch()), vgroup, App::Prop_None, "The hatch pattern file for this area");
ADD_PROPERTY_TYPE(SvgIncluded, (""), vgroup,App::Prop_None,

View File

@@ -44,7 +44,7 @@ std::string DrawHatchPy::representation(void) const
PyObject *DrawHatchPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawHatchPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -72,7 +72,7 @@ DrawLeaderLine::DrawLeaderLine(void)
{
static const char *group = "Leader";
ADD_PROPERTY_TYPE(LeaderParent,(0),group,(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(LeaderParent,(nullptr),group,(App::PropertyType)(App::Prop_None),
"View to which this leader is attached");
LeaderParent.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(WayPoints,(Base::Vector3d()) ,group, App::Prop_None,

View File

@@ -45,7 +45,7 @@ std::string DrawLeaderLinePy::representation(void) const
PyObject *DrawLeaderLinePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawLeaderLinePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -71,7 +71,7 @@ PROPERTY_SOURCE(TechDraw::DrawPage, App::DocumentObject)
const char* DrawPage::ProjectionTypeEnums[] = { "First Angle",
"Third Angle",
NULL };
nullptr };
DrawPage::DrawPage(void)
{
@@ -81,9 +81,9 @@ DrawPage::DrawPage(void)
ADD_PROPERTY_TYPE(KeepUpdated, (Preferences::keepPagesUpToDate()),
group, (App::PropertyType)(App::Prop_Output), "Keep page in sync with model");
ADD_PROPERTY_TYPE(Template, (0), group, (App::PropertyType)(App::Prop_None), "Attached Template");
ADD_PROPERTY_TYPE(Template, (nullptr), group, (App::PropertyType)(App::Prop_None), "Attached Template");
Template.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(Views, (0), group, (App::PropertyType)(App::Prop_None), "Attached Views");
ADD_PROPERTY_TYPE(Views, (nullptr), group, (App::PropertyType)(App::Prop_None), "Attached Views");
Views.setScope(App::LinkScope::Global);
// Projection Properties
@@ -136,7 +136,7 @@ void DrawPage::onChanged(const App::Property* prop)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawView *view = dynamic_cast<TechDraw::DrawView *>(*it);
if (view != NULL && view->ScaleType.isValue("Page")) {
if (view != nullptr && view->ScaleType.isValue("Page")) {
if(std::abs(view->Scale.getValue() - Scale.getValue()) > FLT_EPSILON) {
view->Scale.setValue(Scale.getValue());
}
@@ -148,7 +148,7 @@ void DrawPage::onChanged(const App::Property* prop)
const std::vector<App::DocumentObject*> &vals = Views.getValues();
for(std::vector<App::DocumentObject *>::const_iterator it = vals.begin(); it < vals.end(); ++it) {
TechDraw::DrawProjGroup *view = dynamic_cast<TechDraw::DrawProjGroup *>(*it);
if (view != NULL && view->ProjectionType.isValue("Default")) {
if (view != nullptr && view->ProjectionType.isValue("Default")) {
view->ProjectionType.touch();
}
}
@@ -193,7 +193,7 @@ PyObject *DrawPage::getPyObject(void)
bool DrawPage::hasValidTemplate() const
{
App::DocumentObject *obj = 0;
App::DocumentObject *obj = nullptr;
obj = Template.getValue();
if(obj && obj->isDerivedFrom(TechDraw::DrawTemplate::getClassTypeId())) {
@@ -209,7 +209,7 @@ bool DrawPage::hasValidTemplate() const
double DrawPage::getPageWidth() const
{
App::DocumentObject *obj = 0;
App::DocumentObject *obj = nullptr;
obj = Template.getValue();
if( obj && obj->isDerivedFrom(TechDraw::DrawTemplate::getClassTypeId()) ) {
@@ -222,7 +222,7 @@ double DrawPage::getPageWidth() const
double DrawPage::getPageHeight() const
{
App::DocumentObject *obj = 0;
App::DocumentObject *obj = nullptr;
obj = Template.getValue();
if(obj) {

View File

@@ -107,26 +107,26 @@ PyObject* DrawPagePy::requestPaint(PyObject* args)
PyObject* DrawPagePy::getPageWidth(PyObject *)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
return nullptr;
}
// double getPageHeight() const;
PyObject* DrawPagePy::getPageHeight(PyObject *)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
return nullptr;
}
// const char* getPageOrientation() const;
PyObject* DrawPagePy::getPageOrientation(PyObject *)
{
PyErr_SetString(PyExc_NotImplementedError, "Not yet implemented");
return 0;
return nullptr;
}
PyObject *DrawPagePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int DrawPagePy::setCustomAttributes(const char* , PyObject *)

View File

@@ -41,7 +41,7 @@ std::string DrawParametricTemplatePy::representation(void) const
PyObject *DrawParametricTemplatePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawParametricTemplatePy::setCustomAttributes(const char* attr, PyObject* obj)
@@ -72,7 +72,7 @@ PyObject* DrawParametricTemplatePy::drawLine(PyObject *args)
double x2, y2;
if (!PyArg_ParseTuple(args, "dddd", &x1, &y1, &x2, &y2))
return 0;
return nullptr;
getDrawParametricTemplatePtr()->drawLine(x1,y1,x2,y2);

View File

@@ -58,7 +58,7 @@ using namespace TechDraw;
const char* DrawProjGroup::ProjectionTypeEnums[] = {"First Angle",
"Third Angle",
"Default", //Use Page setting
NULL};
nullptr};
PROPERTY_SOURCE(TechDraw::DrawProjGroup, TechDraw::DrawViewCollection)
@@ -72,12 +72,12 @@ DrawProjGroup::DrawProjGroup(void) :
GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
bool autoDist = hGrp->GetBool("AutoDist",true);
ADD_PROPERTY_TYPE(Source, (0), group, App::Prop_None, "Shape to view");
ADD_PROPERTY_TYPE(Source, (nullptr), group, App::Prop_None, "Shape to view");
Source.setScope(App::LinkScope::Global);
Source.setAllowExternal(true);
ADD_PROPERTY_TYPE(XSource, (0), group,App::Prop_None, "External 3D Shape to view");
ADD_PROPERTY_TYPE(XSource, (nullptr), group,App::Prop_None, "External 3D Shape to view");
ADD_PROPERTY_TYPE(Anchor, (0), group, App::Prop_None, "The root view to align projections with");
ADD_PROPERTY_TYPE(Anchor, (nullptr), group, App::Prop_None, "The root view to align projections with");
Anchor.setScope(App::LinkScope::Global);
ProjectionType.setEnums(ProjectionTypeEnums);
@@ -267,7 +267,7 @@ TechDraw::DrawPage * DrawProjGroup::getPage(void) const
double DrawProjGroup::calculateAutomaticScale() const
{
TechDraw::DrawPage *page = getPage();
if (page == NULL)
if (page == nullptr)
throw Base::RuntimeError("No page is assigned to this feature");
DrawProjGroupItem *viewPtrs[10];
@@ -285,7 +285,7 @@ double DrawProjGroup::calculateAutomaticScale() const
// C++ Standard says casting bool to int gives 0 or 1
int numVertSpaces = (viewPtrs[0] || viewPtrs[3] || viewPtrs[7]) +
(viewPtrs[2] || viewPtrs[5] || viewPtrs[9]) +
(viewPtrs[6] != NULL);
(viewPtrs[6] != nullptr);
int numHorizSpaces = (viewPtrs[0] || viewPtrs[1] || viewPtrs[2]) +
(viewPtrs[7] || viewPtrs[8] || viewPtrs[9]);
@@ -369,7 +369,7 @@ App::DocumentObject * DrawProjGroup::getProjObj(const char *viewProjType) const
}
}
return 0;
return nullptr;
}
DrawProjGroupItem* DrawProjGroup::getProjItem(const char *viewProjType) const
@@ -1093,7 +1093,7 @@ App::Enumeration DrawProjGroup::usedProjectionType(void)
App::Enumeration ret(ProjectionTypeEnums, ProjectionType.getValueAsString());
if (ret.isValue("Default")) {
TechDraw::DrawPage * page = getPage();
if ( page != NULL ) {
if ( page != nullptr ) {
ret.setValue(page->ProjectionType.getValueAsString());
}
}

View File

@@ -55,7 +55,7 @@ const char* DrawProjGroupItem::TypeEnums[] = {"Front",
"FrontTopRight",
"FrontBottomLeft",
"FrontBottomRight",
NULL};
nullptr};
PROPERTY_SOURCE(TechDraw::DrawProjGroupItem, TechDraw::DrawViewPart)

View File

@@ -26,7 +26,7 @@ PyObject* DrawProjGroupItemPy::autoPosition(PyObject *args)
PyObject *DrawProjGroupItemPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawProjGroupItemPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -119,7 +119,7 @@ PyObject* DrawProjGroupPy::getXYPosition(PyObject* args)
PyObject *DrawProjGroupPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawProjGroupPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -47,7 +47,7 @@ DrawRichAnno::DrawRichAnno(void)
{
static const char *group = "Text Block";
ADD_PROPERTY_TYPE(AnnoParent,(0),group,(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(AnnoParent,(nullptr),group,(App::PropertyType)(App::Prop_None),
"Object to which this annontation is attached");
ADD_PROPERTY_TYPE(AnnoText, (""), group, App::Prop_None, "Annotation text");
ADD_PROPERTY_TYPE(ShowFrame, (true), group, App::Prop_None, "Outline rectangle on/off");

View File

@@ -45,7 +45,7 @@ std::string DrawRichAnnoPy::representation(void) const
PyObject *DrawRichAnnoPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawRichAnnoPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -69,7 +69,7 @@ DrawSVGTemplate::DrawSVGTemplate()
// PageResult points to a temporary file in tmp/FreeCAD-AB-CD-EF-.../myTemplate.svg
// which is really copy of original Template with EditableFields replaced
// When restoring saved document, Template is redundant/incorrect/not present - PageResult is the correct info. -wf-
ADD_PROPERTY_TYPE(PageResult, (0), group, App::Prop_Output, "Current SVG code for template");
ADD_PROPERTY_TYPE(PageResult, (nullptr), group, App::Prop_Output, "Current SVG code for template");
ADD_PROPERTY_TYPE(Template, (""), group, App::Prop_Transient, "Template for the page"); //sb TemplateFileName???
// Width and Height properties shouldn't be set by the user

View File

@@ -38,7 +38,7 @@ std::string DrawSVGTemplatePy::representation(void) const
PyObject *DrawSVGTemplatePy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int DrawSVGTemplatePy::setCustomAttributes(const char* attr, PyObject* obj)

View File

@@ -48,7 +48,7 @@ PROPERTY_SOURCE(TechDraw::DrawTemplate, App::DocumentObject)
const char* DrawTemplate::OrientationEnums[]= {"Portrait",
"Landscape",
NULL};
nullptr};
@@ -111,7 +111,7 @@ void DrawTemplate::onChanged(const App::Property* prop)
App::DocumentObjectExecReturn *DrawTemplate::execute(void)
{
DrawPage *page = 0;
DrawPage *page = nullptr;
std::vector<App::DocumentObject*> parent = getInList();
for (std::vector<App::DocumentObject*>::iterator it = parent.begin(); it != parent.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) {

View File

@@ -41,7 +41,7 @@ std::string DrawTemplatePy::representation(void) const
PyObject *DrawTemplatePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawTemplatePy::setCustomAttributes(const char* attr, PyObject* obj)

View File

@@ -47,7 +47,7 @@ DrawTile::DrawTile(void)
{
static const char *group = "Tile";
ADD_PROPERTY_TYPE(TileParent,(0),group,(App::PropertyType)(App::Prop_None),
ADD_PROPERTY_TYPE(TileParent,(nullptr),group,(App::PropertyType)(App::Prop_None),
"Object to which this tile is attached");
ADD_PROPERTY_TYPE(TileRow, (0), group, App::Prop_None, "Row in parent object\n 0 for arrow side, -1 for other side");
ADD_PROPERTY_TYPE(TileColumn, (0), group, App::Prop_None, "Column in parent object");

View File

@@ -45,7 +45,7 @@ std::string DrawTilePy::representation(void) const
PyObject *DrawTilePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawTilePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -54,8 +54,8 @@ DrawTileWeld::DrawTileWeld(void)
ADD_PROPERTY_TYPE(LeftText,(""),group,(App::PropertyType)(App::Prop_None),
"Text before symbol");
ADD_PROPERTY_TYPE(RightText, (0), group, App::Prop_None, "Text after symbol");
ADD_PROPERTY_TYPE(CenterText, (0), group, App::Prop_None, "Text above/below symbol");
ADD_PROPERTY_TYPE(RightText, (nullptr), group, App::Prop_None, "Text after symbol");
ADD_PROPERTY_TYPE(CenterText, (nullptr), group, App::Prop_None, "Text above/below symbol");
ADD_PROPERTY_TYPE(SymbolFile, (prefSymbol()), group, App::Prop_None, "Symbol File");
ADD_PROPERTY_TYPE(SymbolIncluded, (""), group, App::Prop_None,
"Embedded Symbol. System use only."); // n/a to end users

View File

@@ -45,7 +45,7 @@ std::string DrawTileWeldPy::representation(void) const
PyObject *DrawTileWeldPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawTileWeldPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -64,7 +64,7 @@ using namespace TechDraw;
const char* DrawView::ScaleTypeEnums[]= {"Page",
"Automatic",
"Custom",
NULL};
nullptr};
App::PropertyFloatConstraint::Constraints DrawView::scaleRange = {Precision::Confusion(),
std::numeric_limits<double>::max(),
(0.1)}; // increment by 0.1
@@ -293,8 +293,8 @@ int DrawView::countParentPages() const
DrawPage* DrawView::findParentPage() const
{
// Get Feature Page
DrawPage *page = 0;
DrawViewCollection *collection = 0;
DrawPage *page = nullptr;
DrawViewCollection *collection = nullptr;
std::vector<App::DocumentObject*> parent = getInList();
for (std::vector<App::DocumentObject*>::iterator it = parent.begin(); it != parent.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) {
@@ -318,8 +318,8 @@ std::vector<DrawPage*> DrawView::findAllParentPages() const
{
// Get Feature Page
std::vector<DrawPage*> result;
DrawPage *page = 0;
DrawViewCollection *collection = 0;
DrawPage *page = nullptr;
DrawViewCollection *collection = nullptr;
std::vector<App::DocumentObject*> parent = getInList();
for (std::vector<App::DocumentObject*>::iterator it = parent.begin(); it != parent.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) {

View File

@@ -53,7 +53,7 @@ const char* DrawViewAnnotation::TextStyleEnums[]= {"Normal",
"Bold",
"Italic",
"Bold-Italic",
NULL};
nullptr};
DrawViewAnnotation::DrawViewAnnotation(void)
{

View File

@@ -49,7 +49,7 @@ std::string DrawViewAnnotationPy::representation(void) const
PyObject *DrawViewAnnotationPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int DrawViewAnnotationPy::setCustomAttributes(const char* , PyObject *)

View File

@@ -50,13 +50,13 @@ const char* DrawViewArch::RenderModeEnums[]= {"Wireframe",
"Solid",
"Coin",
"Coin mono",
NULL};
nullptr};
DrawViewArch::DrawViewArch(void)
{
static const char *group = "Arch view";
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"SectionPlane or BuildingPart object for this view");
ADD_PROPERTY_TYPE(Source ,(nullptr),group,App::Prop_None,"SectionPlane or BuildingPart object for this view");
Source.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(AllOn ,(false),group,App::Prop_None,"If hidden objects must be shown or not");
RenderMode.setEnums(RenderModeEnums);

View File

@@ -88,12 +88,12 @@ const char* DrawViewBalloon::balloonTypeEnums[]= {"Circular",
"Square",
"Rectangle",
"Line",
NULL};
nullptr};
DrawViewBalloon::DrawViewBalloon(void)
{
ADD_PROPERTY_TYPE(Text, (""), "", App::Prop_None, "The text to be displayed");
ADD_PROPERTY_TYPE(SourceView, (0), "", (App::PropertyType)(App::Prop_None), "Source view for balloon");
ADD_PROPERTY_TYPE(SourceView, (nullptr), "", (App::PropertyType)(App::Prop_None), "Source view for balloon");
ADD_PROPERTY_TYPE(OriginX, (0), "", (App::PropertyType)(App::Prop_None), "Balloon origin x");
ADD_PROPERTY_TYPE(OriginY, (0), "", (App::PropertyType)(App::Prop_None), "Balloon origin y");

View File

@@ -53,7 +53,7 @@ DrawViewClip::DrawViewClip(void)
ADD_PROPERTY_TYPE(Height ,(100),group,App::Prop_None,"The height of the view area of this clip");
ADD_PROPERTY_TYPE(Width ,(100),group,App::Prop_None,"The width of the view area of this clip");
ADD_PROPERTY_TYPE(ShowFrame ,(0) ,group,App::Prop_None,"Specifies if the clip frame appears on the page or not");
ADD_PROPERTY_TYPE(Views ,(0) ,group,App::Prop_None,"The Views in this Clip group");
ADD_PROPERTY_TYPE(Views ,(nullptr) ,group,App::Prop_None,"The Views in this Clip group");
Views.setScope(App::LinkScope::Global);
// hide N/A properties

View File

@@ -49,7 +49,7 @@ PyObject* DrawViewClipPy::addView(PyObject* args)
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &pcDocObj)) {
Base::Console().Error("Error: DrawViewClipPy::addView - Bad Arg - not DocumentObject\n");
return NULL;
return nullptr;
//TODO: sb PyErr??
//PyErr_SetString(PyExc_TypeError,"addView expects a DrawView");
//return -1;
@@ -73,7 +73,7 @@ PyObject* DrawViewClipPy::removeView(PyObject* args)
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &pcDocObj)) {
Base::Console().Error("Error: DrawViewClipPy::removeView - Bad Arg - not DocumentObject\n");
return NULL;
return nullptr;
//TODO: sb PyErr??
//PyErr_SetString(PyExc_TypeError,"removeView expects a DrawView");
//return -1;
@@ -111,7 +111,7 @@ PyObject* DrawViewClipPy::getChildViewNames(PyObject* args)
PyObject *DrawViewClipPy::getCustomAttributes(const char* ) const
{
return 0;
return nullptr;
}
int DrawViewClipPy::setCustomAttributes(const char* , PyObject *)

View File

@@ -47,7 +47,7 @@ DrawViewCollection::DrawViewCollection()
{
nowUnsetting = false;
static const char *group = "Collection";
ADD_PROPERTY_TYPE(Views ,(0), group, App::Prop_None,"Collection Views");
ADD_PROPERTY_TYPE(Views ,(nullptr), group, App::Prop_None,"Collection Views");
Views.setScope(App::LinkScope::Global);
}

View File

@@ -74,7 +74,7 @@ PyObject* DrawViewCollectionPy::removeView(PyObject* args)
PyObject *DrawViewCollectionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawViewCollectionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -106,7 +106,7 @@ DrawViewDetail::DrawViewDetail()
{
static const char *dgroup = "Detail";
ADD_PROPERTY_TYPE(BaseView ,(0),dgroup,App::Prop_None,"2D View source for this Section");
ADD_PROPERTY_TYPE(BaseView ,(nullptr),dgroup,App::Prop_None,"2D View source for this Section");
BaseView.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(AnchorPoint ,(0,0,0) ,dgroup,App::Prop_None,"Location of detail in BaseView");
ADD_PROPERTY_TYPE(Radius,(10.0),dgroup, App::Prop_None, "Size of detail area");

View File

@@ -68,9 +68,9 @@ DrawViewDimExtent::DrawViewDimExtent(void)
//Cosmetic End points are stored in DVD::References2d
App::PropertyLinkSubList Source3d; //Part::Feature & SubElements TBI
ADD_PROPERTY_TYPE(Source,(0,0),"",(App::PropertyType)(App::Prop_Output),"View (Edges) to dimension");
ADD_PROPERTY_TYPE(Source,(nullptr,nullptr),"",(App::PropertyType)(App::Prop_Output),"View (Edges) to dimension");
Source.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(Source3d,(0,0),"",(App::PropertyType)(App::Prop_Output),"View (Edges) to dimension"); //TBI
ADD_PROPERTY_TYPE(Source3d,(nullptr,nullptr),"",(App::PropertyType)(App::Prop_Output),"View (Edges) to dimension"); //TBI
Source3d.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(DirExtent ,(0),"",App::Prop_Output,"Horizontal / Vertical");

View File

@@ -53,7 +53,7 @@ PyObject* DrawViewDimExtentPy::tbd(PyObject* args)
PyObject *DrawViewDimExtentPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawViewDimExtentPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -92,11 +92,11 @@ const char* DrawViewDimension::TypeEnums[]= {"Distance",
"Diameter",
"Angle",
"Angle3Pt",
NULL};
nullptr};
const char* DrawViewDimension::MeasureTypeEnums[]= {"True",
"Projected",
NULL};
nullptr};
// constraint to set the step size to 0.1
static const App::PropertyQuantityConstraint::Constraints ToleranceConstraint = { -DBL_MAX, DBL_MAX, 0.1 };
@@ -105,9 +105,9 @@ static const App::PropertyQuantityConstraint::Constraints PositiveConstraint = {
DrawViewDimension::DrawViewDimension(void)
{
ADD_PROPERTY_TYPE(References2D, (0,0), "", (App::Prop_None), "Projected Geometry References");
ADD_PROPERTY_TYPE(References2D, (nullptr,nullptr), "", (App::Prop_None), "Projected Geometry References");
References2D.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(References3D, (0,0), "", (App::Prop_None), "3D Geometry References");
ADD_PROPERTY_TYPE(References3D, (nullptr,nullptr), "", (App::Prop_None), "3D Geometry References");
References3D.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(FormatSpec, (getDefaultFormatSpec()), "Format", App::Prop_Output,"Dimension format");
@@ -175,7 +175,7 @@ DrawViewDimension::DrawViewDimension(void)
DrawViewDimension::~DrawViewDimension()
{
delete measurement;
measurement = 0;
measurement = nullptr;
}
void DrawViewDimension::onChanged(const App::Property* prop)

View File

@@ -117,7 +117,7 @@ PyObject* DrawViewDimensionPy::getArrowPositions(PyObject* args)
}
PyObject *DrawViewDimensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawViewDimensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -51,7 +51,7 @@ DrawViewDraft::DrawViewDraft(void)
{
static const char *group = "Draft view";
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Draft object for this view");
ADD_PROPERTY_TYPE(Source ,(nullptr),group,App::Prop_None,"Draft object for this view");
Source.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(LineWidth,(0.35),group,App::Prop_None,"Line width of this view. If Override Style is false, this value multiplies the object line width");
ADD_PROPERTY_TYPE(FontSize,(12.0),group,App::Prop_None,"Text size for this view");

View File

@@ -79,7 +79,7 @@ DrawViewMulti::DrawViewMulti()
static const char *group = "Projection";
//properties that affect Geometry
ADD_PROPERTY_TYPE(Sources ,(0),group,App::Prop_None,"3D Shapes to view");
ADD_PROPERTY_TYPE(Sources ,(nullptr),group,App::Prop_None,"3D Shapes to view");
Sources.setScope(App::LinkScope::Global);
//Source is replaced by Sources in Multi
Source.setStatus(App::Property::ReadOnly,true);

View File

@@ -127,7 +127,7 @@ PROPERTY_SOURCE_WITH_EXTENSIONS(TechDraw::DrawViewPart,
TechDraw::DrawView)
DrawViewPart::DrawViewPart(void) :
geometryObject(0)
geometryObject(nullptr)
{
static const char *group = "Projection";
static const char *sgroup = "HLR Parameters";
@@ -142,10 +142,10 @@ DrawViewPart::DrawViewPart(void) :
double defDist = hGrp->GetFloat("FocusDistance",100.0);
//properties that affect Geometry
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"3D Shape to view");
ADD_PROPERTY_TYPE(Source ,(nullptr),group,App::Prop_None,"3D Shape to view");
Source.setScope(App::LinkScope::Global);
Source.setAllowExternal(true);
ADD_PROPERTY_TYPE(XSource ,(0),group,App::Prop_None,"External 3D Shape to view");
ADD_PROPERTY_TYPE(XSource ,(nullptr),group,App::Prop_None,"External 3D Shape to view");
ADD_PROPERTY_TYPE(Direction ,(0.0,-1.0,0.0),
@@ -724,11 +724,11 @@ TechDraw::BaseGeomPtr DrawViewPart::getGeomByIndex(int idx) const
const std::vector<TechDraw::BaseGeomPtr> &geoms = getEdgeGeometry();
if (geoms.empty()) {
Base::Console().Log("INFO - getGeomByIndex(%d) - no Edge Geometry. Probably restoring?\n",idx);
return NULL;
return nullptr;
}
if ((unsigned)idx >= geoms.size()) {
Base::Console().Log("INFO - getGeomByIndex(%d) - invalid index\n",idx);
return NULL;
return nullptr;
}
return geoms.at(idx);
}
@@ -739,11 +739,11 @@ TechDraw::VertexPtr DrawViewPart::getProjVertexByIndex(int idx) const
const std::vector<TechDraw::VertexPtr> &geoms = getVertexGeometry();
if (geoms.empty()) {
Base::Console().Log("INFO - getProjVertexByIndex(%d) - no Vertex Geometry. Probably restoring?\n",idx);
return NULL;
return nullptr;
}
if ((unsigned)idx >= geoms.size()) {
Base::Console().Log("INFO - getProjVertexByIndex(%d) - invalid index\n",idx);
return NULL;
return nullptr;
}
return geoms.at(idx);
}

View File

@@ -788,7 +788,7 @@ PyObject* DrawViewPartPy::getVertexBySelection(PyObject *args)
//==============================================================================
PyObject *DrawViewPartPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawViewPartPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -39,7 +39,7 @@ std::string DrawViewPy::representation(void) const
PyObject *DrawViewPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawViewPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -100,13 +100,13 @@ const char* DrawViewSection::SectionDirEnums[]= {"Right",
"Left",
"Up",
"Down",
NULL};
nullptr};
const char* DrawViewSection::CutSurfaceEnums[]= {"Hide",
"Color",
"SvgHatch",
"PatHatch",
NULL};
nullptr};
//===========================================================================
@@ -121,7 +121,7 @@ DrawViewSection::DrawViewSection()
static const char *fgroup = "Cut Surface Format";
ADD_PROPERTY_TYPE(SectionSymbol ,(""),sgroup,App::Prop_None,"The identifier for this section");
ADD_PROPERTY_TYPE(BaseView ,(0),sgroup,App::Prop_None,"2D View source for this Section");
ADD_PROPERTY_TYPE(BaseView ,(nullptr),sgroup,App::Prop_None,"2D View source for this Section");
BaseView.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(SectionNormal ,(0,0,1.0) ,sgroup,App::Prop_None,
"Section Plane normal direction"); //direction of extrusion of cutting prism

View File

@@ -61,7 +61,7 @@ DrawViewSpreadsheet::DrawViewSpreadsheet(void)
{
static const char *vgroup = "Spreadsheet";
ADD_PROPERTY_TYPE(Source ,(0),vgroup,App::Prop_None,"Spreadsheet to view");
ADD_PROPERTY_TYPE(Source ,(nullptr),vgroup,App::Prop_None,"Spreadsheet to view");
Source.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(CellStart ,("A1"),vgroup,App::Prop_None,"The top left cell of the range to display");
ADD_PROPERTY_TYPE(CellEnd ,("B2"),vgroup,App::Prop_None,"The bottom right cell of the range to display");

View File

@@ -71,7 +71,7 @@ PyObject* DrawViewSymbolPy::dumpSymbol(PyObject *args)
PyObject *DrawViewSymbolPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawViewSymbolPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -53,7 +53,7 @@ DrawWeldSymbol::DrawWeldSymbol(void)
{
static const char *group = "Weld Symbol";
ADD_PROPERTY_TYPE(Leader,(0),group,(App::PropertyType)(App::Prop_None), "Parent Leader");
ADD_PROPERTY_TYPE(Leader,(nullptr),group,(App::PropertyType)(App::Prop_None), "Parent Leader");
ADD_PROPERTY_TYPE(AllAround, (false), group, App::Prop_None, "All Around Symbol on/off");
ADD_PROPERTY_TYPE(FieldWeld, (false), group, App::Prop_None, "Field Weld Symbol on/off");
ADD_PROPERTY_TYPE(AlternatingWeld, (false), group, App::Prop_None, "Alternating Weld true/false");

View File

@@ -58,7 +58,7 @@ std::string DrawWeldSymbolPy::representation(void) const
PyObject *DrawWeldSymbolPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int DrawWeldSymbolPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -50,7 +50,7 @@ PROPERTY_SOURCE(TechDraw::FeatureProjection, Part::Feature)
FeatureProjection::FeatureProjection()
{
static const char *group = "Projection";
ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Shape to project");
ADD_PROPERTY_TYPE(Source ,(nullptr),group,App::Prop_None,"Shape to project");
ADD_PROPERTY_TYPE(Direction ,(Base::Vector3d(0,0,1)),group,App::Prop_None,"Projection direction");
ADD_PROPERTY_TYPE(VCompound ,(true),group,App::Prop_None,"Projection parameter");
ADD_PROPERTY_TYPE(Rg1LineVCompound ,(true),group,App::Prop_None,"Projection parameter");

View File

@@ -44,7 +44,7 @@ PyObject *GeomFormatPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'GeomFormat'.");
return 0;
return nullptr;
}
// constructor method
@@ -56,17 +56,17 @@ int GeomFormatPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* GeomFormatPy::clone(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::GeomFormat* geom = this->getGeomFormatPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create clone of GeomFormat");
return 0;
return nullptr;
}
TechDraw::GeomFormatPy* geompy = static_cast<TechDraw::GeomFormatPy*>(cpy);
@@ -83,17 +83,17 @@ PyObject* GeomFormatPy::clone(PyObject *args)
PyObject* GeomFormatPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
TechDraw::GeomFormat* geom = this->getGeomFormatPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of GeomFormat");
return 0;
return nullptr;
}
TechDraw::GeomFormatPy* geompy = static_cast<TechDraw::GeomFormatPy*>(cpy);
@@ -115,7 +115,7 @@ Py::String GeomFormatPy::getTag(void) const
PyObject *GeomFormatPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeomFormatPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)

View File

@@ -1688,7 +1688,7 @@ void Vertex::createNewTag()
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(0)));
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);

View File

@@ -102,7 +102,7 @@ PyMOD_INIT_FUNC(TechDrawGui)
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
// load dependent module
try {
@@ -110,7 +110,7 @@ PyMOD_INIT_FUNC(TechDrawGui)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = TechDrawGui::initModule();

View File

@@ -174,9 +174,9 @@ private:
PyMem_Free(name);
try {
App::DocumentObject* obj = 0;
Gui::ViewProvider* vp = 0;
MDIViewPage* mdi = 0;
App::DocumentObject* obj = nullptr;
Gui::ViewProvider* vp = nullptr;
MDIViewPage* mdi = nullptr;
if (PyObject_TypeCheck(pageObj, &(App::DocumentObjectPy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(pageObj)->getDocumentObjectPtr();
vp = Gui::Application::Instance->getViewProvider(obj);
@@ -220,9 +220,9 @@ private:
PyMem_Free(name);
try {
App::DocumentObject* obj = 0;
Gui::ViewProvider* vp = 0;
MDIViewPage* mdi = 0;
App::DocumentObject* obj = nullptr;
Gui::ViewProvider* vp = nullptr;
MDIViewPage* mdi = nullptr;
if (PyObject_TypeCheck(pageObj, &(App::DocumentObjectPy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(pageObj)->getDocumentObjectPtr();
vp = Gui::Application::Instance->getViewProvider(obj);
@@ -326,8 +326,8 @@ private:
}
try {
App::DocumentObject* obj = 0;
Gui::ViewProvider* vp = 0;
App::DocumentObject* obj = nullptr;
Gui::ViewProvider* vp = nullptr;
QGIView* qgiv = nullptr;
if (PyObject_TypeCheck(viewPy, &(TechDraw::DrawViewPy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(viewPy)->getDocumentObjectPtr();

View File

@@ -322,7 +322,7 @@ void CmdTechDrawView::activated(int iMsg)
std::string faceName;
int resolve = 1; //mystery
bool single = false; //mystery
auto selection = getSelection().getSelectionEx(0,
auto selection = getSelection().getSelectionEx(nullptr,
App::DocumentObject::getClassTypeId(),
resolve,
single);
@@ -601,7 +601,7 @@ void CmdTechDrawProjectionGroup::activated(int iMsg)
std::string faceName;
int resolve = 1; //mystery
bool single = false; //mystery
auto selection = getSelection().getSelectionEx(0,
auto selection = getSelection().getSelectionEx(nullptr,
App::DocumentObject::getClassTypeId(),
resolve,
single);
@@ -976,8 +976,8 @@ void CmdTechDrawClipGroupAdd::activated(int iMsg)
return;
}
TechDraw::DrawViewClip* clip = 0;
TechDraw::DrawView* view = 0;
TechDraw::DrawViewClip* clip = nullptr;
TechDraw::DrawView* view = nullptr;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
for (; itSel != selection.end(); itSel++) {
if ((*itSel).getObject()->isDerivedFrom(TechDraw::DrawViewClip::getClassTypeId())) {

View File

@@ -268,7 +268,7 @@ void CmdTechDrawRadiusDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -281,7 +281,7 @@ void CmdTechDrawRadiusDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::vector<App::DocumentObject *> objs;
@@ -390,7 +390,7 @@ void CmdTechDrawDiameterDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -403,7 +403,7 @@ void CmdTechDrawDiameterDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::vector<App::DocumentObject *> objs;
@@ -511,7 +511,7 @@ void CmdTechDrawLengthDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -524,7 +524,7 @@ void CmdTechDrawLengthDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::string dimType;
@@ -614,7 +614,7 @@ void CmdTechDrawHorizontalDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -627,7 +627,7 @@ void CmdTechDrawHorizontalDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::string dimType;
@@ -717,7 +717,7 @@ void CmdTechDrawVerticalDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -730,7 +730,7 @@ void CmdTechDrawVerticalDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::string dimType;
@@ -818,7 +818,7 @@ void CmdTechDrawAngleDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -831,7 +831,7 @@ void CmdTechDrawAngleDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::vector<App::DocumentObject *> objs;
@@ -906,7 +906,7 @@ void CmdTechDraw3PtAngleDimension::activated(int iMsg)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx();
TechDraw::DrawViewPart * objFeat = 0;
TechDraw::DrawViewPart * objFeat = nullptr;
std::vector<std::string> SubNames;
std::vector<Gui::SelectionObject>::iterator itSel = selection.begin();
@@ -919,7 +919,7 @@ void CmdTechDraw3PtAngleDimension::activated(int iMsg)
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension *dim = 0;
TechDraw::DrawViewDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("Dimension");
std::vector<App::DocumentObject *> objs;
@@ -1000,10 +1000,10 @@ void CmdTechDrawLinkDimension::activated(int iMsg)
if (!result)
return;
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx(0,
std::vector<Gui::SelectionObject> selection = getSelection().getSelectionEx(nullptr,
App::DocumentObject::getClassTypeId(),0);
App::DocumentObject* obj3D = 0;
App::DocumentObject* obj3D = nullptr;
std::vector<App::DocumentObject*> parts;
std::vector<std::string> subs;
@@ -1362,7 +1362,7 @@ void CmdTechDrawLandmarkDimension::activated(int iMsg)
std::string parentName = dvp->getNameInDocument();
std::string PageName = page->getNameInDocument();
TechDraw::LandmarkDimension *dim = 0;
TechDraw::LandmarkDimension *dim = nullptr;
std::string FeatName = getUniqueObjectName("LandmarkDim");
openCommand(QT_TRANSLATE_NOOP("Command", "Create Dimension"));

View File

@@ -2281,7 +2281,7 @@ namespace TechDrawGui {
{
TechDraw::DrawPage* page = objFeat->findParentPage();
std::string PageName = page->getNameInDocument();
TechDraw::DrawViewDimension* dim = 0;
TechDraw::DrawViewDimension* dim = nullptr;
std::string FeatName = cmd->getUniqueObjectName("Dimension");
std::vector<App::DocumentObject*> objs;
std::vector<std::string> subs;

View File

@@ -34,7 +34,7 @@ class TechDrawGuiExport DlgPageChooser : public QDialog
public:
DlgPageChooser(const std::vector<std::string> labels,
const std::vector<std::string> names,
QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags());
QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
~DlgPageChooser();
std::string getSelection() const;

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawAdvancedImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawAdvancedImp( QWidget* parent = 0 );
DlgPrefsTechDrawAdvancedImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawAdvancedImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawAnnotationImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawAnnotationImp( QWidget* parent = 0 );
DlgPrefsTechDrawAnnotationImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawAnnotationImp();
public Q_SLOTS:

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawColorsImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawColorsImp( QWidget* parent = 0 );
DlgPrefsTechDrawColorsImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawColorsImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawDimensionsImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawDimensionsImp( QWidget* parent = 0 );
DlgPrefsTechDrawDimensionsImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawDimensionsImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawGeneralImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawGeneralImp( QWidget* parent = 0 );
DlgPrefsTechDrawGeneralImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawGeneralImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawHLRImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawHLRImp( QWidget* parent = 0 );
DlgPrefsTechDrawHLRImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawHLRImp();
protected:

View File

@@ -36,7 +36,7 @@ class DlgPrefsTechDrawScaleImp : public Gui::Dialog::PreferencePage
Q_OBJECT
public:
DlgPrefsTechDrawScaleImp( QWidget* parent = 0 );
DlgPrefsTechDrawScaleImp( QWidget* parent = nullptr );
~DlgPrefsTechDrawScaleImp();
protected Q_SLOTS:

View File

@@ -123,7 +123,7 @@ double Grabber3d::copyActiveViewToSvgFile(App::Document* appDoc,
pCam = nullptr;
//make a view for rendering Svg
View3DInventor* view3DI = new View3DInventor(0, 0); //essentially an undisplayed mdi
View3DInventor* view3DI = new View3DInventor(nullptr, nullptr); //essentially an undisplayed mdi
// view3DI->setWindowTitle(QString::fromUtf8("SvgRenderViewer")); //fluff
// Gui::getMainWindow()->addWindow(view3DI); //just for debugging. comment for release.

View File

@@ -1157,7 +1157,7 @@ void MDIViewPage::setTreeToSceneSelect(void)
QList<QGraphicsItem*> sceneSel = m_qgSceneSelected;
for (QList<QGraphicsItem*>::iterator it = sceneSel.begin(); it != sceneSel.end(); ++it) {
QGIView *itemView = dynamic_cast<QGIView *>(*it);
if(itemView == 0) {
if(itemView == nullptr) {
QGIEdge *edge = dynamic_cast<QGIEdge *>(*it);
if(edge) {
QGraphicsItem*parent = edge->parentItem();
@@ -1332,7 +1332,7 @@ bool MDIViewPage::compareSelections(std::vector<Gui::SelectionObject> treeSel, Q
for (auto sn:sceneSel){
QGIView *itemView = dynamic_cast<QGIView *>(sn);
if(itemView == 0) {
if(itemView == nullptr) {
QGIDatumLabel* dl = dynamic_cast<QGIDatumLabel*>(sn);
QGIPrimPath* pp = dynamic_cast<QGIPrimPath*>(sn); //count Vertex/Edge/Face
if (pp != nullptr) {

View File

@@ -59,7 +59,7 @@ class TechDrawGuiExport MDIViewPage : public Gui::MDIView, public Gui::Selection
TYPESYSTEM_HEADER();
public:
MDIViewPage(ViewProviderPage *page, Gui::Document* doc, QWidget* parent = 0);
MDIViewPage(ViewProviderPage *page, Gui::Document* doc, QWidget* parent = nullptr);
virtual ~MDIViewPage();
void addChildrenToPage(void);

View File

@@ -44,7 +44,7 @@ public:
enum {Type = QGraphicsItem::UserType + 136};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY);

View File

@@ -47,7 +47,7 @@ public:
int type() const { return Type;}
virtual QRectF boundingRect() const;
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY);
virtual void setRect(QRectF r);

View File

@@ -44,7 +44,7 @@ public:
enum {Type = QGraphicsItem::UserType + 135};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY);

View File

@@ -44,7 +44,7 @@ public:
enum {Type = QGraphicsItem::UserType + 133};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY);

View File

@@ -46,7 +46,7 @@ public:
enum {Type = QGraphicsItem::UserType + 130};
int type() const override { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
virtual QRectF boundingRect() const override;
QRectF tightBoundingRect() const;
QPointF tightBoundingAdjust() const;

View File

@@ -45,7 +45,7 @@ public:
int type() const { return Type;}
virtual QRectF boundingRect() const;
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual void centerAt(QPointF centerPos);
virtual void centerAt(double cX, double cY);

View File

@@ -208,7 +208,7 @@ void QGEPath::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void QGEPath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
QGIView *view = dynamic_cast<QGIView *> (parentItem());
assert(view != 0);
assert(view != nullptr);
Q_UNUSED(view);
Q_EMIT hover(false);

View File

@@ -48,7 +48,7 @@ public:
enum {Type = QGraphicsItem::UserType + 302};
int type() const override { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
@@ -87,7 +87,7 @@ public:
int type() const override { return Type;}
virtual QRectF boundingRect() const override;
virtual QPainterPath shape() const override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
void inEdit(bool b) { m_inEdit = b; }
bool inEdit(void) { return m_inEdit; }

View File

@@ -73,7 +73,7 @@ public:
static double getPrefArrowSize();
static double getOverlapAdjust(int style, double size);
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
protected:
QPainterPath makeFilledTriangle(double length, double width, bool flipped);

View File

@@ -36,7 +36,7 @@ public:
enum {Type = QGraphicsItem::UserType + 171};
int type() const override { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
virtual QRectF boundingRect() const override;
virtual QPainterPath shape() const override;

View File

@@ -43,7 +43,7 @@ public:
enum {Type = QGraphicsItem::UserType + 174};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
void setBounds(double x1,double y1,double x2,double y2);
virtual void draw();

View File

@@ -48,7 +48,7 @@ public:
int type() const { return Type;}
virtual QRectF boundingRect() const;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual void draw();
void setWidth(double w);
void setStyle(Qt::PenStyle s);

View File

@@ -50,7 +50,7 @@ public:
//double getLineWidth() { return m_lineWidth; }
//void setLineWidth(double w);
//QPainterPath shape() const;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr) override;
protected:
//QVariant itemChange(GraphicsItemChange change, const QVariant &value);

View File

@@ -48,7 +48,7 @@
using namespace TechDrawGui;
QGIDrawingTemplate::QGIDrawingTemplate(QGraphicsScene *scene) : QGITemplate(scene),
pathItem(0)
pathItem(nullptr)
{
pathItem = new QGraphicsPathItem;
@@ -63,7 +63,7 @@ QGIDrawingTemplate::QGIDrawingTemplate(QGraphicsScene *scene) : QGITemplate(scen
QGIDrawingTemplate::~QGIDrawingTemplate()
{
pathItem = 0;
pathItem = nullptr;
}
QVariant QGIDrawingTemplate::itemChange(GraphicsItemChange change, const QVariant &value)
@@ -82,7 +82,7 @@ TechDraw::DrawParametricTemplate * QGIDrawingTemplate::getParametricTemplate()
if(pageTemplate && pageTemplate->isDerivedFrom(TechDraw::DrawParametricTemplate::getClassTypeId()))
return static_cast<TechDraw::DrawParametricTemplate *>(pageTemplate);
else
return 0;
return nullptr;
}
void QGIDrawingTemplate::draw()

View File

@@ -39,7 +39,7 @@ public:
int type() const override { return Type;}
virtual QRectF boundingRect() const override;
virtual QPainterPath shape() const override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
int getProjIndex() const { return projIndex; }

View File

@@ -56,7 +56,7 @@ public:
int type() const override { return Type;}
QRectF boundingRect() const override;
QPainterPath shape() const override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
public:
enum fillMode {

View File

@@ -55,7 +55,7 @@ public:
virtual void paint(QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget = 0 ) override;
QWidget * widget = nullptr ) override;
void setBounds(double x1,double y1,double x2,double y2);
void setReference(char* sym);

View File

@@ -63,7 +63,7 @@ public:
int type() const override { return Type;}
virtual void paint( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget = 0 ) override;
QWidget * widget = nullptr ) override;
virtual QRectF boundingRect() const override;
virtual QPainterPath shape(void) const override;

View File

@@ -50,7 +50,7 @@ public:
enum {Type = QGraphicsItem::UserType + 205};
int type() const { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr );
virtual QRectF boundingRect() const;
virtual void setSize(double w, double h) {m_height = h; m_width = w;}

View File

@@ -44,7 +44,7 @@ public:
enum {Type = QGraphicsItem::UserType + 170};
int type() const override { return Type;}
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = nullptr ) override;
virtual QPainterPath shape() const override { return path(); }
void setHighlighted(bool state);

View File

@@ -193,7 +193,7 @@ QGIView * QGIProjGroup::getAnchorQItem() const
return view;
}
}
return 0;
return nullptr;
}
void QGIProjGroup::updateView(bool update)

View File

@@ -372,7 +372,7 @@ void QGIRichAnno::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) {
QString text = QString::fromUtf8(annotation->AnnoText.getValue());
QDialog dialog(0);
QDialog dialog(nullptr);
dialog.setWindowTitle(QObject::tr("Rich text editor"));
dialog.setMinimumWidth(400);
dialog.setMinimumHeight(400);

View File

@@ -68,7 +68,7 @@ public:
int type() const override { return Type;}
virtual void paint( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget = 0 ) override;
QWidget * widget = nullptr ) override;
virtual QRectF boundingRect() const override;
virtual QPainterPath shape(void) const override;

View File

@@ -127,7 +127,7 @@ TechDraw::DrawSVGTemplate * QGISVGTemplate::getSVGTemplate()
if(pageTemplate && pageTemplate->isDerivedFrom(TechDraw::DrawSVGTemplate::getClassTypeId()))
return static_cast<TechDraw::DrawSVGTemplate *>(pageTemplate);
else
return 0;
return nullptr;
}
void QGISVGTemplate::draw()

Some files were not shown because too many files have changed in this diff Show More