xc
Linear3d.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 //Linear3d.h
22 
23 #ifndef LINEAR3D_H
24 #define LINEAR3D_H
25 
26 #include "../d3/GeomObj3d.h"
27 
28 
30 //
33 class Linear3d : public GeomObj3d
34  {
35  public:
36  Linear3d(void): GeomObj3d(){}
37  ~Linear3d(void) {}
38  inline virtual unsigned short int Dimension(void) const
39  { return 1; }
41  virtual GEOM_FT getArea(void) const
42  { return 0.0; }
44  virtual GEOM_FT getVolume(void) const
45  { return 0.0; }
46  //@brief Return true if the points is on sobre la Linea.
47  virtual bool In(const Pos3d &p, const double &tol= 0.0) const= 0;
48 
49  virtual GEOM_FT getLambda(const Pos3d &) const;
50  std::vector<std::pair<Pos3d, GEOM_FT> > sortPointsAlong(const GeomObj3d::list_Pos3d &) const;
51  boost::python::list sortPointsAlongPy(const boost::python::list &) const;
52  //Return the intersection of the line with the plane
53  // defined by the equation coord_i= d.
54 /* virtual list_Pos3d Int(unsigned short int i, const double &d) const= 0; */
55 /* inline list_Pos3d intx(const double &x) */
56 /* //Return the intersection of the line with a plane x=cte. */
57 /* { return Int(1,x); } */
58 /* inline list_Pos3d inty(const double &y) */
59 /* //Return the intersection of the line with a plane y=cte. */
60 /* { return Int(2,y); } */
61 /* inline list_Pos3d intz(const double &z) */
62 /* //Return the intersection of the line with a plane z=cte. */
63 /* { return Int(3,z); } */
64  };
65 #endif
66 
67 
68 
virtual GEOM_FT getArea(void) const
Return the object area.
Definition: Linear3d.h:41
Base class for position lists.
Definition: PolyPos.h:35
std::vector< std::pair< Pos3d, GEOM_FT > > sortPointsAlong(const GeomObj3d::list_Pos3d &) const
Return the given points sorted by its parameter along the line (assuming they are on the line) in the...
Definition: Linear3d.cc:40
virtual bool In(const Pos3d &p, const double &tol=0.0) const =0
Return true if point lies inside the object.
Base class for the objects involving a single dimension in a three-dimensional space.
Definition: Linear3d.h:33
virtual GEOM_FT getVolume(void) const
Return the volume of the object.
Definition: Linear3d.h:44
virtual unsigned short int Dimension(void) const
Return the dimension of the object 0, 1, 2 or 3.
Definition: Linear3d.h:38
Posición en tres dimensiones.
Definition: Pos3d.h:44
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: Linear3d.cc:59
virtual GEOM_FT getLambda(const Pos3d &) const
Return the lambda parameter for the given point: p= getFromPoint()+lambda*VDir()
Definition: Linear3d.cc:29
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43