Skip to content
Snippets Groups Projects
Commit 011ec862 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

add some "const"

parent 328920bd
No related branches found
No related tags found
No related merge requests found
...@@ -450,7 +450,7 @@ int GModel::setPhysicalName(std::string name, int dim, int number) ...@@ -450,7 +450,7 @@ int GModel::setPhysicalName(std::string name, int dim, int number)
return number; return number;
} }
std::string GModel::getPhysicalName(int dim, int number) std::string GModel::getPhysicalName(int dim, int number) const
{ {
//Emi debug here //Emi debug here
// printf("getPhysName size %d \n", physicalNames.size()); // printf("getPhysName size %d \n", physicalNames.size());
...@@ -460,7 +460,7 @@ std::string GModel::getPhysicalName(int dim, int number) ...@@ -460,7 +460,7 @@ std::string GModel::getPhysicalName(int dim, int number)
// printf("par (%d,%d) \n", itt->first.first, itt->first.second); // printf("par (%d,%d) \n", itt->first.first, itt->first.second);
// } // }
std::map<std::pair<int, int>, std::string>::iterator it = std::map<std::pair<int, int>, std::string>::const_iterator it =
physicalNames.find(std::pair<int, int>(dim, number)); physicalNames.find(std::pair<int, int>(dim, number));
if(it != physicalNames.end()) return it->second; if(it != physicalNames.end()) return it->second;
return ""; return "";
......
...@@ -325,7 +325,7 @@ class GModel ...@@ -325,7 +325,7 @@ class GModel
// get the name (if any) of a given physical group of dimension // get the name (if any) of a given physical group of dimension
// "dim" and id number "num" // "dim" and id number "num"
std::string getPhysicalName(int dim, int num); std::string getPhysicalName(int dim, int num) const;
// get the number of a given physical group of dimension // get the number of a given physical group of dimension
// "dim" and name "name". return -1 if not found // "dim" and name "name". return -1 if not found
......
...@@ -187,7 +187,7 @@ std::vector<MElement *> MElementOctree::findAll(double x, double y, double z, ...@@ -187,7 +187,7 @@ std::vector<MElement *> MElementOctree::findAll(double x, double y, double z,
return e; return e;
} }
MElement *MElementOctree::find(double x, double y, double z, int dim, bool strict) MElement *MElementOctree::find(double x, double y, double z, int dim, bool strict) const
{ {
double P[3] = {x, y, z}; double P[3] = {x, y, z};
MElement *e = (MElement*)Octree_Search(P, _octree); MElement *e = (MElement*)Octree_Search(P, _octree);
......
...@@ -21,7 +21,7 @@ class MElementOctree{ ...@@ -21,7 +21,7 @@ class MElementOctree{
MElementOctree(GModel *); MElementOctree(GModel *);
MElementOctree(std::vector<MElement*> &); MElementOctree(std::vector<MElement*> &);
~MElementOctree(); ~MElementOctree();
MElement *find(double x, double y, double z, int dim = -1, bool strict = false); MElement *find(double x, double y, double z, int dim = -1, bool strict = false) const;
Octree *getInternalOctree(){ return _octree; } Octree *getInternalOctree(){ return _octree; }
std::vector<MElement *> findAll(double x, double y, double z, int dim, bool strict = false); std::vector<MElement *> findAll(double x, double y, double z, int dim, bool strict = false);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment