Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:21

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 
0032 //! point    start/end of  fillet common  to  2 adjacent  filets
0033 //! and  to an edge on  one of 2 faces participating
0034 //! in  the construction of  the  fillet
0035 class ChFiDS_CommonPoint 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   //! Empty constructor.
0043   Standard_EXPORT ChFiDS_CommonPoint();
0044   
0045   //! default value for all fields
0046   Standard_EXPORT void Reset();
0047   
0048   //! Sets the values of a point which is a vertex on
0049   //! the initial facet of restriction of one
0050   //! of the surface.
0051   void SetVertex (const TopoDS_Vertex& theVertex)
0052   {
0053     isvtx = Standard_True;
0054     vtx = theVertex;
0055   }
0056 
0057   //! Sets the values of a point which is on the arc
0058   //! A, at parameter Param.
0059   Standard_EXPORT void SetArc (const Standard_Real Tol, const TopoDS_Edge& A, const Standard_Real Param, const TopAbs_Orientation TArc);
0060   
0061   //! Sets the value of the parameter on the spine
0062   Standard_EXPORT void SetParameter (const Standard_Real 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 = Standard_True;
0072     vector = theVector;
0073   }
0074   
0075   //! This method set the fuzziness on the point.
0076   void SetTolerance (const Standard_Real Tol)
0077   {
0078     if (Tol > tol)
0079     {
0080       tol = Tol;
0081     }
0082   }
0083   
0084   //! This method returns the fuzziness on the point.
0085   Standard_Real Tolerance() const { return tol; }
0086   
0087   //! Returns TRUE if the point is a vertex on the initial
0088   //! restriction facet of the surface.
0089   Standard_Boolean 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) { throw Standard_DomainError(); }
0098     return vtx;
0099   }
0100 
0101   //! Returns TRUE if the point is a on an edge of the initial
0102   //! restriction facet of the surface.
0103   Standard_Boolean IsOnArc() const { return isonarc; }
0104   
0105   //! Returns the arc of restriction containing the
0106   //! vertex.
0107   Standard_EXPORT const TopoDS_Edge& Arc() const;
0108   
0109   //! Returns the transition of the point on the arc
0110   //! returned by Arc().
0111   Standard_EXPORT TopAbs_Orientation TransitionOnArc() const;
0112   
0113   //! Returns the parameter of the point on the
0114   //! arc returned by the method Arc().
0115   Standard_EXPORT Standard_Real ParameterOnArc() const;
0116   
0117   //! Returns the parameter on the spine
0118   Standard_EXPORT Standard_Real Parameter() const;
0119   
0120   //! Returns the 3d point
0121   const gp_Pnt& Point() const { return point; }
0122   
0123   //! Returns TRUE if the output vector is  stored.
0124   Standard_Boolean HasVector() const { return hasvector; }
0125   
0126   //! Returns the output  3d vector
0127   const gp_Vec& Vector() const
0128   {
0129     if (!hasvector) { throw Standard_DomainError ("ChFiDS_CommonPoint::Vector"); }
0130     return vector;
0131   }
0132 
0133 private:
0134 
0135   TopoDS_Edge arc;
0136   TopoDS_Vertex vtx;
0137   gp_Pnt point;
0138   gp_Vec vector;
0139   Standard_Real tol;
0140   Standard_Real prmarc;
0141   Standard_Real prmtg;
0142   TopAbs_Orientation traarc;
0143   Standard_Boolean isonarc;
0144   Standard_Boolean isvtx;
0145   Standard_Boolean hasvector;
0146 
0147 };
0148 
0149 #endif // _ChFiDS_CommonPoint_HeaderFile