Skip to content
Snippets Groups Projects
Commit 2d038944 authored by Stefen Guzik's avatar Stefen Guzik
Browse files

Propagation of _const_ GFace/Edge * from reparamMeshVertex... to isSeam and reparamOnFace

parent 074b473a
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ SVector3 GEdge::secondDer(double par) const
return 500 * (x2 - x1);
}
SPoint2 GEdge::reparamOnFace(GFace *face, double epar,int dir) const
SPoint2 GEdge::reparamOnFace(const GFace *face, double epar,int dir) const
{
// reparmaterize the point onto the given face.
const GPoint p3 = point(epar);
......
......@@ -48,7 +48,7 @@ class GEdge : public GEntity {
virtual void setVisibility(char val, bool recursive=false);
// true if the edge is a seam for the given face.
virtual bool isSeam(GFace *face) const { return false; }
virtual bool isSeam(const GFace *face) const { return false; }
// get the bounding box
virtual SBoundingBox3d bounds() const;
......@@ -73,7 +73,7 @@ class GEdge : public GEntity {
virtual double curvature(double par) const;
// reparmaterize the point onto the given face
virtual SPoint2 reparamOnFace(GFace *face, double epar, int dir) const;
virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const;
// return the minimum number of segments used for meshing the edge
virtual int minimumMeshSegments() const { return 1; }
......
......@@ -42,7 +42,7 @@ void GVertex::delEdge(GEdge *e)
l_edges.erase(std::find(l_edges.begin(), l_edges.end(), e));
}
SPoint2 GVertex::reparamOnFace(GFace *gf, int) const
SPoint2 GVertex::reparamOnFace(const GFace *gf, int) const
{
return gf->parFromPoint(SPoint3(x(), y(), z()));
}
......
......@@ -53,7 +53,7 @@ class GVertex : public GEntity
virtual SBoundingBox3d bounds() const { return SBoundingBox3d(SPoint3(x(), y(), z())); }
// reparmaterize the point onto the given face
virtual SPoint2 reparamOnFace(GFace *gf, int) const;
virtual SPoint2 reparamOnFace(const GFace *gf, int) const;
// return a type-specific additional information string
virtual std::string getAdditionalInfoString();
......
......@@ -303,12 +303,12 @@ bool reparamMeshEdgeOnFace(MVertex *v1, MVertex *v2, GFace *gf,
}
}
bool reparamMeshVertexOnFace(MVertex *v, GFace *gf, SPoint2 &param)
bool reparamMeshVertexOnFace(const MVertex *v, const GFace *gf, SPoint2 &param)
{
if (gf->geomType() == GEntity::CompoundSurface &&
v->onWhat()->dim() < 2){
GFaceCompound *gfc = (GFaceCompound*) gf;
param = gfc->getCoordinates(v);
param = gfc->getCoordinates(const_cast<MVertex*>(v));
return true;
}
......@@ -350,7 +350,7 @@ bool reparamMeshVertexOnFace(MVertex *v, GFace *gf, SPoint2 &param)
return true;
}
bool reparamMeshVertexOnEdge(MVertex *v, GEdge *ge, double &param)
bool reparamMeshVertexOnEdge(const MVertex *v, const GEdge *ge, double &param)
{
param = 1.e6;
Range<double> bounds = ge->parBounds(0);
......
......@@ -156,7 +156,7 @@ class MFaceVertex : public MVertex{
bool reparamMeshEdgeOnFace(MVertex *v1, MVertex *v2, GFace *gf,
SPoint2 &param1, SPoint2 &param2);
bool reparamMeshVertexOnFace(MVertex *v, GFace *gf, SPoint2 &param);
bool reparamMeshVertexOnEdge(MVertex *v, GEdge *ge, double &param);
bool reparamMeshVertexOnFace(const MVertex *v, const GFace *gf, SPoint2 &param);
bool reparamMeshVertexOnEdge(const MVertex *v, const GEdge *ge, double &param);
#endif
......@@ -216,6 +216,7 @@ int edge_normal
{
double par;
// Note: const_cast used to match MVertex.cpp interface
if(!reparamMeshVertexOnEdge(vertex, gEdge, par)) return 1;
const SVector3 tangent(gEdge->firstDer(par));
......@@ -641,7 +642,7 @@ void updateBoVec<3, MFace>
gFIt != useGFace.end(); ++gFIt) {
SPoint2 par;
if(!reparamMeshVertexOnFace(vertex, (*gFIt), par))
if(!reparamMeshVertexOnFace(vertex, *gFIt, par))
goto getNormalFromElements; // :P After all that!
SVector3 boNormal = (*gFIt)->normal(par);
......
......@@ -64,7 +64,7 @@ void OCCEdge::setTrimmed (OCCFace *f)
}
}
SPoint2 OCCEdge::reparamOnFace(GFace *face, double epar, int dir) const
SPoint2 OCCEdge::reparamOnFace(const GFace *face, double epar, int dir) const
{
const TopoDS_Face *s = (TopoDS_Face*) face->getNativePtr();
double t0, t1;
......@@ -107,7 +107,7 @@ SPoint2 OCCEdge::reparamOnFace(GFace *face, double epar, int dir) const
}
// True if the edge is a seam for the given face
bool OCCEdge::isSeam(GFace *face) const
bool OCCEdge::isSeam(const GFace *face) const
{
if (face->geomType() == GEntity::CompoundSurface)return false;
const TopoDS_Face *s = (TopoDS_Face*) face->getNativePtr();
......
......@@ -32,14 +32,14 @@ class OCCEdge : public GEdge {
virtual GPoint point(double p) const;
virtual SVector3 firstDer(double par) const;
virtual double curvature (double par) const;
virtual SPoint2 reparamOnFace(GFace * face, double epar, int dir) const ;
virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const;
ModelType getNativeType() const { return OpenCascadeModel; }
void * getNativePtr() const { return (void*)&c; }
virtual int minimumMeshSegments () const;
virtual int minimumDrawSegments () const;
bool is3D() const { return !curve.IsNull(); }
void setTrimmed(OCCFace *);
bool isSeam(GFace *) const;
bool isSeam(const GFace *) const;
};
#endif
......
......@@ -65,7 +65,7 @@ double OCCVertex::max_curvature_of_surfaces() const
return max_curvature;
}
SPoint2 OCCVertex::reparamOnFace(GFace *gf, int dir) const
SPoint2 OCCVertex::reparamOnFace(const GFace *gf, int dir) const
{
std::list<GEdge*>::const_iterator it = l_edges.begin();
while(it != l_edges.end()){
......
......@@ -28,7 +28,7 @@ class OCCVertex : public GVertex {
virtual void setPosition(GPoint &p);
ModelType getNativeType() const { return OpenCascadeModel; }
void * getNativePtr() const { return (void*)&v; }
virtual SPoint2 reparamOnFace(GFace *gf, int) const;
virtual SPoint2 reparamOnFace(const GFace *gf, int) const;
};
#endif
......
......@@ -89,7 +89,7 @@ int gmshEdge::minimumDrawSegments () const
return CTX.geom.num_sub_edges * n;
}
SPoint2 gmshEdge::reparamOnFace(GFace *face, double epar,int dir) const
SPoint2 gmshEdge::reparamOnFace(const GFace *face, double epar,int dir) const
{
Surface *s = (Surface*) face->getNativePtr();
......
......@@ -25,7 +25,7 @@ class gmshEdge : public GEdge {
virtual int minimumMeshSegments() const;
virtual int minimumDrawSegments() const;
virtual void resetMeshAttributes();
virtual SPoint2 reparamOnFace(GFace *face, double epar, int dir) const;
virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const;
};
#endif
......@@ -39,7 +39,7 @@ GEntity::GeomType gmshVertex::geomType() const
return Point;
}
SPoint2 gmshVertex::reparamOnFace(GFace *face, int dir) const
SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const
{
Surface *s = (Surface*)face->getNativePtr();
......
......@@ -32,7 +32,7 @@ class gmshVertex : public GVertex {
meshSize = l;
v->lc = meshSize;
}
virtual SPoint2 reparamOnFace(GFace *gf, int) const;
virtual SPoint2 reparamOnFace(const GFace *gf, int) const;
};
#endif
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