Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:45:42

0001 // Created on: 1994-03-24
0002 // Created by: model
0003 // Copyright (c) 1994-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 _Adaptor3d_TopolTool_HeaderFile
0018 #define _Adaptor3d_TopolTool_HeaderFile
0019 
0020 #include <Adaptor2d_Line2d.hxx>
0021 #include <Adaptor3d_HVertex.hxx>
0022 #include <Adaptor3d_Surface.hxx>
0023 #include <TColStd_Array1OfReal.hxx>
0024 #include <TColStd_HArray1OfReal.hxx>
0025 #include <TopAbs_State.hxx>
0026 #include <TopAbs_Orientation.hxx>
0027 
0028 class Adaptor3d_HVertex;
0029 
0030 DEFINE_STANDARD_HANDLE(Adaptor3d_TopolTool, Standard_Transient)
0031 
0032 //! This class provides a default topological tool,
0033 //! based on the Umin,Vmin,Umax,Vmax of an HSurface from Adaptor3d.
0034 //! All methods and fields may be redefined when inheriting from this class.
0035 //! This class is used to instantiate algorithms as Intersection, outlines,...
0036 class Adaptor3d_TopolTool : public Standard_Transient
0037 {
0038 
0039 public:
0040 
0041   Standard_EXPORT Adaptor3d_TopolTool();
0042   
0043   Standard_EXPORT Adaptor3d_TopolTool(const Handle(Adaptor3d_Surface)& Surface);
0044   
0045   Standard_EXPORT virtual void Initialize();
0046   
0047   Standard_EXPORT virtual void Initialize (const Handle(Adaptor3d_Surface)& S);
0048   
0049   Standard_EXPORT virtual void Initialize (const Handle(Adaptor2d_Curve2d)& Curve);
0050   
0051   Standard_EXPORT virtual void Init();
0052   
0053   Standard_EXPORT virtual Standard_Boolean More();
0054   
0055   Standard_EXPORT virtual Handle(Adaptor2d_Curve2d) Value();
0056   
0057   Standard_EXPORT virtual void Next();
0058   
0059   Standard_EXPORT virtual void InitVertexIterator();
0060   
0061   Standard_EXPORT virtual Standard_Boolean MoreVertex();
0062   
0063   Standard_EXPORT virtual Handle(Adaptor3d_HVertex) Vertex();
0064   
0065   Standard_EXPORT virtual void NextVertex();
0066   
0067   Standard_EXPORT virtual TopAbs_State Classify (const gp_Pnt2d& P, const Standard_Real Tol, const Standard_Boolean ReacdreOnPeriodic = Standard_True);
0068   
0069   Standard_EXPORT virtual Standard_Boolean IsThePointOn (const gp_Pnt2d& P, const Standard_Real Tol, const Standard_Boolean ReacdreOnPeriodic = Standard_True);
0070   
0071   //! If the function returns the orientation of the arc.
0072   //! If the orientation is FORWARD or REVERSED, the arc is
0073   //! a "real" limit of the surface.
0074   //! If the orientation is INTERNAL or EXTERNAL, the arc is
0075   //! considered as an arc on the surface.
0076   Standard_EXPORT virtual TopAbs_Orientation Orientation (const Handle(Adaptor2d_Curve2d)& C);
0077   
0078   //! Returns the orientation of the vertex V.
0079   //! The vertex has been found with an exploration on
0080   //! a given arc. The orientation is the orientation
0081   //! of the vertex on this arc.
0082   Standard_EXPORT virtual TopAbs_Orientation Orientation (const Handle(Adaptor3d_HVertex)& V);
0083   
0084   //! Returns True if the vertices V1 and V2 are identical.
0085   //! This method does not take the orientation of the
0086   //! vertices in account.
0087   Standard_EXPORT virtual Standard_Boolean Identical (const Handle(Adaptor3d_HVertex)& V1, const Handle(Adaptor3d_HVertex)& V2);
0088   
0089   //! answers if arcs and vertices may have 3d representations,
0090   //! so that we could use Tol3d and Pnt methods.
0091   Standard_EXPORT virtual Standard_Boolean Has3d() const;
0092   
0093   //! returns 3d tolerance of the arc C
0094   Standard_EXPORT virtual Standard_Real Tol3d (const Handle(Adaptor2d_Curve2d)& C) const;
0095   
0096   //! returns 3d tolerance of the vertex V
0097   Standard_EXPORT virtual Standard_Real Tol3d (const Handle(Adaptor3d_HVertex)& V) const;
0098   
0099   //! returns 3d point of the vertex V
0100   Standard_EXPORT virtual gp_Pnt Pnt (const Handle(Adaptor3d_HVertex)& V) const;
0101   
0102   Standard_EXPORT virtual void ComputeSamplePoints();
0103   
0104   //! compute the sample-points for the intersections algorithms
0105   Standard_EXPORT virtual Standard_Integer NbSamplesU();
0106   
0107   //! compute the sample-points for the intersections algorithms
0108   Standard_EXPORT virtual Standard_Integer NbSamplesV();
0109   
0110   //! compute the sample-points for the intersections algorithms
0111   Standard_EXPORT virtual Standard_Integer NbSamples();
0112   
0113   //! return the set of U parameters on the surface
0114   //! obtained by the method SamplePnts
0115   Standard_EXPORT void UParameters (TColStd_Array1OfReal& theArray) const;
0116   
0117   //! return the set of V parameters on the surface
0118   //! obtained by the method SamplePnts
0119   Standard_EXPORT void VParameters (TColStd_Array1OfReal& theArray) const;
0120   
0121   Standard_EXPORT virtual void SamplePoint (const Standard_Integer Index, gp_Pnt2d& P2d, gp_Pnt& P3d);
0122   
0123   Standard_EXPORT virtual Standard_Boolean DomainIsInfinite();
0124   
0125   Standard_EXPORT virtual Standard_Address Edge() const;
0126 
0127   //! Compute the sample-points for the intersections algorithms by adaptive algorithm for BSpline surfaces.
0128   //! For other surfaces algorithm is the same as in method ComputeSamplePoints(),
0129   //! but only fill arrays of U and V sample parameters;
0130   //! @param theDefl  [in] a required deflection
0131   //! @param theNUmin [in] minimal nb points for U
0132   //! @param theNVmin [in] minimal nb points for V
0133   Standard_EXPORT virtual void SamplePnts (const Standard_Real theDefl,
0134                                            const Standard_Integer theNUmin,
0135                                            const Standard_Integer theNVmin);
0136 
0137   //! Compute the sample-points for the intersections algorithms
0138   //! by adaptive algorithm for BSpline surfaces - is used in SamplePnts
0139   //! @param theDefl  [in] required deflection
0140   //! @param theNUmin [in] minimal nb points for U
0141   //! @param theNVmin [in] minimal nb points for V
0142   Standard_EXPORT virtual void BSplSamplePnts (const Standard_Real theDefl,
0143                                                const Standard_Integer theNUmin,
0144                                                const Standard_Integer theNVmin);
0145 
0146   //! Returns true if provide uniform sampling of points.
0147   Standard_EXPORT virtual Standard_Boolean IsUniformSampling() const;
0148 
0149   //! Computes the cone's apex parameters.
0150   //! @param[in] theC conical surface
0151   //! @param[in] theU U parameter of cone's apex
0152   //! @param[in] theV V parameter of cone's apex
0153   Standard_EXPORT static void GetConeApexParam (const gp_Cone& theC, Standard_Real& theU, Standard_Real& theV);
0154 
0155   DEFINE_STANDARD_RTTIEXT(Adaptor3d_TopolTool,Standard_Transient)
0156 
0157 protected:
0158 
0159   Handle(Adaptor3d_Surface) myS;
0160   Standard_Integer myNbSamplesU;
0161   Standard_Integer myNbSamplesV;
0162   Handle(TColStd_HArray1OfReal) myUPars;
0163   Handle(TColStd_HArray1OfReal) myVPars;
0164 
0165 private:
0166 
0167   Standard_Integer nbRestr;
0168   Standard_Integer idRestr;
0169   Standard_Real Uinf;
0170   Standard_Real Usup;
0171   Standard_Real Vinf;
0172   Standard_Real Vsup;
0173   Handle(Adaptor2d_Line2d) myRestr[4];
0174   Standard_Integer nbVtx;
0175   Standard_Integer idVtx;
0176   Handle(Adaptor3d_HVertex) myVtx[2];
0177 
0178 };
0179 
0180 #endif // _Adaptor3d_TopolTool_HeaderFile