Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:36

0001 // Created on: 1993-03-10
0002 // Created by: Philippe DAUTRY
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Geom_Line_HeaderFile
0018 #define _Geom_Line_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Ax1.hxx>
0024 #include <Geom_Curve.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <Standard_Integer.hxx>
0027 class gp_Lin;
0028 class gp_Pnt;
0029 class gp_Dir;
0030 class gp_Vec;
0031 class gp_Trsf;
0032 class Geom_Geometry;
0033 
0034 
0035 class Geom_Line;
0036 DEFINE_STANDARD_HANDLE(Geom_Line, Geom_Curve)
0037 
0038 //! Describes an infinite line.
0039 //! A line is defined and positioned in space with an axis
0040 //! (gp_Ax1 object) which gives it an origin and a unit vector.
0041 //! The Geom_Line line is parameterized:
0042 //! P (U) = O + U*Dir, where:
0043 //! - P is the point of parameter U,
0044 //! - O is the origin and Dir the unit vector of its positioning axis.
0045 //! The parameter range is ] -infinite, +infinite [.
0046 //! The orientation of the line is given by the unit vector
0047 //! of its positioning axis.
0048 class Geom_Line : public Geom_Curve
0049 {
0050 
0051 public:
0052 
0053   
0054 
0055   //! Creates a line located in 3D space with the axis placement A1.
0056   //! The Location of A1 is the origin of the line.
0057   Standard_EXPORT Geom_Line(const gp_Ax1& A1);
0058   
0059 
0060   //! Creates a line from a non transient line from package gp.
0061   Standard_EXPORT Geom_Line(const gp_Lin& L);
0062   
0063 
0064   //! Constructs a line passing through point P and parallel to vector V
0065   //! (P and V are, respectively, the origin and the unit
0066   //! vector of the positioning axis of the line).
0067   Standard_EXPORT Geom_Line(const gp_Pnt& P, const gp_Dir& V);
0068   
0069 
0070   //! Set <me> so that <me> has the same geometric properties as L.
0071   Standard_EXPORT void SetLin (const gp_Lin& L);
0072   
0073   //! changes the direction of the line.
0074   Standard_EXPORT void SetDirection (const gp_Dir& V);
0075   
0076 
0077   //! changes the "Location" point (origin) of the line.
0078   Standard_EXPORT void SetLocation (const gp_Pnt& P);
0079   
0080 
0081   //! changes the "Location" and a the "Direction" of <me>.
0082   Standard_EXPORT void SetPosition (const gp_Ax1& A1);
0083   
0084 
0085   //! Returns non transient line from gp with the same geometric
0086   //! properties as <me>
0087   Standard_EXPORT gp_Lin Lin() const;
0088   
0089   //! Returns the positioning axis of this line; this is also its local coordinate system.
0090   Standard_EXPORT const gp_Ax1& Position() const;
0091   
0092   //! Changes the orientation of this line. As a result, the
0093   //! unit vector of the positioning axis of this line is reversed.
0094   Standard_EXPORT void Reverse() Standard_OVERRIDE;
0095   
0096   //! Computes the parameter on the reversed line for the
0097   //! point of parameter U on this line.
0098   //! For a line, the returned value is -U.
0099   Standard_EXPORT Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
0100   
0101   //! Returns the value of the first parameter of this
0102   //! line. This is Standard_Real::RealFirst().
0103   Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
0104   
0105   //! Returns the value of the last parameter of this
0106   //! line. This is  Standard_Real::RealLast().
0107   Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
0108   
0109   //! returns False
0110   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
0111   
0112   //! returns False
0113   Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
0114   
0115   //! Returns GeomAbs_CN, which is the global continuity of any line.
0116   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0117   
0118   //! returns True.
0119   //! Raised if N < 0.
0120   Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE;
0121   
0122   //! Returns in P the point of parameter U.
0123   //! P (U) = O + U * Dir where O is the "Location" point of the
0124   //! line and Dir the direction of the line.
0125   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
0126   
0127 
0128   //! Returns the point P of parameter u and the first derivative V1.
0129   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1) const Standard_OVERRIDE;
0130   
0131 
0132   //! Returns the point P of parameter U, the first and second
0133   //! derivatives V1 and V2. V2 is a vector with null magnitude
0134   //! for a line.
0135   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
0136   
0137 
0138   //! V2 and V3 are vectors with null magnitude for a line.
0139   Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const Standard_OVERRIDE;
0140   
0141 
0142   //! The returned vector gives the value of the derivative for the
0143   //! order of derivation N.
0144   //! Raised if N < 1.
0145   Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
0146   
0147   //! Applies the transformation T to this line.
0148   Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
0149   
0150   //! Returns the  parameter on the  transformed  curve for
0151   //! the transform of the point of parameter U on <me>.
0152   //!
0153   //! me->Transformed(T)->Value(me->TransformedParameter(U,T))
0154   //!
0155   //! is the same point as
0156   //!
0157   //! me->Value(U).Transformed(T)
0158   //!
0159   //! This methods returns <U> * T.ScaleFactor()
0160   Standard_EXPORT virtual Standard_Real TransformedParameter (const Standard_Real U, const gp_Trsf& T) const Standard_OVERRIDE;
0161   
0162   //! Returns a  coefficient to compute the parameter on
0163   //! the transformed  curve  for  the transform  of the
0164   //! point on <me>.
0165   //!
0166   //! Transformed(T)->Value(U * ParametricTransformation(T))
0167   //!
0168   //! is the same point as
0169   //!
0170   //! Value(U).Transformed(T)
0171   //!
0172   //! This methods returns T.ScaleFactor()
0173   Standard_EXPORT virtual Standard_Real ParametricTransformation (const gp_Trsf& T) const Standard_OVERRIDE;
0174   
0175   //! Creates a new object which is a copy of this line.
0176   Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
0177 
0178   //! Dumps the content of me into the stream
0179   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0180 
0181 
0182 
0183 
0184   DEFINE_STANDARD_RTTIEXT(Geom_Line,Geom_Curve)
0185 
0186 protected:
0187 
0188 
0189 
0190 
0191 private:
0192 
0193 
0194   gp_Ax1 pos;
0195 
0196 
0197 };
0198 
0199 
0200 
0201 
0202 
0203 
0204 
0205 #endif // _Geom_Line_HeaderFile