]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Improvements for gluing and new command GetShapesOnBox.
authorskl <skl@opencascade.com>
Thu, 7 Dec 2006 10:39:45 +0000 (10:39 +0000)
committerskl <skl@opencascade.com>
Thu, 7 Dec 2006 10:39:45 +0000 (10:39 +0000)
55 files changed:
src/GEOMAlgo/GEOMAlgo.cdl
src/GEOMAlgo/GEOMAlgo_Clsf.cdl [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_Clsf.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_Clsf.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_Clsf.ixx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_Clsf.jxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfBox.cdl [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfBox.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfBox.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfBox.ixx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfBox.jxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cdl [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfSurf.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfSurf.ixx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfSurf.jxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cdl [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.ixx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.jxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cdl
src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx
src/GEOMAlgo/GEOMAlgo_Gluer.cdl
src/GEOMAlgo/GEOMAlgo_Gluer.cxx
src/GEOMAlgo/GEOMAlgo_HAlgo.cdl [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_HAlgo.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_HAlgo.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_HAlgo.ixx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_HAlgo.jxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_0.cxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_0.cxx
src/GEOMAlgo/GEOMAlgo_PassKey.cdl
src/GEOMAlgo/GEOMAlgo_PassKey.cxx
src/GEOMAlgo/GEOMAlgo_PassKey.hxx
src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cdl
src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cxx
src/GEOMAlgo/GEOMAlgo_PassKeyShape.cdl
src/GEOMAlgo/GEOMAlgo_PassKeyShape.cxx
src/GEOMAlgo/GEOMAlgo_PassKeyShape.hxx
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cdl [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.ixx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.jxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_Tools.cdl
src/GEOMAlgo/GEOMAlgo_Tools.cxx
src/GEOMAlgo/Handle_GEOMAlgo_Clsf.hxx [new file with mode: 0644]
src/GEOMAlgo/Handle_GEOMAlgo_ClsfBox.hxx [new file with mode: 0644]
src/GEOMAlgo/Handle_GEOMAlgo_ClsfSurf.hxx [new file with mode: 0644]
src/GEOMAlgo/Handle_GEOMAlgo_HAlgo.hxx [new file with mode: 0644]
src/GEOMAlgo/Makefile.in

index 75e5b2106659506db8fa4a720df2cceee192efc5..f290d14d0c8f3cfc058cb9c12dbc77b7328666ee 100755 (executable)
@@ -40,14 +40,13 @@ uses
     IntTools, 
     BOPTools, 
     BOP, 
     IntTools, 
     BOPTools, 
     BOP, 
-    --||
+    
     TColStd, 
     BOPTColStd,  
     BRepAlgo, 
     NMTDS, 
     NMTTools 
     TColStd, 
     BOPTColStd,  
     BRepAlgo, 
     NMTDS, 
     NMTTools 
-    --||     
-
+    
 is   
     --
     -- enumerations 
 is   
     --
     -- enumerations 
@@ -60,10 +59,17 @@ is
        ST_ONIN, 
        ST_ONOUT, 
        ST_INOUT    
        ST_ONIN, 
        ST_ONOUT, 
        ST_INOUT    
-    end State;
+    end State; 
+    --
+    deferred class HAlgo;
+    deferred class Clsf;
+    class ClsfSurf; 
+    class ClsfBox; 
+    class FinderShapeOn2; 
+    class PassKeyShapeMapHasher; 
     -- 
     --  classes 
     -- 
     --  classes 
-    -- 
+    --  
     deferred class Algo;  
     deferred class ShapeAlgo;  
     -- 
     deferred class Algo;  
     deferred class ShapeAlgo;  
     -- 
@@ -74,6 +80,7 @@ is
     class PassKey;  
     class PassKeyMapHasher; 
     class PassKeyShape;  
     class PassKey;  
     class PassKeyMapHasher; 
     class PassKeyShape;  
+    
     class SurfaceTools; 
     class Tools;  
     --      
     class SurfaceTools; 
     class Tools;  
     --      
@@ -86,7 +93,8 @@ is
     class FinderShapeOn; 
     -- 
     class FinderShapeOn1;
     class FinderShapeOn; 
     -- 
     class FinderShapeOn1;
-    class StateCollector;
+    class StateCollector; 
+    
     --
     -- Builder/Splitter 
     deferred class BuilderShape; 
     --
     -- Builder/Splitter 
     deferred class BuilderShape; 
@@ -128,10 +136,7 @@ is
                                 MapRealHasher from TColStd);      
     --
     --  instantiations
                                 MapRealHasher from TColStd);      
     --
     --  instantiations
-    class IndexedDataMapOfPassKeyShapeListOfShape   
-       instantiates IndexedDataMap from TCollection (PassKeyShape from GEOMAlgo, 
-                                                     ListOfShape from TopTools, 
-                                                      PassKeyMapHasher from GEOMAlgo); 
+    
      
     class IndexedDataMapOfShapeBox  
        instantiates IndexedDataMap from TCollection    (Shape from TopoDS,
      
     class IndexedDataMapOfShapeBox  
        instantiates IndexedDataMap from TCollection    (Shape from TopoDS,
@@ -153,10 +158,14 @@ is
     class ListOfPnt  
        instantiates List from TCollection  (Pnt from gp);
 
     class ListOfPnt  
        instantiates List from TCollection  (Pnt from gp);
 
-                                              
-
     class DataMapOfPassKeyInteger   
        instantiates DataMap from TCollection (PassKey from GEOMAlgo, 
                                               Integer from Standard, 
     class DataMapOfPassKeyInteger   
        instantiates DataMap from TCollection (PassKey from GEOMAlgo, 
                                               Integer from Standard, 
-                                               PassKeyMapHasher from GEOMAlgo);
+                                               PassKeyMapHasher from GEOMAlgo); 
+     
+    class IndexedDataMapOfPassKeyShapeListOfShape   
+       instantiates IndexedDataMap from TCollection (PassKeyShape from GEOMAlgo, 
+                                                     ListOfShape from TopTools, 
+                                                      PassKeyShapeMapHasher from GEOMAlgo); 
+
 end GEOMAlgo;
 end GEOMAlgo;
diff --git a/src/GEOMAlgo/GEOMAlgo_Clsf.cdl b/src/GEOMAlgo/GEOMAlgo_Clsf.cdl
new file mode 100644 (file)
index 0000000..d32329d
--- /dev/null
@@ -0,0 +1,75 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File:       GEOMAlgo_Clsf.cdl
+-- Created:    Wed Nov 22 10:19:29 2006
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+deferred class Clsf from GEOMAlgo 
+    inherits HAlgo from GEOMAlgo 
+     
+       ---Purpose: 
+
+uses 
+    State from TopAbs,
+    Pnt from gp, 
+    Curve from Geom,
+    Surface from Geom 
+    
+--raises
+
+is 
+    Initialize 
+       returns mutable Clsf from GEOMAlgo; 
+    ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_Clsf();"  
+     
+    SetPnt(me:mutable; 
+           aP:Pnt from gp); 
+            
+    Pnt(me) 
+       returns Pnt from gp; 
+    ---C++:return const&        
+        
+    SetTolerance(me:mutable; 
+           aT:Real from Standard);  
+        
+    Tolerance(me) 
+       returns Real from Standard;       
+        
+    State(me) 
+       returns State from TopAbs; 
+        
+    CanBeON(me; 
+           aCT:Curve from Geom) 
+       returns Boolean from Standard 
+       is virtual;     
+
+    CanBeON(me; 
+           aST:Surface from Geom) 
+       returns Boolean from Standard 
+       is virtual;     
+       
+fields 
+    myState    :State from TopAbs is protected;
+    myPnt      :Pnt from gp is protected;
+    myTolerance:Real from Standard is protected; 
+
+end Clsf;
diff --git a/src/GEOMAlgo/GEOMAlgo_Clsf.cxx b/src/GEOMAlgo/GEOMAlgo_Clsf.cxx
new file mode 100644 (file)
index 0000000..91b1b2a
--- /dev/null
@@ -0,0 +1,102 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       GEOMAlgo_Classifier.cxx
+// Created:    Wed Nov 22 10:23:04 2006
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <GEOMAlgo_Clsf.ixx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_Clsf::GEOMAlgo_Clsf()
+:
+  GEOMAlgo_HAlgo()
+{
+  myState=TopAbs_UNKNOWN;
+  myPnt.SetCoord(99.,99.,99.);
+  myTolerance=0.0001;
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_Clsf::~GEOMAlgo_Clsf()
+{
+}
+//=======================================================================
+//function : SetTolerance
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_Clsf::SetTolerance(const Standard_Real aT)
+{
+  myTolerance=aT;
+}
+//=======================================================================
+//function : Tolerance
+//purpose  : 
+//=======================================================================
+  Standard_Real GEOMAlgo_Clsf::Tolerance()const
+{
+  return myTolerance;
+}
+//=======================================================================
+//function : SetPnt
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_Clsf::SetPnt(const gp_Pnt& aP)
+{
+  myPnt=aP;
+}
+//=======================================================================
+//function : Pnt
+//purpose  : 
+//=======================================================================
+  const gp_Pnt& GEOMAlgo_Clsf::Pnt()const
+{
+  return myPnt;
+}
+//=======================================================================
+//function : State
+//purpose  : 
+//=======================================================================
+  TopAbs_State GEOMAlgo_Clsf::State() const
+{
+  return myState;
+}
+//=======================================================================
+//function : CanBeON
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_Clsf::CanBeON(const Handle(Geom_Curve)& ) const
+{
+  return Standard_True;
+}
+//=======================================================================
+//function : CanBeON
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_Clsf::CanBeON(const Handle(Geom_Surface)& ) const
+{
+  return Standard_True;
+}
diff --git a/src/GEOMAlgo/GEOMAlgo_Clsf.hxx b/src/GEOMAlgo/GEOMAlgo_Clsf.hxx
new file mode 100644 (file)
index 0000000..3b2c43a
--- /dev/null
@@ -0,0 +1,130 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_Clsf_HeaderFile
+#define _GEOMAlgo_Clsf_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
+#include <Handle_GEOMAlgo_Clsf.hxx>
+#endif
+
+#ifndef _TopAbs_State_HeaderFile
+#include <TopAbs_State.hxx>
+#endif
+#ifndef _gp_Pnt_HeaderFile
+#include <gp_Pnt.hxx>
+#endif
+#ifndef _Standard_Real_HeaderFile
+#include <Standard_Real.hxx>
+#endif
+#ifndef _GEOMAlgo_HAlgo_HeaderFile
+#include <GEOMAlgo_HAlgo.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+#ifndef _Handle_Geom_Curve_HeaderFile
+#include <Handle_Geom_Curve.hxx>
+#endif
+#ifndef _Handle_Geom_Surface_HeaderFile
+#include <Handle_Geom_Surface.hxx>
+#endif
+class gp_Pnt;
+class Geom_Curve;
+class Geom_Surface;
+
+
+
+class GEOMAlgo_Clsf : public GEOMAlgo_HAlgo {
+
+public:
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT   void SetPnt(const gp_Pnt& aP) ;
+
+
+Standard_EXPORT  const gp_Pnt& Pnt() const;
+
+
+Standard_EXPORT   void SetTolerance(const Standard_Real aT) ;
+
+
+Standard_EXPORT   Standard_Real Tolerance() const;
+
+
+Standard_EXPORT   TopAbs_State State() const;
+
+
+Standard_EXPORT virtual  Standard_Boolean CanBeON(const Handle(Geom_Curve)& aCT) const;
+
+
+Standard_EXPORT virtual  Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
+//Standard_EXPORT ~GEOMAlgo_Clsf();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean           IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT GEOMAlgo_Clsf();
+Standard_EXPORT virtual ~GEOMAlgo_Clsf();
+
+
+ // Fields PROTECTED
+ //
+TopAbs_State myState;
+gp_Pnt myPnt;
+Standard_Real myTolerance;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_Clsf.ixx b/src/GEOMAlgo/GEOMAlgo_Clsf.ixx
new file mode 100644 (file)
index 0000000..bb7371f
--- /dev/null
@@ -0,0 +1,73 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_Clsf.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+//GEOMAlgo_Clsf::~GEOMAlgo_Clsf() {}
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_Clsf_Type_()
+{
+
+    static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_HAlgo);
+  static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
+  static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
+
+  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
+  static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_Clsf",
+                                                        sizeof(GEOMAlgo_Clsf),
+                                                        1,
+                                                        (Standard_Address)_Ancestors,
+                                                        (Standard_Address)NULL);
+
+  return _aType;
+}
+
+
+// DownCast method
+//   allow safe downcasting
+//
+const Handle(GEOMAlgo_Clsf) Handle(GEOMAlgo_Clsf)::DownCast(const Handle(Standard_Transient)& AnObject) 
+{
+  Handle(GEOMAlgo_Clsf) _anOtherObject;
+
+  if (!AnObject.IsNull()) {
+     if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_Clsf))) {
+       _anOtherObject = Handle(GEOMAlgo_Clsf)((Handle(GEOMAlgo_Clsf)&)AnObject);
+     }
+  }
+
+  return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_Clsf::DynamicType() const 
+{ 
+  return STANDARD_TYPE(GEOMAlgo_Clsf) ; 
+}
+//Standard_Boolean GEOMAlgo_Clsf::IsKind(const Handle(Standard_Type)& AType) const 
+//{ 
+//  return (STANDARD_TYPE(GEOMAlgo_Clsf) == AType || GEOMAlgo_HAlgo::IsKind(AType)); 
+//}
+//Handle_GEOMAlgo_Clsf::~Handle_GEOMAlgo_Clsf() {}
+
diff --git a/src/GEOMAlgo/GEOMAlgo_Clsf.jxx b/src/GEOMAlgo/GEOMAlgo_Clsf.jxx
new file mode 100644 (file)
index 0000000..775a638
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _gp_Pnt_HeaderFile
+#include <gp_Pnt.hxx>
+#endif
+#ifndef _Geom_Curve_HeaderFile
+#include <Geom_Curve.hxx>
+#endif
+#ifndef _Geom_Surface_HeaderFile
+#include <Geom_Surface.hxx>
+#endif
+#ifndef _GEOMAlgo_Clsf_HeaderFile
+#include <GEOMAlgo_Clsf.hxx>
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfBox.cdl b/src/GEOMAlgo/GEOMAlgo_ClsfBox.cdl
new file mode 100644 (file)
index 0000000..21c385d
--- /dev/null
@@ -0,0 +1,70 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-- 
+-- File:       GEOMAlgo_ClsfBox.cdl
+-- Created:    Wed Nov 22 10:19:29 2006
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class ClsfBox from GEOMAlgo 
+    inherits Clsf from GEOMAlgo 
+     
+       ---Purpose: 
+
+uses 
+    Shape from TopoDS, 
+    Curve   from Geom, 
+    Surface from Geom,
+    Surface from GeomAdaptor
+
+--raises
+
+is 
+    Create 
+       returns mutable ClsfBox from GEOMAlgo; 
+    ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ClsfBox();"  
+      
+    SetBox(me:mutable; 
+           aS:Shape from TopoDS);  
+        
+    Box(me) 
+       returns Shape from TopoDS; 
+    ---C++: return const &     
+     
+    Perform(me:mutable) 
+       is redefined;      
+
+    CheckData(me:mutable) 
+       is redefined;  
+        
+    CanBeON(me; 
+           aC:Curve from Geom) 
+       returns Boolean from Standard 
+       is redefined;  
+     
+    CanBeON(me; 
+           aST:Surface from Geom) 
+       returns Boolean from Standard 
+       is redefined;   
+    
+fields 
+    myBox : Shape from TopoDS is protected; 
+    myGAS : Surface from GeomAdaptor [6] is protected;
+end ClsfBox;
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfBox.cxx b/src/GEOMAlgo/GEOMAlgo_ClsfBox.cxx
new file mode 100644 (file)
index 0000000..1abad54
--- /dev/null
@@ -0,0 +1,216 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       GEOMAlgo_ClsfSurf.cxx
+// Created:    Wed Nov 22 10:41:47 2006
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <GEOMAlgo_ClsfBox.ixx>
+#include <GeomAbs_SurfaceType.hxx>
+#include <GEOMAlgo_SurfaceTools.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopExp.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS.hxx>
+#include <Geom_Surface.hxx>
+#include <BRep_Tool.hxx>
+#include <Geom_Plane.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Ax1.hxx>
+#include <Geom_Plane.hxx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_ClsfBox::GEOMAlgo_ClsfBox()
+:
+  GEOMAlgo_Clsf()
+{
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_ClsfBox::~GEOMAlgo_ClsfBox()
+{
+}
+//=======================================================================
+//function : SetBox
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_ClsfBox::SetBox(const TopoDS_Shape& aBox)
+{
+  myBox=aBox;
+}
+//=======================================================================
+//function : Box
+//purpose  : 
+//=======================================================================
+  const TopoDS_Shape& GEOMAlgo_ClsfBox::Box() const
+{
+  return myBox;
+}
+//=======================================================================
+//function : CheckData
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_ClsfBox::CheckData()
+{ 
+  Standard_Integer i, aNbF;
+  TopAbs_ShapeEnum aTypeShape;
+  TopAbs_Orientation aOr;
+  GeomAbs_SurfaceType aType;
+  Handle(Geom_Surface) aS;
+  TopTools_IndexedMapOfShape aMF;
+  //
+  myErrorStatus=0;
+  //
+  if(myBox.IsNull()) {
+    myErrorStatus=10; // myBox=NULL
+    return;
+  }
+  //
+  aTypeShape=myBox.ShapeType();
+  if (aTypeShape!=TopAbs_SOLID) {
+    myErrorStatus=11; // unallowed shape type
+    return;
+  }
+  //
+  TopExp::MapShapes(myBox, TopAbs_FACE, aMF);
+  aNbF=aMF.Extent();
+  if (aNbF!=6) {
+    myErrorStatus=12; // wrong number of faces
+    return;
+  }
+  //
+  for (i=1; i<=aNbF; ++i) {
+    const TopoDS_Face& aF=TopoDS::Face(aMF(i));
+    aOr=aF.Orientation();
+    if (!(aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED)) {
+      myErrorStatus=12; // unallowed orientation of face
+      return;
+    }
+    //
+    aS=BRep_Tool::Surface(aF);
+    myGAS[i-1].Load(aS);
+    aType=myGAS[i-1].GetType();
+    if (!aType==GeomAbs_Plane) { 
+      myErrorStatus=13; // unallowed surface type
+      return;
+    }
+    //
+    if(aOr==TopAbs_REVERSED) {
+      gp_Ax1 aAx1;
+      gp_Pln aPln;
+      gp_Pnt aP;
+      gp_Dir aD;
+      Handle(Geom_Plane) aSR;
+      //
+      aPln=myGAS[i-1].Plane();
+      aAx1=aPln.Axis();
+      aP=aAx1.Location();
+      aD=aAx1.Direction();
+      aD.Reverse();
+      aSR=new Geom_Plane(aP, aD);
+      myGAS[i-1].Load(aSR);
+    }
+  }
+}
+//=======================================================================
+//function : Perform
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_ClsfBox::Perform()
+{
+  myErrorStatus=0;
+  //
+  const Standard_Integer aNbS=6;
+  Standard_Integer i, aNbON, aNbIN, iNext;
+  TopAbs_State aSt;
+  /*
+  CheckData();
+  if(myErrorStatus) {
+    return;
+  }
+  */
+  iNext=1;
+  aNbON=0; 
+  aNbIN=0;
+  for(i=0; i<aNbS && iNext; i++) {
+    GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS[i], myTolerance, aSt);
+    //
+    switch (aSt) {
+      case TopAbs_OUT:
+        myState=aSt;
+       iNext=0;
+       break;
+      case TopAbs_ON:
+       ++aNbON;
+       break;
+      case TopAbs_IN:
+       ++aNbIN;
+       break;
+      default:
+       myState=TopAbs_UNKNOWN;
+       iNext=0;
+       break; 
+    }
+  }
+  //
+  if (iNext) {
+    myState=TopAbs_UNKNOWN;
+    //
+    if (aNbON && aNbIN) {
+      myState=TopAbs_ON;
+    }
+    else if (aNbIN==aNbS){
+      myState=TopAbs_IN;
+    }
+  }
+}
+//=======================================================================
+//function : CanBeON
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_ClsfBox::CanBeON(const Handle(Geom_Curve)& aC) const
+{
+  return GEOMAlgo_Clsf::CanBeON(aC);
+}
+//=======================================================================
+//function : CanBeON
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_ClsfBox::CanBeON(const Handle(Geom_Surface)& aS1) const
+{
+  Standard_Boolean bRet;
+  GeomAbs_SurfaceType  aST1;
+  GeomAdaptor_Surface aGAS1;
+  //
+  aGAS1.Load(aS1);
+  aST1=aGAS1.GetType();
+  bRet=(aST1==GeomAbs_Plane);
+  //
+  return bRet;
+}
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfBox.hxx b/src/GEOMAlgo/GEOMAlgo_ClsfBox.hxx
new file mode 100644 (file)
index 0000000..2a0dc75
--- /dev/null
@@ -0,0 +1,123 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_ClsfBox_HeaderFile
+#define _GEOMAlgo_ClsfBox_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_ClsfBox_HeaderFile
+#include <Handle_GEOMAlgo_ClsfBox.hxx>
+#endif
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _GeomAdaptor_Surface_HeaderFile
+#include <GeomAdaptor_Surface.hxx>
+#endif
+#ifndef _GEOMAlgo_Clsf_HeaderFile
+#include <GEOMAlgo_Clsf.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+#ifndef _Handle_Geom_Curve_HeaderFile
+#include <Handle_Geom_Curve.hxx>
+#endif
+#ifndef _Handle_Geom_Surface_HeaderFile
+#include <Handle_Geom_Surface.hxx>
+#endif
+class TopoDS_Shape;
+class Geom_Curve;
+class Geom_Surface;
+
+
+
+class GEOMAlgo_ClsfBox : public GEOMAlgo_Clsf {
+
+public:
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT GEOMAlgo_ClsfBox();
+Standard_EXPORT virtual ~GEOMAlgo_ClsfBox();
+
+
+Standard_EXPORT   void SetBox(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT  const TopoDS_Shape& Box() const;
+
+
+Standard_EXPORT virtual  void Perform() ;
+
+
+Standard_EXPORT virtual  void CheckData() ;
+
+
+Standard_EXPORT virtual  Standard_Boolean CanBeON(const Handle(Geom_Curve)& aC) const;
+
+
+Standard_EXPORT virtual  Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
+//Standard_EXPORT ~GEOMAlgo_ClsfBox();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean           IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+TopoDS_Shape myBox;
+GeomAdaptor_Surface myGAS[6];
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfBox.ixx b/src/GEOMAlgo/GEOMAlgo_ClsfBox.ixx
new file mode 100644 (file)
index 0000000..8406273
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_ClsfBox.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+//GEOMAlgo_ClsfBox::~GEOMAlgo_ClsfBox() {}
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_ClsfBox_Type_()
+{
+
+    static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_Clsf);
+  static Handle_Standard_Type aType2 = STANDARD_TYPE(GEOMAlgo_HAlgo);
+  static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
+  static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
+
+  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
+  static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfBox",
+                                                        sizeof(GEOMAlgo_ClsfBox),
+                                                        1,
+                                                        (Standard_Address)_Ancestors,
+                                                        (Standard_Address)NULL);
+
+  return _aType;
+}
+
+
+// DownCast method
+//   allow safe downcasting
+//
+const Handle(GEOMAlgo_ClsfBox) Handle(GEOMAlgo_ClsfBox)::DownCast(const Handle(Standard_Transient)& AnObject) 
+{
+  Handle(GEOMAlgo_ClsfBox) _anOtherObject;
+
+  if (!AnObject.IsNull()) {
+     if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_ClsfBox))) {
+       _anOtherObject = Handle(GEOMAlgo_ClsfBox)((Handle(GEOMAlgo_ClsfBox)&)AnObject);
+     }
+  }
+
+  return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_ClsfBox::DynamicType() const 
+{ 
+  return STANDARD_TYPE(GEOMAlgo_ClsfBox) ; 
+}
+//Standard_Boolean GEOMAlgo_ClsfBox::IsKind(const Handle(Standard_Type)& AType) const 
+//{ 
+//  return (STANDARD_TYPE(GEOMAlgo_ClsfBox) == AType || GEOMAlgo_Clsf::IsKind(AType)); 
+//}
+//Handle_GEOMAlgo_ClsfBox::~Handle_GEOMAlgo_ClsfBox() {}
+
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfBox.jxx b/src/GEOMAlgo/GEOMAlgo_ClsfBox.jxx
new file mode 100644 (file)
index 0000000..dfcc229
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _Geom_Curve_HeaderFile
+#include <Geom_Curve.hxx>
+#endif
+#ifndef _Geom_Surface_HeaderFile
+#include <Geom_Surface.hxx>
+#endif
+#ifndef _GEOMAlgo_ClsfBox_HeaderFile
+#include <GEOMAlgo_ClsfBox.hxx>
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfSurf.cdl b/src/GEOMAlgo/GEOMAlgo_ClsfSurf.cdl
new file mode 100644 (file)
index 0000000..15c0b69
--- /dev/null
@@ -0,0 +1,70 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-- 
+-- File:       GEOMAlgo_ClsfSurf.cdl
+-- Created:    Wed Nov 22 10:19:29 2006
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class ClsfSurf from GEOMAlgo 
+    inherits Clsf from GEOMAlgo 
+     
+       ---Purpose: 
+
+uses  
+    Curve   from Geom, 
+    Surface from Geom,
+    Surface from GeomAdaptor 
+    
+--raises
+
+is 
+    Create 
+       returns mutable ClsfSurf from GEOMAlgo; 
+    ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_ClsfSurf();"  
+      
+    SetSurface(me:mutable; 
+           aS:Surface from Geom);  
+        
+    Surface(me) 
+       returns Surface from Geom; 
+    ---C++: return const &     
+     
+    Perform(me:mutable) 
+       is redefined;      
+
+    CheckData(me:mutable) 
+       is redefined;  
+       
+    CanBeON(me; 
+           aC:Curve from Geom) 
+       returns Boolean from Standard 
+       is redefined; 
+
+    CanBeON(me; 
+           aST:Surface from Geom) 
+       returns Boolean from Standard 
+       is redefined;   
+        
+fields 
+    myS   : Surface from Geom is protected;   
+    myGAS : Surface from GeomAdaptor is protected; 
+    
+end ClsfSurf;
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfSurf.cxx b/src/GEOMAlgo/GEOMAlgo_ClsfSurf.cxx
new file mode 100644 (file)
index 0000000..a7b0509
--- /dev/null
@@ -0,0 +1,136 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       GEOMAlgo_ClsfSurf.cxx
+// Created:    Wed Nov 22 10:41:47 2006
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <GEOMAlgo_ClsfSurf.ixx>
+#include <GeomAbs_SurfaceType.hxx>
+#include <GEOMAlgo_SurfaceTools.hxx>
+#include <GeomAdaptor_Curve.hxx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_ClsfSurf::GEOMAlgo_ClsfSurf()
+:
+  GEOMAlgo_Clsf()
+{
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_ClsfSurf::~GEOMAlgo_ClsfSurf()
+{
+}
+//=======================================================================
+//function : SetSurface
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_ClsfSurf::SetSurface(const Handle(Geom_Surface)& aS)
+{
+  myS=aS;
+}
+//=======================================================================
+//function : Surface
+//purpose  : 
+//=======================================================================
+  const Handle(Geom_Surface)& GEOMAlgo_ClsfSurf::Surface() const
+{
+  return myS;
+}
+//=======================================================================
+//function : CheckData
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_ClsfSurf::CheckData()
+{
+  GeomAbs_SurfaceType aType;
+  //
+  myErrorStatus=0;
+  //
+  if(myS.IsNull()) {
+    myErrorStatus=10; // mySurface=NULL
+    return;
+  }
+  //
+  myGAS.Load(myS);
+  aType=myGAS.GetType();
+  if (!(aType==GeomAbs_Plane || 
+       aType==GeomAbs_Cylinder ||
+       aType==GeomAbs_Sphere)) {
+    myErrorStatus=11; // unallowed surface type
+  }
+}
+//=======================================================================
+//function : Perform
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_ClsfSurf::Perform()
+{
+  myErrorStatus=0;
+  /*
+  CheckData();
+  if(myErrorStatus) {
+    return;
+  }
+  */
+  GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS, myTolerance, myState);
+}
+//=======================================================================
+//function : CanBeON
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Curve)& aC) const
+{
+  GeomAbs_SurfaceType aST;
+  GeomAbs_CurveType aCT;
+  GeomAdaptor_Curve aGAC;
+  //
+  aGAC.Load(aC);
+  aCT=aGAC.GetType();
+  //
+  aST=myGAS.GetType();
+  if (aCT==GeomAbs_Line && aST==GeomAbs_Sphere) {
+    return Standard_False;
+  }
+  return Standard_True;
+}
+//=======================================================================
+//function : CanBeON
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_ClsfSurf::CanBeON(const Handle(Geom_Surface)& aS1) const
+{
+  Standard_Boolean bRet;
+  GeomAbs_SurfaceType aST, aST1;
+  GeomAdaptor_Surface aGAS1;
+  //
+  aST=myGAS.GetType();
+  aGAS1.Load(aS1);
+  aST1=aGAS1.GetType();
+  bRet=(aST1==aST);
+  //
+  return bRet;
+}
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfSurf.hxx b/src/GEOMAlgo/GEOMAlgo_ClsfSurf.hxx
new file mode 100644 (file)
index 0000000..f356295
--- /dev/null
@@ -0,0 +1,119 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_ClsfSurf_HeaderFile
+#define _GEOMAlgo_ClsfSurf_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_ClsfSurf_HeaderFile
+#include <Handle_GEOMAlgo_ClsfSurf.hxx>
+#endif
+
+#ifndef _Handle_Geom_Surface_HeaderFile
+#include <Handle_Geom_Surface.hxx>
+#endif
+#ifndef _GeomAdaptor_Surface_HeaderFile
+#include <GeomAdaptor_Surface.hxx>
+#endif
+#ifndef _GEOMAlgo_Clsf_HeaderFile
+#include <GEOMAlgo_Clsf.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+#ifndef _Handle_Geom_Curve_HeaderFile
+#include <Handle_Geom_Curve.hxx>
+#endif
+class Geom_Surface;
+class Geom_Curve;
+
+
+
+class GEOMAlgo_ClsfSurf : public GEOMAlgo_Clsf {
+
+public:
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT GEOMAlgo_ClsfSurf();
+Standard_EXPORT virtual ~GEOMAlgo_ClsfSurf();
+
+
+Standard_EXPORT   void SetSurface(const Handle(Geom_Surface)& aS) ;
+
+
+Standard_EXPORT  const Handle_Geom_Surface& Surface() const;
+
+
+Standard_EXPORT virtual  void Perform() ;
+
+
+Standard_EXPORT virtual  void CheckData() ;
+
+
+Standard_EXPORT virtual  Standard_Boolean CanBeON(const Handle(Geom_Curve)& aC) const;
+
+
+Standard_EXPORT virtual  Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
+//Standard_EXPORT ~GEOMAlgo_ClsfSurf();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean           IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+Handle_Geom_Surface myS;
+GeomAdaptor_Surface myGAS;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfSurf.ixx b/src/GEOMAlgo/GEOMAlgo_ClsfSurf.ixx
new file mode 100644 (file)
index 0000000..dadf131
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_ClsfSurf.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+//GEOMAlgo_ClsfSurf::~GEOMAlgo_ClsfSurf() {}
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_ClsfSurf_Type_()
+{
+
+    static Handle_Standard_Type aType1 = STANDARD_TYPE(GEOMAlgo_Clsf);
+  static Handle_Standard_Type aType2 = STANDARD_TYPE(GEOMAlgo_HAlgo);
+  static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
+  static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
+
+  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
+  static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_ClsfSurf",
+                                                        sizeof(GEOMAlgo_ClsfSurf),
+                                                        1,
+                                                        (Standard_Address)_Ancestors,
+                                                        (Standard_Address)NULL);
+
+  return _aType;
+}
+
+
+// DownCast method
+//   allow safe downcasting
+//
+const Handle(GEOMAlgo_ClsfSurf) Handle(GEOMAlgo_ClsfSurf)::DownCast(const Handle(Standard_Transient)& AnObject) 
+{
+  Handle(GEOMAlgo_ClsfSurf) _anOtherObject;
+
+  if (!AnObject.IsNull()) {
+     if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_ClsfSurf))) {
+       _anOtherObject = Handle(GEOMAlgo_ClsfSurf)((Handle(GEOMAlgo_ClsfSurf)&)AnObject);
+     }
+  }
+
+  return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_ClsfSurf::DynamicType() const 
+{ 
+  return STANDARD_TYPE(GEOMAlgo_ClsfSurf) ; 
+}
+//Standard_Boolean GEOMAlgo_ClsfSurf::IsKind(const Handle(Standard_Type)& AType) const 
+//{ 
+//  return (STANDARD_TYPE(GEOMAlgo_ClsfSurf) == AType || GEOMAlgo_Clsf::IsKind(AType)); 
+//}
+//Handle_GEOMAlgo_ClsfSurf::~Handle_GEOMAlgo_ClsfSurf() {}
+
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfSurf.jxx b/src/GEOMAlgo/GEOMAlgo_ClsfSurf.jxx
new file mode 100644 (file)
index 0000000..6d8048b
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Geom_Surface_HeaderFile
+#include <Geom_Surface.hxx>
+#endif
+#ifndef _Geom_Curve_HeaderFile
+#include <Geom_Curve.hxx>
+#endif
+#ifndef _GEOMAlgo_ClsfSurf_HeaderFile
+#include <GEOMAlgo_ClsfSurf.hxx>
+#endif
index 6a8f33bb4f711469c3e48b038ea4ad0c38d20f91..98f4afe30c84f438b2e6128ce2739b73ea79a58f 100644 (file)
 #include <BRepLib_MakeEdge.hxx>
 
 #include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
 #include <BRepLib_MakeEdge.hxx>
 
 #include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
