Integration next version of GEOM packages from PKV.

This commit is contained in:
skl 2007-06-13 07:24:14 +00:00
parent dc00d1137e
commit cb8ad5d0b7
88 changed files with 5502 additions and 1559 deletions

View File

@ -37,8 +37,8 @@ uses
MapOfShape from TopTools,
Image from BRepAlgo,
DSFiller from NMTTools,
PDSFiller from NMTTools
PaveFiller from NMTTools,
PPaveFiller from NMTTools
--raises
@ -54,8 +54,8 @@ is
is redefined;
PerformWithFiller(me:out;
theDSF: DSFiller from NMTTools)
---Purpose: Performs calculations using prepared DSFiller
theDSF: PaveFiller from NMTTools)
---Purpose: Performs calculations using prepared PaveFiller
-- object theDSF
is virtual;
@ -99,13 +99,12 @@ is
--
-- protected methods
--
--
PerformInternal(me:out;
theDSF: DSFiller from NMTTools)
theDSF: PaveFiller from NMTTools)
---Purpose: Performs calculations using prepared DSFiller
-- object theDSF
is protected;
--
is virtual protected;
PrepareHistory (me:out)
---Purpose: Prepare information for history support
is redefined protected;
@ -234,7 +233,7 @@ is
-- =====================================================
fields
myDSFiller : PDSFiller from NMTTools is protected;
myPaveFiller : PPaveFiller from NMTTools is protected;
myShapes : ListOfShape from TopTools is protected;
-- Common usage
myNbTypes : Integer from Standard is protected;

View File

@ -38,9 +38,8 @@
#include <BOP_CorrectTolerances.hxx>
#include <NMTTools_DSFiller.hxx>
#include <BRepLib.hxx>
#include <NMTTools_PaveFiller.hxx>
//=======================================================================
//function :
@ -51,7 +50,7 @@
GEOMAlgo_BuilderShape()
{
myNbTypes=9;
myDSFiller=NULL;
myPaveFiller=NULL;
myEntryPoint=0; // Entry point through PerformWithFiller ()
}
//=======================================================================
@ -61,9 +60,9 @@
GEOMAlgo_Builder::~GEOMAlgo_Builder()
{
if (myEntryPoint==1) {
if (myDSFiller) {
delete myDSFiller;
myDSFiller=NULL;
if (myPaveFiller) {
delete myPaveFiller;
myPaveFiller=NULL;
}
}
}
@ -260,23 +259,19 @@
aBB.Add(aCS, aS);
}
//
if (myDSFiller) {
delete myDSFiller;
myDSFiller=NULL;
}
NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
NMTTools_PaveFiller* pPF=new NMTTools_PaveFiller;
//
pDSF->SetCompositeShape(aCS);
pDSF->Perform();
pPF->SetCompositeShape(aCS);
pPF->Perform();
//
myEntryPoint=1;
PerformInternal(*pDSF);
PerformInternal(*pPF);
}
//=======================================================================
//function : PerformWithFiller
//purpose :
//=======================================================================
void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_PaveFiller& theDSF)
{
myEntryPoint=0;
//
@ -286,18 +281,18 @@
//function : PerformInternal
//purpose :
//=======================================================================
void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF)
void GEOMAlgo_Builder::PerformInternal(const NMTTools_PaveFiller& pPF)
{
myErrorStatus=0;
//
Standard_Boolean bIsDone;
//
// 0. myDSFiller
myDSFiller=(NMTTools_DSFiller *)&theDSF;
// 0. myPaveFiller
myPaveFiller=(NMTTools_PaveFiller *)&pPF;
//
bIsDone=myDSFiller->IsDone();
bIsDone=myPaveFiller->IsDone();
if (!bIsDone) {
myErrorStatus=2; // DSFiller is failed
myErrorStatus=2; // PaveFiller is failed
return;
}
//
@ -406,6 +401,6 @@
//
// 0 - Ok
// 1 - The object is just initialized
// 2 - DSFiller is failed
// 2 - PaveFiller is failed
// 10 - No shapes to process
// 30 - SolidBuilder failed

View File

@ -20,8 +20,8 @@
#ifndef _GEOMAlgo_Builder_HeaderFile
#define _GEOMAlgo_Builder_HeaderFile
#ifndef _NMTTools_PDSFiller_HeaderFile
#include <NMTTools_PDSFiller.hxx>
#ifndef _NMTTools_PPaveFiller_HeaderFile
#include <NMTTools_PPaveFiller.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
@ -50,7 +50,7 @@
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
class NMTTools_DSFiller;
class NMTTools_PaveFiller;
class TopoDS_Shape;
class TopTools_ListOfShape;
class BRepAlgo_Image;
@ -90,9 +90,9 @@ Standard_EXPORT virtual ~GEOMAlgo_Builder();
//! Performs calculations <br>
Standard_EXPORT virtual void Perform() ;
//! Performs calculations using prepared DSFiller <br>
//! Performs calculations using prepared PaveFiller <br>
//! object theDSF <br>
Standard_EXPORT virtual void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
Standard_EXPORT virtual void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
//! Adds argument theShape of the operation <br>
Standard_EXPORT virtual void AddShape(const TopoDS_Shape& theShape) ;
@ -139,7 +139,7 @@ protected:
//! Performs calculations using prepared DSFiller <br>
//! object theDSF <br>
Standard_EXPORT void PerformInternal(const NMTTools_DSFiller& theDSF) ;
Standard_EXPORT virtual void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
//! Prepare information for history support <br>
Standard_EXPORT virtual void PrepareHistory() ;
@ -214,7 +214,7 @@ Standard_EXPORT void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape
// Fields PROTECTED
//
NMTTools_PDSFiller myDSFiller;
NMTTools_PPaveFiller myPaveFiller;
TopTools_ListOfShape myShapes;
Standard_Integer myNbTypes;
TopTools_MapOfShape myMapFence;

View File

@ -17,8 +17,8 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _NMTTools_DSFiller_HeaderFile
#include <NMTTools_DSFiller.hxx>
#ifndef _NMTTools_PaveFiller_HeaderFile
#include <NMTTools_PaveFiller.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>

View File

@ -20,7 +20,7 @@
#include <GEOMAlgo_Builder.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_DSFiller.hxx>
//#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <IntTools_Context.hxx>
#include <TopoDS_Shape.hxx>

View File

@ -47,7 +47,6 @@
//
#include <NMTDS_ShapesDataStructure.hxx>
//
#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_CommonBlockPool.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
@ -78,8 +77,8 @@ static
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
//
Standard_Integer i, aNb, iV;
//
@ -94,7 +93,6 @@ static
myImages.Bind(aV, aVSD);
//
mySameDomainShapes.Add(aV, aVSD);
//
}
}
}
@ -108,8 +106,8 @@ static
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
IntTools_Context& aCtx=pPF->ChangeContext();
@ -218,8 +216,8 @@ static
TopTools_MapOfShape aMS;
TopTools_MapIteratorOfMapOfShape aItS;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
aNbS=aDS.NumberOfShapesOfTheObject();

View File

@ -54,7 +54,6 @@
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_InterferencePool.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_SequenceOfCurves.hxx>
@ -68,7 +67,6 @@
#include <BOPTools_CArray1OfESInterference.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_Tools.hxx>
@ -83,6 +81,7 @@
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_BuilderFace.hxx>
#include <NMTDS_InterfPool.hxx>
static
void UpdateCandidates(const Standard_Integer ,
@ -109,9 +108,9 @@ static
//=======================================================================
void GEOMAlgo_Builder::FillIn2DParts()
{
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
//
@ -193,9 +192,9 @@ static
//=======================================================================
void GEOMAlgo_Builder::BuildSplitFaces()
{
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
IntTools_Context& aCtx= pPF->ChangeContext();
//
@ -388,9 +387,9 @@ static
//=======================================================================
void GEOMAlgo_Builder::FillSameDomainFaces()
{
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
IntTools_Context& aCtx= pPF->ChangeContext();
//
@ -513,7 +512,7 @@ static
TopTools_ListOfShape aLFx;
TopTools_ListIteratorOfListOfShape aIt;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
//
aNb=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNb; ++i) {
@ -557,9 +556,9 @@ static
//=======================================================================
void GEOMAlgo_Builder::FillInternalVertices()
{
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
IntTools_Context& aCtx= pPF->ChangeContext();
//
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();

View File

@ -56,7 +56,6 @@
#include <IntTools_Context.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_DSFiller.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <GEOMAlgo_Tools3D.hxx>
@ -93,8 +92,8 @@ static
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Boolean bToReverse;
@ -186,8 +185,8 @@ static
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Boolean bIsIN, bHasImage;
@ -416,8 +415,8 @@ static
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Integer i, aNbS, iErr;
@ -589,8 +588,8 @@ static
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
//
//Standard_Boolean bHasImage;

View File

@ -35,7 +35,6 @@
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_DSFiller.hxx>
#include <GEOMAlgo_Tools3D.hxx>
@ -49,8 +48,8 @@ static
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
{
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx=pPF->ChangeContext();
//
Standard_Boolean bHasImage, bToReverse;
@ -104,8 +103,8 @@ static
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
{
const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx=pPF->ChangeContext();
//
Standard_Boolean bHasImage, bToReverse;

View File

@ -42,7 +42,6 @@
#include <BOP_CorrectTolerances.hxx>
#include <NMTTools_DSFiller.hxx>
static
void TreatCompound(const TopoDS_Shape& aC,
@ -320,6 +319,6 @@ void TreatCompound(const TopoDS_Shape& aC1,
//
// 0 - Ok
// 1 - The object is just initialized
// 2 - DSFiller is failed
// 2 - PaveFiller is failed
// 10 - No shapes to process
// 30 - SolidBuilder failed

View File

@ -238,7 +238,7 @@ EXPORT_IDLS=
CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS)
CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS)
LDFLAGS += $(CAS_LDPATH) -lTKBO $(KERNEL_LDFLAGS)
LDFLAGS += $(CAS_LDPATH) -lTKBO $(KERNEL_LDFLAGS) -lNMTTools
%_moc.cxx: %.h
$(MOC) $< -o $@

View File

@ -34,7 +34,8 @@
#include <GEOM_Function.hxx>
#include <ShHealOper_Sewing.hxx>
#include <NMTAlgo_Splitter1.hxx>
//#include <NMTAlgo_Splitter1.hxx>
#include <GEOMAlgo_Gluer.hxx>
#include <BlockFix_BlockFixAPI.hxx>
#include "utilities.h"
@ -470,14 +471,21 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
TopoDS_Shape aCompound = anArgs(1);
// Glue coincident faces and edges (with Partition algorithm).
NMTAlgo_Splitter1 PS;
PS.AddShape(aCompound);
PS.Compute();
PS.SetRemoveWebs(Standard_False);
// PS.Build(aCompound.ShapeType());
PS.Build(TopAbs_SOLID);
//NMTAlgo_Splitter1 PS;
//PS.AddShape(aCompound);
//PS.Compute();
//PS.SetRemoveWebs(Standard_False);
// PS.Build(aCompound.ShapeType());
//PS.Build(TopAbs_SOLID);
//aShape = PS.Shape();
GEOMAlgo_Gluer aGluer;
aGluer.SetShape(aCompound);
aGluer.SetCheckGeometry(Standard_True);
aGluer.Perform();
aShape = aGluer.Result();
aShape = PS.Shape();
} else {
}

View File

@ -114,7 +114,7 @@ EXPORT_HEADERS= GEOMImpl_Gen.hxx \
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS) $(BOOST_CPPFLAGS)
CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS)
LDFLAGS += $(KERNEL_LDFLAGS) $(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset -lGEOMbasic -lNMTAlgo -lGEOMAlgo -lShHealOper
LDFLAGS += $(KERNEL_LDFLAGS) $(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset -lGEOMbasic -lGEOMAlgo -lShHealOper
# additional file to be cleaned

View File

@ -34,7 +34,7 @@ VPATH=.:@srcdir@
#SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_I_Superv GEOM_SWIG STLExport
SUBDIRS = ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG STLExport
SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG STLExport
ifeq (@WITHIHM@,yes)
SUBDIRS+= OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG_WITHIHM

View File

@ -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_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#define _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_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_DataMapNodeOfDataMapOfIntegerMapOfInteger;
Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger);
class Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) : public Handle(TCollection_MapNode) {
public:
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)():Handle(TCollection_MapNode)() {}
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle)
{
}
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem)
{
}
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle)
{
Assign(aHandle.Access());
return *this;
}
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem)
{
Assign((Standard_Transient *)anItem);
return *this;
}
NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* operator->() const
{
return (NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger *)ControlAccess();
}
// Standard_EXPORT ~Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)();
Standard_EXPORT static const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) DownCast(const Handle(Standard_Transient)& AnObject);
};
#endif

View File

@ -39,6 +39,9 @@ LIB = libNMTDS.la
LIB_SRC = \
NMTDS_CArray1OfIndexRange_0.cxx \
NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx \
NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx \
NMTDS_DataMapOfIntegerMapOfInteger_0.cxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
@ -46,7 +49,9 @@ LIB_SRC = \
NMTDS_IndexedDataMapOfIntegerShape_0.cxx \
NMTDS_IndexedDataMapOfShapeBox_0.cxx \
NMTDS_IndexRange.cxx \
NMTDS_InterfPool.cxx \
NMTDS_Iterator.cxx \
NMTDS_IteratorCheckerSI.cxx \
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \
NMTDS_ListIteratorOfListOfPassKey_0.cxx \
NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \
@ -63,9 +68,12 @@ LIB_SRC = \
NMTDS_PassKeyBoolean.cxx \
NMTDS_PassKey.cxx \
NMTDS_PassKeyMapHasher.cxx \
NMTDS_PassKeyShape.cxx \
NMTDS_PassKeyShapeMapHasher.cxx \
NMTDS_ShapesDataStructure.cxx \
NMTDS_StdMapNodeOfMapOfPassKey_0.cxx \
NMTDS_StdMapNodeOfMapOfPassKeyBoolean_0.cxx \
NMTDS_Tools.cxx \
NMTDS_BoxBndTree.cxx
LIB_CLIENT_IDL =
@ -73,6 +81,7 @@ LIB_SERVER_IDL =
# header files
EXPORT_HEADERS = \
Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
@ -82,6 +91,9 @@ EXPORT_HEADERS = \
Handle_NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
Handle_NMTDS_StdMapNodeOfMapOfPassKey.hxx \
NMTDS_CArray1OfIndexRange.hxx \
NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx \
NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
NMTDS_DataMapOfIntegerMapOfInteger.hxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
@ -89,7 +101,10 @@ EXPORT_HEADERS = \
NMTDS_IndexedDataMapOfIntegerShape.hxx \
NMTDS_IndexedDataMapOfShapeBox.hxx \
NMTDS_IndexRange.hxx \
NMTDS_InterfPool.hxx \
NMTDS_InterfType.hxx \
NMTDS_Iterator.hxx \
NMTDS_IteratorCheckerSI.hxx \
NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx \
NMTDS_ListIteratorOfListOfPassKey.hxx \
@ -104,12 +119,17 @@ EXPORT_HEADERS = \
NMTDS_MapOfPassKeyBoolean.hxx \
NMTDS_MapOfPassKey.hxx \
NMTDS_PassKeyBoolean.hxx \
NMTDS_PInterfPool.hxx \
NMTDS_PIterator.hxx \
NMTDS_PassKey.hxx \
NMTDS_PassKeyMapHasher.hxx \
NMTDS_PassKeyShape.hxx \
NMTDS_PassKeyShapeMapHasher.hxx \
NMTDS_PShapesDataStructure.hxx \
NMTDS_ShapesDataStructure.hxx \
NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
NMTDS_StdMapNodeOfMapOfPassKey.hxx \
NMTDS_Tools.hxx \
NMTDS_BoxBndTree.hxx
# idl files

View File

@ -28,7 +28,6 @@ package NMTDS
---Purpose:
uses
TCollection,
TColStd,
Bnd,
@ -36,20 +35,41 @@ uses
TopAbs,
TopTools,
BooleanOperations,
BOPTools,
BOPTColStd
is
enumeration InterfType is
TI_VV,
TI_VE,
TI_VF,
TI_EE,
TI_EF,
TI_FF,
TI_UNKNOWN
end InterfType;
--
class ShapesDataStructure;
class IndexRange;
-- Modified to Add new classes Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
class Iterator;
class PassKey;
class PassKeyBoolean;
class PassKeyMapHasher;
-- Contribution of Samtech www.samcef.com END
class PassKeyShape;
class PassKeyShapeMapHasher;
--modified by NIZNHY-PKV Tue Feb 6 10:40:02 2007f
class IteratorCheckerSI;
class Tools;
class InterfPool;
--modified by NIZNHY-PKV Tue Feb 6 10:40:04 2007t
pointer PShapesDataStructure to ShapesDataStructure from NMTDS;
pointer PIterator to Iterator from NMTDS;
pointer PInterfPool to InterfPool from NMTDS;
class CArray1OfIndexRange instantiates
CArray1 from BOPTColStd(IndexRange from NMTDS);
@ -79,7 +99,7 @@ is
PassKeyMapHasher from NMTDS);
-- Contribution of Samtech www.samcef.com END
--modified by NIZNHY-PKV Tue Oct 10 11:19:06 2006f
class IndexedDataMapOfShapeBox
instantiates IndexedDataMap from TCollection (Shape from TopoDS,
Box from Bnd,
@ -89,5 +109,11 @@ is
Shape from TopoDS,
MapIntegerHasher from TColStd);
class DataMapOfIntegerMapOfInteger
instantiates DataMap from TCollection (Integer from Standard,
MapOfInteger from TColStd,
MapIntegerHasher from TColStd);
--modified by NIZNHY-PKV Tue Oct 10 11:19:08 2006t
end NMTDS;

View File

@ -0,0 +1,115 @@
// 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_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
#define _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
#ifndef _TCollection_BasicMapIterator_HeaderFile
#include <TCollection_BasicMapIterator.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#endif
class Standard_NoSuchObject;
class TColStd_MapOfInteger;
class TColStd_MapIntegerHasher;
class NMTDS_DataMapOfIntegerMapOfInteger;
class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger : 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);
}
// Methods PUBLIC
//
Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger();
Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& aMap);
Standard_EXPORT void Initialize(const NMTDS_DataMapOfIntegerMapOfInteger& aMap) ;
Standard_EXPORT const Standard_Integer& Key() const;
Standard_EXPORT const TColStd_MapOfInteger& Value() const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,54 @@
// 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_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx>
#endif
#ifndef _TColStd_MapOfInteger_HeaderFile
#include <TColStd_MapOfInteger.hxx>
#endif
#ifndef _TColStd_MapIntegerHasher_HeaderFile
#include <TColStd_MapIntegerHasher.hxx>
#endif
#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#endif
#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#endif
#define TheKey Standard_Integer
#define TheKey_hxx <Standard_Integer.hxx>
#define TheItem TColStd_MapOfInteger
#define TheItem_hxx <TColStd_MapOfInteger.hxx>
#define Hasher TColStd_MapIntegerHasher
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#include <TCollection_DataMapIterator.gxx>

View File

@ -0,0 +1,131 @@
// 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_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#define _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TColStd_MapOfInteger_HeaderFile
#include <TColStd_MapOfInteger.hxx>
#endif
#ifndef _TCollection_MapNode_HeaderFile
#include <TCollection_MapNode.hxx>
#endif
#ifndef _TCollection_MapNodePtr_HeaderFile
#include <TCollection_MapNodePtr.hxx>
#endif
class TColStd_MapOfInteger;
class TColStd_MapIntegerHasher;
class NMTDS_DataMapOfIntegerMapOfInteger;
class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger : public TCollection_MapNode {
public:
// Methods PUBLIC
//
NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger(const Standard_Integer& K,const TColStd_MapOfInteger& I,const TCollection_MapNodePtr& n);
Standard_Integer& Key() const;
TColStd_MapOfInteger& Value() const;
//Standard_EXPORT ~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger();
// 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 myKey;
TColStd_MapOfInteger myValue;
};
#define TheKey Standard_Integer
#define TheKey_hxx <Standard_Integer.hxx>
#define TheItem TColStd_MapOfInteger
#define TheItem_hxx <TColStd_MapOfInteger.hxx>
#define Hasher TColStd_MapIntegerHasher
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.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

View File

@ -0,0 +1,100 @@
// 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_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
#ifndef _TColStd_MapOfInteger_HeaderFile
#include <TColStd_MapOfInteger.hxx>
#endif
#ifndef _TColStd_MapIntegerHasher_HeaderFile
#include <TColStd_MapIntegerHasher.hxx>
#endif
#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#endif
#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#endif
//NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
Standard_EXPORT Handle_Standard_Type& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_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_DataMapNodeOfDataMapOfIntegerMapOfInteger",
sizeof(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger),
1,
(Standard_Address)_Ancestors,
(Standard_Address)NULL);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger))) {
_anOtherObject = Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)((Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::DynamicType() const
{
return STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) ;
}
//Standard_Boolean NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::IsKind(const Handle(Standard_Type)& AType) const
//{
// return (STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) == AType || TCollection_MapNode::IsKind(AType));
//}
//Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
#define TheKey Standard_Integer
#define TheKey_hxx <Standard_Integer.hxx>
#define TheItem TColStd_MapOfInteger
#define TheItem_hxx <TColStd_MapOfInteger.hxx>
#define Hasher TColStd_MapIntegerHasher
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#include <TCollection_DataMapNode.gxx>

View File

@ -0,0 +1,154 @@
// 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_DataMapOfIntegerMapOfInteger_HeaderFile
#define _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
#ifndef _TCollection_BasicMap_HeaderFile
#include <TCollection_BasicMap.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class Standard_DomainError;
class Standard_NoSuchObject;
class TColStd_MapOfInteger;
class TColStd_MapIntegerHasher;
class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_DataMapOfIntegerMapOfInteger : 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_DataMapOfIntegerMapOfInteger(const Standard_Integer NbBuckets = 1);
Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger& Assign(const NMTDS_DataMapOfIntegerMapOfInteger& Other) ;
NMTDS_DataMapOfIntegerMapOfInteger& operator =(const NMTDS_DataMapOfIntegerMapOfInteger& Other)
{
return Assign(Other);
}
Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;
Standard_EXPORT void Clear() ;
~NMTDS_DataMapOfIntegerMapOfInteger()
{
Clear();
}
Standard_EXPORT Standard_Boolean Bind(const Standard_Integer& K,const TColStd_MapOfInteger& I) ;
Standard_EXPORT Standard_Boolean IsBound(const Standard_Integer& K) const;
Standard_EXPORT Standard_Boolean UnBind(const Standard_Integer& K) ;
Standard_EXPORT const TColStd_MapOfInteger& Find(const Standard_Integer& K) const;
const TColStd_MapOfInteger& operator()(const Standard_Integer& K) const
{
return Find(K);
}
Standard_EXPORT TColStd_MapOfInteger& ChangeFind(const Standard_Integer& K) ;
TColStd_MapOfInteger& operator()(const Standard_Integer& K)
{
return ChangeFind(K);
}
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& Other);
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,57 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#ifndef _Standard_DomainError_HeaderFile
#include <Standard_DomainError.hxx>
#endif
#ifndef _Standard_NoSuchObject_HeaderFile
#include <Standard_NoSuchObject.hxx>
#endif
#ifndef _TColStd_MapOfInteger_HeaderFile
#include <TColStd_MapOfInteger.hxx>
#endif
#ifndef _TColStd_MapIntegerHasher_HeaderFile
#include <TColStd_MapIntegerHasher.hxx>
#endif
#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#endif
#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#endif
#define TheKey Standard_Integer
#define TheKey_hxx <Standard_Integer.hxx>
#define TheItem TColStd_MapOfInteger
#define TheItem_hxx <TColStd_MapOfInteger.hxx>
#define Hasher TColStd_MapIntegerHasher
#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#include <TCollection_DataMap.gxx>

