Warning, /include/opencascade/IntCurve_Polygon2dGen.lxx is written in an unsupported language. File is not indexed.
0001 // Created on: 1993-06-03
0002 // Created by: Laurent BUCHARD
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 #include <Standard_OutOfRange.hxx>
0018
0019 //======================================================================
0020 inline double IntCurve_Polygon2dGen::DeflectionOverEstimation() const
0021 {
0022 return (TheDeflection);
0023 } //======================================================================
0024
0025 inline void IntCurve_Polygon2dGen::SetDeflectionOverEstimation(const double x)
0026 {
0027 TheDeflection = x;
0028 myBox.Enlarge(TheDeflection);
0029 }
0030
0031 //======================================================================
0032 inline void IntCurve_Polygon2dGen::Closed(const bool flag)
0033 {
0034 ClosedPolygon = flag;
0035 }
0036
0037 //======================================================================
0038 inline int IntCurve_Polygon2dGen::NbSegments() const
0039 {
0040 return ((ClosedPolygon) ? NbPntIn : NbPntIn - 1);
0041 }
0042
0043 //======================================================================
0044 inline double IntCurve_Polygon2dGen::InfParameter() const
0045 {
0046 return (TheParams.Value(TheIndex(1)));
0047 }
0048
0049 //======================================================================
0050 inline double IntCurve_Polygon2dGen::SupParameter() const
0051 {
0052 return (TheParams.Value(TheIndex(NbPntIn)));
0053 }
0054
0055 //======================================================================
0056
0057 //======================================================================
0058 inline int IntCurve_Polygon2dGen::CalculRegion(const double x,
0059 const double y,
0060 const double x1,
0061 const double x2,
0062 const double y1,
0063 const double y2) const
0064 {
0065 int r;
0066 if (x < x1)
0067 {
0068 r = 1;
0069 }
0070 else
0071 {
0072 if (x > x2)
0073 {
0074 r = 2;
0075 }
0076 else
0077 {
0078 r = 0;
0079 }
0080 }
0081 if (y < y1)
0082 {
0083 r |= 4;
0084 }
0085 else
0086 {
0087 if (y > y2)
0088 {
0089 r |= 8;
0090 }
0091 }
0092 return (r);
0093 }