-#include <GEOMAlgo_PassKey.hxx>
-#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
-#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
+
 #include <GEOMAlgo_SurfaceTools.hxx>
 #include <GEOMAlgo_StateCollector.hxx>
 
 #include <GEOMAlgo_SurfaceTools.hxx>
 #include <GEOMAlgo_StateCollector.hxx>
 
+#include <GEOMAlgo_PassKey.hxx>
+#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
 
 //=======================================================================
 //function : GEOMAlgo_FinderShapeOn1
 
 //=======================================================================
 //function : GEOMAlgo_FinderShapeOn1
@@ -529,8 +530,7 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
 {
   myErrorStatus=0;
   //
 {
   myErrorStatus=0;
   //
-  Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNbMax, aNb;
-  Standard_Integer iCnt, *pIds;
+  Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds;
   TopLoc_Location aLoc;
   Handle(Poly_Triangulation) aTRF;
   TColStd_MapOfInteger aMBN;
   TopLoc_Location aLoc;
   Handle(Poly_Triangulation) aTRF;
   TColStd_MapOfInteger aMBN;
@@ -578,12 +578,20 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
     iCnt=aIt.Value();
     if (iCnt==1) {
       const GEOMAlgo_PassKey& aPK=aIt.Key();
     iCnt=aIt.Value();
     if (iCnt==1) {
       const GEOMAlgo_PassKey& aPK=aIt.Key();
+      //qf
+      /*
       aNbMax=aPK.NbMax();
       pIds=(Standard_Integer*)aPK.Key();
       for (k=1; k<3; ++k) {
        aNx=*(pIds+aNbMax-k);
        aMBN.Add(aNx);
       }
       aNbMax=aPK.NbMax();
       pIds=(Standard_Integer*)aPK.Key();
       for (k=1; k<3; ++k) {
        aNx=*(pIds+aNbMax-k);
        aMBN.Add(aNx);
       }
+      */
+      aNx=(Standard_Integer)aPK.Id(1);
+      aMBN.Add(aNx);
+      aNx=(Standard_Integer)aPK.Id(2);
+      aMBN.Add(aNx);
+      //qt
     }
   }
   //
     }
   }
   //