View File

@ -0,0 +1,151 @@
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License.
--
-- This library is distributed in the hope that it will be useful
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: NMTDS_InterfPool.cdl
-- Created: Wed Feb 21 10:10:58 2007
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2007
class InterfPool from NMTDS
---Purpose:
uses
MapOfPassKeyBoolean from NMTDS,
ListOfPassKeyBoolean from NMTDS,
PassKeyBoolean from NMTDS,
InterfType from NMTDS,
--
CArray1OfSSInterference from BOPTools,
CArray1OfESInterference from BOPTools,
CArray1OfVSInterference from BOPTools,
CArray1OfEEInterference from BOPTools,
CArray1OfVEInterference from BOPTools,
CArray1OfVVInterference from BOPTools
--raises
is
Create
returns InterfPool from NMTDS;
---C++: alias "Standard_EXPORT virtual ~NMTDS_InterfPool();"
Add (me:out;
aPKB : PassKeyBoolean from NMTDS;
aType: InterfType from NMTDS)
returns Boolean from Standard;
Add (me:out;
aInd1 : Integer from Standard;
aInd2 : Integer from Standard;
aType : InterfType from NMTDS)
returns Boolean from Standard;
Add (me:out;
aInd1 : Integer from Standard;
aInd2 : Integer from Standard;
bFlag : Boolean from Standard;
aType : InterfType from NMTDS)
returns Boolean from Standard;
Contains(me;
aPKB : PassKeyBoolean from NMTDS)
returns Boolean from Standard;
Contains(me;
aInd1 : Integer from Standard;
aInd2 : Integer from Standard)
returns Boolean from Standard;
Get(me)
returns ListOfPassKeyBoolean from NMTDS;
---C++: return const &
Get(me;
aType : InterfType from NMTDS)
returns ListOfPassKeyBoolean from NMTDS;
---C++: return const &
Get(me;
aInd : Integer from Standard)
returns ListOfPassKeyBoolean from NMTDS;
---C++: return const &
Get(me;
aInd : Integer from Standard;
aType: InterfType from NMTDS)
returns ListOfPassKeyBoolean from NMTDS;
---C++: return const &
--
-- Interferences
--
SSInterferences (me:out)
returns CArray1OfSSInterference from BOPTools;
---C++: return &
---Purpose:
--- Returns the reference to array Of F/F interferences
---
ESInterferences (me:out)
returns CArray1OfESInterference from BOPTools;
---C++: return &
---Purpose:
--- Returns the reference to array Of E/F interferences
---
VSInterferences (me:out)
returns CArray1OfVSInterference from BOPTools;
---C++: return &
---Purpose:
--- Returns the reference to array Of V/F interferences
---
EEInterferences (me:out)
returns CArray1OfEEInterference from BOPTools;
---C++: return &
---Purpose:
--- Returns the reference to arrray Of E/E interferences
---
VEInterferences (me:out)
returns CArray1OfVEInterference from BOPTools;
---C++: return &
---Purpose:
--- Returns the reference to arrray Of V/E interferences
---
VVInterferences (me:out)
returns CArray1OfVVInterference from BOPTools;
---C++: return &
---Purpose:
--- Returns the reference to arrray Of V/V interferences
---
fields
myTable : MapOfPassKeyBoolean from NMTDS [6] is protected;
myList : ListOfPassKeyBoolean from NMTDS is protected;
myMaxInd: Integer from Standard is protected;
--
mySSInterferences : CArray1OfSSInterference from BOPTools is protected;
myESInterferences : CArray1OfESInterference from BOPTools is protected;
myVSInterferences : CArray1OfVSInterference from BOPTools is protected;
myEEInterferences : CArray1OfEEInterference from BOPTools is protected;
myVEInterferences : CArray1OfVEInterference from BOPTools is protected;
myVVInterferences : CArray1OfVVInterference from BOPTools is protected;
end InterfPool;

View File

@ -0,0 +1,281 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTDS_.InterfPoolcxx
// Created: Wed Feb 21 10:35:35 2007
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTDS_InterfPool.ixx>
#include <NMTDS_PassKeyBoolean.hxx>
#include <NMTDS_ListOfPassKeyBoolean.hxx>
#include <NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx>
#include <NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx>
static
Standard_Integer TypeToInteger(const NMTDS_InterfType aType);
//=======================================================================
//function :
//purpose :
//=======================================================================
NMTDS_InterfPool::NMTDS_InterfPool()
{
myMaxInd=6;
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
NMTDS_InterfPool::~NMTDS_InterfPool()
{
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB,
const NMTDS_InterfType aType)
{
Standard_Boolean bRet;
Standard_Integer iType;
//
bRet=Standard_False;
//
iType=TypeToInteger(aType);
if (iType>-1 && iType<myMaxInd) {
bRet=myTable[iType].Add(aPKB);
}
return bRet;
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
const Standard_Integer aInd2,
const NMTDS_InterfType aType)
{
NMTDS_PassKeyBoolean aPKB;
//
aPKB.SetIds(aInd1, aInd2);
return Add(aPKB, aType);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
const Standard_Integer aInd2,
const Standard_Boolean bFlag,
const NMTDS_InterfType aType)
{
NMTDS_PassKeyBoolean aPKB;
//
aPKB.SetIds(aInd1, aInd2);
aPKB.SetFlag(bFlag);
return Add(aPKB, aType);
}
//=======================================================================
//function : Contains
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PassKeyBoolean& aPKB)const
{
Standard_Boolean bRet;
Standard_Integer i;
//
for (i=0; i<myMaxInd; ++i) {
bRet=myTable[i].Contains(aPKB);
if (bRet) {
break;
}
}
return bRet;
}
//=======================================================================
//function : Contains
//purpose :
//=======================================================================
Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1,
const Standard_Integer aInd2)const
{
NMTDS_PassKeyBoolean aPKB;
//
aPKB.SetIds(aInd1, aInd2);
return Contains(aPKB);
}
//=======================================================================
//function : Get
//purpose :
//=======================================================================
const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get()const
{
Standard_Integer i;
NMTDS_ListOfPassKeyBoolean* pL;
//
pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
pL->Clear();
//
for (i=0; i<myMaxInd; ++i) {
NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
//
aIt.Initialize(myTable[i]);
for(; aIt.More(); aIt.Next()) {
const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
pL->Append(aPKB);
}
}
return myList;
}
//=======================================================================
//function : Get
//purpose :
//=======================================================================
const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd)const
{
Standard_Integer i, n1, n2;
NMTDS_ListOfPassKeyBoolean* pL;
//
pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
pL->Clear();
//
for (i=0; i<myMaxInd; ++i) {
NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
//
aIt.Initialize(myTable[i]);
for(; aIt.More(); aIt.Next()) {
const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
aPKB.Ids(n1, n2);
if(n1==aInd || n2==aInd) {
pL->Append(aPKB);
}
}
}
return myList;
}
//=======================================================================
//function : Get
//purpose :
//=======================================================================
const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const NMTDS_InterfType aType)const
{
Standard_Integer iType;
NMTDS_ListOfPassKeyBoolean* pL;
//
pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
pL->Clear();
//
iType=TypeToInteger(aType);
if (iType>-1 && iType<myMaxInd) {
NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
//
aIt.Initialize(myTable[iType]);
for(; aIt.More(); aIt.Next()) {
const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
pL->Append(aPKB);
}
}
return myList;
}
//=======================================================================
//function : Get
//purpose :
//=======================================================================
const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd,
const NMTDS_InterfType aType)const
{
Standard_Integer n1, n2;
NMTDS_ListOfPassKeyBoolean *pL, aLPKB;
NMTDS_ListIteratorOfListOfPassKeyBoolean aIt;
//
aLPKB=Get(aType);
//
pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
pL->Clear();
//
aIt.Initialize (aLPKB);
for (; aIt.More(); aIt.Next()) {
const NMTDS_PassKeyBoolean& aPKB=aIt.Value();
aPKB.Ids(n1, n2);
if(n1==aInd || n2==aInd) {
pL->Append(aPKB);
}
}
return myList;
}
////////////////////
//===========================================================================
//function : SSInterferences
//purpose :
//===========================================================================
BOPTools_CArray1OfSSInterference& NMTDS_InterfPool::SSInterferences()
{
return mySSInterferences;
}
//===========================================================================
//function : ESInterferences
//purpose :
//===========================================================================
BOPTools_CArray1OfESInterference& NMTDS_InterfPool::ESInterferences()
{
return myESInterferences;
}
//===========================================================================
//function : VSInterferences
//purpose :
//===========================================================================
BOPTools_CArray1OfVSInterference& NMTDS_InterfPool::VSInterferences()
{
return myVSInterferences;
}
//===========================================================================
//function : EEInterferences
//purpose :
//===========================================================================
BOPTools_CArray1OfEEInterference& NMTDS_InterfPool::EEInterferences()
{
return myEEInterferences;
}
//===========================================================================
//function : VEInterferences
//purpose :
//===========================================================================
BOPTools_CArray1OfVEInterference& NMTDS_InterfPool::VEInterferences()
{
return myVEInterferences;
}
//===========================================================================
//function : VVInterferences
//purpose :
//===========================================================================
BOPTools_CArray1OfVVInterference& NMTDS_InterfPool::VVInterferences()
{
return myVVInterferences;
}
////////////////////
//=======================================================================
//function : TypeToInteger
//purpose :
//=======================================================================
Standard_Integer TypeToInteger(const NMTDS_InterfType aType)
{
return (Standard_Integer)aType;
}

View File

@ -0,0 +1,191 @@
// 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_InterfPool_HeaderFile
#define _NMTDS_InterfPool_HeaderFile
#ifndef _NMTDS_MapOfPassKeyBoolean_HeaderFile
#include <NMTDS_MapOfPassKeyBoolean.hxx>
#endif
#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
#include <NMTDS_ListOfPassKeyBoolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
#include <BOPTools_CArray1OfSSInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
#include <BOPTools_CArray1OfESInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
#include <BOPTools_CArray1OfVSInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
#include <BOPTools_CArray1OfEEInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
#include <BOPTools_CArray1OfVEInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
#include <BOPTools_CArray1OfVVInterference.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _NMTDS_InterfType_HeaderFile
#include <NMTDS_InterfType.hxx>
#endif
class NMTDS_PassKeyBoolean;
class NMTDS_ListOfPassKeyBoolean;
class BOPTools_CArray1OfSSInterference;
class BOPTools_CArray1OfESInterference;
class BOPTools_CArray1OfVSInterference;
class BOPTools_CArray1OfEEInterference;
class BOPTools_CArray1OfVEInterference;
class BOPTools_CArray1OfVVInterference;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_InterfPool {
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_InterfPool();
Standard_EXPORT virtual ~NMTDS_InterfPool();
Standard_EXPORT Standard_Boolean Add(const NMTDS_PassKeyBoolean& aPKB,const NMTDS_InterfType aType) ;
Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const NMTDS_InterfType aType) ;
Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const Standard_Boolean bFlag,const NMTDS_InterfType aType) ;
Standard_EXPORT Standard_Boolean Contains(const NMTDS_PassKeyBoolean& aPKB) const;
Standard_EXPORT Standard_Boolean Contains(const Standard_Integer aInd1,const Standard_Integer aInd2) const;
Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get() const;
Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const NMTDS_InterfType aType) const;
Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd) const;
Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd,const NMTDS_InterfType aType) const;
//! Returns the reference to array Of F/F interferences <br>
Standard_EXPORT BOPTools_CArray1OfSSInterference& SSInterferences() ;
//! Returns the reference to array Of E/F interferences <br>
Standard_EXPORT BOPTools_CArray1OfESInterference& ESInterferences() ;
//! Returns the reference to array Of V/F interferences <br>
Standard_EXPORT BOPTools_CArray1OfVSInterference& VSInterferences() ;
//! Returns the reference to arrray Of E/E interferences <br>
Standard_EXPORT BOPTools_CArray1OfEEInterference& EEInterferences() ;
//! Returns the reference to arrray Of V/E interferences <br>
Standard_EXPORT BOPTools_CArray1OfVEInterference& VEInterferences() ;
//! Returns the reference to arrray Of V/V interferences <br>
Standard_EXPORT BOPTools_CArray1OfVVInterference& VVInterferences() ;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
NMTDS_MapOfPassKeyBoolean myTable[6];
NMTDS_ListOfPassKeyBoolean myList;
Standard_Integer myMaxInd;
BOPTools_CArray1OfSSInterference mySSInterferences;
BOPTools_CArray1OfESInterference myESInterferences;
BOPTools_CArray1OfVSInterference myVSInterferences;
BOPTools_CArray1OfEEInterference myEEInterferences;
BOPTools_CArray1OfVEInterference myVEInterferences;
BOPTools_CArray1OfVVInterference myVVInterferences;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,24 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_InterfPool.jxx>

View File

@ -0,0 +1,46 @@
// 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_PassKeyBoolean_HeaderFile
#include <NMTDS_PassKeyBoolean.hxx>
#endif
#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
#include <NMTDS_ListOfPassKeyBoolean.hxx>
#endif
#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
#include <BOPTools_CArray1OfSSInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
#include <BOPTools_CArray1OfESInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
#include <BOPTools_CArray1OfVSInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
#include <BOPTools_CArray1OfEEInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
#include <BOPTools_CArray1OfVEInterference.hxx>
#endif
#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
#include <BOPTools_CArray1OfVVInterference.hxx>
#endif
#ifndef _NMTDS_InterfPool_HeaderFile
#include <NMTDS_InterfPool.hxx>
#endif

View File

@ -0,0 +1,39 @@
// 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_InterfType_HeaderFile
#define _NMTDS_InterfType_HeaderFile
enum NMTDS_InterfType {
NMTDS_TI_VV,
NMTDS_TI_VE,
NMTDS_TI_VF,
NMTDS_TI_EE,
NMTDS_TI_EF,
NMTDS_TI_FF,
NMTDS_TI_UNKNOWN
};
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#endif
#endif

View File

@ -33,7 +33,9 @@ uses
ShapesDataStructure from NMTDS,
PShapesDataStructure from NMTDS,
ListOfPassKeyBoolean from NMTDS,
ListIteratorOfListOfPassKeyBoolean from NMTDS
ListIteratorOfListOfPassKeyBoolean from NMTDS,
PassKeyBoolean from NMTDS
--raises
is
@ -61,18 +63,28 @@ is
aIndex2:out Integer from Standard;
aWithSubShape: out Boolean from Standard);
Prepare(me:out);
Prepare(me:out)
is virtual;
Intersect(me:out)
is virtual protected;
ExpectedLength(me)
returns Integer from Standard;
BlockLength(me)
returns Integer from Standard;
SDVertices(me)
returns DataMapOfIntegerListOfInteger from TColStd;
---C++:return const &
FillMVSD(myclass;
aMVSD1:DataMapOfIntegerListOfInteger from TColStd;
aMVSD2:out DataMapOfIntegerListOfInteger from TColStd);
fields
myPDS :PShapesDataStructure from NMTDS is protected;
myDS :PShapesDataStructure from NMTDS is protected;
myLists :ListOfPassKeyBoolean from NMTDS [6] is protected;
myIterator :ListIteratorOfListOfPassKeyBoolean from NMTDS is protected;
myEmptyList:ListOfPassKeyBoolean from NMTDS is protected;

View File

@ -1,5 +1,4 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// Copyright (C) 2006 SAMTECH
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -24,44 +23,35 @@
#include <NMTDS_Iterator.ixx>
#include <NMTDS_CArray1OfIndexRange.hxx>
#include <NMTDS_IndexRange.hxx>
//
#include <Bnd_Box.hxx>
#include <TopoDS_Shape.hxx>
//
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_Array1OfListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
//
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Shape.hxx>
//
#include <TopTools_DataMapOfShapeInteger.hxx>
//
#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <NMTDS_CArray1OfIndexRange.hxx>
#include <NMTDS_IndexRange.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>
#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
static
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);
#include <NMTDS_Tools.hxx>
#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
//=======================================================================
//function : NMTDS_Iterator
@ -69,7 +59,7 @@ static
//=======================================================================
NMTDS_Iterator::NMTDS_Iterator()
{
myPDS=NULL;
myDS=NULL;
myLength=0;
}
//=======================================================================
@ -85,7 +75,7 @@ static
//=======================================================================
void NMTDS_Iterator::SetDS(const NMTDS_PShapesDataStructure& aDS)
{
myPDS=aDS;
myDS=aDS;
}
//=======================================================================
// function: DS
@ -93,7 +83,7 @@ static
//=======================================================================
const NMTDS_ShapesDataStructure& NMTDS_Iterator::DS()const
{
return *myPDS;
return *myDS;
}
//=======================================================================
// function: ExpectedLength
@ -104,6 +94,24 @@ static
return myLength;
}
//=======================================================================
// function: BlockLength
// purpose:
//=======================================================================
Standard_Integer NMTDS_Iterator::BlockLength() const
{
Standard_Integer aNbIIs;
Standard_Real aCfPredict=.5;
aNbIIs=ExpectedLength();
if (aNbIIs<=1) {
return 1;
}
//
aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
return aNbIIs;
}
//=======================================================================
// function: Initialize
// purpose:
//=======================================================================
@ -112,7 +120,7 @@ static
{
Standard_Integer iX;
//
iX=TypeToInteger(aType1, aType2);
iX=NMTDS_Tools::TypeToInteger(aType1, aType2);
if (iX>=0) {
myIterator.Initialize(myLists[iX]);
myLength=myLists[iX].Extent();
@ -158,34 +166,13 @@ static
{
return myMVSD;
}
//=======================================================================
// function: Prepare
// purpose:
//=======================================================================
void NMTDS_Iterator::Prepare()
{
Standard_Boolean bFlag;
Standard_Integer aNb, i, aNbB, aNbR;
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;
//
NMTDS_BoxBndTreeSelector aSelector;
NMTDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
if (myPDS==NULL){
return;
}
Standard_Integer i;
//
myLength=0;
for (i=0; i<6; ++i) {
@ -193,17 +180,48 @@ static
}
myMVSD.Clear();
//
const NMTDS_CArray1OfIndexRange& aRanges=myPDS->Ranges();
if (myDS==NULL){
return;
}
Intersect();
}
//=======================================================================
// function: Intersect
// purpose:
//=======================================================================
void NMTDS_Iterator::Intersect()
{
Standard_Boolean bFlag;
Standard_Integer aNb, i, aNbB, aNbR, iFlag;
Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV;
TColStd_ListIteratorOfListOfInteger aIt;
TColStd_DataMapOfIntegerInteger aMII;
//modified by NIZNHY-PKV Mon Jan 22 15:08:00 2007f
//TColStd_MapOfInteger aMFence;
TColStd_DataMapOfIntegerListOfInteger aMVSD;
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
//modified by NIZNHY-PKV Mon Jan 22 10:21:50 2007t
TopTools_DataMapOfShapeInteger aMSI;
TopAbs_ShapeEnum aTi, aTj;
NMTDS_PassKeyBoolean aPKXB;
NMTDS_MapOfPassKeyBoolean aMPKXB;
NMTDS_IndexedDataMapOfShapeBox aMSB;
//
NMTDS_BoxBndTreeSelector aSelector;
NMTDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
const NMTDS_CArray1OfIndexRange& aRanges=myDS->Ranges();
aNbR=aRanges.Extent();
//
aNb=myPDS->NumberOfShapesOfTheObject();
aNb=myDS->NumberOfShapesOfTheObject();
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aS=myPDS->Shape(i);
const TopoDS_Shape& aS=myDS->Shape(i);
aTi=aS.ShapeType();
if (IsValidType(aTi)) {
if (NMTDS_Tools::HasBRep(aTi)) {
Bnd_Box aBoxEx;
//
ComputeBoxEx(i, myPDS, aBoxEx);
myDS->ComputeBoxEx(i, aBoxEx);
aMSI.Bind(aS, i);
aMSB.Add(aS, aBoxEx);
}
@ -228,9 +246,9 @@ static
i1=aR.First();
i2=aR.Last();
for (i=i1; i<=i2; ++i) {
const TopoDS_Shape& aSi=myPDS->Shape(i);
const TopoDS_Shape& aSi=myDS->Shape(i);
aTi=aSi.ShapeType();
if (!IsValidType(aTi)){
if (!NMTDS_Tools::HasBRep(aTi)){
continue;
}
const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
@ -257,25 +275,24 @@ static
}
//
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);
const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
if (aBoxi.IsOut(aBoxj)) {
bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
}
const TopoDS_Shape& aSj=myPDS->Shape(j);
const TopoDS_Shape& aSj=myDS->Shape(j);
aTj=aSj.ShapeType();
iX=TypeToInteger(aTi, aTj);
iX=NMTDS_Tools::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);
}
aLV.Append(j);
}
}// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
@ -283,112 +300,154 @@ static
// VSD treatment
aNbLV=aLV.Extent();
if (aNbLV) {
myMVSD.Bind(i, aLV);
TColStd_ListOfInteger aLV1;
//
const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
aIt.Initialize(aLV);
for (; aIt.More(); aIt.Next()) {
j=aIt.Value();
const TopoDS_Shape& aSj=myDS->Shape(j);
const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
if (!iFlag) {
aLV1.Append(j);
}
else {
aPKXB.SetIds(i, j);
aMPKXB.Remove(aPKXB);
}
}
aMVSD.Bind(i, aLV1);
}
}//for (i=i1; i<=i2; ++i) {
}//for (iR=1; iR<aNbR; ++iR) {
}
//=======================================================================
// function: IsValidType
// purpose:
//=======================================================================
Standard_Boolean IsValidType(const TopAbs_ShapeEnum aTi)
{
return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
//
//
// Chains
//=================
myMVSD.Clear();
NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
}
//=======================================================================
// function: ComputeBoxEx
// purpose:
//function : FillMVSD
//purpose :
//=======================================================================
void ComputeBoxEx(const Standard_Integer aIx,
NMTDS_ShapesDataStructure* pDS,
Bnd_Box& aBoxEx)
void NMTDS_Iterator::FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD,
TColStd_DataMapOfIntegerListOfInteger& bMVSD)
{
Standard_Integer i, aNbS, iS;
Standard_Boolean bFound;
Standard_Integer aNbVSD, iCnt, i, j, k;
TColStd_ListOfInteger aLV;
TColStd_ListIteratorOfListOfInteger aIt;
TColStd_MapOfInteger aMF;
TColStd_MapIteratorOfMapOfInteger aItMI;
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
NMTDS_DataMapOfIntegerMapOfInteger aDMIMI;
NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger aIti, aItj;
//
const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
aBoxEx.Add(aBox);
//
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);
aNbVSD=aMVSD.Extent();
if (!aNbVSD) {
return;
}
}
//=======================================================================
// function: TypeToInteger
// purpose:
//=======================================================================
Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
const TopAbs_ShapeEnum aType2)
{
Standard_Integer iRet, iT1, iT2, iX;
//
iRet=-1;
iT1=(Standard_Integer)aType1;
iT2=(Standard_Integer)aType2;
//
iX=iT2*10+iT1;
switch (iX) {
case 77:
iRet=5; // VV
break;
case 76:
case 67:
iRet=4; // VE
break;
case 74:
case 47:
iRet=2; // VF
break;
case 66:
iRet=3; // EE
break;
case 64:
case 46:
iRet=1; // EF
break;
case 44:
iRet=0; // FF
break;
default:
break;
}
return iRet;
}
/*
//
// 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);
aItVSD.Initialize(aMVSD);
for (; aItVSD.More(); aItVSD.Next()) {
TColStd_MapOfInteger aMI;
//
i=aItVSD.Key();
aMI.Add(i);
const TColStd_ListOfInteger& aLVSD=aItVSD.Value();
aIt.Initialize(aLVSD);
for (; aIt.More(); aIt.Next()) {
j=aIt.Value();
printf(" %d", j);
aMI.Add(j);
}
printf(")\n");
aDMIMI.Bind(i, aMI);
}
//
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);
// i
aIti.Initialize(aDMIMI);
for (; aIti.More(); aIti.Next()) {
i=aIti.Key();
if (aMF.Contains(i)) {
continue;
}
aMF.Add(i);
//
//TColStd_MapOfInteger& aMIi=aDMIMI.ChangeFind(i);
TColStd_MapOfInteger *pMIi=(TColStd_MapOfInteger *)&aIti.Value();
TColStd_MapOfInteger& aMIi=*pMIi;
// j
while (1) {
iCnt=0;
aItj.Initialize(aDMIMI);
for (; aItj.More(); aItj.Next()) {
j=aItj.Key();
if (aMF.Contains(j)) {
continue;
}
//
//TColStd_MapOfInteger& aMIj=aDMIMI.ChangeFind(j);
TColStd_MapOfInteger *pMj=(TColStd_MapOfInteger *)&aItj.Value();
TColStd_MapOfInteger& aMIj=*pMj;
//
aItMI.Initialize(aMIj);
for (; aItMI.More(); aItMI.Next()) {
k=aItMI.Key();
bFound=aMIi.Contains(k);
if (bFound) {
break;
}
}
if (!bFound) {
continue;
}
//
aItMI.Initialize(aMIj);
for (; aItMI.More(); aItMI.Next()) {
k=aItMI.Key();
aMIi.Add(k);
}
//
if (aMF.Add(j)) {
++iCnt;
}
} //for (; aItj.More(); aItj.Next()) {
if (!iCnt) {
break;
}
} // while (1) {
//
aLV.Clear();
aItMI.Initialize(aMIi);
for (; aItMI.More(); aItMI.Next()) {
k=aItMI.Key();
if (k!=i) {
aLV.Append(k);
}
}
bMVSD.Bind(i, aLV);
}// for (; aIti.More(); aIti.Next()) {
}
/*
{
// check
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItX;
//
printf(" \n");
printf(" myMVSD.Extent()=%d\n", myMVSD.Extent());
aItX.Initialize(myMVSD);
for (; aItX.More(); aItX.Next()) {
i=aItX.Key();
printf(" i=%d (", i);
const TColStd_ListOfInteger& aLV=aItX.Value();
aIt.Initialize(aLV);
for (; aIt.More(); aIt.Next()) {
j=aIt.Value();
printf(" %d", j);
}
printf(")\n");
}
}
printf("\n");
*/

