fix const correctness

This commit is contained in:
wmayer
2018-05-31 12:49:23 +02:00
parent 29f87ca6cd
commit 443dde8d6c
2 changed files with 8 additions and 8 deletions

View File

@@ -1093,7 +1093,7 @@ Py::Tuple Sketch::getPyGeometry(void) const
return tuple;
}
int Sketch::checkGeoId(int geoId)
int Sketch::checkGeoId(int geoId) const
{
if (geoId < 0)
geoId += Geoms.size();//convert negative external-geometry index to index into Geoms
@@ -3608,7 +3608,7 @@ int Sketch::getPointId(int geoId, PointPos pos) const
return -1;
}
Base::Vector3d Sketch::getPoint(int geoId, PointPos pos)
Base::Vector3d Sketch::getPoint(int geoId, PointPos pos) const
{
geoId = checkGeoId(geoId);
int pointId = getPointId(geoId, pos);
@@ -3618,12 +3618,12 @@ Base::Vector3d Sketch::getPoint(int geoId, PointPos pos)
return Base::Vector3d();
}
bool Sketch::hasDependentParameters(int geoId, PointPos pos)
bool Sketch::hasDependentParameters(int geoId, PointPos pos) const
{
try {
geoId = checkGeoId(geoId);
}
catch (Base::Exception e) {
catch (Base::Exception) {
return false;
}

View File

@@ -94,10 +94,10 @@ public:
/// retrieves the index of a point
int getPointId(int geoId, PointPos pos) const;
/// retrieves a point
Base::Vector3d getPoint(int geoId, PointPos pos);
Base::Vector3d getPoint(int geoId, PointPos pos) const;
/// retrieves whether a geometry has dependent parameters or not
bool hasDependentParameters(int geoId, PointPos pos);
bool hasDependentParameters(int geoId, PointPos pos) const;
// Inline methods
inline bool hasConflicts(void) const { return !Conflicting.empty(); }
@@ -460,7 +460,7 @@ private:
void calculateDependentParametersElements(void);
/// checks if the index bounds and converts negative indices to positive
int checkGeoId(int geoId);
int checkGeoId(int geoId) const;
GCS::Curve* getGCSCurveByGeoId(int geoId);
};