Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:37:19

0001 // Created on: 1992-01-30
0002 // Created by: Didier PIFFAULT
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 _TopTrans_SurfaceTransition_HeaderFile
0018 #define _TopTrans_SurfaceTransition_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <gp_Dir.hxx>
0024 #include <TColStd_Array2OfReal.hxx>
0025 #include <TopTrans_Array2OfOrientation.hxx>
0026 #include <TopAbs_Orientation.hxx>
0027 #include <TopAbs_State.hxx>
0028 
0029 //! This algorithm  is used to  compute the transition
0030 //! of a 3D surface intersecting a topological surfacic
0031 //! boundary on a 3D curve ( intersection curve ).
0032 //! The  boundary is  described  by a  set of faces
0033 //! each face is described by
0034 //! - its support surface,
0035 //! - an orientation defining its matter side.
0036 //! The geometric elements are described locally at the
0037 //! intersection point by a second order development.
0038 //! A surface is described by the normal vector, the
0039 //! principal directions and the principal curvatures.
0040 //! A curve is described  by the  tangent, the normal
0041 //! and the curvature.
0042 //! The  algorithm  keeps track of the two faces elements
0043 //! closest to the part of the curve "before" and "after"
0044 //! the intersection,  these  two elements are updated
0045 //! for each new face.
0046 //! The position of the  curve can be computed when at
0047 //! least  one surface  element has   been given, this
0048 //! position is "In","Out" or "On" for the part of the
0049 //! curve "Before" or "After" the intersection.
0050 class TopTrans_SurfaceTransition
0051 {
0052 public:
0053   DEFINE_STANDARD_ALLOC
0054 
0055   //! Create an empty Surface Transition.
0056   Standard_EXPORT TopTrans_SurfaceTransition();
0057 
0058   //! Initialize  a  Surface Transition with the local
0059   //! description of the intersection curve and of the
0060   //! reference surface.
0061   //! PREQUESITORY : Norm oriented OUTSIDE "geometric matter"
0062   Standard_EXPORT void Reset(const gp_Dir&       Tgt,
0063                              const gp_Dir&       Norm,
0064                              const gp_Dir&       MaxD,
0065                              const gp_Dir&       MinD,
0066                              const Standard_Real MaxCurv,
0067                              const Standard_Real MinCurv);
0068 
0069   //! Initialize  a  Surface Transition  with the  local
0070   //! description of a straight line.
0071   Standard_EXPORT void Reset(const gp_Dir& Tgt, const gp_Dir& Norm);
0072 
0073   //! Add a face element to the boundary.
0074   //!
0075   //! - S defines topological orientation for the face :
0076   //! S FORWARD means: along the intersection curve on the
0077   //! reference surface, transition states while crossing
0078   //! the face are OUT,IN.
0079   //! S REVERSED means states are IN,OUT.
0080   //! S INTERNAL means states are IN,IN.
0081   //!
0082   //! - O defines curve's position on face :
0083   //! O FORWARD means the face is before the intersection
0084   //! O REVERSED means the face is AFTER
0085   //! O INTERNAL means the curve intersection is in the face.
0086   //! PREQUESITORY : Norm oriented OUTSIDE "geometric matter"
0087   Standard_EXPORT void Compare(const Standard_Real      Tole,
0088                                const gp_Dir&            Norm,
0089                                const gp_Dir&            MaxD,
0090                                const gp_Dir&            MinD,
0091                                const Standard_Real      MaxCurv,
0092                                const Standard_Real      MinCurv,
0093                                const TopAbs_Orientation S,
0094                                const TopAbs_Orientation O);
0095 
0096   //! Add a plane or a cylindric face to the boundary.
0097   Standard_EXPORT void Compare(const Standard_Real      Tole,
0098                                const gp_Dir&            Norm,
0099                                const TopAbs_Orientation S,
0100                                const TopAbs_Orientation O);
0101 
0102   //! Returns the state of the reference surface before
0103   //! the interference, this is the position relative to
0104   //! the surface of a  point very close to the intersection
0105   //! on the negative side of the tangent.
0106   Standard_EXPORT TopAbs_State StateBefore() const;
0107 
0108   //! Returns the state of the reference surface after
0109   //! interference, this is the position relative to the
0110   //! surface of a point very  close to the intersection
0111   //! on the positive side of the tangent.
0112   Standard_EXPORT TopAbs_State StateAfter() const;
0113 
0114   Standard_EXPORT static TopAbs_State GetBefore(const TopAbs_Orientation Tran);
0115 
0116   Standard_EXPORT static TopAbs_State GetAfter(const TopAbs_Orientation Tran);
0117 
0118 protected:
0119 private:
0120   Standard_EXPORT void UpdateReference(const Standard_Real      Tole,
0121                                        const Standard_Boolean   isInfRef,
0122                                        Standard_Real&           CosInf,
0123                                        Standard_Real&           CosSup,
0124                                        const TopAbs_Orientation Tran,
0125                                        TopAbs_Orientation&      TranRef);
0126 
0127   Standard_EXPORT Standard_Real ComputeCos(const Standard_Real      Tole,
0128                                            const gp_Dir&            Norm,
0129                                            const TopAbs_Orientation O,
0130                                            Standard_Boolean&        isleft) const;
0131 
0132   gp_Dir                       myTgt;
0133   gp_Dir                       myNorm;
0134   gp_Dir                       beafter;
0135   Standard_Real                myCurvRef;
0136   TColStd_Array2OfReal         myAng;
0137   TColStd_Array2OfReal         myCurv;
0138   TopTrans_Array2OfOrientation myOri;
0139   Standard_Boolean             myTouchFlag;
0140 };
0141 
0142 #endif // _TopTrans_SurfaceTransition_HeaderFile