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,13 +17,11 @@
|
||||
package HatchGen
|
||||
|
||||
uses
|
||||
IntRes2d ,
|
||||
StdFail ,
|
||||
TopAbs ,
|
||||
TCollection ,
|
||||
TColStd,
|
||||
gp,
|
||||
TopClass
|
||||
IntRes2d,
|
||||
StdFail,
|
||||
TopAbs,
|
||||
TCollection,
|
||||
gp
|
||||
|
||||
is
|
||||
|
||||
@@ -65,17 +63,6 @@ is
|
||||
class Domain ;
|
||||
class Domains instantiates Sequence from TCollection
|
||||
(Domain from HatchGen) ;
|
||||
|
||||
generic class HatchingGen ;
|
||||
generic class ElementGen ;
|
||||
generic class ElementsGen,MapOfElements;
|
||||
|
||||
generic class Hatcher ,
|
||||
Hatching ,
|
||||
Hatchings ,
|
||||
Element ,
|
||||
Elements,
|
||||
Classifier;
|
||||
|
||||
|
||||
end HatchGen ;
|
||||
|
@@ -1,84 +0,0 @@
|
||||
-- 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.
|
||||
|
||||
generic class ElementGen from HatchGen (TheElementCurve as any)
|
||||
|
||||
uses
|
||||
Orientation from TopAbs
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create
|
||||
|
||||
returns ElementGen from HatchGen;
|
||||
|
||||
Create (Other : ElementGen from HatchGen)
|
||||
|
||||
---Purpose: Magic constructor.
|
||||
|
||||
returns ElementGen from HatchGen ;
|
||||
|
||||
|
||||
Create (Curve : TheElementCurve ;
|
||||
Orientation : Orientation from TopAbs = TopAbs_FORWARD)
|
||||
|
||||
---Purpose: Creates an element.
|
||||
|
||||
returns ElementGen from HatchGen ;
|
||||
|
||||
|
||||
Curve (me)
|
||||
|
||||
---Purpose: Returns the curve associated to the element.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns TheElementCurve
|
||||
is static ;
|
||||
|
||||
|
||||
ChangeCurve (me : in out)
|
||||
|
||||
---Purpose: Returns the curve associated to the element.
|
||||
|
||||
---C++: return &
|
||||
|
||||
returns TheElementCurve
|
||||
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 : TheElementCurve ;
|
||||
myOrientation : Orientation from TopAbs ;
|
||||
|
||||
end ElementGen from HatchGen ;
|
@@ -1,87 +0,0 @@
|
||||
// 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 : HatchGen_ElementGen
|
||||
// Purpose : Magic Constructor.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_ElementGen::HatchGen_ElementGen (const HatchGen_ElementGen& Other)
|
||||
: myCurve(Other.myCurve), myOrientation(Other.myOrientation) {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : HatchGen_ElementGen
|
||||
// Purpose : Empty Constructor.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_ElementGen::HatchGen_ElementGen () {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : HatchGen_ElementGen
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_ElementGen::HatchGen_ElementGen (const TheElementCurve& Curve,
|
||||
const TopAbs_Orientation Orientation) :
|
||||
myCurve (Curve),
|
||||
myOrientation (Orientation)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Curve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const TheElementCurve& HatchGen_ElementGen::Curve () const
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ChangeCurve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
TheElementCurve& HatchGen_ElementGen::ChangeCurve ()
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Orientation
|
||||
// Purpose : Sets the orientation of the element.
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_ElementGen::Orientation (const TopAbs_Orientation Orientation)
|
||||
{
|
||||
myOrientation = Orientation ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Orientation
|
||||
// Purpose : Returns the orientation of the element.
|
||||
//=======================================================================
|
||||
|
||||
TopAbs_Orientation HatchGen_ElementGen::Orientation () const
|
||||
{
|
||||
return myOrientation ;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,152 +0,0 @@
|
||||
-- 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
|
||||
|
||||
|
||||
generic class ElementsGen from HatchGen
|
||||
(TheKey as any;
|
||||
TheItem as any;
|
||||
TheHasher as any;
|
||||
TheCurve as any)
|
||||
|
||||
|
||||
uses
|
||||
Orientation from TopAbs,
|
||||
Lin2d from gp,
|
||||
Pnt2d from gp
|
||||
|
||||
raises
|
||||
DomainError from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
|
||||
private class MapOfElements from HatchGen instantiates
|
||||
DataMap from TCollection
|
||||
(TheKey,
|
||||
TheItem,
|
||||
TheHasher);
|
||||
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns ElementsGen from HatchGen;
|
||||
|
||||
Create(Other : ElementsGen from HatchGen)
|
||||
returns ElementsGen from HatchGen;
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- 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 : TheKey; I : TheItem) returns Boolean
|
||||
is static;
|
||||
|
||||
IsBound(me; K : TheKey) returns Boolean
|
||||
is static;
|
||||
|
||||
UnBind(me : in out; K : TheKey) returns Boolean
|
||||
is static;
|
||||
|
||||
Find(me; K : TheKey) returns any TheItem
|
||||
raises NoSuchObject from Standard -- when <K> is not in the map.
|
||||
---C++: alias operator()
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
ChangeFind(me : in out; K : TheKey) returns any TheItem
|
||||
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 TheCurve;
|
||||
Or : out Orientation from TopAbs)
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myMap : MapOfElements;
|
||||
Iter : DataMapIteratorOfMapOfElements;
|
||||
NumWire : Integer from Standard;
|
||||
NumEdge : Integer from Standard;
|
||||
myCurEdge: Integer from Standard;
|
||||
|
||||
end ElementsGen from HatchGen;
|
@@ -1,227 +0,0 @@
|
||||
// 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 <TopAbs_Orientation.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
//HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& Other) {
|
||||
HatchGen_ElementsGen::HatchGen_ElementsGen(const HatchGen_ElementsGen& ) {
|
||||
cout<<" Magic Constructor in HatchGen_ElementsGen:: "<<endl;
|
||||
}
|
||||
|
||||
HatchGen_ElementsGen::HatchGen_ElementsGen() {
|
||||
NumWire = 0;
|
||||
NumEdge = 0;
|
||||
myCurEdge = 1;
|
||||
}
|
||||
|
||||
void HatchGen_ElementsGen::Clear() {
|
||||
myMap.Clear();
|
||||
}
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::IsBound(const TheKey& K) const {
|
||||
return(myMap.IsBound(K));
|
||||
}
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::UnBind(const TheKey& K) {
|
||||
return(myMap.UnBind(K));
|
||||
}
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::Bind(const TheKey& K,const TheItem& I) {
|
||||
return(myMap.Bind(K,I));
|
||||
}
|
||||
|
||||
const TheItem& HatchGen_ElementsGen::Find(const TheKey& K) const {
|
||||
return(myMap.Find(K));
|
||||
}
|
||||
|
||||
TheItem& HatchGen_ElementsGen::ChangeFind(const TheKey& K) {
|
||||
return(myMap.ChangeFind(K));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Reject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::Reject(const gp_Pnt2d&) const {
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Segment
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::Segment(const gp_Pnt2d& P,
|
||||
gp_Lin2d& L,
|
||||
Standard_Real& Par)
|
||||
{
|
||||
myCurEdge = 1;
|
||||
|
||||
return OtherSegment(P, L, Par);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Segment
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::OtherSegment(const gp_Pnt2d& P,
|
||||
gp_Lin2d& L,
|
||||
Standard_Real& Par)
|
||||
{
|
||||
HatchGen_DataMapIteratorOfMapOfElements Itertemp;
|
||||
Standard_Integer i;
|
||||
|
||||
for( Itertemp.Initialize(myMap), i = 1; Itertemp.More(); Itertemp.Next(), i++) {
|
||||
if (i < myCurEdge)
|
||||
continue;
|
||||
|
||||
void *ptrmyMap = (void *)(&myMap);
|
||||
TheItem& Item=((HatchGen_MapOfElements*)ptrmyMap)->ChangeFind(Itertemp.Key());
|
||||
TheCurve& 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 HatchGen_ElementsGen::InitWires() {
|
||||
NumWire = 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RejectWire NYI
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::RejectWire(const gp_Lin2d& ,
|
||||
const Standard_Real) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InitEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_ElementsGen::InitEdges() {
|
||||
NumEdge = 0;
|
||||
Iter.Initialize(myMap);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RejectEdge NYI
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::RejectEdge(const gp_Lin2d& ,
|
||||
const Standard_Real ) const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : CurrentEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_ElementsGen::CurrentEdge(TheCurve& E,
|
||||
TopAbs_Orientation& Or) const
|
||||
{
|
||||
void *ptrmyMap = (void *)(&myMap);
|
||||
TheItem& Item=((HatchGen_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 HatchGen_ElementsGen::MoreWires() const
|
||||
{
|
||||
return (NumWire == 0);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NextWire
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_ElementsGen::NextWire() {
|
||||
NumWire++;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MoreEdges
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_ElementsGen::MoreEdges() const {
|
||||
return(Iter.More());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NextEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_ElementsGen::NextEdge() {
|
||||
Iter.Next();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,513 +0,0 @@
|
||||
-- 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.
|
||||
|
||||
generic class Hatcher from HatchGen
|
||||
(TheCurveE as any ; -- as Curve from Geom2dAdaptor
|
||||
TheCurveH as any ; -- as Curve from Geom2dAdaptor
|
||||
TheIntersector as any ) -- as Intersector from HatchGen
|
||||
|
||||
uses
|
||||
MapIntegerHasher from TColStd ,
|
||||
PointOnHatching from HatchGen ,
|
||||
Orientation from TopAbs ,
|
||||
State from TopAbs ,
|
||||
Domain from HatchGen ,
|
||||
ErrorStatus from HatchGen
|
||||
|
||||
raises
|
||||
NoSuchObject from Standard ,
|
||||
OutOfRange from Standard ,
|
||||
NotDone from StdFail
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- Nested classes descriptions.
|
||||
----------------------------------------------------------------------
|
||||
|
||||
class Element from HatchGen instantiates ElementGen from HatchGen
|
||||
(TheCurveE) ;
|
||||
|
||||
class Elements from HatchGen instantiates ElementsGen from HatchGen
|
||||
(Integer from Standard,
|
||||
Element from HatchGen,
|
||||
MapIntegerHasher from TColStd ,
|
||||
TheCurveE ) ;
|
||||
|
||||
class Hatching from HatchGen instantiates HatchingGen from HatchGen
|
||||
(TheCurveH) ;
|
||||
|
||||
class Hatchings from HatchGen instantiates DataMap from TCollection
|
||||
(Integer from Standard,
|
||||
Hatching from HatchGen,
|
||||
MapIntegerHasher from TColStd) ;
|
||||
|
||||
class Classifier from HatchGen instantiates FaceClassifier from TopClass
|
||||
(Elements,
|
||||
TheCurveE,
|
||||
TheIntersector);
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- class Hatcher description.
|
||||
----------------------------------------------------------------------
|
||||
|
||||
is
|
||||
|
||||
---Category: General use
|
||||
|
||||
|
||||
Create (Intersector : TheIntersector ;
|
||||
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 HatchGen ;
|
||||
|
||||
|
||||
Intersector (me : in out ; Intersector : TheIntersector)
|
||||
|
||||
---Purpose: Sets the associated intersector.
|
||||
is static ;
|
||||
|
||||
|
||||
Intersector (me : in out)
|
||||
|
||||
---Purpose: Returns the associated intersector.
|
||||
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
returns TheIntersector
|
||||
is static ;
|
||||
|
||||
|
||||
ChangeIntersector (me : in out)
|
||||
|
||||
---Purpose: Returns the associated intersector.
|
||||
|
||||
---C++: inline
|
||||
---C++: return &
|
||||
|
||||
returns TheIntersector
|
||||
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 HatchGen
|
||||
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 TheCurveE
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
AddElement (me : in out ; Curve : TheCurveE ;
|
||||
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 HatchGen
|
||||
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 TheCurveH
|
||||
raises NoSuchObject from Standard
|
||||
is static ;
|
||||
|
||||
|
||||
AddHatching (me : in out ; Curve : TheCurveH)
|
||||
|
||||
---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 : TheCurveH)
|
||||
|
||||
---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 : TheIntersector ;
|
||||
myConfusion2d : Real from Standard ;
|
||||
myConfusion3d : Real from Standard ;
|
||||
myKeepPoints : Boolean from Standard ;
|
||||
myKeepSegments : Boolean from Standard ;
|
||||
myNbElements : Integer from Standard ;
|
||||
myElements : Elements from HatchGen ;
|
||||
myNbHatchings : Integer from Standard ;
|
||||
myHatchings : Hatchings from HatchGen ;
|
||||
|
||||
end Hatcher from HatchGen ;
|
File diff suppressed because it is too large
Load Diff
@@ -1,262 +0,0 @@
|
||||
// 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 HatchGen_Element_hxx
|
||||
#include HatchGen_Elements_hxx
|
||||
#include TheIntersector_hxx
|
||||
#include TheCurveE_hxx
|
||||
#include HatchGen_Hatching_hxx
|
||||
//=======================================================================
|
||||
// Function : Intersector
|
||||
// Purpose : Returns the associated intersector.
|
||||
//=======================================================================
|
||||
|
||||
inline const TheIntersector& HatchGen_Hatcher::Intersector ()
|
||||
{
|
||||
return myIntersector ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ChangeIntersector
|
||||
// Purpose : Returns the associated intersector.
|
||||
//=======================================================================
|
||||
|
||||
inline TheIntersector& HatchGen_Hatcher::ChangeIntersector ()
|
||||
{
|
||||
return myIntersector ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Confusion2d
|
||||
// Purpose : Returns the 2d confusion tolerance.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real HatchGen_Hatcher::Confusion2d () const
|
||||
{
|
||||
return myConfusion2d ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Confusion3d
|
||||
// Purpose : Returns the 3d confusion tolerance.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real HatchGen_Hatcher::Confusion3d () const
|
||||
{
|
||||
return myConfusion3d ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : KeepPoints
|
||||
// Purpose : Returns the flag about the points consideration.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean HatchGen_Hatcher::KeepPoints () const
|
||||
{
|
||||
return myKeepPoints ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : KeepSegments
|
||||
// Purpose : Returns the flag about the segments consideration.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean HatchGen_Hatcher::KeepSegments () const
|
||||
{
|
||||
return myKeepSegments ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Clear
|
||||
// Purpose : Removes all the hatchings and all the elements.
|
||||
//=======================================================================
|
||||
|
||||
inline void HatchGen_Hatcher::Clear ()
|
||||
{
|
||||
if (myNbHatchings != 0) ClrHatchings () ;
|
||||
if (myNbElements != 0) ClrElements () ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Element
|
||||
// Purpose : Returns the IndE-th element.
|
||||
//=======================================================================
|
||||
|
||||
inline HatchGen_Element& HatchGen_Hatcher::Element (const Standard_Integer IndE)
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
|
||||
#endif
|
||||
HatchGen_Element& Element = myElements.ChangeFind (IndE) ;
|
||||
return Element ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ElementCurve
|
||||
// Purpose : Returns the curve associated to the IndE-th element.
|
||||
//=======================================================================
|
||||
|
||||
inline const TheCurveE& HatchGen_Hatcher::ElementCurve (const Standard_Integer IndE) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myElements.IsBound (IndE), "") ;
|
||||
#endif
|
||||
const HatchGen_Element& Element = myElements.Find (IndE) ;
|
||||
return Element.Curve() ;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// Function : Hatching
|
||||
// Purpose : Returns the IndH-th hatching.
|
||||
//=======================================================================
|
||||
|
||||
inline HatchGen_Hatching& HatchGen_Hatcher::Hatching (const Standard_Integer IndH)
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
HatchGen_Hatching& Hatching = myHatchings.ChangeFind (IndH) ;
|
||||
return Hatching ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : HatchingCurve
|
||||
// Purpose : Returns the curve associated to the IndH-th hatching.
|
||||
//=======================================================================
|
||||
|
||||
inline const TheCurveH& HatchGen_Hatcher::HatchingCurve (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_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 HatchGen_Hatcher::NbPoints (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_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& HatchGen_Hatcher::Point (const Standard_Integer IndH,
|
||||
const Standard_Integer IndP) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_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 HatchGen_Hatcher::TrimDone (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_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 HatchGen_Hatcher::TrimFailed (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_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 HatchGen_Hatcher::IsDone (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ;
|
||||
return Hatching.IsDone() ;
|
||||
}
|
||||
//=======================================================================
|
||||
// Function : Status
|
||||
// Purpose : Returns the status about the IndH-th hatching.
|
||||
//=======================================================================
|
||||
|
||||
inline HatchGen_ErrorStatus HatchGen_Hatcher::Status (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ;
|
||||
return Hatching.Status() ;
|
||||
}
|
||||
//=======================================================================
|
||||
// Function : NbDomains
|
||||
// Purpose : Returns the number of domains of the IndH-th hatching.
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer HatchGen_Hatcher::NbDomains (const Standard_Integer IndH) const
|
||||
{
|
||||
#if RAISE_IF_NOSUCHOBJECT
|
||||
Standard_NoSuchObject_Raise_if (!myHatchings.IsBound (IndH), "") ;
|
||||
#endif
|
||||
const HatchGen_Hatching& Hatching = myHatchings.Find (IndH) ;
|
||||
StdFail_NotDone_Raise_if (!Hatching.IsDone(), "HatchGen_Hatcher::NbDomains") ;
|
||||
return Hatching.NbDomains() ;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,256 +0,0 @@
|
||||
-- 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.
|
||||
|
||||
generic class HatchingGen from HatchGen (TheHatchingCurve as any)
|
||||
|
||||
uses
|
||||
ErrorStatus from HatchGen ,
|
||||
PointOnHatching from HatchGen ,
|
||||
PointsOnHatching from HatchGen ,
|
||||
Domain from HatchGen ,
|
||||
Domains from HatchGen ,
|
||||
Pnt2d from gp
|
||||
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
|
||||
returns HatchingGen from HatchGen;
|
||||
|
||||
|
||||
Create (Curve : TheHatchingCurve)
|
||||
|
||||
---Purpose: Creates a hatching.
|
||||
|
||||
returns HatchingGen from HatchGen ;
|
||||
|
||||
|
||||
Curve (me)
|
||||
|
||||
---Purpose: Returns the curve associated to the hatching.
|
||||
|
||||
---C++: return const &
|
||||
|
||||
returns TheHatchingCurve
|
||||
is static ;
|
||||
|
||||
|
||||
ChangeCurve (me : in out)
|
||||
|
||||
---Purpose: Returns the curve associated to the hatching.
|
||||
|
||||
---C++: return &
|
||||
|
||||
returns TheHatchingCurve
|
||||
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 : TheHatchingCurve ;
|
||||
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 HatchingGen from HatchGen ;
|
@@ -1,332 +0,0 @@
|
||||
// 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 <HatchGen_PointOnElement.hxx>
|
||||
|
||||
#define RAISE_IF_NOSUCHOBJECT 0
|
||||
|
||||
#include <Precision.hxx>
|
||||
//=======================================================================
|
||||
// Function : HatchGen_HatchingGen
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_HatchingGen::HatchGen_HatchingGen () {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : HatchGen_HatchingGen
|
||||
// Purpose : Constructor.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_HatchingGen::HatchGen_HatchingGen (const TheHatchingCurve& 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 TheHatchingCurve& HatchGen_HatchingGen::Curve () const
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ChangeCurve
|
||||
// Purpose : Returns the curve associated to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
TheHatchingCurve& HatchGen_HatchingGen::ChangeCurve ()
|
||||
{
|
||||
return myCurve ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimDone
|
||||
// Purpose : Sets the flag about the trimmings computation to the given
|
||||
// value.
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_HatchingGen::TrimDone (const Standard_Boolean Flag)
|
||||
{
|
||||
myTrimDone = Flag ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimDone
|
||||
// Purpose : Returns the flag about the trimmings computation.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_HatchingGen::TrimDone () const
|
||||
{
|
||||
return myTrimDone ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimFailed
|
||||
// Purpose : Sets the flag about the trimmings failure to the given
|
||||
// value.
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_HatchingGen::TrimFailed (const Standard_Boolean Flag)
|
||||
{
|
||||
myTrimFailed = Flag ;
|
||||
if (myTrimFailed) myStatus = HatchGen_TrimFailure ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : TrimFailed
|
||||
// Purpose : Returns the flag about the trimmings failure.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_HatchingGen::TrimFailed () const
|
||||
{
|
||||
return myTrimFailed ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : IsDone
|
||||
// Purpose : Sets the flag about the domains computation to the given
|
||||
// value.
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_HatchingGen::IsDone (const Standard_Boolean Flag)
|
||||
{
|
||||
myIsDone = Flag ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : IsDone
|
||||
// Purpose : Returns the flag about the domains computation.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean HatchGen_HatchingGen::IsDone () const
|
||||
{
|
||||
return myIsDone ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : SetStatus
|
||||
// Purpose : Sets the error status.
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_HatchingGen::Status (const HatchGen_ErrorStatus Status)
|
||||
{
|
||||
myStatus = Status ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Status
|
||||
// Purpose : Returns the error status.
|
||||
//=======================================================================
|
||||
|
||||
HatchGen_ErrorStatus HatchGen_HatchingGen::Status () const
|
||||
{
|
||||
return myStatus ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : AddPoint
|
||||
// Purpose : Adds an intersection point to the hatching.
|
||||
//=======================================================================
|
||||
|
||||
void HatchGen_HatchingGen::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 HatchGen_HatchingGen::NbPoints () const
|
||||
{
|
||||
return myPoints.Length () ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Point
|
||||
// Purpose : Returns the Index-th intersection point on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const HatchGen_PointOnHatching& HatchGen_HatchingGen::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& HatchGen_HatchingGen::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 HatchGen_HatchingGen::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 HatchGen_HatchingGen::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 HatchGen_HatchingGen::AddDomain (const HatchGen_Domain& Domain)
|
||||
{
|
||||
myDomains.Append (Domain) ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : NbDomains
|
||||
// Purpose : Returns the number of domains on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer HatchGen_HatchingGen::NbDomains () const
|
||||
{
|
||||
return myDomains.Length () ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : Domain
|
||||
// Purpose : Returns the Index-th domain on the hatching.
|
||||
//=======================================================================
|
||||
|
||||
const HatchGen_Domain& HatchGen_HatchingGen::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 HatchGen_HatchingGen::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 HatchGen_HatchingGen::ClrDomains ()
|
||||
{
|
||||
myDomains.Clear () ;
|
||||
myIsDone = Standard_False ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// Function : ClassificationPoint
|
||||
// Purpose : returns a 2d point on the curve
|
||||
//=======================================================================
|
||||
gp_Pnt2d HatchGen_HatchingGen::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