Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-02 09:14:20

0001 // Created on: 1993-11-10
0002 // Created by: Jean Yves LEBEY
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 _TopOpeBRep_VPointInter_HeaderFile
0018 #define _TopOpeBRep_VPointInter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <TopOpeBRep_PThePointOfIntersection.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <TopAbs_State.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <IntSurf_Transition.hxx>
0028 #include <Standard_OStream.hxx>
0029 class gp_Pnt;
0030 class gp_Pnt2d;
0031 class TopoDS_Edge;
0032 class TopoDS_Face;
0033 
0034 class TopOpeBRep_VPointInter
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   TopOpeBRep_VPointInter();
0040 
0041   Standard_EXPORT void SetPoint(const IntPatch_Point& P);
0042 
0043   void SetShapes(const int I1, const int I2);
0044 
0045   void GetShapes(int& I1, int& I2) const;
0046 
0047   IntSurf_Transition TransitionOnS1() const;
0048 
0049   IntSurf_Transition TransitionOnS2() const;
0050 
0051   IntSurf_Transition TransitionLineArc1() const;
0052 
0053   IntSurf_Transition TransitionLineArc2() const;
0054 
0055   bool IsOnDomS1() const;
0056 
0057   bool IsOnDomS2() const;
0058 
0059   void ParametersOnS1(double& u, double& v) const;
0060 
0061   void ParametersOnS2(double& u, double& v) const;
0062 
0063   const gp_Pnt& Value() const;
0064 
0065   double Tolerance() const;
0066 
0067   Standard_EXPORT const TopoDS_Shape& ArcOnS1() const;
0068 
0069   Standard_EXPORT const TopoDS_Shape& ArcOnS2() const;
0070 
0071   double ParameterOnLine() const;
0072 
0073   double ParameterOnArc1() const;
0074 
0075   //! Returns TRUE if the point is a vertex on the initial
0076   //! restriction facet of the first surface.
0077   bool IsVertexOnS1() const;
0078 
0079   //! Returns the information about the point when it is
0080   //! on the domain of the first patch, i-e when the function
0081   //! IsVertexOnS1 returns True.
0082   //! Otherwise, an exception is raised.
0083   Standard_EXPORT const TopoDS_Shape& VertexOnS1() const;
0084 
0085   double ParameterOnArc2() const;
0086 
0087   //! Returns TRUE if the point is a vertex on the initial
0088   //! restriction facet of the second surface.
0089   bool IsVertexOnS2() const;
0090 
0091   //! Returns the information about the point when it is
0092   //! on the domain of the second patch, i-e when the function
0093   //! IsVertexOnS2 returns True.
0094   //! Otherwise, an exception is raised.
0095   Standard_EXPORT const TopoDS_Shape& VertexOnS2() const;
0096 
0097   bool IsInternal() const;
0098 
0099   //! Returns True if the point belongs to several intersection
0100   //! lines.
0101   bool IsMultiple() const;
0102 
0103   //! get state of VPoint within the domain of geometric shape
0104   //! domain <I> (= 1 or 2).
0105   Standard_EXPORT TopAbs_State State(const int I) const;
0106 
0107   //! Set the state of VPoint within the domain of
0108   //! the geometric shape <I> (= 1 or 2).
0109   Standard_EXPORT void State(const TopAbs_State S, const int I);
0110 
0111   //! set the shape Eon of shape I (1,2) containing the point,
0112   //! and parameter <Par> of point on <Eon>.
0113   Standard_EXPORT void EdgeON(const TopoDS_Shape& Eon, const double Par, const int I);
0114 
0115   //! get the edge of shape I (1,2) containing the point.
0116   Standard_EXPORT const TopoDS_Shape& EdgeON(const int I) const;
0117 
0118   //! get the parameter on edge of shape I (1,2) containing the point.
0119   Standard_EXPORT double EdgeONParameter(const int I) const;
0120 
0121   //! returns value of filed myShapeIndex = 0,1,2,3
0122   //! 0 means the VPoint is on no restriction
0123   //! 1 means the VPoint is on the restriction 1
0124   //! 2 means the VPoint is on the restriction 2
0125   //! 3 means the VPoint is on the restrictions 1 and 2
0126   int ShapeIndex() const;
0127 
0128   //! set value of shape supporting me (0,1,2,3).
0129   void ShapeIndex(const int I);
0130 
0131   //! get the edge of shape I (1,2) containing the point.
0132   //! Returned shape is null if the VPoint is not on an edge
0133   //! of shape I (1,2).
0134   Standard_EXPORT const TopoDS_Shape& Edge(const int I) const;
0135 
0136   //! get the parameter on edge of shape I (1,2) containing the point
0137   Standard_EXPORT double EdgeParameter(const int I) const;
0138 
0139   //! get the parameter on surface of shape I (1,2) containing the point
0140   Standard_EXPORT gp_Pnt2d SurfaceParameters(const int I) const;
0141 
0142   Standard_EXPORT bool IsVertex(const int I) const;
0143 
0144   Standard_EXPORT const TopoDS_Shape& Vertex(const int I) const;
0145 
0146   //! set myKeep value according to current states.
0147   Standard_EXPORT void UpdateKeep();
0148 
0149   //! Returns value of myKeep (does not evaluate states)
0150   //! False at creation of VPoint.
0151   //! Updated by State(State from TopAbs,Integer from Standard)
0152   bool Keep() const;
0153 
0154   //! updates VPointInter flag "keep" with <keep>.
0155   void ChangeKeep(const bool keep);
0156 
0157   //! returns <True> if the 3d points and the parameters of the
0158   //! VPoints are same
0159   Standard_EXPORT bool EqualpP(const TopOpeBRep_VPointInter& VP) const;
0160 
0161   //! returns <false> if the vpoint is not given on arc <E>,
0162   //! else returns <par> parameter on <E>
0163   Standard_EXPORT bool ParonE(const TopoDS_Edge& E, double& par) const;
0164 
0165   void Index(const int I);
0166 
0167   int Index() const;
0168 
0169   Standard_EXPORT Standard_OStream& Dump(const int          I,
0170                                          const TopoDS_Face& F,
0171                                          Standard_OStream&  OS) const;
0172 
0173   Standard_EXPORT Standard_OStream& Dump(const TopoDS_Face& F1,
0174                                          const TopoDS_Face& F2,
0175                                          Standard_OStream&  OS) const;
0176 
0177   Standard_EXPORT TopOpeBRep_PThePointOfIntersection PThePointOfIntersectionDummy() const;
0178 
0179 private:
0180   TopOpeBRep_PThePointOfIntersection myPPOI;
0181   int                                myShapeIndex;
0182   TopAbs_State                       myState1;
0183   TopAbs_State                       myState2;
0184   bool                               myKeep;
0185   TopoDS_Shape                       myEdgeON1;
0186   TopoDS_Shape                       myEdgeON2;
0187   double                             myEdgeONPar1;
0188   double                             myEdgeONPar2;
0189   int                                myIndex;
0190   TopoDS_Shape                       myNullShape;
0191   int                                myS1;
0192   int                                myS2;
0193 };
0194 
0195 #include <TopOpeBRep_VPointInter.lxx>
0196 
0197 #endif // _TopOpeBRep_VPointInter_HeaderFile