Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-11-10
0002 // Created by: Jean Marc LACHAUME
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 _Geom2dHatch_Hatching_HeaderFile
0018 #define _Geom2dHatch_Hatching_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Geom2dAdaptor_Curve.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <HatchGen_PointsOnHatching.hxx>
0027 #include <HatchGen_ErrorStatus.hxx>
0028 #include <HatchGen_Domains.hxx>
0029 
0030 class gp_Pnt2d;
0031 
0032 // resolve name collisions with X11 headers
0033 #ifdef Status
0034   #undef Status
0035 #endif
0036 
0037 class Geom2dHatch_Hatching 
0038 {
0039 public:
0040 
0041   DEFINE_STANDARD_ALLOC
0042 
0043   
0044   Standard_EXPORT Geom2dHatch_Hatching();
0045   
0046   //! Creates a hatching.
0047   Standard_EXPORT Geom2dHatch_Hatching(const Geom2dAdaptor_Curve& Curve);
0048   
0049   //! Returns the curve associated to the hatching.
0050   Standard_EXPORT const Geom2dAdaptor_Curve& Curve() const;
0051   
0052   //! Returns the curve associated to the hatching.
0053   Standard_EXPORT Geom2dAdaptor_Curve& ChangeCurve();
0054   
0055   //! Sets the flag about the trimming computations to the
0056   //! given value.
0057   Standard_EXPORT void TrimDone (const Standard_Boolean Flag);
0058   
0059   //! Returns the flag about the trimming computations.
0060   Standard_EXPORT Standard_Boolean TrimDone() const;
0061   
0062   //! Sets the flag about the trimming failure to the
0063   //! given value.
0064   Standard_EXPORT void TrimFailed (const Standard_Boolean Flag);
0065   
0066   //! Returns the flag about the trimming failure.
0067   Standard_EXPORT Standard_Boolean TrimFailed() const;
0068   
0069   //! Sets the flag about the domains computation to the
0070   //! given value.
0071   Standard_EXPORT void IsDone (const Standard_Boolean Flag);
0072   
0073   //! Returns the flag about the domains computation.
0074   Standard_EXPORT Standard_Boolean IsDone() const;
0075   
0076   //! Sets the error status.
0077   Standard_EXPORT void Status (const HatchGen_ErrorStatus theStatus);
0078   
0079   //! Returns the error status.
0080   Standard_EXPORT HatchGen_ErrorStatus Status() const;
0081   
0082   //! Adds an intersection point to the hatching.
0083   Standard_EXPORT void AddPoint (const HatchGen_PointOnHatching& Point, const Standard_Real Confusion);
0084   
0085   //! Returns the number of intersection points
0086   //! of the hatching.
0087   Standard_EXPORT Standard_Integer NbPoints() const;
0088   
0089   //! Returns the Index-th intersection point of the
0090   //! hatching.
0091   //! The exception OutOfRange is raised if
0092   //! Index < 1 or Index > NbPoints.
0093   Standard_EXPORT const HatchGen_PointOnHatching& Point (const Standard_Integer Index) const;
0094   
0095   //! Returns the Index-th intersection point of the
0096   //! hatching.
0097   //! The exception OutOfRange is raised if
0098   //! Index < 1 or Index > NbPoints.
0099   Standard_EXPORT HatchGen_PointOnHatching& ChangePoint (const Standard_Integer Index);
0100   
0101   //! Removes the Index-th intersection point of the
0102   //! hatching.
0103   //! The exception OutOfRange is raised if
0104   //! Index < 1 or Index > NbPoints.
0105   Standard_EXPORT void RemPoint (const Standard_Integer Index);
0106   
0107   //! Removes all the intersection points of the hatching.
0108   Standard_EXPORT void ClrPoints();
0109   
0110   //! Adds a domain to the hatching.
0111   Standard_EXPORT void AddDomain (const HatchGen_Domain& Domain);
0112   
0113   //! Returns the number of domains of the hatching.
0114   Standard_EXPORT Standard_Integer NbDomains() const;
0115   
0116   //! Returns the Index-th domain of the hatching.
0117   //! The exception OutOfRange is raised if
0118   //! Index < 1 or Index > NbDomains.
0119   Standard_EXPORT const HatchGen_Domain& Domain (const Standard_Integer Index) const;
0120   
0121   //! Removes the Index-th domain of the hatching.
0122   //! The exception OutOfRange is raised if
0123   //! Index < 1 or Index > NbDomains.
0124   Standard_EXPORT void RemDomain (const Standard_Integer Index);
0125   
0126   //! Removes all the domains of the hatching.
0127   Standard_EXPORT void ClrDomains();
0128   
0129   //! Returns a point on the curve.
0130   //! This point will be used for the classification.
0131   Standard_EXPORT gp_Pnt2d ClassificationPoint() const;
0132 
0133 
0134 
0135 
0136 protected:
0137 
0138 
0139 
0140 
0141 
0142 private:
0143 
0144 
0145 
0146   Geom2dAdaptor_Curve myCurve;
0147   Standard_Boolean myTrimDone;
0148   Standard_Boolean myTrimFailed;
0149   HatchGen_PointsOnHatching myPoints;
0150   Standard_Boolean myIsDone;
0151   HatchGen_ErrorStatus myStatus;
0152   HatchGen_Domains myDomains;
0153 
0154 
0155 };
0156 
0157 
0158 
0159 
0160 
0161 
0162 
0163 #endif // _Geom2dHatch_Hatching_HeaderFile