gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
OCCEdge.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef OCC_EDGE_H
7 #define OCC_EDGE_H
8 
9 #include "GmshConfig.h"
10 #include "GEdge.h"
11 #include "GModel.h"
12 #include "Range.h"
13 
14 class OCCFace;
15 
16 #if defined(HAVE_OCC)
17 
18 #include <BRep_Tool.hxx>
19 #include <Geom2d_Curve.hxx>
20 #include <GeomAPI_ProjectPointOnCurve.hxx>
21 #include <Geom_Curve.hxx>
22 #include <TopoDS_Edge.hxx>
23 
24 class OCCEdge : public GEdge {
25 private:
26  TopoDS_Edge _c;
27  TopoDS_Edge _c_rev;
28  double _s0, _s1;
29  int _nbpoles;
30  Handle(Geom_Curve) _curve;
31  mutable Handle(Geom2d_Curve) _curve2d;
32  mutable GFace *_trimmed;
33  mutable GeomAPI_ProjectPointOnCurve _projector;
34  bool _project(const double p[3], double &u, double xyz[3]) const;
35 
36 public:
37  OCCEdge(GModel *model, TopoDS_Edge c, int num, GVertex *v1, GVertex *v2);
38  virtual ~OCCEdge() {}
39  void delFace(GFace *f);
40  virtual SBoundingBox3d bounds(bool fast = false);
41  virtual Range<double> parBounds(int i) const;
42  virtual Range<double> parBoundsOnFace(GFace *face = nullptr) const;
43  virtual GeomType geomType() const;
44  virtual bool degenerate(int) const { return BRep_Tool::Degenerated(_c); }
45  virtual GPoint point(double p) const;
46  virtual SVector3 firstDer(double par) const;
47  virtual double curvature(double par) const;
48  virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const;
49  virtual GPoint closestPoint(const SPoint3 &queryPoint, double &param) const;
50  virtual double parFromPoint(const SPoint3 &P) const;
51  virtual bool containsPoint(const SPoint3 &pt) const;
52  virtual ModelType getNativeType() const { return OpenCascadeModel; }
53  virtual void *getNativePtr() const { return (void *)&_c; }
54  virtual int minimumMeshSegments() const;
55  virtual int minimumDrawSegments() const;
56  virtual bool is3D() const { return !_curve.IsNull(); }
57  void setTrimmed(OCCFace *);
58  virtual bool isSeam(const GFace *) const;
59  virtual void writeGEO(FILE *fp);
60 };
61 
62 #endif
63 
64 #endif
GEdge::reparamOnFace
virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const
Definition: GEdge.cpp:482
GFace
Definition: GFace.h:33
GEntity::degenerate
virtual bool degenerate(int dim) const
Definition: GEntity.h:248
SPoint2
Definition: SPoint2.h:12
GEdge::minimumDrawSegments
virtual int minimumDrawSegments() const
Definition: GEdge.h:151
c
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
Definition: discreteFrechetDistance.cpp:15
GEntity::OpenCascadeModel
@ OpenCascadeModel
Definition: GEntity.h:82
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
GEdge::writeGEO
virtual void writeGEO(FILE *fp)
Definition: GEdge.cpp:354
SVector3
Definition: SVector3.h:16
GEntity::getNativeType
virtual ModelType getNativeType() const
Definition: GEntity.h:268
GPoint
Definition: GPoint.h:13
Range.h
GEntity::getNativePtr
virtual void * getNativePtr() const
Definition: GEntity.h:271
GEdge.h
GEdge::delFace
virtual void delFace(GFace *f)
Definition: GEdge.cpp:206
GEdge::firstDer
virtual SVector3 firstDer(double par) const =0
Range
Definition: Range.h:10
GVertex
Definition: GVertex.h:23
GModel
Definition: GModel.h:44
GEntity::geomType
virtual GeomType geomType() const
Definition: GEntity.h:238
GEdge::is3D
virtual bool is3D() const
Definition: GEdge.h:167
GEdge::isSeam
virtual bool isSeam(const GFace *face) const
Definition: GEdge.h:101
GEdge::parBoundsOnFace
virtual Range< double > parBoundsOnFace(GFace *face=nullptr) const
Definition: GEdge.h:223
GEdge::curvature
virtual double curvature(double par) const
Definition: GEdge.cpp:492
GEdge::containsPoint
virtual bool containsPoint(const SPoint3 &pt) const
Definition: GEdge.cpp:445
GEdge::bounds
virtual SBoundingBox3d bounds(bool fast=false)
Definition: GEdge.cpp:212
GEdge::closestPoint
virtual GPoint closestPoint(const SPoint3 &queryPoint, double &param) const
Definition: GEdge.cpp:552
GEdge::parBounds
virtual Range< double > parBounds(int i) const =0
GEdge::point
virtual GPoint point(double p) const =0
GEdge
Definition: GEdge.h:26
GModel.h
GEdge::parFromPoint
virtual double parFromPoint(const SPoint3 &P) const
Definition: GEdge.cpp:595
SBoundingBox3d
Definition: SBoundingBox3d.h:21
GEdge::minimumMeshSegments
int minimumMeshSegments
Definition: GEdge.h:255