Skip to content
Snippets Groups Projects
Commit 4cde9956 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 589f6156
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ class OCCEdge : public GEdge {
virtual double curvature (double par) const;
virtual SPoint2 reparamOnFace(GFace * face, double epar, int dir) const ;
ModelType getNativeType() const { return OpenCascadeModel; }
void * getNativePtr() const { return (void*) &c; }
void * getNativePtr() const { return (void*)&c; }
virtual double parFromPoint(const SPoint3 &pt) const;
virtual int minimumMeshSegments () const;
virtual int minimumDrawSegments () const;
......
// $Id: OCCFace.cpp,v 1.27 2008-01-30 15:27:41 remacle Exp $
// $Id: OCCFace.cpp,v 1.28 2008-02-03 08:54:28 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -119,7 +119,7 @@ Pair<SVector3,SVector3> OCCFace::firstDer(const SPoint2 &param) const
{
gp_Pnt pnt;
gp_Vec du, dv;
occface->D1(param.x(), param.y(),pnt,du,dv);
occface->D1(param.x(), param.y(), pnt, du, dv);
return Pair<SVector3,SVector3>(SVector3(du.X(), du.Y(), du.Z()),
SVector3(dv.X(), dv.Y(), dv.Z()));
......@@ -143,11 +143,11 @@ GPoint OCCFace::closestPoint(const SPoint3 & qp) const
}
double pp[2];
proj.LowerDistanceParameters (pp[0], pp[1]);
proj.LowerDistanceParameters(pp[0], pp[1]);
Msg(INFO,"projection lower distance parameters %g %g",pp[0],pp[1]);
if((pp[0]<umin || umax<pp[0]) || (pp[1]<vmin || vmax<pp[1])){
if((pp[0] < umin || umax < pp[0]) || (pp[1]<vmin || vmax<pp[1])){
Msg(GERROR,"Point projection is out of face bounds");
return GPoint(0, 0);
}
......@@ -175,8 +175,8 @@ SPoint2 OCCFace::parFromPoint(const SPoint3 &qp) const
Msg(GERROR,"OCC Project Point on Surface FAIL");
return GFace::parFromPoint(qp);
}
double U,V;
proj.LowerDistanceParameters (U, V);
double U, V;
proj.LowerDistanceParameters(U, V);
return SPoint2(U, V);
}
......
......@@ -28,7 +28,7 @@ class OCCRegion : public GRegion {
protected:
TopoDS_Solid s;
public:
OCCRegion(GModel *m, TopoDS_Solid s , int num, TopTools_IndexedMapOfShape &fmap);
OCCRegion(GModel *m, TopoDS_Solid s, int num, TopTools_IndexedMapOfShape &fmap);
virtual ~OCCRegion() {}
virtual GeomType geomType() const;
ModelType getNativeType() const { return OpenCascadeModel; }
......
// $Id: OCCVertex.cpp,v 1.12 2008-01-20 10:10:41 geuzaine Exp $
// $Id: OCCVertex.cpp,v 1.13 2008-02-03 08:54:28 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -30,12 +30,12 @@ double max_surf_curvature(const GVertex *gv, double x, double y, double z,
const GEdge *_myGEdge)
{
std::list<GFace *> faces = _myGEdge->faces();
std::list<GFace *>::iterator it = faces.begin();
std::list<GFace *>::iterator it = faces.begin();
double curv = 1.e-22;
while(it != faces.end()){
SPoint2 par = gv->reparamOnFace((*it),1);
SPoint2 par = gv->reparamOnFace((*it), 1);
double cc = (*it)->curvature(par);
if(cc > 0) curv = std::max(curv, cc);
if(cc > 0) curv = std::max(curv, cc);
++it;
}
return curv;
......@@ -45,7 +45,7 @@ double OCCVertex::max_curvature_of_surfaces() const
{
if(max_curvature < 0){
for(std::list<GEdge*>::const_iterator it = l_edges.begin();
it != l_edges.end(); ++it ){
it != l_edges.end(); ++it){
max_curvature = std::max(max_surf_curvature(this, x(), y(), z(), *it),
max_curvature);
}
......@@ -67,9 +67,9 @@ SPoint2 OCCVertex::reparamOnFace(GFace *gf, int dir) const
double s1,s0;
Handle(Geom2d_Curve) curve2d = BRep_Tool::CurveOnSurface(*c, *s, s0, s1);
if((*it)->getBeginVertex() == this)
return (*it)->reparamOnFace(gf,s0,dir);
return (*it)->reparamOnFace(gf, s0, dir);
else if((*it)->getEndVertex() == this)
return (*it)->reparamOnFace(gf,s1,dir);
return (*it)->reparamOnFace(gf, s1, dir);
}
}
++it;
......@@ -83,9 +83,9 @@ SPoint2 OCCVertex::reparamOnFace(GFace *gf, int dir) const
double s1,s0;
Handle(Geom2d_Curve) curve2d = BRep_Tool::CurveOnSurface(*c, *s, s0, s1);
if((*it)->getBeginVertex() == this)
return (*it)->reparamOnFace(gf,s0,dir);
return (*it)->reparamOnFace(gf, s0, dir);
else if((*it)->getEndVertex() == this)
return (*it)->reparamOnFace(gf,s1,dir);
return (*it)->reparamOnFace(gf, s1, dir);
}
++it;
}
......
......@@ -30,37 +30,26 @@
class OCCVertex : public GVertex {
protected:
TopoDS_Vertex v;
double _x,_y,_z;
double _x, _y, _z;
mutable double max_curvature;
double max_curvature_of_surfaces() const;
public:
OCCVertex(GModel *m, int num, TopoDS_Vertex _v) : GVertex(m, num), v(_v)
{
max_curvature = -1;
gp_Pnt pnt = BRep_Tool::Pnt (v);
gp_Pnt pnt = BRep_Tool::Pnt(v);
_x = pnt.X();
_y = pnt.Y();
_z = pnt.Z();
mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
}
virtual ~OCCVertex() {}
virtual GPoint point() const
virtual GPoint point() const { return GPoint(x(), y(), z()); }
virtual double x() const { return _x; }
virtual double y() const { return _y; }
virtual double z() const { return _z; }
virtual void setPosition(GPoint &p)
{
return GPoint(x(),y(),z());
}
virtual double x() const
{
return _x;
}
virtual double y() const
{
return _y;
}
virtual double z() const
{
return _z;
}
virtual void setPosition(GPoint &p){
_x = p.x();
_y = p.y();
_z = p.z();
......@@ -68,9 +57,8 @@ class OCCVertex : public GVertex {
mesh_vertices.clear();
mesh_vertices.push_back(new MVertex(x(), y(), z(), this));
}
ModelType getNativeType() const { return OpenCascadeModel; }
void * getNativePtr() const { return (void*) &v; }
void * getNativePtr() const { return (void*)&v; }
virtual SPoint2 reparamOnFace ( GFace *gf , int) const;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment