28 #include "utility/utils/misc_utils/matem.h" 30 #include "../pos_vec/Pos3d.h" 31 #include "../pos_vec/Vector3d.h" 45 inline const Pos3d &GetOrg(
void)
const 47 inline const Vector3d &GetDir(
void)
const 51 {
return org+lambda*dir; }
65 static const Pos3d defaultOrg;
66 static const Pos3d defaultDest;
68 void regularize(
void);
71 explicit Line3d(
const CGLine_3 &r);
78 explicit Line3d(
const boost::python::list &lp);
79 virtual GeomObj *getCopy(
void)
const 80 {
return new Line3d(*
this); }
82 void TwoPoints(
const Pos3d &p1,
const Pos3d &p2);
83 virtual GEOM_FT
GetMax(
unsigned short int)
const 85 virtual GEOM_FT
GetMin(
unsigned short int i)
const 87 const CGLine_3 &ToCGAL(
void)
const 89 inline Pos3d Point(
const int &i=0)
const 90 {
return Pos3d(cgr.point(i)); }
92 double getLambda(
unsigned short int i,
const double &d,
const Vector3d &i_)
const;
93 virtual GEOM_FT getLambda(
const Pos3d &)
const;
97 Line3d XY3DProjection(
void)
const;
98 Line3d XZ3DProjection(
void)
const;
99 Line3d YZ3DProjection(
void)
const;
101 Line2d XY2DProjection(
void)
const;
102 Line2d XZ2DProjection(
void)
const;
103 Line2d YZ2DProjection(
void)
const;
105 GEOM_FT getSlope(
void)
const;
107 Pos3d PtoParametricas(
const GEOM_FT &)
const;
110 virtual bool In(
const Pos3d &p,
const double &tol= 0.0)
const 111 {
return cgr.has_on(p.ToCGAL()); }
114 {
return p.
dist2(Projection(p)); }
115 virtual GEOM_FT dist(
const Pos3d &p)
const;
120 { TwoPoints(p1,p2); }
121 bool isParallel(
const Line3d &r)
const;
123 bool intersects(
const Line3d &r2)
const;
130 inline virtual Pos3d getCenterOfMass(
void)
const 131 {
return Pos3d(NAN,NAN,NAN); }
132 Dir3d GetDir(
void)
const;
134 virtual Vector3d getIVector(
void)
const;
135 virtual Vector3d getJVector(
void)
const;
136 virtual Vector3d getKVector(
void)
const;
137 inline double getAngle(
const Vector3d &v)
const 138 {
return angle(VDir(),v); }
140 {
return r.getAngle(v); }
141 inline friend double angle(
const Line3d &r1,
const Line3d &r2)
142 {
return r1.getAngle(r2.
VDir()); }
145 GEOM_FT linearLeastSquaresFittingPy(
const boost::python::list &lp);
149 inline virtual GEOM_FT
Ix(
void)
const 153 inline virtual GEOM_FT
Iy(
void)
const 157 inline virtual GEOM_FT
Iz(
void)
const 160 boost::python::dict getPyDict(
void)
const;
161 void setPyDict(
const boost::python::dict &);
163 void Print(std::ostream &os)
const;
171 inline GEOM_FT dist2(
const Pos3d &p,
const Line3d &r)
172 {
return r.
dist2(p); }
173 inline GEOM_FT dist2(
const Line3d &r,
const Pos3d &p)
174 {
return dist2(p,r); }
176 inline GEOM_FT dist(
const Line3d &r,
const Pos3d &p)
177 {
return dist(p,r); }
184 inline bool intersecan(
const Line3d &r1,
const Line3d &r2)
Base class for position lists.
Definition: PolyPos.h:35
virtual GEOM_FT GetMax(unsigned short int) const
Return the maximum value of the i-th coordinate.
Definition: Line3d.h:83
Line in a two-dimensional space.
Definition: Line2d.h:61
void Put(const Pos3d &p1, const Pos3d &p2)
Set the points that define the line.
Definition: Line3d.h:119
bool isParallel(const Line3d &r) const
Return true if the lines are parallel.
Definition: Line3d.cc:360
Plane in a three-dimensional space.
Definition: Plane.h:49
Vector3d VDir(void) const
Return the direction vector.
Definition: Line3d.cc:151
GeomObj3d::list_Pos3d getIntersection(unsigned short int, const double &) const
Return the intersection of the line with the plane defined by the equation coord_i= d...
Definition: Line3d.cc:417
virtual GEOM_FT getLength(void) const
Return the length of the object.
Definition: Line3d.h:128
Base class for the objects involving a single dimension in a three-dimensional space.
Definition: Linear3d.h:33
virtual GEOM_FT Iy(void) const
Moment of inertia with respect to the local axis y passing through the center of mass.
Definition: Line3d.h:153
Dirección en el espacio de tres dimensiones.
Definition: Dir3d.h:35
virtual bool In(const Pos3d &p, const double &tol=0.0) const
Return true if the point is on the line.
Definition: Line3d.h:110
Posición en tres dimensiones.
Definition: Pos3d.h:44
Line in a three-dimensional space.
Definition: Line3d.h:62
virtual GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: Line3d.h:85
bool intersects(const Line3d &r2) const
Return true if the lines intersect.
Definition: Line3d.cc:405
virtual GEOM_FT Ix(void) const
Moment of inertia with respect to the local axis x passing through the center of mass.
Definition: Line3d.h:149
virtual GEOM_FT dist2(const Pos3d &p) const
Return the squared distance from the point to the line.
Definition: Line3d.h:113
GEOM_FT dist2(const Pos3d &) const
Return the squared distance to the point.
Definition: Pos3d.cc:216
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
virtual GEOM_FT Iz(void) const
Moment of inertia with respect to the local axis z passing through the center of mass.
Definition: Line3d.h:157
Vector en tres dimensiones.
Definition: Vector3d.h:39