@@ -620,10 +628,17 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
          // take the first having occured inner link
          // and discretize it
          const GEOMAlgo_PassKey& aPK=aIt.Key();
          // take the first having occured inner link
          // and discretize it
          const GEOMAlgo_PassKey& aPK=aIt.Key();
+         //qf
+         /*
          aNbMax=aPK.NbMax();
          pIds=(Standard_Integer*)aPK.Key();
          aN1=*(pIds+aNbMax-1);
          aN2=*(pIds+aNbMax-2);
          aNbMax=aPK.NbMax();
          pIds=(Standard_Integer*)aPK.Key();
          aN1=*(pIds+aNbMax-1);
          aN2=*(pIds+aNbMax-2);
+         */
+         //
+         aN1=(Standard_Integer)aPK.Id(1);
+         aN2=(Standard_Integer)aPK.Id(2);
+         //qt
          aP1=aNodes(aN1).Transformed(aTrsf);
          aP2=aNodes(aN2).Transformed(aTrsf);
          //
          aP1=aNodes(aN1).Transformed(aTrsf);
          aP2=aNodes(aN2).Transformed(aTrsf);
          //
diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cdl b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cdl
new file mode 100644 (file)
index 0000000..c0a1b92
--- /dev/null
@@ -0,0 +1,138 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File:       GEOMAlgo_FinderShapeOn1.cdl
+-- Created:    Fri Mar  4 10:26:54 2005
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class FinderShapeOn2 from GEOMAlgo  
+    inherits ShapeAlgo from GEOMAlgo 
+
+       ---Purpose: 
+
+uses 
+    Pnt from gp,
+    ShapeEnum from TopAbs, 
+    State from TopAbs,
+    Face from TopoDS, 
+    Edge from TopoDS, 
+    ListOfShape from TopTools,  
+     
+    State from GEOMAlgo, 
+    ListOfPnt from GEOMAlgo, 
+    IndexedDataMapOfShapeState from GEOMAlgo, 
+    Clsf from GEOMAlgo 
+    
+--raises
+
+is 
+    Create   
+       returns FinderShapeOn2 from GEOMAlgo; 
+    ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn2();" 
+
+    SetClsf(me:out; 
+           aClsf:Clsf from GEOMAlgo); 
+        
+    Clsf(me) 
+       returns Clsf from GEOMAlgo;  
+    ---C++: return const &  
+     
+    SetShapeType(me:out; 
+           aST:ShapeEnum from TopAbs); 
+        
+    ShapeType(me) 
+       returns ShapeEnum from TopAbs; 
+     
+    SetState(me:out; 
+           aSF:State from GEOMAlgo);      
+     
+    State(me)
+       returns State from GEOMAlgo;        
+     
+    SetNbPntsMin(me:out; 
+           aNb:Integer from Standard);   
+
+    NbPntsMin(me) 
+       returns Integer from Standard; 
+        
+    SetNbPntsMax(me:out; 
+           aNb:Integer from Standard);   
+
+    NbPntsMax(me) 
+       returns Integer from Standard; 
+        
+    Perform(me:out) 
+       is redefined; 
+        
+    Shapes(me)
+       returns ListOfShape from TopTools; 
+    ---C++: return const &  
+    -- 
+    --  protected  methods
+    -- 
+    CheckData(me:out) 
+       is redefined protected; 
+        
+    ProcessVertices(me:out) 
+       is protected; 
+     
+    ProcessEdges(me:out) 
+       is protected; 
+  
+    ProcessFaces(me:out) 
+       is protected; 
+        
+    ProcessSolids(me:out) 
+       is protected; 
+         
+    InnerPoints(me:out; 
+           aF :Face from TopoDS;            
+           aLP:out ListOfPnt from GEOMAlgo) 
+       is protected;  
+        
+    InnerPoints(me:out; 
+           aE :Edge from TopoDS;            
+           aLP:out ListOfPnt from GEOMAlgo) 
+       is protected; 
+        
+    InnerPoints(me:out; 
+           aE :Edge from TopoDS;            
+           aNbPnts: Integer from Standard;     
+           aLP:out ListOfPnt from GEOMAlgo) 
+       is protected;  
+      
+    MSS (me)  
+       returns IndexedDataMapOfShapeState from GEOMAlgo; 
+    ---C++:return const &      
+    
+    
+fields
+    myShapeType : ShapeEnum from TopAbs is protected;  
+    myState     : State from GEOMAlgo is protected;  
+    myNbPntsMin : Integer from Standard is protected;   
+    myNbPntsMax : Integer from Standard is protected; 
+    myClsf      : Clsf    from GEOMAlgo is protected;   
+    -- 
+    myLS        : ListOfShape from TopTools is protected; 
+    --     
+    myMSS       : IndexedDataMapOfShapeState from GEOMAlgo is protected;
+end FinderShapeOn2;
diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
new file mode 100644 (file)
index 0000000..8a386d0
--- /dev/null
@@ -0,0 +1,821 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       GEOMAlgo_FinderShapeOn1.cxx
+// Created:    Fri Mar  4 10:31:06 2005
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <GEOMAlgo_FinderShapeOn2.ixx>
+#include <math.h>
+
+
+#include <Precision.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
+
+#include <gp_Trsf.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Pnt.hxx>
+
+#include <TColgp_Array1OfPnt.hxx>
+
+#include <Poly_Array1OfTriangle.hxx>
+#include <Poly_Triangle.hxx>
+#include <Poly_PolygonOnTriangulation.hxx>
+#include <Poly_Triangulation.hxx>
+
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomAdaptor_Surface.hxx>
+#include <GeomAbs_SurfaceType.hxx>
+#include <GeomAdaptor_Curve.hxx>
+#include <GeomAbs_CurveType.hxx>
+
+#include <TopAbs_State.hxx>
+
+#include <TopLoc_Location.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Edge.hxx>
+
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <TopTools_IndexedMapOfShape.hxx>
+
+#include <BRep_Tool.hxx>
+#include <BRepLib_MakeEdge.hxx>
+
+#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
+
+#include <GEOMAlgo_SurfaceTools.hxx>
+#include <GEOMAlgo_StateCollector.hxx>
+
+#include <GEOMAlgo_PassKey.hxx>
+#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
+
+//=======================================================================
+//function : GEOMAlgo_FinderShapeOn1
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_FinderShapeOn2::GEOMAlgo_FinderShapeOn2()
+:
+  GEOMAlgo_ShapeAlgo()
+{
+  myTolerance=0.0001;
+  myShapeType=TopAbs_VERTEX;
+  myState=GEOMAlgo_ST_UNKNOWN;
+  myNbPntsMin=3;
+  myNbPntsMax=0;
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_FinderShapeOn2::~GEOMAlgo_FinderShapeOn2()
+{
+}
+//=======================================================================
+//function : SetClsf
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::SetClsf(const Handle(GEOMAlgo_Clsf)& aClsf)
+{
+  myClsf=aClsf;
+}
+//=======================================================================
+//function : Clsf
+//purpose  : 
+//=======================================================================
+  const Handle(GEOMAlgo_Clsf)& GEOMAlgo_FinderShapeOn2::Clsf() const
+{
+  return myClsf;
+}
+//=======================================================================
+//function : SetShapeType
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::SetShapeType(const TopAbs_ShapeEnum aType)
+{
+  myShapeType=aType;
+}
+//=======================================================================
+//function : ShapeType
+//purpose  : 
+//=======================================================================
+  TopAbs_ShapeEnum GEOMAlgo_FinderShapeOn2::ShapeType()const
+{
+  return myShapeType;
+}
+//=======================================================================
+//function : SetState
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::SetState(const GEOMAlgo_State aState)
+{
+  myState=aState;
+}
+//=======================================================================
+//function : State
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_State GEOMAlgo_FinderShapeOn2::State() const
+{
+  return myState;
+}
+//=======================================================================
+//function : SetNbPntsMin
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::SetNbPntsMin(const Standard_Integer aNb)
+{
+  myNbPntsMin=aNb;
+}
+//=======================================================================
+//function : NbPntsMin
+//purpose  : 
+//=======================================================================
+  Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMin()const
+{
+  return myNbPntsMin;
+}
+//=======================================================================
+//function : SetNbPntsMax
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::SetNbPntsMax(const Standard_Integer aNb)
+{
+  myNbPntsMax=aNb;
+}
+//=======================================================================
+//function : NbPntsMax
+//purpose  : 
+//=======================================================================
+  Standard_Integer GEOMAlgo_FinderShapeOn2::NbPntsMax()const
+{
+  return myNbPntsMax;
+}
+//=======================================================================
+// function: MSS
+// purpose: 
+//=======================================================================
+  const GEOMAlgo_IndexedDataMapOfShapeState& GEOMAlgo_FinderShapeOn2::MSS() const
+{
+  return myMSS;
+}
+//=======================================================================
+// function: Shapes
+// purpose: 
+//=======================================================================
+  const TopTools_ListOfShape& GEOMAlgo_FinderShapeOn2::Shapes() const
+{
+  Standard_Integer i, aNb;
+  TopTools_ListOfShape* pL;
+  //
+  pL=(TopTools_ListOfShape*) &myLS;
+  pL->Clear();
+  //
+  aNb=myMSS.Extent();
+  for (i=1; i<=aNb; ++i) {
+    const TopoDS_Shape& aS=myMSS.FindKey(i);
+    if (aS.ShapeType()==myShapeType) {
+      pL->Append(aS);
+    }
+  }
+  return myLS;
+}
+//=======================================================================
+//function : Perform
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::Perform()
+{
+  myErrorStatus=0;
+  myWarningStatus=0;
+  myLS.Clear();
+  myMSS.Clear();
+  //
+  CheckData();
+  if(myErrorStatus) {
+    return;
+  }
+  //
+  myClsf->SetTolerance(myTolerance);
+  //
+  // 1
+  ProcessVertices();
+  if(myErrorStatus) {
+    return;
+  }
+  if (myShapeType==TopAbs_VERTEX) {
+    return;
+  }
+  //
+  // 2
+  ProcessEdges();
+  if(myErrorStatus) {
+    return;
+  }
+  if (myShapeType==TopAbs_EDGE) {
+    return;
+  }
+  //
+  // 3
+  ProcessFaces();
+  if(myErrorStatus) {
+    return;
+  }
+  if (myShapeType==TopAbs_FACE) {
+    return;
+  }
+  //
+  // 4
+  ProcessSolids(); 
+  //
+}
+//=======================================================================
+//function : CheckData
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::CheckData()
+{
+  Standard_Integer iErr;
+  //
+  myErrorStatus=0;
+  //
+  if(myClsf.IsNull()) {
+    myErrorStatus=10; // myClsf=NULL
+    return;
+  }
+  //
+  myClsf->CheckData();
+  iErr=myClsf->ErrorStatus();
+  if (iErr) {
+    myErrorStatus=41; // invalid data for classifier
+    return;
+  }
+  //
+  if (myShape.IsNull()) {
+    myErrorStatus=11; // myShape=NULL
+    return;
+  }
+  //
+  if (!(myShapeType==TopAbs_VERTEX ||
+       myShapeType==TopAbs_EDGE ||
+       myShapeType==TopAbs_FACE ||
+       myShapeType==TopAbs_SOLID)) {
+    myErrorStatus=12; // unallowed subshape type
+    return;
+  }
+  //
+  if (myState==GEOMAlgo_ST_UNKNOWN || 
+      myState==GEOMAlgo_ST_INOUT) {
+    myErrorStatus=13; // unallowed state type
+    return;
+  }
+}
+//=======================================================================
+//function : ProcessVertices
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::ProcessVertices()
+{
+  myErrorStatus=0;
+  //
+  Standard_Boolean bIsConformState;
+  Standard_Integer i, aNb, iErr;
+  gp_Pnt aP;
+  TopTools_IndexedMapOfShape aM;
+  TopAbs_State aSt;
+  //
+  TopExp::MapShapes(myShape, TopAbs_VERTEX, aM);
+  aNb=aM.Extent();
+  for (i=1; i<=aNb; ++i) {
+    const TopoDS_Vertex& aV=TopoDS::Vertex(aM(i));
+    aP=BRep_Tool::Pnt(aV);
+    //
+    myClsf->SetPnt(aP);
+    myClsf->Perform();
+    iErr=myClsf->ErrorStatus();
+    if (iErr) {
+      myErrorStatus=40; // point can not be classified
+      return;
+    }
+    //
+    aSt=myClsf->State();
+    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
+    //
+    if (myShapeType==TopAbs_VERTEX){
+      if (bIsConformState) {
+       myMSS.Add(aV, aSt);
+      }
+    }
+    else if (bIsConformState || aSt==TopAbs_ON) {
+      myMSS.Add(aV, aSt);
+    }
+  }
+}
+//=======================================================================
+//function : ProcessEdges
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::ProcessEdges()
+{
+  myErrorStatus=0;
+  //
+  Standard_Boolean bIsConformState, bIsToBreak;
+  Standard_Integer i, aNb, iCnt, iErr;
+  TopAbs_State aSt;
+  TopTools_IndexedMapOfShape aM;
+  TopExp_Explorer aExp;
+  GEOMAlgo_ListIteratorOfListOfPnt aIt;
+  //
+  TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
+  aNb=aM.Extent();
+  for (i=1; i<=aNb; ++i) {
+    GEOMAlgo_ListOfPnt aLP;
+    GEOMAlgo_StateCollector aSC;
+    //
+    const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
+    //
+    aExp.Init(aE, TopAbs_VERTEX);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aV=aExp.Current();
+      //
+      bIsConformState=myMSS.Contains(aV);
+      if (!bIsConformState) {
+       break;// vertex has non-conformed state
+      }
+      else {
+       aSt=myMSS.FindFromKey(aV);
+       aSC.AppendState(aSt);
+      }
+    }
+    //
+    if (!bIsConformState) {
+      continue; // vertex has non-conformed state,skip edge
+    }
+    //
+    if (BRep_Tool::Degenerated(aE)) {
+      myMSS.Add(aE, aSt); 
+      continue;
+    }
+    //
+    if (myState==GEOMAlgo_ST_ON) {
+      Standard_Boolean bCanBeON;
+      Standard_Real aT1, aT2;
+      Handle(Geom_Curve) aC; 
+      //
+      aC=BRep_Tool::Curve(aE, aT1, aT2);
+      bCanBeON=myClsf->CanBeON(aC);
+      if(!bCanBeON) {
+       continue;
+      }
+    }
+    //
+    InnerPoints(aE, aLP);
+    if (myErrorStatus) {
+      return;  
+    }
+    //
+    bIsConformState=Standard_True;
+    aIt.Initialize(aLP);
+    for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
+      if (myNbPntsMax) {
+       if (iCnt > myNbPntsMax) {
+         break;
+       }
+      }
+      //
+      const gp_Pnt& aP=aIt.Value();
+      //
+      myClsf->SetPnt(aP);
+      myClsf->Perform();
+      iErr=myClsf->ErrorStatus();
+      if (iErr) {
+       myErrorStatus=40; // point can not be classified
+       return;
+      }
+      //
+      aSt=myClsf->State();
+      //
+      bIsToBreak=aSC.AppendState(aSt);
+      if (bIsToBreak) {
+       break;
+      }
+    }
+    //
+    aSt=aSC.State();    
+    //
+    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
+    if (myShapeType==TopAbs_EDGE) {
+      if (bIsConformState) {
+       myMSS.Add(aE, aSt);
+      }
+    }
+    else if (bIsConformState || aSt==TopAbs_ON) {
+      myMSS.Add(aE, aSt);
+    }
+  } //  for (i=1; i<=aNb; ++i) next edge 
+}
+//=======================================================================
+//function : ProcessFaces
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::ProcessFaces()
+{
+  myErrorStatus=0;
+  //
+  Standard_Boolean bIsConformState, bIsToBreak, bCanBeON;
+  Standard_Integer i, aNbF, iCnt, iErr;
+  TopAbs_State aSt;
+  TopTools_IndexedMapOfShape aM;
+  TopExp_Explorer aExp;
+  GEOMAlgo_ListIteratorOfListOfPnt aIt;
+  //
+  TopExp::MapShapes(myShape, TopAbs_FACE, aM);
+  aNbF=aM.Extent();
+  for (i=1; i<=aNbF; ++i) {
+    GEOMAlgo_StateCollector aSC;
+    GEOMAlgo_ListOfPnt aLP;
+    //
+    const TopoDS_Face& aF=TopoDS::Face(aM(i));
+    //
+    if (myState==GEOMAlgo_ST_ON) {
+      Handle(Geom_Surface) aS;
+      //
+      aS=BRep_Tool::Surface(aF);
+      bCanBeON=myClsf->CanBeON(aS);
+      if(!bCanBeON) {
+       continue;
+      }
+    }
+    //
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      const TopoDS_Shape& aE=aExp.Current();
+      bIsConformState=myMSS.Contains(aE);
+      if (!bIsConformState) {
+       break;// edge has non-conformed state
+      }
+      else {
+       aSt=myMSS.FindFromKey(aE);
+       aSC.AppendState(aSt);
+      }
+    }
+    //
+    if (!bIsConformState) {
+      continue; // edge has non-conformed state,skip face
+    }
+    //
+    InnerPoints(aF, aLP);
+    if (myErrorStatus) {
+      return;
+    }
+    //
+    bIsConformState=Standard_True;
+    aIt.Initialize(aLP);
+    for (iCnt=0; aIt.More(); aIt.Next(), ++iCnt) {
+      if (myNbPntsMax) {
+       if (iCnt > myNbPntsMax) {
+         break;
+       }
+      }
+      //
+      const gp_Pnt& aP=aIt.Value();
+      //
+      myClsf->SetPnt(aP);
+      myClsf->Perform();
+      iErr=myClsf->ErrorStatus();
+      if (iErr) {
+       myErrorStatus=40; // point can not be classified
+       return;
+      }
+      //
+      aSt=myClsf->State();
+      //
+      bIsToBreak=aSC.AppendState(aSt);
+      if (bIsToBreak) {
+       break;
+      }
+    }
+    //
+    aSt=aSC.State();    
+    //
+    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
+    if (myShapeType==TopAbs_FACE) {
+      if (bIsConformState) {
+       myMSS.Add(aF, aSt);
+      }
+    }
+    else if (bIsConformState || aSt==TopAbs_ON) {
+      myMSS.Add(aF, aSt);
+    }
+  }//  for (i=1; i<=aNb; ++i) next face 
+}
+//=======================================================================
+//function : ProcessSolids
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::ProcessSolids()
+{
+  myErrorStatus=0;
+  //
+  Standard_Boolean bIsConformState;
+  Standard_Integer i, aNbS, j, aNbF;
+  TopTools_IndexedMapOfShape aM, aMF;
+  TopAbs_State aSt;
+  //
+  TopExp::MapShapes(myShape, TopAbs_SOLID, aM);
+  aNbS=aM.Extent();
+  for (i=1; i<=aNbS; ++i) {
+    GEOMAlgo_StateCollector aSC;
+    //
+    const TopoDS_Shape& aSd=aM(i);
+    aMF.Clear();
+    TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
+    aNbF=aMF.Extent();
+    for (j=1; j<=aNbF; ++j) {
+      const TopoDS_Shape& aF=aMF(j);
+      bIsConformState=myMSS.Contains(aF);
+      if (!bIsConformState) {
+       break;// face has non-conformed state
+      }
+      else {
+       aSt=myMSS.FindFromKey(aF);
+       aSC.AppendState(aSt);
+      }
+    }
+    //
+    if (!bIsConformState) {
+      continue; // face has non-conformed state,skip solid
+    }
+    //
+    aSt=aSC.State();    
+    //
+    bIsConformState=GEOMAlgo_SurfaceTools::IsConformState(aSt, myState);
+    if (bIsConformState) {
+      myMSS.Add(aSd, aSt);
+    }
+  }
+}
+//
+//=======================================================================
+//function : InnerPoints
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
+                                         GEOMAlgo_ListOfPnt& aLP)
+{
+  myErrorStatus=0;
+  //
+  Standard_Integer j, j1, j2, k, n[4], aNbLinks, aNx, aNb, iCnt;//, aNbMax, *pIds;
+  TopLoc_Location aLoc;
+  Handle(Poly_Triangulation) aTRF;
+  TColStd_MapOfInteger aMBN;
+  GEOMAlgo_DataMapOfPassKeyInteger aMPKI;
+  GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger aIt;
+  gp_Pnt aP, aP1, aP2;
+  //
+  aLP.Clear();
+  //
+  aTRF=BRep_Tool::Triangulation(aF, aLoc);
+  if (aTRF.IsNull()) {
+    myErrorStatus=20; // no triangulation found
+    return;  
+  }
+  //
+  const gp_Trsf& aTrsf=aLoc.Transformation();
+  const Poly_Array1OfTriangle& aTrs=aTRF->Triangles();
+  const TColgp_Array1OfPnt& aNodes=aTRF->Nodes();
+  //
+  // map link/nbtriangles
+  j1=aTrs.Lower();
+  j2=aTrs.Upper();
+  for (j=j1; j<=j2; ++j) {
+    const Poly_Triangle& aTr=aTrs(j);
+    aTr.Get(n[0], n[1], n[2]);
+    n[3]=n[0];
+    for (k=0; k<3; ++k) {
+      GEOMAlgo_PassKey aPK;
+      //
+      aPK.SetIds(n[k], n[k+1]);
+      if (aMPKI.IsBound(aPK)) {
+       Standard_Integer& iCntX=aMPKI.ChangeFind(aPK);
+       ++iCntX;
+      }
+      else {
+       aMPKI.Bind(aPK, 1);
+      }
+    }
+  }
+  //
+  // boundary nodes aMBN
+  aNbLinks=aMPKI.Extent();
+  aIt.Initialize(aMPKI);
+  for (; aIt.More(); aIt.Next()) {
+    iCnt=aIt.Value();
+    if (iCnt==1) {
+      const GEOMAlgo_PassKey& aPK=aIt.Key();
+      //qf
+      /*
+      aNbMax=aPK.NbMax();
+      pIds=(Standard_Integer*)aPK.Key();
+      for (k=1; k<3; ++k) {
+       aNx=*(pIds+aNbMax-k);
+       aMBN.Add(aNx);
+      }
+      */
+      aNx=(Standard_Integer)aPK.Id(1);
+      aMBN.Add(aNx);
+      aNx=(Standard_Integer)aPK.Id(2);
+      aMBN.Add(aNx);
+      //qt
+    }
+  }
+  //
+  // inner nodes=all_nodes - boundary_nodes 
+  j1=aNodes.Lower();
+  j2=aNodes.Upper();
+  for (j=j1; j<=j2; ++j) {
+    if (!aMBN.Contains(j)) {
+      aP=aNodes(j).Transformed(aTrsf);
+      aLP.Append(aP);
+    }
+  }
+  //
+  aNb=aLP.Extent();
+  //
+  if (!aNb && myNbPntsMin) { 
+    // try to fill it yourself
+    Standard_Boolean bIsDone;
+    Standard_Integer aN1, aN2;
+    Handle(Geom_Surface) aS;
+    GeomAdaptor_Surface aGAS;
+    GeomAbs_SurfaceType aType;
+    //
+    aS=BRep_Tool::Surface(aF);
+    aGAS.Load(aS);
+    aType=aGAS.GetType();
+    if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
+      // inner links
+      aNbLinks=aMPKI.Extent();
+      aIt.Initialize(aMPKI);
+      for (; aIt.More(); aIt.Next()) {
+       iCnt=aIt.Value();
+       if (iCnt>1) {
+         // take the first having occured inner link
+         // and discretize it
+         const GEOMAlgo_PassKey& aPK=aIt.Key();
+         //qf
+         /*
+         aNbMax=aPK.NbMax();
+         pIds=(Standard_Integer*)aPK.Key();
+         aN1=*(pIds+aNbMax-1);
+         aN2=*(pIds+aNbMax-2);
+         */
+         //
+         aN1=(Standard_Integer)aPK.Id(1);
+         aN2=(Standard_Integer)aPK.Id(2);
+         //qt
+         aP1=aNodes(aN1).Transformed(aTrsf);
+         aP2=aNodes(aN2).Transformed(aTrsf);
+         //
+         if (aType==GeomAbs_Cylinder) {
+           Standard_Real aTolSM;
+           gp_Cylinder aCyl;
+           //
+           aTolSM=1.523e-6;//~1.-cos(0.1 deg)
+           aCyl=aGAS.Cylinder();
+           if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, aTolSM)) {
+             continue;
+           }
+         }
+         //
+         BRepLib_MakeEdge aBME(aP1, aP2);
+         bIsDone=aBME.IsDone();
+         if (!bIsDone) {
+           myErrorStatus=30; //can not obtain the line fron the link
+           return;
+         }
+         //
+         const TopoDS_Shape& aSx=aBME.Shape();
+         const TopoDS_Edge& aE=TopoDS::Edge(aSx);
+         //
+         InnerPoints(aE, myNbPntsMin, aLP);
+         break;
+       }// if (iCnt>1)
+      }// for (; aIt.More(); aIt.Next())
+    }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) 
+  }// if (!aNb && myNbPntsMin) { 
+}
+//=======================================================================
+//function : InnerPoints
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
+                                         GEOMAlgo_ListOfPnt& aLP)
+{
+  myErrorStatus=0;
+  //
+  Standard_Integer j, aNbNodes, aIndex, aNb;
+  Handle(Poly_PolygonOnTriangulation) aPTE;
+  Handle(Poly_Triangulation) aTRE;
+  TopLoc_Location aLoc;
+  gp_Pnt aP;
+  //
+  aLP.Clear();
+  BRep_Tool::PolygonOnTriangulation(aE, aPTE, aTRE, aLoc);
+  if (aTRE.IsNull() || aPTE.IsNull()) {
+    myErrorStatus=20; // no triangulation found
+    return;  
+  }
+  //
+  const gp_Trsf& aTrsf=aLoc.Transformation();
+  const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
+  //
+  aNbNodes=aPTE->NbNodes();
+  const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
+  for (j=2; j<aNbNodes; ++j) {
+    aIndex=aInds(j);
+    aP=aNodes(aIndex).Transformed(aTrsf);
+    aLP.Append(aP);
+  }
+  //
+  aNb=aLP.Extent();
+  if (!aNb && myNbPntsMin) { 
+    // try to fill it yourself
+    InnerPoints(aE, myNbPntsMin, aLP);
+    aNb=aLP.Extent();
+    
+  }
+}
+//=======================================================================
+//function : InnerPoints
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
+                                         const Standard_Integer aNbPntsMin,
+                                         GEOMAlgo_ListOfPnt& aLP)
+{
+  // try to fill it yourself
+  Standard_Boolean bInf1, bInf2;
+  Standard_Integer j, aNbT;
+  Standard_Real dT, aT, aT1, aT2;
+  gp_Pnt aP;
+  Handle(Geom_Curve) aC3D;
+  //
+  aC3D=BRep_Tool::Curve(aE, aT1, aT2);
+  if (aC3D.IsNull()) {
+    return;
+  }
+  //
+  bInf1=Precision::IsNegativeInfinite(aT1);
+  bInf2=Precision::IsPositiveInfinite(aT2);
+  if (bInf1 || bInf2) {
+    return;
+  }
+  //
+  aNbT=myNbPntsMin+1;
+  dT=(aT2-aT1)/aNbT;
+  for (j=1; j<=aNbPntsMin; ++j) {
+    aT=aT1+j*dT;
+    aC3D->D0(aT, aP);
+    aLP.Append(aP);
+  }
+}
+
+//
+// myErrorStatus :
+//
+// 10 -myClsf=NULL
+// 11 -myShape=NULL
+// 12 -unallowed type of subshapes 
+// 13 -unallowed state  
+// 15 -unallowed surface type
+// 20- no triangulation found
+// 30- can not obtain the line from the link
+// 40- point can not be classified
+// 41- invalid data for classifier
+
diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx
new file mode 100644 (file)
index 0000000..1d467a5
--- /dev/null
@@ -0,0 +1,187 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_FinderShapeOn2_HeaderFile
+#define _GEOMAlgo_FinderShapeOn2_HeaderFile
+
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+#ifndef _GEOMAlgo_State_HeaderFile
+#include <GEOMAlgo_State.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
+#include <Handle_GEOMAlgo_Clsf.hxx>
+#endif
+#ifndef _TopTools_ListOfShape_HeaderFile
+#include <TopTools_ListOfShape.hxx>
+#endif
+#ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
+#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
+#endif
+#ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
+#include <GEOMAlgo_ShapeAlgo.hxx>
+#endif
+class GEOMAlgo_Clsf;
+class TopTools_ListOfShape;
+class TopoDS_Face;
+class GEOMAlgo_ListOfPnt;
+class TopoDS_Edge;
+class GEOMAlgo_IndexedDataMapOfShapeState;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_FinderShapeOn2  : public GEOMAlgo_ShapeAlgo {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT GEOMAlgo_FinderShapeOn2();
+Standard_EXPORT virtual ~GEOMAlgo_FinderShapeOn2();
+
+
+Standard_EXPORT   void SetClsf(const Handle(GEOMAlgo_Clsf)& aClsf) ;
+
+
+Standard_EXPORT  const Handle_GEOMAlgo_Clsf& Clsf() const;
+
+
+Standard_EXPORT   void SetShapeType(const TopAbs_ShapeEnum aST) ;
+
+
+Standard_EXPORT   TopAbs_ShapeEnum ShapeType() const;
+
+
+Standard_EXPORT   void SetState(const GEOMAlgo_State aSF) ;
+
+
+Standard_EXPORT   GEOMAlgo_State State() const;
+
+
+Standard_EXPORT   void SetNbPntsMin(const Standard_Integer aNb) ;
+
+
+Standard_EXPORT   Standard_Integer NbPntsMin() const;
+
+
+Standard_EXPORT   void SetNbPntsMax(const Standard_Integer aNb) ;
+
+
+Standard_EXPORT   Standard_Integer NbPntsMax() const;
+
+
+Standard_EXPORT virtual  void Perform() ;
+
+
+Standard_EXPORT  const TopTools_ListOfShape& Shapes() const;
+
+
+Standard_EXPORT  const GEOMAlgo_IndexedDataMapOfShapeState& MSS() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT virtual  void CheckData() ;
+
+
+Standard_EXPORT   void ProcessVertices() ;
+
+
+Standard_EXPORT   void ProcessEdges() ;
+
+
+Standard_EXPORT   void ProcessFaces() ;
+
+
+Standard_EXPORT   void ProcessSolids() ;
+
+
+Standard_EXPORT   void InnerPoints(const TopoDS_Face& aF,GEOMAlgo_ListOfPnt& aLP) ;
+
+
+Standard_EXPORT   void InnerPoints(const TopoDS_Edge& aE,GEOMAlgo_ListOfPnt& aLP) ;
+
+
+Standard_EXPORT   void InnerPoints(const TopoDS_Edge& aE,const Standard_Integer aNbPnts,GEOMAlgo_ListOfPnt& aLP) ;
+
+
+ // Fields PROTECTED
+ //
+TopAbs_ShapeEnum myShapeType;
+GEOMAlgo_State myState;
+Standard_Integer myNbPntsMin;
+Standard_Integer myNbPntsMax;
+Handle_GEOMAlgo_Clsf myClsf;
+TopTools_ListOfShape myLS;
+GEOMAlgo_IndexedDataMapOfShapeState myMSS;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.ixx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.ixx
new file mode 100644 (file)
index 0000000..9e17577
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_FinderShapeOn2.jxx>
+
+
+
diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.jxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.jxx
new file mode 100644 (file)
index 0000000..62172c4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_Clsf_HeaderFile
+#include <GEOMAlgo_Clsf.hxx>
+#endif
+#ifndef _TopTools_ListOfShape_HeaderFile
+#include <TopTools_ListOfShape.hxx>
+#endif
+#ifndef _TopoDS_Face_HeaderFile
+#include <TopoDS_Face.hxx>
+#endif
+#ifndef _GEOMAlgo_ListOfPnt_HeaderFile
+#include <GEOMAlgo_ListOfPnt.hxx>
+#endif
+#ifndef _TopoDS_Edge_HeaderFile
+#include <TopoDS_Edge.hxx>
+#endif
+#ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile
+#include <GEOMAlgo_IndexedDataMapOfShapeState.hxx>
+#endif
+#ifndef _GEOMAlgo_FinderShapeOn2_HeaderFile
+#include <GEOMAlgo_FinderShapeOn2.hxx>
+#endif
index 26fadda0a461ed55db9abb256e41384202ebb3eb..97dd6f476e6d21dae33f1a727e62686c9ac26244 100644 (file)
@@ -21,7 +21,6 @@
 -- Created:    Wed Dec 15 11:03:03 2004
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 -- Created:    Wed Dec 15 11:03:03 2004
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
----Copyright:   Matra Datavision 2004
 
 
 class GlueAnalyser from GEOMAlgo 
 
 
 class GlueAnalyser from GEOMAlgo 
index b8aff729447a4d523fd29e67088ed5ad081fa2a1..e38911f5beb2fda9240df57693695a66d4bc831a 100644 (file)
   for (i=1; i<=aNbF; ++i) {
     const TopoDS_Shape& aS=aMF(i);
     // 
   for (i=1; i<=aNbF; ++i) {
     const TopoDS_Shape& aS=aMF(i);
     // 
-    aPKF.Clear();
+    //aPKF.Clear();//qft
     if (aType==TopAbs_FACE) {
       const TopoDS_Face& aF=TopoDS::Face(aS);
       FacePassKey(aF, aPKF);
     if (aType==TopAbs_FACE) {
       const TopoDS_Face& aF=TopoDS::Face(aS);
       FacePassKey(aF, aPKF);
   TopTools_IndexedDataMapOfShapeListOfShape aMFS;
   TopTools_IndexedMapOfShape aMx, aMS;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
   TopTools_IndexedDataMapOfShapeListOfShape aMFS;
   TopTools_IndexedMapOfShape aMx, aMS;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
+  GEOMAlgo_CoupleOfShapes aCS;
+  //
   GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLS;
   GEOMAlgo_PassKeyShape aPKSx;
   GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLS;
   GEOMAlgo_PassKeyShape aPKSx;
-  GEOMAlgo_CoupleOfShapes aCS;
   //
   aBB.MakeCompound(aCmp);
   //
   //
   aBB.MakeCompound(aCmp);
   //
       continue;
     }
     //
       continue;
     }
     //
-    aPKSx.Clear();
-    aPKSx.SetIds(aSx[0], aSx[1]);
+    //aPKSx.Clear();//qft
+    //qf
+    //aPKSx.SetIds(aSx[0], aSx[1]);
+    aPKSx.SetShapes(aSx[0], aSx[1]);
+    //qt
     //
     if (!aMPKLS.Contains(aPKSx)) {
       TopTools_ListOfShape aLSx;
     //
     if (!aMPKLS.Contains(aPKSx)) {
       TopTools_ListOfShape aLSx;
index 9b213cb3e4c9feb826f6d7f7d4b5eddf9a780359..fe629e68b6cbff1682bc94adf85ed152a7f896ca 100755 (executable)
@@ -21,7 +21,6 @@
 -- Created:    Sat Dec 04 12:41:32 2004
 -- Author:     Peter KURNEV
 --             <peter@PREFEX>
 -- Created:    Sat Dec 04 12:41:32 2004
 -- Author:     Peter KURNEV
 --             <peter@PREFEX>
----Copyright:   Matra Datavision 2004
 
 
 class Gluer from GEOMAlgo  
 
 
 class Gluer from GEOMAlgo  
@@ -106,12 +105,12 @@ is
  
     EdgePassKey(me:out; 
            aE:Edge from TopoDS;  
  
     EdgePassKey(me:out; 
            aE:Edge from TopoDS;  
-           aPK:out PassKeyShape from GEOMAlgo) 
+           aPK:out PassKeyShape from GEOMAlgo)  
        is protected;     
    
     FacePassKey(me:out; 
            aF:Face from TopoDS;  
        is protected;     
    
     FacePassKey(me:out; 
            aF:Face from TopoDS;  
-           aPK:out PassKeyShape from GEOMAlgo) 
+           aPK:out PassKeyShape from GEOMAlgo)  
        is protected; 
         
     MakeVertex(me:out; 
        is protected; 
         
     MakeVertex(me:out; 
index 1e6d31e6bb956356ce18108147abd2a72e90e36d..cb2b0d424b5b0e11c0ae13e39b467df609c97977 100755 (executable)
@@ -77,8 +77,8 @@
 
 #include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
 #include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
 
 #include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
 #include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
-#include <GEOMAlgo_PassKeyShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx> //qft
+#include <GEOMAlgo_PassKeyShape.hxx>//qft
 #include <GEOMAlgo_Tools.hxx>
 //
 
 #include <GEOMAlgo_Tools.hxx>
 //
 
@@ -424,8 +424,8 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
   TopoDS_Shape aNewShape;
   TopTools_IndexedMapOfShape aMF;
   TopTools_ListIteratorOfListOfShape aItS;
   TopoDS_Shape aNewShape;
   TopTools_IndexedMapOfShape aMF;
   TopTools_ListIteratorOfListOfShape aItS;
-  GEOMAlgo_PassKeyShape aPKF;
-  GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF;
+  GEOMAlgo_PassKeyShape aPKF;//qft
+  GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF;//qft
   //
   TopExp::MapShapes(myShape, aType, aMF);
   //
   //
   TopExp::MapShapes(myShape, aType, aMF);
   //
@@ -433,7 +433,7 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
   for (i=1; i<=aNbF; ++i) {
     const TopoDS_Shape& aS=aMF(i);
     // 
   for (i=1; i<=aNbF; ++i) {
     const TopoDS_Shape& aS=aMF(i);
     // 
-    aPKF.Clear();
+    //aPKF.Clear();//qft
     if (aType==TopAbs_FACE) {
       const TopoDS_Face& aF=TopoDS::Face(aS);
       FacePassKey(aF, aPKF);
     if (aType==TopAbs_FACE) {
       const TopoDS_Face& aF=TopoDS::Face(aS);
       FacePassKey(aF, aPKF);
@@ -622,17 +622,21 @@ void GEOMAlgo_Gluer::InnerTolerance()
 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF, 
                                 GEOMAlgo_PassKeyShape& aPK)
 {
 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF, 
                                 GEOMAlgo_PassKeyShape& aPK)
 {
-  Standard_Integer i, aNbE, aNbMax;
+  Standard_Integer i, aNbE;//, aNbMax;//qft
   TopTools_ListOfShape aLE;
   TopTools_IndexedMapOfShape aME;
   //
   TopExp::MapShapes(aF, TopAbs_EDGE, aME);
   aNbE=aME.Extent();
   TopTools_ListOfShape aLE;
   TopTools_IndexedMapOfShape aME;
   //
   TopExp::MapShapes(aF, TopAbs_EDGE, aME);
   aNbE=aME.Extent();
+  //qf
+  /*
   aNbMax=aPK.NbMax();
   if (!aNbE || aNbE>aNbMax) {
   aNbMax=aPK.NbMax();
   if (!aNbE || aNbE>aNbMax) {
-     myErrorStatus=101; // temprorary
-     return;
+    myErrorStatus=101; // temprorary
+    return;
   }
   }
+  */
+  //qt
   //
   for (i=1; i<=aNbE; ++i) {
     const TopoDS_Shape& aE=aME(i);
   //
   for (i=1; i<=aNbE; ++i) {
     const TopoDS_Shape& aE=aME(i);
@@ -643,7 +647,10 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
     const TopoDS_Shape& aER=myOrigins.Find(aE);
     aLE.Append(aER);
   }
     const TopoDS_Shape& aER=myOrigins.Find(aE);
     aLE.Append(aER);
   }
-  aPK.SetIds(aLE);
+  //qf
+  //aPK.SetIds(aLE);
+  aPK.SetShapes(aLE);
+  //qt
 }
 //=======================================================================
 //function : EdgePassKey
 }
 //=======================================================================
 //function : EdgePassKey
@@ -662,7 +669,10 @@ void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
   }
   const TopoDS_Shape& aVR1=myOrigins.Find(aV1);
   const TopoDS_Shape& aVR2=myOrigins.Find(aV2);
   }
   const TopoDS_Shape& aVR1=myOrigins.Find(aV1);
   const TopoDS_Shape& aVR2=myOrigins.Find(aV2);
-  aPK.SetIds(aVR1, aVR2);
+  //qf
+  //aPK.SetIds(aVR1, aVR2);
+  aPK.SetShapes(aVR1, aVR2);
+  //qt
 }
 //=======================================================================
 //function : MakeVertex
 }
 //=======================================================================
 //function : MakeVertex
diff --git a/src/GEOMAlgo/GEOMAlgo_HAlgo.cdl b/src/GEOMAlgo/GEOMAlgo_HAlgo.cdl
new file mode 100644 (file)
index 0000000..0da6348
--- /dev/null
@@ -0,0 +1,57 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File:       GEOMAlgo_Algo.cdl
+-- Created:    Sat Dec 04 12:37:56 2004
+-- Author:     Peter KURNEV
+--             <peter@PREFEX>
+
+
+deferred  class HAlgo from GEOMAlgo 
+    inherits TShared from MMgt   
+       ---Purpose: 
+
+--uses
+--raises
+
+is
+    Initialize 
+       returns mutable HAlgo from GEOMAlgo;  
+    ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_HAlgo();" 
+
+    Perform(me:mutable) 
+       is deferred;      
+
+    CheckData(me:mutable) 
+       is virtual;  
+       
+    CheckResult(me:mutable) 
+       is virtual;
+     
+    ErrorStatus (me) 
+       returns Integer from Standard; 
+  
+    WarningStatus (me) 
+       returns Integer from Standard;
+fields
+    myErrorStatus   : Integer from Standard  is protected;      
+    myWarningStatus : Integer from Standard  is protected;      
+end HAlgo;
diff --git a/src/GEOMAlgo/GEOMAlgo_HAlgo.cxx b/src/GEOMAlgo/GEOMAlgo_HAlgo.cxx
new file mode 100644 (file)
index 0000000..807929c
--- /dev/null
@@ -0,0 +1,78 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       GEOMAlgo_Algo.cxx
+// Created:    Sat Dec 04 12:39:47 2004
+// Author:     Peter KURNEV
+//             <peter@PREFEX>
+
+
+#include <GEOMAlgo_HAlgo.ixx>
+
+//=======================================================================
+// function: 
+// purpose: 
+//=======================================================================
+  GEOMAlgo_HAlgo::GEOMAlgo_HAlgo()
+:
+  myErrorStatus(1),
+  myWarningStatus(0)
+{}
+//=======================================================================
+// function: ~
+// purpose: 
+//=======================================================================
+  GEOMAlgo_HAlgo::~GEOMAlgo_HAlgo()
+{
+}
+//=======================================================================
+// function: CheckData
+// purpose: 
+//=======================================================================
+  void GEOMAlgo_HAlgo::CheckData()
+{
+  myErrorStatus=0;
+}
+//=======================================================================
+// function: CheckResult
+// purpose: 
+//=======================================================================
+  void GEOMAlgo_HAlgo::CheckResult()
+{
+  myErrorStatus=0;
+}
+//=======================================================================
+// function: ErrorStatus
+// purpose: 
+//=======================================================================
+  Standard_Integer GEOMAlgo_HAlgo::ErrorStatus()const
+{
+  return myErrorStatus;
+}
+//=======================================================================
+// function: WarningStatus
+// purpose: 
+//=======================================================================
+  Standard_Integer GEOMAlgo_HAlgo::WarningStatus()const
+{
+  return myWarningStatus;
+}
+//  myErrorStatus
+//
+// 1 - object is just initialized
diff --git a/src/GEOMAlgo/GEOMAlgo_HAlgo.hxx b/src/GEOMAlgo/GEOMAlgo_HAlgo.hxx
new file mode 100644 (file)
index 0000000..0f25b53
--- /dev/null
@@ -0,0 +1,105 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_HAlgo_HeaderFile
+#define _GEOMAlgo_HAlgo_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_GEOMAlgo_HAlgo_HeaderFile
+#include <Handle_GEOMAlgo_HAlgo.hxx>
+#endif
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _MMgt_TShared_HeaderFile
+#include <MMgt_TShared.hxx>
+#endif
+
+
+
+class GEOMAlgo_HAlgo : public MMgt_TShared {
+
+public:
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT virtual  void Perform()  = 0;
+
+
+Standard_EXPORT virtual  void CheckData() ;
+
+
+Standard_EXPORT virtual  void CheckResult() ;
+
+
+Standard_EXPORT   Standard_Integer ErrorStatus() const;
+
+
+Standard_EXPORT   Standard_Integer WarningStatus() const;
+//Standard_EXPORT ~GEOMAlgo_HAlgo();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean           IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT GEOMAlgo_HAlgo();
+Standard_EXPORT virtual ~GEOMAlgo_HAlgo();
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myErrorStatus;
+Standard_Integer myWarningStatus;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_HAlgo.ixx b/src/GEOMAlgo/GEOMAlgo_HAlgo.ixx
new file mode 100644 (file)
index 0000000..96a32ed
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_HAlgo.jxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+//GEOMAlgo_HAlgo::~GEOMAlgo_HAlgo() {}
+
+
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_HAlgo_Type_()
+{
+
+    static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
+  static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
+
+  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
+  static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_HAlgo",
+                                                        sizeof(GEOMAlgo_HAlgo),
+                                                        1,
+                                                        (Standard_Address)_Ancestors,
+                                                        (Standard_Address)NULL);
+
+  return _aType;
+}
+
+
+// DownCast method
+//   allow safe downcasting
+//
+const Handle(GEOMAlgo_HAlgo) Handle(GEOMAlgo_HAlgo)::DownCast(const Handle(Standard_Transient)& AnObject) 
+{
+  Handle(GEOMAlgo_HAlgo) _anOtherObject;
+
+  if (!AnObject.IsNull()) {
+     if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_HAlgo))) {
+       _anOtherObject = Handle(GEOMAlgo_HAlgo)((Handle(GEOMAlgo_HAlgo)&)AnObject);
+     }
+  }
+
+  return _anOtherObject ;
+}
+const Handle(Standard_Type)& GEOMAlgo_HAlgo::DynamicType() const 
+{ 
+  return STANDARD_TYPE(GEOMAlgo_HAlgo) ; 
+}
+//Standard_Boolean GEOMAlgo_HAlgo::IsKind(const Handle(Standard_Type)& AType) const 
+//{ 
+//  return (STANDARD_TYPE(GEOMAlgo_HAlgo) == AType || MMgt_TShared::IsKind(AType)); 
+//}
+//Handle_GEOMAlgo_HAlgo::~Handle_GEOMAlgo_HAlgo() {}
+
diff --git a/src/GEOMAlgo/GEOMAlgo_HAlgo.jxx b/src/GEOMAlgo/GEOMAlgo_HAlgo.jxx
new file mode 100644 (file)
index 0000000..e6d2040
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_HAlgo_HeaderFile
+#include <GEOMAlgo_HAlgo.hxx>
+#endif
index 4d5556d0d41920d6338ac3b6882be008d2737f40..ce1a5003a3151c19715503d099c6cb0aeef3abcc 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 class GEOMAlgo_PassKeyShape;
 class TopTools_ListOfShape;
 #endif
 class GEOMAlgo_PassKeyShape;
 class TopTools_ListOfShape;
-class GEOMAlgo_PassKeyMapHasher;
+class GEOMAlgo_PassKeyShapeMapHasher;
 class GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape;
 
 
 class GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape;
 
 
@@ -104,8 +104,8 @@ TCollection_MapNodePtr myNext2;
 #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
 #define TheItem TopTools_ListOfShape
 #define TheItem_hxx <TopTools_ListOfShape.hxx>
 #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
 #define TheItem TopTools_ListOfShape
 #define TheItem_hxx <TopTools_ListOfShape.hxx>
-#define Hasher GEOMAlgo_PassKeyMapHasher
-#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
 #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
index dbdb8ae8ae91f0b7bfb0b45dda24849d023b50e2..ddacd87621a1c7037e7ad1c32106d3af33c7cc55 100644 (file)
@@ -29,8 +29,8 @@
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
 #endif
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
 #endif
-#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
-#include <GEOMAlgo_PassKeyMapHasher.hxx>
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
 #endif
 #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
 #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #endif
 #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
 #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
@@ -86,8 +86,8 @@ const Handle(Standard_Type)& GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKe
 #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
 #define TheItem TopTools_ListOfShape
 #define TheItem_hxx <TopTools_ListOfShape.hxx>
 #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
 #define TheItem TopTools_ListOfShape
 #define TheItem_hxx <TopTools_ListOfShape.hxx>
-#define Hasher GEOMAlgo_PassKeyMapHasher
-#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
 #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
index df92465d189e8e6ba52903bbf97cf707a7102690..b27ee9a81640fdb38b1e9b5e97a5805055f4954f 100644 (file)
@@ -37,7 +37,7 @@ class Standard_OutOfRange;
 class Standard_NoSuchObject;
 class GEOMAlgo_PassKeyShape;
 class TopTools_ListOfShape;
 class Standard_NoSuchObject;
 class GEOMAlgo_PassKeyShape;
 class TopTools_ListOfShape;
-class GEOMAlgo_PassKeyMapHasher;
+class GEOMAlgo_PassKeyShapeMapHasher;
 class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape;
 
 
 class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape;
 
 
index cbd20e4f0dfc439902fdf8d8f2d2fed1f10d3496..ccd40ac2834e9ee5b439fcd40fabe59c674833a6 100644 (file)
@@ -34,8 +34,8 @@
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
 #endif
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
 #endif
-#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile
-#include <GEOMAlgo_PassKeyMapHasher.hxx>
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
 #endif
 #ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
 #include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #endif
 #ifndef _GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_HeaderFile
 #include <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
@@ -46,8 +46,8 @@
 #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
 #define TheItem TopTools_ListOfShape
 #define TheItem_hxx <TopTools_ListOfShape.hxx>
 #define TheKey_hxx <GEOMAlgo_PassKeyShape.hxx>
 #define TheItem TopTools_ListOfShape
 #define TheItem_hxx <TopTools_ListOfShape.hxx>
-#define Hasher GEOMAlgo_PassKeyMapHasher
-#define Hasher_hxx <GEOMAlgo_PassKeyMapHasher.hxx>
+#define Hasher GEOMAlgo_PassKeyShapeMapHasher
+#define Hasher_hxx <GEOMAlgo_PassKeyShapeMapHasher.hxx>
 #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
 #define TCollection_IndexedDataMapNode_hxx <GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx>
 #define Handle_TCollection_IndexedDataMapNode Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape
index 91aa0975172b6d6cbaf3bb89492d130b6c708fc7..8b84345a40101674cf141a4c77dfd540395ec443 100755 (executable)
 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 --
 -- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 --
 -- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
---
+-- 
 -- File:       GEOMAlgo_PassKey.cdl
 -- File:       GEOMAlgo_PassKey.cdl
--- Created:    
+-- Created:    Mon Nov 20 12:16:13 2006
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
----Copyright:   
 
 
 class PassKey from GEOMAlgo 
 
 
 class PassKey from GEOMAlgo 
@@ -30,25 +29,32 @@ class PassKey from GEOMAlgo
 
 uses
     Shape from TopoDS, 
 
 uses
     Shape from TopoDS, 
-    ListOfInteger from TColStd   
-        
+    IndexedMapOfInteger from TColStd, 
+    ListOfInteger from TColStd
+
 --raises
 
 is 
     Create  
        returns PassKey from GEOMAlgo; 
 --raises
 
 is 
     Create  
        returns PassKey from GEOMAlgo; 
+    ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_PassKey();" 
+     
+    Create(Other:PassKey from GEOMAlgo) 
+       returns PassKey from GEOMAlgo;
      
     Assign(me:out;  
            Other : PassKey from GEOMAlgo) 
        returns PassKey from GEOMAlgo; 
     ---C++: alias operator =
     ---C++: return & 
      
     Assign(me:out;  
            Other : PassKey from GEOMAlgo) 
        returns PassKey from GEOMAlgo; 
     ---C++: alias operator =
     ---C++: return & 
+            
+    Clear(me:out);
 --    
     SetIds(me:out; 
            aI1  :Integer from Standard); 
             
     SetIds(me:out; 
 --    
     SetIds(me:out; 
            aI1  :Integer from Standard); 
             
     SetIds(me:out; 
-           aI1 :Integer from Standard;    
+           aI1 :Integer from Standard; 
            aI2 :Integer from Standard);  
             
     SetIds(me:out; 
            aI2 :Integer from Standard);  
             
     SetIds(me:out; 
@@ -64,20 +70,13 @@ is
      
     SetIds(me:out;  
            aLS  :ListOfInteger from TColStd);   
      
     SetIds(me:out;  
            aLS  :ListOfInteger from TColStd);   
-    NbMax(me) 
+
+    NbIds(me) 
        returns Integer  from Standard; 
        returns Integer  from Standard; 
-        
-    Clear(me:out); 
-     
-    Compute(me:out); 
      
     IsEqual(me; 
            aOther:PassKey from GEOMAlgo) 
        returns Boolean from Standard;                       
      
     IsEqual(me; 
            aOther:PassKey from GEOMAlgo) 
        returns Boolean from Standard;                       
-
-    Key(me) 
-       returns Address from Standard;  
         
     HashCode(me; 
            Upper : Integer  from Standard)  
         
     HashCode(me; 
            Upper : Integer  from Standard)  
@@ -85,16 +84,16 @@ is
      
     Id(me; 
            aIndex: Integer  from Standard)  
      
     Id(me; 
            aIndex: Integer  from Standard)  
-       returns Integer from Standard;
+       returns  Integer from Standard;
        
 
        
 
-    Dump(me); 
-
+    Dump(me; 
+       aHex:Integer from Standard=0);  
+     
+       
 fields 
 fields 
     myNbIds: Integer from Standard is protected;  
     myNbIds: Integer from Standard is protected;  
-    myNbMax: Integer from Standard is protected; 
-    mySum  : Integer from Standard is protected;   
-    myIds  : Integer from Standard [8] is protected; 
+    mySum  : Integer from Standard is protected;  
+    myMap  : IndexedMapOfInteger from TColStd is protected; 
 
 end PassKey;
 
 end PassKey;
index f38e29f60c90917adb6c135ece64361b0c9afbdf..342a116f2e94db2bd3d858c6bcde1230083c1c18 100755 (executable)
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       GEOMAlgo_PassKey.cxx
-// Created:    
+//
+// File:       GEOMAlgo_Algo.cxx
+// Created:    Sat Dec 04 12:39:47 2004
 // Author:     Peter KURNEV
 // Author:     Peter KURNEV
-//             <pkv@irinox>
+//             <peter@PREFEX>
 
 
 #include <GEOMAlgo_PassKey.ixx>
 
 
 #include <GEOMAlgo_PassKey.ixx>
 #include <stdio.h>
 #include <string.h>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <stdio.h>
 #include <string.h>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
 
 #ifdef WNT
 #pragma warning( disable : 4101) 
 #endif
 
 
 #ifdef WNT
 #pragma warning( disable : 4101) 
 #endif
 
-static 
-  void SortShell(const int n, int* a); 
 static
   Standard_Integer NormalizedId(const Standard_Integer aId,
                                const Standard_Integer aDiv);
 static
   Standard_Integer NormalizedId(const Standard_Integer aId,
                                const Standard_Integer aDiv);
@@ -45,115 +45,102 @@ static
 //=======================================================================
   GEOMAlgo_PassKey::GEOMAlgo_PassKey()
 {
 //=======================================================================
   GEOMAlgo_PassKey::GEOMAlgo_PassKey()
 {
-  Clear();
+ Clear(); 
+}
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_PassKey::GEOMAlgo_PassKey(const GEOMAlgo_PassKey& aOther)
+{
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
 }
 //=======================================================================
 //function :Assign
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function :Assign
 //purpose  : 
 //=======================================================================
-  GEOMAlgo_PassKey& GEOMAlgo_PassKey::Assign(const GEOMAlgo_PassKey& anOther)
+  GEOMAlgo_PassKey& GEOMAlgo_PassKey::Assign(const GEOMAlgo_PassKey& aOther)
 {
 {
-  myNbIds=anOther.myNbIds;
-  myNbMax=anOther.myNbMax;
-  mySum=anOther.mySum;
-  memcpy(myIds, anOther.myIds, sizeof(myIds));
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
   return *this;
 }
 //=======================================================================
   return *this;
 }
 //=======================================================================
+//function :~
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_PassKey::~GEOMAlgo_PassKey()
+{
+}
+//=======================================================================
 //function :Clear
 //purpose  : 
 //=======================================================================
   void GEOMAlgo_PassKey::Clear()
 {
 //function :Clear
 //purpose  : 
 //=======================================================================
   void GEOMAlgo_PassKey::Clear()
 {
-  Standard_Integer i;
-  //
   myNbIds=0;
   myNbIds=0;
-  myNbMax=8;
   mySum=0;
   mySum=0;
-  for (i=0; i<myNbMax; ++i) {
-    myIds[i]=0;
-  }
+  myMap.Clear();
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1)
+  void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1)
                               
 {
                               
 {
+  Clear();
   myNbIds=1;
   myNbIds=1;
-  myIds[myNbMax-1]=anId1;
-  mySum=anId1;
+  myMap.Add(aId1);
+  mySum=NormalizedId(aId1, myNbIds);
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1,
-                               const Standard_Integer anId2)
+  void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1,
+                               const Standard_Integer aId2)
 {
 {
-  Standard_Integer aIdN1, aIdN2;
+  TColStd_ListOfInteger aLI;
   //
   //
-  myNbIds=2;
-  aIdN1=NormalizedId(anId1, myNbIds);
-  aIdN2=NormalizedId(anId2, myNbIds);
-  mySum=aIdN1+aIdN2;
-  //
-  if (anId1<anId2) {
-    myIds[myNbMax-2]=anId1;
-    myIds[myNbMax-1]=anId2;
-    return;
-  }
-  myIds[myNbMax-2]=anId2;
-  myIds[myNbMax-1]=anId1;
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  SetIds(aLI);
 }
 }
-
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1,
-                               const Standard_Integer anId2,
-                               const Standard_Integer anId3)
+  void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1,
+                               const Standard_Integer aId2,
+                               const Standard_Integer aId3)
 {
 {
-  Standard_Integer aIdN1, aIdN2, aIdN3;
-  //
-  myNbIds=3;
-  aIdN1=NormalizedId(anId1, myNbIds);
-  aIdN2=NormalizedId(anId2, myNbIds);
-  aIdN3=NormalizedId(anId3, myNbIds);
-  mySum=aIdN1+aIdN2+aIdN3;
-  //
-  myIds[myNbMax-3]=anId1;
-  myIds[myNbMax-2]=anId2;
-  myIds[myNbMax-1]=anId3;
+  TColStd_ListOfInteger aLI;
   //
   //
-  Compute();
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  aLI.Append(aId3);
+  SetIds(aLI);
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKey::SetIds(const Standard_Integer anId1,
-                               const Standard_Integer anId2,
-                               const Standard_Integer anId3,
-                               const Standard_Integer anId4)
-{
-  Standard_Integer aIdN1, aIdN2, aIdN3, aIdN4;
-  //
-  myNbIds=4;
-  aIdN1=NormalizedId(anId1, myNbIds);
-  aIdN2=NormalizedId(anId2, myNbIds);
-  aIdN3=NormalizedId(anId3, myNbIds);
-  aIdN4=NormalizedId(anId4, myNbIds);
-  mySum=aIdN1+aIdN2+aIdN3+aIdN4;
+  void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1,
+                               const Standard_Integer aId2,
+                               const Standard_Integer aId3,
+                               const Standard_Integer aId4)
+{ 
+  TColStd_ListOfInteger aLI;
   //
   //
-  myIds[myNbMax-4]=anId1;
-  myIds[myNbMax-3]=anId2;
-  myIds[myNbMax-2]=anId3;
-  myIds[myNbMax-1]=anId4;
-  //
-  Compute();
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  aLI.Append(aId3);
+  aLI.Append(aId4);
+  SetIds(aLI);
 }
 //=======================================================================
 //function :SetIds
 }
 //=======================================================================
 //function :SetIds
@@ -161,100 +148,77 @@ static
 //=======================================================================
   void GEOMAlgo_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
 {
 //=======================================================================
   void GEOMAlgo_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
 {
-  Standard_Integer aNb, i, anId, aIdN;
+  Standard_Integer i, aId, aIdN;
   TColStd_ListIteratorOfListOfInteger aIt;
   //
   TColStd_ListIteratorOfListOfInteger aIt;
   //
-  aNb=aLI.Extent();
-  if (!aNb || aNb > myNbMax) {
-    return;
-  }
-  //
-  myNbIds=aNb;
-  mySum=0;
-  i=myNbMax-myNbIds;
+  Clear();
   aIt.Initialize(aLI);
   aIt.Initialize(aLI);
-  for (; aIt.More(); aIt.Next(), ++i) {
-    anId=aIt.Value();
-    myIds[i]=anId;
-    aIdN=NormalizedId(anId, myNbIds);
-    mySum+=aIdN;
+  for (; aIt.More(); aIt.Next()) {
+    aId=aIt.Value();
+    myMap.Add(aId);
   }
   }
-  //
-  Compute();
-}
-//=======================================================================
-//function :Id
-//purpose  : 
-//=======================================================================
-  Standard_Integer GEOMAlgo_PassKey::Id(const Standard_Integer aIndex)const
-{
-  if (aIndex < 0 || aIndex >= myNbMax) {
-    return 0;
+  myNbIds=myMap.Extent();
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aIdN=NormalizedId(aId, myNbIds);
+    mySum+=aIdN;
   }
   }
-  return myIds[aIndex];
 }
 //=======================================================================
 }
 //=======================================================================
-//function :NbMax
+//function :NbIds
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  Standard_Integer GEOMAlgo_PassKey::NbMax()const
+  Standard_Integer GEOMAlgo_PassKey::NbIds()const
 {
 {
-  return myNbMax;
+  return myNbIds;
 }
 //=======================================================================
 }
 //=======================================================================
-//function :Compute
+//function :Id
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKey::Compute()
+  Standard_Integer GEOMAlgo_PassKey::Id(const Standard_Integer aIndex) const
 {
 {
-  SortShell(myNbIds, myIds+myNbMax-myNbIds);
+  if (aIndex<1 || aIndex>myNbIds) {
+    return -1;
+  }
+  return myMap(aIndex);
 }
 //=======================================================================
 //function :IsEqual
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function :IsEqual
 //purpose  : 
 //=======================================================================
-  Standard_Boolean GEOMAlgo_PassKey::IsEqual(const GEOMAlgo_PassKey& anOther) const
+  Standard_Boolean GEOMAlgo_PassKey::IsEqual(const GEOMAlgo_PassKey& aOther) const
 {
 {
-  Standard_Integer iIsEqual;
-  Standard_Boolean bIsEqual;
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
   //
   //
-  iIsEqual=memcmp(myIds, anOther.myIds, sizeof(myIds));
-  bIsEqual=Standard_False;
-  if (!iIsEqual) {
-    bIsEqual=!bIsEqual;
+  bRet=Standard_False;
+  //
+  if (myNbIds!=aOther.myNbIds) {
+    return bRet;
   }
   }
-  return bIsEqual;
-}
-//=======================================================================
-//function :Key
-//purpose  : 
-//=======================================================================
-  Standard_Address GEOMAlgo_PassKey::Key()const
-{
-  return (Standard_Address)myIds;
+  for (i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    if (!aOther.myMap.Contains(aId)) {
+      return bRet;
+    }
+  }
+  return !bRet;
 }
 //=======================================================================
 //function : HashCode
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function : HashCode
 //purpose  : 
 //=======================================================================
-  Standard_Integer GEOMAlgo_PassKey::HashCode(const Standard_Integer Upper) const
+  Standard_Integer GEOMAlgo_PassKey::HashCode(const Standard_Integer aUpper) const
 {
 {
-  //return (mySum % Upper);
-  return ::HashCode(mySum, Upper);
+  return ::HashCode(mySum, aUpper);
 }
 //=======================================================================
 //function : Dump
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function : Dump
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKey::Dump()const
+  void GEOMAlgo_PassKey::Dump(const Standard_Integer )const
 {
 {
-  Standard_Integer i;
-  //
-  printf(" PassKey: {");
-  for (i=0; i<myNbMax; ++i) {
-    printf(" %d", myIds[i]);
-  }
-  printf(" }");
 }
 //=======================================================================
 // function: NormalizedId
 }
 //=======================================================================
 // function: NormalizedId
@@ -273,33 +237,3 @@ Standard_Integer NormalizedId(const Standard_Integer aId,
   }
   return aIdRet;
 }
   }
   return aIdRet;
 }
-//=======================================================================
-// function: SortShell
-// purpose : 
-//=======================================================================
-void SortShell(const int n, int* a) 
-{
-  int  x, nd, i, j, l, d=1;
-  //
-  while(d<=n) {
-    d*=2;
-  }
-  //
-  while (d) {
-    d=(d-1)/2;
-    //
-    nd=n-d;
-    for (i=0; i<nd; ++i) {
-      j=i;
-    m30:;
-      l=j+d;
-      if (a[l] < a[j]){
-       x=a[j];
-       a[j]=a[l];
-       a[l]=x;
-       j-=d;
-       if (j > -1) goto m30;
-      }//if (a[l] < a[j]){
-    }//for (i=0; i<nd; ++i) 
-  }//while (1)
-}
index b040fb0f415a6402ccaae437258b13bc2ed87ca1..930eb1b080cd215015b214aaebf45e7ef7487758 100644 (file)
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
-#ifndef _Standard_Address_HeaderFile
-#include <Standard_Address.hxx>
-#endif
 class TColStd_ListOfInteger;
 
 
 class TColStd_ListOfInteger;
 
 
@@ -61,6 +61,10 @@ public:
 
 
 Standard_EXPORT GEOMAlgo_PassKey();
 
 
 Standard_EXPORT GEOMAlgo_PassKey();
+Standard_EXPORT virtual ~GEOMAlgo_PassKey();
+
+
+Standard_EXPORT GEOMAlgo_PassKey(const GEOMAlgo_PassKey& Other);
 
 
 Standard_EXPORT   GEOMAlgo_PassKey& Assign(const GEOMAlgo_PassKey& Other) ;
 
 
 Standard_EXPORT   GEOMAlgo_PassKey& Assign(const GEOMAlgo_PassKey& Other) ;
@@ -71,6 +75,9 @@ Standard_EXPORT   GEOMAlgo_PassKey& Assign(const GEOMAlgo_PassKey& Other) ;
 
 
 
 
 
 
+Standard_EXPORT   void Clear() ;
+
+
 Standard_EXPORT   void SetIds(const Standard_Integer aI1) ;
 
 
 Standard_EXPORT   void SetIds(const Standard_Integer aI1) ;
 
 
@@ -86,28 +93,19 @@ Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer
 Standard_EXPORT   void SetIds(const TColStd_ListOfInteger& aLS) ;
 
 
 Standard_EXPORT   void SetIds(const TColStd_ListOfInteger& aLS) ;
 
 
-Standard_EXPORT   Standard_Integer NbMax() const;
-
-
-Standard_EXPORT   void Clear() ;
-
-
-Standard_EXPORT   void Compute() ;
+Standard_EXPORT   Standard_Integer NbIds() const;
 
 
 Standard_EXPORT   Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const;
 
 
 
 
 Standard_EXPORT   Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const;
 
 
-Standard_EXPORT   Standard_Address Key() const;
-
-
 Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
 
 
 Standard_EXPORT   Standard_Integer Id(const Standard_Integer aIndex) const;
 
 
 Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
 
 
 Standard_EXPORT   Standard_Integer Id(const Standard_Integer aIndex) const;
 
 
-Standard_EXPORT   void Dump() const;
+Standard_EXPORT   void Dump(const Standard_Integer aHex = 0) const;
 
 
 
 
 
 
@@ -122,9 +120,8 @@ protected:
  // Fields PROTECTED
  //
 Standard_Integer myNbIds;
  // Fields PROTECTED
  //
 Standard_Integer myNbIds;
-Standard_Integer myNbMax;
 Standard_Integer mySum;
 Standard_Integer mySum;
-Standard_Integer myIds[8];
+TColStd_IndexedMapOfInteger myMap;
 
 
 private: 
 
 
 private: 
index 92e4d599b7139340db1a57120e58e92d9143347d..a0ba022fc7296a683e07fdb1be1dfddad122d2b4 100755 (executable)
@@ -21,7 +21,6 @@
 -- Created:    
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 -- Created:    
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
----Copyright:   
 
 
 class PassKeyMapHasher from GEOMAlgo 
 
 
 class PassKeyMapHasher from GEOMAlgo 
index fbd3d81cb0edbb52b717ba38061bec9661a18b5b..654278f7ee69724855d3f8b2a8cceacb263e61ee 100755 (executable)
 //function : HashCode
 //purpose  : 
 //=======================================================================
 //function : HashCode
 //purpose  : 
 //=======================================================================
-  Standard_Integer GEOMAlgo_PassKeyMapHasher::HashCode(const GEOMAlgo_PassKey& aPKey,
+  Standard_Integer GEOMAlgo_PassKeyMapHasher::HashCode(const GEOMAlgo_PassKey& aPK,
                                                       const Standard_Integer Upper)
 {
                                                       const Standard_Integer Upper)
 {
-  return aPKey.HashCode(Upper);
+  return aPK.HashCode(Upper);
 }
 //=======================================================================
 //function :IsEqual
 //purpose  : 
 //=======================================================================
 }
 //=======================================================================
 //function :IsEqual
 //purpose  : 
 //=======================================================================
-  Standard_Boolean GEOMAlgo_PassKeyMapHasher::IsEqual(const GEOMAlgo_PassKey& aPKey1,
-                                                     const GEOMAlgo_PassKey& aPKey2)
+  Standard_Boolean GEOMAlgo_PassKeyMapHasher::IsEqual(const GEOMAlgo_PassKey& aPK1,
+                                                     const GEOMAlgo_PassKey& aPK2)
 {
 {
-  return aPKey1.IsEqual(aPKey2);
+  return aPK1.IsEqual(aPK2);
 }
 }
index d5d47c0bd7afc40d8f405562012067376ec5fcb2..5215a4de47ef26339322b1d0f521d1cd04ee211a 100755 (executable)
 -- Created:    
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 -- Created:    
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
----Copyright:   
 
 
 class PassKeyShape from GEOMAlgo 
 
 
 class PassKeyShape from GEOMAlgo 
-    inherits PassKey from GEOMAlgo  
-    
+   
        ---Purpose: 
 
 uses
     Shape from TopoDS, 
        ---Purpose: 
 
 uses
     Shape from TopoDS, 
-    ListOfShape from TopTools   
-        
+    ListOfShape from TopTools,   
+    IndexedMapOfShape from TopTools 
+     
 --raises
 
 is 
     Create  
        returns PassKeyShape from GEOMAlgo; 
 --raises
 
 is 
     Create  
        returns PassKeyShape from GEOMAlgo; 
-      
-    SetIds(me:out; 
+     ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_PassKeyShape();" 
+     
+    Create(Other:PassKeyShape from GEOMAlgo) 
+       returns PassKeyShape from GEOMAlgo;
+     
+    Assign(me:out;  
+           Other : PassKeyShape from GEOMAlgo) 
+       returns PassKeyShape from GEOMAlgo; 
+    ---C++: alias operator =
+    ---C++: return &  
+     
+    SetShapes(me:out; 
            aS  :Shape from TopoDS); 
            
            aS  :Shape from TopoDS); 
            
-    SetIds(me:out; 
+    SetShapes(me:out; 
            aS1  :Shape from TopoDS; 
            aS2  :Shape from TopoDS); 
      
            aS1  :Shape from TopoDS; 
            aS2  :Shape from TopoDS); 
      
-    SetIds(me:out; 
+    SetShapes(me:out; 
            aS1  :Shape from TopoDS; 
            aS2  :Shape from TopoDS; 
            aS3  :Shape from TopoDS); 
  
            aS1  :Shape from TopoDS; 
            aS2  :Shape from TopoDS; 
            aS3  :Shape from TopoDS); 
  
-    SetIds(me:out;  
+    SetShapes(me:out;  
            aS1  :Shape from TopoDS; 
            aS2  :Shape from TopoDS; 
            aS3  :Shape from TopoDS;
            aS4  :Shape from TopoDS);
  
            aS1  :Shape from TopoDS; 
            aS2  :Shape from TopoDS; 
            aS3  :Shape from TopoDS;
            aS4  :Shape from TopoDS);
  
-    SetIds(me:out;  
+    SetShapes(me:out;  
            aLS  :ListOfShape from TopTools); 
            aLS  :ListOfShape from TopTools); 
-            
+        
+    Clear(me:out); 
+     
 
 
+    NbIds(me) 
+       returns Integer  from Standard; 
+     
+    IsEqual(me; 
+           aOther:PassKeyShape from GEOMAlgo) 
+       returns Boolean from Standard;                       
+        
+    HashCode(me; 
+           Upper : Integer  from Standard)  
+       returns Integer from Standard;           
+     
+    Dump(me; 
+       aHex:Integer from Standard=0);  
+       
 fields 
 fields 
-    myUpper  : Integer from Standard is protected; 
+    myNbIds:Integer from Standard is protected;    
+    mySum  :Integer from Standard is protected;    
+    myUpper:Integer from Standard is protected;    
+    myMap  :IndexedMapOfShape from TopTools is protected;        
 
 end PassKeyShape;
 
 end PassKeyShape;
index cd90291c2585e788363fd05701a2ef7d029aa380..df01791adaa092449b4b135feffe08fd87450dd7 100755 (executable)
 
 #include <GEOMAlgo_PassKeyShape.ixx>
 
 
 #include <GEOMAlgo_PassKeyShape.ixx>
 
-#include <stdio.h>
-#include <string.h>
-
+#include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_ListOfInteger.hxx>
 
 
+
+static 
+  Standard_Integer NormalizedId(const Standard_Integer aId,
+                               const Standard_Integer aDiv);
 //=======================================================================
 //function :
 //purpose  : 
 //=======================================================================
   GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape()
 //=======================================================================
 //function :
 //purpose  : 
 //=======================================================================
   GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape()
-:
-  GEOMAlgo_PassKey()
 {
   myUpper=432123;
 {
   myUpper=432123;
-  GEOMAlgo_PassKey::Clear();
 }
 //=======================================================================
 }
 //=======================================================================
-//function :SetIds
+//function :
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape(const GEOMAlgo_PassKeyShape& aOther)
+{
+  myUpper=432123;
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
+}
+//=======================================================================
+//function :~
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_PassKeyShape::~GEOMAlgo_PassKeyShape()
+{
+}
+//=======================================================================
+//function :Assign
+//purpose  : 
+//=======================================================================
+  GEOMAlgo_PassKeyShape& GEOMAlgo_PassKeyShape::Assign(const GEOMAlgo_PassKeyShape& aOther)
+{
+  myUpper=432123;
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
+  return *this;
+}
+//=======================================================================
+//function :Clear
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1)
+  void GEOMAlgo_PassKeyShape::Clear()
+{
+  myNbIds=0;
+  mySum=0;
+  myMap.Clear();
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
                               
 {
                               
 {
-  Standard_Integer anId1;
+  Standard_Integer aHC;
   //
   //
-  anId1=aS1.HashCode(myUpper);
-  GEOMAlgo_PassKey::SetIds(anId1);
+  Clear();
+  myNbIds=1;
+  myMap.Add(aS1);
+  aHC=aS1.HashCode(myUpper);
+  mySum=NormalizedId(aHC, myNbIds);
 }
 //=======================================================================
 }
 //=======================================================================
-//function :SetIds
+//function :SetShapes
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
-                                    const TopoDS_Shape& aS2)
+  void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2)
 {
 {
-  Standard_Integer anId1, anId2;
+  TopTools_ListOfShape aLS;
   //
   //
-  anId1=aS1.HashCode(myUpper);
-  anId2=aS2.HashCode(myUpper);
-  //
-  GEOMAlgo_PassKey::SetIds(anId1, anId2);
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  SetShapes(aLS);
 }
 //=======================================================================
 }
 //=======================================================================
-//function :SetIds
+//function :SetShapes
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
-                                    const TopoDS_Shape& aS2,
-                                    const TopoDS_Shape& aS3)
+  void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2,
+                                       const TopoDS_Shape& aS3)
 {
 {
-  Standard_Integer anId1, anId2, anId3;
-  //
-  anId1=aS1.HashCode(myUpper);
-  anId2=aS2.HashCode(myUpper);
-  anId3=aS3.HashCode(myUpper);
+  TopTools_ListOfShape aLS;
   //
   //
-  GEOMAlgo_PassKey::SetIds(anId1, anId2, anId3);
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  aLS.Append(aS3);
+  SetShapes(aLS);
 }
 //=======================================================================
 }
 //=======================================================================
