mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,2 +1,20 @@
|
||||
IntRes2d_Domain.cxx
|
||||
IntRes2d_Domain.hxx
|
||||
IntRes2d_Domain.lxx
|
||||
IntRes2d_Intersection.cxx
|
||||
IntRes2d_Intersection.hxx
|
||||
IntRes2d_Intersection.lxx
|
||||
IntRes2d_IntersectionPoint.cxx
|
||||
IntRes2d_IntersectionPoint.hxx
|
||||
IntRes2d_IntersectionPoint.lxx
|
||||
IntRes2d_IntersectionSegment.cxx
|
||||
IntRes2d_IntersectionSegment.hxx
|
||||
IntRes2d_IntersectionSegment.lxx
|
||||
IntRes2d_Position.hxx
|
||||
IntRes2d_SequenceOfIntersectionPoint.hxx
|
||||
IntRes2d_SequenceOfIntersectionSegment.hxx
|
||||
IntRes2d_Situation.hxx
|
||||
IntRes2d_Transition.cxx
|
||||
IntRes2d_Transition.hxx
|
||||
IntRes2d_Transition.lxx
|
||||
IntRes2d_TypeTrans.hxx
|
||||
|
@@ -1,58 +0,0 @@
|
||||
-- Created on: 1992-04-03
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
package IntRes2d
|
||||
|
||||
|
||||
---Purpose: This package provides the definition of the results of
|
||||
-- the intersection between 2D curves and the definition
|
||||
-- of a domain on a 2D curve.
|
||||
---Level: Public
|
||||
--
|
||||
-- All the methods of all the classes of this package are public.
|
||||
--
|
||||
|
||||
uses
|
||||
|
||||
Standard, TCollection, gp, StdFail
|
||||
|
||||
is
|
||||
|
||||
|
||||
class IntersectionPoint;
|
||||
|
||||
class IntersectionSegment;
|
||||
|
||||
class Transition;
|
||||
|
||||
class Domain;
|
||||
|
||||
deferred class Intersection;
|
||||
|
||||
enumeration Position is Head,Middle,End;
|
||||
|
||||
enumeration TypeTrans is In,Out,Touch,Undecided;
|
||||
|
||||
enumeration Situation is Inside, Outside, Unknown;
|
||||
|
||||
imported SequenceOfIntersectionPoint;
|
||||
|
||||
imported SequenceOfIntersectionSegment;
|
||||
|
||||
|
||||
end IntRes2d;
|
||||
|
||||
|
@@ -1,266 +0,0 @@
|
||||
-- Created on: 1992-03-05
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Domain from IntRes2d
|
||||
|
||||
|
||||
---Purpose: Definition of the domain of parameter on a 2d-curve.
|
||||
-- Most of the time, a domain is defined by two extremities.
|
||||
-- An extremity is made of :
|
||||
-- - a point in 2d-space (Pnt2d from gp),
|
||||
-- - a parameter on the curve,
|
||||
-- - a tolerance in the 2d-space.
|
||||
-- Sometimes, it can be made of 0 or 1 point ( for an infinite
|
||||
-- or semi-infinite line for example).
|
||||
--
|
||||
-- For Intersection algorithms, Ellipses and Circles
|
||||
-- Domains must be closed.
|
||||
-- So, SetEquivalentParameters(.,.) method must be called
|
||||
-- after initializing the first and the last bounds.
|
||||
|
||||
|
||||
|
||||
uses Pnt2d from gp
|
||||
|
||||
raises DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create
|
||||
|
||||
---Purpose: Creates an infinite Domain (HasFirstPoint = False
|
||||
-- and HasLastPoint = False).
|
||||
|
||||
returns Domain from IntRes2d;
|
||||
|
||||
|
||||
Create(Pnt1: Pnt2d from gp;
|
||||
Par1: Real from Standard;
|
||||
Tol1: Real from Standard;
|
||||
Pnt2: Pnt2d from gp;
|
||||
Par2: Real from Standard;
|
||||
Tol2: Real from Standard)
|
||||
|
||||
---Purpose: Creates a bounded Domain.
|
||||
|
||||
returns Domain from IntRes2d;
|
||||
|
||||
|
||||
Create(Pnt: Pnt2d from gp;
|
||||
Par: Real from Standard;
|
||||
Tol: Real from Standard;
|
||||
First: Boolean from Standard)
|
||||
|
||||
---Purpose: Creates a semi-infinite Domain. If First is set to
|
||||
-- True, the given point is the first point of the domain,
|
||||
-- otherwise it is the last point.
|
||||
|
||||
returns Domain from IntRes2d;
|
||||
|
||||
|
||||
SetValues(me: in out;
|
||||
Pnt1: Pnt2d from gp;
|
||||
Par1: Real from Standard;
|
||||
Tol1: Real from Standard;
|
||||
Pnt2: Pnt2d from gp;
|
||||
Par2: Real from Standard;
|
||||
Tol2: Real from Standard)
|
||||
|
||||
---Purpose: Sets the values for a bounded domain.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetValues(me: in out)
|
||||
|
||||
---Purpose : Sets the values for an infinite domain.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetValues(me: in out;
|
||||
Pnt: Pnt2d from gp;
|
||||
Par: Real from Standard;
|
||||
Tol: Real from Standard;
|
||||
First: Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the values for a semi-infinite domain.
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetEquivalentParameters(me: in out; zero,period: Real from Standard)
|
||||
|
||||
---Purpose: Defines a closed domain.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
HasFirstPoint(me)
|
||||
|
||||
---Purpose: Returns True if the domain has a first point, i-e
|
||||
-- a point defining the lowest admitted parameter on the
|
||||
-- curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
FirstParameter(me)
|
||||
|
||||
---Purpose: Returns the parameter of the first point of the domain
|
||||
-- The exception DomainError is raised if HasFirstPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
FirstPoint(me)
|
||||
|
||||
---Purpose: Returns the first point of the domain.
|
||||
-- The exception DomainError is raised if HasFirstPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns Pnt2d from gp
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
FirstTolerance(me)
|
||||
|
||||
---Purpose: Returns the tolerance of the first (left) bound.
|
||||
-- The exception DomainError is raised if HasFirstPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
HasLastPoint(me)
|
||||
|
||||
---Purpose: Returns True if the domain has a last point, i-e
|
||||
-- a point defining the highest admitted parameter on the
|
||||
-- curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
LastParameter(me)
|
||||
|
||||
---Purpose: Returns the parameter of the last point of the domain.
|
||||
-- The exception DomainError is raised if HasLastPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
LastPoint(me)
|
||||
|
||||
---Purpose: Returns the last point of the domain.
|
||||
-- The exception DomainError is raised if HasLastPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns Pnt2d from gp
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
LastTolerance(me)
|
||||
|
||||
---Purpose: Returns the tolerance of the last (right) bound.
|
||||
-- The exception DomainError is raised if HasLastPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsClosed(me)
|
||||
|
||||
---Purpose: Returns True if the domain is closed.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
EquivalentParameters(me; zero,zeroplusperiod:out Real from Standard)
|
||||
|
||||
---Purpose: Returns Equivalent parameters if the domain is closed.
|
||||
-- Otherwise, the exception DomainError is raised.
|
||||
|
||||
---C++: inline
|
||||
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
status : Integer from Standard;
|
||||
----------------------------------------
|
||||
-- Bit 0 : HasFist
|
||||
-- Bit 1 : HasLast
|
||||
-- Bit 2 : Closed
|
||||
----------------------------------------
|
||||
|
||||
first_param : Real from Standard;
|
||||
last_param : Real from Standard;
|
||||
|
||||
first_tol : Real from Standard;
|
||||
last_tol : Real from Standard;
|
||||
|
||||
first_point : Pnt2d from gp;
|
||||
last_point : Pnt2d from gp;
|
||||
|
||||
periodfirst : Real from Standard;
|
||||
periodlast : Real from Standard;
|
||||
|
||||
end Domain;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -18,8 +18,10 @@
|
||||
// --- limit infinite points and parameters in order to make
|
||||
// --- arithmetic operation on them safe
|
||||
|
||||
#include <IntRes2d_Domain.ixx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <IntRes2d_Domain.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
const Standard_Real infVal = Precision::Infinite();
|
||||
|
||||
|
156
src/IntRes2d/IntRes2d_Domain.hxx
Normal file
156
src/IntRes2d/IntRes2d_Domain.hxx
Normal file
@@ -0,0 +1,156 @@
|
||||
// Created on: 1992-03-05
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_Domain_HeaderFile
|
||||
#define _IntRes2d_Domain_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! Definition of the domain of parameter on a 2d-curve.
|
||||
//! Most of the time, a domain is defined by two extremities.
|
||||
//! An extremity is made of :
|
||||
//! - a point in 2d-space (Pnt2d from gp),
|
||||
//! - a parameter on the curve,
|
||||
//! - a tolerance in the 2d-space.
|
||||
//! Sometimes, it can be made of 0 or 1 point ( for an infinite
|
||||
//! or semi-infinite line for example).
|
||||
//!
|
||||
//! For Intersection algorithms, Ellipses and Circles
|
||||
//! Domains must be closed.
|
||||
//! So, SetEquivalentParameters(.,.) method must be called
|
||||
//! after initializing the first and the last bounds.
|
||||
class IntRes2d_Domain
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an infinite Domain (HasFirstPoint = False
|
||||
//! and HasLastPoint = False).
|
||||
Standard_EXPORT IntRes2d_Domain();
|
||||
|
||||
//! Creates a bounded Domain.
|
||||
Standard_EXPORT IntRes2d_Domain(const gp_Pnt2d& Pnt1, const Standard_Real Par1, const Standard_Real Tol1, const gp_Pnt2d& Pnt2, const Standard_Real Par2, const Standard_Real Tol2);
|
||||
|
||||
//! Creates a semi-infinite Domain. If First is set to
|
||||
//! True, the given point is the first point of the domain,
|
||||
//! otherwise it is the last point.
|
||||
Standard_EXPORT IntRes2d_Domain(const gp_Pnt2d& Pnt, const Standard_Real Par, const Standard_Real Tol, const Standard_Boolean First);
|
||||
|
||||
//! Sets the values for a bounded domain.
|
||||
Standard_EXPORT void SetValues (const gp_Pnt2d& Pnt1, const Standard_Real Par1, const Standard_Real Tol1, const gp_Pnt2d& Pnt2, const Standard_Real Par2, const Standard_Real Tol2);
|
||||
|
||||
//! Sets the values for an infinite domain.
|
||||
Standard_EXPORT void SetValues();
|
||||
|
||||
//! Sets the values for a semi-infinite domain.
|
||||
Standard_EXPORT void SetValues (const gp_Pnt2d& Pnt, const Standard_Real Par, const Standard_Real Tol, const Standard_Boolean First);
|
||||
|
||||
//! Defines a closed domain.
|
||||
void SetEquivalentParameters (const Standard_Real zero, const Standard_Real period);
|
||||
|
||||
//! Returns True if the domain has a first point, i-e
|
||||
//! a point defining the lowest admitted parameter on the
|
||||
//! curve.
|
||||
Standard_Boolean HasFirstPoint() const;
|
||||
|
||||
//! Returns the parameter of the first point of the domain
|
||||
//! The exception DomainError is raised if HasFirstPoint
|
||||
//! returns False.
|
||||
Standard_Real FirstParameter() const;
|
||||
|
||||
//! Returns the first point of the domain.
|
||||
//! The exception DomainError is raised if HasFirstPoint
|
||||
//! returns False.
|
||||
const gp_Pnt2d& FirstPoint() const;
|
||||
|
||||
//! Returns the tolerance of the first (left) bound.
|
||||
//! The exception DomainError is raised if HasFirstPoint
|
||||
//! returns False.
|
||||
Standard_Real FirstTolerance() const;
|
||||
|
||||
//! Returns True if the domain has a last point, i-e
|
||||
//! a point defining the highest admitted parameter on the
|
||||
//! curve.
|
||||
Standard_Boolean HasLastPoint() const;
|
||||
|
||||
//! Returns the parameter of the last point of the domain.
|
||||
//! The exception DomainError is raised if HasLastPoint
|
||||
//! returns False.
|
||||
Standard_Real LastParameter() const;
|
||||
|
||||
//! Returns the last point of the domain.
|
||||
//! The exception DomainError is raised if HasLastPoint
|
||||
//! returns False.
|
||||
const gp_Pnt2d& LastPoint() const;
|
||||
|
||||
//! Returns the tolerance of the last (right) bound.
|
||||
//! The exception DomainError is raised if HasLastPoint
|
||||
//! returns False.
|
||||
Standard_Real LastTolerance() const;
|
||||
|
||||
//! Returns True if the domain is closed.
|
||||
Standard_Boolean IsClosed() const;
|
||||
|
||||
//! Returns Equivalent parameters if the domain is closed.
|
||||
//! Otherwise, the exception DomainError is raised.
|
||||
void EquivalentParameters (Standard_Real& zero, Standard_Real& zeroplusperiod) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Integer status;
|
||||
Standard_Real first_param;
|
||||
Standard_Real last_param;
|
||||
Standard_Real first_tol;
|
||||
Standard_Real last_tol;
|
||||
gp_Pnt2d first_point;
|
||||
gp_Pnt2d last_point;
|
||||
Standard_Real periodfirst;
|
||||
Standard_Real periodlast;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <IntRes2d_Domain.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IntRes2d_Domain_HeaderFile
|
@@ -1,196 +0,0 @@
|
||||
-- Created on: 1992-04-27
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
deferred class Intersection from IntRes2d
|
||||
|
||||
|
||||
---Purpose: Defines the root class of all the Intersections
|
||||
-- between two 2D-Curves, and provides all the methods
|
||||
-- about the results of the Intersections Algorithms.
|
||||
|
||||
|
||||
uses IntersectionPoint from IntRes2d,
|
||||
IntersectionSegment from IntRes2d,
|
||||
SequenceOfIntersectionPoint from IntRes2d,
|
||||
SequenceOfIntersectionSegment from IntRes2d
|
||||
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Initialize
|
||||
|
||||
---Purpose: Empty constructor.
|
||||
is protected;
|
||||
---C++:inline
|
||||
|
||||
|
||||
Initialize(Other: Intersection from IntRes2d)
|
||||
---C++:inline
|
||||
is protected;
|
||||
|
||||
IsDone(me)
|
||||
|
||||
---Purpose: returns TRUE when the computation was successful.
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsEmpty(me)
|
||||
|
||||
---Purpose: Returns TRUE if there is no intersection between the
|
||||
-- given arguments.
|
||||
-- The exception NotDone is raised if IsDone returns FALSE.
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
NbPoints(me)
|
||||
|
||||
---Purpose: This function returns the number of intersection
|
||||
-- points between the 2 curves.
|
||||
-- The exception NotDone is raised if IsDone returns FALSE.
|
||||
---C++: inline
|
||||
|
||||
returns Integer from Standard
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Point(me; N : Integer from Standard)
|
||||
|
||||
---Purpose: This function returns the intersection point
|
||||
-- of range N;
|
||||
-- The exception NotDone is raised if IsDone returns FALSE.
|
||||
-- The exception OutOfRange is raised if (N <= 0)
|
||||
-- or (N > NbPoints).
|
||||
---C++: inline
|
||||
|
||||
returns IntersectionPoint from IntRes2d
|
||||
---C++: return const &
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
|
||||
NbSegments(me)
|
||||
|
||||
---Purpose: This function returns the number of intersection
|
||||
-- segments between the two curves.
|
||||
-- The exception NotDone is raised if IsDone returns FALSE.
|
||||
---C++: inline
|
||||
|
||||
returns Integer from Standard
|
||||
raises NotDone from StdFail
|
||||
is static;
|
||||
|
||||
|
||||
Segment(me; N : Integer)
|
||||
|
||||
---Purpose: This function returns the intersection segment
|
||||
-- of range N;
|
||||
-- The exception NotDone is raised if IsDone returns FALSE.
|
||||
-- The exception OutOfRange is raised if (N <= 0)
|
||||
-- or (N > NbPoints).
|
||||
---C++: inline
|
||||
|
||||
returns IntersectionSegment from IntRes2d
|
||||
---C++: return const &
|
||||
raises NotDone from StdFail,
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
SetValues(me: in out; Inter: Intersection from IntRes2d)
|
||||
|
||||
--Purpose: Copies the Inters values into the current object.
|
||||
|
||||
is static protected;
|
||||
|
||||
|
||||
Append(me: in out; Inter : Intersection from IntRes2d;
|
||||
FirstParam1: Real from Standard;
|
||||
LastParam1 : Real from Standard;
|
||||
FirstParam2: Real from Standard;
|
||||
LastParam2 : Real from Standard)
|
||||
|
||||
--Purpose: Appends the Inters values to the current object
|
||||
-- FirstParam and LastParam are the parameters of
|
||||
-- the bounds of the parameter interval of the
|
||||
-- curves.
|
||||
|
||||
is static protected;
|
||||
|
||||
|
||||
Append(me: in out; Seg: IntersectionSegment from IntRes2d)
|
||||
|
||||
--Purpose: Appends a new Intersection Segment.
|
||||
---C++: inline
|
||||
is static protected;
|
||||
|
||||
|
||||
Append(me: in out; Pnt: IntersectionPoint from IntRes2d)
|
||||
|
||||
--Purpose: Appends a new Intersection Point.
|
||||
---C++: inline
|
||||
is static protected;
|
||||
|
||||
|
||||
Insert(me: in out; Pnt: IntersectionPoint from IntRes2d)
|
||||
|
||||
--Purpose: Inserts a new Intersection Point.
|
||||
|
||||
is static protected;
|
||||
|
||||
|
||||
ResetFields(me: in out)
|
||||
|
||||
--Purpose: Resets all fields.
|
||||
---C++: inline
|
||||
is static protected;
|
||||
|
||||
|
||||
SetReversedParameters(me: in out; Reverseflag: Boolean from Standard)
|
||||
|
||||
--Purpose: Initialize the reverse flag. This flag is used to
|
||||
-- determine if the first and second parameters have
|
||||
-- to be swaped when the intersection points and
|
||||
-- segments are created.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
ReversedParameters(me)
|
||||
|
||||
--Purpose: Returns the value of the reverse flag.
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
is static protected;
|
||||
|
||||
fields
|
||||
|
||||
done : Boolean from Standard is protected;
|
||||
reverse : Boolean from Standard;
|
||||
lpnt : SequenceOfIntersectionPoint from IntRes2d;
|
||||
lseg : SequenceOfIntersectionSegment from IntRes2d;
|
||||
|
||||
end Intersection;
|
||||
|
@@ -14,14 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IntRes2d_Intersection.ixx>
|
||||
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <IntRes2d_Intersection.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <IntRes2d_IntersectionSegment.hxx>
|
||||
#include <IntRes2d_Position.hxx>
|
||||
#include <IntRes2d_SequenceOfIntersectionPoint.hxx>
|
||||
#include <IntRes2d_SequenceOfIntersectionSegment.hxx>
|
||||
#include <IntRes2d_Position.hxx>
|
||||
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
#define PARAMEQUAL(a,b) (Abs((a)-(b))< (1e-8))
|
||||
|
||||
|
126
src/IntRes2d/IntRes2d_Intersection.hxx
Normal file
126
src/IntRes2d/IntRes2d_Intersection.hxx
Normal file
@@ -0,0 +1,126 @@
|
||||
// Created on: 1992-04-27
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_Intersection_HeaderFile
|
||||
#define _IntRes2d_Intersection_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <IntRes2d_SequenceOfIntersectionPoint.hxx>
|
||||
#include <IntRes2d_SequenceOfIntersectionSegment.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class StdFail_NotDone;
|
||||
class Standard_OutOfRange;
|
||||
class IntRes2d_IntersectionPoint;
|
||||
class IntRes2d_IntersectionSegment;
|
||||
|
||||
|
||||
//! Defines the root class of all the Intersections
|
||||
//! between two 2D-Curves, and provides all the methods
|
||||
//! about the results of the Intersections Algorithms.
|
||||
class IntRes2d_Intersection
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! returns TRUE when the computation was successful.
|
||||
Standard_Boolean IsDone() const;
|
||||
|
||||
//! Returns TRUE if there is no intersection between the
|
||||
//! given arguments.
|
||||
//! The exception NotDone is raised if IsDone returns FALSE.
|
||||
Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! This function returns the number of intersection
|
||||
//! points between the 2 curves.
|
||||
//! The exception NotDone is raised if IsDone returns FALSE.
|
||||
Standard_Integer NbPoints() const;
|
||||
|
||||
//! This function returns the intersection point
|
||||
//! of range N;
|
||||
//! The exception NotDone is raised if IsDone returns FALSE.
|
||||
//! The exception OutOfRange is raised if (N <= 0)
|
||||
//! or (N > NbPoints).
|
||||
const IntRes2d_IntersectionPoint& Point (const Standard_Integer N) const;
|
||||
|
||||
//! This function returns the number of intersection
|
||||
//! segments between the two curves.
|
||||
//! The exception NotDone is raised if IsDone returns FALSE.
|
||||
Standard_Integer NbSegments() const;
|
||||
|
||||
//! This function returns the intersection segment
|
||||
//! of range N;
|
||||
//! The exception NotDone is raised if IsDone returns FALSE.
|
||||
//! The exception OutOfRange is raised if (N <= 0)
|
||||
//! or (N > NbPoints).
|
||||
const IntRes2d_IntersectionSegment& Segment (const Standard_Integer N) const;
|
||||
|
||||
void SetReversedParameters (const Standard_Boolean Reverseflag);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
IntRes2d_Intersection();
|
||||
|
||||
IntRes2d_Intersection(const IntRes2d_Intersection& Other);
|
||||
|
||||
Standard_EXPORT void SetValues (const IntRes2d_Intersection& Inter);
|
||||
|
||||
Standard_EXPORT void Append (const IntRes2d_Intersection& Inter, const Standard_Real FirstParam1, const Standard_Real LastParam1, const Standard_Real FirstParam2, const Standard_Real LastParam2);
|
||||
|
||||
void Append (const IntRes2d_IntersectionSegment& Seg);
|
||||
|
||||
void Append (const IntRes2d_IntersectionPoint& Pnt);
|
||||
|
||||
Standard_EXPORT void Insert (const IntRes2d_IntersectionPoint& Pnt);
|
||||
|
||||
void ResetFields();
|
||||
|
||||
Standard_Boolean ReversedParameters() const;
|
||||
|
||||
|
||||
Standard_Boolean done;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean reverse;
|
||||
IntRes2d_SequenceOfIntersectionPoint lpnt;
|
||||
IntRes2d_SequenceOfIntersectionSegment lseg;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <IntRes2d_Intersection.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IntRes2d_Intersection_HeaderFile
|
@@ -1,127 +0,0 @@
|
||||
-- Created on: 1992-04-03
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class IntersectionPoint from IntRes2d
|
||||
|
||||
---Purpose: Definition of an intersection point between two
|
||||
-- 2D curves.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Transition from IntRes2d
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
returns IntersectionPoint from IntRes2d;
|
||||
|
||||
|
||||
Create(P: Pnt2d from gp; Uc1,Uc2:Real from Standard;
|
||||
Trans1,Trans2: Transition from IntRes2d;
|
||||
ReversedFlag: Boolean from Standard)
|
||||
|
||||
---Purpose: Creates an IntersectionPoint.
|
||||
-- if ReversedFlag is False, the parameter Uc1(resp. Uc2)
|
||||
-- and the Transition Trans1 (resp. Trans2) refer to
|
||||
-- the first curve (resp. second curve) otherwise Uc1
|
||||
-- and Trans1 (resp. Uc2 and Trans2) refer to the
|
||||
-- second curve (resp. the first curve).
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns IntersectionPoint from IntRes2d;
|
||||
|
||||
|
||||
SetValues(me:in out; P: Pnt2d from gp; Uc1,Uc2:Real from Standard;
|
||||
Trans1,Trans2: Transition from IntRes2d;
|
||||
ReversedFlag: Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the values for an existing intersection
|
||||
-- point. The meaning of the parameters are the same
|
||||
-- as for the Create.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
Value(me)
|
||||
|
||||
---Purpose: Returns the value of the coordinates of the
|
||||
-- intersection point in the 2D space.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns Pnt2d from gp
|
||||
is static;
|
||||
|
||||
|
||||
ParamOnFirst(me)
|
||||
|
||||
---Purpose: Returns the parameter on the first curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
is static;
|
||||
|
||||
|
||||
ParamOnSecond(me)
|
||||
|
||||
---Purpose: Returns the parameter on the second curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Real from Standard
|
||||
is static;
|
||||
|
||||
|
||||
TransitionOfFirst(me)
|
||||
|
||||
---Purpose: Returns the transition of the 1st curve compared to
|
||||
-- the 2nd one.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
returns Transition from IntRes2d
|
||||
is static;
|
||||
|
||||
|
||||
TransitionOfSecond(me)
|
||||
|
||||
---Purpose: returns the transition of the 2nd curve compared to
|
||||
-- the 1st one.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
returns Transition from IntRes2d
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
pt : Pnt2d from gp;
|
||||
p1 : Real from Standard;
|
||||
p2 : Real from Standard;
|
||||
trans1 : Transition from IntRes2d;
|
||||
trans2 : Transition from IntRes2d;
|
||||
|
||||
end IntersectionPoint;
|
||||
|
||||
|
@@ -14,7 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IntRes2d_IntersectionPoint.ixx>
|
||||
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <IntRes2d_Transition.hxx>
|
||||
|
||||
IntRes2d_IntersectionPoint::IntRes2d_IntersectionPoint ():
|
||||
pt(),p1(RealLast()),p2(RealLast()),trans1(),trans2()
|
||||
|
104
src/IntRes2d/IntRes2d_IntersectionPoint.hxx
Normal file
104
src/IntRes2d/IntRes2d_IntersectionPoint.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 1992-04-03
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_IntersectionPoint_HeaderFile
|
||||
#define _IntRes2d_IntersectionPoint_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <IntRes2d_Transition.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class gp_Pnt2d;
|
||||
class IntRes2d_Transition;
|
||||
|
||||
|
||||
//! Definition of an intersection point between two
|
||||
//! 2D curves.
|
||||
class IntRes2d_IntersectionPoint
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT IntRes2d_IntersectionPoint();
|
||||
|
||||
//! Creates an IntersectionPoint.
|
||||
//! if ReversedFlag is False, the parameter Uc1(resp. Uc2)
|
||||
//! and the Transition Trans1 (resp. Trans2) refer to
|
||||
//! the first curve (resp. second curve) otherwise Uc1
|
||||
//! and Trans1 (resp. Uc2 and Trans2) refer to the
|
||||
//! second curve (resp. the first curve).
|
||||
IntRes2d_IntersectionPoint(const gp_Pnt2d& P, const Standard_Real Uc1, const Standard_Real Uc2, const IntRes2d_Transition& Trans1, const IntRes2d_Transition& Trans2, const Standard_Boolean ReversedFlag);
|
||||
|
||||
//! Sets the values for an existing intersection
|
||||
//! point. The meaning of the parameters are the same
|
||||
//! as for the Create.
|
||||
void SetValues (const gp_Pnt2d& P, const Standard_Real Uc1, const Standard_Real Uc2, const IntRes2d_Transition& Trans1, const IntRes2d_Transition& Trans2, const Standard_Boolean ReversedFlag);
|
||||
|
||||
//! Returns the value of the coordinates of the
|
||||
//! intersection point in the 2D space.
|
||||
const gp_Pnt2d& Value() const;
|
||||
|
||||
//! Returns the parameter on the first curve.
|
||||
Standard_Real ParamOnFirst() const;
|
||||
|
||||
//! Returns the parameter on the second curve.
|
||||
Standard_Real ParamOnSecond() const;
|
||||
|
||||
//! Returns the transition of the 1st curve compared to
|
||||
//! the 2nd one.
|
||||
const IntRes2d_Transition& TransitionOfFirst() const;
|
||||
|
||||
//! returns the transition of the 2nd curve compared to
|
||||
//! the 1st one.
|
||||
const IntRes2d_Transition& TransitionOfSecond() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
gp_Pnt2d pt;
|
||||
Standard_Real p1;
|
||||
Standard_Real p2;
|
||||
IntRes2d_Transition trans1;
|
||||
IntRes2d_Transition trans2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <IntRes2d_IntersectionPoint.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IntRes2d_IntersectionPoint_HeaderFile
|
@@ -1,158 +0,0 @@
|
||||
-- Created on: 1992-04-03
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class IntersectionSegment from IntRes2d
|
||||
|
||||
---Purpose: Definition of an intersection curve between
|
||||
-- two 2D curves.
|
||||
|
||||
uses IntersectionPoint from IntRes2d
|
||||
|
||||
raises DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
returns IntersectionSegment from IntRes2d;
|
||||
|
||||
|
||||
Create(P1,P2 : IntersectionPoint from IntRes2d;
|
||||
Oppos : Boolean from Standard;
|
||||
ReverseFlag : Boolean from Standard)
|
||||
|
||||
--Purpose: Creates an IntersectionSegment from two
|
||||
-- IntersectionPoint. Oppos is FALSE if the 2 curves
|
||||
-- have the same orientation. if ReverseFlag is True,
|
||||
-- P1 and P2 are the point on the first curve, and on
|
||||
-- the second curve. else, P1 is the point on the
|
||||
-- second curve and P2 the intersection point on the
|
||||
-- first curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns IntersectionSegment from IntRes2d;
|
||||
|
||||
|
||||
Create(P : IntersectionPoint from IntRes2d;
|
||||
First : Boolean from Standard;
|
||||
Oppos : Boolean from Standard;
|
||||
ReverseFlag: Boolean from Standard)
|
||||
|
||||
--Purpose: Creates a semi-infinite segment of intersection.
|
||||
-- if First is set to True, P is the first point of
|
||||
-- the segment. Otherwise P is the last point of the
|
||||
-- segment. P belongs to the first curve if
|
||||
-- ReversedFlag is set to False; otherwise it belongs
|
||||
-- to the second curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns IntersectionSegment from IntRes2d;
|
||||
|
||||
|
||||
Create(Oppos: Boolean from Standard)
|
||||
|
||||
---Purpose: Creates an infinite segment of intersection.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns IntersectionSegment from IntRes2d;
|
||||
|
||||
|
||||
IsOpposite(me)
|
||||
|
||||
---Purpose: Returns FALSE if the intersection segment has got
|
||||
-- the same orientation on both curves.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
HasFirstPoint(me)
|
||||
|
||||
---Purpose: Returns True if the segment is limited by a first
|
||||
-- point. This point defines the lowest parameter
|
||||
-- admitted on the first curve for the segment. If
|
||||
-- IsOpposite returns False, it defines the lowest
|
||||
-- parameter on the second curve, otherwise, it is
|
||||
-- the highest parameter on the second curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
FirstPoint(me)
|
||||
|
||||
---Purpose: Returns the first point of the segment as an
|
||||
-- IntersectionPoint (with a transition). The
|
||||
-- exception DomainError is raised if HasFirstPoint
|
||||
-- returns False.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns IntersectionPoint from IntRes2d
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
HasLastPoint(me)
|
||||
|
||||
---Purpose: Returns True if the segment is limited by a last
|
||||
-- point. This point defines the highest parameter
|
||||
-- admitted on the first curve for the segment. If
|
||||
-- IsOpposite returns False, it defines the highest
|
||||
-- parameter on the second curve, otherwise, it is
|
||||
-- the lowest parameter on the second curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
|
||||
LastPoint(me)
|
||||
|
||||
---Purpose: Returns the last point of the segment as an
|
||||
-- IntersectionPoint (with a transition). The
|
||||
-- exception DomainError is raised if
|
||||
-- HasLastExtremity returns False.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns IntersectionPoint from IntRes2d
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
oppos : Boolean from Standard;
|
||||
first : Boolean from Standard;
|
||||
last : Boolean from Standard;
|
||||
ptfirst : IntersectionPoint from IntRes2d;
|
||||
ptlast : IntersectionPoint from IntRes2d;
|
||||
|
||||
end IntersectionSegment;
|
||||
|
@@ -14,7 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IntRes2d_IntersectionSegment.ixx>
|
||||
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <IntRes2d_IntersectionSegment.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
IntRes2d_IntersectionSegment::IntRes2d_IntersectionSegment ():
|
||||
|
||||
|
110
src/IntRes2d/IntRes2d_IntersectionSegment.hxx
Normal file
110
src/IntRes2d/IntRes2d_IntersectionSegment.hxx
Normal file
@@ -0,0 +1,110 @@
|
||||
// Created on: 1992-04-03
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_IntersectionSegment_HeaderFile
|
||||
#define _IntRes2d_IntersectionSegment_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
class Standard_DomainError;
|
||||
class IntRes2d_IntersectionPoint;
|
||||
|
||||
|
||||
//! Definition of an intersection curve between
|
||||
//! two 2D curves.
|
||||
class IntRes2d_IntersectionSegment
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT IntRes2d_IntersectionSegment();
|
||||
|
||||
IntRes2d_IntersectionSegment(const IntRes2d_IntersectionPoint& P1, const IntRes2d_IntersectionPoint& P2, const Standard_Boolean Oppos, const Standard_Boolean ReverseFlag);
|
||||
|
||||
IntRes2d_IntersectionSegment(const IntRes2d_IntersectionPoint& P, const Standard_Boolean First, const Standard_Boolean Oppos, const Standard_Boolean ReverseFlag);
|
||||
|
||||
//! Creates an infinite segment of intersection.
|
||||
IntRes2d_IntersectionSegment(const Standard_Boolean Oppos);
|
||||
|
||||
//! Returns FALSE if the intersection segment has got
|
||||
//! the same orientation on both curves.
|
||||
Standard_Boolean IsOpposite() const;
|
||||
|
||||
//! Returns True if the segment is limited by a first
|
||||
//! point. This point defines the lowest parameter
|
||||
//! admitted on the first curve for the segment. If
|
||||
//! IsOpposite returns False, it defines the lowest
|
||||
//! parameter on the second curve, otherwise, it is
|
||||
//! the highest parameter on the second curve.
|
||||
Standard_Boolean HasFirstPoint() const;
|
||||
|
||||
//! Returns the first point of the segment as an
|
||||
//! IntersectionPoint (with a transition). The
|
||||
//! exception DomainError is raised if HasFirstPoint
|
||||
//! returns False.
|
||||
const IntRes2d_IntersectionPoint& FirstPoint() const;
|
||||
|
||||
//! Returns True if the segment is limited by a last
|
||||
//! point. This point defines the highest parameter
|
||||
//! admitted on the first curve for the segment. If
|
||||
//! IsOpposite returns False, it defines the highest
|
||||
//! parameter on the second curve, otherwise, it is
|
||||
//! the lowest parameter on the second curve.
|
||||
Standard_Boolean HasLastPoint() const;
|
||||
|
||||
//! Returns the last point of the segment as an
|
||||
//! IntersectionPoint (with a transition). The
|
||||
//! exception DomainError is raised if
|
||||
//! HasLastExtremity returns False.
|
||||
const IntRes2d_IntersectionPoint& LastPoint() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean oppos;
|
||||
Standard_Boolean first;
|
||||
Standard_Boolean last;
|
||||
IntRes2d_IntersectionPoint ptfirst;
|
||||
IntRes2d_IntersectionPoint ptlast;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <IntRes2d_IntersectionSegment.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IntRes2d_IntersectionSegment_HeaderFile
|
28
src/IntRes2d/IntRes2d_Position.hxx
Normal file
28
src/IntRes2d/IntRes2d_Position.hxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Created on: 1992-04-03
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_Position_HeaderFile
|
||||
#define _IntRes2d_Position_HeaderFile
|
||||
|
||||
|
||||
enum IntRes2d_Position
|
||||
{
|
||||
IntRes2d_Head,
|
||||
IntRes2d_Middle,
|
||||
IntRes2d_End
|
||||
};
|
||||
|
||||
#endif // _IntRes2d_Position_HeaderFile
|
28
src/IntRes2d/IntRes2d_Situation.hxx
Normal file
28
src/IntRes2d/IntRes2d_Situation.hxx
Normal file
@@ -0,0 +1,28 @@
|
||||
// Created on: 1992-04-03
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_Situation_HeaderFile
|
||||
#define _IntRes2d_Situation_HeaderFile
|
||||
|
||||
|
||||
enum IntRes2d_Situation
|
||||
{
|
||||
IntRes2d_Inside,
|
||||
IntRes2d_Outside,
|
||||
IntRes2d_Unknown
|
||||
};
|
||||
|
||||
#endif // _IntRes2d_Situation_HeaderFile
|
@@ -1,199 +0,0 @@
|
||||
-- Created on: 1992-04-03
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1992-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Transition from IntRes2d
|
||||
|
||||
---Purpose: Definition of the type of transition near an
|
||||
-- intersection point between two curves. The transition
|
||||
-- is either a "true transition", which means that one of
|
||||
-- the curves goes inside or outside the area defined by
|
||||
-- the other curve near the intersection, or a "touch
|
||||
-- transition" which means that the first curve does not
|
||||
-- cross the other one, or an "undecided" transition,
|
||||
-- which means that the curves are superposed.
|
||||
|
||||
|
||||
uses Position from IntRes2d,
|
||||
Situation from IntRes2d,
|
||||
TypeTrans from IntRes2d
|
||||
|
||||
|
||||
raises DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
---Purpose: Empty constructor.
|
||||
|
||||
returns Transition from IntRes2d;
|
||||
|
||||
|
||||
Create(Tangent: Boolean from Standard;
|
||||
Pos : Position from IntRes2d;
|
||||
Type : TypeTrans from IntRes2d)
|
||||
|
||||
---Purpose: Creates an IN or OUT transition.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Transition from IntRes2d;
|
||||
|
||||
|
||||
Create(Tangent: Boolean from Standard;
|
||||
Pos : Position from IntRes2d;
|
||||
Situ : Situation from IntRes2d;
|
||||
Oppos : Boolean from Standard)
|
||||
|
||||
---Purpose: Creates a TOUCH transition.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Transition from IntRes2d;
|
||||
|
||||
|
||||
Create(Pos: Position from IntRes2d)
|
||||
|
||||
---Purpose: Creates an UNDECIDED transition.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Transition from IntRes2d;
|
||||
|
||||
|
||||
SetValue(me: in out; Tangent: Boolean from Standard;
|
||||
Pos : Position from IntRes2d;
|
||||
Type : TypeTrans from IntRes2d)
|
||||
|
||||
---Purpose: Sets the values of an IN or OUT transition.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetValue(me: in out; Tangent: Boolean from Standard;
|
||||
Pos : Position from IntRes2d;
|
||||
Situ : Situation from IntRes2d;
|
||||
Oppos : Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the values of a TOUCH transition.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetValue(me: in out; Pos: Position from IntRes2d)
|
||||
|
||||
---Purpose: Sets the values of an UNDECIDED transition.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
SetPosition(me: in out; Pos: Position from IntRes2d)
|
||||
|
||||
---Purpose: Sets the value of the position.
|
||||
|
||||
---C++: inline
|
||||
|
||||
is static;
|
||||
|
||||
|
||||
PositionOnCurve(me)
|
||||
|
||||
---Purpose: Indicates if the intersection is at the beginning
|
||||
-- (IntRes2d_Head), at the end (IntRes2d_End), or in
|
||||
-- the middle (IntRes2d_Middle) of the curve.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Position from IntRes2d
|
||||
is static;
|
||||
|
||||
|
||||
TransitionType(me)
|
||||
|
||||
---Purpose: Returns the type of transition at the intersection.
|
||||
-- It may be IN or OUT or TOUCH, or UNDECIDED if the
|
||||
-- two first derivatives are not enough to give
|
||||
-- the tangent to one of the two curves.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns TypeTrans from IntRes2d
|
||||
is static;
|
||||
|
||||
|
||||
IsTangent(me)
|
||||
|
||||
---Purpose: Returns TRUE when the 2 curves are tangent at the
|
||||
-- intersection point.
|
||||
-- Theexception DomainError is raised if the type of
|
||||
-- transition is UNDECIDED.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
Situation(me)
|
||||
|
||||
---Purpose: returns a significant value if TransitionType returns
|
||||
-- TOUCH. In this case, the function returns :
|
||||
-- INSIDE when the curve remains inside the other one,
|
||||
-- OUTSIDE when it remains outside the other one,
|
||||
-- UNKNOWN when the calculus, based on the second derivatives
|
||||
-- cannot give the result.
|
||||
-- If TransitionType returns IN or OUT or UNDECIDED, the
|
||||
-- exception DomainError is raised.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Situation from IntRes2d
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
IsOpposite(me)
|
||||
|
||||
---Purpose: returns a significant value if TransitionType
|
||||
-- returns TOUCH. In this case, the function returns
|
||||
-- true when the 2 curves locally define two
|
||||
-- different parts of the space. If TransitionType
|
||||
-- returns IN or OUT or UNDECIDED, the exception
|
||||
-- DomainError is raised.
|
||||
|
||||
---C++: inline
|
||||
|
||||
returns Boolean from Standard
|
||||
raises DomainError from Standard
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
tangent : Boolean from Standard;
|
||||
posit : Position from IntRes2d;
|
||||
typetra : TypeTrans from IntRes2d;
|
||||
situat : Situation from IntRes2d;
|
||||
oppos : Boolean from Standard;
|
||||
|
||||
end Transition;
|
@@ -14,8 +14,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IntRes2d_Transition.ixx>
|
||||
|
||||
#include <IntRes2d_Transition.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
IntRes2d_Transition::IntRes2d_Transition() : tangent(Standard_True),
|
||||
posit(IntRes2d_Middle),
|
||||
|
134
src/IntRes2d/IntRes2d_Transition.hxx
Normal file
134
src/IntRes2d/IntRes2d_Transition.hxx
Normal file
@@ -0,0 +1,134 @@
|
||||
// Created on: 1992-04-03
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_Transition_HeaderFile
|
||||
#define _IntRes2d_Transition_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <IntRes2d_Position.hxx>
|
||||
#include <IntRes2d_TypeTrans.hxx>
|
||||
#include <IntRes2d_Situation.hxx>
|
||||
class Standard_DomainError;
|
||||
|
||||
|
||||
//! Definition of the type of transition near an
|
||||
//! intersection point between two curves. The transition
|
||||
//! is either a "true transition", which means that one of
|
||||
//! the curves goes inside or outside the area defined by
|
||||
//! the other curve near the intersection, or a "touch
|
||||
//! transition" which means that the first curve does not
|
||||
//! cross the other one, or an "undecided" transition,
|
||||
//! which means that the curves are superposed.
|
||||
class IntRes2d_Transition
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT IntRes2d_Transition();
|
||||
|
||||
//! Creates an IN or OUT transition.
|
||||
IntRes2d_Transition(const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_TypeTrans Type);
|
||||
|
||||
//! Creates a TOUCH transition.
|
||||
IntRes2d_Transition(const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_Situation Situ, const Standard_Boolean Oppos);
|
||||
|
||||
//! Creates an UNDECIDED transition.
|
||||
IntRes2d_Transition(const IntRes2d_Position Pos);
|
||||
|
||||
//! Sets the values of an IN or OUT transition.
|
||||
void SetValue (const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_TypeTrans Type);
|
||||
|
||||
//! Sets the values of a TOUCH transition.
|
||||
void SetValue (const Standard_Boolean Tangent, const IntRes2d_Position Pos, const IntRes2d_Situation Situ, const Standard_Boolean Oppos);
|
||||
|
||||
//! Sets the values of an UNDECIDED transition.
|
||||
void SetValue (const IntRes2d_Position Pos);
|
||||
|
||||
//! Sets the value of the position.
|
||||
void SetPosition (const IntRes2d_Position Pos);
|
||||
|
||||
//! Indicates if the intersection is at the beginning
|
||||
//! (IntRes2d_Head), at the end (IntRes2d_End), or in
|
||||
//! the middle (IntRes2d_Middle) of the curve.
|
||||
IntRes2d_Position PositionOnCurve() const;
|
||||
|
||||
//! Returns the type of transition at the intersection.
|
||||
//! It may be IN or OUT or TOUCH, or UNDECIDED if the
|
||||
//! two first derivatives are not enough to give
|
||||
//! the tangent to one of the two curves.
|
||||
IntRes2d_TypeTrans TransitionType() const;
|
||||
|
||||
//! Returns TRUE when the 2 curves are tangent at the
|
||||
//! intersection point.
|
||||
//! Theexception DomainError is raised if the type of
|
||||
//! transition is UNDECIDED.
|
||||
Standard_Boolean IsTangent() const;
|
||||
|
||||
//! returns a significant value if TransitionType returns
|
||||
//! TOUCH. In this case, the function returns :
|
||||
//! INSIDE when the curve remains inside the other one,
|
||||
//! OUTSIDE when it remains outside the other one,
|
||||
//! UNKNOWN when the calculus, based on the second derivatives
|
||||
//! cannot give the result.
|
||||
//! If TransitionType returns IN or OUT or UNDECIDED, the
|
||||
//! exception DomainError is raised.
|
||||
IntRes2d_Situation Situation() const;
|
||||
|
||||
//! returns a significant value if TransitionType
|
||||
//! returns TOUCH. In this case, the function returns
|
||||
//! true when the 2 curves locally define two
|
||||
//! different parts of the space. If TransitionType
|
||||
//! returns IN or OUT or UNDECIDED, the exception
|
||||
//! DomainError is raised.
|
||||
Standard_Boolean IsOpposite() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean tangent;
|
||||
IntRes2d_Position posit;
|
||||
IntRes2d_TypeTrans typetra;
|
||||
IntRes2d_Situation situat;
|
||||
Standard_Boolean oppos;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <IntRes2d_Transition.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IntRes2d_Transition_HeaderFile
|
29
src/IntRes2d/IntRes2d_TypeTrans.hxx
Normal file
29
src/IntRes2d/IntRes2d_TypeTrans.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1992-04-03
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1992-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _IntRes2d_TypeTrans_HeaderFile
|
||||
#define _IntRes2d_TypeTrans_HeaderFile
|
||||
|
||||
|
||||
enum IntRes2d_TypeTrans
|
||||
{
|
||||
IntRes2d_In,
|
||||
IntRes2d_Out,
|
||||
IntRes2d_Touch,
|
||||
IntRes2d_Undecided
|
||||
};
|
||||
|
||||
#endif // _IntRes2d_TypeTrans_HeaderFile
|
Reference in New Issue
Block a user