View File

@ -95,15 +95,21 @@ Standard_EXPORT void Next() ;
Standard_EXPORT void Current(Standard_Integer& aIndex1,Standard_Integer& aIndex2,Standard_Boolean& aWithSubShape) const;
Standard_EXPORT void Prepare() ;
Standard_EXPORT virtual void Prepare() ;
Standard_EXPORT Standard_Integer ExpectedLength() const;
Standard_EXPORT Standard_Integer BlockLength() const;
Standard_EXPORT const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const;
Standard_EXPORT static void FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD1,TColStd_DataMapOfIntegerListOfInteger& aMVSD2) ;
@ -113,9 +119,12 @@ protected:
//
Standard_EXPORT virtual void Intersect() ;
// Fields PROTECTED
//
NMTDS_PShapesDataStructure myPDS;
NMTDS_PShapesDataStructure myDS;
NMTDS_ListOfPassKeyBoolean myLists[6];
NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator;
NMTDS_ListOfPassKeyBoolean myEmptyList;

View File

@ -0,0 +1,41 @@
-- Copyright (C) 2007 SAMTECH
--
-- 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: NMTDS_IteratorCheckerSI.cdl
-- Created: Tue Feb 6 10:18:27 2007
-- Author: Peter KURNEV
class IteratorCheckerSI from NMTDS
inherits Iterator from NMTDS
---Purpose:
--uses
--raises
is
Create
returns IteratorCheckerSI from NMTDS;
---C++: alias "Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();"
Intersect(me:out)
is redefined protected;
--fields
end IteratorCheckerSI;

View File

@ -0,0 +1,225 @@
// Copyright (C) 2007 SAMTECH
//
// 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: NMTDS_IteratorChecker.cxx
// Created: Tue Feb 6 10:37:59 2007
// Author: Peter KURNEV
#include <NMTDS_IteratorCheckerSI.ixx>
#include <TopAbs_ShapeEnum.hxx>
#include <gp_Pnt.hxx>
#include <Bnd_Box.hxx>
//
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
//
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
//
#include <TopTools_DataMapOfShapeInteger.hxx>
//
#include <NCollection_UBTreeFiller.hxx>
#include <NMTDS_BoxBndTree.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_CArray1OfIndexRange.hxx>
#include <NMTDS_IndexRange.hxx>
#include <NMTDS_PassKeyBoolean.hxx>
#include <NMTDS_MapOfPassKeyBoolean.hxx>
#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
#include <NMTDS_Tools.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
NMTDS_IteratorCheckerSI::NMTDS_IteratorCheckerSI()
:
NMTDS_Iterator()
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
NMTDS_IteratorCheckerSI::~NMTDS_IteratorCheckerSI()
{
}
//=======================================================================
// function: Intersect
// purpose:
//=======================================================================
void NMTDS_IteratorCheckerSI::Intersect()
{
Standard_Boolean bFlag;
Standard_Integer aNbS, i, aNbA, aNbB, iFlag;
Standard_Integer aNbSD, iX, j, iDS, jB, k, aNbLV;
TColStd_ListIteratorOfListOfInteger aIt;
TColStd_DataMapOfIntegerInteger aMII;
TColStd_DataMapOfIntegerListOfInteger aMVSD;
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
TopTools_DataMapOfShapeInteger aMSI;
TopAbs_ShapeEnum aTi, aTj;
NMTDS_PassKeyBoolean aPKXB;
NMTDS_MapOfPassKeyBoolean aMPKXB;
NMTDS_IndexedDataMapOfShapeBox aMSB;
NMTDS_MapOfPassKeyBoolean aMPA;//myPairsAvoid
//
NMTDS_BoxBndTreeSelector aSelector;
NMTDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aNbS=myDS->NumberOfShapesOfTheObject();
//
// myPairsAvoid, aMSI, aMSB
for (i=1; i<=aNbS; ++i) {
const TopoDS_Shape& aSi=myDS->Shape(i);
aTi=aSi.ShapeType();
if (NMTDS_Tools::HasBRep(aTi)) {
if (aTi!=TopAbs_VERTEX) {
TColStd_IndexedMapOfInteger aMA;
//
myDS->GetAllSuccessors(i, aMA);
//
aNbA=aMA.Extent();
for (j=1; j<=aNbA; ++j) {
iX=aMA(j);
aPKXB.Clear();
aPKXB.SetIds(i, iX);
aMPA.Add(aPKXB);
}
}
else {
aPKXB.Clear();
aPKXB.SetIds(i, i);
aMPA.Add(aPKXB);
}
//
Bnd_Box aBoxEx;
//
myDS->ComputeBoxEx(i, aBoxEx);
aMSI.Bind(aSi, i);
aMSB.Add(aSi, aBoxEx);
}
}
//
// aMII
aNbB=aMSB.Extent();
for (i=1; i<=aNbB; ++i) {
const TopoDS_Shape& aS=aMSB.FindKey(i);
const Bnd_Box& aBoxEx=aMSB(i);
//
aTreeFiller.Add(i, aBoxEx);
//
iDS=aMSI.Find(aS);
aMII.Bind(i, iDS);
}
//
aTreeFiller.Fill();
//
for (i=1; i<=aNbS; ++i) {
const TopoDS_Shape& aSi=myDS->Shape(i);
aTi=aSi.ShapeType();
if (!NMTDS_Tools::HasBRep(aTi)){
continue;
}
const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
aSelector.Clear();
aSelector.SetBox(aBoxEx);
//
aNbSD=aBBTree.Select(aSelector);
if (!aNbSD){
continue;
}
//
const TColStd_ListOfInteger& aLI=aSelector.Indices();
//
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
//
aPKXB.SetIds(i, j);
if (aMPA.Contains(aPKXB)) {
continue;
}
//
if (aMPKXB.Add(aPKXB)) {
bFlag=Standard_False;// Bounding boxes are intersected
const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
if (aBoxi.IsOut(aBoxj)) {
bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
}
const TopoDS_Shape& aSj=myDS->Shape(j);
aTj=aSj.ShapeType();
iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
//bFlag=(iStatus==2);
aPKXB.SetFlag(bFlag);
myLists[iX].Append(aPKXB);
//
// VSD prepare
if (iX==5) { //VV
aLV.Append(j);
}
}// if (aMPKXB.Add(aPKXB)) {
}// for (; aIt.More(); aIt.Next()) {
//
// VSD treatment
aNbLV=aLV.Extent();
if (aNbLV) {
TColStd_ListOfInteger aLV1;
//
const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
aIt.Initialize(aLV);
for (; aIt.More(); aIt.Next()) {
j=aIt.Value();
const TopoDS_Shape& aSj=myDS->Shape(j);
const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
if (!iFlag) {
aLV1.Append(j);
}
else {
aPKXB.SetIds(i, j);
aMPKXB.Remove(aPKXB);
}
}
aMVSD.Bind(i, aLV1);
}
}//for (i=1; i<=aNbS; ++i) {
//
//
// 2. Chains
//=================
myMVSD.Clear();
NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
}

View File

@ -0,0 +1,96 @@
// 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_IteratorCheckerSI_HeaderFile
#define _NMTDS_IteratorCheckerSI_HeaderFile
#ifndef _NMTDS_Iterator_HeaderFile
#include <NMTDS_Iterator.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_IteratorCheckerSI : public NMTDS_Iterator {
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_IteratorCheckerSI();
Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();
protected:
// Methods PROTECTED
//
Standard_EXPORT virtual void Intersect() ;
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,24 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_IteratorCheckerSI.jxx>

View File

@ -0,0 +1,22 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
#include <NMTDS_IteratorCheckerSI.hxx>
#endif

View File

@ -0,0 +1,27 @@
// 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_PInterfPool_HeaderFile
#define _NMTDS_PInterfPool_HeaderFile
class NMTDS_InterfPool;
typedef NMTDS_InterfPool* NMTDS_PInterfPool;
#endif

View File

@ -0,0 +1,27 @@
// 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_PIterator_HeaderFile
#define _NMTDS_PIterator_HeaderFile
class NMTDS_Iterator;
typedef NMTDS_Iterator* NMTDS_PIterator;
#endif

View File

@ -1,4 +1,5 @@
-- Copyright (C) 2006 SAMTECH
-- 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
@ -14,19 +15,21 @@
-- 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
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: NMTDS_PassKey.cdl
-- Created:
-- Created: Mon Nov 20 12:16:13 2006
-- Author: Peter KURNEV
-- <pkv@irinox>
class PassKey from NMTDS
---Purpose:
uses
Shape from TopoDS,
IndexedMapOfInteger from TColStd,
ListOfInteger from TColStd
--raises
@ -34,47 +37,61 @@ uses
is
Create
returns PassKey from NMTDS;
---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKey();"
Assign(me:out;
Other : PassKey from NMTDS)
Create(Other:PassKey from NMTDS)
returns PassKey from NMTDS;
---C++: alias operator =
---C++: return &
--
---C++: alias "Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);"
Clear(me:out);
SetIds(me:out;
aI1 :Integer from Standard);
SetIds(me:out;
aI1 :Integer from Standard;
aI2 :Integer from Standard);
NbMax(me)
SetIds(me:out;
aI1 :Integer from Standard;
aI2 :Integer from Standard;
aI3 :Integer from Standard);
SetIds(me:out;
aI1 :Integer from Standard;
aI2 :Integer from Standard;
aI3 :Integer from Standard;
aI4 :Integer from Standard);
SetIds(me:out;
aLS :ListOfInteger from TColStd);
NbIds(me)
returns Integer from Standard;
Clear(me:out);
Compute(me:out);
IsEqual(me;
aOther:PassKey from NMTDS)
returns Boolean from Standard;
Key(me)
returns Address from Standard;
HashCode(me;
Upper : Integer from Standard)
returns Integer from Standard;
Id(me;
aIndex: Integer from Standard)
returns Integer from Standard;
Ids(me;
aI1 :out Integer from Standard;
aI2 :out Integer from Standard);
Dump(me);
Dump(me;
aHex:Integer from Standard=0);
fields
myNbIds: Integer from Standard is protected;
myNbMax: Integer from Standard is protected;
mySum : Integer from Standard is protected;
myIds : Integer from Standard [2] is protected;
myMap : IndexedMapOfInteger from TColStd is protected;
end PassKey;

View File

@ -1,4 +1,5 @@
// Copyright (C) 2006 SAMTECH
// 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
@ -16,10 +17,11 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTDS_PassKey.cxx
// Created:
//
// File: NMTDS_Algo.cxx
// Created: Sat Dec 04 12:39:47 2004
// Author: Peter KURNEV
// <pkv@irinox>
// <peter@PREFEX>
#include <NMTDS_PassKey.ixx>
@ -27,13 +29,12 @@
#include <stdio.h>
#include <string.h>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#ifdef WNT
#pragma warning( disable : 4101)
#endif
static
void SortShell(const int n, int* a);
static
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv);
@ -44,129 +45,197 @@ static
//=======================================================================
NMTDS_PassKey::NMTDS_PassKey()
{
Clear();
Clear();
}
//=======================================================================
//function :Assign
//function :
//purpose :
//=======================================================================
NMTDS_PassKey& NMTDS_PassKey::Assign(const NMTDS_PassKey& anOther)
NMTDS_PassKey::NMTDS_PassKey(const NMTDS_PassKey& aOther)
{
myNbIds=anOther.myNbIds;
myNbMax=anOther.myNbMax;
mySum=anOther.mySum;
memcpy(myIds, anOther.myIds, sizeof(myIds));
myNbIds=aOther.myNbIds;
mySum=aOther.mySum;
myMap=aOther.myMap;
}
//=======================================================================
//function :operator =
//purpose :
//=======================================================================
NMTDS_PassKey& NMTDS_PassKey::operator =(const NMTDS_PassKey& aOther)
{
myNbIds=aOther.myNbIds;
mySum=aOther.mySum;
myMap=aOther.myMap;
return *this;
}
//=======================================================================
//function :~
//purpose :
//=======================================================================
NMTDS_PassKey::~NMTDS_PassKey()
{
}
//=======================================================================
//function :Clear
//purpose :
//=======================================================================
void NMTDS_PassKey::Clear()
{
Standard_Integer i;
//
myNbIds=0;
myNbMax=2;
mySum=0;
for (i=0; i<myNbMax; ++i) {
myIds[i]=0;
}
myMap.Clear();
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer anId1,
const Standard_Integer anId2)
void NMTDS_PassKey::SetIds(const Standard_Integer aId1)
{
Standard_Integer aIdN1, aIdN2;
Clear();
myNbIds=1;
myMap.Add(aId1);
mySum=NormalizedId(aId1, myNbIds);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
const Standard_Integer aId2)
{
TColStd_ListOfInteger aLI;
//
myNbIds=2;
aIdN1=NormalizedId(anId1, myNbIds);
aIdN2=NormalizedId(anId2, myNbIds);
mySum=aIdN1+aIdN2;
aLI.Append(aId1);
aLI.Append(aId2);
SetIds(aLI);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
const Standard_Integer aId2,
const Standard_Integer aId3)
{
TColStd_ListOfInteger aLI;
//
if (anId1<anId2) {
myIds[myNbMax-2]=anId1;
myIds[myNbMax-1]=anId2;
return;
aLI.Append(aId1);
aLI.Append(aId2);
aLI.Append(aId3);
SetIds(aLI);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
const Standard_Integer aId2,
const Standard_Integer aId3,
const Standard_Integer aId4)
{
TColStd_ListOfInteger aLI;
//
aLI.Append(aId1);
aLI.Append(aId2);
aLI.Append(aId3);
aLI.Append(aId4);
SetIds(aLI);
}
//=======================================================================
//function :SetIds
//purpose :
//=======================================================================
void NMTDS_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
{
Standard_Integer i, aId, aIdN;
TColStd_ListIteratorOfListOfInteger aIt;
//
Clear();
aIt.Initialize(aLI);
for (; aIt.More(); aIt.Next()) {
aId=aIt.Value();
myMap.Add(aId);
}
myIds[myNbMax-2]=anId2;
myIds[myNbMax-1]=anId1;
myNbIds=myMap.Extent();
for(i=1; i<=myNbIds; ++i) {
aId=myMap(i);
aIdN=NormalizedId(aId, myNbIds);
mySum+=aIdN;
}
}
//=======================================================================
//function :NbIds
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKey::NbIds()const
{
return myNbIds;
}
//=======================================================================
//function :Id
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKey::Id(const Standard_Integer aIndex) const
{
if (aIndex<1 || aIndex>myNbIds) {
return -1;
}
return myMap(aIndex);
}
//=======================================================================
//function :Ids
//purpose :
//=======================================================================
void NMTDS_PassKey::Ids(Standard_Integer& aId1,
Standard_Integer& aId2)const
Standard_Integer& aId2) const
{
aId1=myIds[0];
aId2=myIds[1];
}
//=======================================================================
//function :NbMax
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKey::NbMax()const
{
return myNbMax;
}
//=======================================================================
//function :Compute
//purpose :
//=======================================================================
void NMTDS_PassKey::Compute()
{
SortShell(myNbIds, myIds+myNbMax-myNbIds);
aId1=0;
aId2=0;
if (myNbIds>1) {
aId1=myMap(1);
aId2=myMap(2);
}
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& anOther) const
Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& aOther) const
{
Standard_Integer iIsEqual;
Standard_Boolean bIsEqual;
Standard_Boolean bRet;
Standard_Integer i, aId;
//
iIsEqual=memcmp(myIds, anOther.myIds, sizeof(myIds));
bIsEqual=Standard_False;
if (!iIsEqual) {
bIsEqual=!bIsEqual;
bRet=Standard_False;
//
if (myNbIds!=aOther.myNbIds) {
return bRet;
}
return bIsEqual;
}
//=======================================================================
//function :Key
//purpose :
//=======================================================================
Standard_Address NMTDS_PassKey::Key()const
{
return (Standard_Address)myIds;
for (i=1; i<=myNbIds; ++i) {
aId=myMap(i);
if (!aOther.myMap.Contains(aId)) {
return bRet;
}
}
return !bRet;
}
//=======================================================================
//function : HashCode
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer Upper) const
Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer aUpper) const
{
return ::HashCode(mySum, Upper);
return ::HashCode(mySum, aUpper);
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
void NMTDS_PassKey::Dump()const
void NMTDS_PassKey::Dump(const Standard_Integer )const
{
Standard_Integer i;
//
printf(" PassKey: {");
for (i=0; i<myNbMax; ++i) {
printf(" %d", myIds[i]);
}
printf(" }");
}
//=======================================================================
// function: NormalizedId
// purpose :
@ -184,33 +253,109 @@ Standard_Integer NormalizedId(const Standard_Integer aId,
}
return aIdRet;
}
/*
//=========
//=======================================================================
// function: SortShell
// purpose :
//function : Contains
//purpose :
//=======================================================================
void SortShell(const int n, int* a)
Standard_Boolean NMTDS_PassKey::Contains(const Standard_Integer aId) const
{
int x, nd, i, j, l, d=1;
return myMap.Contains(aId);
}
//=======================================================================
//function :Contains
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKey::Contains(const NMTDS_PassKey& aOther) const
{
Standard_Boolean bRet;
Standard_Integer i, aId;
//
while(d<=n) {
d*=2;
bRet=Standard_False;
//
if (myNbIds<aOther.myNbIds) {
return bRet;
}
for (i=1; i<=aOther.myNbIds; ++i) {
aId=aOther.myMap(i);
if (!myMap.Contains(aId)) {
return bRet;
}
}
return !bRet;
}
//=======================================================================
//function :Intersected
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKey::Intersected(const NMTDS_PassKey& aOther) const
{
Standard_Boolean bRet;
Standard_Integer i, aId;
//
bRet=Standard_False;
//
for (i=1; i<=myNbIds; ++i) {
aId=myMap(i);
if (aOther.Contains(aId)) {
return !bRet;
}
}
return bRet;
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void NMTDS_PassKey::Add(const Standard_Integer aId)
{
TColStd_ListOfInteger aLI;
aLI.Append(aId);
//
Add(aLI);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void NMTDS_PassKey::Add(const NMTDS_PassKey& aOther)
{
Standard_Integer i, aId;
TColStd_ListOfInteger aLS;
//
for(i=1; i<=myNbIds; ++i) {
aId=myMap(i);
aLS.Append(aId);
}
for(i=1; i<=aOther.myNbIds; ++i) {
aId=aOther.myMap(i);
aLS.Append(aId);
}
//
while (d) {
d=(d-1)/2;
//
nd=n-d;
for (i=0; i<nd; ++i) {
j=i;
m30:;
l=j+d;
if (a[l] < a[j]){
x=a[j];
a[j]=a[l];
a[l]=x;
j-=d;
if (j > -1) goto m30;
}//if (a[l] < a[j]){
}//for (i=0; i<nd; ++i)
}//while (1)
Add(aLS);
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void NMTDS_PassKey::Add(const TColStd_ListOfInteger& aLI)
{
Standard_Integer i, aId;
TColStd_ListOfInteger aLS;
TColStd_ListIteratorOfListOfInteger aIt;
//
for(i=1; i<=myNbIds; ++i) {
aId=myMap(i);
aLS.Append(aId);
}
aIt.Initialize(aLI);
for (; aIt.More(); aIt.Next()) {
aId=aIt.Value();
aLS.Append(aId);
}
//
SetIds(aLS);
}
//=========
*/

