gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
discreteEdge.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 DISCRETE_EDGE_H
7 #define DISCRETE_EDGE_H
8 
9 #include "GModel.h"
10 #include "GEdge.h"
11 
12 class discreteEdge : public GEdge {
13 private:
14  std::vector<double> _pars;
15  std::vector<SPoint3> _discretization;
16  bool _getLocalParameter(const double &t, int &iEdge, double &tLoc) const;
17 
18 public:
20  discreteEdge(GModel *model, int num);
22  virtual ~discreteEdge() {}
23  virtual GeomType geomType() const { return DiscreteCurve; }
24  virtual GPoint point(double p) const;
25  virtual SVector3 firstDer(double par) const;
26  virtual double curvature(double par) const;
27  virtual bool haveParametrization() { return !_pars.empty(); }
28  virtual Range<double> parBounds(int) const;
29  int createGeometry();
30  virtual void mesh(bool verbose);
31  int minimumDrawSegments() const { return 2 * _pars.size(); }
32  virtual int minimumMeshSegments() const { return periodic(0) ? 3 : 2; }
33  virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const;
34  bool writeParametrization(FILE *fp, bool binary);
35  bool readParametrization(FILE *fp, bool binary);
36 };
37 
38 #endif
discreteEdge::point
virtual GPoint point(double p) const
Definition: discreteEdge.cpp:59
GEdge::periodic
virtual bool periodic(int dim) const
Definition: GEdge.h:219
discreteEdge::reparamOnFace
virtual SPoint2 reparamOnFace(const GFace *face, double epar, int dir) const
Definition: discreteEdge.cpp:93
discreteEdge::readParametrization
bool readParametrization(FILE *fp, bool binary)
Definition: discreteEdge.cpp:251
discreteEdge::curvature
virtual double curvature(double par) const
Definition: discreteEdge.cpp:102
GFace
Definition: GFace.h:33
GEntity::model
GModel * model() const
Definition: GEntity.h:277
SPoint2
Definition: SPoint2.h:12
discreteEdge
Definition: discreteEdge.h:12
discreteEdge::minimumDrawSegments
int minimumDrawSegments() const
Definition: discreteEdge.h:31
discreteEdge::_pars
std::vector< double > _pars
Definition: discreteEdge.h:14
SVector3
Definition: SVector3.h:16
discreteEdge::haveParametrization
virtual bool haveParametrization()
Definition: discreteEdge.h:27
discreteEdge::writeParametrization
bool writeParametrization(FILE *fp, bool binary)
Definition: discreteEdge.cpp:223
GPoint
Definition: GPoint.h:13
GEntity::DiscreteCurve
@ DiscreteCurve
Definition: GEntity.h:104
GEdge.h
discreteEdge::_discretization
std::vector< SPoint3 > _discretization
Definition: discreteEdge.h:15
discreteEdge::discreteEdge
discreteEdge(GModel *model, int num, GVertex *_v0, GVertex *_v1)
Definition: discreteEdge.cpp:20
discreteEdge::~discreteEdge
virtual ~discreteEdge()
Definition: discreteEdge.h:22
Range
Definition: Range.h:10
GVertex
Definition: GVertex.h:23
GModel
Definition: GModel.h:44
discreteEdge::createGeometry
int createGeometry()
Definition: discreteEdge.cpp:152
discreteEdge::parBounds
virtual Range< double > parBounds(int) const
Definition: discreteEdge.cpp:147
GEntity::GeomType
GeomType
Definition: GEntity.h:88
discreteEdge::firstDer
virtual SVector3 firstDer(double par) const
Definition: discreteEdge.cpp:74
discreteEdge::geomType
virtual GeomType geomType() const
Definition: discreteEdge.h:23
discreteEdge::minimumMeshSegments
virtual int minimumMeshSegments() const
Definition: discreteEdge.h:32
GEdge::_v0
GVertex * _v0
Definition: GEdge.h:35
GEdge::_v1
GVertex * _v1
Definition: GEdge.h:35
discreteEdge::mesh
virtual void mesh(bool verbose)
Definition: discreteEdge.cpp:214
GEdge
Definition: GEdge.h:26
GModel.h
discreteEdge::_getLocalParameter
bool _getLocalParameter(const double &t, int &iEdge, double &tLoc) const
Definition: discreteEdge.cpp:45