Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-07-12
0002 // Created by: Yves FRICAUD
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 _MAT2d_Tool2d_HeaderFile
0018 #define _MAT2d_Tool2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GeomAbs_JoinType.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <MAT2d_DataMapOfIntegerBisec.hxx>
0027 #include <MAT2d_DataMapOfIntegerPnt2d.hxx>
0028 #include <MAT2d_DataMapOfIntegerVec2d.hxx>
0029 #include <TColStd_SequenceOfInteger.hxx>
0030 #include <MAT_Side.hxx>
0031 class MAT2d_Circuit;
0032 class MAT_Bisector;
0033 class Bisector_Bisec;
0034 class Geom2d_Geometry;
0035 class gp_Pnt2d;
0036 class gp_Vec2d;
0037 
0038 
0039 //! Set of the methods useful for the MAT's computation.
0040 //! Tool2d contains the geometry of the bisecting locus.
0041 class MAT2d_Tool2d 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   //! Empty Constructor.
0049   Standard_EXPORT MAT2d_Tool2d();
0050   
0051   //! <aSide> defines the side of the computation of the map.
0052   Standard_EXPORT void Sense (const MAT_Side aside);
0053   
0054   Standard_EXPORT void SetJoinType (const GeomAbs_JoinType aJoinType);
0055   
0056   //! InitItems cuts the line in Items.
0057   //! this Items are the geometrics representations of
0058   //! the BasicElts from MAT.
0059   Standard_EXPORT void InitItems (const Handle(MAT2d_Circuit)& aCircuit);
0060   
0061   //! Returns the Number of Items .
0062   Standard_EXPORT Standard_Integer NumberOfItems() const;
0063   
0064   //! Returns tolerance to test the confusion of two points.
0065   Standard_EXPORT Standard_Real ToleranceOfConfusion() const;
0066   
0067   //! Creates the point at the origin of the bisector between
0068   //! anitem and the previous  item.
0069   //! dist is the distance from the FirstPoint to <anitem>.
0070   //! Returns the index of this point in <theGeomPnts>.
0071   Standard_EXPORT Standard_Integer FirstPoint (const Standard_Integer anitem, Standard_Real& dist);
0072   
0073   //! Creates the Tangent at the end of the Item defined
0074   //! by <anitem>. Returns the index of this vector in
0075   //! <theGeomVecs>
0076   Standard_EXPORT Standard_Integer TangentBefore (const Standard_Integer anitem, const Standard_Boolean IsOpenResult);
0077   
0078   //! Creates the Reversed Tangent at the origin of the Item
0079   //! defined by <anitem>. Returns the index of this vector in
0080   //! <theGeomVecs>
0081   Standard_EXPORT Standard_Integer TangentAfter (const Standard_Integer anitem, const Standard_Boolean IsOpenResult);
0082   
0083   //! Creates the Tangent at the end of the bisector defined
0084   //! by <bisector>. Returns the index of this vector in
0085   //! <theGeomVecs>
0086   Standard_EXPORT Standard_Integer Tangent (const Standard_Integer bisector);
0087   
0088   //! Creates the geometric bisector defined by <abisector>.
0089   Standard_EXPORT void CreateBisector (const Handle(MAT_Bisector)& abisector);
0090   
0091   //! Trims the geometric bisector by the <firstparameter>
0092   //! of <abisector>.
0093   //! If the parameter is out of the bisector, Return FALSE.
0094   //! else Return True.
0095   Standard_EXPORT Standard_Boolean TrimBisector (const Handle(MAT_Bisector)& abisector);
0096   
0097   //! Trims the geometric bisector by the point of index
0098   //! <apoint> in <theGeomPnts>.
0099   //! If the point is out of the bisector, Return FALSE.
0100   //! else Return True.
0101   Standard_EXPORT Standard_Boolean TrimBisector (const Handle(MAT_Bisector)& abisector, const Standard_Integer apoint);
0102   
0103   //! Computes  the point  of  intersection between  the
0104   //! bisectors defined  by  <bisectorone>  and
0105   //! <bisectortwo> .
0106   //! If this point exists,  <intpnt> is its  index
0107   //! in <theGeomPnts> and Return the distance of the point
0108   //! from the bisector else Return <RealLast>.
0109   Standard_EXPORT Standard_Real IntersectBisector (const Handle(MAT_Bisector)& bisectorone, const Handle(MAT_Bisector)& bisectortwo, Standard_Integer& intpnt);
0110   
0111   //! Returns the distance between the two points designed
0112   //! by their parameters on <abisector>.
0113   Standard_EXPORT Standard_Real Distance (const Handle(MAT_Bisector)& abisector, const Standard_Real param1, const Standard_Real param2) const;
0114   
0115   //! displays information about the bisector defined by
0116   //! <bisector>.
0117   Standard_EXPORT void Dump (const Standard_Integer bisector, const Standard_Integer erease) const;
0118   
0119   //! Returns the <Bisec> of index <Index> in
0120   //! <theGeomBisectors>.
0121   Standard_EXPORT const Bisector_Bisec& GeomBis (const Standard_Integer Index) const;
0122   
0123   //! Returns the Geometry of index <Index> in <theGeomElts>.
0124   Standard_EXPORT Handle(Geom2d_Geometry) GeomElt (const Standard_Integer Index) const;
0125   
0126   //! Returns the point of index <Index> in the <theGeomPnts>.
0127   Standard_EXPORT const gp_Pnt2d& GeomPnt (const Standard_Integer Index) const;
0128   
0129   //! Returns the  vector  of index <Index> in the
0130   //! <theGeomVecs>.
0131   Standard_EXPORT const gp_Vec2d& GeomVec (const Standard_Integer Index) const;
0132   
0133   Standard_EXPORT Handle(MAT2d_Circuit) Circuit() const;
0134   
0135   Standard_EXPORT void BisecFusion (const Standard_Integer Index1, const Standard_Integer Index2);
0136   
0137   //! Returns the <Bisec> of index <Index> in
0138   //! <theGeomBisectors>.
0139   Standard_EXPORT Bisector_Bisec& ChangeGeomBis (const Standard_Integer Index);
0140 
0141 
0142 
0143 
0144 protected:
0145 
0146 
0147 
0148 
0149 
0150 private:
0151 
0152   
0153   //! Returns True if the point <apoint> is equidistant to
0154   //! the elements separated by bisectors <bisectorone> and
0155   //! <bisectortwo>.
0156   //! In this case <adistance> is the distance of the point
0157   //! from the bisectors.
0158   Standard_EXPORT Standard_Boolean IsSameDistance (const Handle(MAT_Bisector)& bisectorone, const Handle(MAT_Bisector)& bisectortwo, const gp_Pnt2d& apoint, Standard_Real& adistance) const;
0159   
0160   //! Return <True> if the Point can be projected
0161   //! on the element designed by <IndexElt>.
0162   //! In this case <Distance> is the minimum of distance
0163   //! between Point and its projections.
0164   Standard_EXPORT Standard_Boolean Projection (const Standard_Integer IndexElt, const gp_Pnt2d& Point, Standard_Real& Distance) const;
0165   
0166   Standard_EXPORT void TrimBisec (Bisector_Bisec& Bis, const Standard_Integer IndexEdge, const Standard_Boolean OnLine, const Standard_Integer StartOrEnd) const;
0167 
0168 
0169   Standard_Real theDirection;
0170   GeomAbs_JoinType theJoinType;
0171   Standard_Integer theNumberOfBisectors;
0172   Standard_Integer theNumberOfPnts;
0173   Standard_Integer theNumberOfVecs;
0174   Handle(MAT2d_Circuit) theCircuit;
0175   MAT2d_DataMapOfIntegerBisec theGeomBisectors;
0176   MAT2d_DataMapOfIntegerPnt2d theGeomPnts;
0177   MAT2d_DataMapOfIntegerVec2d theGeomVecs;
0178   TColStd_SequenceOfInteger theLinesLength;
0179 
0180 
0181 };
0182 
0183 
0184 
0185 
0186 
0187 
0188 
0189 #endif // _MAT2d_Tool2d_HeaderFile