View File

@ -23,12 +23,13 @@
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
#include <TColStd_IndexedMapOfInteger.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
class TColStd_ListOfInteger;
#ifndef _Standard_HeaderFile
@ -60,41 +61,47 @@ public:
Standard_EXPORT NMTDS_PassKey();
Standard_EXPORT virtual ~NMTDS_PassKey();
Standard_EXPORT NMTDS_PassKey& Assign(const NMTDS_PassKey& Other) ;
NMTDS_PassKey& operator =(const NMTDS_PassKey& Other)
{
return Assign(Other);
}
Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ;
Standard_EXPORT Standard_Integer NbMax() const;
Standard_EXPORT NMTDS_PassKey(const NMTDS_PassKey& Other);
Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);
Standard_EXPORT void Clear() ;
Standard_EXPORT void Compute() ;
Standard_EXPORT void SetIds(const Standard_Integer aI1) ;
Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ;
Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3) ;
Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3,const Standard_Integer aI4) ;
Standard_EXPORT void SetIds(const TColStd_ListOfInteger& aLS) ;
Standard_EXPORT Standard_Integer NbIds() const;
Standard_EXPORT Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
Standard_EXPORT Standard_Address Key() const;
Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const;
Standard_EXPORT Standard_Integer Id(const Standard_Integer aIndex) const;
Standard_EXPORT void Ids(Standard_Integer& aI1,Standard_Integer& aI2) const;
Standard_EXPORT void Dump() const;
Standard_EXPORT void Dump(const Standard_Integer aHex = 0) const;
@ -109,9 +116,8 @@ protected:
// Fields PROTECTED
//
Standard_Integer myNbIds;
Standard_Integer myNbMax;
Standard_Integer mySum;
Standard_Integer myIds[2];
TColStd_IndexedMapOfInteger myMap;
private:

View File

@ -17,6 +17,9 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _TColStd_ListOfInteger_HeaderFile
#include <TColStd_ListOfInteger.hxx>
#endif
#ifndef _NMTDS_PassKey_HeaderFile
#include <NMTDS_PassKey.hxx>
#endif

View File

@ -36,21 +36,16 @@ uses
is
Create
returns PassKeyBoolean from NMTDS;
---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();"
Assign(me:out;
Other : PassKeyBoolean from NMTDS)
returns PassKeyBoolean from NMTDS;
---C++: alias operator =
---C++: return &
--
SetFlag(me:out;
aFlag: Boolean from Standard);
---C++: alias " Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);"
Flag(me)
returns Boolean from Standard;
fields
myFlag: Boolean from Standard is protected;
end PassKeyBoolean;

View File

@ -25,7 +25,7 @@
#include <NMTDS_PassKeyBoolean.ixx>
//=======================================================================
//function : NMTDS_PassKeyBoolean
//function :
//purpose :
//=======================================================================
NMTDS_PassKeyBoolean::NMTDS_PassKeyBoolean()
@ -35,13 +35,20 @@
{
}
//=======================================================================
//function :Assign
//function : ~
//purpose :
//=======================================================================
NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::Assign(const NMTDS_PassKeyBoolean& anOther)
NMTDS_PassKeyBoolean::~NMTDS_PassKeyBoolean()
{
}
//=======================================================================
//function :operator =
//purpose :
//=======================================================================
NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::operator =(const NMTDS_PassKeyBoolean& anOther)
{
myFlag=anOther.myFlag;
NMTDS_PassKey::Assign(anOther);
NMTDS_PassKey::operator =(anOther);
return *this;
}
//=======================================================================

View File

@ -57,17 +57,11 @@ public:
Standard_EXPORT NMTDS_PassKeyBoolean();
Standard_EXPORT NMTDS_PassKeyBoolean& Assign(const NMTDS_PassKeyBoolean& Other) ;
NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other)
{
return Assign(Other);
}
Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();
Standard_EXPORT void SetFlag(const Standard_Boolean aFlag) ;
Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);
Standard_EXPORT Standard_Boolean Flag() const;

View File

@ -1,4 +1,5 @@
-- Copyright (C) 2006 SAMTECH
-- 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
@ -14,7 +15,7 @@
-- 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
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: NMTDS_PassKeyMapHasher.cdl
-- Created:

View File

@ -1,4 +1,5 @@
// Copyright (C) 2006 SAMTECH
// 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
@ -28,17 +29,17 @@
//function : HashCode
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPKey,
Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPK,
const Standard_Integer Upper)
{
return aPKey.HashCode(Upper);
return aPK.HashCode(Upper);
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPKey1,
const NMTDS_PassKey& aPKey2)
Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPK1,
const NMTDS_PassKey& aPK2)
{
return aPKey1.IsEqual(aPKey2);
return aPK1.IsEqual(aPK2);
}

View File

@ -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
--
-- File: NMTDS_PassKeyShape.cdl
-- Created:
-- Author: Peter KURNEV
-- <pkv@irinox>
class PassKeyShape from NMTDS
---Purpose:
uses
Shape from TopoDS,
ListOfShape from TopTools,
IndexedMapOfShape from TopTools
--raises
is
Create
returns PassKeyShape from NMTDS;
---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyShape();"
Create(Other:PassKeyShape from NMTDS)
returns PassKeyShape from NMTDS;
Assign(me:out;
Other : PassKeyShape from NMTDS)
returns PassKeyShape from NMTDS;
---C++: alias operator =
---C++: return &
SetShapes(me:out;
aS :Shape from TopoDS);
SetShapes(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS);
SetShapes(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS;
aS3 :Shape from TopoDS);
SetShapes(me:out;
aS1 :Shape from TopoDS;
aS2 :Shape from TopoDS;
aS3 :Shape from TopoDS;
aS4 :Shape from TopoDS);
SetShapes(me:out;
aLS :ListOfShape from TopTools);
Clear(me:out);
NbIds(me)
returns Integer from Standard;
IsEqual(me;
aOther:PassKeyShape from NMTDS)
returns Boolean from Standard;
HashCode(me;
Upper : Integer from Standard)
returns Integer from Standard;
Dump(me;
aHex:Integer from Standard=0);
fields
myNbIds:Integer from Standard is protected;
mySum :Integer from Standard is protected;
myUpper:Integer from Standard is protected;
myMap :IndexedMapOfShape from TopTools is protected;
end PassKeyShape;

View File

@ -0,0 +1,227 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTDS_PassKeyShape.cxx
// Created:
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTDS_PassKeyShape.ixx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
static
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv);
//=======================================================================
//function :
//purpose :
//=======================================================================
NMTDS_PassKeyShape::NMTDS_PassKeyShape()
{
myUpper=432123;
}
//=======================================================================
//function :
//purpose :
//=======================================================================
NMTDS_PassKeyShape::NMTDS_PassKeyShape(const NMTDS_PassKeyShape& aOther)
{
myUpper=432123;
myNbIds=aOther.myNbIds;
mySum=aOther.mySum;
myMap=aOther.myMap;
}
//=======================================================================
//function :~
//purpose :
//=======================================================================
NMTDS_PassKeyShape::~NMTDS_PassKeyShape()
{
}
//=======================================================================
//function :Assign
//purpose :
//=======================================================================
NMTDS_PassKeyShape& NMTDS_PassKeyShape::Assign(const NMTDS_PassKeyShape& aOther)
{
myUpper=432123;
myNbIds=aOther.myNbIds;
mySum=aOther.mySum;
myMap=aOther.myMap;
return *this;
}
//=======================================================================
//function :Clear
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::Clear()
{
myNbIds=0;
mySum=0;
myMap.Clear();
}
//=======================================================================
//function :SetShapes
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
{
Standard_Integer aHC;
//
Clear();
myNbIds=1;
myMap.Add(aS1);
aHC=aS1.HashCode(myUpper);
mySum=NormalizedId(aHC, myNbIds);
}
//=======================================================================
//function :SetShapes
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2)
{
TopTools_ListOfShape aLS;
//
aLS.Append(aS1);
aLS.Append(aS2);
SetShapes(aLS);
}
//=======================================================================
//function :SetShapes
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
const TopoDS_Shape& aS3)
{
TopTools_ListOfShape aLS;
//
aLS.Append(aS1);
aLS.Append(aS2);
aLS.Append(aS3);
SetShapes(aLS);
}
//=======================================================================
//function :SetShapes
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
const TopoDS_Shape& aS2,
const TopoDS_Shape& aS3,
const TopoDS_Shape& aS4)
{
TopTools_ListOfShape aLS;
//
aLS.Append(aS1);
aLS.Append(aS2);
aLS.Append(aS3);
aLS.Append(aS4);
SetShapes(aLS);
}
//=======================================================================
//function :SetShapes
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::SetShapes(const TopTools_ListOfShape& aLS)
{
Standard_Integer i, aId, aIdN;
TopTools_ListIteratorOfListOfShape aIt;
//
Clear();
aIt.Initialize(aLS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value();
myMap.Add(aS);
}
myNbIds=myMap.Extent();
for(i=1; i<=myNbIds; ++i) {
const TopoDS_Shape& aS=myMap(i);
aId=aS.HashCode(myUpper);
aIdN=NormalizedId(aId, myNbIds);
mySum+=aIdN;
}
}
//=======================================================================
//function :NbIds
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKeyShape::NbIds()const
{
return myNbIds;
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKeyShape::IsEqual(const NMTDS_PassKeyShape& aOther) const
{
Standard_Boolean bRet;
Standard_Integer i;
//
bRet=Standard_False;
//
if (myNbIds!=aOther.myNbIds) {
return bRet;
}
for (i=1; i<=myNbIds; ++i) {
const TopoDS_Shape& aS=myMap(i);
if (!aOther.myMap.Contains(aS)) {
return bRet;
}
}
return !bRet;
}
//=======================================================================
//function : HashCode
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKeyShape::HashCode(const Standard_Integer aUpper) const
{
return ::HashCode(mySum, aUpper);
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
void NMTDS_PassKeyShape::Dump(const Standard_Integer)const
{
}
//=======================================================================
// function: NormalizedId
// purpose :
//=======================================================================
Standard_Integer NormalizedId(const Standard_Integer aId,
const Standard_Integer aDiv)
{
Standard_Integer aMax, aTresh, aIdRet;
//
aIdRet=aId;
aMax=::IntegerLast();
aTresh=aMax/aDiv;
if (aId>aTresh) {
aIdRet=aId%aTresh;
}
return aIdRet;
}

View File

@ -0,0 +1,146 @@
// 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_PassKeyShape_HeaderFile
#define _NMTDS_PassKeyShape_HeaderFile
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopTools_IndexedMapOfShape_HeaderFile
#include <TopTools_IndexedMapOfShape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class TopoDS_Shape;
class TopTools_ListOfShape;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_PassKeyShape {
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_PassKeyShape();
Standard_EXPORT virtual ~NMTDS_PassKeyShape();
Standard_EXPORT NMTDS_PassKeyShape(const NMTDS_PassKeyShape& Other);
Standard_EXPORT NMTDS_PassKeyShape& Assign(const NMTDS_PassKeyShape& Other) ;
NMTDS_PassKeyShape& operator =(const NMTDS_PassKeyShape& Other)
{
return Assign(Other);
}
Standard_EXPORT void SetShapes(const TopoDS_Shape& aS) ;
Standard_EXPORT void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
Standard_EXPORT void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
Standard_EXPORT void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
Standard_EXPORT void SetShapes(const TopTools_ListOfShape& aLS) ;
Standard_EXPORT void Clear() ;
Standard_EXPORT Standard_Integer NbIds() const;
Standard_EXPORT Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aOther) const;
Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const;
Standard_EXPORT void Dump(const Standard_Integer aHex = 0) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
Standard_Integer myNbIds;
Standard_Integer mySum;
Standard_Integer myUpper;
TopTools_IndexedMapOfShape myMap;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,24 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_PassKeyShape.jxx>

View File

@ -0,0 +1,28 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_ListOfShape_HeaderFile
#include <TopTools_ListOfShape.hxx>
#endif
#ifndef _NMTDS_PassKeyShape_HeaderFile
#include <NMTDS_PassKeyShape.hxx>
#endif

View File

@ -0,0 +1,47 @@
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License.
--
-- This library is distributed in the hope that it will be useful
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: NMTDS_PassKeyMapHasher.cdl
-- Created:
-- Author: Peter KURNEV
-- <pkv@irinox>
class PassKeyShapeMapHasher from NMTDS
---Purpose:
uses
PassKeyShape from NMTDS
--raises
is
HashCode(myclass;
aPKey : PassKeyShape from NMTDS;
Upper : Integer from Standard)
returns Integer from Standard;
IsEqual(myclass;
aPKey1 : PassKeyShape from NMTDS;
aPKey2 : PassKeyShape from NMTDS)
returns Boolean from Standard;
end PassKeyShapeMapHasher;

View File

@ -0,0 +1,45 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTDS_PassKeyMapHasher.cxx
// Created:
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTDS_PassKeyShapeMapHasher.ixx>
//=======================================================================
//function : HashCode
//purpose :
//=======================================================================
Standard_Integer NMTDS_PassKeyShapeMapHasher::HashCode(const NMTDS_PassKeyShape& aPK,
const Standard_Integer Upper)
{
return aPK.HashCode(Upper);
}
//=======================================================================
//function :IsEqual
//purpose :
//=======================================================================
Standard_Boolean NMTDS_PassKeyShapeMapHasher::IsEqual(const NMTDS_PassKeyShape& aPK1,
const NMTDS_PassKeyShape& aPK2)
{
return aPK1.IsEqual(aPK2);
}

View File

@ -0,0 +1,99 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
#define _NMTDS_PassKeyShapeMapHasher_HeaderFile
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class NMTDS_PassKeyShape;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_PassKeyShapeMapHasher {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT static Standard_Integer HashCode(const NMTDS_PassKeyShape& aPKey,const Standard_Integer Upper) ;
Standard_EXPORT static Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aPKey1,const NMTDS_PassKeyShape& aPKey2) ;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,24 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_PassKeyShapeMapHasher.jxx>

View File

@ -0,0 +1,25 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _NMTDS_PassKeyShape_HeaderFile
#include <NMTDS_PassKeyShape.hxx>
#endif
#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
#include <NMTDS_PassKeyShapeMapHasher.hxx>
#endif

View File

@ -28,6 +28,8 @@ class ShapesDataStructure from NMTDS
---Purpose:
uses
Box from Bnd,
IndexedMapOfInteger from TColStd,
Shape from TopoDS,
IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations,
CArray1OfIndexRange from NMTDS,
@ -79,6 +81,14 @@ is
aMS :out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations);
-- Contribution of Samtech www.samcef.com END
GetAllSuccessors(me;
anIndex:Integer from Standard;
aScrs :out IndexedMapOfInteger from TColStd);
ComputeBoxEx(me;
anIndex:Integer from Standard;
aBox:out Box from Bnd);
fields
myCompositeShape: Shape from TopoDS is protected;
myRanges : CArray1OfIndexRange from NMTDS is protected;

View File

@ -24,19 +24,28 @@
#include <NMTDS_ShapesDataStructure.ixx>
#include <TColStd_MapOfInteger.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <BooleanOperations_ShapeAndInterferences.hxx>
#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
#include <NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
#include <BooleanOperations_ShapeAndInterferences.hxx>
#include <NMTDS_IndexRange.hxx>
//
#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <NMTDS_Tools.hxx>
static
void ComputeBoxExS(const Standard_Integer aIx,
const NMTDS_ShapesDataStructure* pDS,
Bnd_Box& aBoxEx);
static
void GetAllSuccessorsS(const Standard_Integer nS,
const NMTDS_ShapesDataStructure* myDS,
TColStd_IndexedMapOfInteger& aMA);
//===========================================================================
//function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure
@ -170,7 +179,6 @@
}
//modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t
}
//
aNbS=aMSA.Extent();
//
// Fill myRanges
@ -214,6 +222,7 @@
// Contribution of Samtech www.samcef.com BEGIN
//
// Fill the table
//aShift=0;
//for (i=0; i<2; ++i) {
// if (i) {
@ -361,3 +370,72 @@
// Contribution of Samtech www.samcef.com END
return aIndex;
}
//=======================================================================
//function : ComputeBoxEx
//purpose :
//=======================================================================
void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx,
Bnd_Box& aBoxEx)const
{
ComputeBoxExS(aIx, this, aBoxEx);
}
//=======================================================================
//function : GetAllSuccessors
//purpose :
//=======================================================================
void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS,
TColStd_IndexedMapOfInteger& aMA)const
{
GetAllSuccessorsS(nS, this, aMA);
}
//=======================================================================
//function : GetAllSuccessorsS
//purpose :
//=======================================================================
void GetAllSuccessorsS(const Standard_Integer nS,
const NMTDS_ShapesDataStructure* myDS,
TColStd_IndexedMapOfInteger& aMA)
{
TopAbs_ShapeEnum aT;
Standard_Integer i, nSx, aNbSuccessors, *pSuccessors;
Standard_Address xSuccessors;
//
const TopoDS_Shape& aS=myDS->Shape(nS);
aT=aS.ShapeType();
if(NMTDS_Tools::HasBRep(aT)) {
aMA.Add(nS);
//
if (aT==TopAbs_VERTEX) {
return;
}
}
//
myDS->GetSuccessors(nS, xSuccessors, aNbSuccessors);
pSuccessors=(Standard_Integer*)xSuccessors;
for (i=0; i<aNbSuccessors; ++i) {
nSx=pSuccessors[i];
GetAllSuccessorsS(nSx, myDS, aMA);
}
}
//=======================================================================
// function: ComputeBoxExS
// purpose:
//=======================================================================
void ComputeBoxExS(const Standard_Integer aIx,
const NMTDS_ShapesDataStructure* pDS,
Bnd_Box& aBoxEx)
{
Standard_Integer i, aNbS, iS;
//
const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
aBoxEx.Add(aBox);
//
aNbS=pDS->NumberOfSuccessors(aIx);
for (i=1; i<=aNbS; ++i) {
Bnd_Box aBoxS;
iS=pDS->GetSuccessor(aIx, i);
ComputeBoxExS(iS, pDS, aBoxS);
aBoxEx.Add(aBoxS);
}
}

View File

@ -38,6 +38,8 @@
class TopoDS_Shape;
class NMTDS_CArray1OfIndexRange;
class BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors;
class TColStd_IndexedMapOfInteger;
class Bnd_Box;
#ifndef _Standard_HeaderFile
@ -98,6 +100,12 @@ Standard_EXPORT void FillMap(const TopoDS_Shape& aS,BooleanOperations_IndexedD
Standard_EXPORT void FillSubshapes(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const;
Standard_EXPORT void GetAllSuccessors(const Standard_Integer anIndex,TColStd_IndexedMapOfInteger& aScrs) const;
Standard_EXPORT void ComputeBoxEx(const Standard_Integer anIndex,Bnd_Box& aBox) const;

View File

@ -26,6 +26,12 @@
#ifndef _BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors_HeaderFile
#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
#endif
#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
#include <TColStd_IndexedMapOfInteger.hxx>
#endif
#ifndef _Bnd_Box_HeaderFile
#include <Bnd_Box.hxx>
#endif
#ifndef _NMTDS_ShapesDataStructure_HeaderFile
#include <NMTDS_ShapesDataStructure.hxx>
#endif

64
src/NMTDS/NMTDS_Tools.cdl Normal file
View File

@ -0,0 +1,64 @@
-- Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License.
--
-- This library is distributed in the hope that it will be useful
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--
-- File: NMTDS_Tools.cdl
-- Created: Tue Feb 20 14:56:14 2007
-- Author: Peter KURNEV
-- <pkv@irinox>
---Copyright: Matra Datavision 2007
class Tools from NMTDS
---Purpose:
uses
ShapeEnum from TopAbs,
Vertex from TopoDS,
Shape from TopoDS,
IndexedDataMapOfShapeShape from TopTools
--raises
is
TypeToInteger(myclass;
aT1: ShapeEnum from TopAbs;
aT2: ShapeEnum from TopAbs)
returns Integer from Standard;
HasBRep(myclass;
aT: ShapeEnum from TopAbs)
returns Boolean from Standard;
ComputeVV(myclass;
aV1:Vertex from TopoDS;
aV2:Vertex from TopoDS)
returns Integer from Standard;
CopyShape(myclass;
aS:Shape from TopoDS;
aSC:out Shape from TopoDS);
CopyShape(myclass;
aS:Shape from TopoDS;
aSC :out Shape from TopoDS;
aMSS :out IndexedDataMapOfShapeShape from TopTools);
--fields
end Tools;

173
src/NMTDS/NMTDS_Tools.cxx Normal file
View File

@ -0,0 +1,173 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTDS_Tools.cxx
// Created: Tue Feb 20 14:57:28 2007
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTDS_Tools.ixx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Builder.hxx>
void CopySource(const TopoDS_Shape& aS,
TopTools_IndexedDataMapOfShapeShape& aMapSS,
TopoDS_Shape& aSC);
//=======================================================================
//function : CopyShape
//purpose :
//=======================================================================
void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
TopoDS_Shape& aSC)
{
TopTools_IndexedDataMapOfShapeShape aMapSS;
//
CopySource(aS, aMapSS, aSC);
}
//=======================================================================
//function : CopyShape
//purpose :
//=======================================================================
void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
TopoDS_Shape& aSC,
TopTools_IndexedDataMapOfShapeShape& aMapSS)
{
CopySource(aS, aMapSS, aSC);
}
//=======================================================================
//function : CopySource
//purpose :
//=======================================================================
void CopySource(const TopoDS_Shape& aS,
TopTools_IndexedDataMapOfShapeShape& aMapSS,
TopoDS_Shape& aSC)
{
Standard_Boolean bFree;
TopAbs_ShapeEnum aT;
TopoDS_Iterator aIt;
BRep_Builder BB;
//
aT=aS.ShapeType();
//
if (aMapSS.Contains(aS)) {
aSC=aMapSS.ChangeFromKey(aS);
aSC.Orientation(aS.Orientation());
return;
}
else {
aSC=aS.EmptyCopied();
aMapSS.Add(aS, aSC);
}
//
bFree=aSC.Free();
aSC.Free(Standard_True);
aIt.Initialize(aS);
for (; aIt.More(); aIt.Next()) {
TopoDS_Shape aSCx;
//
const TopoDS_Shape& aSx=aIt.Value();
//
CopySource (aSx, aMapSS, aSCx);
//
aSCx.Orientation(aSx.Orientation());
BB.Add(aSC, aSCx);
}
aSC.Free(bFree);
}
//=======================================================================
// function: ComputeVV
// purpose:
//=======================================================================
Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1,
const TopoDS_Vertex& aV2)
{
Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
gp_Pnt aP1, aP2;
//
aTolV1=BRep_Tool::Tolerance(aV1);
aTolV2=BRep_Tool::Tolerance(aV2);
aTolSum=aTolV1+aTolV2;
aTolSum2=aTolSum*aTolSum;
//
aP1=BRep_Tool::Pnt(aV1);
aP2=BRep_Tool::Pnt(aV2);
//
aD2=aP1.SquareDistance(aP2);
if (aD2>aTolSum2) {
return -1;
}
return 0;
}
//=======================================================================
// function: HasBRep
// purpose:
//=======================================================================
Standard_Boolean NMTDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
{
return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
}
//=======================================================================
//function : TypeToInteger
//purpose :
//=======================================================================
Standard_Integer NMTDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
const TopAbs_ShapeEnum aType2)
{
Standard_Integer iRet, iT1, iT2, iX;
//
iRet=-1;
iT1=(Standard_Integer)aType1;
iT2=(Standard_Integer)aType2;
//
iX=iT2*10+iT1;
switch (iX) {
case 77:
iRet=5; // VV
break;
case 76:
case 67:
iRet=4; // VE
break;
case 74:
case 47:
iRet=2; // VF
break;
case 66:
iRet=3; // EE
break;
case 64:
case 46:
iRet=1; // EF
break;
case 44:
iRet=0; // FF
break;
default:
break;
}
return iRet;
}

