mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
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".
This commit is contained in:
@@ -17,18 +17,38 @@
|
||||
package Geom2dHatch
|
||||
|
||||
uses
|
||||
Geom2dAdaptor ,
|
||||
Geom2dInt ,
|
||||
gp ,
|
||||
HatchGen
|
||||
Geom2dAdaptor,
|
||||
Geom2dInt,
|
||||
gp,
|
||||
HatchGen,
|
||||
TCollection,
|
||||
TColStd,
|
||||
TopClass,
|
||||
TopAbs
|
||||
|
||||
is
|
||||
|
||||
class Intersector ;
|
||||
|
||||
class Hatcher instantiates Hatcher from HatchGen
|
||||
(Curve from Geom2dAdaptor,
|
||||
Curve from Geom2dAdaptor,
|
||||
Intersector from Geom2dHatch) ;
|
||||
class Hatcher;
|
||||
|
||||
class Element;
|
||||
class Elements;
|
||||
class Hatching;
|
||||
|
||||
class Hatchings instantiates DataMap from TCollection
|
||||
(Integer from Standard,
|
||||
Hatching from Geom2dHatch,
|
||||
MapIntegerHasher from TColStd) ;
|
||||
|
||||
class Classifier instantiates FaceClassifier from TopClass
|
||||
(Elements from Geom2dHatch,
|
||||
Curve from Geom2dAdaptor,
|
||||
Intersector from Geom2dHatch);
|
||||
|
||||
private class MapOfElements instantiates DataMap from TCollection
|
||||
(Integer from Standard,
|
||||
Element from Geom2dHatch,
|
||||
MapIntegerHasher from TColStd);
|
||||
|
||||
end Geom2dHatch ;
|
||||
|
85
src/Geom2dHatch/Geom2dHatch_Element.cdl
Normal file
85
src/Geom2dHatch/Geom2dHatch_Element.cdl
Normal file
@@ -0,0 +1,85 @@
|
||||
-- Created on: 1993-11-10
|
||||
-- Created by: Jean Marc LACHAUME
|
||||
-- Copyright (c) 1993-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 Element from Geom2dHatch
|
||||
|
||||
uses
|
||||
Orientation from TopAbs,
|
||||
Curve from Geom2dAdaptor
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create
|
||||
|
||||
returns Element from Geom2dHatch;
|
||||
|
||||
Create (Other : Element from Geom2dHatch)
|
||||
|
||||
---Purpose: Magic constructor.
|
||||
|
||||
returns Element from Geom2dHatch ;
|
||||
|
||||
|
||||
Create (Curve : Curve from Geom2dAdaptor ;
|
||||
Orientation : Orientation from TopAbs = TopAbs_FORWARD)
|
||||
|
||||
---Purpose: Creates an element.
|
||||
|
||||
returns Element from Geom2dHatch ;
|
||||
|
||||
|
||||
Curve (me)
|
||||
|
||||
---Purpose: Returns the curve associated to the element.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns Curve from Geom2dAdaptor
|
||||
is static ;
|
||||
|
||||
|
||||
ChangeCurve (me : in out)
|
||||
|
||||
---Purpose: Returns the curve associated to the element.
|
||||
|
||||
---C++: return &
|
||||
|
||||
returns Curve from Geom2dAdaptor
|
||||
is static ;
|
||||
|
||||
|
||||
Orientation (me : in out ; Orientation : Orientation from TopAbs)
|
||||
|
||||
---Purpose: Sets the orientation of the element.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
Orientation (me)
|
||||
|
||||
---Purpose: Returns the orientation of the element.
|
||||
|
||||
returns Orientation from TopAbs
|
||||
is static ;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myCurve : Curve from Geom2dAdaptor ;
|
||||
myOrientation : Orientation from TopAbs ;
|
||||
|
||||
end Element from Geom2dHatch;
|
91
src/Geom2dHatch/Geom2dHatch_Element.cxx
Normal file
91
src/Geom2dHatch/Geom2dHatch_Element.cxx
Normal file
@@ -0,0 +1,91 @@
|
||||
// Created on: 1993-11-03
|
||||
// Created by: Jean Marc LACHAUME
|
||||
// Copyright (c) 1993-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.
|
||||
|
||||
//=======================================================================
|
||||
// Function : Geom2dHatch_Element
|
||||
// Purpose : Magic Constructor.
|
||||
//=======================================================================
|
||||
|
||||
#include <Geom2dHatch_Element.ixx>
|
||||
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
|
||||
Geom2dHatch_Element::Geom2dHatch_Element (const Geom2dHatch_Element& Other)
|
||||
: myCurve(Other.myCurve), myOrientation(Other.myOrientation) {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Geom2dHatch_Element
|
||||
// Purpose : Empty Constructor.
|
||||
//=======================================================================
|
||||
|
||||
Geom2dHatch_Element::Geom2dHatch_Element () {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Geom2dHatch_Element
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
Geom2dHatch_Element::Geom2dHatch_Element (const Geom2dAdaptor_Curve& Curve,
|
||||
const TopAbs_Orientation Orientation) :
|
||||
myCurve (Curve),
|
||||
myOrientation (Orientation)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Curve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const Geom2dAdaptor_Curve& Geom2dHatch_Element::Curve () const
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ChangeCurve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
Geom2dAdaptor_Curve& Geom2dHatch_Element::ChangeCurve ()
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Orientation
|
||||
// Purpose : Sets the orientation of the element.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Element::Orientation (const TopAbs_Orientation Orientation)
|
||||
{
|
||||
myOrientation = Orientation ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Orientation
|
||||
// Purpose : Returns the orientation of the element.
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation Geom2dHatch_Element::Orientation () const
|
||||
{
|
||||
return myOrientation ;
|
||||
}
|
||||
|
||||
|
||||
|
147
src/Geom2dHatch/Geom2dHatch_Elements.cdl
Normal file
147
src/Geom2dHatch/Geom2dHatch_Elements.cdl
Normal file
@@ -0,0 +1,147 @@
|
||||
-- Created on: 1994-12-16
|
||||
-- Created by: Laurent BUCHARD
|
||||
-- Copyright (c) 1994-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.
|
||||
|
||||
-- Modified by skv - Fri Jul 14 16:46:18 2006 OCC12627
|
||||
|
||||
|
||||
class Elements from Geom2dHatch
|
||||
|
||||
|
||||
uses
|
||||
Orientation from TopAbs,
|
||||
Lin2d from gp,
|
||||
Pnt2d from gp,
|
||||
Integer from Standard,
|
||||
Element from Geom2dHatch,
|
||||
MapIntegerHasher from TColStd,
|
||||
Curve from Geom2dAdaptor,
|
||||
MapOfElements from Geom2dHatch,
|
||||
DataMapIteratorOfMapOfElements from Geom2dHatch
|
||||
|
||||
raises
|
||||
DomainError from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns Elements from Geom2dHatch;
|
||||
|
||||
Create(Other : Elements from Geom2dHatch)
|
||||
returns Elements from Geom2dHatch;
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- E m u l a t i o n o f D a t a M a p
|
||||
--
|
||||
-- f r o m T C o l l e c t i o n
|
||||
----------------------------------------------------------------------
|
||||
Clear(me : in out)
|
||||
---C++: alias ~
|
||||
is static;
|
||||
|
||||
Bind(me : in out; K : Integer from Standard; I : Element from Geom2dHatch) returns Boolean
|
||||
is static;
|
||||
|
||||
IsBound(me; K : Integer from Standard) returns Boolean
|
||||
is static;
|
||||
|
||||
UnBind(me : in out; K : Integer from Standard) returns Boolean
|
||||
is static;
|
||||
|
||||
Find(me; K : Integer from Standard) returns any Element from Geom2dHatch
|
||||
raises NoSuchObject from Standard -- when <K> is not in the map.
|
||||
---C++: alias operator()
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
ChangeFind(me : in out; K : Integer from Standard) returns any Element from Geom2dHatch
|
||||
raises NoSuchObject from Standard -- when <K> is not in the map.
|
||||
---C++: alias operator()
|
||||
---C++: return &
|
||||
is static;
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- M e t h o d s u s e d b y t h e C l a s s i f i e r
|
||||
--
|
||||
-- see BRepClass_FaceExplorer for the Purposes
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Reject(me; P : Pnt2d from gp)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
-- Modified by skv - Fri Jul 14 16:46:18 2006 OCC12627 Begin
|
||||
Segment(me: in out; P : Pnt2d from gp;
|
||||
L : out Lin2d from gp;
|
||||
Par : out Real)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
OtherSegment(me: in out; P : Pnt2d from gp;
|
||||
L : out Lin2d from gp;
|
||||
Par : out Real)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
-- Modified by skv - Fri Jul 14 16:46:18 2006 OCC12627 End
|
||||
|
||||
InitWires(me : in out)
|
||||
is static;
|
||||
|
||||
MoreWires(me) returns
|
||||
Boolean from Standard
|
||||
is static;
|
||||
|
||||
NextWire(me : in out)
|
||||
is static;
|
||||
|
||||
RejectWire(me; L : Lin2d from gp;
|
||||
Par : Real from Standard)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
InitEdges(me : in out)
|
||||
is static;
|
||||
|
||||
MoreEdges(me)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
NextEdge(me : in out)
|
||||
is static;
|
||||
|
||||
RejectEdge(me; L : Lin2d from gp;
|
||||
Par : Real from Standard)
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
|
||||
CurrentEdge(me; E : out Curve from Geom2dAdaptor;
|
||||
Or : out Orientation from TopAbs)
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myMap : MapOfElements from Geom2dHatch;
|
||||
Iter : DataMapIteratorOfMapOfElements;
|
||||
NumWire : Integer from Standard;
|
||||
NumEdge : Integer from Standard;
|
||||
myCurEdge: Integer from Standard;
|
||||
|
||||
end Elements from Geom2dHatch;
|
241
src/Geom2dHatch/Geom2dHatch_Elements.cxx
Normal file
241
src/Geom2dHatch/Geom2dHatch_Elements.cxx
Normal file
@@ -0,0 +1,241 @@
|
||||
// Created on: 1994-12-16
|
||||
// Created by: Laurent BUCHARD
|
||||
// Copyright (c) 1994-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.
|
||||
|
||||
// Modified by skv - Fri Jul 14 17:03:47 2006 OCC12627
|
||||
|
||||
#include <Geom2dHatch_Elements.ixx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Geom2dHatch_Element.hxx>
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
Geom2dHatch_Elements::Geom2dHatch_Elements(const Geom2dHatch_Elements& )
|
||||
{
|
||||
cout<<" Magic Constructor in Geom2dHatch_Elements:: "<<endl;
|
||||
}
|
||||
|
||||
Geom2dHatch_Elements::Geom2dHatch_Elements()
|
||||
{
|
||||
NumWire = 0;
|
||||
NumEdge = 0;
|
||||
myCurEdge = 1;
|
||||
}
|
||||
|
||||
void Geom2dHatch_Elements::Clear()
|
||||
{
|
||||
myMap.Clear();
|
||||
}
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::IsBound(const Standard_Integer K) const
|
||||
{
|
||||
return(myMap.IsBound(K));
|
||||
}
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::UnBind(const Standard_Integer K)
|
||||
{
|
||||
return(myMap.UnBind(K));
|
||||
}
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::Bind(const Standard_Integer K,const Geom2dHatch_Element& I)
|
||||
{
|
||||
return(myMap.Bind(K,I));
|
||||
}
|
||||
|
||||
const Geom2dHatch_Element& Geom2dHatch_Elements::Find(const Standard_Integer K) const
|
||||
{
|
||||
return(myMap.Find(K));
|
||||
}
|
||||
|
||||
Geom2dHatch_Element& Geom2dHatch_Elements::ChangeFind(const Standard_Integer K)
|
||||
{
|
||||
return(myMap.ChangeFind(K));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::Reject(const gp_Pnt2d&) const {
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Segment
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::Segment(const gp_Pnt2d& P,
|
||||
gp_Lin2d& L,
|
||||
Standard_Real& Par)
|
||||
{
|
||||
myCurEdge = 1;
|
||||
|
||||
return OtherSegment(P, L, Par);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Segment
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::OtherSegment(const gp_Pnt2d& P,
|
||||
gp_Lin2d& L,
|
||||
Standard_Real& Par)
|
||||
{
|
||||
Geom2dHatch_DataMapIteratorOfMapOfElements Itertemp;
|
||||
Standard_Integer i;
|
||||
|
||||
for( Itertemp.Initialize(myMap), i = 1; Itertemp.More(); Itertemp.Next(), i++) {
|
||||
if (i < myCurEdge)
|
||||
continue;
|
||||
|
||||
void *ptrmyMap = (void *)(&myMap);
|
||||
Geom2dHatch_Element& Item=((Geom2dHatch_MapOfElements*)ptrmyMap)->ChangeFind(Itertemp.Key());
|
||||
Geom2dAdaptor_Curve& E = Item.ChangeCurve();
|
||||
TopAbs_Orientation Or= Item.Orientation();
|
||||
gp_Pnt2d P2 = E.Value
|
||||
((E.FirstParameter() + E.LastParameter()) *0.5);
|
||||
if ((Or == TopAbs_FORWARD) ||
|
||||
(Or == TopAbs_REVERSED)) {
|
||||
gp_Vec2d V(P,P2);
|
||||
Par = V.Magnitude();
|
||||
if (Par >= gp::Resolution()) {
|
||||
L = gp_Lin2d(P,V);
|
||||
myCurEdge++;
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == myCurEdge + 1) {
|
||||
Par = RealLast();
|
||||
L = gp_Lin2d(P,gp_Dir2d(1,0));
|
||||
myCurEdge++;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InitWires
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Elements::InitWires() {
|
||||
NumWire = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RejectWire NYI
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::RejectWire(const gp_Lin2d& ,
|
||||
const Standard_Real) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InitEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Elements::InitEdges() {
|
||||
NumEdge = 0;
|
||||
Iter.Initialize(myMap);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RejectEdge NYI
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::RejectEdge(const gp_Lin2d& ,
|
||||
const Standard_Real ) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : CurrentEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Elements::CurrentEdge(Geom2dAdaptor_Curve& E,
|
||||
TopAbs_Orientation& Or) const
|
||||
{
|
||||
void *ptrmyMap = (void *)(&myMap);
|
||||
Geom2dHatch_Element& Item=((Geom2dHatch_MapOfElements*)ptrmyMap)->ChangeFind(Iter.Key());
|
||||
|
||||
E = Item.ChangeCurve();
|
||||
Or= Item.Orientation();
|
||||
#if 0
|
||||
E.Edge() = TopoDS::Edge(myEExplorer.Current());
|
||||
E.Face() = myFace;
|
||||
Or = E.Edge().Orientation();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : MoreWires
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::MoreWires() const
|
||||
{
|
||||
return (NumWire == 0);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NextWire
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Elements::NextWire() {
|
||||
NumWire++;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MoreEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Elements::MoreEdges() const {
|
||||
return(Iter.More());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NextEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Elements::NextEdge() {
|
||||
Iter.Next();
|
||||
}
|
||||
|
||||
|
||||
|
491
src/Geom2dHatch/Geom2dHatch_Hatcher.cdl
Normal file
491
src/Geom2dHatch/Geom2dHatch_Hatcher.cdl
Normal file
@@ -0,0 +1,491 @@
|
||||
-- Created on: 1993-10-25
|
||||
-- Created by: Jean Marc LACHAUME
|
||||
-- Copyright (c) 1993-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 Hatcher from Geom2dHatch
|
||||
|
||||
uses
|
||||
MapIntegerHasher from TColStd,
|
||||
PointOnHatching from HatchGen,
|
||||
Orientation from TopAbs,
|
||||
State from TopAbs,
|
||||
Domain from HatchGen,
|
||||
ErrorStatus from HatchGen,
|
||||
Curve from Geom2dAdaptor,
|
||||
Intersector from Geom2dHatch,
|
||||
Element from Geom2dHatch,
|
||||
Elements from Geom2dHatch,
|
||||
Hatching from Geom2dHatch,
|
||||
Hatchings from Geom2dHatch,
|
||||
Classifier from Geom2dHatch
|
||||
|
||||
raises
|
||||
NoSuchObject from Standard ,
|
||||
OutOfRange from Standard ,
|
||||
NotDone from StdFail
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- class Hatcher description.
|
||||
----------------------------------------------------------------------
|
||||
|
||||
is
|
||||
|
||||
---Category: General use
|
||||
|
||||
|
||||
Create (Intersector : Intersector from Geom2dHatch ;
|
||||
Confusion2d : Real from Standard ;
|
||||
Confusion3d : Real from Standard ;
|
||||
KeepPnt : Boolean from Standard = Standard_False ;
|
||||
KeepSeg : Boolean from Standard = Standard_False)
|
||||
|
||||
---Purpose: Returns an empty hatcher.
|
||||
|
||||
returns Hatcher from Geom2dHatch;
|
||||
|
||||
|
||||
Intersector (me : in out ; Intersector : Intersector from Geom2dHatch)
|
||||
|
||||
---Purpose: Sets the associated intersector.
|
||||
is static ;
|
||||
|
||||
|
||||
Intersector (me : in out)
|
||||
|
||||
---Purpose: Returns the associated intersector.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns Intersector from Geom2dHatch
|
||||
is static ;
|
||||
|
||||
|
||||
ChangeIntersector (me : in out)
|
||||
|
||||
---Purpose: Returns the associated intersector.
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
returns Intersector from Geom2dHatch
|
||||
is static ;
|
||||
|
||||
|
||||
Confusion2d (me : in out ; Confusion : Real from Standard)
|
||||
|
||||
---Purpose: Sets the confusion tolerance.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
Confusion2d (me)
|
||||
|
||||
---Purpose: Returns the 2d confusion tolerance, i.e. the value under
|
||||
-- which two points are considered identical in the
|
||||
-- parametric space of the hatching.
|
||||
|
||||
---C++: inline
|
||||
returns Real from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Confusion3d (me : in out ; Confusion : Real from Standard)
|
||||
|
||||
---Purpose: Sets the confusion tolerance.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
Confusion3d (me)
|
||||
|
||||
---Purpose: Returns the 3d confusion tolerance, i.e. the value under
|
||||
-- which two points are considered identical in the
|
||||
-- 3d space of the hatching.
|
||||
|
||||
---C++: inline
|
||||
returns Real from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
KeepPoints (me : in out; Keep : Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the above flag.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
KeepPoints (me)
|
||||
|
||||
---Purpose: Returns the flag about the points consideration.
|
||||
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
KeepSegments (me : in out; Keep : Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the above flag.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
KeepSegments (me)
|
||||
|
||||
---Purpose: Returns the flag about the segments consideration.
|
||||
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Clear (me : in out)
|
||||
|
||||
---Purpose: Removes all the hatchings and all the elements.
|
||||
|
||||
---C++: inline
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Element
|
||||
|
||||
|
||||
Element (me : in out ; IndE : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the IndE-th element.
|
||||
|
||||
---Category: Element
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
returns Element from Geom2dHatch
|
||||
raises NoSuchObject from Standard
|
||||
is static protected ;
|
||||
|
||||
|
||||
ElementCurve (me; IndE : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the curve associated to the IndE-th element.
|
||||
|
||||
---Category: Element
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns Curve from Geom2dAdaptor
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
AddElement (me : in out ; Curve : Curve from Geom2dAdaptor ;
|
||||
Orientation : Orientation from TopAbs = TopAbs_FORWARD)
|
||||
|
||||
---Purpose: Adds an element to the hatcher and returns its index.
|
||||
|
||||
---Category: Element
|
||||
|
||||
returns Integer from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
RemElement (me : in out ; IndE : Integer from Standard)
|
||||
|
||||
---Purpose: Removes the IndE-th element from the hatcher.
|
||||
|
||||
---Category: Element
|
||||
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
ClrElements (me : in out)
|
||||
|
||||
---Purpose: Removes all the elements from the hatcher.
|
||||
|
||||
---Category: Element
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Hatching
|
||||
|
||||
|
||||
Hatching (me : in out ; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the IndH-th hatching.
|
||||
|
||||
---Category: Hatching
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
returns Hatching from Geom2dHatch
|
||||
raises NoSuchObject from Standard
|
||||
is static protected ;
|
||||
|
||||
|
||||
HatchingCurve (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the curve associated to the IndH-th hatching.
|
||||
|
||||
---Category: Hatching
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns Curve from Geom2dAdaptor
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
AddHatching (me : in out ; Curve : Curve from Geom2dAdaptor)
|
||||
|
||||
---Purpose: Adds a hatching to the hatcher and returns its index.
|
||||
|
||||
---Category: Hatching
|
||||
|
||||
returns Integer from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
RemHatching (me : in out ; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Removes the IndH-th hatching from the hatcher.
|
||||
|
||||
---Category: Hatching
|
||||
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
ClrHatchings (me : in out)
|
||||
|
||||
---Purpose: Removes all the hatchings from the hatcher.
|
||||
|
||||
---Category: Hatching
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
NbPoints (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the number of intersection points of
|
||||
-- the IndH-th hatching.
|
||||
|
||||
---Category: Hatching - Test
|
||||
|
||||
---C++: inline
|
||||
returns Integer from Standard
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Point (me; IndH, IndP : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the IndP-th intersection point of the
|
||||
-- IndH-th hatching.
|
||||
|
||||
---Category: Hatching - Test
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns PointOnHatching from HatchGen
|
||||
raises NoSuchObject from Standard,
|
||||
OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Computation - Trimming
|
||||
|
||||
Trim (me : in out)
|
||||
|
||||
---Purpose: Trims all the hatchings of the hatcher by all the
|
||||
-- elements of the hatcher.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
Trim (me : in out ; Curve : Curve from Geom2dAdaptor)
|
||||
|
||||
---Purpose: Adds a hatching to the hatcher and trims it by
|
||||
-- the elements already given and returns its index.
|
||||
|
||||
---Category: Computation
|
||||
|
||||
returns Integer from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Trim (me : in out ; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Trims the IndH-th hatching by the elements
|
||||
-- already given.
|
||||
|
||||
---Category: Computation
|
||||
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Trim (me : in out ; IndH, IndE : Integer from Standard)
|
||||
|
||||
---Purpose: Trims the IndH-th hatching of the hatcher by the
|
||||
-- IndE-th element.
|
||||
|
||||
---Category: Computation
|
||||
|
||||
returns Boolean from Standard
|
||||
is static private ;
|
||||
|
||||
|
||||
---Category: Computation - Domains
|
||||
|
||||
GlobalTransition (me : in out; Point : in out PointOnHatching from HatchGen)
|
||||
|
||||
---Purpose: Sets the global transition (the before and after
|
||||
-- states and segment extremities flags) of the point.
|
||||
|
||||
---Category: Computation - Domains
|
||||
|
||||
returns Boolean from Standard
|
||||
is static private ;
|
||||
|
||||
|
||||
ComputeDomains (me : in out)
|
||||
|
||||
---Purpose: Computes the domains of all the hatchings.
|
||||
|
||||
---Category: Computation - Domains
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
ComputeDomains (me : in out ; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Computes the domains of the IndH-th hatching.
|
||||
|
||||
---Category: Computation - Domains
|
||||
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Results
|
||||
|
||||
TrimDone (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the fact that the intersections were computed
|
||||
-- for the IndH-th hatching.
|
||||
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
TrimFailed (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the fact that the intersections failed
|
||||
-- for the IndH-th hatching.
|
||||
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
IsDone (me)
|
||||
|
||||
---Purpose: Returns the fact that the domains were computed
|
||||
-- for all the hatchings.
|
||||
|
||||
---C++: inline
|
||||
returns Boolean from Standard
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
IsDone (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the fact that the domains were computed
|
||||
-- for the IndH-th hatching.
|
||||
|
||||
returns Boolean from Standard
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Status (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the status about the IndH-th hatching.
|
||||
|
||||
---C++: inline
|
||||
returns ErrorStatus from HatchGen
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
NbDomains (me; IndH : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the number of domains of the IndH-th hatching.
|
||||
-- Only ONE "INFINITE" domain means that the hatching is
|
||||
-- fully included in the contour defined by the elements.
|
||||
|
||||
---C++: inline
|
||||
returns Integer from Standard
|
||||
raises NoSuchObject from Standard ,
|
||||
NotDone from StdFail
|
||||
is static ;
|
||||
|
||||
|
||||
Domain (me; IndH : Integer from Standard ;
|
||||
IDom : Integer from Standard )
|
||||
|
||||
---Purpose: Returns the IDom-th domain of the IndH-th hatching.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns Domain from HatchGen
|
||||
raises NoSuchObject from Standard ,
|
||||
NotDone from StdFail ,
|
||||
OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Dump
|
||||
|
||||
Dump (me)
|
||||
|
||||
---Purpose: Dump the hatcher.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myIntersector : Intersector from Geom2dHatch;
|
||||
myConfusion2d : Real from Standard ;
|
||||
myConfusion3d : Real from Standard ;
|
||||
myKeepPoints : Boolean from Standard ;
|
||||
myKeepSegments : Boolean from Standard ;
|
||||
myNbElements : Integer from Standard ;
|
||||
myElements : Elements from Geom2dHatch ;
|
||||
myNbHatchings : Integer from Standard ;
|
||||
myHatchings : Hatchings from Geom2dHatch;
|
||||
|
||||
end Hatcher from Geom2dHatch;
|
1503
src/Geom2dHatch/Geom2dHatch_Hatcher.cxx
Normal file
1503
src/Geom2dHatch/Geom2dHatch_Hatcher.cxx
Normal file
File diff suppressed because it is too large
Load Diff
262
src/Geom2dHatch/Geom2dHatch_Hatcher.lxx
Normal file
262
src/Geom2dHatch/Geom2dHatch_Hatcher.lxx
Normal file
@@ -0,0 +1,262 @@
|
||||
// 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() ;
|
||||
}
|
||||
|
||||
|
||||
|
257
src/Geom2dHatch/Geom2dHatch_Hatching.cdl
Normal file
257
src/Geom2dHatch/Geom2dHatch_Hatching.cdl
Normal file
@@ -0,0 +1,257 @@
|
||||
-- Created on: 1993-11-10
|
||||
-- Created by: Jean Marc LACHAUME
|
||||
-- Copyright (c) 1993-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 Hatching from Geom2dHatch
|
||||
|
||||
uses
|
||||
ErrorStatus from HatchGen ,
|
||||
PointOnHatching from HatchGen ,
|
||||
PointsOnHatching from HatchGen ,
|
||||
Domain from HatchGen ,
|
||||
Domains from HatchGen ,
|
||||
Pnt2d from gp,
|
||||
Curve from Geom2dAdaptor
|
||||
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
returns Hatching from Geom2dHatch;
|
||||
|
||||
|
||||
Create (Curve : Curve from Geom2dAdaptor)
|
||||
|
||||
---Purpose: Creates a hatching.
|
||||
|
||||
returns Hatching from Geom2dHatch ;
|
||||
|
||||
|
||||
Curve (me)
|
||||
|
||||
---Purpose: Returns the curve associated to the hatching.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns Curve from Geom2dAdaptor
|
||||
is static ;
|
||||
|
||||
|
||||
ChangeCurve (me : in out)
|
||||
|
||||
---Purpose: Returns the curve associated to the hatching.
|
||||
|
||||
---C++: return &
|
||||
|
||||
returns Curve from Geom2dAdaptor
|
||||
is static ;
|
||||
|
||||
|
||||
TrimDone (me : in out ; Flag : Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the flag about the trimming computations to the
|
||||
-- given value.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
TrimDone (me)
|
||||
|
||||
---Purpose: Returns the flag about the trimming computations.
|
||||
|
||||
returns Boolean from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
TrimFailed (me : in out ; Flag : Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the flag about the trimming failure to the
|
||||
-- given value.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
TrimFailed (me)
|
||||
|
||||
---Purpose: Returns the flag about the trimming failure.
|
||||
|
||||
returns Boolean from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
IsDone (me : in out ; Flag : Boolean from Standard)
|
||||
|
||||
---Purpose: Sets the flag about the domains computation to the
|
||||
-- given value.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
IsDone (me)
|
||||
|
||||
---Purpose: Returns the flag about the domains computation.
|
||||
|
||||
returns Boolean from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Status (me : in out ; Status : ErrorStatus from HatchGen)
|
||||
|
||||
---Purpose: Sets the error status.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
Status (me)
|
||||
|
||||
---Purpose: Returns the error status.
|
||||
|
||||
returns ErrorStatus from HatchGen
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Points on hatching.
|
||||
|
||||
AddPoint (me : in out ; Point : PointOnHatching from HatchGen ;
|
||||
Confusion : Real from Standard)
|
||||
|
||||
---Purpose: Adds an intersection point to the hatching.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
NbPoints (me)
|
||||
|
||||
---Purpose: Returns the number of intersection points
|
||||
-- of the hatching.
|
||||
|
||||
returns Integer from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Point (me ; Index : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the Index-th intersection point of the
|
||||
-- hatching.
|
||||
-- The exception OutOfRange is raised if
|
||||
-- Index < 1 or Index > NbPoints.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns PointOnHatching from HatchGen
|
||||
raises OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
ChangePoint (me : in out ; Index : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the Index-th intersection point of the
|
||||
-- hatching.
|
||||
-- The exception OutOfRange is raised if
|
||||
-- Index < 1 or Index > NbPoints.
|
||||
|
||||
---C++: return &
|
||||
|
||||
returns PointOnHatching from HatchGen
|
||||
raises OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
RemPoint (me : in out ; Index : Integer from Standard)
|
||||
|
||||
---Purpose: Removes the Index-th intersection point of the
|
||||
-- hatching.
|
||||
-- The exception OutOfRange is raised if
|
||||
-- Index < 1 or Index > NbPoints.
|
||||
|
||||
raises OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
ClrPoints (me : in out)
|
||||
|
||||
---Purpose: Removes all the intersection points of the hatching.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
---Category: Domains.
|
||||
|
||||
|
||||
AddDomain (me : in out ; Domain : Domain from HatchGen)
|
||||
|
||||
---Purpose: Adds a domain to the hatching.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
NbDomains (me)
|
||||
|
||||
---Purpose: Returns the number of domains of the hatching.
|
||||
|
||||
returns Integer from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
Domain (me ; Index : Integer from Standard)
|
||||
|
||||
---Purpose: Returns the Index-th domain of the hatching.
|
||||
-- The exception OutOfRange is raised if
|
||||
-- Index < 1 or Index > NbDomains.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns Domain from HatchGen
|
||||
raises OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
RemDomain (me : in out ; Index : Integer from Standard)
|
||||
|
||||
---Purpose: Removes the Index-th domain of the hatching.
|
||||
-- The exception OutOfRange is raised if
|
||||
-- Index < 1 or Index > NbDomains.
|
||||
|
||||
raises OutOfRange from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
ClrDomains (me : in out)
|
||||
|
||||
---Purpose: Removes all the domains of the hatching.
|
||||
|
||||
is static ;
|
||||
|
||||
|
||||
ClassificationPoint (me)
|
||||
---Purpose: Returns a point on the curve.
|
||||
-- This point will be used for the classification.
|
||||
returns Pnt2d from gp
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
myCurve : Curve from Geom2dAdaptor ;
|
||||
myTrimDone : Boolean from Standard ;
|
||||
myTrimFailed : Boolean from Standard ;
|
||||
myPoints : PointsOnHatching from HatchGen ;
|
||||
myIsDone : Boolean from Standard ;
|
||||
myStatus : ErrorStatus from HatchGen ;
|
||||
myDomains : Domains from HatchGen ;
|
||||
|
||||
end Hatching from Geom2dHatch ;
|
335
src/Geom2dHatch/Geom2dHatch_Hatching.cxx
Normal file
335
src/Geom2dHatch/Geom2dHatch_Hatching.cxx
Normal file
@@ -0,0 +1,335 @@
|
||||
// Created on: 1993-11-03
|
||||
// Created by: Jean Marc LACHAUME
|
||||
// Copyright (c) 1993-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.
|
||||
|
||||
#include <Geom2dHatch_Hatching.ixx>
|
||||
|
||||
#include <HatchGen_PointOnElement.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
|
||||
#define RAISE_IF_NOSUCHOBJECT 0
|
||||
|
||||
#include <Precision.hxx>
|
||||
//=======================================================================
|
||||
// Function : Geom2dHatch_Hatching
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
Geom2dHatch_Hatching::Geom2dHatch_Hatching () {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Geom2dHatch_Hatching
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
Geom2dHatch_Hatching::Geom2dHatch_Hatching (const Geom2dAdaptor_Curve& Curve) :
|
||||
myCurve (Curve),
|
||||
myTrimDone (Standard_False),
|
||||
myTrimFailed (Standard_False),
|
||||
myIsDone (Standard_False),
|
||||
myStatus (HatchGen_NoProblem)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Curve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const Geom2dAdaptor_Curve& Geom2dHatch_Hatching::Curve () const
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ChangeCurve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
Geom2dAdaptor_Curve& Geom2dHatch_Hatching::ChangeCurve ()
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimDone
|
||||
// Purpose : Sets the flag about the trimmings computation to the given
|
||||
// value.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::TrimDone (const Standard_Boolean Flag)
|
||||
{
|
||||
myTrimDone = Flag ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimDone
|
||||
// Purpose : Returns the flag about the trimmings computation.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Hatching::TrimDone () const
|
||||
{
|
||||
return myTrimDone ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimFailed
|
||||
// Purpose : Sets the flag about the trimmings failure to the given
|
||||
// value.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::TrimFailed (const Standard_Boolean Flag)
|
||||
{
|
||||
myTrimFailed = Flag ;
|
||||
if (myTrimFailed) myStatus = HatchGen_TrimFailure ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimFailed
|
||||
// Purpose : Returns the flag about the trimmings failure.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Hatching::TrimFailed () const
|
||||
{
|
||||
return myTrimFailed ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : IsDone
|
||||
// Purpose : Sets the flag about the domains computation to the given
|
||||
// value.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::IsDone (const Standard_Boolean Flag)
|
||||
{
|
||||
myIsDone = Flag ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : IsDone
|
||||
// Purpose : Returns the flag about the domains computation.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Geom2dHatch_Hatching::IsDone () const
|
||||
{
|
||||
return myIsDone ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : SetStatus
|
||||
// Purpose : Sets the error status.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::Status (const HatchGen_ErrorStatus Status)
|
||||
{
|
||||
myStatus = Status ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Status
|
||||
// Purpose : Returns the error status.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_ErrorStatus Geom2dHatch_Hatching::Status () const
|
||||
{
|
||||
return myStatus ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : AddPoint
|
||||
// Purpose : Adds an intersection point to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::AddPoint (const HatchGen_PointOnHatching& Point,
|
||||
const Standard_Real Confusion)
|
||||
{
|
||||
Standard_Integer NbPoints = myPoints.Length () ;
|
||||
//for (Standard_Integer IPntH = 1 ; IPntH <= NbPoints ; IPntH++) {
|
||||
Standard_Integer IPntH;
|
||||
for (IPntH = 1 ; IPntH <= NbPoints ; IPntH++) {
|
||||
const HatchGen_PointOnHatching& PntH = myPoints.Value (IPntH) ;
|
||||
if (!PntH.IsLower (Point, Confusion)) break ;
|
||||
}
|
||||
if (IPntH > NbPoints) {
|
||||
myPoints.Append (Point) ;
|
||||
} else {
|
||||
HatchGen_PointOnHatching& PntH = myPoints.ChangeValue (IPntH) ;
|
||||
if (PntH.IsGreater (Point, Confusion)) {
|
||||
myPoints.InsertBefore (IPntH, Point) ;
|
||||
} else {
|
||||
for (Standard_Integer IPntE = 1 ; IPntE <= Point.NbPoints() ; IPntE++) {
|
||||
const HatchGen_PointOnElement& PntE = Point.Point (IPntE) ;
|
||||
PntH.AddPoint (PntE, Confusion) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (myIsDone) ClrDomains() ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : NbPoints
|
||||
// Purpose : Returns the number of intersection points on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Geom2dHatch_Hatching::NbPoints () const
|
||||
{
|
||||
return myPoints.Length () ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Point
|
||||
// Purpose : Returns the Index-th intersection point on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const HatchGen_PointOnHatching& Geom2dHatch_Hatching::Point (const Standard_Integer Index) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_Integer NbPoints = myPoints.Length () ;
|
||||
Standard_OutOfRange_Raise_if (Index < 1 || Index > NbPoints, "") ;
|
||||
#endif
|
||||
const HatchGen_PointOnHatching& Point = myPoints.Value (Index) ;
|
||||
return Point ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ChangePoint
|
||||
// Purpose : Returns the Index-th intersection point on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_PointOnHatching& Geom2dHatch_Hatching::ChangePoint (const Standard_Integer Index)
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_Integer NbPoints = myPoints.Length () ;
|
||||
Standard_OutOfRange_Raise_if (Index < 1 || Index > NbPoints, "") ;
|
||||
#endif
|
||||
HatchGen_PointOnHatching& Point = myPoints.ChangeValue (Index) ;
|
||||
return Point ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : RemPoint
|
||||
// Purpose : Removes the Index-th intersection point of the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::RemPoint (const Standard_Integer Index)
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_Integer NbPoints = myPoints.Length () ;
|
||||
Standard_OutOfRange_Raise_if (Index < 1 || Index > NbPoints, "") ;
|
||||
#endif
|
||||
if (myIsDone) ClrDomains() ;
|
||||
myPoints.Remove (Index) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ClrPoints
|
||||
// Purpose : Removes all the intersection points of the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::ClrPoints ()
|
||||
{
|
||||
if (myIsDone) ClrDomains() ;
|
||||
for (Standard_Integer IPntH = 1 ; IPntH <= myPoints.Length() ; IPntH++) {
|
||||
HatchGen_PointOnHatching& Point = myPoints.ChangeValue (IPntH) ;
|
||||
Point.ClrPoints() ;
|
||||
}
|
||||
myPoints.Clear () ;
|
||||
myTrimDone = Standard_False ;
|
||||
myTrimFailed = Standard_False ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : AddDomain
|
||||
// Purpose : Adds a domain to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::AddDomain (const HatchGen_Domain& Domain)
|
||||
{
|
||||
myDomains.Append (Domain) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : NbDomains
|
||||
// Purpose : Returns the number of domains on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Geom2dHatch_Hatching::NbDomains () const
|
||||
{
|
||||
return myDomains.Length () ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Domain
|
||||
// Purpose : Returns the Index-th domain on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const HatchGen_Domain& Geom2dHatch_Hatching::Domain (const Standard_Integer Index) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_Integer NbDomains = myDomains.Length () ;
|
||||
Standard_OutOfRange_Raise_if (Index < 1 || Index > NbDomains, "") ;
|
||||
#endif
|
||||
const HatchGen_Domain& Domain = myDomains.Value (Index) ;
|
||||
return Domain ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : RemDomain
|
||||
// Purpose : Removes the Index-th domain of the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::RemDomain (const Standard_Integer Index)
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_Integer NbDomains = myDomains.Length () ;
|
||||
Standard_OutOfRange_Raise_if (Index < 1 || Index > NbDomains, "") ;
|
||||
#endif
|
||||
myDomains.Remove (Index) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ClrDomains
|
||||
// Purpose : Removes all the domains of the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void Geom2dHatch_Hatching::ClrDomains ()
|
||||
{
|
||||
myDomains.Clear () ;
|
||||
myIsDone = Standard_False ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ClassificationPoint
|
||||
// Purpose : returns a 2d point on the curve
|
||||
//=======================================================================
|
||||
gp_Pnt2d Geom2dHatch_Hatching::ClassificationPoint () const {
|
||||
Standard_Real t,a,b;
|
||||
a = myCurve.FirstParameter();
|
||||
b = myCurve.LastParameter();
|
||||
if(b >= Precision::Infinite()) {
|
||||
if(a <= -Precision::Infinite()) {
|
||||
t=0;
|
||||
}
|
||||
else {
|
||||
t = a;
|
||||
}
|
||||
}
|
||||
else {
|
||||
t = b;
|
||||
}
|
||||
return(myCurve.Value(t));
|
||||
}
|
||||
|
Reference in New Issue
Block a user