TechDraw: Use freecad_cast whenever possible
This commit is contained in:
committed by
Benjamin Nauck
parent
81c772938e
commit
d9d518f905
@@ -63,7 +63,7 @@ public:
|
||||
bool operator== (const ReferenceEntry& otherRef) const;
|
||||
|
||||
App::DocumentObject* getObject() const;
|
||||
template <class T> T* getObject() const { return dynamic_cast<T*>(getObject()); }
|
||||
template <class T> T* getObject() const { return freecad_cast<T*>(getObject()); }
|
||||
void setObject(App::DocumentObject* docObj) { m_object = docObj; }
|
||||
std::string getSubName(bool longForm = false) const;
|
||||
void setSubName(const std::string& subName) { m_subName = subName; }
|
||||
|
||||
@@ -744,7 +744,7 @@ BaseGeomPtrVector DrawComplexSection::makeSectionLineGeometry()
|
||||
{
|
||||
// Base::Console().Message("DCS::makeSectionLineGeometry()\n");
|
||||
BaseGeomPtrVector result;
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
DrawViewPart* baseDvp = freecad_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
TopoDS_Wire lineWire = makeSectionLineWire();
|
||||
TopoDS_Shape projectedWire =
|
||||
@@ -775,7 +775,7 @@ std::pair<Base::Vector3d, Base::Vector3d> DrawComplexSection::sectionLineEnds()
|
||||
Base::Vector3d first = Base::Vector3d(gpFirst.X(), gpFirst.Y(), gpFirst.Z());
|
||||
Base::Vector3d last = Base::Vector3d(gpLast.X(), gpLast.Y(), gpLast.Z());
|
||||
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
DrawViewPart* baseDvp = freecad_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
first = baseDvp->projectPoint(first);
|
||||
last = baseDvp->projectPoint(last);
|
||||
@@ -831,7 +831,7 @@ std::pair<Base::Vector3d, Base::Vector3d> DrawComplexSection::sectionArrowDirs()
|
||||
Base::Vector3d vDir1 = Base::convertTo<Base::Vector3d>(gDir1);
|
||||
vDir0.Normalize();
|
||||
vDir1.Normalize();
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
DrawViewPart* baseDvp = freecad_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
vDir0 = baseDvp->projectPoint(vDir0, true);
|
||||
vDir1 = baseDvp->projectPoint(vDir1, true);
|
||||
@@ -847,7 +847,7 @@ TopoDS_Wire DrawComplexSection::makeSectionLineWire()
|
||||
{
|
||||
TopoDS_Wire lineWire;
|
||||
App::DocumentObject* toolObj = CuttingToolWireObject.getValue();
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
DrawViewPart* baseDvp = freecad_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
TopoDS_Shape toolShape = Part::Feature::getShape(toolObj);
|
||||
if (toolShape.IsNull()) {
|
||||
@@ -884,7 +884,7 @@ ChangePointVector DrawComplexSection::getChangePointsFromSectionLine()
|
||||
// Base::Console().Message("DCS::getChangePointsFromSectionLine()\n");
|
||||
ChangePointVector result;
|
||||
std::vector<gp_Pnt> allPoints;
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
DrawViewPart* baseDvp = freecad_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
TopoDS_Wire lineWire = makeSectionLineWire();
|
||||
TopoDS_Shape projectedWire =
|
||||
|
||||
@@ -112,7 +112,7 @@ DrawViewDimension* DrawDimHelper::makeExtentDim(DrawViewPart* dvp, std::vector<s
|
||||
Base::Interpreter().runStringArg(
|
||||
"App.activeDocument().%s.DirExtent = %d", dimName.c_str(), dimNum);
|
||||
|
||||
auto* dimExt = dynamic_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
|
||||
auto* dimExt = freecad_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
|
||||
if (!dimExt) {
|
||||
throw Base::TypeError("Dim extent not found");
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void DrawDimHelper::makeExtentDim3d(DrawViewPart* dvp, ReferenceVector reference
|
||||
Base::Interpreter().runStringArg(
|
||||
"App.activeDocument().%s.DirExtent = %d", dimName.c_str(), dimNum);
|
||||
|
||||
auto* dimExt = dynamic_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
|
||||
auto* dimExt = freecad_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
|
||||
if (!dimExt) {
|
||||
throw Base::TypeError("Dim extent not found");
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ void DrawGeomHatch::unsetupObject()
|
||||
{
|
||||
// Base::Console().Message("DGH::unsetupObject() - status: %lu removing: %d \n", getStatus(), isRemoving());
|
||||
App::DocumentObject* source = Source.getValue();
|
||||
DrawView* dv = dynamic_cast<DrawView*>(source);
|
||||
DrawView* dv = freecad_cast<DrawView*>(source);
|
||||
if (dv) {
|
||||
dv->requestPaint();
|
||||
}
|
||||
@@ -211,7 +211,7 @@ std::vector<LineSet> DrawGeomHatch::makeLineSets(std::string fileSpec, std::stri
|
||||
DrawViewPart* DrawGeomHatch::getSourceView() const
|
||||
{
|
||||
App::DocumentObject* obj = Source.getValue();
|
||||
DrawViewPart* result = dynamic_cast<DrawViewPart*>(obj);
|
||||
DrawViewPart* result = freecad_cast<DrawViewPart*>(obj);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ App::DocumentObjectExecReturn *DrawHatch::execute(void)
|
||||
DrawViewPart* DrawHatch::getSourceView(void) const
|
||||
{
|
||||
App::DocumentObject* obj = Source.getValue();
|
||||
DrawViewPart* result = dynamic_cast<DrawViewPart*>(obj);
|
||||
DrawViewPart* result = freecad_cast<DrawViewPart*>(obj);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ void DrawHatch::unsetupObject(void)
|
||||
{
|
||||
// Base::Console().Message("DH::unsetupObject() - status: %lu removing: %d \n", getStatus(), isRemoving());
|
||||
App::DocumentObject* source = Source.getValue();
|
||||
DrawView* dv = dynamic_cast<DrawView*>(source);
|
||||
DrawView* dv = freecad_cast<DrawView*>(source);
|
||||
if (dv) {
|
||||
dv->requestPaint();
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ DrawView* DrawLeaderLine::getBaseView() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto cast = dynamic_cast<DrawView*>(baseObj);
|
||||
auto cast = freecad_cast<DrawView*>(baseObj);
|
||||
return cast;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ void DrawPage::onChanged(const App::Property* prop)
|
||||
// this is needed just to mark the Views to recompute??
|
||||
if (!isRestoring()) {
|
||||
for (auto* obj : getViews()) {
|
||||
auto* view = dynamic_cast<DrawView*>(obj);
|
||||
auto* view = freecad_cast<DrawView*>(obj);
|
||||
if (view && view->ScaleType.isValue("Page")) {
|
||||
if (std::abs(view->Scale.getValue() - Scale.getValue()) > std::numeric_limits<float>::epsilon()) {
|
||||
view->Scale.setValue(Scale.getValue());
|
||||
@@ -128,7 +128,7 @@ void DrawPage::onChanged(const App::Property* prop)
|
||||
else if (prop == &ProjectionType) {
|
||||
// touch all ortho views in the Page as they may be dependent on Projection Type //(is this true?)
|
||||
for (auto* obj : getViews()) {
|
||||
auto* view = dynamic_cast<DrawProjGroup*>(obj);
|
||||
auto* view = freecad_cast<DrawProjGroup*>(obj);
|
||||
if (view && view->ProjectionType.isValue("Default")) {
|
||||
view->ProjectionType.touch();
|
||||
}
|
||||
@@ -239,7 +239,7 @@ int DrawPage::addView(App::DocumentObject* docObj, bool setPosition)
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto* view = dynamic_cast<DrawView*>(docObj);
|
||||
auto* view = freecad_cast<DrawView*>(docObj);
|
||||
|
||||
if (!view) {
|
||||
auto* link = dynamic_cast<App::Link*>(docObj);
|
||||
@@ -247,7 +247,7 @@ int DrawPage::addView(App::DocumentObject* docObj, bool setPosition)
|
||||
return -1;
|
||||
}
|
||||
|
||||
view = dynamic_cast<DrawView*>(link->getLinkedObject());
|
||||
view = freecad_cast<DrawView*>(link->getLinkedObject());
|
||||
if (!view) {
|
||||
return -1;
|
||||
}
|
||||
@@ -339,7 +339,7 @@ void DrawPage::updateAllViews()
|
||||
|
||||
//first, make sure all the Parts have been executed so GeometryObjects exist
|
||||
for (auto& v : featViews) {
|
||||
auto* part = dynamic_cast<DrawViewPart*>(v);
|
||||
auto* part = freecad_cast<DrawViewPart*>(v);
|
||||
if (part) {
|
||||
//view, section, detail, dpgi
|
||||
part->recomputeFeature();
|
||||
@@ -348,12 +348,12 @@ void DrawPage::updateAllViews()
|
||||
//second, do the rest of the views that may depend on a part view
|
||||
//TODO: check if we have 2 layers of dependency (ex. leader > weld > tile?)
|
||||
for (auto& v : featViews) {
|
||||
auto* part = dynamic_cast<DrawViewPart*>(v);
|
||||
auto* part = freecad_cast<DrawViewPart*>(v);
|
||||
if (part) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto* view = dynamic_cast<DrawView*>(v);
|
||||
auto* view = freecad_cast<DrawView*>(v);
|
||||
if (view) {
|
||||
view->overrideKeepUpdated(true);
|
||||
view->recomputeFeature();
|
||||
|
||||
@@ -356,7 +356,7 @@ void DrawProjGroup::getViewArea(std::array<DrawProjGroupItem*, MAXPROJECTIONCOUN
|
||||
App::DocumentObject* DrawProjGroup::getProjObj(const char* viewProjType) const
|
||||
{
|
||||
for (auto it : Views.getValues()) {
|
||||
auto projPtr(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto projPtr(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!projPtr) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
Base::Console().Error("PROBLEM - DPG::getProjObj - non DPGI entry in Views! %s / %s\n",
|
||||
@@ -540,7 +540,7 @@ int DrawProjGroup::purgeProjections()
|
||||
while (!Views.getValues().empty()) {
|
||||
std::vector<DocumentObject*> views = Views.getValues();
|
||||
DocumentObject* dObj = views.back();
|
||||
auto* dpgi = dynamic_cast<DrawProjGroupItem*>(dObj);
|
||||
auto* dpgi = freecad_cast<DrawProjGroupItem*>(dObj);
|
||||
if (dpgi) {
|
||||
std::string itemName = dpgi->Type.getValueAsString();
|
||||
removeProjection(itemName.c_str());
|
||||
@@ -866,7 +866,7 @@ void DrawProjGroup::arrangeViewPointers(
|
||||
|
||||
bool thirdAngle = (strcmp(projType, "Third Angle") == 0);
|
||||
for (auto it : Views.getValues()) {
|
||||
auto oView(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto oView(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!oView) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
Base::Console().Error(
|
||||
@@ -944,7 +944,7 @@ void DrawProjGroup::recomputeChildren()
|
||||
{
|
||||
// Base::Console().Message("DPG::recomputeChildren() - waiting: %d\n", waitingForChildren());
|
||||
for (const auto it : Views.getValues()) {
|
||||
auto view(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto view(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!view) {
|
||||
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
|
||||
}
|
||||
@@ -959,7 +959,7 @@ void DrawProjGroup::autoPositionChildren()
|
||||
// Base::Console().Message("DPG::autoPositionChildren() - %s - waiting: %d\n",
|
||||
// getNameInDocument(), waitingForChildren());
|
||||
for (const auto it : Views.getValues()) {
|
||||
auto view(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto view(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!view) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
|
||||
@@ -977,7 +977,7 @@ void DrawProjGroup::updateChildrenScale()
|
||||
{
|
||||
// Base::Console().Message("DPG::updateChildrenScale() - waiting: %d\n", waitingForChildren());
|
||||
for (const auto it : Views.getValues()) {
|
||||
auto view(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto view(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!view) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
throw Base::TypeError("Error: projection in DPG list is not a DPGI!");
|
||||
@@ -995,7 +995,7 @@ void DrawProjGroup::updateChildrenScale()
|
||||
void DrawProjGroup::updateChildrenSource()
|
||||
{
|
||||
for (const auto it : Views.getValues()) {
|
||||
auto view(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto view(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!view) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
Base::Console().Error(
|
||||
@@ -1019,7 +1019,7 @@ void DrawProjGroup::updateChildrenSource()
|
||||
void DrawProjGroup::updateChildrenLock()
|
||||
{
|
||||
for (const auto it : Views.getValues()) {
|
||||
auto view(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto view(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!view) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
Base::Console().Error(
|
||||
@@ -1034,7 +1034,7 @@ void DrawProjGroup::updateChildrenLock()
|
||||
void DrawProjGroup::updateChildrenEnforce(void)
|
||||
{
|
||||
for (const auto it : Views.getValues()) {
|
||||
auto view(dynamic_cast<DrawProjGroupItem*>(it));
|
||||
auto view(freecad_cast<DrawProjGroupItem*>(it));
|
||||
if (!view) {
|
||||
//if an element in Views is not a DPGI, something really bad has happened somewhere
|
||||
Base::Console().Error(
|
||||
|
||||
@@ -89,7 +89,7 @@ App::DocumentObjectExecReturn *DrawRichAnno::execute()
|
||||
DrawView* DrawRichAnno::getBaseView() const
|
||||
{
|
||||
// Base::Console().Message("DRA::getBaseView() - %s\n", getNameInDocument());
|
||||
return dynamic_cast<DrawView*>(AnnoParent.getValue());
|
||||
return freecad_cast<DrawView*>(AnnoParent.getValue());
|
||||
}
|
||||
|
||||
//finds the first DrawPage in this Document that claims to own this DrawRichAnno
|
||||
@@ -102,7 +102,7 @@ DrawPage* DrawRichAnno::findParentPage() const
|
||||
return DrawView::findParentPage();
|
||||
}
|
||||
|
||||
DrawView* parent = dynamic_cast<DrawView*>(AnnoParent.getValue());
|
||||
DrawView* parent = freecad_cast<DrawView*>(AnnoParent.getValue());
|
||||
if (parent) {
|
||||
return parent->findParentPage();
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void DrawTile::handleChangedPropertyType(Base::XMLReader &reader, const char *Ty
|
||||
DrawView* DrawTile::getParent() const
|
||||
{
|
||||
// Base::Console().Message("DT::getParent() - %s\n", getNameInDocument());
|
||||
return dynamic_cast<DrawView*>(TileParent.getValue());
|
||||
return freecad_cast<DrawView*>(TileParent.getValue());
|
||||
}
|
||||
|
||||
PyObject *DrawTile::getPyObject()
|
||||
|
||||
@@ -660,7 +660,7 @@ void DrawView::setScaleAttribute()
|
||||
//! existence of the parent DrawProjGroup
|
||||
bool DrawView::isProjGroupItem(DrawViewPart* item)
|
||||
{
|
||||
auto dpgi = dynamic_cast<DrawProjGroupItem*>(item);
|
||||
auto dpgi = freecad_cast<DrawProjGroupItem*>(item);
|
||||
if (!dpgi) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ void DrawViewBalloon::handleXYLock()
|
||||
DrawView* DrawViewBalloon::getParentView() const
|
||||
{
|
||||
App::DocumentObject* obj = SourceView.getValue();
|
||||
DrawView* result = dynamic_cast<DrawView*>(obj);
|
||||
DrawView* result = freecad_cast<DrawView*>(obj);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ int DrawViewCollection::addView(App::DocumentObject* docObj)
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto* view = dynamic_cast<DrawView*>(docObj);
|
||||
auto* view = freecad_cast<DrawView*>(docObj);
|
||||
|
||||
if (!view) {
|
||||
auto* link = dynamic_cast<App::Link*>(docObj);
|
||||
@@ -99,7 +99,7 @@ int DrawViewCollection::addView(App::DocumentObject* docObj)
|
||||
}
|
||||
|
||||
if (link) {
|
||||
view = dynamic_cast<DrawView*>(link->getLinkedObject());
|
||||
view = freecad_cast<DrawView*>(link->getLinkedObject());
|
||||
if (!view) {
|
||||
return -1;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ QRectF DrawViewCollection::getRect() const
|
||||
{
|
||||
QRectF result;
|
||||
for (auto& v : getViews()) {
|
||||
auto *view = dynamic_cast<DrawView*>(v);
|
||||
auto *view = freecad_cast<DrawView*>(v);
|
||||
if (!view) {
|
||||
throw Base::ValueError("DrawViewCollection::getRect bad View\n");
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ TopoDS_Shape DrawViewDetail::projectEdgesOntoFace(TopoDS_Shape& edgeShape, TopoD
|
||||
Base::Vector3d DrawViewDetail::mapPoint3dToDetail(const Base::Vector3d& inPoint) const
|
||||
{
|
||||
auto baseObj = BaseView.getValue();
|
||||
auto baseDvp = dynamic_cast<DrawViewPart*>(baseObj);
|
||||
auto baseDvp = freecad_cast<DrawViewPart*>(baseObj);
|
||||
if (!baseDvp) {
|
||||
throw Base::RuntimeError("Detail has no BaseView");
|
||||
}
|
||||
@@ -502,7 +502,7 @@ void DrawViewDetail::handleChangedPropertyType(Base::XMLReader &reader, const ch
|
||||
void DrawViewDetail::unsetupObject()
|
||||
{
|
||||
App::DocumentObject* baseObj = BaseView.getValue();
|
||||
DrawView* base = dynamic_cast<DrawView*>(baseObj);
|
||||
DrawView* base = freecad_cast<DrawView*>(baseObj);
|
||||
if (base) {
|
||||
base->requestPaint();
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ App::DocumentObjectExecReturn *DrawViewDimExtent::execute(void)
|
||||
App::DocumentObject* docObj = Source.getValue();
|
||||
if (!docObj)
|
||||
return App::DocumentObject::StdReturn;
|
||||
DrawViewPart* dvp = dynamic_cast<DrawViewPart*>(docObj);
|
||||
DrawViewPart* dvp = freecad_cast<DrawViewPart*>(docObj);
|
||||
if (!dvp)
|
||||
return App::DocumentObject::StdReturn;
|
||||
|
||||
|
||||
@@ -729,7 +729,7 @@ double DrawViewDimension::getProjectedDimValue() const
|
||||
|
||||
if (Type.isValue("Distance") || Type.isValue("DistanceX") || Type.isValue("DistanceY")) {
|
||||
pointPair pts = getLinearPoints();
|
||||
auto dbv = dynamic_cast<DrawBrokenView*>(getViewPart());
|
||||
auto dbv = freecad_cast<DrawBrokenView*>(getViewPart());
|
||||
if (dbv) {
|
||||
// raw pts from view are inverted Y, so we need to un-invert them before mapping
|
||||
// raw pts are scaled, so we need to unscale them for mapPoint2dFromView
|
||||
|
||||
@@ -972,7 +972,7 @@ ChangePointVector DrawViewSection::getChangePointsFromSectionLine()
|
||||
// Base::Console().Message("Dvs::getChangePointsFromSectionLine()\n");
|
||||
ChangePointVector result;
|
||||
std::vector<gp_Pnt> allPoints;
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
DrawViewPart* baseDvp = freecad_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
std::pair<Base::Vector3d, Base::Vector3d> lineEnds = sectionLineEnds();
|
||||
// make start and end marks
|
||||
|
||||
@@ -77,7 +77,7 @@ void DrawWeldSymbol::onSettingDocument()
|
||||
|
||||
std::string tileName1 = doc->getUniqueObjectName("TileWeld");
|
||||
auto tile1Obj( doc->addObject( "TechDraw::DrawTileWeld", tileName1.c_str() ) );
|
||||
DrawTileWeld* tile1 = dynamic_cast<DrawTileWeld*>(tile1Obj);
|
||||
DrawTileWeld* tile1 = freecad_cast<DrawTileWeld*>(tile1Obj);
|
||||
if (tile1) {
|
||||
tile1->Label.setValue(DrawUtil::translateArbitrary("DrawTileWeld", "TileWeld", tileName1));
|
||||
tile1->TileParent.setValue(this);
|
||||
@@ -85,7 +85,7 @@ void DrawWeldSymbol::onSettingDocument()
|
||||
|
||||
std::string tileName2 = doc->getUniqueObjectName("TileWeld");
|
||||
auto tile2Obj( doc->addObject( "TechDraw::DrawTileWeld", tileName2.c_str() ) );
|
||||
DrawTileWeld* tile2 = dynamic_cast<DrawTileWeld*>(tile2Obj);
|
||||
DrawTileWeld* tile2 = freecad_cast<DrawTileWeld*>(tile2Obj);
|
||||
if (tile2) {
|
||||
tile2->Label.setValue(DrawUtil::translateArbitrary("DrawTileWeld", "TileWeld", tileName2));
|
||||
tile2->TileParent.setValue(this);
|
||||
|
||||
@@ -165,7 +165,7 @@ DrawViewPart* LandmarkDimension::getViewPart() const
|
||||
{
|
||||
std::vector<App::DocumentObject*> refs2d = References2D.getValues();
|
||||
App::DocumentObject* obj = refs2d.front();
|
||||
DrawViewPart* dvp = dynamic_cast<DrawViewPart*>(obj);
|
||||
DrawViewPart* dvp = freecad_cast<DrawViewPart*>(obj);
|
||||
return dvp;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ PyObject *PropertyGeomFormatList::getPyObject()
|
||||
void PropertyGeomFormatList::setPyObject(PyObject *value)
|
||||
{
|
||||
// check container of this property to notify about changes
|
||||
// Part2DObject* part2d = dynamic_cast<Part2DObject*>(this->getContainer());
|
||||
// Part2DObject* part2d = freecad_cast<Part2DObject*>(this->getContainer());
|
||||
|
||||
if (PySequence_Check(value)) {
|
||||
Py::Sequence sequence(value);
|
||||
|
||||
Reference in New Issue
Block a user