113
src/NMTDS/NMTDS_Tools.hxx Normal file
View File

@ -0,0 +1,113 @@
// 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_Tools_HeaderFile
#define _NMTDS_Tools_HeaderFile
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class TopoDS_Vertex;
class TopoDS_Shape;
class TopTools_IndexedDataMapOfShapeShape;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTDS_Tools {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
Standard_EXPORT static Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aT1,const TopAbs_ShapeEnum aT2) ;
Standard_EXPORT static Standard_Boolean HasBRep(const TopAbs_ShapeEnum aT) ;
Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& aV1,const TopoDS_Vertex& aV2) ;
Standard_EXPORT static void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC) ;
Standard_EXPORT static void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC,TopTools_IndexedDataMapOfShapeShape& aMSS) ;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

24
src/NMTDS/NMTDS_Tools.ixx Normal file
View File

@ -0,0 +1,24 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTDS_Tools.jxx>

31
src/NMTDS/NMTDS_Tools.jxx Normal file
View File

@ -0,0 +1,31 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _TopoDS_Vertex_HeaderFile
#include <TopoDS_Vertex.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#endif
#ifndef _NMTDS_Tools_HeaderFile
#include <NMTDS_Tools.hxx>
#endif

View File

@ -37,12 +37,13 @@ VPATH=.:@srcdir@
# Libraries targets
LIB = libNMTTools.la
LIB_SRC = \
NMTTools_CheckerSI.cxx \
NMTTools_CheckerSI_1.cxx \
NMTTools_CommonBlockAPI.cxx \
NMTTools_CommonBlock.cxx \
NMTTools_CommonBlockPool_0.cxx \
NMTTools_CoupleOfShape.cxx \
NMTTools_DEProcessor.cxx \
NMTTools_DSFiller.cxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger_0.cxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape_0.cxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock_0.cxx \
@ -67,7 +68,6 @@ LIB_SRC = \
NMTTools_PaveFiller_8.cxx \
NMTTools_PaveFiller_9.cxx \
NMTTools_PaveFiller.cxx \
NMTTools_PCurveMaker.cxx \
NMTTools_Tools.cxx \
NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock_0.cxx \
NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock_0.cxx \
@ -90,12 +90,12 @@ EXPORT_HEADERS = \
Handle_NMTTools_ListNodeOfListOfCommonBlock.hxx \
Handle_NMTTools_ListNodeOfListOfCoupleOfShape.hxx \
NMTDS_Iterator.hxx \
NMTTools_CheckerSI.hxx \
NMTTools_CommonBlockAPI.hxx \
NMTTools_CommonBlock.hxx \
NMTTools_CommonBlockPool.hxx \
NMTTools_CoupleOfShape.hxx \
NMTTools_DEProcessor.hxx \
NMTTools_DSFiller.hxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger.hxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape.hxx \
NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
@ -110,8 +110,6 @@ EXPORT_HEADERS = \
NMTTools_ListOfCommonBlock.hxx \
NMTTools_ListOfCoupleOfShape.hxx \
NMTTools_PaveFiller.hxx \
NMTTools_PCurveMaker.hxx \
NMTTools_PDSFiller.hxx \
NMTTools_PPaveFiller.hxx \
NMTTools_Tools.hxx \
Handle_NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock.hxx \

View File

@ -44,18 +44,21 @@ uses
NMTDS
is
class IteratorOfCoupleOfShape;
class DSFiller;
--class IteratorOfCoupleOfShape;
--class DSFiller;
class PaveFiller;
class Tools;
class CommonBlock;
class CommonBlockAPI;
class PCurveMaker;
--class PCurveMaker;
class DEProcessor;
class CoupleOfShape;
--modified by NIZNHY-PKV Mon Feb 19 11:39:24 2007f
class CheckerSI;
--modified by NIZNHY-PKV Mon Feb 19 11:39:27 2007t
pointer PPaveFiller to PaveFiller from NMTTools;
pointer PDSFiller to DSFiller from NMTTools;
--pointer PDSFiller to DSFiller from NMTTools;
class ListOfCommonBlock instantiates
List from TCollection(CommonBlock from NMTTools);

View File

@ -0,0 +1,64 @@
-- Copyright (C) 2006 SAMTECH
--
-- 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: NMTTools_CheckerSI.cdl
-- Created: Mon Feb 19 11:23:55 2007
-- Author: Peter KURNEV
class CheckerSI from NMTTools
inherits PaveFiller from NMTTools
---Purpose:
uses
ShapeEnum from TopAbs
--raises
is
Create
returns CheckerSI from NMTTools;
---C++: alias "Standard_EXPORT virtual ~NMTTools_CheckerSI();"
Perform (me:out)
is redefined;
Init (me:out)
is redefined protected;
Clear (me:out)
is redefined protected;
PreparePaveBlocks (me:out;
nE:Integer from Standard)
is redefined protected;
PreparePaveBlocks (me:out;
aType1: ShapeEnum from TopAbs;
aType2: ShapeEnum from TopAbs)
is redefined protected;
StopStatus(me)
returns Integer from Standard;
fields
myStopStatus: Integer from Standard is protected;
end CheckerSI;

View File

@ -0,0 +1,177 @@
// Copyright (C) 2006 SAMTECH
//
// 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: NMTTools_CheckerSI.cxx
// Created: Mon Feb 19 11:32:08 2007
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTTools_CheckerSI.ixx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_IteratorCheckerSI.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTTools_DEProcessor.hxx>
//=======================================================================
//function :
//purpose :
//=======================================================================
NMTTools_CheckerSI::NMTTools_CheckerSI()
:
NMTTools_PaveFiller()
{
myStopStatus=0;
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
NMTTools_CheckerSI::~NMTTools_CheckerSI()
{
}
//=======================================================================
//function : Clear
//purpose :
//=======================================================================
void NMTTools_CheckerSI::Clear()
{
NMTTools_PaveFiller::Clear();
}
//=======================================================================
//function : StopStatus
//purpose :
//=======================================================================
Standard_Integer NMTTools_CheckerSI::StopStatus()const
{
return myStopStatus;
}
//=======================================================================
//function : Init
//purpose :
//=======================================================================
void NMTTools_CheckerSI::Init()
{
myIsDone=Standard_False;
if (myCompositeShape.IsNull()) {
return;
}
//
Clear();
// 1.
myDS=new NMTDS_ShapesDataStructure;
myDS->SetCompositeShape(myCompositeShape);
myDS->Init();
//
// 2.
myDSIt=new NMTDS_IteratorCheckerSI;
myDSIt->SetDS(myDS);
myDSIt->Prepare();
//
// 4.
myNbSources=myDS->NumberOfShapesOfTheObject()+
myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges();
// 5
myIP=new NMTDS_InterfPool;
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
void NMTTools_CheckerSI::Perform()
{
myIsDone=Standard_False;
myStopStatus=0;
//
Init();
//1.VV
//
PerformVV();
//
// 2.VE
myPavePool.Resize (myNbEdges);
PrepareEdges();
//
PerformVE();
//
// 3.VF
PerformVF();
//
// 4.EE
myCommonBlockPool.Resize (myNbEdges);
mySplitShapesPool.Resize (myNbEdges);
myPavePoolNew .Resize (myNbEdges);
//
PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
if (myStopStatus) {
return;
}
PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
if (myStopStatus) {
return;
}
//
PerformEE();
//
RefinePavePool ();
if (myStopStatus) {
return;
}
//
myPavePoolNew.Destroy();
myPavePoolNew.Resize (myNbEdges);
//
// 5.EF
PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
if (myStopStatus) {
return;
}
//
PerformEF();
//
RefinePavePool();
if (myStopStatus) {
return;
}
//
myPavePoolNew.Destroy();
//
MakeSplitEdges();
//
UpdateCommonBlocks();
//
// 6. FF
PerformFF ();
//
MakeBlocks();
//
MakePCurves();
//
// 7. Postprocessing
UpdatePaveBlocks();
//
NMTTools_DEProcessor aDEP(*this);
aDEP.Do();
//
MakeAloneVertices();
//
myIsDone=Standard_True;
}

View File

@ -0,0 +1,118 @@
// 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 _NMTTools_CheckerSI_HeaderFile
#define _NMTTools_CheckerSI_HeaderFile
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _NMTTools_PaveFiller_HeaderFile
#include <NMTTools_PaveFiller.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
class NMTTools_CheckerSI : public NMTTools_PaveFiller {
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 NMTTools_CheckerSI();
Standard_EXPORT virtual ~NMTTools_CheckerSI();
Standard_EXPORT virtual void Perform() ;
Standard_EXPORT Standard_Integer StopStatus() const;
protected:
// Methods PROTECTED
//
Standard_EXPORT virtual void Init() ;
Standard_EXPORT virtual void Clear() ;
Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer nE) ;
Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ;
// Fields PROTECTED
//
Standard_Integer myStopStatus;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif

View File

@ -0,0 +1,24 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <NMTTools_CheckerSI.jxx>

View File

@ -0,0 +1,22 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _NMTTools_CheckerSI_HeaderFile
#include <NMTTools_CheckerSI.hxx>
#endif

View File

@ -0,0 +1,160 @@
// Copyright (C) 2006 SAMTECH
//
// 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: NMTTools_CheckerSI.cxx
// Created: Mon Feb 19 11:32:08 2007
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTTools_CheckerSI.ixx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_IteratorCheckerSI.hxx>
#include <NMTDS_InterfPool.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <TopoDS.hxx>
#include <BRep_Tool.hxx>
#include <BOPTools_PaveSet.hxx>
#include <BOPTools_PaveBlockIterator.hxx>
#include <BOPTools_PaveBlock.hxx>
#include <IntTools_Range.hxx>
#include <BOPTools_Pave.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <BOPTColStd_Failure.hxx>
#include <BOPTColStd_Dump.hxx>
#include <Geom_Curve.hxx>
#include <gp_Pnt.hxx>
static
Standard_Boolean IsValid(const TopoDS_Edge& aE,
const TopoDS_Vertex& aV,
const Standard_Real aTV1,
const Standard_Real aTV2);
//=======================================================================
// function: PreparePaveBlocks
// purpose:
//=======================================================================
void NMTTools_CheckerSI::PreparePaveBlocks(const TopAbs_ShapeEnum aType1,
const TopAbs_ShapeEnum aType2)
{
NMTTools_PaveFiller::PreparePaveBlocks(aType1, aType2);
}
//=======================================================================
// function: PreparePaveBlocks
// purpose:
//=======================================================================
void NMTTools_CheckerSI::PreparePaveBlocks(const Standard_Integer nE)
{
myIsDone=Standard_False;
//
char buf[32]={"SR"};
Standard_Boolean bIsValid;
Standard_Integer nV1, nV2, iErr;
Standard_Real aT1, aT2;
TopoDS_Edge aE;
TopoDS_Vertex aV1, aV2;
//
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
// Edge
aE=TopoDS::Edge(myDS->Shape(nE));
if (BRep_Tool::Degenerated(aE)) {
myIsDone=Standard_True;
return;
}
//
BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
BOPTools_PaveBlockIterator aPBIt(nE, aPS);
for (; aPBIt.More(); aPBIt.Next()) {
BOPTools_PaveBlock& aPB=aPBIt.Value();
const IntTools_Range& aRange=aPB.Range();
//
const BOPTools_Pave& aPave1=aPB.Pave1();
nV1=aPave1.Index();
aV1=TopoDS::Vertex(myDS->Shape(nV1));
aT1=aPave1.Param();
//
const BOPTools_Pave& aPave2=aPB.Pave2();
nV2=aPave2.Index();
aV2=TopoDS::Vertex(myDS->Shape(nV2));
aT2=aPave2.Param();
//
bIsValid=Standard_True;
if (nV1==nV2) {
bIsValid=IsValid(aE, aV1, aT1, aT2);
if (!bIsValid) {
//printf(" pb SR: nV nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
myStopStatus=1;
}
}
//
IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
iErr=aSR.ErrorStatus();
if (!aSR.IsDone()) {
//printf(" pb SR: Done nE: %d nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
aSR.SetShrunkRange(aRange);
//throw BOPTColStd_Failure(buf) ;
}
else if (iErr!=6) {
CorrectShrunkRanges (0, aPave1, aSR);
CorrectShrunkRanges (1, aPave2, aSR);
}
aPB.SetShrunkRange(aSR);
aLPB.Append(aPB);
} //for (; aPBIt.More(); aPBIt.Next())
myIsDone=Standard_True;
}
//=======================================================================
//function : IsValid
//purpose :
//=======================================================================
Standard_Boolean IsValid(const TopoDS_Edge& aE,
const TopoDS_Vertex& aV,
const Standard_Real aTV1,
const Standard_Real aTV2)
{
Standard_Boolean bRet;
Standard_Integer i, aNbP, aNbP1;
Standard_Real aTolV2, aTC1, aTC2, dT, aTC, aD2;
Handle(Geom_Curve) aC;
gp_Pnt aPV, aPC;
//
bRet=Standard_False;
aTolV2=BRep_Tool::Tolerance(aV);
aTolV2=aTolV2*aTolV2;
aPV=BRep_Tool::Pnt(aV);
aC=BRep_Tool::Curve(aE, aTC1, aTC2);
aNbP=7;
aNbP1=aNbP-1;
dT=(aTV2-aTV1)/aNbP1;
//
for (i=1; i<aNbP-1 && !bRet ; ++i) {
aTC=aTV1+dT*i;
aC->D0(aTC, aPC);
aD2=aPV.SquareDistance(aPC);
bRet=aD2>aTolV2;
}
return bRet;
}

View File

@ -74,7 +74,7 @@
#include <BOPTools_PavePool.hxx>
#include <BOPTools_PaveSet.hxx>
#include <BOPTools_Tools3D.hxx>
#include <BOPTools_InterferencePool.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_SplitShapesPool.hxx>
@ -90,7 +90,7 @@
#include <ElCLib.hxx>
#include <gp_Lin2d.hxx>
#include <NMTDS_InterfPool.hxx>
//=======================================================================
// function: NMTTools_DEProcessor::NMTTools_DEProcessor
@ -189,7 +189,7 @@
void NMTTools_DEProcessor::DoPaves()
{
Standard_Integer i, aNbE, nED, nVD, nFD, aNbLPB;
Standard_Integer i, aNbE, nED, nVD, aNbLPB, nFD;
//
nFD=0;
aNbE=myDEMap.Extent();
@ -203,16 +203,15 @@
TColStd_ListIteratorOfListOfInteger anIt(nLF);
for (; anIt.More(); anIt.Next()) {
nFD=anIt.Value();
//
BOPTools_ListOfPaveBlock aLPB;
FindPaveBlocks(nED, nVD, nFD, aLPB);
//modified by NIZNHY-PKV Fri Mar 23 10:35:27 2007f
//
// xxf
aNbLPB=aLPB.Extent();
if (!aNbLPB) {
continue;
}
//modified by NIZNHY-PKV Fri Mar 23 10:35:33 2007t
//xxt
FillPaveSet (nED, nVD, nFD, aLPB);
}
//
@ -236,7 +235,8 @@
BOPTools_ListIteratorOfListOfPaveBlock anIt;
Standard_Integer i, aNb, nF2, nV;
//
BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
//BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
BOPTools_CArray1OfSSInterference& aFFs=(myFiller->IP())->SSInterferences();
//
aNb=aFFs.Extent();
for (i=1; i<=aNb; ++i) {

View File

@ -28,19 +28,18 @@ class PaveFiller from NMTTools
---Purpose:
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
DataMapOfIntegerInteger from TColStd,
Pnt from gp,
ShapeEnum from TopAbs,
Vertex from TopoDS,
Face from TopoDS,
Shape from TopoDS,
-- Modified to add new definitions Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
Edge from TopoDS,
ListOfShape from TopTools,
DataMapOfShapeShape from TopTools,
ListOfInteger from TColStd,
-- Contribution of Samtech www.samcef.com END
Context from IntTools,
@ -48,8 +47,8 @@ uses
IndexedDataMapOfShapeInteger from BooleanOperations,
InterferencePool from BOPTools,
PInterferencePool from BOPTools,
--InterferencePool from BOPTools,
--PInterferencePool from BOPTools,
PavePool from BOPTools,
PaveBlock from BOPTools,
ListOfPaveBlock from BOPTools,
@ -66,48 +65,77 @@ uses
CommonBlockPool from NMTTools,
CommonBlock from NMTTools,
ListOfCommonBlock from NMTTools,
-- Modified to add new definitions Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
IndexedDataMapOfIndexedMapOfInteger from NMTTools,
-- Contribution of Samtech www.samcef.com END
ShapesDataStructure from NMTDS,
-- Modified to add new definitions Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
PShapesDataStructure from NMTDS,
Iterator from NMTDS
Iterator from NMTDS,
IndexedDataMapOfIndexedMapOfInteger from NMTTools,
-- Contribution of Samtech www.samcef.com END
PIterator from NMTDS,
PInterfPool from NMTDS
--raises
is
Create
returns PaveFiller from NMTTools;
---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller();"
Create(aIP:InterferencePool from BOPTools)
returns PaveFiller from NMTTools;
-- Create(aIP:InterferencePool from BOPTools)
-- returns PaveFiller from NMTTools;
Destroy (me: in out)
is virtual;
---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
-- Destroy (me: in out)
--is virtual;
-- -C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
--
-- Selectors/Modifiers
SetInterferencePool(me:out;
aIP:InterferencePool from BOPTools);
--SetInterferencePool(me:out;
-- aIP:PInterferencePool from BOPTools);
InterfPool(me:out)
returns PInterferencePool from BOPTools;
SetCompositeShape (me:out;
aS: Shape from TopoDS);
CompositeShape(me)
returns Shape from TopoDS;
---C++: return const&
--InterfPool(me:out)
--returns PInterferencePool from BOPTools;
--SetDS(me:out;
-- aDS:PShapesDataStructure from NMTDS);
DS(me:out)
returns PShapesDataStructure from NMTDS;
--SetDSIt(me:out;
-- aIt:PIterator from NMTDS);
DSIt(me:out)
returns PIterator from NMTDS;
IP(me:out)
returns PInterfPool from NMTDS;
--
-- Perform the algo
-- Modified to add new method Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
Init (me:out);
Init (me:out)
is virtual protected;
-- Contribution of Samtech www.samcef.com END
Clear (me:out)
is virtual protected;
Perform (me:out)
is virtual;
PerformVV (me:out)
is virtual ;
is virtual protected;
PerformVE (me:out)
is virtual protected;
@ -142,28 +170,25 @@ is
anE:Integer from Standard)
is virtual protected;
PerformNewVertices (me:out)
is virtual ;
--PerformNewVertices (me:out)
--is virtual;
PrepareEdges (me:out)
is virtual protected;
SortTypes (me;
anInd1:in out Integer from Standard;
anInd2:in out Integer from Standard)
is protected;
--SortTypes (me;
-- anInd1:in out Integer from Standard;
-- anInd2:in out Integer from Standard)
-- is protected;
ExpectedPoolLength(me)
returns Integer from Standard
is protected;
--ExpectedPoolLength(me)
-- returns Integer from Standard
--is protected;
--
-- Query section
IsDone(me)
returns Boolean from Standard;
DS(me:out)
returns PShapesDataStructure from NMTDS;
Context(me)
returns Context from IntTools;
---C++:return const &
@ -200,7 +225,7 @@ is
nV: Integer from Standard)
returns Integer from Standard;
IsSuccesstorsComputed (me;
IsSuccessorsComputed (me;
iF1:Integer from Standard;
iF2:Integer from Standard)
returns Boolean from Standard
@ -500,18 +525,17 @@ is
aLSE :out ListOfShape from TopTools);
-- Contribution of Samtech www.samcef.com END
FuseVertices(me;
aC:Shape from TopoDS;
aDMVV: out DataMapOfShapeShape from TopTools);
fields
myIntrPool : PInterferencePool from BOPTools is protected;
--myIntrPool : PInterferencePool from BOPTools is protected;
myDS : PShapesDataStructure from NMTDS is protected;
myIsDone : Boolean from Standard is protected;
myNbSources : Integer from Standard is protected;
myNbEdges : Integer from Standard is protected;
-- Modified to add new field Thu Sep 14 14:35:18 2006
-- Contribution of Samtech www.samcef.com BEGIN
myDSIt : Iterator from NMTDS is protected;
-- Contribution of Samtech www.samcef.com END
myPavePool : PavePool from BOPTools is protected;
myPavePoolNew : PavePool from BOPTools is protected;
myCommonBlockPool : CommonBlockPool from NMTTools is protected;
@ -520,7 +544,10 @@ fields
myContext : Context from IntTools is protected;
mySectionAttribute : SSIntersectionAttribute from BOPTools is protected;
myAloneVertices : IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected;
--
--modified by NIZNHY-PKV Wed Oct 11 11:06:50 2006f
myVSD : DataMapOfIntegerInteger from TColStd is protected;
--
myDSIt : PIterator from NMTDS is protected;
myCompositeShape : Shape from TopoDS is protected;
myIP : PInterfPool from NMTDS is protected;
--modified by NIZNHY-PKV Wed Oct 11 11:06:55 2006t
end PaveFiller;

View File

@ -27,63 +27,65 @@
#include <BOPTColStd_Failure.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_DEProcessor.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_InterfPool.hxx>
//
//=======================================================================
// function: NMTTools_PaveFiller::NMTTools_PaveFiller
// purpose:
//=======================================================================
NMTTools_PaveFiller::NMTTools_PaveFiller()
{
myIntrPool=NULL;
myDS=NULL;
myDSIt=NULL;
myIsDone=Standard_False;
myNbSources=0;
myNbEdges=0;
myIP=NULL;
}
//=======================================================================
// function:NMTTools_PaveFiller::NMTTools_PaveFiller
// function: ~
// purpose:
//=======================================================================
NMTTools_PaveFiller::NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP)
NMTTools_PaveFiller::~NMTTools_PaveFiller()
{
SetInterferencePool(aIP);
Clear();
}
//=======================================================================
// function: Destroy
// function: Clear
// purpose:
//=======================================================================
void NMTTools_PaveFiller::Destroy()
void NMTTools_PaveFiller::Clear()
{
if (myDSIt) {
delete myDSIt;
}
if (myDS) {
delete myDS;
}
myDSIt=NULL;
myDS=NULL;
if (myIP) {
delete myIP;
}
myIP=NULL;
}
//=======================================================================
// function: SetInterferencePool
// function: SetCompositeShape
// purpose:
//=======================================================================
void NMTTools_PaveFiller::SetInterferencePool(const BOPTools_InterferencePool& aIP)
void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
{
myIsDone=Standard_False;
//
myIntrPool=(BOPTools_InterferencePool*)&aIP;
myDS=(NMTDS_ShapesDataStructure*)myIntrPool->DS();
myNbSources=myDS->NumberOfShapesOfTheObject()+myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges();
myCompositeShape=aS;
}
//=======================================================================
// function: InterfPool
// function: CompositeShape
// purpose:
//=======================================================================
BOPTools_PInterferencePool NMTTools_PaveFiller::InterfPool()
const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
{
return myIntrPool;
}
//=======================================================================
// function:IsDone
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsDone() const
{
return myIsDone;
return myCompositeShape;
}
//=======================================================================
// function: DS
@ -94,6 +96,30 @@
return myDS;
}
//=======================================================================
// function: DSIt
// purpose:
//=======================================================================
NMTDS_PIterator NMTTools_PaveFiller::DSIt()
{
return myDSIt;
}
//=======================================================================
// function: IP
// purpose:
//=======================================================================
NMTDS_PInterfPool NMTTools_PaveFiller::IP()
{
return myIP;
}
//=======================================================================
// function:IsDone
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsDone() const
{
return myIsDone;
}
//=======================================================================
// function: Context
// purpose:
//=======================================================================
@ -149,7 +175,6 @@
{
return mySplitShapesPool;
}
//=======================================================================
// function: ChangeSplitShapesPool
// purpose:
@ -164,11 +189,29 @@
//=======================================================================
void NMTTools_PaveFiller::Init()
{
myDSIt.SetDS(myDS);
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
myDSIt.Prepare();
// Contribution of Samtech www.samcef.com END
myIsDone=Standard_False;
if (myCompositeShape.IsNull()) {
return;
}
//
Clear();
// 1.
myDS=new NMTDS_ShapesDataStructure;
myDS->SetCompositeShape(myCompositeShape);
myDS->Init();
//
// 2.
myDSIt=new NMTDS_Iterator;
myDSIt->SetDS(myDS);
myDSIt->Prepare();
//
// 3.
myNbSources=myDS->NumberOfShapesOfTheObject()+
myDS->NumberOfShapesOfTheTool();
myNbEdges=myDS->NbEdges();
//
// 4
myIP=new NMTDS_InterfPool;
}
//=======================================================================
@ -179,6 +222,7 @@
{
myIsDone=Standard_False;
//
//----------------
try {
// 0.
// Modified Thu Sep 14 14:35:18 2006
@ -188,7 +232,6 @@
//1.VV
//
PerformVV();
PerformNewVertices();
//
// 2.VE
myPavePool.Resize (myNbEdges);
@ -217,7 +260,6 @@
//
// 5.EF
PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
PerformEF();
//
RefinePavePool();

View File

@ -20,9 +20,6 @@
#ifndef _NMTTools_PaveFiller_HeaderFile
#define _NMTTools_PaveFiller_HeaderFile
#ifndef _BOPTools_PInterferencePool_HeaderFile
#include <BOPTools_PInterferencePool.hxx>
#endif
#ifndef _NMTDS_PShapesDataStructure_HeaderFile
#include <NMTDS_PShapesDataStructure.hxx>
#endif
@ -32,9 +29,6 @@
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _NMTDS_Iterator_HeaderFile
#include <NMTDS_Iterator.hxx>
#endif
#ifndef _BOPTools_PavePool_HeaderFile
#include <BOPTools_PavePool.hxx>
#endif
@ -56,13 +50,22 @@
#ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile
#include <TColStd_DataMapOfIntegerInteger.hxx>
#endif
#ifndef _NMTDS_PIterator_HeaderFile
#include <NMTDS_PIterator.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _NMTDS_PInterfPool_HeaderFile
#include <NMTDS_PInterfPool.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class BOPTools_InterferencePool;
class TopoDS_Shape;
class BOPTools_Pave;
class IntTools_ShrunkRange;
class IntTools_Context;
@ -86,6 +89,7 @@ class gp_Pnt;
class NMTTools_IndexedDataMapOfIndexedMapOfInteger;
class TopTools_ListOfShape;
class TopoDS_Edge;
class TopTools_DataMapOfShapeShape;
#ifndef _Standard_HeaderFile
@ -117,39 +121,30 @@ public:
Standard_EXPORT NMTTools_PaveFiller();
Standard_EXPORT virtual ~NMTTools_PaveFiller();
Standard_EXPORT NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP);
Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ;
Standard_EXPORT virtual void Destroy() ;
Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}
Standard_EXPORT const TopoDS_Shape& CompositeShape() const;
Standard_EXPORT void SetInterferencePool(const BOPTools_InterferencePool& aIP) ;
Standard_EXPORT NMTDS_PShapesDataStructure DS() ;
Standard_EXPORT BOPTools_PInterferencePool InterfPool() ;
Standard_EXPORT NMTDS_PIterator DSIt() ;
Standard_EXPORT void Init() ;
Standard_EXPORT NMTDS_PInterfPool IP() ;
Standard_EXPORT virtual void Perform() ;
Standard_EXPORT virtual void PerformVV() ;
Standard_EXPORT virtual void PerformNewVertices() ;
Standard_EXPORT Standard_Boolean IsDone() const;
Standard_EXPORT NMTDS_PShapesDataStructure DS() ;
Standard_EXPORT const IntTools_Context& Context() const;
@ -285,6 +280,9 @@ Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlo
Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ;
Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const;
@ -294,6 +292,15 @@ protected:
//
Standard_EXPORT virtual void Init() ;
Standard_EXPORT virtual void Clear() ;
Standard_EXPORT virtual void PerformVV() ;
Standard_EXPORT virtual void PerformVE() ;
@ -324,13 +331,7 @@ Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ;
Standard_EXPORT virtual void PrepareEdges() ;
Standard_EXPORT void SortTypes(Standard_Integer& anInd1,Standard_Integer& anInd2) const;
Standard_EXPORT Standard_Integer ExpectedPoolLength() const;
Standard_EXPORT Standard_Boolean IsSuccesstorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const;
@ -392,12 +393,10 @@ Standard_EXPORT void MakeAloneVertices() ;
// Fields PROTECTED
//
BOPTools_PInterferencePool myIntrPool;
NMTDS_PShapesDataStructure myDS;
Standard_Boolean myIsDone;
Standard_Integer myNbSources;
Standard_Integer myNbEdges;
NMTDS_Iterator myDSIt;
BOPTools_PavePool myPavePool;
BOPTools_PavePool myPavePoolNew;
NMTTools_CommonBlockPool myCommonBlockPool;
@ -406,6 +405,9 @@ IntTools_Context myContext;
BOPTools_SSIntersectionAttribute mySectionAttribute;
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
TColStd_DataMapOfIntegerInteger myVSD;
NMTDS_PIterator myDSIt;
TopoDS_Shape myCompositeShape;
NMTDS_PInterfPool myIP;
private:

