Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:35:58

0001 // Created on: 1991-03-05
0002 // Created by: Remy GILET
0003 // Copyright (c) 1991-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 _GccEnt_HeaderFile
0018 #define _GccEnt_HeaderFile
0019 
0020 #include <GccEnt_Position.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024 #include <Standard_OStream.hxx>
0025 
0026 class GccEnt_QualifiedLin;
0027 class gp_Lin2d;
0028 class GccEnt_QualifiedCirc;
0029 class gp_Circ2d;
0030 
0031 //! This package provides an implementation of the qualified
0032 //! entities useful to create 2d entities with geometric
0033 //! constraints. The qualifier explains which subfamily of
0034 //! solutions we want to obtain. It uses the following law: the
0035 //! matter/the interior side is at the left of the line, if we go
0036 //! from the beginning to the end.
0037 //! The qualifiers are:
0038 //! Enclosing   : the solution(s) must enclose the argument.
0039 //! Enclosed    : the solution(s) must be enclosed in the
0040 //! argument.
0041 //! Outside     : both the solution(s) and the argument must be
0042 //! outside to each other.
0043 //! Unqualified : the position is undefined, so give all the
0044 //! solutions.
0045 //! The use of a qualifier is always required if such
0046 //! subfamilies exist. For example, it is not used for a point.
0047 //! Note:    the interior of a curve is defined as the left-hand
0048 //! side of the curve in relation to its orientation.
0049 class GccEnt
0050 {
0051 public:
0052   DEFINE_STANDARD_ALLOC
0053 
0054   //! Prints the name of Position type as a String on the Stream.
0055   static Standard_OStream& Print(const GccEnt_Position thePosition, Standard_OStream& theStream)
0056   {
0057     return (theStream << PositionToString(thePosition));
0058   }
0059 
0060   //! Returns the string name for a given position.
0061   //! @param thePosition position type
0062   //! @return string identifier from the list UNQUALIFIED ENCLOSING ENCLOSED OUTSIDE NOQUALIFIER
0063   Standard_EXPORT static Standard_CString PositionToString(GccEnt_Position thePosition);
0064 
0065   //! Returns the position from the given string identifier (using case-insensitive comparison).
0066   //! @param thePositionString string identifier
0067   //! @return position or GccEnt_unqualified if string identifier is invalid
0068   static GccEnt_Position PositionFromString(Standard_CString thePositionString)
0069   {
0070     GccEnt_Position aPosition = GccEnt_unqualified;
0071     PositionFromString(thePositionString, aPosition);
0072     return aPosition;
0073   }
0074 
0075   //! Determines the position from the given string identifier (using case-insensitive comparison).
0076   //! @param thePositionString string identifier
0077   //! @param thePosition detected shape type
0078   //! @return TRUE if string identifier is known
0079   Standard_EXPORT static Standard_Boolean PositionFromString(Standard_CString thePositionString,
0080                                                              GccEnt_Position& thePosition);
0081 
0082   //! Constructs a qualified line,
0083   //! so that the relative position to the circle or line of the
0084   //! solution computed by a construction algorithm using the
0085   //! qualified circle or line is not qualified, i.e. all solutions apply.
0086   Standard_EXPORT static GccEnt_QualifiedLin Unqualified(const gp_Lin2d& Obj);
0087 
0088   //! Constructs a qualified circle
0089   //! so that the relative position to the circle or line of the
0090   //! solution computed by a construction algorithm using the
0091   //! qualified circle or line is not qualified, i.e. all solutions apply.
0092   Standard_EXPORT static GccEnt_QualifiedCirc Unqualified(const gp_Circ2d& Obj);
0093 
0094   //! Constructs such a qualified circle that the solution
0095   //! computed by a construction algorithm using the qualified
0096   //! circle encloses the circle.
0097   Standard_EXPORT static GccEnt_QualifiedCirc Enclosing(const gp_Circ2d& Obj);
0098 
0099   //! Constructs a qualified line,
0100   //! so that the solution computed by a construction
0101   //! algorithm using the qualified circle or line is enclosed by
0102   //! the circle or line.
0103   Standard_EXPORT static GccEnt_QualifiedLin Enclosed(const gp_Lin2d& Obj);
0104 
0105   //! Constructs a qualified circle
0106   //! so that the solution computed by a construction
0107   //! algorithm using the qualified circle or line is enclosed by
0108   //! the circle or line.
0109   Standard_EXPORT static GccEnt_QualifiedCirc Enclosed(const gp_Circ2d& Obj);
0110 
0111   //! Constructs a qualified line,
0112   //! so that the solution computed by a construction
0113   //! algorithm using the qualified circle or line and the circle
0114   //! or line are external to one another.
0115   Standard_EXPORT static GccEnt_QualifiedLin Outside(const gp_Lin2d& Obj);
0116 
0117   //! Constructs a qualified circle
0118   //! so that the solution computed by a construction
0119   //! algorithm using the qualified circle or line and the circle
0120   //! or line are external to one another.
0121   Standard_EXPORT static GccEnt_QualifiedCirc Outside(const gp_Circ2d& Obj);
0122 };
0123 
0124 #endif // _GccEnt_HeaderFile