Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix -Wextra in PartDesign
  • Loading branch information
wwmayer committed Sep 22, 2016
1 parent 15d7ae5 commit 664cf65
Show file tree
Hide file tree
Showing 40 changed files with 133 additions and 90 deletions.
6 changes: 3 additions & 3 deletions src/Mod/PartDesign/App/Body.cpp
Expand Up @@ -213,7 +213,7 @@ bool Body::isAfterInsertPoint(App::DocumentObject* feature) {
}
}

const bool Body::isMemberOfMultiTransform(const App::DocumentObject* f)
bool Body::isMemberOfMultiTransform(const App::DocumentObject* f)
{
if (f == NULL)
return false;
Expand All @@ -224,7 +224,7 @@ const bool Body::isMemberOfMultiTransform(const App::DocumentObject* f)
static_cast<const PartDesign::Transformed*>(f)->Originals.getValues().empty());
}

const bool Body::isSolidFeature(const App::DocumentObject* f)
bool Body::isSolidFeature(const App::DocumentObject* f)
{
if (f == NULL)
return false;
Expand All @@ -236,7 +236,7 @@ const bool Body::isSolidFeature(const App::DocumentObject* f)
return false;//DeepSOIC: work-in-progress?
}

const bool Body::isAllowed(const App::DocumentObject* f)
bool Body::isAllowed(const App::DocumentObject* f)
{
if (f == NULL)
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/PartDesign/App/Body.h
Expand Up @@ -96,20 +96,20 @@ class PartDesignExport Body : public Part::BodyBase
bool isAfterInsertPoint(App::DocumentObject* feature);

/// Return true if the given feature is member of a MultiTransform feature
static const bool isMemberOfMultiTransform(const App::DocumentObject* f);
static bool isMemberOfMultiTransform(const App::DocumentObject* f);

/**
* Return true if the given feature is a solid feature allowed in a Body. Currently this is only valid
* for features derived from PartDesign::Feature
* Return false if the given feature is a Sketch or a Part::Datum feature
*/
static const bool isSolidFeature(const App::DocumentObject* f);
static bool isSolidFeature(const App::DocumentObject* f);

/**
* Return true if the given feature is allowed in a Body. Currently allowed are
* all features derived from PartDesign::Feature and Part::Datum and sketches
*/
static const bool isAllowed(const App::DocumentObject* f);
static bool isAllowed(const App::DocumentObject* f);

/**
* Return the body which this feature belongs too, or NULL
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/App/FeaturePipe.cpp
Expand Up @@ -369,7 +369,7 @@ void Pipe::setupAlgorithm(BRepOffsetAPI_MakePipeShell& mkPipeShell, TopoDS_Shape
}


void Pipe::getContiniusEdges(Part::TopoShape TopShape, std::vector< std::string >& SubNames) {
void Pipe::getContiniusEdges(Part::TopoShape /*TopShape*/, std::vector< std::string >& /*SubNames*/) {

/*
TopTools_IndexedMapOfShape mapOfEdges;
Expand Down
8 changes: 4 additions & 4 deletions src/Mod/PartDesign/App/FeatureSketchBased.cpp
Expand Up @@ -730,8 +730,8 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism,

}

const bool ProfileBased::checkWireInsideFace(const TopoDS_Wire& wire, const TopoDS_Face& face,
const gp_Dir& dir) {
bool ProfileBased::checkWireInsideFace(const TopoDS_Wire& wire, const TopoDS_Face& face,
const gp_Dir& dir) {
// Project wire onto the face (face, not surface! So limits of face apply)
// FIXME: The results of BRepProj_Projection do not seem to be very stable. Sometimes they return no result
// even in the simplest projection case.
Expand All @@ -741,7 +741,7 @@ const bool ProfileBased::checkWireInsideFace(const TopoDS_Wire& wire, const Topo
return (proj.More() && proj.Current().Closed());
}

const bool ProfileBased::checkLineCrossesFace(const gp_Lin &line, const TopoDS_Face &face)
bool ProfileBased::checkLineCrossesFace(const gp_Lin &line, const TopoDS_Face &face)
{
#if 1
BRepBuilderAPI_MakeEdge mkEdge(line);
Expand Down Expand Up @@ -1086,7 +1086,7 @@ bool ProfileBased::isParallelPlane(const TopoDS_Shape& s1, const TopoDS_Shape& s
}


const double ProfileBased::getReversedAngle(const Base::Vector3d &b, const Base::Vector3d &v)
double ProfileBased::getReversedAngle(const Base::Vector3d &b, const Base::Vector3d &v)
{
try {
Part::Feature* obj = getVerifiedObject();
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/PartDesign/App/FeatureSketchBased.h
Expand Up @@ -137,17 +137,17 @@ class PartDesignExport ProfileBased : public PartDesign::FeatureAddSub
const bool reversed);

/// Check whether the wire after projection on the face is inside the face
static const bool checkWireInsideFace(const TopoDS_Wire& wire,
const TopoDS_Face& face,
const gp_Dir& dir);
static bool checkWireInsideFace(const TopoDS_Wire& wire,
const TopoDS_Face& face,
const gp_Dir& dir);

/// Check whether the line crosses the face (line and face must be on the same plane)
static const bool checkLineCrossesFace(const gp_Lin& line, const TopoDS_Face& face);
static bool checkLineCrossesFace(const gp_Lin& line, const TopoDS_Face& face);
class Wire_Compare;


/// Used to suggest a value for Reversed flag so that material is always removed (Groove) or added (Revolution) from the support
const double getReversedAngle(const Base::Vector3d& b, const Base::Vector3d& v);
double getReversedAngle(const Base::Vector3d& b, const Base::Vector3d& v);
/// get Axis from ReferenceAxis
void getAxis(const App::DocumentObject* pcReferenceAxis, const std::vector<std::string>& subReferenceAxis,
Base::Vector3d& base, Base::Vector3d& dir);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/App/FeatureTransformed.h
Expand Up @@ -63,7 +63,7 @@ class PartDesignExport Transformed : public PartDesign::Feature

/// Get the list of transformations describing the members of the pattern
// Note: Only the Scaled feature requires the originals
virtual const std::list<gp_Trsf> getTransformations(const std::vector<App::DocumentObject*> originals) {
virtual const std::list<gp_Trsf> getTransformations(const std::vector<App::DocumentObject*> /*originals*/) {
return std::list<gp_Trsf>(); // Default method
}