View File

@ -17,8 +17,8 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#ifndef _BOPTools_InterferencePool_HeaderFile
#include <BOPTools_InterferencePool.hxx>
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _BOPTools_Pave_HeaderFile
#include <BOPTools_Pave.hxx>
@ -89,6 +89,9 @@
#ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
#include <TopTools_DataMapOfShapeShape.hxx>
#endif
#ifndef _NMTTools_PaveFiller_HeaderFile
#include <NMTTools_PaveFiller.hxx>
#endif

View File

@ -17,49 +17,54 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File: NMTTools_PaveFiller_1.cxx
// Created: Mon Dec 8 11:47:55 2003
// File: NMTTools_PaveFiller_0.cxx
// Created: Mon Dec 8 11:45:51 2003
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTTools_PaveFiller.ixx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <BOPTools_ListOfCoupleOfInteger.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <BooleanOperations_OnceExplorer.hxx>
#include <NMTDS_Iterator.hxx>
//=======================================================================
//function : SortTypes
//purpose :
// function:IsSuccesstorsComputed
// purpose:
//=======================================================================
void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
Standard_Integer& theWith)const
Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
const Standard_Integer aN2)const
{
Standard_Boolean aReverseFlag=Standard_True;
TopAbs_ShapeEnum aType1= myDS->GetShapeType(theWhat),
aType2= myDS->GetShapeType(theWith);
if (aType1==aType2)
return;
if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE){
aReverseFlag=Standard_False;
Standard_Boolean bComputed;
Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
TopAbs_ShapeEnum aType;
TColStd_IndexedMapOfInteger aMSuc;
//
n1=aN1;
n2=aN2;
aType=myDS->GetShapeType(aN1);
if (aType!=TopAbs_VERTEX) {
ntmp=n1;
n1=n2;
n2=ntmp;
}
if (aType1==TopAbs_VERTEX &&
(aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
aReverseFlag=Standard_False;
//
myDS->GetAllSuccessors(n2, aMSuc);
aNbS=aMSuc.Extent();
for (i=1; i<=aNbS; ++i) {
nSuc=aMSuc(i);
bComputed=myIP->Contains(n1, nSuc);
if (bComputed) {
break;
}
}
Standard_Integer aWhat, aWith;
aWhat=(aReverseFlag) ? theWith : theWhat;
aWith=(aReverseFlag) ? theWhat : theWith;
theWhat=aWhat;
theWith=aWith;
return bComputed;
}
/*
//=======================================================================
// function: ExpectedPoolLength
// purpose:
@ -72,7 +77,7 @@
// Contribution of Samtech www.samcef.com BEGIN
//const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
//aNbIIs=aLC.Extent();
aNbIIs=myDSIt.ExpectedLength();
aNbIIs=myDSIt->ExpectedLength();
// Contribution of Samtech www.samcef.com END
//
if (aNbIIs==1) {
@ -83,57 +88,39 @@
return aNbIIs;
}
*/
/*
//=======================================================================
// function:IsSuccesstorsComputed
// purpose:
//function : SortTypes
//purpose :
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsSuccesstorsComputed(const Standard_Integer aN1,
const Standard_Integer aN2)const
void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
Standard_Integer& theWith)const
{
Standard_Integer nSuc, n1, n2;
BooleanOperations_OnceExplorer aExp(*myDS);
TopAbs_ShapeEnum aType=myDS->GetShapeType(aN1);
n1=aN1;
n2=aN2;
if (aType!=TopAbs_VERTEX) {
Standard_Integer ntmp=n1;
n1=n2;
n2=ntmp;
Standard_Integer aWhat, aWith;
Standard_Boolean aReverseFlag;
TopAbs_ShapeEnum aType1, aType2;
//
aType1= myDS->GetShapeType(theWhat),
aType2= myDS->GetShapeType(theWith);
//
if (aType1==aType2) {
return;
}
aType=myDS->GetShapeType(n2);
if (aType==TopAbs_EDGE) {
aExp.Init(n2, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
nSuc=aExp.Current();
if (myIntrPool->IsComputed(n1, nSuc)) {
return Standard_True;
}
}
return Standard_False;
//
aReverseFlag=Standard_True;
if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
aReverseFlag=Standard_False;
}
else if (aType==TopAbs_FACE) {
aExp.Init(n2, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
nSuc=aExp.Current();
if (myIntrPool->IsComputed(n1, nSuc)) {
return Standard_True;
}
}
aExp.Init(n2, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
nSuc=aExp.Current();
if (myIntrPool->IsComputed(n1, nSuc)) {
return Standard_True;
}
}
return Standard_False;
if (aType1==TopAbs_VERTEX &&
(aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
aReverseFlag=Standard_False;
}
return Standard_False;
//
aWhat=(aReverseFlag) ? theWith : theWhat;
aWith=(aReverseFlag) ? theWhat : theWith;
//
theWhat=aWhat;
theWith=aWith;
}
*/

View File

@ -21,6 +21,7 @@
// Created: Mon Dec 8 11:47:55 2003
// Author: Peter KURNEV
// <pkv@irinox>
#include <NMTTools_PaveFiller.ixx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
@ -35,12 +36,14 @@
#include <TopTools_ListOfShape.hxx>
#include <IntTools_Tools.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTTools_Tools.hxx>
//=======================================================================
@ -51,47 +54,47 @@
{
myIsDone=Standard_False;
//
Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD;
Standard_Integer nVnew;
Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
TColStd_ListIteratorOfListOfInteger aIt;
TColStd_ListIteratorOfListOfInteger aItX, aItY;
TColStd_ListOfInteger aLIX;
TopTools_ListOfShape aLV;
TopoDS_Vertex aVnew;
TopoDS_Shape aS;
//
myVSD.Clear();
//
BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences();
//
// BlockLength correction
aNbVVs=ExpectedPoolLength();
aBlockLength=aVVs.BlockLength();
if (aNbVVs > aBlockLength) {
aVVs.SetBlockLength(aNbVVs);
}
//
const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices();
const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
aNbVSD=aMVSD.Extent();
if (!aNbVSD) {
return;
}
//
BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
//
// BlockLength correction
myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
aNbVVs=myDSIt->BlockLength();
aBL=aVVs.BlockLength();
if (aNbVVs > aBL) {
aVVs.SetBlockLength(aNbVVs);
}
//
aIt1.Initialize(aMVSD);
for (; aIt1.More(); aIt1.Next()) {
aLV.Clear();
//
aWhat=aIt1.Key();
n1=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);
const TopoDS_Shape& aS1=myDS->Shape(n1);
aLV.Append(aS1);
aItX.Initialize(aLIV);
for (; aItX.More(); aItX.Next()) {
n2=aItX.Value();
const TopoDS_Shape& aS2=myDS->Shape(n2);
aLV.Append(aS2);
}
aS=myDS->Shape(aWhat);
aLV.Append(aS);
//
NMTTools_Tools::MakeNewVertex(aLV, aVnew);
//
@ -101,30 +104,38 @@
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, aLIX
aLIX.Clear();
aLIX.Append(n1);
myVSD.Bind(n1, nVnew);
//
aItX.Initialize(aLIV);
for (; aItX.More(); aItX.Next()) {
n2=aItX.Value();
aLIX.Append(n2);
myVSD.Bind(n2, nVnew);
}
//
// interferences
aItX.Initialize(aLIX);
for (i=0; aItX.More(); aItX.Next(), ++i) {
aItY.Initialize(aLIX);
for (j=0; aItY.More(); aItY.Next(), ++j) {
if (j>i) {
n1=aItX.Value();
n2=aItY.Value();
myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
//
BOPTools_VVInterference aVV(n1, n2);
aVV.SetNewShape(nVnew);
aVVs.Append(aVV);
}
}
}
myVSD.Bind(aWhat, nVnew);
}//for (; aIt1.More(); aIt1.Next()) {
myIsDone=Standard_True;
}
//=======================================================================
// function: PerformNewVertices
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PerformNewVertices()
{
}
//=======================================================================
// function: FindSDVertex
// purpose:
//=======================================================================
@ -138,3 +149,12 @@
}
return nVSD;
}
/*
//=======================================================================
// function: PerformNewVertices
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PerformNewVertices()
{
}
*/

View File

@ -47,20 +47,137 @@
#include <BOPTools_VEInterference.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_InterfPool.hxx>
//
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
#include <BOPTools_IndexedMapOfCoupleOfInteger.hxx>
#include <BOPTools_CoupleOfInteger.hxx>
#include <BooleanOperations_OnceExplorer.hxx>
//
static
Standard_Boolean Contains(const TopoDS_Edge& aE,
const TopoDS_Vertex& aV);
// Contribution of Samtech www.samcef.com END
//=======================================================================
// function: PerformVE
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PerformVE()
{
myIsDone=Standard_False;
//
Standard_Boolean bJustAdd;
Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
Standard_Real aT;
TopoDS_Vertex aV1;
TopoDS_Edge aE2;
BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
BOPTools_CoupleOfInteger aCouple;
//
BOPTools_CArray1OfVEInterference& aVEs=myIP->VEInterferences();
//
myDSIt->Initialize (TopAbs_VERTEX, TopAbs_EDGE);
//
// BlockLength correction
aNbVEs=myDSIt->BlockLength();
aBlockLength=aVEs.BlockLength();
if (aNbVEs > aBlockLength) {
aVEs.SetBlockLength(aNbVEs);
}
//
for (; myDSIt->More(); myDSIt->Next()) {
myDSIt->Current(n1, n2, bJustAdd);
if (!IsSuccessorsComputed(n1, n2)) {
anIndexIn=0;
aWhat=n1; // Vertex
aWith=n2; // Edge
if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
aWhat=n2;
aWith=n1;
}
//
if(bJustAdd) {
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
continue;
}
// Edge
aE2=TopoDS::Edge(myDS->Shape(aWith));
if (BRep_Tool::Degenerated(aE2)){
continue;
}
// Vertex
nV1=aWhat;
aV1=TopoDS::Vertex(myDS->Shape(aWhat));
//
iSDV=FindSDVertex(aWhat);
if (iSDV) {
nV1=iSDV;
aV1=TopoDS::Vertex(myDS->Shape(nV1));
// Modified to find same domain vertex Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
Standard_Integer nVE, iSDVE, iRet;
//
BooleanOperations_OnceExplorer aExp(*myDS);
iRet=0;
aExp.Init(aWith, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
nVE=aExp.Current();
iSDVE=FindSDVertex(nVE);
if (iSDVE==iSDV) {
iRet=1;
break;
}
}
if (iRet) {
continue;
}
}
else {
if (Contains(aE2, aV1)) {
continue;
}
// Contribution of Samtech www.samcef.com END
}
//
aFlag=myContext.ComputeVE (aV1, aE2, aT);
//
if (!aFlag) {
// Add Interference to the Pool
BOPTools_VEInterference anInterf (aWhat, aWith, aT);
anIndexIn=aVEs.Append(anInterf);
//
// Add Pave to the Edge's myPavePool
aCouple.SetCouple(nV1, aWith);
if (!aSnareMap.Contains(aCouple)){
aSnareMap.Add(aCouple);
//
BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
aPave.SetInterference(anIndexIn);
BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
aPaveSet.Append(aPave);
}
//
// State for the Vertex in DS;
myDS->SetState (aWhat, BooleanOperations_ON);
// Insert Vertex in Interference Object
BOPTools_VEInterference& aVE=aVEs(anIndexIn);
aVE.SetNewShape(aWhat);
// qqf
{
myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
}
// qqt
}
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
}
}
myIsDone=Standard_True;
}
//=======================================================================
// function: PrepareEdges
// purpose:
@ -106,116 +223,7 @@ static
}
}
}
//=======================================================================
// function: PerformVE
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PerformVE()
{
myIsDone=Standard_False;
//
Standard_Boolean bJustAddInterference;
Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
Standard_Real aT;
TopoDS_Vertex aV1;
TopoDS_Edge aE2;
BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
BOPTools_CoupleOfInteger aCouple;
//
BOPTools_CArray1OfVEInterference& aVEs=myIntrPool->VEInterferences();
//
myDSIt.Initialize (TopAbs_VERTEX, TopAbs_EDGE);
//
// BlockLength correction
aNbVEs=ExpectedPoolLength();
aBlockLength=aVEs.BlockLength();
if (aNbVEs > aBlockLength) {
aVEs.SetBlockLength(aNbVEs);
}
//
for (; myDSIt.More(); myDSIt.Next()) {
myDSIt.Current(n1, n2, bJustAddInterference);
//
if (! myIntrPool->IsComputed(n1, n2)) {
if (! IsSuccesstorsComputed(n1, n2)) {
anIndexIn=0;
aWhat=n1; // Vertex
aWith=n2; // Edge
SortTypes(aWhat, aWith);
//
if(bJustAddInterference) {
myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
continue;
}
// Edge
aE2=TopoDS::Edge(myDS->Shape(aWith));
if (BRep_Tool::Degenerated(aE2)){
continue;
}
// Vertex
nV1=aWhat;
aV1=TopoDS::Vertex(myDS->Shape(aWhat));
//
iSDV=FindSDVertex(aWhat);
if (iSDV) {
nV1=iSDV;
aV1=TopoDS::Vertex(myDS->Shape(nV1));
// Modified to find same domain vertex Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
Standard_Integer nVE, iSDVE, iRet;
//
BooleanOperations_OnceExplorer aExp(*myDS);
iRet=0;
aExp.Init(aWith, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
nVE=aExp.Current();
iSDVE=FindSDVertex(nVE);
if (iSDVE==iSDV) {
iRet=1;
break;
}
}
if (iRet) {
continue;
}
}
else {
if (Contains(aE2, aV1)) {
continue;
}
// Contribution of Samtech www.samcef.com END
}
//
aFlag=myContext.ComputeVE (aV1, aE2, aT);
//
if (!aFlag) {
// Add Interference to the Pool
BOPTools_VEInterference anInterf (aWhat, aWith, aT);
anIndexIn=aVEs.Append(anInterf);
//
// Add Pave to the Edge's myPavePool
aCouple.SetCouple(nV1, aWith);
if (!aSnareMap.Contains(aCouple)){
aSnareMap.Add(aCouple);
//
BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
aPave.SetInterference(anIndexIn);
BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
aPaveSet.Append(aPave);
}
//
// State for the Vertex in DS;
myDS->SetState (aWhat, BooleanOperations_ON);
// Insert Vertex in Interference Object
BOPTools_VEInterference& aVE=aVEs(anIndexIn);
aVE.SetNewShape(aWhat);
}
myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
}
}
}
myIsDone=Standard_True;
}
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
//=======================================================================

