mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-15 21:21:22 +05:00
Second version of PartAlgo.
This commit is contained in:
parent
1d64e6d16a
commit
c9abd4028b
@ -0,0 +1,72 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
#define _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.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 NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape);
|
||||
|
||||
class Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) : public Handle(TCollection_MapNode) {
|
||||
public:
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)():Handle(TCollection_MapNode)() {}
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& aHandle) : Handle(TCollection_MapNode)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& operator=(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& operator=(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape* operator->() const
|
||||
{
|
||||
return (NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape *)ControlAccess();
|
||||
}
|
||||
|
||||
// Standard_EXPORT ~Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)();
|
||||
|
||||
Standard_EXPORT static const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
@ -0,0 +1,72 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
#define _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.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 NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox;
|
||||
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox);
|
||||
|
||||
class Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) : public Handle(TCollection_MapNode) {
|
||||
public:
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)():Handle(TCollection_MapNode)() {}
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& aHandle) : Handle(TCollection_MapNode)(aHandle)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
|
||||
{
|
||||
}
|
||||
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& operator=(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& aHandle)
|
||||
{
|
||||
Assign(aHandle.Access());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& operator=(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox* anItem)
|
||||
{
|
||||
Assign((Standard_Transient *)anItem);
|
||||
return *this;
|
||||
}
|
||||
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox* operator->() const
|
||||
{
|
||||
return (NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox *)ControlAccess();
|
||||
}
|
||||
|
||||
// Standard_EXPORT ~Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)();
|
||||
|
||||
Standard_EXPORT static const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
};
|
||||
#endif
|
@ -40,11 +40,15 @@ LIB = libNMTDS.la
|
||||
LIB_SRC = \
|
||||
NMTDS_CArray1OfIndexRange_0.cxx \
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
|
||||
NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \
|
||||
NMTDS_IndexedDataMapOfIntegerShape_0.cxx \
|
||||
NMTDS_IndexedDataMapOfShapeBox_0.cxx \
|
||||
NMTDS_IndexRange.cxx \
|
||||
NMTDS_Iterator.cxx \
|
||||
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \
|
||||
NMTDS_ListIteratorOfListOfPassKey_0.cxx \
|
||||
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \
|
||||
NMTDS_ListIteratorOfListOfPassKey_0.cxx \
|
||||
NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \
|
||||
NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \
|
||||
NMTDS_ListNodeOfListOfPassKey_0.cxx \
|
||||
@ -69,6 +73,8 @@ LIB_SERVER_IDL =
|
||||
# header files
|
||||
EXPORT_HEADERS = \
|
||||
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
|
||||
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
|
||||
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
|
||||
Handle_NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
|
||||
Handle_NMTDS_ListNodeOfListOfPassKeyBoolean.hxx \
|
||||
Handle_NMTDS_ListNodeOfListOfPassKey.hxx \
|
||||
@ -76,7 +82,11 @@ EXPORT_HEADERS = \
|
||||
Handle_NMTDS_StdMapNodeOfMapOfPassKey.hxx \
|
||||
NMTDS_CArray1OfIndexRange.hxx \
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
|
||||
NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
|
||||
NMTDS_IndexedDataMapOfIntegerShape.hxx \
|
||||
NMTDS_IndexedDataMapOfShapeBox.hxx \
|
||||
NMTDS_IndexRange.hxx \
|
||||
NMTDS_Iterator.hxx \
|
||||
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
|
||||
@ -90,7 +100,7 @@ EXPORT_HEADERS = \
|
||||
NMTDS_ListOfPassKey.hxx \
|
||||
NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx \
|
||||
NMTDS_MapIteratorOfMapOfPassKey.hxx \
|
||||
NMTDS_MapOfPassKeyBoolean.hxx \
|
||||
NMTDS_MapOfPassKeyBoolean.hxx \
|
||||
NMTDS_MapOfPassKey.hxx \
|
||||
NMTDS_PassKeyBoolean.hxx \
|
||||
NMTDS_PassKey.hxx \
|
||||
|
@ -78,4 +78,16 @@ is
|
||||
Map from TCollection(PassKeyBoolean from NMTDS,
|
||||
PassKeyMapHasher from NMTDS);
|
||||
-- Contribution of Samtech www.samcef.com END
|
||||
|
||||
|
||||
class IndexedDataMapOfShapeBox
|
||||
instantiates IndexedDataMap from TCollection (Shape from TopoDS,
|
||||
Box from Bnd,
|
||||
ShapeMapHasher from TopTools);
|
||||
class IndexedDataMapOfIntegerShape
|
||||
instantiates IndexedDataMap from TCollection (Integer from Standard,
|
||||
Shape from TopoDS,
|
||||
MapIntegerHasher from TColStd);
|
||||
|
||||
|
||||
end NMTDS;
|
||||
|
@ -0,0 +1,132 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
#define _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
#include <Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||
#include <TCollection_MapNodePtr.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNode_HeaderFile
|
||||
#include <TCollection_MapNode.hxx>
|
||||
#endif
|
||||
class TopoDS_Shape;
|
||||
class TColStd_MapIntegerHasher;
|
||||
class NMTDS_IndexedDataMapOfIntegerShape;
|
||||
|
||||
|
||||
|
||||
class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape : public TCollection_MapNode {
|
||||
|
||||
public:
|
||||
// Methods PUBLIC
|
||||
//
|
||||
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape(const Standard_Integer& K1,const Standard_Integer K2,const TopoDS_Shape& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2);
|
||||
|
||||
Standard_Integer& Key1() const;
|
||||
|
||||
Standard_Integer& Key2() const;
|
||||
|
||||
TCollection_MapNodePtr& Next2() const;
|
||||
|
||||
TopoDS_Shape& Value() const;
|
||||
//Standard_EXPORT ~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
//Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
Standard_Integer myKey1;
|
||||
Standard_Integer myKey2;
|
||||
TopoDS_Shape myValue;
|
||||
TCollection_MapNodePtr myNext2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem TopoDS_Shape
|
||||
#define TheItem_hxx <TopoDS_Shape.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMapNode_hxx <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_()
|
||||
#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMap_hxx <NMTDS_IndexedDataMapOfIntegerShape.hxx>
|
||||
|
||||
#include <TCollection_IndexedDataMapNode.lxx>
|
||||
|
||||
#undef TheKey
|
||||
#undef TheKey_hxx
|
||||
#undef TheItem
|
||||
#undef TheItem_hxx
|
||||
#undef Hasher
|
||||
#undef Hasher_hxx
|
||||
#undef TCollection_IndexedDataMapNode
|
||||
#undef TCollection_IndexedDataMapNode_hxx
|
||||
#undef Handle_TCollection_IndexedDataMapNode
|
||||
#undef TCollection_IndexedDataMapNode_Type_
|
||||
#undef TCollection_IndexedDataMap
|
||||
#undef TCollection_IndexedDataMap_hxx
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,95 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#include <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_MapIntegerHasher_HeaderFile
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#endif
|
||||
#ifndef _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile
|
||||
#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
|
||||
#endif
|
||||
//NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_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("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape",
|
||||
sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape))) {
|
||||
_anOtherObject = Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)((Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) ;
|
||||
}
|
||||
//Standard_Boolean NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::IsKind(const Handle(Standard_Type)& AType) const
|
||||
//{
|
||||
// return (STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) == AType || TCollection_MapNode::IsKind(AType));
|
||||
//}
|
||||
//Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::~Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape() {}
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem TopoDS_Shape
|
||||
#define TheItem_hxx <TopoDS_Shape.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMapNode_hxx <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_()
|
||||
#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMap_hxx <NMTDS_IndexedDataMapOfIntegerShape.hxx>
|
||||
#include <TCollection_IndexedDataMapNode.gxx>
|
||||
|
136
src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx
Normal file
136
src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx
Normal file
@ -0,0 +1,136 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
#define _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
#include <Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Bnd_Box_HeaderFile
|
||||
#include <Bnd_Box.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNodePtr_HeaderFile
|
||||
#include <TCollection_MapNodePtr.hxx>
|
||||
#endif
|
||||
#ifndef _TCollection_MapNode_HeaderFile
|
||||
#include <TCollection_MapNode.hxx>
|
||||
#endif
|
||||
class TopoDS_Shape;
|
||||
class Bnd_Box;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class NMTDS_IndexedDataMapOfShapeBox;
|
||||
|
||||
|
||||
|
||||
class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox : public TCollection_MapNode {
|
||||
|
||||
public:
|
||||
// Methods PUBLIC
|
||||
//
|
||||
|
||||
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox(const TopoDS_Shape& K1,const Standard_Integer K2,const Bnd_Box& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2);
|
||||
|
||||
TopoDS_Shape& Key1() const;
|
||||
|
||||
Standard_Integer& Key2() const;
|
||||
|
||||
TCollection_MapNodePtr& Next2() const;
|
||||
|
||||
Bnd_Box& Value() const;
|
||||
//Standard_EXPORT ~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
//Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
TopoDS_Shape myKey1;
|
||||
Standard_Integer myKey2;
|
||||
Bnd_Box myValue;
|
||||
TCollection_MapNodePtr myNext2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem Bnd_Box
|
||||
#define TheItem_hxx <Bnd_Box.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMapNode_hxx <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx>
|
||||
#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_()
|
||||
#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMap_hxx <NMTDS_IndexedDataMapOfShapeBox.hxx>
|
||||
|
||||
#include <TCollection_IndexedDataMapNode.lxx>
|
||||
|
||||
#undef TheKey
|
||||
#undef TheKey_hxx
|
||||
#undef TheItem
|
||||
#undef TheItem_hxx
|
||||
#undef Hasher
|
||||
#undef Hasher_hxx
|
||||
#undef TCollection_IndexedDataMapNode
|
||||
#undef TCollection_IndexedDataMapNode_hxx
|
||||
#undef Handle_TCollection_IndexedDataMapNode
|
||||
#undef TCollection_IndexedDataMapNode_Type_
|
||||
#undef TCollection_IndexedDataMap
|
||||
#undef TCollection_IndexedDataMap_hxx
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,98 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#include <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _Bnd_Box_HeaderFile
|
||||
#include <Bnd_Box.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _NMTDS_IndexedDataMapOfShapeBox_HeaderFile
|
||||
#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
|
||||
#endif
|
||||
//NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_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("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox",
|
||||
sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox))) {
|
||||
_anOtherObject = Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)((Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) ;
|
||||
}
|
||||
//Standard_Boolean NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::IsKind(const Handle(Standard_Type)& AType) const
|
||||
//{
|
||||
// return (STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) == AType || TCollection_MapNode::IsKind(AType));
|
||||
//}
|
||||
//Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::~Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox() {}
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem Bnd_Box
|
||||
#define TheItem_hxx <Bnd_Box.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMapNode_hxx <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx>
|
||||
#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_()
|
||||
#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMap_hxx <NMTDS_IndexedDataMapOfShapeBox.hxx>
|
||||
#include <TCollection_IndexedDataMapNode.gxx>
|
||||
|
169
src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx
Normal file
169
src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx
Normal file
@ -0,0 +1,169 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile
|
||||
#define _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile
|
||||
|
||||
#ifndef _TCollection_BasicMap_HeaderFile
|
||||
#include <TCollection_BasicMap.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
#include <Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
class Standard_DomainError;
|
||||
class Standard_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class TColStd_MapIntegerHasher;
|
||||
class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
class NMTDS_IndexedDataMapOfIntegerShape : 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);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_IndexedDataMapOfIntegerShape(const Standard_Integer NbBuckets = 1);
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_IndexedDataMapOfIntegerShape& Assign(const NMTDS_IndexedDataMapOfIntegerShape& Other) ;
|
||||
NMTDS_IndexedDataMapOfIntegerShape& operator =(const NMTDS_IndexedDataMapOfIntegerShape& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||
|
||||
|
||||
Standard_EXPORT void Clear() ;
|
||||
~NMTDS_IndexedDataMapOfIntegerShape()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer Add(const Standard_Integer& K,const TopoDS_Shape& I) ;
|
||||
|
||||
|
||||
Standard_EXPORT void Substitute(const Standard_Integer I,const Standard_Integer& K,const TopoDS_Shape& T) ;
|
||||
|
||||
|
||||
Standard_EXPORT void RemoveLast() ;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean Contains(const Standard_Integer& K) const;
|
||||
|
||||
|
||||
Standard_EXPORT const Standard_Integer& FindKey(const Standard_Integer I) const;
|
||||
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& FindFromIndex(const Standard_Integer I) const;
|
||||
const TopoDS_Shape& operator ()(const Standard_Integer I) const
|
||||
{
|
||||
return FindFromIndex(I);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT TopoDS_Shape& ChangeFromIndex(const Standard_Integer I) ;
|
||||
TopoDS_Shape& operator ()(const Standard_Integer I)
|
||||
{
|
||||
return ChangeFromIndex(I);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer FindIndex(const Standard_Integer& K) const;
|
||||
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& FindFromKey(const Standard_Integer& K) const;
|
||||
|
||||
|
||||
Standard_EXPORT TopoDS_Shape& ChangeFromKey(const Standard_Integer& K) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_IndexedDataMapOfIntegerShape(const NMTDS_IndexedDataMapOfIntegerShape& Other);
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
55
src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape_0.cxx
Normal file
55
src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape_0.cxx
Normal file
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
|
||||
|
||||
#ifndef _Standard_DomainError_HeaderFile
|
||||
#include <Standard_DomainError.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_OutOfRange_HeaderFile
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_MapIntegerHasher_HeaderFile
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#endif
|
||||
#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile
|
||||
#include <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey Standard_Integer
|
||||
#define TheKey_hxx <Standard_Integer.hxx>
|
||||
#define TheItem TopoDS_Shape
|
||||
#define TheItem_hxx <TopoDS_Shape.hxx>
|
||||
#define Hasher TColStd_MapIntegerHasher
|
||||
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
|
||||
#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMapNode_hxx <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx>
|
||||
#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_()
|
||||
#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfIntegerShape
|
||||
#define TCollection_IndexedDataMap_hxx <NMTDS_IndexedDataMapOfIntegerShape.hxx>
|
||||
#include <TCollection_IndexedDataMap.gxx>
|
||||
|
170
src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx
Normal file
170
src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx
Normal file
@ -0,0 +1,170 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#ifndef _NMTDS_IndexedDataMapOfShapeBox_HeaderFile
|
||||
#define _NMTDS_IndexedDataMapOfShapeBox_HeaderFile
|
||||
|
||||
#ifndef _TCollection_BasicMap_HeaderFile
|
||||
#include <TCollection_BasicMap.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
#include <Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.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_OutOfRange;
|
||||
class Standard_NoSuchObject;
|
||||
class TopoDS_Shape;
|
||||
class Bnd_Box;
|
||||
class TopTools_ShapeMapHasher;
|
||||
class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Macro_HeaderFile
|
||||
#include <Standard_Macro.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
class NMTDS_IndexedDataMapOfShapeBox : 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);
|
||||
}
|
||||
// Methods PUBLIC
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_IndexedDataMapOfShapeBox(const Standard_Integer NbBuckets = 1);
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_IndexedDataMapOfShapeBox& Assign(const NMTDS_IndexedDataMapOfShapeBox& Other) ;
|
||||
NMTDS_IndexedDataMapOfShapeBox& operator =(const NMTDS_IndexedDataMapOfShapeBox& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
|
||||
|
||||
|
||||
Standard_EXPORT void Clear() ;
|
||||
~NMTDS_IndexedDataMapOfShapeBox()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer Add(const TopoDS_Shape& K,const Bnd_Box& I) ;
|
||||
|
||||
|
||||
Standard_EXPORT void Substitute(const Standard_Integer I,const TopoDS_Shape& K,const Bnd_Box& T) ;
|
||||
|
||||
|
||||
Standard_EXPORT void RemoveLast() ;
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Boolean Contains(const TopoDS_Shape& K) const;
|
||||
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& FindKey(const Standard_Integer I) const;
|
||||
|
||||
|
||||
Standard_EXPORT const Bnd_Box& FindFromIndex(const Standard_Integer I) const;
|
||||
const Bnd_Box& operator ()(const Standard_Integer I) const
|
||||
{
|
||||
return FindFromIndex(I);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Bnd_Box& ChangeFromIndex(const Standard_Integer I) ;
|
||||
Bnd_Box& operator ()(const Standard_Integer I)
|
||||
{
|
||||
return ChangeFromIndex(I);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Standard_Integer FindIndex(const TopoDS_Shape& K) const;
|
||||
|
||||
|
||||
Standard_EXPORT const Bnd_Box& FindFromKey(const TopoDS_Shape& K) const;
|
||||
|
||||
|
||||
Standard_EXPORT Bnd_Box& ChangeFromKey(const TopoDS_Shape& K) ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT NMTDS_IndexedDataMapOfShapeBox(const NMTDS_IndexedDataMapOfShapeBox& Other);
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other Inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
58
src/NMTDS/NMTDS_IndexedDataMapOfShapeBox_0.cxx
Normal file
58
src/NMTDS/NMTDS_IndexedDataMapOfShapeBox_0.cxx
Normal file
@ -0,0 +1,58 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
|
||||
#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
|
||||
|
||||
#ifndef _Standard_DomainError_HeaderFile
|
||||
#include <Standard_DomainError.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_OutOfRange_HeaderFile
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_NoSuchObject_HeaderFile
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#endif
|
||||
#ifndef _TopoDS_Shape_HeaderFile
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#endif
|
||||
#ifndef _Bnd_Box_HeaderFile
|
||||
#include <Bnd_Box.hxx>
|
||||
#endif
|
||||
#ifndef _TopTools_ShapeMapHasher_HeaderFile
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#endif
|
||||
#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile
|
||||
#include <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
#define TheKey TopoDS_Shape
|
||||
#define TheKey_hxx <TopoDS_Shape.hxx>
|
||||
#define TheItem Bnd_Box
|
||||
#define TheItem_hxx <Bnd_Box.hxx>
|
||||
#define Hasher TopTools_ShapeMapHasher
|
||||
#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>
|
||||
#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMapNode_hxx <NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx>
|
||||
#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_()
|
||||
#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfShapeBox
|
||||
#define TCollection_IndexedDataMap_hxx <NMTDS_IndexedDataMapOfShapeBox.hxx>
|
||||
#include <TCollection_IndexedDataMap.gxx>
|
||||
|
@ -27,7 +27,8 @@ class Iterator from NMTDS
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
uses
|
||||
DataMapOfIntegerListOfInteger from TColStd,
|
||||
ShapeEnum from TopAbs,
|
||||
ShapesDataStructure from NMTDS,
|
||||
PShapesDataStructure from NMTDS,
|
||||
@ -63,13 +64,20 @@ is
|
||||
Prepare(me:out);
|
||||
|
||||
ExpectedLength(me)
|
||||
returns Integer from Standard;
|
||||
returns Integer from Standard;
|
||||
|
||||
SDVertices(me)
|
||||
returns DataMapOfIntegerListOfInteger from TColStd;
|
||||
---C++:return const &
|
||||
|
||||
|
||||
fields
|
||||
myPDS :PShapesDataStructure from NMTDS is protected;
|
||||
myLists :ListOfPassKeyBoolean from NMTDS [6] is protected;
|
||||
myIterator :ListIteratorOfListOfPassKeyBoolean from NMTDS is protected;
|
||||
myEmptyList:ListOfPassKeyBoolean from NMTDS is protected;
|
||||
myLength :Integer from Standard is protected;
|
||||
|
||||
--
|
||||
myMVSD :DataMapOfIntegerListOfInteger from TColStd is protected;
|
||||
|
||||
end Iterator;
|
||||
|
@ -34,28 +34,30 @@
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <NMTDS_PassKeyBoolean.hxx>
|
||||
#include <NMTDS_MapOfPassKeyBoolean.hxx>
|
||||
#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
|
||||
#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
|
||||
#include <Bnd_HArray1OfBox.hxx>
|
||||
#include <Bnd_BoundSortBox.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <TColStd_DataMapOfIntegerInteger.hxx>
|
||||
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
|
||||
#include <TColStd_DataMapIteratorOfDataMapOfIntegerInteger.hxx>
|
||||
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
|
||||
static
|
||||
Bnd_Box& ComputeBoxEx(const Standard_Integer iX,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
Bnd_Box* pBoxes);
|
||||
static
|
||||
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType);
|
||||
void ComputeBoxEx(const Standard_Integer aIx,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
Bnd_Box& aBoxEx);
|
||||
|
||||
static inline
|
||||
Standard_Boolean IsValidType(const TopAbs_ShapeEnum aT);
|
||||
|
||||
static
|
||||
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
|
||||
const TopAbs_ShapeEnum aType2);
|
||||
static
|
||||
void PropagateState(const Standard_Integer aIDS1,
|
||||
const Standard_Integer aIDS2,
|
||||
const Standard_Integer iStatus,
|
||||
const Standard_Integer aNb,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
Standard_Integer *pTable);
|
||||
static
|
||||
void FillSuccessors(const Standard_Integer aIDS,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
TColStd_MapOfInteger& aMS);
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NMTDS_Iterator
|
||||
@ -145,20 +147,32 @@ static
|
||||
aWithSubShape=aPKB.Flag();
|
||||
}
|
||||
//=======================================================================
|
||||
// function: SDVertices
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
const TColStd_DataMapOfIntegerListOfInteger& NMTDS_Iterator::SDVertices()const
|
||||
{
|
||||
return myMVSD;
|
||||
}
|
||||
//=======================================================================
|
||||
// function: Prepare
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void NMTDS_Iterator::Prepare()
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Integer aNb, aNb2, aNbR, iR, jR1, jR2, jR;
|
||||
Standard_Integer *pTable, i, j, k, iT1, iT2, i1, i2, j1, j2, iT, jT;
|
||||
Standard_Integer iStatus, iX;
|
||||
Bnd_Box *pBoxes, aBox;
|
||||
TColStd_ListIteratorOfListOfInteger aItIT, aItJT;
|
||||
Standard_Integer aNb, i, aNbB, aNbR;//,iStatus;
|
||||
Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV;
|
||||
TColStd_ListIteratorOfListOfInteger aIt;
|
||||
TColStd_DataMapOfIntegerInteger aMII;
|
||||
TColStd_MapOfInteger aMFence;
|
||||
TopTools_DataMapOfShapeInteger aMSI;
|
||||
TopAbs_ShapeEnum aTi, aTj;
|
||||
NMTDS_PassKeyBoolean aPKXB;
|
||||
NMTDS_MapOfPassKeyBoolean aMPKXB;
|
||||
NMTDS_IndexedDataMapOfShapeBox aMSB;
|
||||
Handle(Bnd_HArray1OfBox) aHAB;
|
||||
Bnd_BoundSortBox aBSB;
|
||||
//
|
||||
if (myPDS==NULL){
|
||||
return;
|
||||
@ -168,230 +182,139 @@ static
|
||||
for (i=0; i<6; ++i) {
|
||||
myLists[i].Clear();
|
||||
}
|
||||
//
|
||||
aNb=myPDS->NumberOfShapesOfTheObject();
|
||||
aNb2=aNb*aNb;
|
||||
myMVSD.Clear();
|
||||
//
|
||||
pTable=new Standard_Integer [aNb2];
|
||||
pBoxes=new Bnd_Box [aNb];
|
||||
//
|
||||
// 1. Set status to Unknown
|
||||
for (i=0; i<aNb2; ++i) {
|
||||
pTable[i]=0; // Unknown
|
||||
}
|
||||
//
|
||||
// 2. Treat Ranges
|
||||
// Set status to SameRange;
|
||||
// Compute enlarged boxes ;
|
||||
const NMTDS_CArray1OfIndexRange& aRanges=myPDS->Ranges();
|
||||
aNbR=aRanges.Extent();
|
||||
for (iR=1; iR<=aNbR; ++iR) {
|
||||
const NMTDS_IndexRange& aRange=aRanges(iR);
|
||||
jR1=aRange.First();
|
||||
jR2=aRange.Last();
|
||||
for (i=jR1; i<=jR2; ++i) {
|
||||
for (j=i; j<=jR2; ++j) {
|
||||
k=(i-1)*aNb+(j-1);
|
||||
pTable[k]=4; //SameRange
|
||||
}
|
||||
//
|
||||
aNb=myPDS->NumberOfShapesOfTheObject();
|
||||
for (i=1; i<=aNb; ++i) {
|
||||
const TopoDS_Shape& aS=myPDS->Shape(i);
|
||||
aTi=aS.ShapeType();
|
||||
if (IsValidType(aTi)) {
|
||||
Bnd_Box aBoxEx;
|
||||
//
|
||||
ComputeBoxEx(i, myPDS, pBoxes);
|
||||
ComputeBoxEx(i, myPDS, aBoxEx);
|
||||
aMSI.Bind(aS, i);
|
||||
aMSB.Add(aS, aBoxEx);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 3. Intersect shapes by ranges
|
||||
iT1=TypeToInteger(TopAbs_COMPOUND);
|
||||
iT2=TypeToInteger(TopAbs_VERTEX);
|
||||
aNbB=aMSB.Extent();
|
||||
aHAB=new Bnd_HArray1OfBox(1, aNbB+1);
|
||||
//
|
||||
{
|
||||
Bnd_Box aBoxX;
|
||||
aBoxX.Update(1234567.8,1234567.8,1234567.8,1234567.8,1234567.8,1234567.8);
|
||||
aBoxX.SetGap(1.e-7);
|
||||
aHAB->SetValue(aNbB+1, aBoxX);
|
||||
}
|
||||
//
|
||||
for (i=1; i<=aNbB; ++i) {
|
||||
const TopoDS_Shape& aS=aMSB.FindKey(i);
|
||||
const Bnd_Box& aBoxEx=aMSB(i);
|
||||
//
|
||||
aHAB->SetValue(i, aBoxEx);
|
||||
//
|
||||
iDS=aMSI.Find(aS);
|
||||
aMII.Bind(i, iDS);
|
||||
}
|
||||
//
|
||||
aBSB.Initialize(aHAB);
|
||||
//
|
||||
for (iR=1; iR<aNbR; ++iR) {
|
||||
TColStd_Array1OfListOfInteger aALIR(iT1, iT2), aALJR(iT1, iT2);
|
||||
//
|
||||
const NMTDS_IndexRange& aRi=aRanges(iR);
|
||||
i1=aRi.First();
|
||||
i2=aRi.Last();
|
||||
const NMTDS_IndexRange& aR=aRanges(iR);
|
||||
i1=aR.First();
|
||||
i2=aR.Last();
|
||||
for (i=i1; i<=i2; ++i) {
|
||||
aALIR(TypeToInteger(myPDS->GetShapeType(i))).Append(i);
|
||||
}
|
||||
//
|
||||
for (jR=2; jR<=aNbR; ++jR) {
|
||||
const NMTDS_IndexRange& aRj=aRanges(jR);
|
||||
j1=aRj.First();
|
||||
j2=aRj.Last();
|
||||
for (j=j1; j<=j2; ++j) {
|
||||
aALJR(TypeToInteger(myPDS->GetShapeType(j))).Append(j);
|
||||
}
|
||||
}
|
||||
//
|
||||
for (iT=iT1; iT<=iT2; ++iT) {
|
||||
const TColStd_ListOfInteger& aLIT=aALIR(iT);
|
||||
if (aLIT.IsEmpty()) {
|
||||
const TopoDS_Shape& aSi=myPDS->Shape(i);
|
||||
aTi=aSi.ShapeType();
|
||||
if (!IsValidType(aTi)){
|
||||
continue;
|
||||
}
|
||||
for (jT=iT1; jT<=iT2; ++jT) {
|
||||
const TColStd_ListOfInteger& aLJT=aALJR(jT);
|
||||
if (aLJT.IsEmpty()) {
|
||||
continue;
|
||||
const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
|
||||
//
|
||||
const TColStd_ListOfInteger& aLI=aBSB.Compare(aBoxEx);
|
||||
//
|
||||
aNbSD=aLI.Extent();
|
||||
if (aNbSD<2){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
k=0;
|
||||
TColStd_ListOfInteger aLV;
|
||||
//
|
||||
aIt.Initialize(aLI);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
jB=aIt.Value(); // box index in MII
|
||||
j=aMII.Find(jB); // DS index
|
||||
if (j>=i1 && j<=i2) {
|
||||
continue;// same range
|
||||
}
|
||||
//
|
||||
aItIT.Initialize(aLIT);
|
||||
for (; aItIT.More(); aItIT.Next()) {
|
||||
aItJT.Initialize(aLJT);
|
||||
for (; aItJT.More(); aItJT.Next()) {
|
||||
i1=aItIT.Value();
|
||||
j1=aItJT.Value();
|
||||
if (i1>j1) {
|
||||
iX=i1;
|
||||
i1=j1;
|
||||
j1=iX;
|
||||
aPKXB.SetIds(i, j);
|
||||
if (aMPKXB.Add(aPKXB)) {
|
||||
bFlag=Standard_False;// Bounding boxes are intersected
|
||||
const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i);
|
||||
const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j);
|
||||
if (aBoxi.IsOut(aBoxj)) {
|
||||
bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
|
||||
}
|
||||
const TopoDS_Shape& aSj=myPDS->Shape(j);
|
||||
aTj=aSj.ShapeType();
|
||||
iX=TypeToInteger(aTi, aTj);
|
||||
//bFlag=(iStatus==2);
|
||||
aPKXB.SetFlag(bFlag);
|
||||
myLists[iX].Append(aPKXB);
|
||||
//
|
||||
// VSD prepare
|
||||
if (iX==5) { //VV
|
||||
if (aMFence.Add(j)) {
|
||||
aLV.Append(j);
|
||||
}
|
||||
//
|
||||
i=i1-1;
|
||||
j=j1-1;
|
||||
k=i*aNb+j;
|
||||
//
|
||||
if (pTable[k]!=0 && pTable[k]!=2) {
|
||||
continue;
|
||||
}
|
||||
// enlarged boxes
|
||||
const Bnd_Box& aBoxEi=pBoxes[i];
|
||||
const Bnd_Box& aBoxEj=pBoxes[j];
|
||||
if (aBoxEi.IsOut(aBoxEj)) {
|
||||
iStatus=3; // Non-intersected
|
||||
PropagateState(i1, j1, iStatus, aNb, myPDS, pTable);
|
||||
}
|
||||
else {
|
||||
iStatus=1; // Bounding boxes are intersected
|
||||
const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i1);
|
||||
const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j1);
|
||||
if (aBoxi.IsOut(aBoxj)) {
|
||||
iStatus=2; // Bounding boxes of Sub-shapes are intersected
|
||||
}
|
||||
pTable[k]=iStatus;
|
||||
//
|
||||
aTi=myPDS->GetShapeType(i1);
|
||||
aTj=myPDS->GetShapeType(j1);
|
||||
iX=TypeToInteger(aTi, aTj);
|
||||
//
|
||||
if (iX>=0) {
|
||||
aPKXB.SetIds(i1, j1);
|
||||
if (aMPKXB.Add(aPKXB)) {
|
||||
bFlag=Standard_False;
|
||||
if(iStatus==2) {
|
||||
bFlag=!bFlag;
|
||||
}
|
||||
aPKXB.SetFlag(bFlag);
|
||||
myLists[iX].Append(aPKXB);
|
||||
}
|
||||
}//if (iX>=0) {
|
||||
}// else {
|
||||
}//for (; aItJT.More(); aItJT.Next()) {
|
||||
}//for (; aItIT.More(); aItIT.Next()) {
|
||||
}//for (jT=iT1; jT<=iT2; ++jT) {
|
||||
}//for (iT=iT1; iT<=iT2; ++iT) {
|
||||
}
|
||||
//
|
||||
//
|
||||
delete [] (Bnd_Box*)pBoxes;
|
||||
delete [] (Standard_Integer*)pTable;
|
||||
}
|
||||
}// if (aMPKXB.Add(aPKXB)) {
|
||||
}// for (; aIt.More(); aIt.Next()) {
|
||||
//
|
||||
// VSD treatment
|
||||
aNbLV=aLV.Extent();
|
||||
if (aNbLV) {
|
||||
myMVSD.Bind(i, aLV);
|
||||
}
|
||||
}//for (i=i1; i<=i2; ++i) {
|
||||
}//for (iR=1; iR<aNbR; ++iR) {
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: PropagateState
|
||||
// function: IsValidType
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void PropagateState(const Standard_Integer aIDS1,
|
||||
const Standard_Integer aIDS2,
|
||||
const Standard_Integer iStatus,
|
||||
const Standard_Integer aNb,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
Standard_Integer *pTable)
|
||||
Standard_Boolean IsValidType(const TopAbs_ShapeEnum aTi)
|
||||
{
|
||||
Standard_Integer i, j, k, i1, j1, iX, i11, j11;
|
||||
TColStd_MapOfInteger aMS1, aMS2;
|
||||
TColStd_MapIteratorOfMapOfInteger aIt1, aIt2;
|
||||
//
|
||||
FillSuccessors(aIDS1, pDS, aMS1);
|
||||
FillSuccessors(aIDS2, pDS, aMS2);
|
||||
//
|
||||
aIt1.Initialize(aMS1);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
i1=aIt1.Key();
|
||||
//
|
||||
aIt2.Initialize(aMS2);
|
||||
for (; aIt2.More(); aIt2.Next()) {
|
||||
j1=aIt2.Key();
|
||||
//
|
||||
i11=i1;
|
||||
j11=j1;
|
||||
//
|
||||
if (i1>j1) {
|
||||
iX=i11;
|
||||
i11=j11;
|
||||
j11=iX;
|
||||
}
|
||||
i=i11-1;
|
||||
j=j11-1;
|
||||
k=i*aNb+j;
|
||||
if (!pTable[k]) {
|
||||
pTable[k]=iStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
// function: FillSuccessors
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void FillSuccessors(const Standard_Integer aIDS,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
TColStd_MapOfInteger& aMS)
|
||||
{
|
||||
Standard_Integer i, aNbS, iDS1;
|
||||
//
|
||||
aMS.Add(aIDS);
|
||||
aNbS=pDS->NumberOfSuccessors(aIDS);
|
||||
for (i=1; i<=aNbS; ++i) {
|
||||
iDS1=pDS->GetSuccessor(aIDS, i);
|
||||
FillSuccessors(iDS1, pDS, aMS);
|
||||
}
|
||||
return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
|
||||
}
|
||||
//=======================================================================
|
||||
// function: ComputeBoxEx
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Bnd_Box& ComputeBoxEx(const Standard_Integer aIndexDS,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
Bnd_Box* pBoxes)
|
||||
void ComputeBoxEx(const Standard_Integer aIx,
|
||||
NMTDS_ShapesDataStructure* pDS,
|
||||
Bnd_Box& aBoxEx)
|
||||
{
|
||||
Standard_Boolean bIsVoid;
|
||||
Standard_Integer iX;
|
||||
Standard_Integer i, aNbS, iS;
|
||||
//
|
||||
iX=aIndexDS-1;
|
||||
Bnd_Box& aBoxEx=pBoxes[iX];
|
||||
const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
|
||||
aBoxEx.Add(aBox);
|
||||
//
|
||||
bIsVoid=aBoxEx.IsVoid();
|
||||
if (bIsVoid) {
|
||||
Standard_Integer i, aNb, iS;
|
||||
//
|
||||
const Bnd_Box& aBox=pDS->GetBoundingBox(aIndexDS);
|
||||
aBoxEx.Add(aBox);
|
||||
//
|
||||
aNb=pDS->NumberOfSuccessors(aIndexDS);
|
||||
for (i=1; i<=aNb; ++i) {
|
||||
iS=pDS->GetSuccessor(aIndexDS, i);
|
||||
Bnd_Box& aBoxS=ComputeBoxEx(iS, pDS, pBoxes);
|
||||
aBoxEx.Add(aBoxS);
|
||||
}
|
||||
aNbS=pDS->NumberOfSuccessors(aIx);
|
||||
for (i=1; i<=aNbS; ++i) {
|
||||
Bnd_Box aBoxS;
|
||||
iS=pDS->GetSuccessor(aIx, i);
|
||||
ComputeBoxEx(iS, pDS, aBoxS);
|
||||
aBoxEx.Add(aBoxS);
|
||||
}
|
||||
return aBoxEx;
|
||||
}
|
||||
//=======================================================================
|
||||
// function: TypeToInteger
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
|
||||
{
|
||||
return (Standard_Integer)aType;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: TypeToInteger
|
||||
// purpose:
|
||||
@ -435,12 +358,33 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
|
||||
}
|
||||
|
||||
/*
|
||||
printf(" *** pTable ***\n");
|
||||
for (i=0; i<aNb; ++i) {
|
||||
for (j=0; j<aNb; ++j) {
|
||||
k=i*aNb+j;
|
||||
printf(" %2d", pTable[k]);
|
||||
//
|
||||
// check
|
||||
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
|
||||
TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt2;
|
||||
//
|
||||
printf(" \n");
|
||||
printf(" aMVLV.Extent()=%d\n", aMVLV.Extent());
|
||||
aIt1.Initialize(aMVLV);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
i=aIt1.Key();
|
||||
printf(" i=%d (", i);
|
||||
const TColStd_ListOfInteger& aLV=aIt1.Value();
|
||||
aIt.Initialize(aLV);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
j=aIt.Value();
|
||||
printf(" %d", j);
|
||||
}
|
||||
printf("\n");
|
||||
printf(")\n");
|
||||
}
|
||||
*/
|
||||
//
|
||||
printf(" \n");
|
||||
printf(" aMVV.Extent()=%d\n", aMVV.Extent());
|
||||
aIt2.Initialize(aMVV);
|
||||
for (; aIt2.More(); aIt2.Next()) {
|
||||
i=aIt2.Key();
|
||||
j=aIt2.Value();
|
||||
printf(" (%d, %d)\n", i, j);
|
||||
}
|
||||
printf("\n");
|
||||
*/
|
||||
|
@ -32,6 +32,9 @@
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile
|
||||
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
|
||||
#endif
|
||||
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#endif
|
||||
@ -39,6 +42,7 @@
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
class NMTDS_ShapesDataStructure;
|
||||
class TColStd_DataMapOfIntegerListOfInteger;
|
||||
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
@ -97,6 +101,9 @@ Standard_EXPORT void Prepare() ;
|
||||
Standard_EXPORT Standard_Integer ExpectedLength() const;
|
||||
|
||||
|
||||
Standard_EXPORT const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -113,6 +120,7 @@ NMTDS_ListOfPassKeyBoolean myLists[6];
|
||||
NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator;
|
||||
NMTDS_ListOfPassKeyBoolean myEmptyList;
|
||||
Standard_Integer myLength;
|
||||
TColStd_DataMapOfIntegerListOfInteger myMVSD;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -20,6 +20,9 @@
|
||||
#ifndef _NMTDS_ShapesDataStructure_HeaderFile
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile
|
||||
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
|
||||
#endif
|
||||
#ifndef _NMTDS_Iterator_HeaderFile
|
||||
#include <NMTDS_Iterator.hxx>
|
||||
#endif
|
||||
|
@ -75,11 +75,14 @@ LIB_SERVER_IDL =
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS = \
|
||||
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
|
||||
Handle_NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
|
||||
Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger.hxx \
|
||||
Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape.hxx \
|
||||
Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
|
||||
Handle_NMTTools_ListNodeOfListOfCommonBlock.hxx \
|
||||
Handle_NMTTools_ListNodeOfListOfCoupleOfShape.hxx \
|
||||
NMTDS_Iterator.hxx \
|
||||
NMTTools_CommonBlockAPI.hxx \
|
||||
NMTTools_CommonBlock.hxx \
|
||||
NMTTools_CommonBlockPool.hxx \
|
||||
|
@ -31,7 +31,8 @@ uses
|
||||
-- Modified to add new definitions Thu Sep 14 14:35:18 2006
|
||||
-- Contribution of Samtech www.samcef.com BEGIN
|
||||
ListOfInteger from TColStd,
|
||||
-- Contribution of Samtech www.samcef.com END
|
||||
-- Contribution of Samtech www.samcef.com END
|
||||
DataMapOfIntegerInteger from TColStd,
|
||||
Pnt from gp,
|
||||
ShapeEnum from TopAbs,
|
||||
Vertex from TopoDS,
|
||||
@ -518,5 +519,8 @@ fields
|
||||
--
|
||||
myContext : Context from IntTools is protected;
|
||||
mySectionAttribute : SSIntersectionAttribute from BOPTools is protected;
|
||||
myAloneVertices : IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected;
|
||||
myAloneVertices : IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected;
|
||||
--
|
||||
myVSD : DataMapOfIntegerInteger from TColStd is protected;
|
||||
--
|
||||
end PaveFiller;
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <BOPTColStd_Failure.hxx>
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
#include <NMTTools_DEProcessor.hxx>
|
||||
//
|
||||
|
||||
//
|
||||
//=======================================================================
|
||||
// function: NMTTools_PaveFiller::NMTTools_PaveFiller
|
||||
@ -192,7 +192,9 @@
|
||||
//
|
||||
// 2.VE
|
||||
myPavePool.Resize (myNbEdges);
|
||||
|
||||
PrepareEdges();
|
||||
|
||||
PerformVE();
|
||||
//
|
||||
// 3.VF
|
||||
@ -215,12 +217,15 @@
|
||||
//
|
||||
// 5.EF
|
||||
PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
|
||||
|
||||
PerformEF();
|
||||
//
|
||||
RefinePavePool();
|
||||
//
|
||||
myPavePoolNew.Destroy();
|
||||
|
||||
MakeSplitEdges();
|
||||
|
||||
UpdateCommonBlocks();
|
||||
//
|
||||
// 6. FF
|
||||
|
@ -53,6 +53,9 @@
|
||||
#ifndef _NMTTools_IndexedDataMapOfIndexedMapOfInteger_HeaderFile
|
||||
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
|
||||
#endif
|
||||
#ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile
|
||||
#include <TColStd_DataMapOfIntegerInteger.hxx>
|
||||
#endif
|
||||
#ifndef _TopAbs_ShapeEnum_HeaderFile
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#endif
|
||||
@ -402,6 +405,7 @@ BOPTools_SplitShapesPool mySplitShapesPool;
|
||||
IntTools_Context myContext;
|
||||
BOPTools_SSIntersectionAttribute mySectionAttribute;
|
||||
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
|
||||
TColStd_DataMapOfIntegerInteger myVSD;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -1,18 +1,18 @@
|
||||
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// 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
|
||||
//
|
||||
// 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
|
||||
// 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
|
||||
@ -21,12 +21,13 @@
|
||||
// Created: Mon Dec 8 11:47:55 2003
|
||||
// Author: Peter KURNEV
|
||||
// <pkv@irinox>
|
||||
|
||||
|
||||
#include <NMTTools_PaveFiller.ixx>
|
||||
|
||||
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||
|
||||
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
|
||||
#include <TColStd_ListOfInteger.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
@ -38,12 +39,10 @@
|
||||
#include <BOPTools_CArray1OfVVInterference.hxx>
|
||||
#include <BOPTools_VVInterference.hxx>
|
||||
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
|
||||
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
|
||||
|
||||
#include <NMTDS_ShapesDataStructure.hxx>
|
||||
#include <NMTTools_Tools.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function: PerformVV
|
||||
// purpose:
|
||||
@ -52,8 +51,15 @@
|
||||
{
|
||||
myIsDone=Standard_False;
|
||||
//
|
||||
Standard_Integer n1, n2,anIndexIn, aFlag, aWhat, aWith, aNbVVs, aBlockLength;
|
||||
Standard_Boolean bJustAddInterference;
|
||||
Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD;
|
||||
Standard_Integer nVnew;
|
||||
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
|
||||
TColStd_ListIteratorOfListOfInteger aIt;
|
||||
TopTools_ListOfShape aLV;
|
||||
TopoDS_Vertex aVnew;
|
||||
TopoDS_Shape aS;
|
||||
//
|
||||
myVSD.Clear();
|
||||
//
|
||||
BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences();
|
||||
//
|
||||
@ -64,41 +70,51 @@
|
||||
aVVs.SetBlockLength(aNbVVs);
|
||||
}
|
||||
//
|
||||
// V/V BooleanOperations_VertexVertex
|
||||
myDSIt.Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
|
||||
//
|
||||
for (; myDSIt.More(); myDSIt.Next()) {
|
||||
myDSIt.Current(n1, n2, bJustAddInterference);
|
||||
//
|
||||
if (!myIntrPool->IsComputed(n1, n2)) {
|
||||
anIndexIn=0;
|
||||
aWhat=n1;
|
||||
aWith=n2;
|
||||
SortTypes(aWhat, aWith);
|
||||
//
|
||||
if (!bJustAddInterference) {
|
||||
const TopoDS_Shape aS1=myDS->GetShape(aWhat);//mpv
|
||||
const TopoDS_Shape aS2=myDS->GetShape(aWith);//mpv
|
||||
//
|
||||
// Modified Thu Sep 14 14:35:18 2006
|
||||
// Contribution of Samtech www.samcef.com BEGIN
|
||||
if (aS1.IsSame(aS2)) {
|
||||
continue;
|
||||
}
|
||||
// Contribution of Samtech www.samcef.com END
|
||||
//
|
||||
const TopoDS_Vertex& aV1=TopoDS::Vertex(aS1);
|
||||
const TopoDS_Vertex& aV2=TopoDS::Vertex(aS2);
|
||||
aFlag=IntTools_Tools::ComputeVV (aV1, aV2);
|
||||
//
|
||||
if (!aFlag) {
|
||||
BOPTools_VVInterference anInterf (aWhat, aWith);
|
||||
anIndexIn=aVVs.Append(anInterf);
|
||||
}
|
||||
}
|
||||
myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn);
|
||||
}
|
||||
const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices();
|
||||
aNbVSD=aMVSD.Extent();
|
||||
if (!aNbVSD) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
aIt1.Initialize(aMVSD);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
aLV.Clear();
|
||||
//
|
||||
aWhat=aIt1.Key();
|
||||
const TColStd_ListOfInteger& aLIV=aIt1.Value();
|
||||
//
|
||||
// new vertex
|
||||
aIt.Initialize(aLIV);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aWith=aIt.Value();
|
||||
aS=myDS->Shape(aWith);
|
||||
aLV.Append(aS);
|
||||
}
|
||||
aS=myDS->Shape(aWhat);
|
||||
aLV.Append(aS);
|
||||
//
|
||||
NMTTools_Tools::MakeNewVertex(aLV, aVnew);
|
||||
//
|
||||
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
|
||||
//
|
||||
myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
|
||||
nVnew=myDS->NumberOfInsertedShapes();
|
||||
myDS->SetState (nVnew, BooleanOperations_ON);
|
||||
//
|
||||
// interferences
|
||||
aIt.Initialize(aLIV);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aWith=aIt.Value();
|
||||
BOPTools_VVInterference aVV(aWhat, aWith);
|
||||
aVV.SetNewShape(nVnew);
|
||||
anIndexIn=aVVs.Append(aVV);
|
||||
myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn);
|
||||
//
|
||||
// to find SD-Vertices
|
||||
myVSD.Bind(aWith, nVnew);
|
||||
}
|
||||
myVSD.Bind(aWhat, nVnew);
|
||||
}//for (; aIt1.More(); aIt1.Next()) {
|
||||
myIsDone=Standard_True;
|
||||
}
|
||||
//=======================================================================
|
||||
@ -107,89 +123,18 @@
|
||||
//=======================================================================
|
||||
void NMTTools_PaveFiller::PerformNewVertices()
|
||||
{
|
||||
myIsDone=Standard_False;
|
||||
//
|
||||
Standard_Integer i, aNb, anIndex1, anIndex2, aNewShape;
|
||||
TopoDS_Vertex aNewVertex;
|
||||
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
|
||||
//
|
||||
Standard_Integer aNbChains, j, aNbV, aIdV, aNbL;
|
||||
TColStd_IndexedMapOfInteger aMapWhole;
|
||||
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMapChains;//aMCV
|
||||
TopTools_ListOfShape aLV;
|
||||
TopTools_IndexedMapOfShape aM;
|
||||
//
|
||||
// 1. VV Interferences
|
||||
BOPTools_CArray1OfVVInterference& VVs=myIntrPool->VVInterferences();
|
||||
//
|
||||
NMTTools_Tools::FindChains(VVs, aMapChains);
|
||||
//
|
||||
aNbChains=aMapChains.Extent();
|
||||
for (i=1; i<=aNbChains; ++i) {
|
||||
const TColStd_IndexedMapOfInteger& aChain=aMapChains(i);
|
||||
//
|
||||
aM.Clear();
|
||||
aLV.Clear();
|
||||
aNbV=aChain.Extent();
|
||||
for (j=1; j<=aNbV; ++j) {
|
||||
aIdV=aChain(j);
|
||||
const TopoDS_Shape aV=myDS->Shape(aIdV);//mpv
|
||||
if (!aM.Contains(aV)) {
|
||||
aM.Add(aV);
|
||||
aLV.Append(aV);
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbL=aLV.Extent();
|
||||
if (aNbL==1){
|
||||
aNewShape=aChain(1);
|
||||
}
|
||||
else if (aNbL>1) {
|
||||
//
|
||||
// Make new Vertex
|
||||
NMTTools_Tools::MakeNewVertex(aLV, aNewVertex);
|
||||
// Insert New Vertex in DS;
|
||||
// aNewShape is # of DS-line, where aNewVertex is kept
|
||||
myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
|
||||
aNewShape=myDS->NumberOfInsertedShapes();
|
||||
//
|
||||
// State of New Vertex is ON
|
||||
myDS->SetState (aNewShape, BooleanOperations_ON);
|
||||
}
|
||||
//
|
||||
// Insert New Vertex in Interference
|
||||
aNb=VVs.Extent();
|
||||
for (j=1; j<=aNb; ++j) {
|
||||
BOPTools_VVInterference& VV=VVs(j);
|
||||
anIndex1=VV.Index1();
|
||||
anIndex2=VV.Index2();
|
||||
if (aChain.Contains(anIndex1) || aChain.Contains(anIndex2)) {
|
||||
VV.SetNewShape(aNewShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
myIsDone=Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: FindSDVertex
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer NMTTools_PaveFiller::FindSDVertex(const Standard_Integer nV)const
|
||||
{
|
||||
Standard_Integer i, aNb, anIndex1, anIndex2, aNewShape=0;
|
||||
|
||||
BOPTools_CArray1OfVVInterference& VVs=myIntrPool->VVInterferences();
|
||||
aNb=VVs.Extent();
|
||||
|
||||
for (i=1; i<=aNb; i++) {
|
||||
const BOPTools_VVInterference& VV=VVs(i);
|
||||
anIndex1=VV.Index1();
|
||||
anIndex2=VV.Index2();
|
||||
if (nV==anIndex1 || nV==anIndex2) {
|
||||
aNewShape=VV.NewShape();
|
||||
return aNewShape;
|
||||
}
|
||||
Standard_Integer nVSD;
|
||||
//
|
||||
nVSD=0;
|
||||
if (myVSD.IsBound(nV)) {
|
||||
nVSD=myVSD.Find(nV);
|
||||
}
|
||||
return aNewShape;
|
||||
return nVSD;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user