Expand Down
29 changes: 26 additions & 3 deletions src/Mod/PartDesign/Gui/Command.cpp
Expand Up @@ -156,6 +156,7 @@ CmdPartDesignPlane::CmdPartDesignPlane()

void CmdPartDesignPlane::activated(int iMsg)
{
Q_UNUSED(iMsg);
UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::Plane"),"DatumPlane");
}

Expand Down Expand Up @@ -183,6 +184,7 @@ CmdPartDesignLine::CmdPartDesignLine()

void CmdPartDesignLine::activated(int iMsg)
{
Q_UNUSED(iMsg);
UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::Line"),"DatumLine");
}

Expand Down Expand Up @@ -210,6 +212,7 @@ CmdPartDesignPoint::CmdPartDesignPoint()

void CmdPartDesignPoint::activated(int iMsg)
{
Q_UNUSED(iMsg);
UnifiedDatumCommand(*this, Base::Type::fromName("PartDesign::Point"),"DatumPoint");
}

Expand Down Expand Up @@ -241,6 +244,7 @@ CmdPartDesignShapeBinder::CmdPartDesignShapeBinder()

void CmdPartDesignShapeBinder::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::PropertyLinkSubList support;
getSelection().getAsPropertyLinkSubList(support);

Expand Down Expand Up @@ -309,6 +313,7 @@ CmdPartDesignNewSketch::CmdPartDesignNewSketch()

