fix Coverity issues
This commit is contained in:
parent
82f7944966
commit
e8b36592c0
|
@ -733,9 +733,6 @@ GProp_GProps AttachEngine::getInertialPropsOfShape(const std::vector<const TopoD
|
|||
default:
|
||||
throw Base::Exception("AttachEngine::getInertialPropsOfShape: unexpected shape type");
|
||||
}
|
||||
|
||||
assert(false);//exec shouldn't ever get here
|
||||
return GProp_GProps();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -346,7 +346,7 @@ bool Extrusion::isInside(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) con
|
|||
// because otherwise we have some intersections which is not allowed
|
||||
else
|
||||
return false;
|
||||
xp.Next();
|
||||
//xp.Next();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -464,9 +464,6 @@ PyObject* GeometryCurvePy::makeRuledSurface(PyObject *args)
|
|||
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* GeometryCurvePy::intersect2d(PyObject *args)
|
||||
|
|
|
@ -2313,11 +2313,11 @@ struct MeshVertex
|
|||
Standard_Integer i;
|
||||
|
||||
MeshVertex(Standard_Real X, Standard_Real Y, Standard_Real Z)
|
||||
: x(X),y(Y),z(Z)
|
||||
: x(X),y(Y),z(Z),i(0)
|
||||
{
|
||||
}
|
||||
MeshVertex(const gp_Pnt& p)
|
||||
: x(p.X()),y(p.Y()),z(p.Z())
|
||||
: x(p.X()),y(p.Y()),z(p.Z()),i(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -624,9 +624,6 @@ PyObject* TopoShapeEdgePy::split(PyObject *args)
|
|||
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Geometry is not a curve");
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* TopoShapeEdgePy::isSeam(PyObject *args)
|
||||
|
|
|
@ -683,10 +683,9 @@ Py::Object TopoShapeFacePy::getOuterWire(void) const
|
|||
TopoDS_Wire clWire = ShapeAnalysis::OuterWire(clFace);
|
||||
return Py::Object(new TopoShapeWirePy(new TopoShape(clWire)),true);
|
||||
}
|
||||
else
|
||||
else {
|
||||
throw Py::Exception("Internal error, TopoDS_Shape is not a face!");
|
||||
|
||||
return Py::Object();
|
||||
}
|
||||
}
|
||||
|
||||
Py::Object TopoShapeFacePy::getMass(void) const
|
||||
|
|
|
@ -683,6 +683,7 @@ void DlgPrimitives::createPrimitive(const QString& placement)
|
|||
|
||||
Location::Location(QWidget* parent)
|
||||
{
|
||||
mode = 0;
|
||||
ui.setupUi(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
EdgeSelection()
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0)
|
||||
{
|
||||
canSelect = false;
|
||||
}
|
||||
bool allow(App::Document*pDoc, App::DocumentObject*pObj, const char*sSubName)
|
||||
{
|
||||
|
|
|
@ -1232,8 +1232,10 @@ void PartGui::ArcEngine::defaultValues()
|
|||
SO_ENGINE_OUTPUT(pointCount, SoSFInt32, setValue(2));
|
||||
}
|
||||
|
||||
PartGui::SteppedSelection::SteppedSelection(const uint& buttonCountIn, QWidget* parent):
|
||||
QWidget(parent)
|
||||
PartGui::SteppedSelection::SteppedSelection(const uint& buttonCountIn, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, stepActive(0)
|
||||
, stepDone(0)
|
||||
{
|
||||
if (buttonCountIn < 1)
|
||||
return;
|
||||
|
|
|
@ -69,7 +69,7 @@ void ViewProviderCompound::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::Compound* objComp = dynamic_cast<Part::Compound*>(getObject());
|
||||
Part::Compound* objComp = static_cast<Part::Compound*>(getObject());
|
||||
std::vector<App::DocumentObject*> sources = objComp->Links.getValues();
|
||||
if (hist.size() != sources.size())
|
||||
return;
|
||||
|
@ -85,6 +85,9 @@ void ViewProviderCompound::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;
|
||||
|
|
|
@ -68,6 +68,10 @@ protected:
|
|||
struct Node {
|
||||
Gui::SoFCSelection *pcHighlight;
|
||||
SoTransform *pcTransform;
|
||||
Node() {
|
||||
pcHighlight = 0;
|
||||
pcTransform = 0;
|
||||
}
|
||||
};
|
||||
|
||||
std::list<Node> NodeList;
|
||||
|
|
|
@ -239,7 +239,7 @@ void ViewProviderFillet::updateData(const App::Property* prop)
|
|||
return;
|
||||
Part::Fillet* objFill = dynamic_cast<Part::Fillet*>(getObject());
|
||||
Part::Feature* objBase = dynamic_cast<Part::Feature*>(objFill->Base.getValue());
|
||||
if (objBase) {
|
||||
if (objFill && objBase) {
|
||||
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
|
||||
const TopoDS_Shape& fillShape = objFill->Shape.getValue();
|
||||
|
||||
|
@ -342,7 +342,7 @@ void ViewProviderChamfer::updateData(const App::Property* prop)
|
|||
return;
|
||||
Part::Chamfer* objCham = dynamic_cast<Part::Chamfer*>(getObject());
|
||||
Part::Feature* objBase = dynamic_cast<Part::Feature*>(objCham->Base.getValue());
|
||||
if (objBase) {
|
||||
if (objCham && objBase) {
|
||||
const TopoDS_Shape& baseShape = objBase->Shape.getValue();
|
||||
const TopoDS_Shape& chamShape = objCham->Shape.getValue();
|
||||
|
||||
|
|
|
@ -212,8 +212,6 @@ App::DocumentObjectExecReturn *Loft::execute(void)
|
|||
}
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
|
||||
return ProfileBased::execute();
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
|
|
@ -80,9 +80,9 @@ const std::list<gp_Trsf> MultiTransform::getTransformations(const std::vector<Ap
|
|||
|
||||
if (originalFeature->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
|
||||
PartDesign::FeatureAddSub* addFeature = static_cast<PartDesign::FeatureAddSub*>(originalFeature);
|
||||
if(addFeature->getAddSubType() == FeatureAddSub::Additive)
|
||||
original = addFeature->AddSubShape.getShape().getShape();
|
||||
else
|
||||
//if (addFeature->getAddSubType() == FeatureAddSub::Additive)
|
||||
// original = addFeature->AddSubShape.getShape().getShape();
|
||||
//else
|
||||
original = addFeature->AddSubShape.getShape().getShape();
|
||||
}
|
||||
|
||||
|
|
|
@ -317,10 +317,8 @@ App::DocumentObjectExecReturn *Pipe::execute(void)
|
|||
boolOp = refineShapeIfActive(boolOp);
|
||||
Shape.setValue(getSolid(boolOp));
|
||||
}
|
||||
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
|
||||
return ProfileBased::execute();
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
|
|
@ -74,9 +74,9 @@ const std::list<gp_Trsf> Scaled::getTransformations(const std::vector<App::Docum
|
|||
|
||||
if (originalFeature->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
|
||||
PartDesign::FeatureAddSub* Feature = static_cast<PartDesign::FeatureAddSub*>(originalFeature);
|
||||
if(Feature->getAddSubType() == FeatureAddSub::Additive)
|
||||
original = Feature->AddSubShape.getShape().getShape();
|
||||
else
|
||||
//if(Feature->getAddSubType() == FeatureAddSub::Additive)
|
||||
// original = Feature->AddSubShape.getShape().getShape();
|
||||
//else
|
||||
original = Feature->AddSubShape.getShape().getShape();
|
||||
}
|
||||
|
||||
|
|
|
@ -726,29 +726,28 @@ void prepareProfileBased(Gui::Command* cmd, const std::string& which,
|
|||
|
||||
//if a profie is selected we can make our life easy and fast
|
||||
auto selection = cmd->getSelection().getSelectionEx();
|
||||
if(!selection.empty() && selection.front().hasSubNames()) {
|
||||
|
||||
if (!selection.empty() && selection.front().hasSubNames()) {
|
||||
base_worker(selection.front().getObject(), selection.front().getSubNames().front());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//no face profile was selected, do he extended sketch logic
|
||||
|
||||
|
||||
bool bNoSketchWasSelected = false;
|
||||
// Get a valid sketch from the user
|
||||
// First check selections
|
||||
std::vector<App::DocumentObject*> sketches = cmd->getSelection().getObjectsOfType(Part::Part2DObject::getClassTypeId());
|
||||
if (sketches.size() == 0) {//no sketches were selected. Let user pick an object from valid ones available in document
|
||||
if (sketches.empty()) {//no sketches were selected. Let user pick an object from valid ones available in document
|
||||
sketches = cmd->getDocument()->getObjectsOfType(Part::Part2DObject::getClassTypeId());
|
||||
bNoSketchWasSelected = true;
|
||||
}
|
||||
|
||||
if(sketches.empty()) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No sketch to work on"),
|
||||
QObject::tr("No sketch is available in the document"));
|
||||
return;
|
||||
if (sketches.empty()) {
|
||||
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("No sketch to work on"),
|
||||
QObject::tr("No sketch is available in the document"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::vector<PartDesignGui::TaskFeaturePick::featureStatus> status;
|
||||
std::vector<App::DocumentObject*>::iterator firstFreeSketch;
|
||||
int freeSketches = validateSketches(sketches, status, firstFreeSketch);
|
||||
|
@ -778,7 +777,7 @@ void prepareProfileBased(Gui::Command* cmd, const std::string& which,
|
|||
|
||||
// TODO Clean this up (2015-10-20, Fat-Zer)
|
||||
auto* pcActiveBody = PartDesignGui::getBody(false);
|
||||
if(pcActiveBody && !bNoSketchWasSelected && ext) {
|
||||
if (pcActiveBody && !bNoSketchWasSelected && ext) {
|
||||
|
||||
auto* pcActivePart = PartDesignGui::getPartFor(pcActiveBody, false);
|
||||
|
||||
|
@ -805,7 +804,7 @@ void prepareProfileBased(Gui::Command* cmd, const std::string& which,
|
|||
|
||||
// Show sketch choose dialog and let user pick sketch if no sketch was selected and no free one available or
|
||||
// multiple free ones are available
|
||||
if ( bNoSketchWasSelected && (freeSketches != 1) ) {
|
||||
if (bNoSketchWasSelected && (freeSketches != 1) ) {
|
||||
|
||||
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
|
||||
PartDesignGui::TaskDlgFeaturePick *pickDlg = qobject_cast<PartDesignGui::TaskDlgFeaturePick *>(dlg);
|
||||
|
@ -827,21 +826,20 @@ void prepareProfileBased(Gui::Command* cmd, const std::string& which,
|
|||
|
||||
Gui::Selection().clearSelection();
|
||||
pickDlg = new PartDesignGui::TaskDlgFeaturePick(sketches, status, accepter, sketch_worker);
|
||||
if(!bNoSketchWasSelected && ext)
|
||||
if (!bNoSketchWasSelected && ext)
|
||||
pickDlg->showExternal(true);
|
||||
|
||||
Gui::Control().showDialog(pickDlg);
|
||||
}
|
||||
else {
|
||||
std::vector<App::DocumentObject*> theSketch;
|
||||
if(!bNoSketchWasSelected)
|
||||
if (!bNoSketchWasSelected)
|
||||
theSketch.push_back(sketches[0]);
|
||||
else
|
||||
theSketch.push_back(*firstFreeSketch);
|
||||
|
||||
|
||||
sketch_worker(theSketch);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void finishProfileBased(const Gui::Command* cmd, const Part::Feature* sketch, const std::string& FeatName)
|
||||
|
|
|
@ -666,7 +666,6 @@ void CmdPartDesignMoveFeature::activated(int iMsg)
|
|||
bool CmdPartDesignMoveFeature::isActive(void)
|
||||
{
|
||||
return hasActiveDocument () && !PartDesignGui::isLegacyWorkflow ( getDocument () );
|
||||
return hasActiveDocument ();
|
||||
}
|
||||
|
||||
DEF_STD_CMD_A(CmdPartDesignMoveFeatureInTree);
|
||||
|
|
|
@ -177,10 +177,9 @@ void TaskBooleanParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
|
|||
void TaskBooleanParameters::onButtonBodyAdd(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
if (doc != NULL)
|
||||
BooleanView->hide();
|
||||
PartDesign::Boolean* pcBoolean = static_cast<PartDesign::Boolean*>(BooleanView->getObject());
|
||||
Gui::Document* doc = BooleanView->getDocument();
|
||||
BooleanView->hide();
|
||||
if (pcBoolean->Bodies.getValues().empty() && pcBoolean->BaseFeature.getValue())
|
||||
doc->setHide(pcBoolean->BaseFeature.getValue()->getNameInDocument());
|
||||
selectionMode = bodyAdd;
|
||||
|
|
|
@ -51,8 +51,11 @@ TaskDressUpParameters::TaskDressUpParameters(ViewProviderDressUp *DressUpView, b
|
|||
: TaskBox(Gui::BitmapFactory().pixmap((std::string("PartDesign_") + DressUpView->featureName()).c_str()),
|
||||
QString::fromLatin1((DressUpView->featureName() + " parameters").c_str()),
|
||||
true,
|
||||
parent),
|
||||
DressUpView(DressUpView), allowFaces(selectFaces), allowEdges(selectEdges)
|
||||
parent)
|
||||
, proxy(0)
|
||||
, DressUpView(DressUpView)
|
||||
, allowFaces(selectFaces)
|
||||
, allowEdges(selectEdges)
|
||||
{
|
||||
selectionMode = none;
|
||||
}
|
||||
|
@ -192,6 +195,7 @@ void TaskDressUpParameters::exitSelectionMode()
|
|||
|
||||
TaskDlgDressUpParameters::TaskDlgDressUpParameters(ViewProviderDressUp *DressUpView)
|
||||
: TaskDlgFeatureParameters(DressUpView)
|
||||
, parameter(0)
|
||||
{
|
||||
assert(DressUpView);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user