fix Coverity issues
This commit is contained in:
parent
de7978434d
commit
f3f0f5bd2e
|
@ -102,7 +102,7 @@ App::DocumentObjectExecReturn *FeatureClip::execute(void)
|
|||
const std::vector<App::DocumentObject*> &Grp = Group.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator It= Grp.begin();It!=Grp.end();++It) {
|
||||
if ((*It)->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId())) {
|
||||
Drawing::FeatureView *View = dynamic_cast<Drawing::FeatureView *>(*It);
|
||||
Drawing::FeatureView *View = static_cast<Drawing::FeatureView *>(*It);
|
||||
svg << View->ViewResult.getValue() << endl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,24 +168,24 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
|
|||
const std::vector<App::DocumentObject*> &Grp = Group.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator It= Grp.begin();It!=Grp.end();++It) {
|
||||
if ( (*It)->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId()) ) {
|
||||
Drawing::FeatureView *View = dynamic_cast<Drawing::FeatureView *>(*It);
|
||||
Drawing::FeatureView *View = static_cast<Drawing::FeatureView *>(*It);
|
||||
if (View->Visible.getValue()) {
|
||||
ofile << View->ViewResult.getValue();
|
||||
ofile << tempendl << tempendl << tempendl;
|
||||
}
|
||||
} else if ( (*It)->getTypeId().isDerivedFrom(Drawing::FeatureClip::getClassTypeId()) ) {
|
||||
Drawing::FeatureClip *Clip = dynamic_cast<Drawing::FeatureClip *>(*It);
|
||||
Drawing::FeatureClip *Clip = static_cast<Drawing::FeatureClip *>(*It);
|
||||
if (Clip->Visible.getValue()) {
|
||||
ofile << Clip->ViewResult.getValue();
|
||||
ofile << tempendl << tempendl << tempendl;
|
||||
}
|
||||
} else if ( (*It)->getTypeId().isDerivedFrom(App::DocumentObjectGroup::getClassTypeId()) ) {
|
||||
// getting children inside subgroups too
|
||||
App::DocumentObjectGroup *SubGroup = dynamic_cast<App::DocumentObjectGroup *>(*It);
|
||||
App::DocumentObjectGroup *SubGroup = static_cast<App::DocumentObjectGroup *>(*It);
|
||||
const std::vector<App::DocumentObject*> &SubGrp = SubGroup->Group.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator Grit= SubGrp.begin();Grit!=SubGrp.end();++Grit) {
|
||||
if ( (*Grit)->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId()) ) {
|
||||
Drawing::FeatureView *SView = dynamic_cast<Drawing::FeatureView *>(*Grit);
|
||||
Drawing::FeatureView *SView = static_cast<Drawing::FeatureView *>(*Grit);
|
||||
if (SView->Visible.getValue()) {
|
||||
ofile << SView->ViewResult.getValue();
|
||||
ofile << tempendl << tempendl << tempendl;
|
||||
|
|
|
@ -302,8 +302,6 @@ Py::Object StdMeshers_AutomaticLengthPy::getLength(const Py::Tuple& args)
|
|||
const TopoDS_Shape& s = shape.extensionObject()->getTopoShapePtr()->getShape();
|
||||
return Py::Float(hypothesis<StdMeshers_AutomaticLength>()->GetLength(m->getSMesh(),s));
|
||||
}
|
||||
|
||||
throw Py::Exception();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
|
@ -872,7 +872,7 @@ void DefineNodesCallback(void * ud, SoEventCallback * n)
|
|||
if(docObj.size() !=1)
|
||||
return;
|
||||
|
||||
const SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(dynamic_cast<Fem::FemMeshObject*>(docObj[0])->FemMesh.getValue().getSMesh())->GetMeshDS();
|
||||
const SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(static_cast<Fem::FemMeshObject*>(docObj[0])->FemMesh.getValue().getSMesh())->GetMeshDS();
|
||||
|
||||
SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
|
||||
Base::Vector3f pt2d;
|
||||
|
|
|
@ -55,9 +55,10 @@ TaskDlgMeshShapeNetgen::TaskDlgMeshShapeNetgen(FemGui::ViewProviderFemMeshShapeN
|
|||
: TaskDialog(),ViewProviderFemMeshShapeNetgen(obj)
|
||||
{
|
||||
FemMeshShapeNetgenObject = dynamic_cast<Fem::FemMeshShapeNetgenObject *>(obj->getObject());
|
||||
param = new TaskTetParameter(FemMeshShapeNetgenObject);
|
||||
|
||||
Content.push_back(param);
|
||||
if (FemMeshShapeNetgenObject) {
|
||||
param = new TaskTetParameter(FemMeshShapeNetgenObject);
|
||||
Content.push_back(param);
|
||||
}
|
||||
}
|
||||
|
||||
TaskDlgMeshShapeNetgen::~TaskDlgMeshShapeNetgen()
|
||||
|
|
|
@ -473,7 +473,7 @@ std::vector<Base::Vector3d> ViewProviderFemMesh::getSelectionShape(const char* E
|
|||
void ViewProviderFemMesh::setHighlightNodes(const std::set<long>& HighlightedNodes)
|
||||
{
|
||||
if(!HighlightedNodes.empty()){
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>((dynamic_cast<Fem::FemMeshObject*>(this->pcObject)->FemMesh).getValue().getSMesh())->GetMeshDS();
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>((static_cast<Fem::FemMeshObject*>(this->pcObject)->FemMesh).getValue().getSMesh())->GetMeshDS();
|
||||
|
||||
pcAnoCoords->point.setNum(HighlightedNodes.size());
|
||||
SbVec3f* verts = pcAnoCoords->point.startEditing();
|
||||
|
@ -685,7 +685,7 @@ void ViewProviderFEMMeshBuilder::buildNodes(const App::Property* prop, std::vect
|
|||
pcFaces = static_cast<SoIndexedFaceSet*>(nodes[1]);
|
||||
}
|
||||
|
||||
if (pcPointsCoord && pcFaces){
|
||||
if (pcPointsCoord && pcFaces && pcLines){
|
||||
std::vector<unsigned long> vFaceElementIdx;
|
||||
std::vector<unsigned long> vNodeElementIdx;
|
||||
bool onlyEdges;
|
||||
|
|
|
@ -224,7 +224,7 @@ Py::List ViewProviderFemMeshPy::getHighlightedNodes(void) const
|
|||
void ViewProviderFemMeshPy::setHighlightedNodes(Py::List arg)
|
||||
{
|
||||
ViewProviderFemMesh* vp = this->getViewProviderFemMeshPtr();
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>((dynamic_cast<Fem::FemMeshObject*>
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>((static_cast<Fem::FemMeshObject*>
|
||||
(vp->getObject())->FemMesh).getValue().getSMesh())->GetMeshDS();
|
||||
|
||||
std::set<long> res;
|
||||
|
|
|
@ -37,7 +37,7 @@ PROPERTY_SOURCE(FemGui::ViewProviderSetNodes, Gui::ViewProviderGeometryObject)
|
|||
|
||||
bool ViewProviderSetNodes::doubleClicked(void)
|
||||
{
|
||||
Gui::TaskView::TaskDialog* dlg = new TaskDlgCreateNodeSet(dynamic_cast<Fem::FemSetNodesObject *>(getObject()));
|
||||
Gui::TaskView::TaskDialog* dlg = new TaskDlgCreateNodeSet(static_cast<Fem::FemSetNodesObject *>(getObject()));
|
||||
Gui::Control().showDialog(dlg);
|
||||
return true;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ bool ViewProviderSetNodes::doubleClicked(void)
|
|||
|
||||
bool ViewProviderSetNodes::setEdit(int ModNum)
|
||||
{
|
||||
Gui::TaskView::TaskDialog* dlg = new TaskDlgCreateNodeSet(dynamic_cast<Fem::FemSetNodesObject *>(getObject()));
|
||||
Gui::TaskView::TaskDialog* dlg = new TaskDlgCreateNodeSet(static_cast<Fem::FemSetNodesObject *>(getObject()));
|
||||
Gui::Control().showDialog(dlg);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1532,7 +1532,6 @@ private:
|
|||
#else
|
||||
throw Py::RuntimeError("FreeCAD compiled without FreeType support! This method is disabled...");
|
||||
#endif
|
||||
return Py::None();
|
||||
}
|
||||
Py::Object exportUnits(const Py::Tuple& args)
|
||||
{
|
||||
|
|
|
@ -88,7 +88,7 @@ void ViewProviderBoolean::updateData(const App::Property* prop)
|
|||
Part::Boolean* objBool = dynamic_cast<Part::Boolean*>(getObject());
|
||||
Part::Feature* objBase = dynamic_cast<Part::Feature*>(objBool->Base.getValue());
|
||||
Part::Feature* objTool = dynamic_cast<Part::Feature*>(objBool->Tool.getValue());
|
||||
if (objBase && objTool) {
|
||||
if (objBool && objBase && objTool) {
|
||||
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
|
||||
const TopoDS_Shape& toolShape = objTool->Shape.getValue();
|
||||
const TopoDS_Shape& boolShape = objBool->Shape.getValue();
|
||||
|
@ -176,7 +176,7 @@ void ViewProviderMultiFuse::updateData(const App::Property* prop)
|
|||
if (prop->getTypeId() == Part::PropertyShapeHistory::getClassTypeId()) {
|
||||
const std::vector<Part::ShapeHistory>& hist = static_cast<const Part::PropertyShapeHistory*>
|
||||
(prop)->getValues();
|
||||
Part::MultiFuse* objBool = dynamic_cast<Part::MultiFuse*>(getObject());
|
||||
Part::MultiFuse* objBool = static_cast<Part::MultiFuse*>(getObject());
|
||||
std::vector<App::DocumentObject*> sources = objBool->Shapes.getValues();
|
||||
if (hist.size() != sources.size())
|
||||
return;
|
||||
|
@ -192,6 +192,8 @@ void ViewProviderMultiFuse::updateData(const App::Property* prop)
|
|||
int index=0;
|
||||
for (std::vector<App::DocumentObject*>::iterator it = sources.begin(); it != sources.end(); ++it, ++index) {
|
||||
Part::Feature* objBase = dynamic_cast<Part::Feature*>(*it);
|
||||
if (!objBase)
|
||||
continue;
|
||||
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
|
||||
|
||||
TopTools_IndexedMapOfShape baseMap;
|
||||
|
@ -293,7 +295,7 @@ void ViewProviderMultiCommon::updateData(const App::Property* prop)
|
|||
if (prop->getTypeId() == Part::PropertyShapeHistory::getClassTypeId()) {
|
||||
const std::vector<Part::ShapeHistory>& hist = static_cast<const Part::PropertyShapeHistory*>
|
||||
(prop)->getValues();
|
||||
Part::MultiCommon* objBool = dynamic_cast<Part::MultiCommon*>(getObject());
|
||||
Part::MultiCommon* objBool = static_cast<Part::MultiCommon*>(getObject());
|
||||
std::vector<App::DocumentObject*> sources = objBool->Shapes.getValues();
|
||||
if (hist.size() != sources.size())
|
||||
return;
|
||||
|
@ -309,6 +311,8 @@ void ViewProviderMultiCommon::updateData(const App::Property* prop)
|
|||
int index=0;
|
||||
for (std::vector<App::DocumentObject*>::iterator it = sources.begin(); it != sources.end(); ++it, ++index) {
|
||||
Part::Feature* objBase = dynamic_cast<Part::Feature*>(*it);
|
||||
if (!objBase)
|
||||
continue;
|
||||
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
|
||||
|
||||
TopTools_IndexedMapOfShape baseMap;
|
||||
|
|
Loading…
Reference in New Issue
Block a user