void CmdPartDesignNewSketch::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument ();
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(
/*messageIfNot = */ PartDesignGui::assureModernWorkflow ( doc ) );
Expand Down Expand Up @@ -611,9 +616,9 @@ void finishFeature(const Gui::Command* cmd, const std::string& FeatName,
// Take a list of Part2DObjects and classify them for creating a
// ProfileBased feature. FirstFreeSketch is the first free sketch in the same body
// or sketches.end() if non available. The returned number is the amount of free sketches
const unsigned validateSketches(std::vector<App::DocumentObject*>& sketches,
std::vector<PartDesignGui::TaskFeaturePick::featureStatus>& status,
std::vector<App::DocumentObject*>::iterator& firstFreeSketch)
unsigned validateSketches(std::vector<App::DocumentObject*>& sketches,
std::vector<PartDesignGui::TaskFeaturePick::featureStatus>& status,
std::vector<App::DocumentObject*>::iterator& firstFreeSketch)
{
// TODO Review the function for non-part bodies (2015-09-04, Fat-Zer)
PartDesign::Body* pcActiveBody = PartDesignGui::getBody(false);
Expand Down Expand Up @@ -868,6 +873,7 @@ CmdPartDesignPad::CmdPartDesignPad()

void CmdPartDesignPad::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument();
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(
/*messageIfNot = */ PartDesignGui::assureModernWorkflow(doc));
Expand Down Expand Up @@ -925,6 +931,7 @@ CmdPartDesignPocket::CmdPartDesignPocket()

void CmdPartDesignPocket::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument();
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(
/*messageIfNot = */ PartDesignGui::assureModernWorkflow(doc));
Expand Down Expand Up @@ -970,6 +977,7 @@ CmdPartDesignRevolution::CmdPartDesignRevolution()

void CmdPartDesignRevolution::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument();
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(
/*messageIfNot = */ PartDesignGui::assureModernWorkflow(doc));
Expand Down Expand Up @@ -1021,6 +1029,7 @@ CmdPartDesignGroove::CmdPartDesignGroove()

void CmdPartDesignGroove::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument();
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(
/*messageIfNot = */ PartDesignGui::assureModernWorkflow(doc));
Expand Down Expand Up @@ -1071,6 +1080,7 @@ CmdPartDesignAdditivePipe::CmdPartDesignAdditivePipe()

void CmdPartDesignAdditivePipe::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */ true);

// No PartDesign feature without Body past FreeCAD 0.13
Expand Down Expand Up @@ -1117,6 +1127,7 @@ CmdPartDesignSubtractivePipe::CmdPartDesignSubtractivePipe()

void CmdPartDesignSubtractivePipe::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */ true);

// No PartDesign feature without Body past FreeCAD 0.13
Expand Down Expand Up @@ -1163,6 +1174,7 @@ CmdPartDesignAdditiveLoft::CmdPartDesignAdditiveLoft()

void CmdPartDesignAdditiveLoft::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */ true);

// No PartDesign feature without Body past FreeCAD 0.13
Expand Down Expand Up @@ -1209,6 +1221,7 @@ CmdPartDesignSubtractiveLoft::CmdPartDesignSubtractiveLoft()

void CmdPartDesignSubtractiveLoft::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */ true);

// No PartDesign feature without Body past FreeCAD 0.13
Expand Down Expand Up @@ -1344,6 +1357,7 @@ CmdPartDesignFillet::CmdPartDesignFillet()

void CmdPartDesignFillet::activated(int iMsg)
{
Q_UNUSED(iMsg);
makeChamferOrFillet(this, "Fillet");
}

Expand Down Expand Up @@ -1371,6 +1385,7 @@ CmdPartDesignChamfer::CmdPartDesignChamfer()

void CmdPartDesignChamfer::activated(int iMsg)
{
Q_UNUSED(iMsg);
makeChamferOrFillet(this, "Chamfer");
doCommand(Gui,"Gui.Selection.clearSelection()");
}
Expand Down Expand Up @@ -1399,6 +1414,7 @@ CmdPartDesignDraft::CmdPartDesignDraft()

void CmdPartDesignDraft::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::SelectionObject selected;
if (!dressupGetSelected ( this, "Draft", selected))
return;
Expand Down Expand Up @@ -1455,6 +1471,7 @@ CmdPartDesignThickness::CmdPartDesignThickness()

void CmdPartDesignThickness::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::SelectionObject selected;
if (!dressupGetSelected ( this, "Thickness", selected))
return;
Expand Down Expand Up @@ -1585,6 +1602,7 @@ CmdPartDesignMirrored::CmdPartDesignMirrored()

