1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-26 11:05:31 +03:00
occt/src/Geom2dHatch/Geom2dHatch_Hatcher.lxx
dln 0b85f9a605 0024761: Convertation of the generic classes to the non-generic. Part 5
1) Generic class "GccEnt_QualifiedCurv" from "GccEnt" package converted to the non-generic class and moved to the "Geom2dGcc" package. Name of this class was changed to "Geom2dGcc_QCurve".

2) Generic classes "HatchGen_ElementGen", "HatchGen_ElementsGen", "HatchGen_HatchingGen" and "HatchGen_Hatcher" from "HatchGen" package converted to the non-generic classes and moved to the "Geom2dHatch" package. Names of this classes were changed to "Geom2dHatch_Element", "Geom2dHatch_Elements", "Geom2dHatch_Hatching" and "Geom2dHatch_Hatcher". Also all instantiations of the "internal" classes of this classes were moved to the "Geom2dHatch.cdl".

3) Generic classes "Extrema_GExtCC", "Extrema_GExtCC2d", "Extrema_GLocateExtCC" and "Extrema_GLocateExtCC2d" from "Extrema" package converted to the non-generic classes. Names of this classes were changed to "Extrema_ExtCC", "Extrema_ExtCC2d", "Extrema_LocateExtCC" and "Extrema_LocateExtCC2d". Also all instantiations of the "internal" classes of this classes were moved to the "Extrema.cdl".
2014-04-04 12:57:39 +04:00

263 lines
9.4 KiB
Plaintext

// Created on: 1995-01-03
// Created by: Laurent BUCHARD
// Copyright (c) 1995-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.
#define RAISE_IF_NOSUCHOBJECT 0
#define TRACE 0
#include <StdFail_NotDone.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dHatch_Intersector.hxx>
#include <Geom2dHatch_Hatching.hxx>
#include <Geom2dHatch_Element.hxx>
//=======================================================================
// Function : Intersector
// Purpose : Returns the associated intersector.
//=======================================================================
inline const Geom2dHatch_Intersector& Geom2dHatch_Hatcher::Intersector ()
{
return myIntersector ;
}
//=======================================================================
// Function : ChangeIntersector
// Purpose : Returns the associated intersector.
//=======================================================================
inline Geom2dHatch_Intersector& Geom2dHatch_Hatcher::ChangeIntersector ()
{
return myIntersector ;
}
//=======================================================================
// Function : Confusion2d
// Purpose : Returns the 2d confusion tolerance.
//=======================================================================
inline Standard_Real Geom2dHatch_Hatcher::Confusion2d () const
{
return myConfusion2d ;
}
//=======================================================================
// Function : Confusion3d
// Purpose : Returns the 3d confusion tolerance.
//=======================================================================
inline Standard_Real Geom2dHatch_Hatcher::Confusion3d () const
{
return myConfusion3d ;
}
//=======================================================================
// Function : KeepPoints
// Purpose : Returns the flag about the points consideration.
//=======================================================================
inline Standard_Boolean Geom2dHatch_Hatcher::KeepPoints () const
{
return myKeepPoints ;
}
//=======================================================================
// Function : KeepSegments
// Purpose : Returns the flag about the segments consideration.
//=======================================================================
inline Standard_Boolean Geom2dHatch_Hatcher::KeepSegments () const
{
return myKeepSegments ;
}
//=======================================================================
// Function : Clear
// Purpose : Removes all the hatchings and all the elements.
//=======================================================================
inline void Geom2dHatch_Hatcher::Clear ()
{
if (myNbHatchings != 0) ClrHatchings () ;
if (myNbElements != 0) ClrElements () ;
}
//=======================================================================
// Function : Element
// Purpose : Returns the IndE-th element.
//=======================================================================
inline Geom2dHatch_Element& Geom2dHatch_Hatcher::Element (const Standard_Integer IndE)
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
#endif
Geom2dHatch_Element& Element = myElements.ChangeFind (IndE) ;
return Element ;
}
//=======================================================================
// Function : ElementCurve
// Purpose : Returns the curve associated to the IndE-th element.
//=======================================================================
inline const Geom2dAdaptor_Curve& Geom2dHatch_Hatcher::ElementCurve (const Standard_Integer IndE) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
#endif
const Geom2dHatch_Element& Element = myElements.Find (IndE) ;
return Element.Curve() ;
}
//=======================================================================
// Function : Hatching
// Purpose : Returns the IndH-th hatching.
//=======================================================================
inline Geom2dHatch_Hatching& Geom2dHatch_Hatcher::Hatching (const Standard_Integer IndH)
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
Geom2dHatch_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
return Hatching ;
}
//=======================================================================
// Function : HatchingCurve
// Purpose : Returns the curve associated to the IndH-th hatching.
//=======================================================================
inline const Geom2dAdaptor_Curve& Geom2dHatch_Hatcher::HatchingCurve (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.Curve() ;
}
//=======================================================================
// Function : NbPoints
// Purpose : Returns the number of intersection points of the IndH-th
// hatching.
//=======================================================================
inline Standard_Integer Geom2dHatch_Hatcher::NbPoints (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.NbPoints() ;
}
//=======================================================================
// Function : Point
// Purpose : Returns the IndP-th intersection point of the IndH-th
// hatching.
//=======================================================================
inline const HatchGen_PointOnHatching& Geom2dHatch_Hatcher::Point (const Standard_Integer IndH,
const Standard_Integer IndP) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
#if RAISE_IF_NOSUCHOBJECT
Standard_OutOfRange_Raise_if (IndP < 0 || IndP > Hatching.NbPoints(), "") ;
#endif
const HatchGen_PointOnHatching& PntH = Hatching.Point (IndP) ;
return PntH ;
}
//=======================================================================
// Function : TrimDone
// Purpose : Returns the fact that all the intersections were computed
// for the IndH-th hatching.
//=======================================================================
inline Standard_Boolean Geom2dHatch_Hatcher::TrimDone (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.TrimDone() ;
}
//=======================================================================
// Function : TrimFailed
// Purpose : Returns the fact that all the intersections failed
// for the IndH-th hatching.
//=======================================================================
inline Standard_Boolean Geom2dHatch_Hatcher::TrimFailed (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.TrimFailed() ;
}
//=======================================================================
// Function : IsDone
// Purpose : Returns the fact that all the domains were computed
// for the IndH-th hatching.
//=======================================================================
inline Standard_Boolean Geom2dHatch_Hatcher::IsDone (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.IsDone() ;
}
//=======================================================================
// Function : Status
// Purpose : Returns the status about the IndH-th hatching.
//=======================================================================
inline HatchGen_ErrorStatus Geom2dHatch_Hatcher::Status (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
return Hatching.Status() ;
}
//=======================================================================
// Function : NbDomains
// Purpose : Returns the number of domains of the IndH-th hatching.
//=======================================================================
inline Standard_Integer Geom2dHatch_Hatcher::NbDomains (const Standard_Integer IndH) const
{
#if RAISE_IF_NOSUCHOBJECT
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
#endif
const Geom2dHatch_Hatching& Hatching = myHatchings.Find (IndH) ;
StdFail_NotDone_Raise_if (!Hatching.IsDone(), "Geom2dHatch_Hatcher::NbDomains") ;
return Hatching.NbDomains() ;
}