View File

@ -30,11 +30,15 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BOPTools_VSInterference.hxx>
#include <BOPTools_CArray1OfVSInterference.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <TopExp_Explorer.hxx>
#include <NMTDS_InterfPool.hxx>
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
@ -50,71 +54,76 @@ static
{
myIsDone=Standard_False;
//
Standard_Boolean aJustAddInterference;
Standard_Boolean aJustAdd;
Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
Standard_Real aU, aV;
TopoDS_Vertex aV1;
TopoDS_Face aF2;
//
BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
//
// V/E Interferences
myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE);
myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE);
//
// BlockLength correction
aNbVSs=ExpectedPoolLength();
aNbVSs=myDSIt->BlockLength();
aBlockLength=aVSs.BlockLength();
if (aNbVSs > aBlockLength) {
aVSs.SetBlockLength(aNbVSs);
}
//
for (; myDSIt.More(); myDSIt.Next()) {
myDSIt.Current(n1, n2, aJustAddInterference);
//
if (! myIntrPool->IsComputed(n1, n2)) {
if (! IsSuccesstorsComputed(n1, n2)) {
anIndexIn=0;
aWhat=n1; // Vertex
aWith=n2; // Face
SortTypes(aWhat, aWith);
//
iSDV=FindSDVertex(aWhat);
//
if(aJustAddInterference) {
myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
continue;
}
//
aV1=TopoDS::Vertex(myDS->Shape(aWhat));
if (iSDV) {
aV1=TopoDS::Vertex(myDS->Shape(iSDV));
}
//
aF2=TopoDS::Face(myDS->Shape(aWith));
//
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
if (Contains(aF2, aV1)) {
continue;
}
// Contribution of Samtech www.samcef.com END
//
aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
//
if (!aFlag) {
//
// Add Interference to the Pool
BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
anIndexIn=aVSs.Append(anInterf);
//
// SetState for Vertex in DS;
myDS->SetState (aWhat, BooleanOperations_ON);
// Insert Vertex in Interference Object
BOPTools_VSInterference& aVS=aVSs(anIndexIn);
aVS.SetNewShape(aWhat);
}
myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
for (; myDSIt->More(); myDSIt->Next()) {
myDSIt->Current(n1, n2, aJustAdd);
if (! IsSuccessorsComputed(n1, n2)) {
anIndexIn=0;
aWhat=n1; // Vertex
aWith=n2; // Face
if (myDS->GetShapeType(n1)==TopAbs_FACE) {
aWhat=n2;
aWith=n1;
}
//
iSDV=FindSDVertex(aWhat);
//
if(aJustAdd) {
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
continue;
}
//
aV1=TopoDS::Vertex(myDS->Shape(aWhat));
if (iSDV) {
aV1=TopoDS::Vertex(myDS->Shape(iSDV));
}
//
aF2=TopoDS::Face(myDS->Shape(aWith));
//
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
if (Contains(aF2, aV1)) {
continue;
}
// Contribution of Samtech www.samcef.com END
//
aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
//
if (!aFlag) {
//
// Add Interference to the Pool
BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
anIndexIn=aVSs.Append(anInterf);
//
// SetState for Vertex in DS;
myDS->SetState (aWhat, BooleanOperations_ON);
// Insert Vertex in Interference Object
BOPTools_VSInterference& aVS=aVSs(anIndexIn);
aVS.SetNewShape(aWhat);
// qqf
{
myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
}
// qqt
}
//myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
}
}
myIsDone=Standard_True;

View File

@ -28,8 +28,14 @@
#include <stdio.h>
#include <Precision.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <Bnd_Box.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
@ -37,11 +43,18 @@
#include <TopoDS_Compound.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
#include <BOPTColStd_Dump.hxx>
#include <BOPTColStd_Failure.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <IntTools_Range.hxx>
@ -67,14 +80,17 @@
#include <BOPTools_ListIteratorOfListOfPave.hxx>
#include <BOPTools_SequenceOfPaveBlock.hxx>
#include <BOPTColStd_Dump.hxx>
#include <BOPTColStd_Failure.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
#include <BooleanOperations_KindOfInterference.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
@ -90,30 +106,7 @@
#include <BOPTools_VSInterference.hxx>
// Contribution of Samtech www.samcef.com END
//
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_XYZ.hxx>
#include <gp_Pnt.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TColStd_MapOfInteger.hxx>
//
#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
static
@ -165,31 +158,30 @@ static
BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB;
//
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
myDSIt->Initialize(TopAbs_EDGE, TopAbs_EDGE);
//
// BlockLength correction
aNbVEs=ExpectedPoolLength();
aNbVEs=myDSIt->BlockLength();
aBlockLength=aEEs.BlockLength();
if (aNbVEs > aBlockLength) {
aEEs.SetBlockLength(aNbVEs);
}
//
myDSIt.Initialize(TopAbs_EDGE, TopAbs_EDGE);
//
for (; myDSIt.More(); myDSIt.Next()) {
myDSIt.Current(n1, n2, bJustAdd);
for (; myDSIt->More(); myDSIt->Next()) {
myDSIt->Current(n1, n2, bJustAdd);
anIndexIn = 0;
//
if (myIntrPool->IsComputed(n1, n2)) {
continue;
}
//if (myIntrPool->IsComputed(n1, n2)) {
// continue;
//}
//
nE1=n1;
nE2=n2;
SortTypes(nE1, nE2);
//
if(bJustAdd) {
myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
//myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
continue;
}
//
@ -296,7 +288,7 @@ static
bIsOnPave2=IsOnPave(aT2, aR2, aTol);
//
if(bIsOnPave1 || bIsOnPave2) {
myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
//myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
continue;
}
//
@ -306,7 +298,12 @@ static
BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
//
anIndexIn=aEEs.Append(anInterf);
myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
//myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
// qqf
{
myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
}
// qqt
//
// Collect
aMapVI.Add(aNewVertex, anIndexIn);
@ -321,7 +318,7 @@ static
aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
//
if (aNbComPrt2>1 || !aCoinsideFlag) {
myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
//myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
break;
}
//
@ -349,6 +346,11 @@ static
aMapPB.Add(aPB2);
aMapCB.Add(aPB2, aMapPB);
}
// qqf
{
myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
}
// qqt
}
break;
default:
@ -396,7 +398,7 @@ static
TColStd_MapOfInteger aMFence;
BOPTools_Pave aPave;
//
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
aNb=aMapVI.Extent();
if (!aNb) { // no new vertices, no new problems
@ -575,10 +577,7 @@ void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMap
//...
aNbIP=aMIPC.Extent();
if (!aNbIP) {
//modified by NIZNHY-PKV Tue Jan 9 14:26:09 2007f
aMIPC.Add(i);
//continue;
//modified by NIZNHY-PKV Tue Jan 9 14:26:12 2007t
}
//
aIt1.Initialize(aMIPC);
@ -698,7 +697,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
BOPTools_Pave aPave;
//
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
// one new vertex case is treated in usual way
//
@ -770,58 +769,43 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
{
myIsDone=Standard_False;
//
Standard_Boolean Ok1, Ok2, Ok3;
Ok1= (aType1==TopAbs_VERTEX) && (aType2==TopAbs_EDGE) ;
Ok2= (aType1==TopAbs_EDGE) && (aType2==TopAbs_EDGE) ;
Ok3= (aType1==TopAbs_EDGE) && (aType2==TopAbs_FACE) ;
if (!Ok1 && !Ok2 && !Ok3) {
// error: Type mismatch
Standard_Boolean bOk1, bOk2, bOk3, bFlag;
Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits;
TColStd_MapOfInteger aMap;
bOk1= (aType1==TopAbs_VERTEX) && (aType2==TopAbs_EDGE) ;
bOk2= (aType1==TopAbs_EDGE) && (aType2==TopAbs_EDGE) ;
bOk3= (aType1==TopAbs_EDGE) && (aType2==TopAbs_FACE) ;
if (!bOk1 && !bOk2 && !bOk3) {// error: Type mismatch
return;
}
//
Standard_Boolean aFlag = Standard_False;
Standard_Integer n1, n2, nE1, nE2, aNbSplits;
TColStd_MapOfInteger aMap;
aNb=bOk2 ? 2 : 1;
//
myDSIt.Initialize(aType1, aType2);
//
for (; myDSIt.More(); myDSIt.Next()) {
myDSIt.Current(n1, n2, aFlag);
nE1=n1;
nE2=n2;
SortTypes(nE1, nE2);
myDSIt->Initialize(aType1, aType2);
for (; myDSIt->More(); myDSIt->Next()) {
myDSIt->Current(n1, n2, bFlag);
//
if (aType1==TopAbs_EDGE) {
BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1));
aNbSplits=aLPB1.Extent();
nE[0]=n1;
nE[1]=n2;
if (myDS->GetShapeType(n1)!=TopAbs_EDGE) {
nE[0]=n2;
nE[1]=n1;
}
//
for (i=0; i<aNb; ++i) {
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
aNbSplits=aLPB.Extent();
if (!aNbSplits) {
if (!aMap.Contains(nE1)) {
aMap.Add(nE1);
PreparePaveBlocks(nE1);
//
if (aMap.Add(nE[i])) {
PreparePaveBlocks(nE[i]);
if (!myIsDone) {
return;
}
}
}
}
//
if (aType2==TopAbs_EDGE) {
BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2));
aNbSplits=aLPB2.Extent();
if (!aNbSplits) {
if (!aMap.Contains(nE2)) {
aMap.Add(nE2);
PreparePaveBlocks(nE2);
//
if (!myIsDone) {
return;
}
}
}
}// if (aType2==TopAbs_EDGE)
}// for (; myDSIt.More(); myDSIt.Next())
myIsDone=Standard_True;
}
//=======================================================================
@ -831,65 +815,60 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE)
{
myIsDone=Standard_False;
Standard_Integer nV1, nV2;
//
char buf[512];
Standard_Integer nV1, nV2, iErr;
TopoDS_Edge aE;
TopoDS_Vertex aV1, aV2;
// SplitShapesPool
//
BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
// Edge
aE=TopoDS::Edge(myDS->Shape(nE));
//
if (!BRep_Tool::Degenerated(aE)){
//
BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
BOPTools_PaveBlockIterator aPBIt(nE, aPS);
for (; aPBIt.More(); aPBIt.Next()) {
BOPTools_PaveBlock& aPB=aPBIt.Value();
const IntTools_Range& aRange=aPB.Range();
const BOPTools_Pave& aPave1=aPB.Pave1();
nV1=aPave1.Index();
aV1=TopoDS::Vertex(myDS->GetShape(nV1));
const BOPTools_Pave& aPave2=aPB.Pave2();
nV2=aPave2.Index();
aV2=TopoDS::Vertex(myDS->GetShape(nV2));
//
// ShrunkRange
IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
//
Standard_Integer anErrorStatus;
anErrorStatus=aSR.ErrorStatus();
char buf[512];
if (!aSR.IsDone()) {
sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
BOPTColStd_Dump::PrintMessage(buf);
sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
throw
BOPTColStd_Failure(buf) ;
}
//
if (anErrorStatus==6) {
sprintf(buf,
"Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
BOPTColStd_Dump::PrintMessage(buf);
}
else {
// Check left paves and correct ShrunkRange if it is necessary
CorrectShrunkRanges (0, aPave1, aSR);
CorrectShrunkRanges (1, aPave2, aSR);
}
//
aPB.SetShrunkRange(aSR);
aLPB.Append(aPB);
} //for (; aPBIt1.More(); aPBIt1.Next())
if (BRep_Tool::Degenerated(aE)) {
myIsDone=Standard_True;
return;
}
//
BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
BOPTools_PaveBlockIterator aPBIt(nE, aPS);
for (; aPBIt.More(); aPBIt.Next()) {
BOPTools_PaveBlock& aPB=aPBIt.Value();
const IntTools_Range& aRange=aPB.Range();
//
const BOPTools_Pave& aPave1=aPB.Pave1();
nV1=aPave1.Index();
aV1=TopoDS::Vertex(myDS->GetShape(nV1));
//
const BOPTools_Pave& aPave2=aPB.Pave2();
nV2=aPave2.Index();
aV2=TopoDS::Vertex(myDS->GetShape(nV2));
//
// ShrunkRange
IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
iErr=aSR.ErrorStatus();
if (!aSR.IsDone()) {
sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
BOPTColStd_Dump::PrintMessage(buf);
sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
throw
BOPTColStd_Failure(buf) ;
}
//
if (iErr==6) {
sprintf(buf,
"Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
BOPTColStd_Dump::PrintMessage(buf);
}
else {
// Check left paves and correct ShrunkRange if it is necessary
CorrectShrunkRanges (0, aPave1, aSR);
CorrectShrunkRanges (1, aPave2, aSR);
}
//
aPB.SetShrunkRange(aSR);
aLPB.Append(aPB);
} //for (; aPBIt.More(); aPBIt.Next())
myIsDone=Standard_True;
}
//=======================================================================
@ -915,7 +894,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
return;
}
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
const BOPTools_EEInterference& aEE=aEEs(anIndexInterf);
const IntTools_CommonPrt& aCP=aEE.CommonPrt();
const TopoDS_Edge& aE1=aCP.Edge1();
@ -945,8 +924,10 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
tNV=tV+aCoeff*(tNV-tV);
aNewRange.SetFirst(tNV);
aNewRange.SetLast (aSR.Last());
if(aNewRange.First() > aNewRange.Last()) {
//modified by NIZNHY-PKV Tue Jan 23 14:07:55 2007f
//if(aNewRange.First() > aNewRange.Last()) {
if(aNewRange.First() < aNewRange.Last()) {
//modified by NIZNHY-PKV Tue Jan 23 14:08:02 2007t
aShrunkRange.SetShrunkRange(aNewRange);
}
}
@ -1370,8 +1351,8 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
TColStd_ListOfInteger aLFI;
TColStd_ListIteratorOfListOfInteger aItLFI;
//
BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
//
aNbS=myDS->NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) {
@ -1427,213 +1408,3 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
}
}
// Contribution of Samtech www.samcef.com END
/*
//=======================================================================
// function:EENewVertices
// purpose:
//=======================================================================
void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
{
Standard_Integer aNb, i, j, aNewShape, aNbEdges, aNbIEE, aNbVV, aNbSimple;
Standard_Integer aWhat, aWith, i1, i2, nE1, nE2, nE, nV, aFlag;
Standard_Real aT;
TopoDS_Compound aCompound;
BRep_Builder aBB;
NMTTools_IndexedDataMapOfIndexedMapOfInteger aMNVE, aMNVIEE;
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
BOPTools_Pave aPave;
TopoDS_Vertex aNewVertex;
TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
//
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
//
aNb=aMapVI.Extent();
//
if (!aNb) { // no new vertices, no new problems
return;
}
//
// 0.
if (aNb==1) {
aNewVertex=TopoDS::Vertex(aMapVI.FindKey(1));
EENewVertices(aNewVertex, aMapVI);
return;
}
//
// 1. Make compound from new vertices
aBB.MakeCompound(aCompound);
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aV=aMapVI.FindKey(i);
aBB.Add(aCompound, aV);
}
//
// 2. VV intersection between these vertices
// using the auxiliary Filler
NMTDS_ShapesDataStructure tDS;
//
tDS.SetCompositeShape(aCompound);
tDS.Init();
//
BOPTools_InterferencePool tInterfPool(tDS);
NMTTools_PaveFiller tPaveFiller(tInterfPool);
//
tPaveFiller.Init();
//
tPaveFiller.PerformVV();
tPaveFiller.PerformNewVertices();
//
const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
//
// 3. Separate Comlex and Simple new vertices
aNbVV=aVVInterfs.Extent();
for (i=1; i<=aNbVV; ++i) {
const BOPTools_VVInterference& aVV=aVVInterfs(i);
aVV.Indices(aWhat, aWith);
const TopoDS_Shape& aV1=tDS.Shape(aWhat);
const TopoDS_Shape& aV2=tDS.Shape(aWith);
aMNVComplex.Add(aV1);
aMNVComplex.Add(aV2);
}
//
for (i=1; i<=aNb; ++i) {
const TopoDS_Shape& aV=aMapVI.FindKey(i);
if (!aMNVComplex.Contains(aV)) {
aMNVSimple.Add(aV);
}
}
//
// 4. Treat Simple new Vertices
aNbSimple=aMNVSimple.Extent();
for (i=1; i<=aNbSimple; ++i) {
const TopoDS_Vertex& aV=TopoDS::Vertex(aMNVSimple(i));
EENewVertices(aV, aMapVI);
}
//
// 3. Fill Maps : NewVertex-edges (aMNVE)
// NewVertex-interferences (aMNVIEE)
for (i=1; i<=aNbVV; ++i) {
const BOPTools_VVInterference& aVV=aVVInterfs(i);
aNewShape=aVV.NewShape();
if (!aNewShape) {
continue;
}
//
if (!aMNVE.Contains(aNewShape)) {
TColStd_IndexedMapOfInteger aMx;
aMNVE.Add(aNewShape, aMx);
}
if (!aMNVIEE.Contains(aNewShape)) {
TColStd_IndexedMapOfInteger aMx;
aMNVIEE.Add(aNewShape, aMx);
}
//
TColStd_IndexedMapOfInteger& aME=aMNVE.ChangeFromKey(aNewShape);
TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.ChangeFromKey(aNewShape);
//
aVV.Indices(aWhat, aWith);
//aWhat
const TopoDS_Shape& aV1=tDS.Shape(aWhat);
i1=aMapVI.FindFromKey(aV1);
const BOPTools_EEInterference& aEE1=aEEs(i1);
aEE1.Indices(nE1, nE2);
aME.Add(nE1);
aME.Add(nE2);
aMIEE.Add(i1);
//aWith
const TopoDS_Shape& aV2=tDS.Shape(aWith);
i2=aMapVI.FindFromKey(aV2);
const BOPTools_EEInterference& aEE2=aEEs(i2);
aEE2.Indices(nE1, nE2);
aME.Add(nE1);
aME.Add(nE2);
aMIEE.Add(i2);
//
//printf(" VV: (%d, %d) -> %d\n", aWhat, aWith, aNewShape);
}
//
// 4. Process new vertices
aNb=aMNVE.Extent();
for (i=1; i<=aNb; ++i) { // xx
//
// new Vertex
nV=aMNVE.FindKey(i);
aNewVertex=TopoDS::Vertex(tDS.Shape(nV));
//
// Insert New Vertex in DS;
myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
aNewShape=myDS->NumberOfInsertedShapes();
myDS->SetState (aNewShape, BooleanOperations_ON);
//
// Update index of NewShape in EE interferences
const TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.FindFromKey(nV);//(i);
aNbIEE=aMIEE.Extent();
for (j=1; j<=aNbIEE; ++j) {
i1=aMIEE(j);
BOPTools_EEInterference& aEE1=aEEs(i1);
aEE1.SetNewShape(aNewShape);
}
//
// Update Paves on edges
const TColStd_IndexedMapOfInteger& aME=aMNVE(i);
aNbEdges=aME.Extent();
for (j=1; j<=aNbEdges; ++j) {
nE=aME(j);
const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
//
aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
//
if (!aFlag) {
aPave.SetInterference(-1);
aPave.SetType (BooleanOperations_EdgeEdge);
aPave.SetIndex(aNewShape);
aPave.SetParam(aT);
//
BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
aPaveSet.Append(aPave);
}
}
}// for (i=1; i<=aNb; ++i) {// xx
}
//=======================================================================
// function:EENewVertices
// purpose:
//=======================================================================
void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
{
Standard_Integer i, aNewShape, nE1, nE2;
Standard_Real aT1, aT2;
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
BOPTools_Pave aPave;
//
BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
//
// one new vertex case is treated in usual way
//
// Insert New Vertex in DS;
myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
aNewShape=myDS->NumberOfInsertedShapes();
myDS->SetState (aNewShape, BooleanOperations_ON);
// Insert New Vertex in EE Interference
i=aMapVI.FindFromKey(aNewVertex);
BOPTools_EEInterference& aEEInterf= aEEs(i);
aEEInterf.SetNewShape(aNewShape);
// Extact interference info
aEEInterf.Indices(nE1, nE2);
const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
VertexParameters(aCPart, aT1, aT2);
//
// Add Paves to the myPavePoolNew
aPave.SetInterference(i);
aPave.SetType (BooleanOperations_EdgeEdge);
aPave.SetIndex(aNewShape);
// Pave for edge nE1
aPave.SetParam(aT1);
BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
aPaveSet1.Append(aPave);
// Pave for edge nE2
aPave.SetParam(aT2);
BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
aPaveSet2.Append(aPave);
}
*/

View File

@ -40,6 +40,8 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Compound.hxx>
#include <TopExp.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <IntTools_ShrunkRange.hxx>
@ -63,7 +65,7 @@
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_ESInterference.hxx>
#include <BOPTools_InterferencePool.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_CArray1OfESInterference.hxx>
#include <BOPTools_VVInterference.hxx>
@ -72,14 +74,15 @@
#include <BOPTools_IMapOfPaveBlock.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
#include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
#include <NMTTools_ListOfCommonBlock.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
static
void VertexParameter(const IntTools_CommonPrt& aCPart,
@ -105,28 +108,32 @@ static
BOPTools_IDMapOfPaveBlockIMapOfInteger aMapCB;
BOPTools_IMapOfPaveBlock aIMPBx;
//
BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
//
myDSIt.Initialize(TopAbs_EDGE, TopAbs_FACE);
myDSIt->Initialize(TopAbs_EDGE, TopAbs_FACE);
//
// BlockLength correction
aNbEFs=ExpectedPoolLength();
aNbEFs=myDSIt->BlockLength();
aBlockLength=aEFs.BlockLength();
if (aNbEFs > aBlockLength) {
aEFs.SetBlockLength(aNbEFs);
}
//
for (; myDSIt.More(); myDSIt.Next()) {
myDSIt.Current(n1, n2, bJustAdd);
for (; myDSIt->More(); myDSIt->Next()) {
myDSIt->Current(n1, n2, bJustAdd);
anIndexIn = 0;
//
if (myIntrPool->IsComputed(n1, n2)) {
continue;
}
//if (myIntrPool->IsComputed(n1, n2)) {
// continue;
//}
//
nE=n1;
nF=n2;
SortTypes(nE, nF);
if (myDS->GetShapeType(n2)==TopAbs_EDGE) {
nE=n2;
nF=n1;
}
//SortTypes(nE, nF);
//
// all Common Blocks for face nF
//XXX
@ -135,7 +142,7 @@ static
NMTTools_CommonBlockAPI aCBAPIF(aLCBF);
//XXX
if(bJustAdd) {
myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
//myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
continue;
}
// Edge
@ -246,10 +253,15 @@ static
//
aMapVI.Add(aNewVertex, anIndexIn);
aIMPBx.Add(aPB);
// qqf
{
myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
}
// qqt
//
}// if (!nVF)
}// if (!bIsOnPave1 && !bIsOnPave2)
myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
//myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
}// case TopAbs_VERTEX:
break;
//
@ -258,7 +270,7 @@ static
//
aCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
if (!aCoinsideFlag) {
myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
//myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
break;
}
//
@ -272,9 +284,12 @@ static
aMapF.Add(nF);
aMapCB.Add(aPB, aMapF);
}
//modified by NIZNHY-PKV Fri Jan 23 14:13:08 2004 f
aIMPBx.Add(aPB);
//modified by NIZNHY-PKV Fri Jan 23 14:13:10 2004 t
// qqf
{
myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
}
// qqt
}// case TopAbs_EDGE:
break;
@ -370,7 +385,7 @@ static
void NMTTools_PaveFiller::EFNewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI)
{
Standard_Integer i, j, aNb, aNewShape, aFlag, iX, aNbVV, aNbSimple;
Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges;
Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges, iTmp;
Standard_Real aT;
TopoDS_Compound aCompound;
TopoDS_Vertex aNewVertex;
@ -380,7 +395,7 @@ static
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
//
BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
//
aNb=aMapVI.Extent();
//
@ -404,20 +419,19 @@ static
//
// 2. VV intersection between these vertices
// using the auxiliary Filler
NMTDS_ShapesDataStructure tDS;
NMTTools_PaveFiller tPF;
//
tDS.SetCompositeShape(aCompound);
tDS.Init();
tPF.SetCompositeShape(aCompound);
//
BOPTools_InterferencePool tInterfPool(tDS);
NMTTools_PaveFiller tPaveFiller(tInterfPool);
tPF.Init();
tPF.PerformVV();
//tPF.PerformNewVertices(); qq
//
tPaveFiller.Init();
//
tPaveFiller.PerformVV();
tPaveFiller.PerformNewVertices();
//
const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
//const BOPTools_InterferencePool& tInterfPool=*(tPF.InterfPool());
NMTDS_InterfPool& tInterfPool=*(tPF.IP());
//const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterferences();
//
// 3. Separate Comlex and Simple new vertices
aNbVV=aVVInterfs.Extent();
@ -472,7 +486,12 @@ static
iX=aMapVI.FindFromKey(aV1);
const BOPTools_ESInterference& aEF1=aEFs(iX);
aEF1.Indices(nE, nF);
SortTypes(nE, nF);
//SortTypes(nE, nF);
if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
iTmp=nE;
nE=nF;
nF=iTmp;
}
aME.Add(nE);
aMIEF.Add(iX);
//aWith
@ -480,7 +499,12 @@ static
iX=aMapVI.FindFromKey(aV2);
const BOPTools_ESInterference& aEF2=aEFs(iX);
aEF2.Indices(nE, nF);
SortTypes(nE, nF);
//SortTypes(nE, nF);
if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
iTmp=nE;
nE=nF;
nF=iTmp;
}
aME.Add(nE);
aMIEF.Add(iX);
}
@ -539,7 +563,7 @@ static
BOPTools_Pave aPave;
BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
//
BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
//
// Insert New Vertex in DS;
myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
@ -551,7 +575,10 @@ static
aEFInterf.SetNewShape(aNewShape);
// Extract interference info
aEFInterf.Indices(nE, nF);
SortTypes(nE, nF);
//SortTypes(nE, nF);
if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
nE=nF;
}
const IntTools_CommonPrt& aCPart=aEFInterf.CommonPrt();
VertexParameter(aCPart, aT);
//