-//function :SetIds
+//function :SetShapes
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
-                               const TopoDS_Shape& aS2,
-                               const TopoDS_Shape& aS3,
-                               const TopoDS_Shape& aS4)
+  void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2,
+                                       const TopoDS_Shape& aS3,
+                                       const TopoDS_Shape& aS4)
 {
 {
-  Standard_Integer anId1, anId2, anId3, anId4;
+  TopTools_ListOfShape aLS;
   //
   //
-  anId1=aS1.HashCode(myUpper);
-  anId2=aS2.HashCode(myUpper);
-  anId3=aS3.HashCode(myUpper);
-  anId4=aS4.HashCode(myUpper);
-  //
-  GEOMAlgo_PassKey::SetIds(anId1, anId2, anId3, anId4);
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  aLS.Append(aS3);
+  aLS.Append(aS4);
+  SetShapes(aLS);
 }
 //=======================================================================
 }
 //=======================================================================
-//function :SetIds
+//function :SetShapes
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_PassKeyShape::SetIds(const TopTools_ListOfShape& aLS)
+  void GEOMAlgo_PassKeyShape::SetShapes(const TopTools_ListOfShape& aLS)
 {
 {
-  Standard_Integer anId;
+  Standard_Integer i, aId, aIdN;
   TopTools_ListIteratorOfListOfShape aIt;
   TopTools_ListIteratorOfListOfShape aIt;
-  TColStd_ListOfInteger aLI;
-  //
-  //aNb=aLS.Extent();
-  //if (aNb<1 || aNb > myNbMax) {
-  //  return;
-  //}
   //
   //
-  //myNbIds=aNb;
-  //mySum=0;
-  //i=myNbMax-myNbIds;
-  
+  Clear();
   aIt.Initialize(aLS);
   for (; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aS=aIt.Value();
   aIt.Initialize(aLS);
   for (; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aS=aIt.Value();
-    anId=aS.HashCode(myUpper);
-    aLI.Append(anId);
+    myMap.Add(aS);
+  }
+  myNbIds=myMap.Extent();
+  for(i=1; i<=myNbIds; ++i) {
+    const TopoDS_Shape& aS=myMap(i);
+    aId=aS.HashCode(myUpper);
+    aIdN=NormalizedId(aId, myNbIds);
+    mySum+=aIdN;
+  }
+}
+//=======================================================================
+//function :NbIds
+//purpose  : 
+//=======================================================================
+  Standard_Integer GEOMAlgo_PassKeyShape::NbIds()const
+{
+  return myNbIds;
+}
+//=======================================================================
+//function :IsEqual
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_PassKeyShape::IsEqual(const GEOMAlgo_PassKeyShape& aOther) const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds!=aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=myNbIds; ++i) {
+    const TopoDS_Shape& aS=myMap(i);
+    if (!aOther.myMap.Contains(aS)) {
+      return bRet;
+    }
+  }
+  return !bRet;
+}
+//=======================================================================
+//function : HashCode
+//purpose  : 
+//=======================================================================
+  Standard_Integer GEOMAlgo_PassKeyShape::HashCode(const Standard_Integer aUpper) const
+{
+  return ::HashCode(mySum, aUpper);
+}
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+  void GEOMAlgo_PassKeyShape::Dump(const Standard_Integer)const
+{
+}
+//=======================================================================
+// function: NormalizedId
+// purpose : 
+//=======================================================================
+Standard_Integer NormalizedId(const Standard_Integer aId,
+                             const Standard_Integer aDiv)
+{
+  Standard_Integer aMax, aTresh, aIdRet;
+  //
+  aIdRet=aId;
+  aMax=::IntegerLast();
+  aTresh=aMax/aDiv;
+  if (aId>aTresh) {
+    aIdRet=aId%aTresh;
   }
   }