void CmdPartDesignMirrored::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::Command* cmd = this;
auto worker = [cmd](std::string FeatName, std::vector<App::DocumentObject*> features) {

Expand Down Expand Up @@ -1638,6 +1656,7 @@ CmdPartDesignLinearPattern::CmdPartDesignLinearPattern()

void CmdPartDesignLinearPattern::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::Command* cmd = this;
auto worker = [cmd](std::string FeatName, std::vector<App::DocumentObject*> features) {

Expand Down Expand Up @@ -1693,6 +1712,7 @@ CmdPartDesignPolarPattern::CmdPartDesignPolarPattern()

void CmdPartDesignPolarPattern::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::Command* cmd = this;
auto worker = [cmd](std::string FeatName, std::vector<App::DocumentObject*> features) {

Expand Down Expand Up @@ -1749,6 +1769,7 @@ CmdPartDesignScaled::CmdPartDesignScaled()

void CmdPartDesignScaled::activated(int iMsg)
{
Q_UNUSED(iMsg);
Gui::Command* cmd = this;
auto worker = [cmd](std::string FeatName, std::vector<App::DocumentObject*> features) {

Expand Down Expand Up @@ -1788,6 +1809,7 @@ CmdPartDesignMultiTransform::CmdPartDesignMultiTransform()

void CmdPartDesignMultiTransform::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */false);
//if (!pcActiveBody) return;

Expand Down Expand Up @@ -1893,6 +1915,7 @@ CmdPartDesignBoolean::CmdPartDesignBoolean()

void CmdPartDesignBoolean::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */true);
if (!pcActiveBody) return;

Expand Down
10 changes: 9 additions & 1 deletion src/Mod/PartDesign/Gui/CommandBody.cpp
Expand Up @@ -89,6 +89,7 @@ CmdPartDesignPart::CmdPartDesignPart()

void CmdPartDesignPart::activated(int iMsg)
{
Q_UNUSED(iMsg);
if ( !PartDesignGui::assureModernWorkflow( getDocument() ) )
return;

Expand Down Expand Up @@ -131,6 +132,7 @@ CmdPartDesignBody::CmdPartDesignBody()

void CmdPartDesignBody::activated(int iMsg)
{
Q_UNUSED(iMsg);
if ( !PartDesignGui::assureModernWorkflow( getDocument() ) )
return;
App::Part *actPart = PartDesignGui::getActivePart ();
Expand Down Expand Up @@ -237,6 +239,7 @@ CmdPartDesignMigrate::CmdPartDesignMigrate()

void CmdPartDesignMigrate::activated(int iMsg)
{
Q_UNUSED(iMsg);
App::Document *doc = getDocument();

std::set<PartDesign::Feature*> migrateFeatures;
Expand Down Expand Up @@ -451,6 +454,7 @@ CmdPartDesignMoveTip::CmdPartDesignMoveTip()

void CmdPartDesignMoveTip::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> features = getSelection().getObjectsOfType(
Part::Feature::getClassTypeId() );
App::DocumentObject* selFeature;
Expand Down Expand Up @@ -527,7 +531,9 @@ CmdPartDesignDuplicateSelection::CmdPartDesignDuplicateSelection()
sStatusTip = sToolTipText;
}

void CmdPartDesignDuplicateSelection::activated(int iMsg) {
void CmdPartDesignDuplicateSelection::activated(int iMsg)
{
Q_UNUSED(iMsg);
PartDesign::Body *pcActiveBody = PartDesignGui::getBody(/*messageIfNot = */false);

std::vector<App::DocumentObject*> beforeFeatures = getDocument()->getObjects();
Expand Down Expand Up @@ -584,6 +590,7 @@ CmdPartDesignMoveFeature::CmdPartDesignMoveFeature()

void CmdPartDesignMoveFeature::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> features = getSelection().getObjectsOfType(Part::Feature::getClassTypeId());
if (features.empty()) return;

Expand Down Expand Up @@ -723,6 +730,7 @@ CmdPartDesignMoveFeatureInTree::CmdPartDesignMoveFeatureInTree()

void CmdPartDesignMoveFeatureInTree::activated(int iMsg)
{
Q_UNUSED(iMsg);
std::vector<App::DocumentObject*> features = getSelection().getObjectsOfType(Part::Feature::getClassTypeId());
if (features.empty()) return;

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/Gui/TaskDatumParameters.cpp
Expand Up @@ -430,7 +430,7 @@ void TaskDatumParameters::onSelectionChanged(const Gui::SelectionChanges& msg)
}
}

void TaskDatumParameters::onSuperplacementChanged(double val, int idx)
void TaskDatumParameters::onSuperplacementChanged(double /*val*/, int idx)
{
Part::Datum* pcDatum = static_cast<Part::Datum*>(DatumView->getObject());
Base::Placement pl = pcDatum->superPlacement.getValue();
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/Gui/TaskDatumParameters.h
Expand Up @@ -63,7 +63,7 @@ class TaskDatumParameters : public Gui::TaskView::TaskBox, public Gui::Selection
*/
Attacher::eMapMode getActiveMapMode();

const bool isCompleted() const { return completed; }
bool isCompleted() const { return completed; }

private Q_SLOTS:
void onSuperplacementChanged(double, int idx);
Expand Down

0 comments on commit 664cf65

Please sign in to comment.