xc
Linear2d.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //Linear2d.h
22 
23 #ifndef LINEAR2D_H
24 #define LINEAR2D_H
25 
26 #include <stdlib.h>
27 #include "../d2/GeomObj2d.h"
28 
29 
31 //
34 class Linear2d : public GeomObj2d
35  {
36  public:
37  Linear2d(void): GeomObj2d(){}
38  ~Linear2d(void) {}
39  virtual GeomObj *getCopy(void) const= 0;
40  inline virtual unsigned short int Dimension(void) const
41  { return 1; }
43  virtual GEOM_FT getArea(void) const
44  { return 0.0; }
46  virtual GEOM_FT getVolume(void) const
47  { return 0.0; }
48  //@brief Return true if the points is on sobre la Linea.
49  virtual bool In(const Pos2d &p, const double &tol= 0.0) const= 0;
50  virtual GEOM_FT getLambda(const Pos2d &) const;
51  std::vector<std::pair<Pos2d, GEOM_FT> > sortPointsAlong(const GeomObj2d::list_Pos2d &) const;
52  boost::python::list sortPointsAlongPy(const boost::python::list &) const;
53  };
54 #endif
55 
56 
57 
Base class for position lists.
Definition: PolyPos.h:35
boost::python::list sortPointsAlongPy(const boost::python::list &) const
Return the given points sorted by its parameter along the line (assuming they are on the line) in the...
Definition: Linear2d.cc:59
Posición en dos dimensiones.
Definition: Pos2d.h:41
std::vector< std::pair< Pos2d, GEOM_FT > > sortPointsAlong(const GeomObj2d::list_Pos2d &) const
Return the given points sorted by its parameter along the line (assuming they are on the line) in the...
Definition: Linear2d.cc:40
virtual GEOM_FT getArea(void) const
Return the area of the object.
Definition: Linear2d.h:43
Base class for the two-dimensional geometric objects.
Definition: GeomObj2d.h:37
virtual bool In(const Pos2d &p, const double &tol=0.0) const =0
Return true if the point lies inside the object.
virtual GEOM_FT getVolume(void) const
Return the volume of the object.
Definition: Linear2d.h:46
virtual GEOM_FT getLambda(const Pos2d &) const
Return the lambda parameter for the given point: p= getFromPoint()+lambda*VDir()
Definition: Linear2d.cc:29
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
Base class for the objects involving a single dimension in a two-dimensional space.
Definition: Linear2d.h:34
virtual unsigned short int Dimension(void) const
Return the dimension of the object 0, 1, 2 or 3.
Definition: Linear2d.h:40