-  GEOMAlgo_PassKey::SetIds(aLI);
+  return aIdRet;
 }
 }
index ad06f55c439c5984738c0f182d214d40b6e679b3..d54dd3c0b5b0f20d390cb68fc3168fc053742ad5 100644 (file)
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
-#ifndef _GEOMAlgo_PassKey_HeaderFile
-#include <GEOMAlgo_PassKey.hxx>
+#ifndef _TopTools_IndexedMapOfShape_HeaderFile
+#include <TopTools_IndexedMapOfShape.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
 #endif
 class TopoDS_Shape;
 class TopTools_ListOfShape;
 #endif
 class TopoDS_Shape;
 class TopTools_ListOfShape;
@@ -38,7 +41,7 @@ class TopTools_ListOfShape;
 #endif
 
 
 #endif
 
 
-class GEOMAlgo_PassKeyShape  : public GEOMAlgo_PassKey {
+class GEOMAlgo_PassKeyShape  {
 
 public:
 
 
 public:
 
@@ -59,21 +62,48 @@ public:
 
 
 Standard_EXPORT GEOMAlgo_PassKeyShape();
 
 
 Standard_EXPORT GEOMAlgo_PassKeyShape();
+Standard_EXPORT virtual ~GEOMAlgo_PassKeyShape();
+
+
+Standard_EXPORT GEOMAlgo_PassKeyShape(const GEOMAlgo_PassKeyShape& Other);
+
+
+Standard_EXPORT   GEOMAlgo_PassKeyShape& Assign(const GEOMAlgo_PassKeyShape& Other) ;
+  GEOMAlgo_PassKeyShape& operator =(const GEOMAlgo_PassKeyShape& Other) 
+{
+  return Assign(Other);
+}
+
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
+
+
+Standard_EXPORT   void SetShapes(const TopTools_ListOfShape& aLS) ;
 
 
 
 
-Standard_EXPORT   void SetIds(const TopoDS_Shape& aS) ;
+Standard_EXPORT   void Clear() ;
 
 
 
 
-Standard_EXPORT   void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
+Standard_EXPORT   Standard_Integer NbIds() const;
 
 
 
 
-Standard_EXPORT   void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
+Standard_EXPORT   Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aOther) const;
 
 
 
 
-Standard_EXPORT   void SetIds(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
+Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
 
 
 
 
-Standard_EXPORT   void SetIds(const TopTools_ListOfShape& aLS) ;
+Standard_EXPORT   void Dump(const Standard_Integer aHex = 0) const;
 
 
 
 
 
 
@@ -87,7 +117,10 @@ protected:
 
  // Fields PROTECTED
  //
 
  // Fields PROTECTED
  //
+Standard_Integer myNbIds;
+Standard_Integer mySum;
 Standard_Integer myUpper;
 Standard_Integer myUpper;
+TopTools_IndexedMapOfShape myMap;
 
 
 private: 
 
 
 private: 
diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cdl b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cdl
new file mode 100644 (file)
index 0000000..393b7e7
--- /dev/null
@@ -0,0 +1,47 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File:       GEOMAlgo_PassKeyMapHasher.cdl
+-- Created:    
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class PassKeyShapeMapHasher from GEOMAlgo 
+
+       ---Purpose: 
+
+uses 
+    PassKeyShape from GEOMAlgo 
+
+--raises
+
+is 
+    HashCode(myclass;  
+           aPKey : PassKeyShape from GEOMAlgo;  
+           Upper : Integer from Standard)  
+       returns Integer from Standard;
+       
+       
+    IsEqual(myclass;  
+           aPKey1 : PassKeyShape from GEOMAlgo;  
+           aPKey2 : PassKeyShape from GEOMAlgo)  
+       returns Boolean from Standard;
+
+end PassKeyShapeMapHasher;
diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx
new file mode 100644 (file)
index 0000000..70478af
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       GEOMAlgo_PassKeyMapHasher.cxx
+// Created:    
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <GEOMAlgo_PassKeyShapeMapHasher.ixx>
+
+//=======================================================================
+//function : HashCode
+//purpose  : 
+//=======================================================================
+  Standard_Integer GEOMAlgo_PassKeyShapeMapHasher::HashCode(const GEOMAlgo_PassKeyShape& aPK,
+                                                           const Standard_Integer Upper)
+{
+  return aPK.HashCode(Upper);
+}
+//=======================================================================
+//function :IsEqual
+//purpose  : 
+//=======================================================================
+  Standard_Boolean GEOMAlgo_PassKeyShapeMapHasher::IsEqual(const GEOMAlgo_PassKeyShape& aPK1,
+                                                          const GEOMAlgo_PassKeyShape& aPK2)
+{
+  return aPK1.IsEqual(aPK2);
+}
diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx
new file mode 100644 (file)
index 0000000..53caf6a
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#define _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class GEOMAlgo_PassKeyShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class GEOMAlgo_PassKeyShapeMapHasher  {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT static  Standard_Integer HashCode(const GEOMAlgo_PassKeyShape& aPKey,const Standard_Integer Upper) ;
+
+
+Standard_EXPORT static  Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aPKey1,const GEOMAlgo_PassKeyShape& aPKey2) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.ixx b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.ixx
new file mode 100644 (file)
index 0000000..ae17ce0
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <GEOMAlgo_PassKeyShapeMapHasher.jxx>
+
+
+
diff --git a/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.jxx b/src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.jxx
new file mode 100644 (file)
index 0000000..99130d0
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _GEOMAlgo_PassKeyShape_HeaderFile
+#include <GEOMAlgo_PassKeyShape.hxx>
+#endif
+#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile
+#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#endif
index e2c6b1a318f3a4bf6bbdb572ad3bf41b27965a19..ece735396de80d574338f3f8bd12d4f98bdb8986 100644 (file)
@@ -21,7 +21,6 @@
 -- Created:    Mon Dec  6 11:26:02 2004
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 -- Created:    Mon Dec  6 11:26:02 2004
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
----Copyright:   Matra Datavision 2004
 
 
 class Tools from GEOMAlgo 
 
 
 class Tools from GEOMAlgo 
@@ -38,7 +37,7 @@ uses
     ListOfShape from TopTools,  
     IndexedDataMapOfShapeListOfShape from TopTools,
     Context from IntTools, 
     ListOfShape from TopTools,  
     IndexedDataMapOfShapeListOfShape from TopTools,
     Context from IntTools, 
-    IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo 
+    IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo  --qft 
     
 --raises
 
     
 --raises
 
@@ -48,7 +47,7 @@ is
        returns Boolean from Standard;    
 
     RefineSDShapes(myclass; 
        returns Boolean from Standard;    
 
     RefineSDShapes(myclass; 
-           aMSD:out IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo; 
+           aMSD:out IndexedDataMapOfPassKeyShapeListOfShape from GEOMAlgo; --qft
            aTol:Real from Standard; 
            aCtx:out Context from IntTools) 
        returns Integer from Standard;
            aTol:Real from Standard; 
            aCtx:out Context from IntTools) 
        returns Integer from Standard;
index 5e3991bfe742db524b6ab5ae510ab14e493f5114..65250c36468210ed0e1edaa46aaad7dd5079f197 100644 (file)
@@ -52,8 +52,8 @@
 #include <BOPTools_Tools2D.hxx>
 #include <IntTools_Context.hxx>
 
 #include <BOPTools_Tools2D.hxx>
 #include <IntTools_Context.hxx>
 
-#include <GEOMAlgo_PassKeyShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
+#include <GEOMAlgo_PassKeyShape.hxx>//qft
+#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>//qft
 
 static 
   void GetCount(const TopoDS_Shape& aS,
 
 static 
   void GetCount(const TopoDS_Shape& aS,
@@ -107,9 +107,9 @@ void GetCount(const TopoDS_Shape& aS,
 //function : RefineSDShapes
 //purpose  : 
 //=======================================================================
 //function : RefineSDShapes
 //purpose  : 
 //=======================================================================
-Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape &aMPKLE,
-                                               const Standard_Real aTol,
-                                               IntTools_Context& aCtx)
+  Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE,
+                                                 const Standard_Real aTol,
+                                                 IntTools_Context& aCtx)
 {
   Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
   TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
 {
   Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
   TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
@@ -156,7 +156,10 @@ Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKey
     const TopoDS_Shape& aE1=aMEToAdd.FindKey(i);
     const TopTools_ListOfShape& aLE=aMEToAdd(i);
     //
     const TopoDS_Shape& aE1=aMEToAdd.FindKey(i);
     const TopTools_ListOfShape& aLE=aMEToAdd(i);
     //
-    aPKE1.SetIds(aE1);
+    //qf
+    //aPKE1.SetIds(aE1);
+    aPKE1.SetShapes(aE1);
+    //qt
     aMPKLE.Add(aPKE1, aLE);
   }
   //
     aMPKLE.Add(aPKE1, aLE);
   }
   //
diff --git a/src/GEOMAlgo/Handle_GEOMAlgo_Clsf.hxx b/src/GEOMAlgo/Handle_GEOMAlgo_Clsf.hxx
new file mode 100644 (file)
index 0000000..8b9bf2d
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
+#define _Handle_GEOMAlgo_Clsf_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_GEOMAlgo_HAlgo_HeaderFile
+#include <Handle_GEOMAlgo_HAlgo.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(GEOMAlgo_HAlgo);
+class GEOMAlgo_Clsf;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_Clsf);
+
+class Handle(GEOMAlgo_Clsf) : public Handle(GEOMAlgo_HAlgo) {
+  public:
+    Handle(GEOMAlgo_Clsf)():Handle(GEOMAlgo_HAlgo)() {} 
+    Handle(GEOMAlgo_Clsf)(const Handle(GEOMAlgo_Clsf)& aHandle) : Handle(GEOMAlgo_HAlgo)(aHandle) 
+     {
+     }
+
+    Handle(GEOMAlgo_Clsf)(const GEOMAlgo_Clsf* anItem) : Handle(GEOMAlgo_HAlgo)((GEOMAlgo_HAlgo *)anItem) 
+     {
+     }
+
+    Handle(GEOMAlgo_Clsf)& operator=(const Handle(GEOMAlgo_Clsf)& aHandle)
+     {
+      Assign(aHandle.Access());
+      return *this;
+     }
+
+    Handle(GEOMAlgo_Clsf)& operator=(const GEOMAlgo_Clsf* anItem)
+     {
+      Assign((Standard_Transient *)anItem);
+      return *this;
+     }
+
+    GEOMAlgo_Clsf* operator->() const
+     {
+      return (GEOMAlgo_Clsf *)ControlAccess();
+     }
+
+//   Standard_EXPORT ~Handle(GEOMAlgo_Clsf)();
+   Standard_EXPORT static const Handle(GEOMAlgo_Clsf) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
diff --git a/src/GEOMAlgo/Handle_GEOMAlgo_ClsfBox.hxx b/src/GEOMAlgo/Handle_GEOMAlgo_ClsfBox.hxx
new file mode 100644 (file)
index 0000000..b397bdd
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_GEOMAlgo_ClsfBox_HeaderFile
+#define _Handle_GEOMAlgo_ClsfBox_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
+#include <Handle_GEOMAlgo_Clsf.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(GEOMAlgo_Clsf);
+class GEOMAlgo_ClsfBox;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_ClsfBox);
+
+class Handle(GEOMAlgo_ClsfBox) : public Handle(GEOMAlgo_Clsf) {
+  public:
+    Handle(GEOMAlgo_ClsfBox)():Handle(GEOMAlgo_Clsf)() {} 
+    Handle(GEOMAlgo_ClsfBox)(const Handle(GEOMAlgo_ClsfBox)& aHandle) : Handle(GEOMAlgo_Clsf)(aHandle) 
+     {
+     }
+
+    Handle(GEOMAlgo_ClsfBox)(const GEOMAlgo_ClsfBox* anItem) : Handle(GEOMAlgo_Clsf)((GEOMAlgo_Clsf *)anItem) 
+     {
+     }
+
+    Handle(GEOMAlgo_ClsfBox)& operator=(const Handle(GEOMAlgo_ClsfBox)& aHandle)
+     {
+      Assign(aHandle.Access());
+      return *this;
+     }
+
+    Handle(GEOMAlgo_ClsfBox)& operator=(const GEOMAlgo_ClsfBox* anItem)
+     {
+      Assign((Standard_Transient *)anItem);
+      return *this;
+     }
+
+    GEOMAlgo_ClsfBox* operator->() const
+     {
+      return (GEOMAlgo_ClsfBox *)ControlAccess();
+     }
+
+//   Standard_EXPORT ~Handle(GEOMAlgo_ClsfBox)();
+   Standard_EXPORT static const Handle(GEOMAlgo_ClsfBox) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
diff --git a/src/GEOMAlgo/Handle_GEOMAlgo_ClsfSurf.hxx b/src/GEOMAlgo/Handle_GEOMAlgo_ClsfSurf.hxx
new file mode 100644 (file)
index 0000000..ca42ed9
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_GEOMAlgo_ClsfSurf_HeaderFile
+#define _Handle_GEOMAlgo_ClsfSurf_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_GEOMAlgo_Clsf_HeaderFile
+#include <Handle_GEOMAlgo_Clsf.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(GEOMAlgo_Clsf);
+class GEOMAlgo_ClsfSurf;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_ClsfSurf);
+
+class Handle(GEOMAlgo_ClsfSurf) : public Handle(GEOMAlgo_Clsf) {
+  public:
+    Handle(GEOMAlgo_ClsfSurf)():Handle(GEOMAlgo_Clsf)() {} 
+    Handle(GEOMAlgo_ClsfSurf)(const Handle(GEOMAlgo_ClsfSurf)& aHandle) : Handle(GEOMAlgo_Clsf)(aHandle) 
+     {
+     }
+
+    Handle(GEOMAlgo_ClsfSurf)(const GEOMAlgo_ClsfSurf* anItem) : Handle(GEOMAlgo_Clsf)((GEOMAlgo_Clsf *)anItem) 
+     {
+     }
+
+    Handle(GEOMAlgo_ClsfSurf)& operator=(const Handle(GEOMAlgo_ClsfSurf)& aHandle)
+     {
+      Assign(aHandle.Access());
+      return *this;
+     }
+
+    Handle(GEOMAlgo_ClsfSurf)& operator=(const GEOMAlgo_ClsfSurf* anItem)
+     {
+      Assign((Standard_Transient *)anItem);
+      return *this;
+     }
+
+    GEOMAlgo_ClsfSurf* operator->() const
+     {
+      return (GEOMAlgo_ClsfSurf *)ControlAccess();
+     }
+
+//   Standard_EXPORT ~Handle(GEOMAlgo_ClsfSurf)();
+   Standard_EXPORT static const Handle(GEOMAlgo_ClsfSurf) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
diff --git a/src/GEOMAlgo/Handle_GEOMAlgo_HAlgo.hxx b/src/GEOMAlgo/Handle_GEOMAlgo_HAlgo.hxx
new file mode 100644 (file)
index 0000000..861c3e3
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_GEOMAlgo_HAlgo_HeaderFile
+#define _Handle_GEOMAlgo_HAlgo_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_MMgt_TShared_HeaderFile
+#include <Handle_MMgt_TShared.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(MMgt_TShared);
+class GEOMAlgo_HAlgo;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_HAlgo);
+
+class Handle(GEOMAlgo_HAlgo) : public Handle(MMgt_TShared) {
+  public:
+    Handle(GEOMAlgo_HAlgo)():Handle(MMgt_TShared)() {} 
+    Handle(GEOMAlgo_HAlgo)(const Handle(GEOMAlgo_HAlgo)& aHandle) : Handle(MMgt_TShared)(aHandle) 
+     {
+     }
+
+    Handle(GEOMAlgo_HAlgo)(const GEOMAlgo_HAlgo* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) 
+     {
+     }
+
+    Handle(GEOMAlgo_HAlgo)& operator=(const Handle(GEOMAlgo_HAlgo)& aHandle)
+     {
+      Assign(aHandle.Access());
+      return *this;
+     }
+
+    Handle(GEOMAlgo_HAlgo)& operator=(const GEOMAlgo_HAlgo* anItem)
+     {
+      Assign((Standard_Transient *)anItem);
+      return *this;
+     }
+
+    GEOMAlgo_HAlgo* operator->() const
+     {
+      return (GEOMAlgo_HAlgo *)ControlAccess();
+     }
+
+//   Standard_EXPORT ~Handle(GEOMAlgo_HAlgo)();
+   Standard_EXPORT static const Handle(GEOMAlgo_HAlgo) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
index 0ea15e24a692dd82e4037a8892884deccc72fc52..5cd72872325d571e6cbaee39fa5741f317c0a56b 100644 (file)
@@ -55,6 +55,9 @@ LIB_SRC = \
        GEOMAlgo_BuilderShape.cxx \
        GEOMAlgo_BuilderSolid.cxx \
        GEOMAlgo_BuilderTools.cxx \
        GEOMAlgo_BuilderShape.cxx \
        GEOMAlgo_BuilderSolid.cxx \
        GEOMAlgo_BuilderTools.cxx \
+       GEOMAlgo_ClsfBox.cxx \
+       GEOMAlgo_Clsf.cxx \
+       GEOMAlgo_ClsfSurf.cxx \
        GEOMAlgo_CoupleOfShapes.cxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_0.cxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_0.cxx \
        GEOMAlgo_CoupleOfShapes.cxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_0.cxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_0.cxx \
@@ -69,10 +72,12 @@ LIB_SRC = \
        GEOMAlgo_DataMapOfShapeReal_0.cxx \
        GEOMAlgo_DataMapOfShapeShapeSet_0.cxx \
        GEOMAlgo_FinderShapeOn1.cxx \
        GEOMAlgo_DataMapOfShapeReal_0.cxx \
        GEOMAlgo_DataMapOfShapeShapeSet_0.cxx \
        GEOMAlgo_FinderShapeOn1.cxx \
+       GEOMAlgo_FinderShapeOn2.cxx \
        GEOMAlgo_FinderShapeOn.cxx \
        GEOMAlgo_FinderShapeOnQuad.cxx \
        GEOMAlgo_GlueAnalyser.cxx \
        GEOMAlgo_Gluer.cxx \
        GEOMAlgo_FinderShapeOn.cxx \
        GEOMAlgo_FinderShapeOnQuad.cxx \
        GEOMAlgo_GlueAnalyser.cxx \
        GEOMAlgo_Gluer.cxx \
+       GEOMAlgo_HAlgo.cxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_0.cxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_0.cxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_0.cxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_0.cxx \
@@ -92,6 +97,7 @@ LIB_SRC = \
        GEOMAlgo_PassKey.cxx \
        GEOMAlgo_PassKeyMapHasher.cxx \
        GEOMAlgo_PassKeyShape.cxx \
        GEOMAlgo_PassKey.cxx \
        GEOMAlgo_PassKeyMapHasher.cxx \
        GEOMAlgo_PassKeyShape.cxx \
+       GEOMAlgo_PassKeyShapeMapHasher.cxx \
        GEOMAlgo_ShapeAlgo.cxx \
        GEOMAlgo_ShapeSet.cxx \
        GEOMAlgo_ShapeSolid.cxx \
        GEOMAlgo_ShapeAlgo.cxx \
        GEOMAlgo_ShapeSet.cxx \
        GEOMAlgo_ShapeSolid.cxx \
@@ -124,6 +130,9 @@ EXPORT_HEADERS = \
        GEOMAlgo_BuilderShape.hxx \
        GEOMAlgo_BuilderSolid.hxx \
        GEOMAlgo_BuilderTools.hxx \
        GEOMAlgo_BuilderShape.hxx \
        GEOMAlgo_BuilderSolid.hxx \
        GEOMAlgo_BuilderTools.hxx \
+       GEOMAlgo_ClsfBox.hxx \
+       GEOMAlgo_Clsf.hxx \
+       GEOMAlgo_ClsfSurf.hxx \
        GEOMAlgo_CoupleOfShapes.hxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx \
        GEOMAlgo_CoupleOfShapes.hxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx \
        GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx \
@@ -138,10 +147,12 @@ EXPORT_HEADERS = \
        GEOMAlgo_DataMapOfShapeReal.hxx \
        GEOMAlgo_DataMapOfShapeShapeSet.hxx \
        GEOMAlgo_FinderShapeOn1.hxx \
        GEOMAlgo_DataMapOfShapeReal.hxx \
        GEOMAlgo_DataMapOfShapeShapeSet.hxx \
        GEOMAlgo_FinderShapeOn1.hxx \
+       GEOMAlgo_FinderShapeOn2.hxx \
        GEOMAlgo_FinderShapeOn.hxx \
        GEOMAlgo_FinderShapeOnQuad.hxx \
        GEOMAlgo_GlueAnalyser.hxx \
        GEOMAlgo_Gluer.hxx \
        GEOMAlgo_FinderShapeOn.hxx \
        GEOMAlgo_FinderShapeOnQuad.hxx \
        GEOMAlgo_GlueAnalyser.hxx \
        GEOMAlgo_Gluer.hxx \
+       GEOMAlgo_HAlgo.hxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \
        GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx \
@@ -161,6 +172,7 @@ EXPORT_HEADERS = \
        GEOMAlgo_PassKey.hxx \
        GEOMAlgo_PassKeyMapHasher.hxx \
        GEOMAlgo_PassKeyShape.hxx \
        GEOMAlgo_PassKey.hxx \
        GEOMAlgo_PassKeyMapHasher.hxx \
        GEOMAlgo_PassKeyShape.hxx \
+       GEOMAlgo_PassKeyShapeMapHasher.hxx \
        GEOMAlgo_PWireEdgeSet.hxx \
        GEOMAlgo_ShapeAlgo.hxx \
        GEOMAlgo_ShapeSet.hxx \
        GEOMAlgo_PWireEdgeSet.hxx \
        GEOMAlgo_ShapeAlgo.hxx \
        GEOMAlgo_ShapeSet.hxx \
@@ -178,10 +190,14 @@ EXPORT_HEADERS = \
        GEOMAlgo_WireEdgeSet.hxx \
        GEOMAlgo_WireSolid.hxx \
        GEOMAlgo_WireSplitter.hxx \
        GEOMAlgo_WireEdgeSet.hxx \
        GEOMAlgo_WireSolid.hxx \
        GEOMAlgo_WireSplitter.hxx \
+       Handle_GEOMAlgo_ClsfBox.hxx \
+       Handle_GEOMAlgo_Clsf.hxx \
+       Handle_GEOMAlgo_ClsfSurf.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \
        Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \
+       Handle_GEOMAlgo_HAlgo.hxx \
        Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \
        Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx \
        Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \
        Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx \