PageRenderTime 25ms CodeModel.GetById 17ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/src/contrib/geom-5.1.2.7/src/Partition/Partition_Inter3d.cdl

http://pythonocc.googlecode.com/
Unknown | 194 lines | 160 code | 34 blank | 0 comment | 0 complexity | f71d84b862e8d2baa8a5ab3a71fbdfbc MD5 | raw file
  1// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  2// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
  3// 
  4// This library is free software; you can redistribute it and/or
  5// modify it under the terms of the GNU Lesser General Public
  6// License as published by the Free Software Foundation; either 
  7// version 2.1 of the License.
  8// 
  9// This library is distributed in the hope that it will be useful 
 10// but WITHOUT ANY WARRANTY; without even the implied warranty of 
 11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 12// Lesser General Public License for more details.
 13//
 14// You should have received a copy of the GNU Lesser General Public  
 15// License along with this library; if not, write to the Free Software 
 16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 17//
 18-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 19//
 20--  GEOM PARTITION : partition algorithm
 21--
 22--  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 23--  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
 24-- 
 25--  This library is free software; you can redistribute it and/or 
 26--  modify it under the terms of the GNU Lesser General Public 
 27--  License as published by the Free Software Foundation; either 
 28--  version 2.1 of the License. 
 29-- 
 30--  This library is distributed in the hope that it will be useful, 
 31--  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 32--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 33--  Lesser General Public License for more details. 
 34-- 
 35--  You should have received a copy of the GNU Lesser General Public 
 36--  License along with this library; if not, write to the Free Software 
 37--  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 38-- 
 39-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 40--
 41--
 42--
 43--  File   : Partition_Inter3d.cdl
 44--  Author : Benedicte MARTIN
 45--  Module : GEOM
 46
 47class Inter3d from Partition 
 48
 49        ---Purpose: Computes the intersection face face in a set of faces
 50        --          Store the result in a SD as AsDes.
 51
 52uses
 53    Edge from TopoDS,
 54    Vertex from TopoDS,
 55    DataMapOfShapeShape       from TopTools,
 56    MapOfShape                from TopTools,
 57    Boolean                   from Standard,
 58    AsDes                     from BRepAlgo,
 59    Image                     from BRepAlgo,
 60    Shape                     from TopoDS,
 61    Face                      from TopoDS,
 62    ListOfShape               from TopTools,
 63    Real                      from Standard,
 64    State                     from TopAbs,
 65    DataMapOfShapeListOfShape from TopTools 
 66
 67is
 68    Create returns Inter3d from Partition;
 69    
 70    Create(AsDes : mutable AsDes from BRepAlgo);
 71
 72    CompletPart3d (me : in out; SetOfFaces1 : ListOfShape from TopTools;
 73                                FaceShapeMap: DataMapOfShapeShape from TopTools)
 74        is static;
 75
 76    FacesPartition (me : in out; F1, F2 : Face  from TopoDS)
 77        is static;
 78
 79        ----------------------------
 80        ---Category: Result Querying
 81        ----------------------------
 82
 83    IsDone(me ; F1,F2 : Face from TopoDS) 
 84        returns Boolean from Standard is static;
 85        ---Purpose: return True if F1-F2 pair has been processed
 86
 87    TouchedFaces(me : in out) returns MapOfShape from TopTools
 88        ---C++: return &
 89        is static;
 90        ---Purpose: return map of faces cut by new or section edges
 91
 92    NewEdges(me : in out) returns MapOfShape from TopTools
 93        ---C++:  return &
 94        is static;
 95        ---Purpose: return new and section edges
 96
 97    AsDes(me) returns AsDes from BRepAlgo
 98        is static;
 99        ---Purpose: return an object containing info about
100        --             Ascendants     | Descendants
101        --          ------------------+---------------------
102        --          1. faces          | edges cutting them
103        --          2. sectoin edges  | new vertices on them
104
105
106        -------------------------------
107        ---Category: Same domain shapes
108        -------------------------------
109
110    HasSameDomainF(me; F : Shape from TopoDS)
111        returns Boolean from Standard;
112        ---Purpose: Return true if F has same domain faces
113    
114    IsSameDomainF(me; F1, F2 : Shape from TopoDS)
115        returns Boolean from Standard;
116        ---Purpose: Return true if F1 and F2 are same domain faces
117    
118    SameDomain(me; F : Face from TopoDS)
119        returns ListOfShape from TopTools;
120        ---C++:  return const &
121        ---Purpose: Return same domain faces of F
122    
123    ReplaceSameDomainV (me; V : Vertex from TopoDS;
124                            E : Edge   from TopoDS)
125        returns Vertex from TopoDS;
126        ---Purpose: return same domain vertex of  V if it was replaced
127        --          and make this vertex to be on E too, else return V
128
129        --------------------------
130        ---Category: Section edges
131        --------------------------
132
133    SectionEdgesAD (me) returns AsDes from BRepAlgo
134        is static;
135    
136    IsSectionEdge (me; E : Edge from TopoDS) 
137        returns Boolean from Standard;
138        ---Purpose: return True if E is an edge of an initial face and
139        --          E intersects aother face
140    
141    HasSectionEdge (me; F : Face from TopoDS)
142        returns Boolean from Standard;
143        ---Purpose: return True if  F  is  intersected  by  an edge of 
144        --          other face
145
146    IsSplitOn (me; NewE, OldE : Edge from TopoDS;
147                   F : Face from TopoDS)
148        returns Boolean from Standard;
149        ---Purpose: return True if NewE is split of OldE on F;
150        --          no check if NewE is split of OldE :)
151    
152    SectionEdgeFaces (me; SecE : Edge from TopoDS)
153        returns ListOfShape from TopTools;
154        ---C++:  return const&
155        ---Purpose: return faces cut by section edge
156    
157        --------------------
158        ---Category: Private
159        --------------------
160
161    Inter3D (me: in out; F1, F2 :        Face        from TopoDS;
162                         LInt   : in out ListOfShape from TopTools)
163        is static private;
164    
165    StorePart3d(me : in out; F1,F2 : Face        from TopoDS;
166                             LInt1 : ListOfShape from TopTools)
167        is static private;    
168    
169    SetDone(me : in out; F1,F2 : Face from TopoDS)
170        is static private;
171
172    Affiche (me; SetOfFaces : ListOfShape from TopTools)
173        is static private;
174    
175fields
176
177    myAsDes        : AsDes                     from BRepAlgo;
178    myDone         : DataMapOfShapeListOfShape from TopTools;    
179    myTouched      : MapOfShape                from TopTools;
180    myNewEdges     : MapOfShape                from TopTools;
181
182        -- section edges: existing edges  that are intersection lines,
183        -- may be partially. 
184        -- Store as 
185        -- FACE -> SECTION EDGES, SECTION EDGE -> OTHER SECTION EDGE
186    mySectionEdgesAD : AsDes                   from BRepAlgo;
187    
188    -- same domain shapes
189     -- faces
190    mySameDomainFM : DataMapOfShapeListOfShape from TopTools;
191     -- vertex -> vertex replacement
192    mySameDomainVM : DataMapOfShapeShape       from TopTools;
193
194end Inter3d;