View File

@ -31,24 +31,36 @@
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <BndLib_Add3dCurve.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopExp.hxx>
#include <BRepLib.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepBndLib.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
#include <BOPTColStd_IndexedDataMapOfIntegerInteger.hxx>
@ -62,14 +74,15 @@
#include <IntTools_SequenceOfCurves.hxx>
#include <IntTools_FaceFace.hxx>
#include <IntTools_Tools.hxx>
#include <IntTools_ShrunkRange.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_ListIteratorOfListOfInterference.hxx>
#include <BOPTools_CArray1OfInterferenceLine.hxx>
#include <BOPTools_InterferenceLine.hxx>
#include <BOPTools_ListOfInterference.hxx>
#include <BOPTools_Interference.hxx>
#include <BOPTools_InterferencePool.hxx>
//#include <BOPTools_ListIteratorOfListOfInterference.hxx>
//#include <BOPTools_CArray1OfInterferenceLine.hxx>
//#include <BOPTools_InterferenceLine.hxx>
//#include <BOPTools_ListOfInterference.hxx>
//#include <BOPTools_Interference.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
@ -79,55 +92,18 @@
#include <BOPTools_PaveBlockIterator.hxx>
#include <BOPTools_Tools2D.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTTools_Tools.hxx>
#include <NMTTools_IndexedDataMapOfShapePaveBlock.hxx>
#include <NMTTools_CommonBlockAPI.hxx>
#include <Geom2d_Curve.hxx>
#include <NMTTools_Tools.hxx>
#include <BRepLib.hxx>
#include <Geom2d_TrimmedCurve.hxx>
//
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TColStd_ListOfInteger.hxx>
////
#include <NMTTools_DataMapOfIntegerListOfPaveBlock.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <NMTTools_MapOfPaveBlock.hxx>
//
#include <IntTools_ShrunkRange.hxx>
static
Standard_Boolean IsPairFound(const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_InterferencePool* myIntrPool,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
static
void FMapWhat(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWhat);
static
void FMapWith(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWith);
static
Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
const TColStd_IndexedMapOfInteger& aMapWith);
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
@ -137,9 +113,11 @@ static
TopTools_ListOfShape& aLS);
// Contribution of Samtech www.samcef.com END
//modified by NIZNHY-PKV Mon Dec 4 12:56:04 2006f
static
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
IntTools_Context& aCtx);
//modified by NIZNHY-PKV Mon Dec 4 12:56:08 2006t
//=======================================================================
// function: PerformFF
@ -149,7 +127,7 @@ static
{
myIsDone=Standard_False;
//
Standard_Boolean bIsFound, bJustAdd, bIsComputed;
Standard_Boolean bJustAdd;//, bIsComputed, bIsFound;
Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
Standard_Integer aNbCurves, aNbPoints;
@ -159,25 +137,25 @@ static
IntTools_SequenceOfCurves aCvs;
BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
//
BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
// F/F Interferences [BooleanOperations_SurfaceSurface]
myDSIt.Initialize(TopAbs_FACE, TopAbs_FACE);
myDSIt->Initialize(TopAbs_FACE, TopAbs_FACE);
//
// BlockLength correction
aNbFFs=ExpectedPoolLength();
aNbFFs=myDSIt->BlockLength();
aBlockLength=aFFs.BlockLength();
if (aNbFFs > aBlockLength) {
aFFs.SetBlockLength(aNbFFs);
}
//
for (; myDSIt.More(); myDSIt.Next()) {
myDSIt.Current(n1, n2, bJustAdd);
for (; myDSIt->More(); myDSIt->Next()) {
myDSIt->Current(n1, n2, bJustAdd);
//
bIsComputed=myIntrPool->IsComputed(n1, n2);
if (bIsComputed) {
continue;
}
//bIsComputed=myIntrPool->IsComputed(n1, n2);
//if (bIsComputed) {
// continue;
//}
//
nF1 = n2;
nF2 = n1;
@ -189,8 +167,8 @@ static
aPnts.Clear();
aCvs.Clear();
//
/*
bIsFound=IsPairFound(nF1, nF2, myIntrPool, aMapWhat, aMapWith);
//
if (bJustAdd) {
if (!bIsFound) {
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
@ -202,6 +180,7 @@ static
}
continue;
}
*/
//
const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
@ -222,7 +201,9 @@ static
//
bIsDone=aFF.IsDone();
//
if (!bIsDone) {
/*
if (!bIsFound) {
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
@ -231,6 +212,7 @@ static
anIndexIn=aFFs.Append(anInterf);
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
*/
continue;
}
//
@ -251,14 +233,14 @@ static
if (!aNbCurves && !aNbPoints) {
BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
anIndexIn=aFFs.Append(anInterf);
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
//myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
continue;
}
//
{
BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
anIndexIn=aFFs.Append(anInterf);
myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
//myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
}
//
}// for (; myDSIt.More(); myDSIt.Next())
@ -278,7 +260,7 @@ static
Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
// Contribution of Samtech www.samcef.com END
//
Standard_Boolean bIsMicroEdge;
Standard_Boolean bIsMicroEdge, bHasES;
Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
Standard_Integer nV1, nV2, j, aNbCurves;
Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
@ -286,7 +268,7 @@ static
BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
BOPTools_ListIteratorOfListOfPaveBlock anIt;
//
BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
aNbFFs=aFFs.Extent();
//
@ -375,11 +357,9 @@ static
//
// 1. Produce Section Edges from intersection curves
// between each pair of faces
//
aNbFFs=aFFs.Extent();
//
for (i=1; i<=aNbFFs; ++i) {
BOPTools_SSInterference& aFFi=aFFs(i);
//
// Faces
@ -456,6 +436,7 @@ static
}
//
// Pave Blocks on Curves
bHasES=Standard_False;
for (j=1; j<=aNbCurves; ++j) {
BOPTools_Curve& aBC=aSCvs(j);
const IntTools_Curve& aIC= aBC.Curve();
@ -472,13 +453,12 @@ static
nV2=aPBNew.Pave2().Index();
aT1=aPBNew.Pave1().Param();
aT2=aPBNew.Pave2().Param();
// ???
//
if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
continue;// mkk ft
continue;// mkk ft ???
}
//
// 1
bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
if (bIsExistingPaveBlock) {
continue;
@ -517,17 +497,13 @@ static
//
BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
//
// use_01 f
//
NMTTools_Tools::UpdateEdge (aES, aTolR3D);
bIsMicroEdge=IsMicroEdge(aES, myContext);
if (bIsMicroEdge) {
continue;
}
//
//use_01 t
//
// SKL/PartC5 f
{
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
@ -536,14 +512,19 @@ static
//
NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
//SKL/PartC5 t
}
//
aMEPB.Add(aES, aPBNew);
aMapEI.Add(aES, i);
}
//
bHasES=Standard_True;
}// for (; aPBIter.More(); aPBIter.Next())
} // end of for (j=1; j<=aNbCurves; ++j)
// qqf
if (bHasES) {
myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
}
// qqt
}// for (i=1; i<=aNbFFs; ++i)
//=============================================================
//
@ -572,18 +553,14 @@ static
//
//
// 2. Intersect SE using auxiliary Filler
NMTDS_ShapesDataStructure tDS;
NMTTools_PaveFiller tPF;
//
tDS.SetCompositeShape(aCompound);
tDS.Init();
//
BOPTools_InterferencePool tIP(tDS);
NMTTools_PaveFiller tPF(tIP);
tPF.SetCompositeShape(aCompound);
//
// 2.1.VV
tPF.Init();
tPF.PerformVV();
tPF.PerformNewVertices();
//tPF.PerformNewVertices(); qq
//
// 2.2.VE
tPF.myPavePool.Resize (tPF.myNbEdges);
@ -617,6 +594,7 @@ static
BOPTools_ListIteratorOfListOfPaveBlock aIt;
BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
//
const NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
//
@ -743,11 +721,9 @@ static
aF2FWD=aF2;
aF2FWD.Orientation(TopAbs_FORWARD);
//
// SKL/PartC5 f
NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
NMTTools_Tools::UpdateEdge (aEx, aTolEx);
//SKL/PartC5 t
} //if (aCBAPI.IsCommonBlock(aPB))
//
// new SE
@ -816,13 +792,13 @@ static
{
Standard_Integer i, aNb, nF1, nF2, nE;
Standard_Integer aNbCB, aNbF, nSp, nF;
TopAbs_ShapeEnum aType;
TopoDS_Face aF1FWD, aF2FWD;
TColStd_ListIteratorOfListOfInteger aItF;
BOPTools_ListIteratorOfListOfPaveBlock anIt;
NMTTools_ListIteratorOfListOfCommonBlock aItCB;
TopAbs_ShapeEnum aType;
//
BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
aNb=aFFs.Extent();
for (i=1; i<=aNb; i++) {
@ -1212,122 +1188,8 @@ static
}
}
/////////////
//=======================================================================
// function: IsPairFound
// purpose:
//=======================================================================
Standard_Boolean IsPairFound(const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_InterferencePool* myIntrPool,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
{
Standard_Boolean bIsFound;
//
if (!aMapWhat.Contains(nF1)) {
TColStd_IndexedMapOfInteger aMWhat;
FMapWhat(nF1, myIntrPool, aMWhat);
aMapWhat.Add(nF1, aMWhat);
}
//
if (!aMapWith.Contains(nF2)) {
TColStd_IndexedMapOfInteger aMWith;
FMapWith(nF2, myIntrPool, aMWith);
aMapWith.Add(nF2, aMWith);
}
//
const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
//
bIsFound=IsFound(aMWht, aMWit);
//
return bIsFound;
}
//=======================================================================
// function: FMapWhat
// purpose:
//=======================================================================
void FMapWhat(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWhat)
{
Standard_Integer nE, nV;
BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
BooleanOperations_OnceExplorer aExp(*myDS);
//
// What
aMapWhat.Add(nF);
aExp.Init(nF, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
nV=aExp.Current();
aMapWhat.Add(nV);
}
//
aExp.Init(nF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
nE=aExp.Current();
aMapWhat.Add(nE);
}
}
//=======================================================================
// function: FMapWith
// purpose:
//=======================================================================
void FMapWith(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWith)
{
TColStd_IndexedMapOfInteger aMapWhat;
FMapWhat(nF, myIntrPool, aMapWhat);
//
// With
Standard_Integer i, aNb, anIndex, aWhat, aWith;
BOPTools_ListIteratorOfListOfInterference anIt;
const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
aNb=aMapWhat.Extent();
for (i=1; i<=aNb; i++) {
aWhat=aMapWhat(i);
const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
const BOPTools_ListOfInterference& aLI=aWithLine.List();
anIt.Initialize(aLI);
for (; anIt.More(); anIt.Next()) {
const BOPTools_Interference& anIntf=anIt.Value();
anIndex=anIntf.Index();
if (anIndex) {
aWith=anIntf.With();
aMapWith.Add(aWith);
}
}
}
}
//=======================================================================
// function: IsFound
// purpose:
//=======================================================================
Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
const TColStd_IndexedMapOfInteger& aMapWith)
{
Standard_Boolean bFlag=Standard_False;
Standard_Integer i, aNb, aWhat;
aNb=aMapWhat.Extent();
for (i=1; i<=aNb; i++) {
aWhat=aMapWhat(i);
if (aMapWith.Contains(aWhat)) {
return !bFlag;
}
}
return bFlag;
}
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
//=======================================================================
@ -1476,7 +1338,7 @@ void SharedEdges1(const TopoDS_Face& aF1,
//
// Contribution of Samtech www.samcef.com END
// use_01 f
//modified by NIZNHY-PKV Mon Dec 4 12:30:38 2006f use_01
//=======================================================================
//function : IsMicroEdge
//purpose :
@ -1515,4 +1377,139 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
//
return bRet;
}
// use_01 t
//modified by NIZNHY-PKV Mon Dec 4 12:55:50 2006t
/*
static
Standard_Boolean IsPairFound(const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_InterferencePool* myIntrPool,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
static
void FMapWhat(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWhat);
static
void FMapWith(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWith);
static
Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
const TColStd_IndexedMapOfInteger& aMapWith);
//=======================================================================
// function: IsPairFound
// purpose:
//=======================================================================
Standard_Boolean IsPairFound(const Standard_Integer nF1,
const Standard_Integer nF2,
BOPTools_InterferencePool* myIntrPool,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
{
Standard_Boolean bIsFound;
//
if (!aMapWhat.Contains(nF1)) {
TColStd_IndexedMapOfInteger aMWhat;
FMapWhat(nF1, myIntrPool, aMWhat);
aMapWhat.Add(nF1, aMWhat);
}
//
if (!aMapWith.Contains(nF2)) {
TColStd_IndexedMapOfInteger aMWith;
FMapWith(nF2, myIntrPool, aMWith);
aMapWith.Add(nF2, aMWith);
}
//
const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
//
bIsFound=IsFound(aMWht, aMWit);
//
return bIsFound;
}
//=======================================================================
// function: FMapWhat
// purpose:
//=======================================================================
void FMapWhat(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWhat)
{
Standard_Integer nE, nV;
//
BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
BooleanOperations_OnceExplorer aExp(*myDS);
//
// What
aMapWhat.Add(nF);
aExp.Init(nF, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next()) {
nV=aExp.Current();
aMapWhat.Add(nV);
}
//
aExp.Init(nF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
nE=aExp.Current();
aMapWhat.Add(nE);
}
}
//=======================================================================
// function: FMapWith
// purpose:
//=======================================================================
void FMapWith(const Standard_Integer nF,
BOPTools_InterferencePool* myIntrPool,
TColStd_IndexedMapOfInteger& aMapWith)
{
TColStd_IndexedMapOfInteger aMapWhat;
FMapWhat(nF, myIntrPool, aMapWhat);
//
// With
Standard_Integer i, aNb, anIndex, aWhat, aWith;
BOPTools_ListIteratorOfListOfInterference anIt;
const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
aNb=aMapWhat.Extent();
for (i=1; i<=aNb; i++) {
aWhat=aMapWhat(i);
const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
const BOPTools_ListOfInterference& aLI=aWithLine.List();
anIt.Initialize(aLI);
for (; anIt.More(); anIt.Next()) {
const BOPTools_Interference& anIntf=anIt.Value();
anIndex=anIntf.Index();
if (anIndex) {
aWith=anIntf.With();
aMapWith.Add(aWith);
}
}
}
}
//=======================================================================
// function: IsFound
// purpose:
//=======================================================================
Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
const TColStd_IndexedMapOfInteger& aMapWith)
{
Standard_Boolean bFlag=Standard_False;
Standard_Integer i, aNb, aWhat;
aNb=aMapWhat.Extent();
for (i=1; i<=aNb; i++) {
aWhat=aMapWhat(i);
if (aMapWith.Contains(aWhat)) {
return !bFlag;
}
}
return bFlag;
}
*/

View File

@ -25,54 +25,61 @@
#include <NMTTools_PaveFiller.ixx>
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopTools_DataMapOfShapeListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_DataMapOfShapeListOfInteger.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <TopExp_Explorer.hxx>
#include <TopExp.hxx>
//
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_PntOnFace.hxx>
#include <IntTools_PntOn2Faces.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_VVInterference.hxx>
#include <BOPTools_Tools.hxx>
#include <BOPTools_ListOfPaveBlock.hxx>
#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
#include <BOPTools_PaveBlock.hxx>
#include <BOPTools_Pave.hxx>
#include <BOPTools_Tools.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
#include <BRep_Tool.hxx>
#include <NMTDS_Iterator.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
#include <NMTDS_InterfPool.hxx>
#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
#include <BOPTools_SSInterference.hxx>
#include <BOPTools_CArray1OfSSInterference.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Shape.hxx>
#include <TopExp.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
//
#include <IntTools_SequenceOfPntOn2Faces.hxx>
#include <IntTools_PntOnFace.hxx>
#include <IntTools_PntOn2Faces.hxx>
#include <BOPTools_Tools.hxx>
#include <TopTools_DataMapOfShapeListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <BOPTools_CArray1OfVVInterference.hxx>
#include <BOPTools_VVInterference.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_DataMapOfShapeListOfInteger.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <Bnd_HArray1OfBox.hxx>
#include <Bnd_BoundSortBox.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
static
@ -286,7 +293,7 @@ static
BOPTools_Pave aPave1, aPave2;
BOPTools_PaveBlock aPB;
//
BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
aNbFFs=aFFs.Extent();
for (i=1; i<=aNbFFs; ++i) {
@ -371,7 +378,7 @@ static
//
myAloneVertices.Clear();
//
BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
// 1. Collect alone vertices from FFs
aNbV=0;
@ -545,6 +552,50 @@ static
}
}
}
// qqf
{
Standard_Integer aNbF, aNbAV, nF, k;
NMTTools_IndexedDataMapOfIndexedMapOfInteger aMAVF;
//
aNbF=myAloneVertices.Extent();
if (aNbF<2) {
return;
}
//
// 1. fill map Alone Vertex/Face -> aMAVF
for (i=1; i<=aNbF; ++i) {
nF=myAloneVertices.FindKey(i);
const TColStd_IndexedMapOfInteger& aMAV=myAloneVertices(i);
aNbAV=aMAV.Extent();
for(j=1; j<=aNbAV; ++j) {
nV=aMAV(j);
if (aMAVF.Contains(nV)) {
TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
aMF.Add(nF);
}
else{
TColStd_IndexedMapOfInteger aMF;
aMF.Add(nF);
aMAVF.Add(nV, aMF);
}
}
}
//
// 2 Obtain pairs of faces
aNbAV=aMAVF.Extent();
for (i=1; i<=aNbAV; ++i) {
const TColStd_IndexedMapOfInteger& aMF=aMAVF(i);
aNbF=aMF.Extent();
for(j=1; j<aNbF; ++j) {
nF1=aMF(j);
for(k=j+1; k<=aNbF; ++k) {
nF2=aMF(k);
myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
}
}
}
}
// qqt
}
//=======================================================================
// function: AloneVertices
@ -558,24 +609,22 @@ static
// function: FuseVertices
// purpose:
//=======================================================================
void FuseVertices(const TopoDS_Shape& aCompound,
TopTools_DataMapOfShapeShape& aDMVV)
void NMTTools_PaveFiller::FuseVertices(const TopoDS_Shape& aCompound,
TopTools_DataMapOfShapeShape& aDMVV)const
{
Standard_Integer i, aNbVV, n1, n2, nX;
NMTDS_ShapesDataStructure tDS;
NMTTools_PaveFiller tPF;
//
tDS.SetCompositeShape(aCompound);
tDS.Init();
tPF.SetCompositeShape(aCompound);
//
BOPTools_InterferencePool tInterfPool(tDS);
NMTTools_PaveFiller tPaveFiller(tInterfPool);
tPF.Init();
//
tPaveFiller.Init();
tPF.PerformVV();
//tPF.PerformNewVertices(); //qq
//
tPaveFiller.PerformVV();
tPaveFiller.PerformNewVertices();
//
const BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterfs();
NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
NMTDS_InterfPool& tInterfPool=*(tPF.IP());
BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterferences();
//
aNbVV=aVVt.Extent();
for (i=1; i<=aNbVV; ++i) {