Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:57

0001 // Created on: 1993-01-20
0002 // Created by: Laurent PAINNOT
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 _AppDef_MyLineTool_HeaderFile
0018 #define _AppDef_MyLineTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <TColgp_Array1OfPnt.hxx>
0025 #include <TColgp_Array1OfPnt2d.hxx>
0026 #include <TColgp_Array1OfVec.hxx>
0027 #include <TColgp_Array1OfVec2d.hxx>
0028 #include <Approx_Status.hxx>
0029 class AppDef_MultiLine;
0030 
0031 
0032 //! Example of MultiLine tool corresponding to the tools of the packages AppParCurves and Approx.
0033 //! For Approx, the tool will not add points if the algorithms want some.
0034 class AppDef_MyLineTool 
0035 {
0036 public:
0037 
0038   DEFINE_STANDARD_ALLOC
0039 
0040   
0041   //! Returns the first index of multipoints of the MultiLine.
0042   Standard_EXPORT static Standard_Integer FirstPoint (const AppDef_MultiLine& ML);
0043   
0044   //! Returns the last index of multipoints of the MultiLine.
0045   Standard_EXPORT static Standard_Integer LastPoint (const AppDef_MultiLine& ML);
0046   
0047   //! Returns the number of 2d points of a MultiLine.
0048   Standard_EXPORT static Standard_Integer NbP2d (const AppDef_MultiLine& ML);
0049   
0050   //! Returns the number of 3d points of a MultiLine.
0051   Standard_EXPORT static Standard_Integer NbP3d (const AppDef_MultiLine& ML);
0052   
0053   //! returns the 3d points of the multipoint <MPointIndex>
0054   //! when only 3d points exist.
0055   Standard_EXPORT static void Value (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt);
0056   
0057   //! returns the 2d points of the multipoint <MPointIndex>
0058   //! when only 2d points exist.
0059   Standard_EXPORT static void Value (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d);
0060   
0061   //! returns the 3d and 2d points of the multipoint
0062   //! <MPointIndex>.
0063   Standard_EXPORT static void Value (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d);
0064   
0065   //! returns the 3d points of the multipoint <MPointIndex>
0066   //! when only 3d points exist.
0067   Standard_EXPORT static Standard_Boolean Tangency (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV);
0068   
0069   //! returns the 2d tangency points of the multipoint
0070   //! <MPointIndex> only when 2d points exist.
0071   Standard_EXPORT static Standard_Boolean Tangency (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d);
0072   
0073   //! returns the 3d and 2d points of the multipoint
0074   //! <MPointIndex>.
0075   Standard_EXPORT static Standard_Boolean Tangency (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d);
0076   
0077   //! returns the 3d curvatures of the multipoint <MPointIndex>
0078   //! when only 3d points exist.
0079   Standard_EXPORT static Standard_Boolean Curvature (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV);
0080   
0081   //! returns the 2d curvatures of the multipoint
0082   //! <MPointIndex> only when 2d points exist.
0083   Standard_EXPORT static Standard_Boolean Curvature (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d);
0084   
0085   //! returns the 3d and 2d curvatures of the multipoint
0086   //! <MPointIndex>.
0087   Standard_EXPORT static Standard_Boolean Curvature (const AppDef_MultiLine& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d);
0088   
0089   //! returns NoPointsAdded
0090   Standard_EXPORT static Approx_Status WhatStatus (const AppDef_MultiLine& ML, const Standard_Integer I1, const Standard_Integer I2);
0091   
0092   //! Is never called in the algorithms.
0093   //! Nothing is done.
0094   Standard_EXPORT static AppDef_MultiLine MakeMLBetween (const AppDef_MultiLine& ML,
0095                                                           const Standard_Integer I1,
0096                                                           const Standard_Integer I2,
0097                                                           const Standard_Integer NbPMin);
0098 
0099   //! Is never called in the algorithms.
0100   //! Nothing is done.
0101   Standard_EXPORT static  Standard_Boolean  MakeMLOneMorePoint (const AppDef_MultiLine& ML,
0102                                                                 const Standard_Integer I1,
0103                                                                 const Standard_Integer I2,
0104                                                                 const Standard_Integer indbad,
0105                                                                 AppDef_MultiLine& OtherLine);
0106 };
0107 
0108 #endif // _AppDef_MyLineTool_HeaderFile