mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-22 13:50:35 +05:00
IMP 0021129: EDF 1541 GEOM: Problem with GetInPlace. A new GetInPlace implementation by Peter Kurnev.
This commit is contained in:
parent
7f46e5fa52
commit
b8030029e0
@ -2004,6 +2004,12 @@ module GEOM
|
||||
GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
|
||||
in GEOM_Object theShapeWhat);
|
||||
|
||||
/*!
|
||||
* Old implementation of GetInPlace functionality, based on shape properties.
|
||||
*/
|
||||
GEOM_Object GetInPlaceOld (in GEOM_Object theShapeWhere,
|
||||
in GEOM_Object theShapeWhat);
|
||||
|
||||
/*!
|
||||
* Get sub-shape(s) of \a theShapeWhere, which are
|
||||
* coincident with \a theShapeWhat or could be a part of it.
|
||||
|
@ -1,4 +1,7 @@
|
||||
-- Copyright (C) 2005-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
-- Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
--
|
||||
-- Copyright (C) 2003-2007 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
|
||||
@ -19,7 +22,6 @@
|
||||
-- File: GEOMAlgo.cdl
|
||||
-- Created: Sat Dec 04 12:36:22 2004
|
||||
-- Author: Peter KURNEV
|
||||
-- <peter@PREFEX>
|
||||
|
||||
package GEOMAlgo
|
||||
|
||||
@ -124,14 +126,15 @@ is
|
||||
class ShapeInfo;
|
||||
class ShapeInfoFiller;
|
||||
--
|
||||
-- gluer
|
||||
class Gluer;
|
||||
class Gluer1;
|
||||
|
||||
-- Gluer / GetInPlace
|
||||
--modified by NIZNHY-PKV Mon Feb 21 10:07:22 2011f
|
||||
-- class Gluer1;
|
||||
class Gluer;
|
||||
|
||||
imported Gluer2 from GEOMAlgo;
|
||||
imported GlueDetector from GEOMAlgo;
|
||||
imported GluerAlgo from GEOMAlgo;
|
||||
imported GetInPlace from GEOMAlgo;
|
||||
--modified by NIZNHY-PKV Mon Feb 21 10:07:27 2011t
|
||||
|
||||
class GlueAnalyser;
|
||||
@ -140,7 +143,6 @@ is
|
||||
class PassKey;
|
||||
class PassKeyMapHasher;
|
||||
class PassKeyShape;
|
||||
|
||||
class SurfaceTools;
|
||||
class Tools;
|
||||
--
|
||||
@ -247,4 +249,15 @@ is
|
||||
Shape from TopoDS,
|
||||
OrientedShapeMapHasher from TopTools);
|
||||
|
||||
--modified by NIZNHY-PKV Thu Apr 28 08:25:36 2011f
|
||||
class DataMapOfShapeMapOfShape instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
MapOfShape from TopTools,
|
||||
ShapeMapHasher from TopTools);
|
||||
class DataMapOfShapePnt instantiates
|
||||
DataMap from TCollection (Shape from TopoDS,
|
||||
Pnt from gp,
|
||||
ShapeMapHasher from TopTools);
|
||||
--modified by NIZNHY-PKV Thu Apr 28 08:25:39 2011t
|
||||
|
||||
end GEOMAlgo;
|
||||
|
@ -0,0 +1,99 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#define _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TCollection_BasicMapIterator_HeaderFile
|
||||
#include <TCollection_BasicMapIterator.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class TopTools_MapOfShape;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class GEOMAlgo_DataMapOfShapeMapOfShape;
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape;
|
||||
|
||||
|
||||
|
||||
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape : public TCollection_BasicMapIterator {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape();
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape(const GEOMAlgo_DataMapOfShapeMapOfShape& aMap);
|
||||
|
||||
Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfShapeMapOfShape& aMap) ;
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Key() const;
|
||||
|
||||
Standard_EXPORT const TopTools_MapOfShape& Value() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,59 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem TopTools_MapOfShape
|
||||
#define TheItem_hxx <TopTools_MapOfShape.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
#include <TCollection_DataMapIterator.gxx>
|
||||
|
99
src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx
Normal file
99
src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx
Normal file
@ -0,0 +1,99 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapIteratorOfDataMapOfShapePnt_HeaderFile
|
||||
#define _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TCollection_BasicMapIterator_HeaderFile
|
||||
#include <TCollection_BasicMapIterator.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class gp_Pnt;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class GEOMAlgo_DataMapOfShapePnt;
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt;
|
||||
|
||||
|
||||
|
||||
class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt : public TCollection_BasicMapIterator {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt();
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt(const GEOMAlgo_DataMapOfShapePnt& aMap);
|
||||
|
||||
Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfShapePnt& aMap) ;
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Key() const;
|
||||
|
||||
Standard_EXPORT const gp_Pnt& Value() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,59 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _gp_Pnt_HeaderFile
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapOfShapePnt_HeaderFile
|
||||
#include <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem gp_Pnt
|
||||
#define TheItem_hxx <gp_Pnt.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
#include <TCollection_DataMapIterator.gxx>
|
||||
|
121
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx
Normal file
121
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx
Normal file
@ -0,0 +1,121 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#define _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_DefineHandle_HeaderFile
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNode_HeaderFile
|
||||
#include <TCollection_MapNode.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||
#include <TCollection_MapNodePtr.hxx>
|
||||
#endif
|
||||
class TopoDS_Shape;
|
||||
class TopTools_MapOfShape;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class GEOMAlgo_DataMapOfShapeMapOfShape;
|
||||
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape;
|
||||
|
||||
|
||||
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape : public TCollection_MapNode {
|
||||
|
||||
public:
|
||||
|
||||
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape(const TopoDS_Shape& K,const TopTools_MapOfShape& I,const TCollection_MapNodePtr& n);
|
||||
|
||||
TopoDS_Shape& Key() const;
|
||||
|
||||
TopTools_MapOfShape& Value() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TopoDS_Shape myKey;
|
||||
TopTools_MapOfShape myValue;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem TopTools_MapOfShape
|
||||
#define TheItem_hxx <TopTools_MapOfShape.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
|
||||
#include <TCollection_DataMapNode.lxx>
|
||||
|
||||
#undef TheKey
|
||||
#undef TheKey_hxx
|
||||
#undef TheItem
|
||||
#undef TheItem_hxx
|
||||
#undef Hasher
|
||||
#undef Hasher_hxx
|
||||
#undef TCollection_DataMapNode
|
||||
#undef TCollection_DataMapNode_hxx
|
||||
#undef TCollection_DataMapIterator
|
||||
#undef TCollection_DataMapIterator_hxx
|
||||
#undef Handle_TCollection_DataMapNode
|
||||
#undef TCollection_DataMapNode_Type_
|
||||
#undef TCollection_DataMap
|
||||
#undef TCollection_DataMap_hxx
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,105 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||
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_DataMapNodeOfDataMapOfShapeMapOfShape",
|
||||
sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape))) {
|
||||
_anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) ;
|
||||
}
|
||||
//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape::IsKind(const Handle(Standard_Type)& AType) const
|
||||
//{
|
||||
// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) == AType || TCollection_MapNode::IsKind(AType));
|
||||
//}
|
||||
//Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape() {}
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem TopTools_MapOfShape
|
||||
#define TheItem_hxx <TopTools_MapOfShape.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
#include <TCollection_DataMapNode.gxx>
|
||||
|
121
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx
Normal file
121
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx
Normal file
@ -0,0 +1,121 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#define _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_DefineHandle_HeaderFile
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _gp_Pnt_HeaderFile
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNode_HeaderFile
|
||||
#include <TCollection_MapNode.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||
#include <TCollection_MapNodePtr.hxx>
|
||||
#endif
|
||||
class TopoDS_Shape;
|
||||
class gp_Pnt;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class GEOMAlgo_DataMapOfShapePnt;
|
||||
class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt;
|
||||
|
||||
|
||||
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt : public TCollection_MapNode {
|
||||
|
||||
public:
|
||||
|
||||
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapePnt(const TopoDS_Shape& K,const gp_Pnt& I,const TCollection_MapNodePtr& n);
|
||||
|
||||
TopoDS_Shape& Key() const;
|
||||
|
||||
gp_Pnt& Value() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TopoDS_Shape myKey;
|
||||
gp_Pnt myValue;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem gp_Pnt
|
||||
#define TheItem_hxx <gp_Pnt.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
|
||||
#include <TCollection_DataMapNode.lxx>
|
||||
|
||||
#undef TheKey
|
||||
#undef TheKey_hxx
|
||||
#undef TheItem
|
||||
#undef TheItem_hxx
|
||||
#undef Hasher
|
||||
#undef Hasher_hxx
|
||||
#undef TCollection_DataMapNode
|
||||
#undef TCollection_DataMapNode_hxx
|
||||
#undef TCollection_DataMapIterator
|
||||
#undef TCollection_DataMapIterator_hxx
|
||||
#undef Handle_TCollection_DataMapNode
|
||||
#undef TCollection_DataMapNode_Type_
|
||||
#undef TCollection_DataMap
|
||||
#undef TCollection_DataMap_hxx
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
|
||||
#endif
|
105
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_0.cxx
Normal file
105
src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_0.cxx
Normal file
@ -0,0 +1,105 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _gp_Pnt_HeaderFile
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapOfShapePnt_HeaderFile
|
||||
#include <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile
|
||||
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
|
||||
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_DataMapNodeOfDataMapOfShapePnt",
|
||||
sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt))) {
|
||||
_anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfShapePnt::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) ;
|
||||
}
|
||||
//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfShapePnt::IsKind(const Handle(Standard_Type)& AType) const
|
||||
//{
|
||||
// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) == AType || TCollection_MapNode::IsKind(AType));
|
||||
//}
|
||||
//Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt() {}
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem gp_Pnt
|
||||
#define TheItem_hxx <gp_Pnt.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
#include <TCollection_DataMapNode.gxx>
|
||||
|
132
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx
Normal file
132
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx
Normal file
@ -0,0 +1,132 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapOfShapeMapOfShape_HeaderFile
|
||||
#define _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TCollection_BasicMap_HeaderFile
|
||||
#include <TCollection_BasicMap.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
class Standard_DomainError;
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class TopTools_MapOfShape;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape;
|
||||
class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape;
|
||||
|
||||
|
||||
|
||||
class GEOMAlgo_DataMapOfShapeMapOfShape : public TCollection_BasicMap {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape(const Standard_Integer NbBuckets = 1);
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape& Assign(const GEOMAlgo_DataMapOfShapeMapOfShape& Other) ;
|
||||
GEOMAlgo_DataMapOfShapeMapOfShape& operator =(const GEOMAlgo_DataMapOfShapeMapOfShape& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||
|
||||
Standard_EXPORT void Clear() ;
|
||||
~GEOMAlgo_DataMapOfShapeMapOfShape()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const TopTools_MapOfShape& I) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ;
|
||||
|
||||
Standard_EXPORT const TopTools_MapOfShape& Find(const TopoDS_Shape& K) const;
|
||||
const TopTools_MapOfShape& operator()(const TopoDS_Shape& K) const
|
||||
{
|
||||
return Find(K);
|
||||
}
|
||||
|
||||
Standard_EXPORT TopTools_MapOfShape& ChangeFind(const TopoDS_Shape& K) ;
|
||||
TopTools_MapOfShape& operator()(const TopoDS_Shape& K)
|
||||
{
|
||||
return ChangeFind(K);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape(const GEOMAlgo_DataMapOfShapeMapOfShape& Other);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
|
||||
#endif
|
62
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape_0.cxx
Normal file
62
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape_0.cxx
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapOfShapeMapOfShape.hxx>
|
||||
|
||||
#ifndef _Standard_DomainError_HeaderFile
|
||||
#include <Standard_DomainError.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_MapOfShape_HeaderFile
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem TopTools_MapOfShape
|
||||
#define TheItem_hxx <TopTools_MapOfShape.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
#include <TCollection_DataMap.gxx>
|
||||
|
132
src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx
Normal file
132
src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx
Normal file
@ -0,0 +1,132 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapOfShapePnt_HeaderFile
|
||||
#define _GEOMAlgo_DataMapOfShapePnt_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TCollection_BasicMap_HeaderFile
|
||||
#include <TCollection_BasicMap.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
class Standard_DomainError;
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class gp_Pnt;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt;
|
||||
class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt;
|
||||
|
||||
|
||||
|
||||
class GEOMAlgo_DataMapOfShapePnt : public TCollection_BasicMap {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapOfShapePnt(const Standard_Integer NbBuckets = 1);
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapOfShapePnt& Assign(const GEOMAlgo_DataMapOfShapePnt& Other) ;
|
||||
GEOMAlgo_DataMapOfShapePnt& operator =(const GEOMAlgo_DataMapOfShapePnt& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||
|
||||
Standard_EXPORT void Clear() ;
|
||||
~GEOMAlgo_DataMapOfShapePnt()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const gp_Pnt& I) ;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ;
|
||||
|
||||
Standard_EXPORT const gp_Pnt& Find(const TopoDS_Shape& K) const;
|
||||
const gp_Pnt& operator()(const TopoDS_Shape& K) const
|
||||
{
|
||||
return Find(K);
|
||||
}
|
||||
|
||||
Standard_EXPORT gp_Pnt& ChangeFind(const TopoDS_Shape& K) ;
|
||||
gp_Pnt& operator()(const TopoDS_Shape& K)
|
||||
{
|
||||
return ChangeFind(K);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT GEOMAlgo_DataMapOfShapePnt(const GEOMAlgo_DataMapOfShapePnt& Other);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
|
||||
|
||||
#endif
|
62
src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt_0.cxx
Normal file
62
src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt_0.cxx
Normal file
@ -0,0 +1,62 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapOfShapePnt.hxx>
|
||||
|
||||
#ifndef _Standard_DomainError_HeaderFile
|
||||
#include <Standard_DomainError.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _gp_Pnt_HeaderFile
|
||||
#include <gp_Pnt.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#include <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile
|
||||
#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem gp_Pnt
|
||||
#define TheItem_hxx <gp_Pnt.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>
|
||||
#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>
|
||||
#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt
|
||||
#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()
|
||||
#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt
|
||||
#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
#include <TCollection_DataMap.gxx>
|
||||
|
1144
src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx
Normal file
1144
src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx
Normal file
File diff suppressed because it is too large
Load Diff
324
src/GEOMAlgo/GEOMAlgo_GetInPlace.hxx
Normal file
324
src/GEOMAlgo/GEOMAlgo_GetInPlace.hxx
Normal file
@ -0,0 +1,324 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_GetInPlace.hxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
|
||||
#ifndef _GEOMAlgo_GetInPlace_HeaderFile
|
||||
#define _GEOMAlgo_GetInPlace_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <NMTTools_CoupleOfShape.hxx>
|
||||
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
|
||||
|
||||
#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
|
||||
#include <GEOMAlgo_GluerAlgo.hxx>
|
||||
#include <GEOMAlgo_Algo.hxx>
|
||||
#include <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
/**
|
||||
* The implementation of iterator of intersected shapes
|
||||
* for Get In Place Algorithm.
|
||||
* The intersection is in terms of 3D bounding boxes.
|
||||
*/
|
||||
//=======================================================================
|
||||
//class : GEOMAlgo_GetInPlaceIterator
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class GEOMAlgo_GetInPlaceIterator {
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
GEOMAlgo_GetInPlaceIterator();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
virtual ~GEOMAlgo_GetInPlaceIterator();
|
||||
|
||||
/**
|
||||
* Clear the internal content.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
void Clear() ;
|
||||
|
||||
/**
|
||||
* Append the pair of intersected shapes.
|
||||
* @param theCS
|
||||
* The pair of intersected shapes.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
void AppendPair(const NMTTools_CoupleOfShape& theCS) ;
|
||||
|
||||
/**
|
||||
* Initialize the iterator.
|
||||
* @param theT1
|
||||
* The type of (sub)shape What.
|
||||
* @param theT2
|
||||
* The type of (sub)shape Where.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
void Initialize(const TopAbs_ShapeEnum theT1,
|
||||
const TopAbs_ShapeEnum theT2) ;
|
||||
/**
|
||||
* Check the existence of pairs to iterare.
|
||||
* @return
|
||||
* Standard_True if there are pairs to iterare.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
Standard_Boolean More() const;
|
||||
|
||||
/**
|
||||
* Shift to the next pair.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
void Next() ;
|
||||
|
||||
/**
|
||||
* Returns the pair of intersected shapes.
|
||||
* @return
|
||||
* The pair of intersected shapes.
|
||||
*/
|
||||
//Standard_EXPORT
|
||||
const NMTTools_CoupleOfShape& Value() const;
|
||||
|
||||
protected:
|
||||
Standard_Integer myDim;
|
||||
NMTTools_ListOfCoupleOfShape myLists[10];
|
||||
NMTTools_ListOfCoupleOfShape myEmptyList;
|
||||
NMTTools_ListIteratorOfListOfCoupleOfShape myIterator;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
//=======================================================================
|
||||
/**
|
||||
* The implementation of Get In Place Algorithm.
|
||||
* The algorithm provides the search the argument [What]
|
||||
* in the shape [Where].
|
||||
*/
|
||||
//=======================================================================
|
||||
//class : GEOMAlgo_GetInPlace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class GEOMAlgo_GetInPlace : public GEOMAlgo_GluerAlgo,
|
||||
public GEOMAlgo_Algo
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
GEOMAlgo_GetInPlace();
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
virtual ~GEOMAlgo_GetInPlace();
|
||||
/**
|
||||
* Modifier. Sets the shape where the search is intended.
|
||||
* @param theShape
|
||||
* The shape where the search is intended.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
virtual void SetShapeWhere(const TopoDS_Shape& theShape) ;
|
||||
|
||||
/**
|
||||
* Selector. Returns the shape where the search is intended.
|
||||
* @return
|
||||
* The shape where the search is intended.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
const TopoDS_Shape& ShapeWhere() const;
|
||||
|
||||
/**
|
||||
* Modifier. Sets the tolerance of mass.
|
||||
* @param theTol
|
||||
* The value tolerance of mass.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
void SetTolMass(const Standard_Real theTol) ;
|
||||
|
||||
/**
|
||||
* Selector. Returns the value tolerance of mass.
|
||||
* @return
|
||||
* The value tolerance of mass.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
Standard_Real TolMass() const;
|
||||
|
||||
/**
|
||||
* Modifier. Sets the tolerance of center of gravily.
|
||||
* @param theTol
|
||||
* The value tolerance of center of gravily.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
void SetTolCG(const Standard_Real theTol) ;
|
||||
|
||||
/**
|
||||
* Selector. Returns the tolerance of center of gravily.
|
||||
* @return
|
||||
* The value tolerance of center of gravily.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
Standard_Real TolCG() const;
|
||||
|
||||
/**
|
||||
* Perform the algorithm.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
virtual void Perform() ;
|
||||
|
||||
/**
|
||||
* Returns state of the search.
|
||||
* @return
|
||||
* Standard_True if the argument is found.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
Standard_Boolean IsFound() const;
|
||||
|
||||
/**
|
||||
* Checks data
|
||||
*/
|
||||
Standard_EXPORT
|
||||
virtual void CheckData() ;
|
||||
|
||||
/**
|
||||
* Clear the internal content.
|
||||
*/
|
||||
Standard_EXPORT
|
||||
virtual void Clear() ;
|
||||
|
||||
/**
|
||||
* Returns the map of shapes IN.
|
||||
* @return
|
||||
** Returns the map of shapes IN.
|
||||
* The Key - the (sub)shape of the argument [What].
|
||||
* The Item- the (sub)shapes of the shape [Where] that have
|
||||
* the state IN in respect of [What].
|
||||
*/
|
||||
Standard_EXPORT
|
||||
const GEOMAlgo_DataMapOfShapeMapOfShape& ShapesIn() const;
|
||||
|
||||
/**
|
||||
* Returns the map of shapes ON.
|
||||
* @return
|
||||
* Returns the map of shapes ON.
|
||||
* The Key - the (sub)shape of the argument [What].
|
||||
* The Item- the (sub)shapes of the shape [Where] that have
|
||||
* the state ON in respect of [What].
|
||||
*/
|
||||
Standard_EXPORT
|
||||
const GEOMAlgo_DataMapOfShapeMapOfShape& ShapesOn() const;
|
||||
|
||||
protected:
|
||||
Standard_EXPORT
|
||||
void Intersect() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformVV() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformVE() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformEE() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformVF() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformEF() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformFF() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillEdgesOn() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillFacesOn() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillSolidsOn() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformZF() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void PerformZZ() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillImages() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillImagesCompound(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void CheckGProps() ;
|
||||
|
||||
Standard_EXPORT
|
||||
void CheckGProps(const TopoDS_Shape& theS) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillShapesIn(const TopoDS_Shape& theS1,
|
||||
const TopoDS_Shape& theS2) ;
|
||||
|
||||
Standard_EXPORT
|
||||
void FillShapesOn(const TopoDS_Shape& theS1,
|
||||
const TopoDS_Shape& theS2) ;
|
||||
|
||||
Standard_EXPORT
|
||||
Standard_Boolean CheckCoincidence(const TopoDS_Shape& theS1,
|
||||
const TopoDS_Shape& theS2);
|
||||
|
||||
|
||||
TopoDS_Shape myShapeWhere;
|
||||
GEOMAlgo_GetInPlaceIterator myIterator;
|
||||
GEOMAlgo_DataMapOfShapeMapOfShape myShapesIn;
|
||||
GEOMAlgo_DataMapOfShapeMapOfShape myShapesOn;
|
||||
Standard_Real myTolMass;
|
||||
Standard_Real myTolCG;
|
||||
Standard_Boolean myFound;
|
||||
GEOMAlgo_DataMapOfShapePnt myMapShapePnt;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
402
src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx
Normal file
402
src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx
Normal file
@ -0,0 +1,402 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_GetInPlace_1.cxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
|
||||
#include <GEOMAlgo_GetInPlace.hxx>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom2dHatch_Hatcher.hxx>
|
||||
#include <Geom2dHatch_Intersector.hxx>
|
||||
#include <HatchGen_Domain.hxx>
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
|
||||
#include <IntTools_Tools.hxx>
|
||||
|
||||
#include <BOPTools_Tools3D.hxx>
|
||||
#include <BOPTools_Tools2D.hxx>
|
||||
|
||||
|
||||
|
||||
static
|
||||
Standard_Integer PntInEdge(const TopoDS_Edge& aF,
|
||||
gp_Pnt& aP);
|
||||
static
|
||||
Standard_Integer PntInEdge(const TopoDS_Edge& aF,
|
||||
gp_Pnt& aP,
|
||||
Standard_Real& aT);
|
||||
static
|
||||
Standard_Integer PntInFace(const TopoDS_Face& aF,
|
||||
gp_Pnt& aP);
|
||||
static
|
||||
Standard_Integer PntInFace(const TopoDS_Face& aF,
|
||||
gp_Pnt& aP,
|
||||
gp_Pnt2d& theP2D);
|
||||
static
|
||||
Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
|
||||
const Standard_Real aTol,
|
||||
gp_Pnt& aP);
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckCoincidence
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
|
||||
const TopoDS_Shape& aS2)
|
||||
{
|
||||
Standard_Boolean bOk, bIsDone;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aTol2, aD2;
|
||||
TopAbs_ShapeEnum aType1, aType2;
|
||||
TopAbs_State aState;
|
||||
gp_Pnt aP1, aP2;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
iErr=0;
|
||||
bOk=Standard_False;
|
||||
aTol2=myTolerance*myTolerance;
|
||||
aType1=aS1.ShapeType();
|
||||
aType2=aS2.ShapeType();
|
||||
//
|
||||
// 1. A point on shape #2 -> aP2
|
||||
if (myMapShapePnt.IsBound(aS2)) {
|
||||
aP2=myMapShapePnt.Find(aS2);
|
||||
}
|
||||
else {//else 1
|
||||
if (aType2==TopAbs_VERTEX) {
|
||||
const TopoDS_Vertex& aV2=*((TopoDS_Vertex*)&aS2);
|
||||
aP2=BRep_Tool::Pnt(aV2);
|
||||
}
|
||||
//
|
||||
else if (aType2==TopAbs_EDGE) {
|
||||
const TopoDS_Edge& aE2=*((TopoDS_Edge*)&aS2);
|
||||
iErr=PntInEdge(aE2, aP2);
|
||||
}
|
||||
//
|
||||
else if (aType2==TopAbs_FACE) {
|
||||
const TopoDS_Face& aF2=*((TopoDS_Face*)&aS2);
|
||||
iErr=PntInFace(aF2, aP2);
|
||||
}
|
||||
//
|
||||
else if (aType2==TopAbs_SOLID) {
|
||||
const TopoDS_Solid& aZ2=*((TopoDS_Solid*)&aS2);
|
||||
iErr=PntInSolid(aZ2, myTolerance, aP2);
|
||||
}
|
||||
//
|
||||
else {
|
||||
iErr=1;
|
||||
}
|
||||
//
|
||||
if (iErr) {
|
||||
myErrorStatus=50;
|
||||
return bOk;
|
||||
}
|
||||
//
|
||||
myMapShapePnt.Bind(aS2, aP2);
|
||||
} //else 1
|
||||
//
|
||||
// 2. Project the point aP2 on shape #1 and check
|
||||
if (aType1==TopAbs_EDGE) {
|
||||
Standard_Integer aNbPoints;
|
||||
Standard_Real aDmin, aT, aT1, aT2, dT;
|
||||
//
|
||||
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
|
||||
//
|
||||
GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1);
|
||||
aPPC.Perform(aP2);
|
||||
aNbPoints=aPPC.NbPoints();
|
||||
if (aNbPoints) {
|
||||
aDmin=aPPC.LowerDistance();
|
||||
aT=aPPC.LowerDistanceParameter();
|
||||
if (aDmin < myTolerance) {
|
||||
dT=1.e-12;
|
||||
BRep_Tool::Curve(aE1, aT1, aT2);
|
||||
if(aT > (aT1-dT) && aT < (aT2+dT)) {
|
||||
bOk=Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
//else {
|
||||
// iErr=2;
|
||||
//}
|
||||
}//if (aType1==TopAbs_EDGE) {
|
||||
//
|
||||
else if (aType1==TopAbs_FACE) {
|
||||
const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1);
|
||||
//
|
||||
bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance);
|
||||
}
|
||||
//
|
||||
else if (aType1==TopAbs_SOLID) {
|
||||
const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1);
|
||||
//
|
||||
BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1);
|
||||
aSC.Perform(aP2, myTolerance);
|
||||
aState=aSC.State();
|
||||
bOk=(aState==TopAbs_IN);
|
||||
}
|
||||
//
|
||||
if (iErr) {
|
||||
myErrorStatus=50;
|
||||
}
|
||||
//
|
||||
return bOk;
|
||||
}
|
||||
//=======================================================================
|
||||
//
|
||||
//=======================================================================
|
||||
//function : PntInEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PntInEdge(const TopoDS_Edge& aE,
|
||||
gp_Pnt& aP)
|
||||
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aT;
|
||||
//
|
||||
iErr=PntInEdge(aE, aP, aT);
|
||||
//
|
||||
return iErr;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PntInEdge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PntInEdge(const TopoDS_Edge& aE,
|
||||
gp_Pnt& aP,
|
||||
Standard_Real& aT)
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aT1, aT2;
|
||||
Handle(Geom_Curve) aC3D;
|
||||
//
|
||||
iErr=0;
|
||||
//
|
||||
aC3D=BRep_Tool::Curve(aE, aT1, aT2);
|
||||
aT=IntTools_Tools::IntermediatePoint(aT1, aT2);
|
||||
aC3D->D0(aT, aP);
|
||||
//
|
||||
return iErr;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PntInSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
|
||||
const Standard_Real aTol,
|
||||
gp_Pnt& aP)
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aUx, aVx, aCoef;
|
||||
gp_Pnt aPx;
|
||||
gp_Pnt2d aP2Dx;
|
||||
gp_Vec aDNx;
|
||||
|
||||
TopoDS_Face aF;
|
||||
TopExp_Explorer aExp;
|
||||
//
|
||||
iErr=0;
|
||||
aCoef=10.;
|
||||
//
|
||||
aExp.Init (aZ, TopAbs_FACE);
|
||||
for (; aExp.More() ; aExp.Next()) {
|
||||
aF=*((TopoDS_Face*)&aExp.Current());
|
||||
break;
|
||||
}
|
||||
//
|
||||
iErr=PntInFace(aF, aPx, aP2Dx);
|
||||
if (iErr) {
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
aP2Dx.Coord(aUx, aVx);
|
||||
BOPTools_Tools2D::FaceNormal(aF, aUx, aVx, aDNx);
|
||||
aDNx.Reverse();
|
||||
//
|
||||
aP.SetXYZ(aPx.XYZ()+aCoef*aTol*aDNx.XYZ());
|
||||
//
|
||||
return iErr;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PntInFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PntInFace(const TopoDS_Face& aF,
|
||||
gp_Pnt& aP)
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
//
|
||||
gp_Pnt2d aP2Dx;
|
||||
//
|
||||
iErr=PntInFace(aF, aP, aP2Dx);
|
||||
//
|
||||
return iErr;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PntInFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer PntInFace(const TopoDS_Face& aF,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D)
|
||||
{
|
||||
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
|
||||
Standard_Integer iErr, aIx, aNbDomains, i;
|
||||
Standard_Real aUMin, aUMax, aVMin, aVMax;
|
||||
Standard_Real aVx, aUx, aV1, aV2, aU1, aU2, aEpsT;
|
||||
Standard_Real aTotArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D;
|
||||
gp_Dir2d aD2D (0., 1.);
|
||||
gp_Pnt2d aP2D;
|
||||
gp_Pnt aPx;
|
||||
Handle(Geom2d_Curve) aC2D;
|
||||
Handle(Geom2d_TrimmedCurve) aCT2D;
|
||||
Handle(Geom2d_Line) aL2D;
|
||||
Handle(Geom_Surface) aS;
|
||||
TopAbs_Orientation aOrE;
|
||||
TopoDS_Face aFF;
|
||||
TopExp_Explorer aExp;
|
||||
//
|
||||
aTolHatch2D=1.e-8;
|
||||
aTolHatch3D=1.e-8;
|
||||
aTotArcIntr=1.e-10;
|
||||
aTolTangfIntr=1.e-10;
|
||||
//
|
||||
Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
|
||||
Geom2dHatch_Hatcher aHatcher(aIntr,
|
||||
aTolHatch2D, aTolHatch3D,
|
||||
Standard_True, Standard_False);
|
||||
//
|
||||
iErr=0;
|
||||
aEpsT=1.e-12;
|
||||
//
|
||||
aFF=aF;
|
||||
aFF.Orientation (TopAbs_FORWARD);
|
||||
//
|
||||
aS=BRep_Tool::Surface(aFF);
|
||||
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
|
||||
//
|
||||
// 1
|
||||
aExp.Init (aFF, TopAbs_EDGE);
|
||||
for (; aExp.More() ; aExp.Next()) {
|
||||
const TopoDS_Edge& aE=*((TopoDS_Edge*)&aExp.Current());
|
||||
aOrE=aE.Orientation();
|
||||
//
|
||||
aC2D=BRep_Tool::CurveOnSurface (aE, aFF, aU1, aU2);
|
||||
if (aC2D.IsNull() ) {
|
||||
iErr=1;
|
||||
return iErr;
|
||||
}
|
||||
if (fabs(aU1-aU2) < aEpsT) {
|
||||
iErr=2;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
aCT2D=new Geom2d_TrimmedCurve(aC2D, aU1, aU2);
|
||||
aHatcher.AddElement(aCT2D, aOrE);
|
||||
}// for (; aExp.More() ; aExp.Next()) {
|
||||
//
|
||||
// 2
|
||||
aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
|
||||
aP2D.SetCoord(aUx, 0.);
|
||||
aL2D=new Geom2d_Line (aP2D, aD2D);
|
||||
Geom2dAdaptor_Curve aHCur(aL2D);
|
||||
//
|
||||
aIx=aHatcher.AddHatching(aHCur) ;
|
||||
//
|
||||
// 3.
|
||||
aHatcher.Trim();
|
||||
bIsDone=aHatcher.TrimDone(aIx);
|
||||
if (!bIsDone) {
|
||||
iErr=3;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
aHatcher.ComputeDomains(aIx);
|
||||
bIsDone=aHatcher.IsDone(aIx);
|
||||
if (!bIsDone) {
|
||||
iErr=4;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
// 4.
|
||||
aNbDomains=aHatcher.NbDomains(aIx);
|
||||
for (i=1; i<=aNbDomains; ++i) {
|
||||
const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
|
||||
bHasFirstPoint=aDomain.HasFirstPoint();
|
||||
if (!bHasFirstPoint) {
|
||||
iErr=5;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
aV1=aDomain.FirstPoint().Parameter();
|
||||
//
|
||||
bHasSecondPoint=aDomain.HasSecondPoint();
|
||||
if (!bHasSecondPoint) {
|
||||
iErr=6;
|
||||
return iErr;
|
||||
}
|
||||
//
|
||||
aV2=aDomain.SecondPoint().Parameter();
|
||||
//
|
||||
aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
|
||||
//
|
||||
break;
|
||||
}
|
||||
//
|
||||
aS->D0(aUx, aVx, aPx);
|
||||
//
|
||||
theP2D.SetCoord(aUx, aVx);
|
||||
theP=aPx;
|
||||
//
|
||||
return iErr;
|
||||
}
|
||||
|
232
src/GEOMAlgo/GEOMAlgo_GetInPlace_2.cxx
Normal file
232
src/GEOMAlgo/GEOMAlgo_GetInPlace_2.cxx
Normal file
@ -0,0 +1,232 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_GetInPlace_2.cxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
|
||||
#include <GEOMAlgo_GetInPlace.hxx>
|
||||
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <BRepGProp.hxx>
|
||||
|
||||
|
||||
static
|
||||
Standard_Integer Dimension(const TopAbs_ShapeEnum aType);
|
||||
static
|
||||
void PointProperties(const TopoDS_Shape& aS,
|
||||
GProp_GProps& aGProps);
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckGProps
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GetInPlace::CheckGProps()
|
||||
{
|
||||
myFound=Standard_False;
|
||||
CheckGProps(myArgument);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : CheckGProps
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GetInPlace::CheckGProps(const TopoDS_Shape& aS1)
|
||||
{
|
||||
Standard_Boolean bOnlyClosed;
|
||||
Standard_Integer iDim, aNbS2;
|
||||
Standard_Real aMass1, aMass2, aD2, aTolCG2, dM;
|
||||
TopAbs_ShapeEnum aType1;
|
||||
gp_Pnt aCG1, aCG2;
|
||||
TopoDS_Iterator aIt;
|
||||
TopoDS_Compound aC2;
|
||||
BRep_Builder aBB;
|
||||
TopTools_ListIteratorOfListOfShape aItLS;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
aType1=aS1.ShapeType();
|
||||
if (aType1==TopAbs_COMPOUND) {
|
||||
aIt.Initialize(aS1);
|
||||
for(; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aS1x=aIt.Value();
|
||||
CheckGProps(aS1x);
|
||||
if (!myFound) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
iDim=Dimension(aType1);
|
||||
//
|
||||
if (!myImages.IsBound(aS1)) {
|
||||
// it should not be.
|
||||
return;
|
||||
}
|
||||
const TopTools_ListOfShape& aLS2=myImages.Find(aS1);
|
||||
aNbS2=aLS2.Extent();
|
||||
if (!aNbS2) {
|
||||
// it should not be.
|
||||
return;
|
||||
}
|
||||
//
|
||||
aBB.MakeCompound(aC2);
|
||||
aItLS.Initialize(aLS2);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aS2x=aItLS.Value();
|
||||
aBB.Add(aC2, aS2x);
|
||||
}
|
||||
//-------------------------
|
||||
GProp_GProps aG1, aG2;
|
||||
//
|
||||
aTolCG2=myTolCG*myTolCG;
|
||||
bOnlyClosed=Standard_False;
|
||||
//
|
||||
if (iDim==0) {
|
||||
PointProperties(aS1, aG1);
|
||||
PointProperties(aC2, aG2);
|
||||
}
|
||||
else if (iDim==1) {
|
||||
BRepGProp::LinearProperties(aS1, aG1);
|
||||
BRepGProp::LinearProperties(aC2, aG2);
|
||||
}
|
||||
else if (iDim==2) {
|
||||
BRepGProp::SurfaceProperties(aS1, aG1);
|
||||
BRepGProp::SurfaceProperties(aC2, aG2);
|
||||
}
|
||||
else if (iDim==3) {
|
||||
BRepGProp::VolumeProperties(aS1, aG1, bOnlyClosed);
|
||||
BRepGProp::VolumeProperties(aC2, aG2, bOnlyClosed);
|
||||
}
|
||||
//
|
||||
aMass1=aG1.Mass();
|
||||
aMass2=aG2.Mass();
|
||||
aCG1=aG1.CentreOfMass();
|
||||
aCG2=aG2.CentreOfMass();
|
||||
//
|
||||
dM=fabs(aMass1-aMass2);
|
||||
if (aMass1 > myTolMass) {
|
||||
dM=dM/aMass1;
|
||||
}
|
||||
//
|
||||
aD2=aCG1.SquareDistance(aCG2);
|
||||
//
|
||||
if ((dM > myTolMass) || (aD2 > aTolCG2)) {
|
||||
myFound=Standard_False;
|
||||
return;
|
||||
}
|
||||
myFound=Standard_True;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Dimension
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer Dimension(const TopAbs_ShapeEnum aType)
|
||||
{
|
||||
Standard_Integer iDim;
|
||||
//
|
||||
iDim=-1;
|
||||
switch (aType) {
|
||||
case TopAbs_VERTEX:
|
||||
iDim=0;
|
||||
break;
|
||||
case TopAbs_EDGE:
|
||||
case TopAbs_WIRE:
|
||||
iDim=1;
|
||||
break;
|
||||
case TopAbs_FACE:
|
||||
case TopAbs_SHELL:
|
||||
iDim=2;
|
||||
break;
|
||||
case TopAbs_SOLID:
|
||||
case TopAbs_COMPSOLID:
|
||||
iDim=3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return iDim;
|
||||
}
|
||||
//=======================================================================
|
||||
//class : GEOMAlgo_GProps
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class GEOMAlgo_GProps : public GProp_GProps {
|
||||
public:
|
||||
GEOMAlgo_GProps() : GProp_GProps() {
|
||||
};
|
||||
//
|
||||
GEOMAlgo_GProps(const gp_Pnt& aPLoc) : GProp_GProps(aPLoc) {
|
||||
};
|
||||
//
|
||||
~GEOMAlgo_GProps() {
|
||||
};
|
||||
//
|
||||
void SetMass(const Standard_Real aMass) {
|
||||
dim=aMass;
|
||||
}
|
||||
//
|
||||
void SetCG(const gp_Pnt& aPCG) {
|
||||
g=aPCG;
|
||||
}
|
||||
};
|
||||
//=======================================================================
|
||||
//function : PointProperties
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PointProperties(const TopoDS_Shape& aS, GProp_GProps& aGProps)
|
||||
{
|
||||
Standard_Integer i, aNbS;
|
||||
Standard_Real aDensity;
|
||||
gp_Pnt aPX;
|
||||
TopTools_IndexedMapOfShape aMS;
|
||||
//
|
||||
aDensity=1.;
|
||||
//
|
||||
TopExp::MapShapes(aS, TopAbs_VERTEX, aMS);
|
||||
aNbS=aMS.Extent();
|
||||
for (i=1; i<=aNbS; ++i) {
|
||||
GEOMAlgo_GProps aGPropsX;
|
||||
//
|
||||
const TopoDS_Vertex& aVX=*((TopoDS_Vertex*)&aMS(i));
|
||||
aPX=BRep_Tool::Pnt(aVX);
|
||||
aGPropsX.SetMass(1.);
|
||||
aGPropsX.SetCG(aPX);
|
||||
aGProps.Add(aGPropsX, aDensity);
|
||||
}
|
||||
}
|
172
src/GEOMAlgo/GEOMAlgo_GetInPlace_3.cxx
Normal file
172
src/GEOMAlgo/GEOMAlgo_GetInPlace_3.cxx
Normal file
@ -0,0 +1,172 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_GetInPlaceIterator.cxx
|
||||
// Created:
|
||||
// Author: Peter KURNEV
|
||||
|
||||
#include <GEOMAlgo_GetInPlace.hxx>
|
||||
|
||||
#include <NMTTools_CoupleOfShape.hxx>
|
||||
|
||||
static
|
||||
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
|
||||
const TopAbs_ShapeEnum aType2);
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_GetInPlaceIterator::GEOMAlgo_GetInPlaceIterator()
|
||||
{
|
||||
myDim=10;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
GEOMAlgo_GetInPlaceIterator::~GEOMAlgo_GetInPlaceIterator()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GetInPlaceIterator::Clear()
|
||||
{
|
||||
Standard_Integer i;
|
||||
//
|
||||
for (i=0; i<myDim; ++i) {
|
||||
myLists[i].Clear();
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AppendPair
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GetInPlaceIterator::AppendPair(const NMTTools_CoupleOfShape& theCS)
|
||||
{
|
||||
Standard_Integer iX;
|
||||
TopAbs_ShapeEnum aType1, aType2;
|
||||
//
|
||||
const TopoDS_Shape& aS1=theCS.Shape1();
|
||||
const TopoDS_Shape& aS2=theCS.Shape2();
|
||||
aType1=aS1.ShapeType();
|
||||
aType2=aS2.ShapeType();
|
||||
//
|
||||
iX=TypeToInteger(aType1, aType2);
|
||||
if (iX>=0) {
|
||||
myLists[iX].Append(theCS);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ShapeWhere
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GetInPlaceIterator::Initialize(const TopAbs_ShapeEnum aType1,
|
||||
const TopAbs_ShapeEnum aType2)
|
||||
{
|
||||
Standard_Integer iX;
|
||||
//
|
||||
iX=TypeToInteger(aType1, aType2);
|
||||
if (iX>=0) {
|
||||
myIterator.Initialize(myLists[iX]);
|
||||
}
|
||||
else {
|
||||
myIterator.Initialize(myEmptyList);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
// function: More
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean GEOMAlgo_GetInPlaceIterator::More()const
|
||||
{
|
||||
return myIterator.More();
|
||||
}
|
||||
//=======================================================================
|
||||
// function: Next
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void GEOMAlgo_GetInPlaceIterator::Next()
|
||||
{
|
||||
myIterator.Next();
|
||||
}
|
||||
//=======================================================================
|
||||
// function: Value
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
const NMTTools_CoupleOfShape& GEOMAlgo_GetInPlaceIterator::Value()const
|
||||
{
|
||||
return myIterator.Value();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TypeToInteger
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
|
||||
const TopAbs_ShapeEnum aType2)
|
||||
{
|
||||
Standard_Integer iRet, iT1, iT2, iX;
|
||||
//
|
||||
iRet=-1;
|
||||
//
|
||||
if (aType1==TopAbs_VERTEX) {
|
||||
if (aType2==TopAbs_VERTEX) {
|
||||
iRet=0;
|
||||
}
|
||||
}
|
||||
else if (aType1==TopAbs_EDGE) {
|
||||
if (aType2==TopAbs_VERTEX) {
|
||||
iRet=1;
|
||||
}
|
||||
else if (aType2==TopAbs_EDGE) {
|
||||
iRet=2;
|
||||
}
|
||||
}
|
||||
else if (aType1==TopAbs_FACE) {
|
||||
if (aType2==TopAbs_VERTEX) {
|
||||
iRet=3;
|
||||
}
|
||||
else if (aType2==TopAbs_EDGE) {
|
||||
iRet=4;
|
||||
}
|
||||
else if (aType2==TopAbs_FACE) {
|
||||
iRet=5;
|
||||
}
|
||||
}
|
||||
// So_1,*_2
|
||||
else if (aType1==TopAbs_SOLID) {
|
||||
if (aType2==TopAbs_VERTEX) {
|
||||
iRet=6;
|
||||
}
|
||||
else if (aType2==TopAbs_EDGE) {
|
||||
iRet=7;
|
||||
}
|
||||
else if (aType2==TopAbs_FACE) {
|
||||
iRet=8;
|
||||
}
|
||||
else if (aType2==TopAbs_SOLID) {
|
||||
iRet=9;
|
||||
}
|
||||
}
|
||||
return iRet;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_DefineHandle_HeaderFile
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_TCollection_MapNode_HeaderFile
|
||||
#include <Handle_TCollection_MapNode.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle(Standard_Type);
|
||||
class Handle(TCollection_MapNode);
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape,TCollection_MapNode)
|
||||
|
||||
#endif
|
@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
//
|
||||
// Copyright (C) 2003-2007 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_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_DefineHandle_HeaderFile
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Handle_TCollection_MapNode_HeaderFile
|
||||
#include <Handle_TCollection_MapNode.hxx>
|
||||
#endif
|
||||
|
||||
class Standard_Transient;
|
||||
class Handle(Standard_Type);
|
||||
class Handle(TCollection_MapNode);
|
||||
class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt,TCollection_MapNode)
|
||||
|
||||
#endif
|
@ -16,11 +16,10 @@
|
||||
#
|
||||
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
#
|
||||
|
||||
# GEOM GEOMAlgo : tools for Glue Faces algorithm
|
||||
# File : Makefile.in
|
||||
# Author : Julia DOROVSKIKH
|
||||
# Module : GEOM
|
||||
# GEOM GEOMAlgo : tools for Glue Faces algorithm
|
||||
# File : Makefile.am
|
||||
# Author : Julia DOROVSKIKH
|
||||
# Module : GEOM
|
||||
|
||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
||||
|
||||
@ -56,24 +55,34 @@ dist_libGEOMAlgo_la_SOURCES = \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_0.cxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_0.cxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_0.cxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_0.cxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_0.cxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_0.cxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_0.cxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_0.cxx \
|
||||
GEOMAlgo_DataMapOfOrientedShapeShape_0.cxx \
|
||||
GEOMAlgo_DataMapOfPassKeyInteger_0.cxx \
|
||||
GEOMAlgo_DataMapOfPassKeyShapeShape_0.cxx \
|
||||
GEOMAlgo_DataMapOfRealListOfShape_0.cxx \
|
||||
GEOMAlgo_DataMapOfShapeMapOfShape_0.cxx \
|
||||
GEOMAlgo_DataMapOfShapePnt_0.cxx \
|
||||
GEOMAlgo_DataMapOfShapeReal_0.cxx \
|
||||
GEOMAlgo_DataMapOfShapeShapeSet_0.cxx \
|
||||
GEOMAlgo_FinderShapeOn1.cxx \
|
||||
GEOMAlgo_FinderShapeOn2.cxx \
|
||||
GEOMAlgo_FinderShapeOn.cxx \
|
||||
GEOMAlgo_FinderShapeOnQuad.cxx \
|
||||
GEOMAlgo_GetInPlace.cxx \
|
||||
GEOMAlgo_GetInPlace_1.cxx \
|
||||
GEOMAlgo_GetInPlace_2.cxx \
|
||||
GEOMAlgo_GetInPlace_3.cxx \
|
||||
GEOMAlgo_GlueAnalyser.cxx \
|
||||
GEOMAlgo_Gluer.cxx \
|
||||
GEOMAlgo_GlueDetector.cxx \
|
||||
@ -193,18 +202,24 @@ salomeinclude_HEADERS = \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx \
|
||||
GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \
|
||||
GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \
|
||||
GEOMAlgo_DataMapOfOrientedShapeShape.hxx \
|
||||
GEOMAlgo_DataMapOfPassKeyInteger.hxx \
|
||||
GEOMAlgo_DataMapOfPassKeyShapeShape.hxx \
|
||||
GEOMAlgo_DataMapOfRealListOfShape.hxx \
|
||||
GEOMAlgo_DataMapOfShapeMapOfShape.hxx \
|
||||
GEOMAlgo_DataMapOfShapePnt.hxx \
|
||||
GEOMAlgo_DataMapOfShapeReal.hxx \
|
||||
GEOMAlgo_DataMapOfShapeShapeSet.hxx \
|
||||
GEOMAlgo_FinderShapeOn1.ixx \
|
||||
@ -217,6 +232,7 @@ salomeinclude_HEADERS = \
|
||||
GEOMAlgo_FinderShapeOn.ixx \
|
||||
GEOMAlgo_FinderShapeOn.jxx \
|
||||
GEOMAlgo_FinderShapeOnQuad.hxx \
|
||||
GEOMAlgo_GetInPlace.hxx \
|
||||
GEOMAlgo_GlueAnalyser.hxx \
|
||||
GEOMAlgo_GlueAnalyser.ixx \
|
||||
GEOMAlgo_GlueAnalyser.jxx \
|
||||
@ -329,6 +345,8 @@ salomeinclude_HEADERS = \
|
||||
Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \
|
||||
Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \
|
||||
Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \
|
||||
Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx \
|
||||
Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx \
|
||||
Handle_GEOMAlgo_HAlgo.hxx \
|
||||
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
|
||||
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \
|
||||
|
@ -46,14 +46,15 @@
|
||||
#include "GEOM_ISubShape.hxx"
|
||||
#include "GEOM_PythonDump.hxx"
|
||||
|
||||
#include "GEOMAlgo_ClsfBox.hxx"
|
||||
#include "GEOMAlgo_ClsfSolid.hxx"
|
||||
#include "GEOMAlgo_CoupleOfShapes.hxx"
|
||||
#include "GEOMAlgo_FinderShapeOn1.hxx"
|
||||
#include "GEOMAlgo_FinderShapeOnQuad.hxx"
|
||||
#include "GEOMAlgo_FinderShapeOn2.hxx"
|
||||
#include "GEOMAlgo_ClsfBox.hxx"
|
||||
#include "GEOMAlgo_ClsfSolid.hxx"
|
||||
#include "GEOMAlgo_GetInPlace.hxx"
|
||||
#include "GEOMAlgo_GlueDetector.hxx"
|
||||
#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
|
||||
#include "GEOMAlgo_CoupleOfShapes.hxx"
|
||||
#include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
@ -3782,6 +3783,174 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
||||
TopTools_IndexedMapOfShape aWhereIndices;
|
||||
TopExp::MapShapes(aWhere, aWhereIndices);
|
||||
|
||||
TopAbs_ShapeEnum iType = TopAbs_SOLID;
|
||||
Standard_Real dl_l = 1e-3;
|
||||
Standard_Real min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
|
||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||
Bnd_Box BoundingBox;
|
||||
gp_Pnt aPnt, aPnt_aWhat, tab_Pnt[2];
|
||||
GProp_GProps aProps;
|
||||
|
||||
// Find the iType of the aWhat shape
|
||||
iType = GetTypeOfSimplePart(aWhat);
|
||||
if (iType == TopAbs_SHAPE) {
|
||||
SetErrorCode("Error: An attempt to extract a shape of not supported type.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TopExp_Explorer Exp_aWhat ( aWhat, iType );
|
||||
TopExp_Explorer Exp_aWhere ( aWhere, iType );
|
||||
TopExp_Explorer Exp_Edge ( aWhere, TopAbs_EDGE );
|
||||
|
||||
// Find the shortest edge in theShapeWhere shape
|
||||
BRepBndLib::Add(aWhere, BoundingBox);
|
||||
BoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||
min_l = fabs(aXmax - aXmin);
|
||||
if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
|
||||
if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
|
||||
min_l /= dl_l;
|
||||
// Mantis issue 0020908 BEGIN
|
||||
if (!Exp_Edge.More()) {
|
||||
min_l = Precision::Confusion();
|
||||
}
|
||||
// Mantis issue 0020908 END
|
||||
for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
|
||||
TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX);
|
||||
for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) {
|
||||
aPnt = BRep_Tool::Pnt( TopoDS::Vertex( Exp_Vertex.Current() ) );
|
||||
tab_Pnt[nbVertex] = aPnt;
|
||||
}
|
||||
if ( ! tab_Pnt[0].IsEqual(tab_Pnt[1], dl_l) ) {
|
||||
BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
|
||||
if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
|
||||
}
|
||||
}
|
||||
|
||||
// Compute tolerances
|
||||
Tol_0D = dl_l;
|
||||
Tol_1D = dl_l * min_l;
|
||||
Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
|
||||
Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
|
||||
|
||||
if (Tol_0D < Precision::Confusion()) Tol_0D = Precision::Confusion();
|
||||
if (Tol_1D < Precision::Confusion()) Tol_1D = Precision::Confusion();
|
||||
if (Tol_2D < Precision::Confusion()) Tol_2D = Precision::Confusion();
|
||||
if (Tol_3D < Precision::Confusion()) Tol_3D = Precision::Confusion();
|
||||
|
||||
Tol_Mass = Tol_3D;
|
||||
if ( iType == TopAbs_VERTEX ) Tol_Mass = Tol_0D;
|
||||
else if ( iType == TopAbs_EDGE ) Tol_Mass = Tol_1D;
|
||||
else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
|
||||
|
||||
// Searching for the sub-shapes inside the ShapeWhere shape
|
||||
GEOMAlgo_GetInPlace aGIP;
|
||||
aGIP.SetTolerance(Tol_1D);
|
||||
aGIP.SetTolMass(Tol_Mass);
|
||||
aGIP.SetTolCG(Tol_1D);
|
||||
|
||||
aGIP.SetArgument(aWhat);
|
||||
aGIP.SetShapeWhere(aWhere);
|
||||
|
||||
aGIP.Perform();
|
||||
int iErr = aGIP.ErrorStatus();
|
||||
if (iErr) {
|
||||
SetErrorCode("Error in GEOMAlgo_GetInPlace");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!aGIP.IsFound()) {
|
||||
SetErrorCode(NOT_FOUND_ANY);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const TopTools_DataMapOfShapeListOfShape& aDMSLS = aGIP.Images();
|
||||
if (!aDMSLS.IsBound(aWhat)) {
|
||||
SetErrorCode(NOT_FOUND_ANY);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// the list of shapes aLSA contains the shapes
|
||||
// of the Shape For Search that corresponds
|
||||
// to the Argument aWhat
|
||||
const TopTools_ListOfShape& aLSA = aDMSLS.Find(aWhat);
|
||||
if (aLSA.Extent() == 0) {
|
||||
SetErrorCode(NOT_FOUND_ANY); // Not found any Results
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Handle(TColStd_HArray1OfInteger) aModifiedArray = new TColStd_HArray1OfInteger (1, aLSA.Extent());
|
||||
TopTools_ListIteratorOfListOfShape anIterModif (aLSA);
|
||||
for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
|
||||
if (aWhereIndices.Contains(anIterModif.Value())) {
|
||||
aModifiedArray->SetValue(imod, aWhereIndices.FindIndex(anIterModif.Value()));
|
||||
}
|
||||
else {
|
||||
SetErrorCode("Error: wrong sub shape returned");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//Add a new object
|
||||
Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
|
||||
if (aResult.IsNull()) {
|
||||
SetErrorCode("Error in algorithm: result found, but cannot be returned.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (aModifiedArray->Length() > 1) {
|
||||
//Set a GROUP type
|
||||
aResult->SetType(GEOM_GROUP);
|
||||
|
||||
//Set a sub shape type
|
||||
TopoDS_Shape aFirstFound = aLSA.First();
|
||||
TopAbs_ShapeEnum aShapeType = aFirstFound.ShapeType();
|
||||
|
||||
TDF_Label aFreeLabel = aResult->GetFreeLabel();
|
||||
TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)aShapeType);
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
|
||||
|
||||
GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
|
||||
<< theShapeWhere << ", " << theShapeWhat << ", True)";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* case GetInPlaceOld:
|
||||
* default:
|
||||
*/
|
||||
//=============================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
|
||||
|
||||
TopoDS_Shape aWhere = theShapeWhere->GetValue();
|
||||
TopoDS_Shape aWhat = theShapeWhat->GetValue();
|
||||
TopoDS_Shape aPntShape;
|
||||
TopoDS_Vertex aVertex;
|
||||
|
||||
if (aWhere.IsNull() || aWhat.IsNull()) {
|
||||
SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
|
||||
if (aWhereFunction.IsNull()) {
|
||||
SetErrorCode("Error: aWhereFunction is Null.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TopTools_IndexedMapOfShape aWhereIndices;
|
||||
TopExp::MapShapes(aWhere, aWhereIndices);
|
||||
|
||||
TColStd_ListOfInteger aModifiedList;
|
||||
Standard_Integer aWhereIndex;
|
||||
Handle(TColStd_HArray1OfInteger) aModifiedArray;
|
||||
@ -3972,7 +4141,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
||||
Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
|
||||
|
||||
GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
|
||||
<< theShapeWhere << ", " << theShapeWhat << ")";
|
||||
<< theShapeWhere << ", " << theShapeWhat << ", False)";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aResult;
|
||||
|
@ -290,6 +290,9 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
|
||||
Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
|
||||
Handle(GEOM_Object) theShapeWhat);
|
||||
|
||||
|
@ -1739,6 +1739,36 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlace
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetInPlaceOld
|
||||
*/
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceOld
|
||||
(GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
//Set a not done flag
|
||||
GetOperations()->SetNotDone();
|
||||
|
||||
//Get the reference objects
|
||||
Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
|
||||
Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
|
||||
|
||||
if (aShapeWhere.IsNull() ||
|
||||
aShapeWhat.IsNull()) return aGEOMObject._retn();
|
||||
|
||||
//Get Shapes in place of aShapeWhat
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->GetInPlaceOld(aShapeWhere, aShapeWhat);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* GetInPlaceByHistory
|
||||
|
@ -255,6 +255,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
|
||||
GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat);
|
||||
|
||||
GEOM::GEOM_Object_ptr GetInPlaceOld (GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat);
|
||||
|
||||
GEOM::GEOM_Object_ptr GetInPlaceByHistory (GEOM::GEOM_Object_ptr theShapeWhere,
|
||||
GEOM::GEOM_Object_ptr theShapeWhat);
|
||||
|
||||
|
@ -2154,9 +2154,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
||||
# @image html get_in_place_lost_part.png
|
||||
#
|
||||
# @ref swig_GetInPlace "Example"
|
||||
def GetInPlace(self, theShapeWhere, theShapeWhat):
|
||||
def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
|
||||
# Example: see GEOM_TestOthers.py
|
||||
anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
|
||||
anObj = None
|
||||
if isNewImplementation:
|
||||
anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
|
||||
else:
|
||||
anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
|
||||
pass
|
||||
RaiseIfFailed("GetInPlace", self.ShapesOp)
|
||||
return anObj
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user