Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:08

0001 // Created on: 1992-04-06
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1992-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 _IntPatch_ALine_HeaderFile
0018 #define _IntPatch_ALine_HeaderFile
0019 
0020 #include <Standard_Handle.hxx>
0021 
0022 #include <IntAna_Curve.hxx>
0023 #include <IntPatch_Line.hxx>
0024 #include <IntPatch_SequenceOfPoint.hxx>
0025 #include <TColStd_ListOfReal.hxx>
0026 
0027 class IntPatch_Point;
0028 class IntPatch_ALine;
0029 
0030 DEFINE_STANDARD_HANDLE(IntPatch_ALine, IntPatch_Line)
0031 
0032 //! Implementation of an intersection line described by a
0033 //! parametrized curve.
0034 class IntPatch_ALine : public IntPatch_Line
0035 {
0036 
0037 public:
0038 
0039   
0040   //! Creates an analytic intersection line
0041   //! when the transitions are In or Out.
0042   Standard_EXPORT IntPatch_ALine(const IntAna_Curve& C, const Standard_Boolean Tang, const IntSurf_TypeTrans Trans1, const IntSurf_TypeTrans Trans2);
0043   
0044   //! Creates an analytic intersection line
0045   //! when the transitions are Touch.
0046   Standard_EXPORT IntPatch_ALine(const IntAna_Curve& C, const Standard_Boolean Tang, const IntSurf_Situation Situ1, const IntSurf_Situation Situ2);
0047   
0048   //! Creates an analytic intersection line
0049   //! when the transitions are Undecided.
0050   Standard_EXPORT IntPatch_ALine(const IntAna_Curve& C, const Standard_Boolean Tang);
0051   
0052   //! To add a vertex in the list.
0053   Standard_EXPORT void AddVertex (const IntPatch_Point& Pnt);
0054   
0055   //! Replaces the element of range Index in the list
0056   //! of points.
0057     void Replace (const Standard_Integer Index, const IntPatch_Point& Pnt);
0058   
0059     void SetFirstPoint (const Standard_Integer IndFirst);
0060   
0061     void SetLastPoint (const Standard_Integer IndLast);
0062   
0063   //! Returns the first parameter on the intersection line.
0064   //! If IsIncluded returns True, Value and D1 methods can
0065   //! be call with a parameter equal to FirstParameter.
0066   //! Otherwise, the parameter must be greater than
0067   //! FirstParameter.
0068     Standard_Real FirstParameter (Standard_Boolean& IsIncluded) const;
0069   
0070   //! Returns the last parameter on the intersection line.
0071   //! If IsIncluded returns True, Value and D1 methods can
0072   //! be call with a parameter equal to LastParameter.
0073   //! Otherwise, the parameter must be less than LastParameter.
0074     Standard_Real LastParameter (Standard_Boolean& IsIncluded) const;
0075   
0076   //! Returns the point of parameter U on the analytic
0077   //! intersection line.
0078     gp_Pnt Value (const Standard_Real U);
0079   
0080   //! Returns Standard_True when the derivative at parameter U
0081   //! is defined on the analytic intersection line.
0082   //! In that case, Du is the derivative.
0083   //! Returns Standard_False when it is not possible to
0084   //! evaluate the derivative.
0085   //! In both cases, P is the point at parameter U on the
0086   //! intersection.
0087     Standard_Boolean D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& Du);
0088   
0089   //! Tries to find the parameters of the point P on the curve.
0090   //! If the method returns False, the "projection" is
0091   //! impossible.
0092   //! If the method returns True at least one parameter has been found.
0093   //! theParams is always sorted in ascending order.
0094   void FindParameter(const gp_Pnt& P,
0095                      TColStd_ListOfReal& theParams) const;
0096   
0097   //! Returns True if the line has a known First point.
0098   //! This point is given by the method FirstPoint().
0099     Standard_Boolean HasFirstPoint() const;
0100   
0101   //! Returns True if the line has a known Last point.
0102   //! This point is given by the method LastPoint().
0103     Standard_Boolean HasLastPoint() const;
0104   
0105   //! Returns the IntPoint corresponding to the FirstPoint.
0106   //! An exception is raised when HasFirstPoint returns False.
0107     const IntPatch_Point& FirstPoint() const;
0108   
0109   //! Returns the IntPoint corresponding to the LastPoint.
0110   //! An exception is raised when HasLastPoint returns False.
0111     const IntPatch_Point& LastPoint() const;
0112   
0113     Standard_Integer NbVertex() const;
0114   
0115   //! Returns the vertex of range Index on the line.
0116     const IntPatch_Point& Vertex (const Standard_Integer Index) const;
0117   
0118   //! Allows modifying the vertex with index theIndex on the line.
0119   IntPatch_Point& ChangeVertex(const Standard_Integer theIndex)
0120   {
0121     return svtx.ChangeValue(theIndex);
0122   }
0123 
0124   //! Set the parameters of all the vertex on the line.
0125   //! if a vertex is already in the line,
0126   //! its parameter is modified
0127   //! else a new point in the line is inserted.
0128   Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
0129   
0130   Standard_EXPORT const IntAna_Curve& Curve() const;
0131 
0132 
0133 
0134 
0135   DEFINE_STANDARD_RTTIEXT(IntPatch_ALine,IntPatch_Line)
0136 
0137 protected:
0138 
0139 
0140 
0141 
0142 private:
0143 
0144 
0145   IntAna_Curve curv;
0146   Standard_Boolean fipt;
0147   Standard_Boolean lapt;
0148   Standard_Integer indf;
0149   Standard_Integer indl;
0150   IntPatch_SequenceOfPoint svtx;
0151 
0152 
0153 };
0154 
0155 
0156 #include <IntPatch_ALine.lxx>
0157 
0158 
0159 
0160 
0161 
0162 #endif // _IntPatch_ALine_HeaderFile