Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:19:47

0001 // Created on: 1993-11-29
0002 // Created by: Isabelle GRIGNON
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 _ChFiDS_CommonPoint_HeaderFile
0018 #define _ChFiDS_CommonPoint_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopoDS_Edge.hxx>
0025 #include <TopoDS_Vertex.hxx>
0026 #include <gp_Pnt.hxx>
0027 #include <gp_Vec.hxx>
0028 #include <Standard_Boolean.hxx>
0029 #include <TopAbs_Orientation.hxx>
0030 
0031 //! point start/end of fillet common to 2 adjacent filets
0032 //! and to an edge on one of 2 faces participating
0033 //! in the construction of the fillet
0034 class ChFiDS_CommonPoint
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Empty constructor.
0040   Standard_EXPORT ChFiDS_CommonPoint();
0041 
0042   //! default value for all fields
0043   Standard_EXPORT void Reset();
0044 
0045   //! Sets the values of a point which is a vertex on
0046   //! the initial facet of restriction of one
0047   //! of the surface.
0048   void SetVertex(const TopoDS_Vertex& theVertex)
0049   {
0050     isvtx = true;
0051     vtx   = theVertex;
0052   }
0053 
0054   //! Sets the values of a point which is on the arc
0055   //! A, at parameter Param.
0056   Standard_EXPORT void SetArc(const double             Tol,
0057                               const TopoDS_Edge&       A,
0058                               const double             Param,
0059                               const TopAbs_Orientation TArc);
0060 
0061   //! Sets the value of the parameter on the spine
0062   Standard_EXPORT void SetParameter(const double Param);
0063 
0064   //! Set the 3d point for a commonpoint that is not
0065   //! a vertex or on an arc.
0066   void SetPoint(const gp_Pnt& thePoint) { point = thePoint; }
0067 
0068   //! Set the output 3d vector
0069   void SetVector(const gp_Vec& theVector)
0070   {
0071     hasvector = true;
0072     vector    = theVector;
0073   }
0074 
0075   //! This method set the fuzziness on the point.
0076   void SetTolerance(const double Tol)
0077   {
0078     if (Tol > tol)
0079     {
0080       tol = Tol;
0081     }
0082   }
0083 
0084   //! This method returns the fuzziness on the point.
0085   double Tolerance() const { return tol; }
0086 
0087   //! Returns TRUE if the point is a vertex on the initial
0088   //! restriction facet of the surface.
0089   bool IsVertex() const { return isvtx; }
0090 
0091   //! Returns the information about the point when it is
0092   //! on the domain of the first patch, i-e when the function
0093   //! IsVertex returns True.
0094   //! Otherwise, an exception is raised.
0095   const TopoDS_Vertex& Vertex() const
0096   {
0097     if (!isvtx)
0098     {
0099       throw Standard_DomainError();
0100     }
0101     return vtx;
0102   }
0103 
0104   //! Returns TRUE if the point is a on an edge of the initial
0105   //! restriction facet of the surface.
0106   bool IsOnArc() const { return isonarc; }
0107 
0108   //! Returns the arc of restriction containing the
0109   //! vertex.
0110   Standard_EXPORT const TopoDS_Edge& Arc() const;
0111 
0112   //! Returns the transition of the point on the arc
0113   //! returned by Arc().
0114   Standard_EXPORT TopAbs_Orientation TransitionOnArc() const;
0115 
0116   //! Returns the parameter of the point on the
0117   //! arc returned by the method Arc().
0118   Standard_EXPORT double ParameterOnArc() const;
0119 
0120   //! Returns the parameter on the spine
0121   Standard_EXPORT double Parameter() const;
0122 
0123   //! Returns the 3d point
0124   const gp_Pnt& Point() const { return point; }
0125 
0126   //! Returns TRUE if the output vector is stored.
0127   bool HasVector() const { return hasvector; }
0128 
0129   //! Returns the output 3d vector
0130   const gp_Vec& Vector() const
0131   {
0132     if (!hasvector)
0133     {
0134       throw Standard_DomainError("ChFiDS_CommonPoint::Vector");
0135     }
0136     return vector;
0137   }
0138 
0139 private:
0140   TopoDS_Edge        arc;
0141   TopoDS_Vertex      vtx;
0142   gp_Pnt             point;
0143   gp_Vec             vector;
0144   double             tol;
0145   double             prmarc;
0146   double             prmtg;
0147   TopAbs_Orientation traarc;
0148   bool               isonarc;
0149   bool               isvtx;
0150   bool               hasvector;
0151 };
0152 
0153 #endif // _ChFiDS_CommonPoint_HeaderFile