From: gdd Date: Tue, 8 Nov 2011 13:24:03 +0000 (+0000) Subject: Merge from V6_main X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_OPENCV;p=modules%2Fgeom.git Merge from V6_main --- diff --git a/adm_local/unix/config_files/Makefile.am b/adm_local/unix/config_files/Makefile.am index 66230c1fe..b2687da74 100644 --- a/adm_local/unix/config_files/Makefile.am +++ b/adm_local/unix/config_files/Makefile.am @@ -21,4 +21,5 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am dist_admlocalm4_DATA = \ check_GEOM.m4 \ -check_GUI.m4 +check_GUI.m4 \ +check_OpenCV.m4 diff --git a/configure.ac b/configure.ac index 1adb80209..8849337c3 100644 --- a/configure.ac +++ b/configure.ac @@ -477,6 +477,7 @@ AC_OUTPUT([ \ resources/Makefile \ resources/GEOMCatalog.xml \ resources/SalomeApp.xml \ + resources/Plugin \ idl/Makefile \ Makefile \ ]) diff --git a/doc/Makefile.am b/doc/Makefile.am index b2d61e363..f6dc56cf4 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -23,6 +23,7 @@ # Modified by : Alexander BORODIN (OCN) - autotools usage # SUBDIRS = salome docutils +#SUBDIRS = salome usr_docs: (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs) diff --git a/doc/docutils/Makefile.am b/doc/docutils/Makefile.am index 7e0f8bfc8..5d077ad62 100644 --- a/doc/docutils/Makefile.am +++ b/doc/docutils/Makefile.am @@ -38,9 +38,17 @@ SPHINXBUILD = sphinx-build PAPEROPT_a4 = -D latex_paper_size=a4 ALLSPHINXOPTS = -d doctrees $(PAPEROPT_a4) $(SPHINXOPTS) $(SOURCEDIR) +if GEOM_ENABLE_GUI +SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(GUI_ROOT_DIR)/lib/salome:$(GUI_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GUI_ROOT_DIR)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages +else !GEOM_ENABLE_GUI SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages +endif +if GEOM_ENABLE_GUI +SPHINX_LD_LIBRARY_PATH = $(GUI_ROOT_DIR)/lib/salome:$(KERNEL_ROOT_DIR)/lib/salome:$(OMNIORB_ROOT)/lib +else !GEOM_ENABLE_GUI SPHINX_LD_LIBRARY_PATH = $(KERNEL_ROOT_DIR)/lib/salome:$(OMNIORB_ROOT)/lib +endif .PHONY: latex diff --git a/resources/Makefile.am b/resources/Makefile.am index a5711e810..6313fd6c7 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -28,8 +28,6 @@ dist_salomeres_DATA = \ GEOM_en.xml \ GEOM_fr.xml \ GEOM.config \ -$(top_builddir)/resources/SalomeApp.xml \ -Plugin \ GEOMDS_Resources \ ImportExport \ ShHealing \ @@ -248,4 +246,4 @@ ADVANCED_RESOURCES += dlg_pipetshapefilletrf.png dist_salomeres_DATA += $(ADVANCED_RESOURCES) # VSR: little trick to avoid putting if GEOMCatalog.xml to the distribution archive -nodist_salomeres_SCRIPTS = GEOMCatalog.xml +nodist_salomeres_SCRIPTS = GEOMCatalog.xml SalomeApp.xml Plugin diff --git a/resources/Plugin b/resources/Plugin deleted file mode 100755 index 895d6554e..000000000 --- a/resources/Plugin +++ /dev/null @@ -1,10 +0,0 @@ -! Description of available plugins -! ******************************** -! -a148e300-5740-11d1-a904-080036aaa103.Location: FWOSPlugin -! -! standard attribute drivers plugin -! -ad696000-5b34-11d1-b5ba-00a0c9064368.Location: StdPlugin -ad696001-5b34-11d1-b5ba-00a0c9064368.Location: StdPlugin -ad696002-5b34-11d1-b5ba-00a0c9064368.Location: StdPlugin diff --git a/resources/Plugin.in b/resources/Plugin.in new file mode 100644 index 000000000..3d4fad5e5 --- /dev/null +++ b/resources/Plugin.in @@ -0,0 +1,10 @@ +! Description of available plugins +! ******************************** +! +a148e300-5740-11d1-a904-080036aaa103.Location: FWOSPlugin +! +! standard attribute drivers plugin +! +ad696000-5b34-11d1-b5ba-00a0c9064368.Location: @CAS_STDPLUGIN@ +ad696001-5b34-11d1-b5ba-00a0c9064368.Location: @CAS_STDPLUGIN@ +ad696002-5b34-11d1-b5ba-00a0c9064368.Location: @CAS_STDPLUGIN@ diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index ee739d075..dc59f51f5 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -27,16 +27,16 @@ - +
- - + +
- +
diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index f3fa98bf2..27604981e 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -91,7 +91,7 @@ EntityGUI_SketcherDlg::EntityGUI_SketcherDlg( GeometryGUI* GUI, QWidget* parent, topLayout->setMargin( 9 ); topLayout->setSpacing( 6 ); MainWidget->buttonCancel->setText( tr( "GEOM_BUT_CANCEL" ) ); - MainWidget->buttonEnd->setText( tr( "GEOM_BUT_END_SKETCH" ) ); + MainWidget->buttonEnd->setText( tr( "GEOM_BUT_CLOSE" ) ); MainWidget->buttonClose->setText( tr( "GEOM_BUT_CLOSE_SKETCH" ) ); MainWidget->buttonHelp->setText( tr( "GEOM_BUT_HELP" ) ); @@ -978,7 +978,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd() myCommand.append( ":WW" ); } else { - // PAL16008 (Sketcher Validation should be equal to Apply&Close) + /*// PAL16008 (Sketcher Validation should be equal to Apply&Close) if ( ( Group1Spin->buttonApply->isEnabled() && Group1Spin->isVisible() ) || ( Group2Spin->buttonApply->isEnabled() && Group2Spin->isVisible() ) || ( Group3Spin->buttonApply->isEnabled() && Group3Spin->isVisible() ) || @@ -987,7 +987,7 @@ void EntityGUI_SketcherDlg::ClickOnEnd() ( Group2Sel->buttonApply->isEnabled() && Group2Sel->isVisible() ) || ( Group1Sel1Spin->buttonApply->isEnabled() && Group1Sel1Spin->isVisible() ) ) { ClickOnApply(); - } + }*/ myIsAllAdded = true; } diff --git a/src/GEOM/GEOM_DataMapOfAsciiStringTransient.hxx b/src/GEOM/GEOM_DataMapOfAsciiStringTransient.hxx index 0ab59d327..8f5472dd2 100644 --- a/src/GEOM/GEOM_DataMapOfAsciiStringTransient.hxx +++ b/src/GEOM/GEOM_DataMapOfAsciiStringTransient.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOM_DataMapOfAsciiStringTransient_HeaderFile #define _GEOM_DataMapOfAsciiStringTransient_HeaderFile @@ -38,6 +37,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class TCollection_AsciiString; @@ -45,7 +45,6 @@ class Standard_Transient; class GEOM_DataMapNodeOfDataMapOfAsciiStringTransient; class GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient; - #ifndef _Standard_HeaderFile #include #endif @@ -53,6 +52,8 @@ class GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient; #include #endif +#include + class GEOM_DataMapOfAsciiStringTransient : public TCollection_BasicMap { public: @@ -69,6 +70,7 @@ public: { if (anAddress) Standard::Free((Standard_Address&)anAddress); } + // Methods PUBLIC // Standard_EXPORT GEOM_DataMapOfAsciiStringTransient(const Standard_Integer NbBuckets = 1); @@ -100,40 +102,18 @@ Standard_EXPORT Handle_Standard_Transient& ChangeFind(const TCollection_AsciiS return ChangeFind(K); } - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const TCollection_AsciiString& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const TCollection_AsciiString& K); +#endif private: - // Methods PRIVATE // Standard_EXPORT GEOM_DataMapOfAsciiStringTransient(const GEOM_DataMapOfAsciiStringTransient& Other); - - - // Fields PRIVATE - // - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 9bb45f6f3..53addff1f 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -522,7 +522,11 @@ bool GEOM_Engine::Save(int theDocID, char* theFileName) bool GEOM_Engine::Load(int theDocID, char* theFileName) { Handle(TDocStd_Document) aDoc; - if(_OCAFApp->Open(theFileName, aDoc) != CDF_RS_OK) { +#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher + if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) { +#else + if (_OCAFApp->Open(theFileName, aDoc) != CDF_RS_OK) { +#endif return false; } @@ -1254,6 +1258,12 @@ void ReplaceVariables(TCollection_AsciiString& theCommand, else aEndParamPos = aSection.Length() + 1; + if(MYDEBUG) + cout<<"aParamIndex: "< -// + #include +#include + #include #include @@ -53,6 +52,11 @@ #include #include +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version +#include +#include +#endif + #include #include #include @@ -276,5 +280,12 @@ void BuildTriangulation(const TopoDS_Face& aF) Standard_True, Standard_False, Standard_True); + +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + TopTools_IndexedDataMapOfShapeListOfShape anAncestors; + TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, anAncestors); + aMesher.Add(aF, anAncestors); +#else aMesher.Add(aF); +#endif } diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx index dc0c5c228..e0ded7c48 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx @@ -95,12 +95,14 @@ #include #include #include +#include static void UpdateCandidates(const Standard_Integer , const Standard_Integer , NMTTools_IndexedDataMapOfIndexedMapOfInteger& ); + //======================================================================= //function : FillImagesFaces //purpose : @@ -153,6 +155,19 @@ static aLSpIn.Clear(); // // 1. In Parts + //modified by NIZNHY-PKV Fri Oct 14 13:58:00 2011f + BOPTools_ListOfPaveBlock aLPBIn; + // + pPF->RealSplitsInFace(nF, aLPBIn); + // + aItPB.Initialize(aLPBIn); + for (; aItPB.More(); aItPB.Next()) { + const BOPTools_PaveBlock& aPB1=aItPB.Value(); + nSpIn=aPB1.Edge(); + const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn); + aLSpIn.Append(aSpIn); + } + /* for (j=1; j<=aNbCBP; ++j) { NMTTools_ListOfCommonBlock& aLCB=aCBP(j); aItCB.Initialize(aLCB); @@ -168,6 +183,8 @@ static } } } + */ + //modified by NIZNHY-PKV Fri Oct 14 13:58:08 2011t // // 2. Section Parts for (j=1; j<=aNbFFs; ++j) { @@ -584,19 +601,73 @@ static // 2. Find Chains NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMC; // - NMTTools_Tools::FindChains(aLCS, aMC); + NMTTools_Tools::FindChains(aLCS, aMC); + // + //modified by NIZNHY-PKV Wed Oct 12 13:33:59 2011f + Standard_Boolean bIsImage; + Standard_Integer aIx, aIxMin, aNbMSDF, k, aNbMFj; + TopoDS_Shape aFOld, aFSDmin; + TopTools_IndexedMapOfShape aMFj; + TopTools_DataMapOfShapeInteger aDMSI; + // + aItF1.Initialize(myShapes); + for (j=1; aItF1.More(); aItF1.Next(), ++j) { + const TopoDS_Shape& aSj=aItF1.Value(); + aMFj.Clear(); + TopExp::MapShapes(aSj, TopAbs_FACE, aMFj); + aNbMFj=aMFj.Extent(); + for (k=1; k<=aNbMFj; ++k) { + const TopoDS_Shape& aFk=aMFj(k); + if (!aDMSI.IsBound(aFk)) { + aDMSI.Bind(aFk, j); + } + } + } + // + //modified by NIZNHY-PKV Wed Oct 12 13:34:01 2011t // // 3. Fill the map of SDF mySameDomainFaces aNbC=aMC.Extent(); for (i=1; i<=aNbC; ++i) { - const TopoDS_Shape& aF=aMC.FindKey(i); + // const TopoDS_Shape& aF=aMC.FindKey(i); const TopTools_IndexedMapOfShape& aMSDF=aMC(i); // + //modified by NIZNHY-PKV Wed Oct 12 13:25:16 2011f + aNbMSDF=aMSDF.Extent(); + for (j=1; j<=aNbMSDF; ++j) { + const TopoDS_Shape& aFSD=aMSDF(j); + bIsImage=mySplitFaces.IsImage(aFSD); + aFOld=aFSD; + if (bIsImage) { + aFOld=mySplitFaces.ImageFrom(aFSD); + } + // + aIx=aDMSI.Find(aFOld); + if (j==1) { + aIxMin=aIx; + aFSDmin=aFSD; + continue; + } + else { + if (aIx #endif + class Standard_DomainError; class Standard_NoSuchObject; class TopoDS_Shape; @@ -39,7 +39,6 @@ class TopTools_OrientedShapeMapHasher; class GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape; class GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape; - #ifndef _Standard_HeaderFile #include #endif @@ -47,108 +46,74 @@ class GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape; #include #endif +#include -class GEOMAlgo_DataMapOfOrientedShapeShape : public TCollection_BasicMap { - +class GEOMAlgo_DataMapOfOrientedShapeShape : 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 GEOMAlgo_DataMapOfOrientedShapeShape(const Standard_Integer NbBuckets = 1); - - -Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape& Assign(const GEOMAlgo_DataMapOfOrientedShapeShape& Other) ; + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + // Methods PUBLIC + // + + Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape(const Standard_Integer NbBuckets = 1); + + Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape& Assign(const GEOMAlgo_DataMapOfOrientedShapeShape& Other) ; GEOMAlgo_DataMapOfOrientedShapeShape& operator =(const GEOMAlgo_DataMapOfOrientedShapeShape& Other) -{ - return Assign(Other); -} - + { + return Assign(Other); + } + Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; -Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + Standard_EXPORT void Clear() ; + ~GEOMAlgo_DataMapOfOrientedShapeShape() + { + Clear(); + } + Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const TopoDS_Shape& I) ; + Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ; -Standard_EXPORT void Clear() ; -~GEOMAlgo_DataMapOfOrientedShapeShape() -{ - Clear(); -} - - - -Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const TopoDS_Shape& I) ; - - -Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const; - - -Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ; - - -Standard_EXPORT const TopoDS_Shape& Find(const TopoDS_Shape& K) const; - const TopoDS_Shape& operator()(const TopoDS_Shape& K) const -{ - return Find(K); -} - + Standard_EXPORT const TopoDS_Shape& Find(const TopoDS_Shape& K) const; + const TopoDS_Shape& operator()(const TopoDS_Shape& K) const + { + return Find(K); + } - -Standard_EXPORT TopoDS_Shape& ChangeFind(const TopoDS_Shape& K) ; + Standard_EXPORT TopoDS_Shape& ChangeFind(const TopoDS_Shape& K) ; TopoDS_Shape& operator()(const TopoDS_Shape& K) -{ - return ChangeFind(K); -} - - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // + { + return ChangeFind(K); + } +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const TopoDS_Shape& K); +#endif private: // Methods PRIVATE // - - Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape(const GEOMAlgo_DataMapOfOrientedShapeShape& Other); - - // Fields PRIVATE - // - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx index 28b15ece2..228cbfa64 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile #define _GEOMAlgo_DataMapOfPassKeyInteger_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class GEOMAlgo_PassKey; @@ -42,7 +42,6 @@ class GEOMAlgo_PassKeyMapHasher; class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger; class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger; #include #endif +#include class GEOMAlgo_DataMapOfPassKeyInteger : public TCollection_BasicMap { @@ -67,91 +67,56 @@ public: { if (anAddress) Standard::Free((Standard_Address&)anAddress); } + // Methods PUBLIC // - Standard_EXPORT GEOMAlgo_DataMapOfPassKeyInteger(const Standard_Integer NbBuckets = 1); - Standard_EXPORT GEOMAlgo_DataMapOfPassKeyInteger& Assign(const GEOMAlgo_DataMapOfPassKeyInteger& Other) ; GEOMAlgo_DataMapOfPassKeyInteger& operator =(const GEOMAlgo_DataMapOfPassKeyInteger& Other) { return Assign(Other); } - - Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; - Standard_EXPORT void Clear() ; ~GEOMAlgo_DataMapOfPassKeyInteger() { Clear(); } - - Standard_EXPORT Standard_Boolean Bind(const GEOMAlgo_PassKey& K,const Standard_Integer& I) ; - - Standard_EXPORT Standard_Boolean IsBound(const GEOMAlgo_PassKey& K) const; - - Standard_EXPORT Standard_Boolean UnBind(const GEOMAlgo_PassKey& K) ; - Standard_EXPORT const Standard_Integer& Find(const GEOMAlgo_PassKey& K) const; const Standard_Integer& operator()(const GEOMAlgo_PassKey& K) const { return Find(K); } - - Standard_EXPORT Standard_Integer& ChangeFind(const GEOMAlgo_PassKey& K) ; Standard_Integer& operator()(const GEOMAlgo_PassKey& K) { return ChangeFind(K); } - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const GEOMAlgo_PassKey& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const GEOMAlgo_PassKey& K); +#endif private: // Methods PRIVATE // - - Standard_EXPORT GEOMAlgo_DataMapOfPassKeyInteger(const GEOMAlgo_DataMapOfPassKeyInteger& Other); - - // Fields PRIVATE - // - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyShapeShape.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyShapeShape.hxx index 649c8e44c..651f1c7ee 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyShapeShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyShapeShape.hxx @@ -15,7 +15,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile #define _GEOMAlgo_DataMapOfPassKeyShapeShape_HeaderFile @@ -32,6 +31,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class GEOMAlgo_PassKeyShape; @@ -40,7 +40,6 @@ class GEOMAlgo_PassKeyShapeMapHasher; class GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape; class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape; - #ifndef _Standard_HeaderFile #include #endif @@ -48,6 +47,7 @@ class GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape; #include #endif +#include class GEOMAlgo_DataMapOfPassKeyShapeShape : public TCollection_BasicMap { @@ -65,91 +65,56 @@ public: { if (anAddress) Standard::Free((Standard_Address&)anAddress); } + // Methods PUBLIC // - Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape(const Standard_Integer NbBuckets = 1); - Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape& Assign(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other) ; GEOMAlgo_DataMapOfPassKeyShapeShape& operator =(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other) { return Assign(Other); } - - Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; - Standard_EXPORT void Clear() ; ~GEOMAlgo_DataMapOfPassKeyShapeShape() { Clear(); } - - Standard_EXPORT Standard_Boolean Bind(const GEOMAlgo_PassKeyShape& K,const TopoDS_Shape& I) ; - - Standard_EXPORT Standard_Boolean IsBound(const GEOMAlgo_PassKeyShape& K) const; - - Standard_EXPORT Standard_Boolean UnBind(const GEOMAlgo_PassKeyShape& K) ; - Standard_EXPORT const TopoDS_Shape& Find(const GEOMAlgo_PassKeyShape& K) const; const TopoDS_Shape& operator()(const GEOMAlgo_PassKeyShape& K) const { return Find(K); } - - Standard_EXPORT TopoDS_Shape& ChangeFind(const GEOMAlgo_PassKeyShape& K) ; TopoDS_Shape& operator()(const GEOMAlgo_PassKeyShape& K) { return ChangeFind(K); } - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const GEOMAlgo_PassKeyShape& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const GEOMAlgo_PassKeyShape& K); +#endif private: // Methods PRIVATE - // - - -Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other); - - - // Fields PRIVATE // - +Standard_EXPORT GEOMAlgo_DataMapOfPassKeyShapeShape(const GEOMAlgo_DataMapOfPassKeyShapeShape& Other); }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape.hxx index d29a97714..2c539bf80 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfRealListOfShape.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_DataMapOfRealListOfShape_HeaderFile #define _GEOMAlgo_DataMapOfRealListOfShape_HeaderFile @@ -38,6 +37,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class TopTools_ListOfShape; @@ -45,7 +45,6 @@ class TColStd_MapRealHasher; class GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape; class GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape; - #ifndef _Standard_HeaderFile #include #endif @@ -53,6 +52,7 @@ class GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape; #include #endif +#include class GEOMAlgo_DataMapOfRealListOfShape : public TCollection_BasicMap { @@ -83,8 +83,6 @@ Standard_EXPORT GEOMAlgo_DataMapOfRealListOfShape& Assign(const GEOMAlgo_DataM return Assign(Other); } - - Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; @@ -94,67 +92,36 @@ Standard_EXPORT void Clear() ; Clear(); } - - Standard_EXPORT Standard_Boolean Bind(const Standard_Real& K,const TopTools_ListOfShape& I) ; - - Standard_EXPORT Standard_Boolean IsBound(const Standard_Real& K) const; - - Standard_EXPORT Standard_Boolean UnBind(const Standard_Real& K) ; - Standard_EXPORT const TopTools_ListOfShape& Find(const Standard_Real& K) const; const TopTools_ListOfShape& operator()(const Standard_Real& K) const { return Find(K); } - - Standard_EXPORT TopTools_ListOfShape& ChangeFind(const Standard_Real& K) ; TopTools_ListOfShape& operator()(const Standard_Real& K) { return ChangeFind(K); } - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const Standard_Real& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const Standard_Real& K); +#endif private: // Methods PRIVATE // - - Standard_EXPORT GEOMAlgo_DataMapOfRealListOfShape(const GEOMAlgo_DataMapOfRealListOfShape& Other); - - // Fields PRIVATE - // - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx index f1e56991c..228278e5e 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx @@ -41,6 +41,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class TopoDS_Shape; @@ -49,7 +50,7 @@ class TopTools_ShapeMapHasher; class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape; class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape; - +#include class GEOMAlgo_DataMapOfShapeMapOfShape : public TCollection_BasicMap { public: @@ -102,31 +103,17 @@ public: return ChangeFind(K); } - - - - -protected: - - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const TopoDS_Shape& K); +#endif private: - Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape(const GEOMAlgo_DataMapOfShapeMapOfShape& Other); - - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx index 23cb455c6..aca9d89e2 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx @@ -41,6 +41,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class TopoDS_Shape; @@ -49,7 +50,7 @@ class TopTools_ShapeMapHasher; class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt; class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt; - +#include class GEOMAlgo_DataMapOfShapePnt : public TCollection_BasicMap { public: @@ -102,31 +103,17 @@ public: return ChangeFind(K); } - - - - -protected: - - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const TopoDS_Shape& K); +#endif private: - Standard_EXPORT GEOMAlgo_DataMapOfShapePnt(const GEOMAlgo_DataMapOfShapePnt& Other); - - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal.hxx index d3e387c20..fa8ebbf95 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeReal.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_DataMapOfShapeReal_HeaderFile #define _GEOMAlgo_DataMapOfShapeReal_HeaderFile @@ -38,6 +37,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class TopoDS_Shape; @@ -45,7 +45,6 @@ class TopTools_ShapeMapHasher; class GEOMAlgo_DataMapNodeOfDataMapOfShapeReal; class GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal; - #ifndef _Standard_HeaderFile #include #endif @@ -53,6 +52,7 @@ class GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal; #include #endif +#include class GEOMAlgo_DataMapOfShapeReal : public TCollection_BasicMap { @@ -119,20 +119,10 @@ Standard_EXPORT Standard_Real& ChangeFind(const TopoDS_Shape& K) ; return ChangeFind(K); } - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const TopoDS_Shape& K); +#endif private: @@ -149,10 +139,6 @@ Standard_EXPORT GEOMAlgo_DataMapOfShapeReal(const GEOMAlgo_DataMapOfShapeReal& O }; - - - - // other Inline functions and methods (like "C++: function call" methods) // diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet.hxx index 3eb0a24b7..dd9e6aff6 100644 --- a/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet.hxx +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfShapeShapeSet.hxx @@ -50,6 +50,8 @@ class GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet; #include #endif +#include + class GEOMAlgo_DataMapOfShapeShapeSet : public TCollection_BasicMap { public: @@ -102,6 +104,11 @@ public: return ChangeFind(K); } +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const TopoDS_Shape& K); +#endif + private: Standard_EXPORT GEOMAlgo_DataMapOfShapeShapeSet(const GEOMAlgo_DataMapOfShapeShapeSet& Other); }; diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx index 066e6a006..c0f0ac711 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx @@ -18,15 +18,19 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: GEOMAlgo_FinderShapeOn.cxx // Created: Tue Jan 11 14:44:31 2005 // Author: Peter KURNEV -// -// + #include +#include + +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version +#include +#endif + #include #include @@ -383,7 +387,11 @@ void GEOMAlgo_FinderShapeOn::MakeArgument1() // // Argument 1 if (!myIsAnalytic) { +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + aMF.Init(mySurface, Standard_True, Precision::Confusion()); +#else aMF.Init(mySurface, Standard_True); +#endif aFErr=aMF.Error(); if (aFErr!=BRepLib_FaceDone) { myErrorStatus=20; // can not build the face diff --git a/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx b/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx index 9220a21b3..014a452af 100644 --- a/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx @@ -18,9 +18,8 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + // File: GEOMAlgo_GetInPlace_1.cxx -// Created: // Author: Peter KURNEV #include @@ -91,9 +90,9 @@ static Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1, const TopoDS_Shape& aS2) { - Standard_Boolean bOk, bIsDone; + Standard_Boolean bOk; Standard_Integer iErr; - Standard_Real aTol2, aD2; + Standard_Real aTol2; TopAbs_ShapeEnum aType1, aType2; TopAbs_State aState; gp_Pnt aP1, aP2; diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx index 1f28cc809..9c50281a6 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_IndexedDataMapOfIntegerShape_HeaderFile #define _GEOMAlgo_IndexedDataMapOfIntegerShape_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -42,7 +42,6 @@ class TopoDS_Shape; class TColStd_MapIntegerHasher; class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape; #include #endif +#include class GEOMAlgo_IndexedDataMapOfIntegerShape : public TCollection_BasicMap { @@ -67,106 +67,65 @@ public: { if (anAddress) Standard::Free((Standard_Address&)anAddress); } + // Methods PUBLIC // - Standard_EXPORT GEOMAlgo_IndexedDataMapOfIntegerShape(const Standard_Integer NbBuckets = 1); - Standard_EXPORT GEOMAlgo_IndexedDataMapOfIntegerShape& Assign(const GEOMAlgo_IndexedDataMapOfIntegerShape& Other) ; GEOMAlgo_IndexedDataMapOfIntegerShape& operator =(const GEOMAlgo_IndexedDataMapOfIntegerShape& Other) { return Assign(Other); } - - Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; - Standard_EXPORT void Clear() ; ~GEOMAlgo_IndexedDataMapOfIntegerShape() { Clear(); } - - Standard_EXPORT Standard_Integer Add(const Standard_Integer& K,const TopoDS_Shape& I) ; - Standard_EXPORT void Substitute(const Standard_Integer I,const Standard_Integer& K,const TopoDS_Shape& T) ; - Standard_EXPORT void RemoveLast() ; - Standard_EXPORT Standard_Boolean Contains(const Standard_Integer& K) const; - Standard_EXPORT const Standard_Integer& FindKey(const Standard_Integer I) const; - Standard_EXPORT const TopoDS_Shape& FindFromIndex(const Standard_Integer I) const; const TopoDS_Shape& operator ()(const Standard_Integer I) const { return FindFromIndex(I); } - - Standard_EXPORT TopoDS_Shape& ChangeFromIndex(const Standard_Integer I) ; TopoDS_Shape& operator ()(const Standard_Integer I) { return ChangeFromIndex(I); } - - Standard_EXPORT Standard_Integer FindIndex(const Standard_Integer& K) const; - Standard_EXPORT const TopoDS_Shape& FindFromKey(const Standard_Integer& K) const; - - Standard_EXPORT TopoDS_Shape& ChangeFromKey(const Standard_Integer& K) ; +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const Standard_Integer& K); +#endif - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - - -private: - +private: // Methods PRIVATE - // - - -Standard_EXPORT GEOMAlgo_IndexedDataMapOfIntegerShape(const GEOMAlgo_IndexedDataMapOfIntegerShape& Other); - - - // Fields PRIVATE // - - +Standard_EXPORT GEOMAlgo_IndexedDataMapOfIntegerShape(const GEOMAlgo_IndexedDataMapOfIntegerShape& Other); }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx index f6931ace7..38ebe7c49 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_HeaderFile #define _GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_HeaderFile @@ -51,6 +50,8 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape; #include #endif +#include + class GEOMAlgo_IndexedDataMapOfPassKeyListOfShape : public TCollection_BasicMap { public: @@ -104,6 +105,10 @@ Standard_EXPORT Standard_Integer FindIndex(const GEOMAlgo_PassKey& K) const; Standard_EXPORT const TopTools_ListOfShape& FindFromKey(const GEOMAlgo_PassKey& K) const; Standard_EXPORT TopTools_ListOfShape& ChangeFromKey(const GEOMAlgo_PassKey& K) ; +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const GEOMAlgo_PassKey& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const GEOMAlgo_PassKey& K); +#endif diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx index abc59d33a..63a181686 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile #define _GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile @@ -51,6 +50,7 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape; #include #endif +#include class GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape : public TCollection_BasicMap { @@ -133,9 +133,10 @@ Standard_EXPORT const TopTools_ListOfShape& FindFromKey(const GEOMAlgo_PassKeyS Standard_EXPORT TopTools_ListOfShape& ChangeFromKey(const GEOMAlgo_PassKeyShape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const GEOMAlgo_PassKeyShape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const GEOMAlgo_PassKeyShape& K); +#endif protected: diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeBox.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeBox.hxx index d2e9de147..2b4f692b2 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeBox.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeBox.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_IndexedDataMapOfShapeBox_HeaderFile #define _GEOMAlgo_IndexedDataMapOfShapeBox_HeaderFile @@ -51,6 +50,7 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox; #include #endif +#include class GEOMAlgo_IndexedDataMapOfShapeBox : public TCollection_BasicMap { @@ -129,13 +129,12 @@ Standard_EXPORT Standard_Integer FindIndex(const TopoDS_Shape& K) const; Standard_EXPORT const Bnd_Box& FindFromKey(const TopoDS_Shape& K) const; - - Standard_EXPORT Bnd_Box& ChangeFromKey(const TopoDS_Shape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif protected: diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx index 37bd9a054..25aa6f527 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx @@ -15,7 +15,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile #define _GEOMAlgo_IndexedDataMapOfShapeShapeInfo_HeaderFile @@ -48,6 +47,7 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo; #include #endif +#include class GEOMAlgo_IndexedDataMapOfShapeShapeInfo : public TCollection_BasicMap { @@ -130,9 +130,10 @@ Standard_EXPORT const GEOMAlgo_ShapeInfo& FindFromKey(const TopoDS_Shape& K) co Standard_EXPORT GEOMAlgo_ShapeInfo& ChangeFromKey(const TopoDS_Shape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif protected: diff --git a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeState.hxx b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeState.hxx index bf2405e26..a8dde9077 100644 --- a/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeState.hxx +++ b/src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeState.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile #define _GEOMAlgo_IndexedDataMapOfShapeState_HeaderFile @@ -53,6 +52,7 @@ class GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState; #include #endif +#include class GEOMAlgo_IndexedDataMapOfShapeState : public TCollection_BasicMap { @@ -131,13 +131,12 @@ Standard_EXPORT Standard_Integer FindIndex(const TopoDS_Shape& K) const; Standard_EXPORT const TopAbs_State& FindFromKey(const TopoDS_Shape& K) const; - - Standard_EXPORT TopAbs_State& ChangeFromKey(const TopoDS_Shape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif protected: diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 8f3ef0cd9..ca2b6c92f 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -90,6 +90,8 @@ #include +#include + // VTK Includes #include #include @@ -322,6 +324,17 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st ) myToActivate = true; // This parameter is used for activisation/deactivisation of objects to be displayed + + #if OCC_VERSION_LARGE > 0x06050100 // Functionnality available only in OCCT 6.5.2 + // Activate parallel vizualisation only for testing purpose + // and if the corresponding env variable is set to 1 + char* parallel_visu = getenv("PARALLEL_VISU"); + if (parallel_visu && atoi(parallel_visu)) + { + MESSAGE("Parallel visualisation on"); + BRepMesh_IncrementalMesh::SetParallelDefault(Standard_True); + } + #endif myViewFrame = 0; } diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 5342658ac..efe2dd7e5 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -2375,7 +2375,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau MEN_GROUP_CREATE - Créer une groupe + Créer un groupe MEN_GROUP_EDIT diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 0cb7c95c2..d15bec532 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -109,7 +109,7 @@ extern "C" { } Standard_EXPORT char* getModuleVersion() { - return GEOM_VERSION_STR; + return (char*)GEOM_VERSION_STR; } } diff --git a/src/GEOMImpl/GEOMImpl_ArchimedeDriver.cxx b/src/GEOMImpl/GEOMImpl_ArchimedeDriver.cxx index 4646927a0..3be550a49 100644 --- a/src/GEOMImpl/GEOMImpl_ArchimedeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ArchimedeDriver.cxx @@ -18,7 +18,6 @@ // 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 "GEOMImpl_ArchimedeDriver.hxx" #include "GEOMImpl_IArchimede.hxx" @@ -26,6 +25,8 @@ #include "Archimede_VolumeSection.hxx" +#include + #include #include @@ -128,7 +129,11 @@ Standard_Integer GEOMImpl_ArchimedeDriver::Execute(TFunction_Logbook& log) const Standard_Real u1,u2,v1,v2; SurfaceTrimmee->Bounds(u1,u2,v1,v2); +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + TopoDS_Face tirant = BRepBuilderAPI_MakeFace(SurfaceTrimmee, u1, u2, v1, v2, Precision::Confusion()); +#else TopoDS_Face tirant = BRepBuilderAPI_MakeFace(SurfaceTrimmee, u1, u2, v1, v2); +#endif if (tirant.IsNull()) { StdFail_NotDone::Raise("Failed to build secant face"); @@ -182,7 +187,5 @@ const Handle(GEOMImpl_ArchimedeDriver) Handle(GEOMImpl_ArchimedeDriver)::DownCas } } - return _anOtherObject ; + return _anOtherObject; } - - diff --git a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx index 1c025ce33..5c2c96882 100644 --- a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx @@ -373,6 +373,11 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const // we obtain BSpline curve of degree 1 (C0), which is slowly // processed by some algorithms (Partition for example). BO.Approximation(Standard_True); + //modified by NIZNHY-PKV Tue Oct 18 14:34:16 2011f + BO.ComputePCurveOn1(Standard_True); + BO.ComputePCurveOn2(Standard_True); + //modified by NIZNHY-PKV Tue Oct 18 14:34:18 2011t + BO.Build(); if (!BO.IsDone()) { StdFail_NotDone::Raise("Section operation can not be performed on the given shapes"); diff --git a/src/GEOMImpl/GEOMImpl_BoxDriver.cxx b/src/GEOMImpl/GEOMImpl_BoxDriver.cxx index 9db586cb0..d150a3e85 100644 --- a/src/GEOMImpl/GEOMImpl_BoxDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BoxDriver.cxx @@ -37,6 +37,10 @@ #include +#include + +#include + //======================================================================= //function : GetID //purpose : @@ -89,8 +93,10 @@ Standard_Integer GEOMImpl_BoxDriver::Execute(TFunction_Logbook& log) const gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1)); gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2)); - if (P1.X() == P2.X() || P1.Y() == P2.Y() || P1.Z() == P2.Z()) { - StdFail_NotDone::Raise("Box can not be created, the points belong to the same plane"); + if (std::abs(P1.X() - P2.X()) < Precision::Confusion() || + std::abs(P1.Y() - P2.Y()) < Precision::Confusion() || + std::abs(P1.Z() - P2.Z()) < Precision::Confusion() ) { + StdFail_NotDone::Raise("Box can not be created, the points belong both to one of the OXY, OYZ or OZX planes"); return 0; } diff --git a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx index 8d601ccc9..b06c44ae7 100644 --- a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx @@ -18,28 +18,32 @@ // 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 #include -#include #include #include +#include + +#include + +#include + #include #include -#include #include +#include #include #include +#include #include -#include #include #include +#include #include -#include #include #include @@ -48,25 +52,22 @@ #include #include #include +#include #include #include #include #include - -#include -#include - -#include -#include #include -#include #include +#include + #include #include -//#include +#include +#include //======================================================================= //function : GetID @@ -78,7 +79,6 @@ const Standard_GUID& GEOMImpl_FillingDriver::GetID() return aFillingDriver; } - //======================================================================= //function : GEOMImpl_FillingDriver //purpose : @@ -290,7 +290,11 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const App.SurfUMults(), App.SurfVMults(), App.UDegree(), App.VDegree()); if (GBS.IsNull()) return 0; +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + aShape = BRepBuilderAPI_MakeFace(GBS, Precision::Confusion()); +#else aShape = BRepBuilderAPI_MakeFace(GBS); +#endif } else { // implemented by skl 20.03.2008 for bug 16568 @@ -349,7 +353,11 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const } GeomAPI_PointsToBSplineSurface PTB(Points,mindeg,maxdeg,GeomAbs_C2,tol3d); Handle(Geom_BSplineSurface) BS = PTB.Surface(); - BRepBuilderAPI_MakeFace BB(BS); +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + BRepBuilderAPI_MakeFace BB (BS, Precision::Confusion()); +#else + BRepBuilderAPI_MakeFace BB (BS); +#endif TopoDS_Face NewF = BB.Face(); Handle(ShapeFix_Face) sff = new ShapeFix_Face(NewF); sff->Perform(); diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index 0cbce375b..265a35f6c 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include @@ -819,18 +821,30 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_ if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed - //Add the function - aFunction = theObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION); + if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066 + //Add the function + aFunction = theObject->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_REVERSE); - if (aFunction.IsNull()) - return NULL; + //Check if the function is set correctly + if (aFunction.IsNull()) return NULL; + if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL; - //Check if the function is set correctly - if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + // prepare "data container" class IVector + GEOMImpl_IVector aVI (aFunction); + aVI.SetCurve(aLastFunction); + } + else { + //Add the function + aFunction = theObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION); - // prepare "data container" class IHealing - GEOMImpl_IHealing HI(aFunction); - HI.SetOriginal( aLastFunction ); + //Check if the function is set correctly + if (aFunction.IsNull()) return NULL; + if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + + // prepare "data container" class IHealing + GEOMImpl_IHealing HI (aFunction); + HI.SetOriginal(aLastFunction); + } //Compute the translation try { @@ -874,22 +888,34 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G return NULL; //There is no function which creates an object to be processed // Add a new object - Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), theObject->GetType() ); + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType()); - //Add the function - aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION); + if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066 + //Add the function + aFunction = aNewObject->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_REVERSE); - if (aFunction.IsNull()) - return NULL; + //Check if the function is set correctly + if (aFunction.IsNull()) return NULL; + if (aFunction->GetDriverGUID() != GEOMImpl_VectorDriver::GetID()) return NULL; - //Check if the function is set correctly - if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + // prepare "data container" class IVector + GEOMImpl_IVector aVI (aFunction); + aVI.SetCurve(aLastFunction); + } + else { + //Add the function + aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CHANGE_ORIENTATION); - // prepare "data container" class IHealing - GEOMImpl_IHealing HI(aFunction); - HI.SetOriginal( aLastFunction ); + //Check if the function is set correctly + if (aFunction.IsNull()) return NULL; + if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; - //Compute the translation + // prepare "data container" class IHealing + GEOMImpl_IHealing aHI (aFunction); + aHI.SetOriginal(aLastFunction); + } + + // Compute the result try { #if OCC_VERSION_LARGE > 0x06010000 OCC_CATCH_SIGNALS; diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 5ca5029fb..f74e646e4 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -40,6 +40,9 @@ #include "GEOMImpl_IGlue.hxx" #include "GEOMImpl_Block6Explorer.hxx" +#include "GEOMImpl_IHealingOperations.hxx" + +#include #include "GEOM_Function.hxx" #include "GEOM_ISubShape.hxx" @@ -1774,6 +1777,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) if (theShape.IsNull()) return NULL; + /* //Add a new reversed object Handle(GEOM_Object) aReversed = GetEngine()->AddObject(GetDocID(), theShape->GetType()); @@ -1813,6 +1817,21 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::ReverseShape(Handle(GEOM_Object) << " = geompy.ChangeOrientation(" << theShape << ")"; SetErrorCode(OK); + */ + + Handle(GEOM_Object) aReversed; + + GEOM_Engine* anEngine = GetEngine(); + //GEOMImpl_Gen* aGen = dynamic_cast(anEngine); + GEOMImpl_Gen* aGen = (GEOMImpl_Gen*)anEngine; + + if (aGen) { + GEOMImpl_IHealingOperations* anIHealingOperations = + aGen->GetIHealingOperations(GetDocID()); + aReversed = anIHealingOperations->ChangeOrientationCopy(theShape); + SetErrorCode(anIHealingOperations->GetErrorCode()); + } + return aReversed; } diff --git a/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx b/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx index cc4a07a85..6549eb316 100644 --- a/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PlaneDriver.cxx @@ -18,7 +18,6 @@ // 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 @@ -29,6 +28,8 @@ #include +#include + // OCCT Includes #include #include @@ -125,7 +126,12 @@ Standard_Integer GEOMImpl_PlaneDriver::Execute(TFunction_Logbook& log) const if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular())) Standard_ConstructionError::Raise("Plane creation aborted: points lay on one line"); GC_MakePlane aMakePlane (aP1, aP2, aP3); +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + aShape = BRepBuilderAPI_MakeFace(aMakePlane, -aSize, +aSize, -aSize, +aSize, + Precision::Confusion()).Shape(); +#else aShape = BRepBuilderAPI_MakeFace(aMakePlane, -aSize, +aSize, -aSize, +aSize).Shape(); +#endif } else if (aType == PLANE_FACE) { Handle(GEOM_Function) aRef = aPI.GetFace(); TopoDS_Shape aRefShape = aRef->GetValue(); diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index f254c2a0c..332d11769 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -18,7 +18,6 @@ // 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 @@ -449,6 +448,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aShape = C; } + /* else if (aType == REVERSE_ORIENTATION) { Handle(GEOM_Function) aRefShape = aCI.GetBase(); TopoDS_Shape aShape_i = aRefShape->GetValue(); @@ -471,6 +471,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aShape = tds; } } + */ else if (aType == EDGE_WIRE) { Handle(GEOM_Function) aRefBase = aCI.GetBase(); TopoDS_Shape aWire = aRefBase->GetValue(); diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 66b6f5372..9359db7a3 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -18,9 +18,9 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -//GEOM_Object types + +// GEOM_Object types #define GEOM_COPY 0 #define GEOM_IMPORT 1 @@ -113,11 +113,11 @@ #define POINT_SURFACE_COORD 7 #define POINT_CURVE_LENGTH 8 +// Vector #define VECTOR_TWO_PNT 1 #define VECTOR_DX_DY_DZ 2 #define VECTOR_TANGENT_CURVE_PAR 3 -#define VECTOR_FACE_NORMALE 4 -#define VERTEX_BY_INDEX 5 +#define VECTOR_REVERSE 4 #define PLANE_PNT_VEC 1 #define PLANE_FACE 2 @@ -222,15 +222,16 @@ #define POLYLINE_POINTS 1 +#define SPLINE_BEZIER 1 +#define SPLINE_INTERPOLATION 2 + #define CIRCLE_THREE_PNT 1 #define CIRCLE_PNT_VEC_R 2 #define CIRCLE_CENTER_TWO_PNT 3 -#define SPLINE_BEZIER 1 -#define SPLINE_INTERPOLATION 2 - #define ELLIPSE_PNT_VEC_RR 1 +// Arc #define CIRC_ARC_THREE_PNT 1 #define CIRC_ARC_CENTER 2 #define ELLIPSE_ARC_CENTER_TWO_PNT 3 @@ -252,6 +253,7 @@ #define CHAMFER_SHAPE_FACES_AD 6 #define CHAMFER_SHAPE_EDGES_AD 7 +// Shape creation #define WIRE_EDGES 1 #define FACE_WIRE 2 #define SHELL_FACES 3 @@ -261,7 +263,7 @@ #define SUBSHAPE_SORTED 7 #define SUBSHAPE_NOT_SORTED 8 #define FACE_WIRES 9 -#define REVERSE_ORIENTATION 10 +//#define REVERSE_ORIENTATION 10 #define EDGE_WIRE 11 #define EDGE_CURVE_LENGTH 12 @@ -288,13 +290,16 @@ #define SKETCHER_NINE_DOUBLS 1 #define SKETCHER_PLANE 2 +// Measures #define CDG_MEASURE 1 +#define VECTOR_FACE_NORMALE 4 +#define VERTEX_BY_INDEX 5 #define GROUP_FUNCTION 1 #define SHAPES_ON_SHAPE 1 -//Curve constructor type +// Curve constructor type #define POINT_CONSTRUCTOR 0 #define COORD_CONSTRUCTOR 1 diff --git a/src/GEOMImpl/GEOMImpl_VectorDriver.cxx b/src/GEOMImpl/GEOMImpl_VectorDriver.cxx index 8df2928f0..df75e4241 100644 --- a/src/GEOMImpl/GEOMImpl_VectorDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_VectorDriver.cxx @@ -18,7 +18,6 @@ // 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 @@ -31,7 +30,9 @@ #include #include +#include #include +#include #include #include @@ -72,7 +73,8 @@ Standard_Integer GEOMImpl_VectorDriver::Execute(TFunction_Logbook& log) const GEOMImpl_IVector aPI (aFunction); Standard_Integer aType = aFunction->GetType(); - if (aType != VECTOR_DX_DY_DZ && aType != VECTOR_TWO_PNT && aType != VECTOR_TANGENT_CURVE_PAR) return 0; + if (aType != VECTOR_DX_DY_DZ && aType != VECTOR_TWO_PNT && + aType != VECTOR_TANGENT_CURVE_PAR && aType != VECTOR_REVERSE) return 0; TopoDS_Shape aShape; @@ -85,7 +87,8 @@ Standard_Integer GEOMImpl_VectorDriver::Execute(TFunction_Logbook& log) const Standard_ConstructionError::Raise(aMsg.ToCString()); } aShape = BRepBuilderAPI_MakeEdge(P1, P2).Shape(); - } else if (aType == VECTOR_TWO_PNT) { + } + else if (aType == VECTOR_TWO_PNT) { Handle(GEOM_Function) aRefPnt1 = aPI.GetPoint1(); Handle(GEOM_Function) aRefPnt2 = aPI.GetPoint2(); TopoDS_Shape aShape1 = aRefPnt1->GetValue(); @@ -104,7 +107,7 @@ Standard_Integer GEOMImpl_VectorDriver::Execute(TFunction_Logbook& log) const } aShape = BRepBuilderAPI_MakeEdge(V1, V2).Shape(); } - else if(aType == VECTOR_TANGENT_CURVE_PAR) { + else if (aType == VECTOR_TANGENT_CURVE_PAR) { Handle(GEOM_Function) aRefCurve = aPI.GetCurve(); TopoDS_Shape aRefShape = aRefCurve->GetValue(); if (aRefShape.ShapeType() != TopAbs_EDGE) { @@ -130,6 +133,18 @@ Standard_Integer GEOMImpl_VectorDriver::Execute(TFunction_Logbook& log) const if(aBuilder.IsDone()) aShape = aBuilder.Shape(); } + else if (aType == VECTOR_REVERSE) { + Handle(GEOM_Function) aRefVec = aPI.GetCurve(); + TopoDS_Shape aRefShape = aRefVec->GetValue(); + if (aRefShape.ShapeType() != TopAbs_EDGE) { + Standard_TypeMismatch::Raise + ("Reversed vector creation aborted : vector shape is not an edge"); + } + TopoDS_Edge anE = TopoDS::Edge(aRefShape); + TopoDS_Vertex V1, V2; + TopExp::Vertices(anE, V1, V2, Standard_True); + aShape = BRepBuilderAPI_MakeEdge(V2, V1).Shape(); + } if (aShape.IsNull()) return 0; @@ -181,5 +196,5 @@ const Handle(GEOMImpl_VectorDriver) Handle(GEOMImpl_VectorDriver)::DownCast } } - return _anOtherObject ; + return _anOtherObject; } diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py index 23642ced0..27fc960e5 100644 --- a/src/GEOM_PY/geomtools.py +++ b/src/GEOM_PY/geomtools.py @@ -31,6 +31,11 @@ from salome.kernel import termcolor logger = Logger("salome.geom.geomtools", color = termcolor.RED) from salome.kernel.studyedit import getActiveStudyId, getStudyEditor +from salome.kernel.services import IDToObject +try: + from salome.gui import helper +except ImportError: + pass _geompys = {} @@ -61,6 +66,10 @@ def getGeompy(studyId = None): return _geompys[studyId] +ModeWireFrame = 0 +ModeShading = 1 +DisplayMode=ModeShading + class GeomStudyTools: """ This class provides several methods to manipulate geom objects in Salome @@ -82,7 +91,7 @@ class GeomStudyTools: if GEOM is None: GEOM = __import__("GEOM") if studyEditor is None: - studyEditor = getStudyEditor() + studyEditor = helper.getStudyEditor() self.editor = studyEditor def displayShapeByName(self, shapeName, color = None): @@ -108,8 +117,60 @@ class GeomStudyTools: if shape: geomgui = salome.ImportComponentGUI("GEOM") geomgui.createAndDisplayGO(entry) - geomgui.setDisplayMode(entry, 1) + geomgui.setDisplayMode(entry, DisplayMode) if color is not None: geomgui.setColor(entry, color[0], color[1], color[2]) return True return False + + def getGeomObjectSelected(self): + ''' + Returns the GEOM object currently selected in the objects browser. + ''' + sobject, entry = helper.getSObjectSelected() + geomObject = self.getGeomObjectFromEntry(entry) + return geomObject + + def getGeomObjectFromEntry(self,entry): + ''' + Returns the GEOM object associated to the specified entry, + (the entry is the identifier of an item in the active study) + ''' + if entry is None: + return None + geomObject=IDToObject(entry, self.editor.study) + return geomObject._narrow(GEOM.GEOM_Object) + +# +# ================================================================== +# Use cases and demo functions +# ================================================================== +# + +# How to test? +# 1. Run a SALOME application including GEOM, and create a new study +# 2. In the console, enter: +# >>> from salome.geom import geomtools +# >>> geomtools.TEST_createBox() +# 3. Select the object named "box" in the browser +# 4. In the console, enter: +# >>> geomtools.TEST_getGeomObjectSelected() + +def TEST_createBox(): + geompy = getGeompy() + box = geompy.MakeBoxDXDYDZ(200, 200, 200) + geompy.addToStudy( box, 'box' ) + if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) + + +def TEST_getGeomObjectSelected(): + tool = GeomStudyTools() + myGeomObject = tool.getGeomObjectSelected() + print myGeomObject + +if __name__ == "__main__": + TEST_getGeomObjectSelected() + + + diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index b9601a857..983773905 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -3683,7 +3683,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## Get a vertex subshape by index depended with orientation. # @param theShape Shape to find subshape. - # @param theIndex Index to find vertex by this index. + # @param theIndex Index to find vertex by this index (starting from zero) # @return New GEOM_Object, containing the created vertex. # # @ref tui_measurement_tools_page "Example" diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index 2fdb36e9f..4cc1e2cb5 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -617,11 +617,14 @@ void GroupGUI_GroupDlg::showOnlySelected() GEOM_Displayer* aDisplayer = getDisplayer(); if (send == myHideSelBtn) { - aDisplayer->Erase(aSelList, false, true); + aDisplayer->Erase(aSelList, /*forced=*/false, /*updateViewer=*/true); } else { - aDisplayer->EraseAll(); + aDisplayer->EraseAll(/*forced = false, updateViewer = true*/); aDisplayer->Display(aSelList, true); + + // for the case when selected ids were not displayed in the viewer: Mantis issue 0021367 + highlightSubShapes(); } } @@ -851,6 +854,7 @@ void GroupGUI_GroupDlg::activateSelection() SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView); if (aPrs) { displayPreview(aPrs, true, false); // append, do not update + // TODO: map or delete Prs } } } @@ -959,16 +963,17 @@ void GroupGUI_GroupDlg::highlightSubShapes() SALOME_View* aView = dynamic_cast(aViewModel); if (aView == 0) return; - // TODO: use here GEOMBase_Helper::myPreview instead of ic->DisplayedObjects() + // TODO??: use here GEOMBase_Helper::myPreview instead of ic->DisplayedObjects() OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)aViewManager)->getOCCViewer(); Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); AIS_ListOfInteractive List; - ic->DisplayedObjects(List); + //ic->DisplayedObjects(List); + ic->ObjectsInside(List); // Mantis issue 0021367 SALOME_ListIO aSelList; - // To highlight the selected subshape in Object Browser, if it's already pudlished under the main shape + // To highlight the selected subshape in Object Browser, if it's already published under the main shape GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId()); QMap childsMap; SalomeApp_Study* appStudy = dynamic_cast(app->activeStudy()); diff --git a/src/IGESExport/IGESExport.cxx b/src/IGESExport/IGESExport.cxx index 897a1eedc..12cf1e1a8 100644 --- a/src/IGESExport/IGESExport.cxx +++ b/src/IGESExport/IGESExport.cxx @@ -18,13 +18,11 @@ // 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: IGESExport.cxx // Created: Wed May 19 14:49:45 2004 // Author: Pavel TELKOV -// -// + #include "utilities.h" #include @@ -68,7 +66,9 @@ IGESEXPORT_EXPORT const TCollection_AsciiString& theFormatName ) { MESSAGE("Export IGES into file " << theFileName.ToCString()); - try + // commented for 0021350: Please don't catch exceptions silently and send an + // inappropriate error message instead, it is disturbing for the user and for us + //try { // define, whether to write only faces (5.1 IGES format) // or shells and solids also (5.3 IGES format) @@ -94,15 +94,15 @@ IGESEXPORT_EXPORT ICW.AddShape( theShape ); ICW.ComputeModel(); bool ok = ICW.Write( theFileName.ToCString() ); - + // Return previous locale if ( ok ) return 1; } - catch(Standard_Failure) - { - //THROW_SALOME_CORBA_EXCEPTION("Exception catched in IGESExport", SALOME::BAD_PARAM); - } + //catch(Standard_Failure) + //{ + // //THROW_SALOME_CORBA_EXCEPTION("Exception catched in IGESExport", SALOME::BAD_PARAM); + //} return 0; } } diff --git a/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx index 6fbb8a7eb..06494e1a3 100644 --- a/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx +++ b/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx @@ -15,7 +15,6 @@ // 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 @@ -32,6 +31,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class TColStd_MapOfInteger; @@ -39,7 +39,6 @@ class TColStd_MapIntegerHasher; class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger; class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger; - #ifndef _Standard_HeaderFile #include #endif @@ -47,108 +46,69 @@ class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger; #include #endif +#include -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 +class NMTDS_DataMapOfIntegerMapOfInteger : public TCollection_BasicMap { - 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 - // +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); + } + +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const Standard_Integer& K); +#endif -private: +private: // Methods PRIVATE - // - - -Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& Other); - - - // Fields PRIVATE // + Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& Other); }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx index 923025604..6a25d0770 100644 --- a/src/NMTDS/NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx +++ b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx @@ -18,7 +18,6 @@ // 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_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_HeaderFile #define _NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -42,7 +42,6 @@ class BooleanOperations_IndexedDataMapOfShapeInteger; class TColStd_MapIntegerHasher; class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInte #include #endif +#include class NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger : public TCollection_BasicMap { @@ -132,41 +132,21 @@ Standard_EXPORT const BooleanOperations_IndexedDataMapOfShapeInteger& FindFromK Standard_EXPORT BooleanOperations_IndexedDataMapOfShapeInteger& ChangeFromKey(const Standard_Integer& K) ; - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const Standard_Integer& K); +#endif private: // Methods PRIVATE // - Standard_EXPORT NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger(const NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger& Other); - - // Fields PRIVATE - // - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx index 27eb2e88c..f4405a215 100644 --- a/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx +++ b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile #define _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -42,7 +42,6 @@ class TopoDS_Shape; class TColStd_MapIntegerHasher; class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape; #include #endif +#include class NMTDS_IndexedDataMapOfIntegerShape : public TCollection_BasicMap { @@ -132,19 +132,10 @@ Standard_EXPORT const TopoDS_Shape& FindFromKey(const Standard_Integer& K) cons Standard_EXPORT TopoDS_Shape& ChangeFromKey(const Standard_Integer& K) ; - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const Standard_Integer& K); +#endif private: diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfShapeBndSphere.hxx b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBndSphere.hxx index f3fc1bc43..db75c3a34 100644 --- a/src/NMTDS/NMTDS_IndexedDataMapOfShapeBndSphere.hxx +++ b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBndSphere.hxx @@ -15,7 +15,6 @@ // 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_IndexedDataMapOfShapeBndSphere_HeaderFile #define _NMTDS_IndexedDataMapOfShapeBndSphere_HeaderFile @@ -32,6 +31,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -40,7 +40,6 @@ class NMTDS_BndSphere; class TopTools_ShapeMapHasher; class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBndSphere; - #ifndef _Standard_HeaderFile #include #endif @@ -48,6 +47,7 @@ class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBndSphere; #include #endif +#include class NMTDS_IndexedDataMapOfShapeBndSphere : public TCollection_BasicMap { @@ -130,41 +130,21 @@ Standard_EXPORT const NMTDS_BndSphere& FindFromKey(const TopoDS_Shape& K) const Standard_EXPORT NMTDS_BndSphere& ChangeFromKey(const TopoDS_Shape& K) ; - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif private: // Methods PRIVATE // - Standard_EXPORT NMTDS_IndexedDataMapOfShapeBndSphere(const NMTDS_IndexedDataMapOfShapeBndSphere& Other); - - // Fields PRIVATE - // - - }; - - - - // other Inline functions and methods (like "C++: function call" methods) // - #endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx index 5b884ccff..2492f25af 100644 --- a/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx +++ b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifndef _NMTDS_IndexedDataMapOfShapeBox_HeaderFile #define _NMTDS_IndexedDataMapOfShapeBox_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -43,7 +43,6 @@ class Bnd_Box; class TopTools_ShapeMapHasher; class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox; - #ifndef _Standard_HeaderFile #include #endif @@ -51,6 +50,7 @@ class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox; #include #endif +#include class NMTDS_IndexedDataMapOfShapeBox : public TCollection_BasicMap { @@ -133,9 +133,10 @@ Standard_EXPORT const Bnd_Box& FindFromKey(const TopoDS_Shape& K) const; Standard_EXPORT Bnd_Box& ChangeFromKey(const TopoDS_Shape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif protected: diff --git a/src/NMTTools/NMTTools_DataMapOfIntegerFaceInfo.hxx b/src/NMTTools/NMTTools_DataMapOfIntegerFaceInfo.hxx index 5f80f8bb3..508c28f1b 100644 --- a/src/NMTTools/NMTTools_DataMapOfIntegerFaceInfo.hxx +++ b/src/NMTTools/NMTTools_DataMapOfIntegerFaceInfo.hxx @@ -18,7 +18,6 @@ // 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_DataMapOfIntegerFaceInfo_HeaderFile #define _NMTTools_DataMapOfIntegerFaceInfo_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class NMTTools_FaceInfo; @@ -42,7 +42,6 @@ class TColStd_MapIntegerHasher; class NMTTools_DataMapNodeOfDataMapOfIntegerFaceInfo; class NMTTools_DataMapIteratorOfDataMapOfIntegerFaceInfo; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class NMTTools_DataMapIteratorOfDataMapOfIntegerFaceInfo; #include #endif +#include class NMTTools_DataMapOfIntegerFaceInfo : public TCollection_BasicMap { @@ -116,10 +116,10 @@ Standard_EXPORT NMTTools_FaceInfo& ChangeFind(const Standard_Integer& K) ; return ChangeFind(K); } - - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const Standard_Integer& K); +#endif protected: diff --git a/src/NMTTools/NMTTools_DataMapOfIntegerListOfPaveBlock.hxx b/src/NMTTools/NMTTools_DataMapOfIntegerListOfPaveBlock.hxx index 66fdda3ed..0cc6bde58 100644 --- a/src/NMTTools/NMTTools_DataMapOfIntegerListOfPaveBlock.hxx +++ b/src/NMTTools/NMTTools_DataMapOfIntegerListOfPaveBlock.hxx @@ -18,7 +18,6 @@ // 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_DataMapOfIntegerListOfPaveBlock_HeaderFile #define _NMTTools_DataMapOfIntegerListOfPaveBlock_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_NoSuchObject; class BOPTools_ListOfPaveBlock; @@ -42,7 +42,6 @@ class TColStd_MapIntegerHasher; class NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock; class NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock; #include #endif +#include class NMTTools_DataMapOfIntegerListOfPaveBlock : public TCollection_BasicMap { @@ -116,20 +116,10 @@ Standard_EXPORT BOPTools_ListOfPaveBlock& ChangeFind(const Standard_Integer& K return ChangeFind(K); } - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address Find1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFind1 (const Standard_Integer& K); +#endif private: diff --git a/src/NMTTools/NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx b/src/NMTTools/NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx index 87dc16a65..0618f69cc 100644 --- a/src/NMTTools/NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx +++ b/src/NMTTools/NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx @@ -18,7 +18,6 @@ // 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_IndexedDataMapOfIndexedMapOfInteger_HeaderFile #define _NMTTools_IndexedDataMapOfIndexedMapOfInteger_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -42,7 +42,6 @@ class TColStd_IndexedMapOfInteger; class TColStd_MapIntegerHasher; class NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger; - #ifndef _Standard_HeaderFile #include #endif @@ -50,6 +49,7 @@ class NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger; #include #endif +#include class NMTTools_IndexedDataMapOfIndexedMapOfInteger : public TCollection_BasicMap { @@ -132,9 +132,10 @@ Standard_EXPORT const TColStd_IndexedMapOfInteger& FindFromKey(const Standard_I Standard_EXPORT TColStd_IndexedMapOfInteger& ChangeFromKey(const Standard_Integer& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const Standard_Integer& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const Standard_Integer& K); +#endif protected: diff --git a/src/NMTTools/NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx b/src/NMTTools/NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx index 8bfea6390..601854b71 100644 --- a/src/NMTTools/NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx +++ b/src/NMTTools/NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx @@ -18,7 +18,6 @@ // 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_IndexedDataMapOfShapeIndexedMapOfShape_HeaderFile #define _NMTTools_IndexedDataMapOfShapeIndexedMapOfShape_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -43,7 +43,6 @@ class TopTools_IndexedMapOfShape; class TopTools_ShapeMapHasher; class NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape; - #ifndef _Standard_HeaderFile #include #endif @@ -51,6 +50,7 @@ class NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape; #include #endif +#include class NMTTools_IndexedDataMapOfShapeIndexedMapOfShape : public TCollection_BasicMap { @@ -133,9 +133,10 @@ Standard_EXPORT const TopTools_IndexedMapOfShape& FindFromKey(const TopoDS_Shap Standard_EXPORT TopTools_IndexedMapOfShape& ChangeFromKey(const TopoDS_Shape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif protected: diff --git a/src/NMTTools/NMTTools_IndexedDataMapOfShapePaveBlock.hxx b/src/NMTTools/NMTTools_IndexedDataMapOfShapePaveBlock.hxx index 3b3b113a5..4f3c1abc1 100644 --- a/src/NMTTools/NMTTools_IndexedDataMapOfShapePaveBlock.hxx +++ b/src/NMTTools/NMTTools_IndexedDataMapOfShapePaveBlock.hxx @@ -18,7 +18,6 @@ // 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_IndexedDataMapOfShapePaveBlock_HeaderFile #define _NMTTools_IndexedDataMapOfShapePaveBlock_HeaderFile @@ -35,6 +34,7 @@ #ifndef _Standard_Boolean_HeaderFile #include #endif + class Standard_DomainError; class Standard_OutOfRange; class Standard_NoSuchObject; @@ -43,7 +43,6 @@ class BOPTools_PaveBlock; class TopTools_ShapeMapHasher; class NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock; - #ifndef _Standard_HeaderFile #include #endif @@ -51,6 +50,7 @@ class NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock; #include #endif +#include class NMTTools_IndexedDataMapOfShapePaveBlock : public TCollection_BasicMap { @@ -133,9 +133,10 @@ Standard_EXPORT const BOPTools_PaveBlock& FindFromKey(const TopoDS_Shape& K) co Standard_EXPORT BOPTools_PaveBlock& ChangeFromKey(const TopoDS_Shape& K) ; - - - +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + Standard_EXPORT Standard_Address FindFromKey1 (const TopoDS_Shape& K) const; + Standard_EXPORT Standard_Address ChangeFromKey1 (const TopoDS_Shape& K); +#endif protected: diff --git a/src/NMTTools/NMTTools_PaveFiller.cdl b/src/NMTTools/NMTTools_PaveFiller.cdl index 593514f68..38df5ddea 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cdl +++ b/src/NMTTools/NMTTools_PaveFiller.cdl @@ -1,23 +1,23 @@ --- Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +-- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -- --- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, --- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +-- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License. +-- This library is 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. +-- 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 +-- 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 +-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -- -- File: NMTTools_PaveFiller.cdl -- Created: Fri Dec 5 14:35:00 2003 @@ -347,7 +347,7 @@ is nF :Integer from Standard; aLCB:out ListOfCommonBlock from NMTTools) returns Integer from Standard; - + PrepareFace(me:out; nF : Integer from Standard; aF : out Face from TopoDS); @@ -383,8 +383,14 @@ is RealSplitsInFace(me:out; nE1 :Integer from Standard; nF2 :Integer from Standard; - aLs :out ListOfPaveBlock from BOPTools); - + aLs :out ListOfPaveBlock from BOPTools); + +--modified by NIZNHY-PKV Mon Oct 17 11:43:23 2011f + RealSplitsInFace(me:out; + nF1 :Integer from Standard; + aLPB :out ListOfPaveBlock from BOPTools); +--modified by NIZNHY-PKV Mon Oct 17 11:43:39 2011t + RealSplitsOnEdge(me:out; nE1 :Integer from Standard; nE2 :Integer from Standard; @@ -413,7 +419,6 @@ is aBC : out Curve from BOPTools); - PutBoundPaveOnCurve (me:out; aBC :out Curve from BOPTools; aFF :out SSInterference from BOPTools); @@ -497,7 +502,6 @@ is aPB2 : PaveBlock from BOPTools) returns Boolean from Standard; ---modified by NIZNHY-PKV Wed Feb 09 10:10:48 2011f FillFaceInfo (me:out) is protected; @@ -505,8 +509,11 @@ is aFF : SSInterference from BOPTools; aMVStick: MapOfInteger from TColStd; aTolR3D: out Real from Standard) - is protected; ---modified by NIZNHY-PKV Wed Feb 09 10:11:52 2011t + is protected; + + PutClosingPaveOnCurve (me:out; + aBC :out Curve from BOPTools; + aFF :out SSInterference from BOPTools); fields myDS : PShapesDataStructure from NMTDS is protected; @@ -527,7 +534,5 @@ fields myDSIt : PIterator from NMTDS is protected; myCompositeShape : Shape from TopoDS is protected; myIP : PInterfPool from NMTDS is protected; ---modified by NIZNHY-PKV Wed Feb 09 10:51:50 2011f myFaceInfo : DataMapOfIntegerFaceInfo from NMTTools is protected; ---modified by NIZNHY-PKV Wed Feb 09 10:51:50 2011t end PaveFiller; diff --git a/src/NMTTools/NMTTools_PaveFiller.hxx b/src/NMTTools/NMTTools_PaveFiller.hxx index c0cc26cce..30be65121 100644 --- a/src/NMTTools/NMTTools_PaveFiller.hxx +++ b/src/NMTTools/NMTTools_PaveFiller.hxx @@ -23,6 +23,13 @@ #ifndef _NMTTools_PaveFiller_HeaderFile #define _NMTTools_PaveFiller_HeaderFile +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + #ifndef _NMTDS_PShapesDataStructure_HeaderFile #include #endif @@ -99,204 +106,142 @@ class TopTools_DataMapOfShapeShape; class TColStd_MapOfInteger; -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - class 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_PaveFiller(); + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + + + Standard_EXPORT NMTTools_PaveFiller(); Standard_EXPORT virtual ~NMTTools_PaveFiller(); - - -Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; - - -Standard_EXPORT const TopoDS_Shape& CompositeShape() const; - - -Standard_EXPORT NMTDS_PShapesDataStructure DS() ; - - -Standard_EXPORT NMTDS_PIterator DSIt() ; - - -Standard_EXPORT NMTDS_PInterfPool IP() ; - - -Standard_EXPORT virtual void Perform() ; - - -Standard_EXPORT Standard_Boolean IsDone() const; - - -Standard_EXPORT const IntTools_Context& Context() const; - - -Standard_EXPORT IntTools_Context& ChangeContext() ; - - -Standard_EXPORT const BOPTools_PavePool& PavePool() const; - - -Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; - - -Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; - - -Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; - - -Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; - - -Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; - - -Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; - - -Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - -Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; - - -Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; - - -Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; - - -Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; - - -Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; - - -Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - -Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; - - -Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; - - -Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - - -Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - - -Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; - - -Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; - - -Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; - - -Standard_EXPORT void MakePCurves() ; - - -Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; - - -Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; - - -Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; - - -Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; - - -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; - - -Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; - - -Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; - - -Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; + + Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; + + Standard_EXPORT const TopoDS_Shape& CompositeShape() const; + + Standard_EXPORT NMTDS_PShapesDataStructure DS() ; + + Standard_EXPORT NMTDS_PIterator DSIt() ; + + Standard_EXPORT NMTDS_PInterfPool IP() ; + + Standard_EXPORT virtual void Perform() ; + + Standard_EXPORT Standard_Boolean IsDone() const; + + Standard_EXPORT const IntTools_Context& Context() const; + + Standard_EXPORT IntTools_Context& ChangeContext() ; + + Standard_EXPORT const BOPTools_PavePool& PavePool() const; + + Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; + + Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; + + Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; + + Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; + + Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; + + Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; + + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; + + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; + + Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; + + Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; + + Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; + + Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; + + Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT void RealSplitsInFace(const Standard_Integer nF1,BOPTools_ListOfPaveBlock& aLPB) ; + + Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; + + Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; + + Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + + Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + + Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; + + Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; + + Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; + + Standard_EXPORT void MakePCurves() ; + + Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; + + Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; + + Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; + + Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; + + 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; + + Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; + + Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; + + Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; + + Standard_EXPORT void PutClosingPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; @@ -304,117 +249,78 @@ Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aP protected: - // Methods PROTECTED - // - - -Standard_EXPORT virtual void Init() ; - - -Standard_EXPORT virtual void Clear() ; - - -Standard_EXPORT virtual void PerformVV() ; - - -Standard_EXPORT virtual void PerformVE() ; - - -Standard_EXPORT virtual void PerformVF() ; - - -Standard_EXPORT virtual void PerformEE() ; - - -Standard_EXPORT virtual void PerformEF() ; - - -Standard_EXPORT virtual void PerformFF() ; - - -Standard_EXPORT void MakeSplitEdges() ; - - -Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; - + + Standard_EXPORT virtual void Init() ; + + Standard_EXPORT virtual void Clear() ; + + Standard_EXPORT virtual void PerformVV() ; + + Standard_EXPORT virtual void PerformVE() ; + + Standard_EXPORT virtual void PerformVF() ; + + Standard_EXPORT virtual void PerformEE() ; + + Standard_EXPORT virtual void PerformEF() ; + + Standard_EXPORT virtual void PerformFF() ; + + Standard_EXPORT void MakeSplitEdges() ; + + Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; + + Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; + + Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; + + Standard_EXPORT virtual void PrepareEdges() ; + + 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; + + Standard_EXPORT void RefinePavePool() ; + + Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; + + Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; + + Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; + + Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; + + Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + Standard_EXPORT void UpdateCommonBlocks() ; + + Standard_EXPORT void UpdatePaveBlocks() ; + + Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; + + Standard_EXPORT void MakeBlocks() ; + + Standard_EXPORT void PerformVF1() ; + + Standard_EXPORT void MakeAloneVertices() ; + + Standard_EXPORT void FillFaceInfo() ; + + Standard_EXPORT void CorrectTolR3D(const BOPTools_SSInterference& aFF,const TColStd_MapOfInteger& aMVStick,Standard_Real& aTolR3D) ; -Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; - -Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; - - -Standard_EXPORT virtual void PrepareEdges() ; - - -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; - - -Standard_EXPORT void RefinePavePool() ; - - -Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; - - -Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - -Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - -Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - -Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; - - -Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; - - -Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; - - -Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - -Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - -Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - -Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - -Standard_EXPORT void UpdateCommonBlocks() ; - - -Standard_EXPORT void UpdatePaveBlocks() ; - - -Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; - - -Standard_EXPORT void MakeBlocks() ; - - -Standard_EXPORT void PerformVF1() ; - - -Standard_EXPORT void MakeAloneVertices() ; - - -Standard_EXPORT void FillFaceInfo() ; - - -Standard_EXPORT void CorrectTolR3D(const BOPTools_SSInterference& aFF,const TColStd_MapOfInteger& aMVStick,Standard_Real& aTolR3D) ; - - - // Fields PROTECTED - // NMTDS_PShapesDataStructure myDS; Standard_Boolean myIsDone; Standard_Integer myNbSources; @@ -433,14 +339,10 @@ NMTDS_PInterfPool myIP; NMTTools_DataMapOfIntegerFaceInfo myFaceInfo; -private: +private: - // Methods PRIVATE - // - // Fields PRIVATE - // }; @@ -450,7 +352,6 @@ private: // other Inline functions and methods (like "C++: function call" methods) -// #endif diff --git a/src/NMTTools/NMTTools_PaveFiller_6.cxx b/src/NMTTools/NMTTools_PaveFiller_6.cxx index 31d1be74f..1a9e9cd8a 100644 --- a/src/NMTTools/NMTTools_PaveFiller_6.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_6.cxx @@ -1,23 +1,23 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is 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. +// 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 +// 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File: NMTTools_PaveFiller_6.cxx // Created: Fri Dec 19 10:27:31 2003 @@ -25,6 +25,8 @@ #include +#include + #include #include @@ -122,7 +124,7 @@ static myIsDone=Standard_False; // Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone; - Standard_Boolean bJustAdd; + Standard_Boolean bJustAdd, bToSplit; Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs; Standard_Integer aNbCurves, aNbPoints; Standard_Real anApproxTol, aTolR3D, aTolR2D; @@ -142,6 +144,10 @@ static aFFs.SetBlockLength(aNbFFs); } // + //modified by NIZNHY-PKV Thu Sep 15 08:02:52 2011f + bToSplit=Standard_False; + //modified by NIZNHY-PKV Thu Sep 15 08:02:55 2011t + // for (; myDSIt->More(); myDSIt->Next()) { myDSIt->Current(n1, n2, bJustAdd); // @@ -186,7 +192,13 @@ static aTolR3D=1.e-7; } // + //modified by NIZNHY-PKV Thu Sep 15 08:03:02 2011f +#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher + aFF.PrepareLines3D(bToSplit); +#else aFF.PrepareLines3D(); +#endif // OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher + //modified by NIZNHY-PKV Thu Sep 15 08:03:04 2011t // const IntTools_SequenceOfCurves& aCvsX=aFF.Lines(); const IntTools_SequenceOfPntOn2Faces& aPntsX=aFF.Points(); @@ -349,6 +361,16 @@ void NMTTools_PaveFiller::MakeBlocks() BOPTools_Curve& aBC=aSCvs(j); PutBoundPaveOnCurve (aBC, aFFi); } + //modified by NIZNHY-PKV Wed Sep 14 13:12:14 2011f +#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher + // + // Put closing pave if needded + for (j=1; j<=aNbCurves; ++j) { + BOPTools_Curve& aBC=aSCvs(j); + PutClosingPaveOnCurve (aBC, aFFi); + } +#endif // OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher + //modified by NIZNHY-PKV Wed Sep 14 13:12:17 2011t // // Pave Blocks on Curves bHasES=Standard_False; @@ -1260,13 +1282,9 @@ void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet, BOPTools_PaveSet& aPS=aBC.Set(); aPS.Append(aPaveNew); //<-B - //modified by NIZNHY-PKV Thu Apr 22 10:36:45 2010f - //BOPTools_Tools::UpdateVertex (aC, aT, aV); - //modified by NIZNHY-PKV Thu Apr 22 10:36:48 2010t } } } -//modified by NIZNHY-PKV Tue Feb 08 12:24:35 2011f // //======================================================================= //function : FillFaceInfo @@ -1518,4 +1536,69 @@ void NMTTools_PaveFiller::CorrectTolR3D(const BOPTools_SSInterference& aFF, aTolR3D=aTolR; } } -//modified by NIZNHY-PKV Tue Feb 08 12:24:56 2011t + +//modified by NIZNHY-PKV Wed Sep 14 13:21:13 2011f +#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher +//======================================================================= +// function: PutClosingPaveOnCurve +// purpose: +//======================================================================= +void NMTTools_PaveFiller::PutClosingPaveOnCurve(BOPTools_Curve& aBC, + BOPTools_SSInterference& aFFi) +{ + Standard_Boolean bIsClosed, bHasBounds, bAdded; + Standard_Integer nVC, j; + Standard_Real aT[2], aTolR3D, aTC, dT, aTx; + gp_Pnt aP[2] ; + BOPTools_Pave aPVx; + BOPTools_ListIteratorOfListOfPave aItLP; + // + const IntTools_Curve& aIC=aBC.Curve(); + const Handle (Geom_Curve)& aC3D=aIC.Curve(); + if(aC3D.IsNull()) { + return; + } + // + bIsClosed=IntTools_Tools::IsClosed(aC3D); + if (!bIsClosed) { + return; + } + // + bHasBounds=aIC.HasBounds (); + if (!bHasBounds){ + return; + } + // + bAdded=Standard_False; + dT=Precision::PConfusion(); + aTolR3D=aFFi.TolR3D(); + aIC.Bounds (aT[0], aT[1], aP[0], aP[1]); + // + BOPTools_PaveSet& aFFiPS=aFFi.NewPaveSet(); + BOPTools_PaveSet& aCPS=aBC.Set(); + // + const BOPTools_ListOfPave& aLP=aCPS.Set(); + aItLP.Initialize(aLP); + for (; aItLP.More() && !bAdded; aItLP.Next()) { + const BOPTools_Pave& aPC=aItLP.Value(); + nVC=aPC.Index(); + const TopoDS_Vertex aVC=TopoDS::Vertex(myDS->Shape(nVC)); + aTC=aPC.Param(); + // + for (j=0; j<2; ++j) { + if (fabs(aTC-aT[j]) < dT) { + aTx=(!j) ? aT[1] : aT[0]; + aPVx.SetIndex(nVC); + aPVx.SetParam(aTx); + // + aCPS.Append(aPVx); + aFFiPS.Append(aPVx); + // + bAdded=Standard_True; + break; + } + } + } +} +#endif // OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher +//modified by NIZNHY-PKV Wed Sep 14 13:21:17 2011t diff --git a/src/NMTTools/NMTTools_PaveFiller_8.cxx b/src/NMTTools/NMTTools_PaveFiller_8.cxx index 5adf31efa..b4c21b10e 100644 --- a/src/NMTTools/NMTTools_PaveFiller_8.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_8.cxx @@ -687,3 +687,142 @@ } return 0; //Ok } +//modified by NIZNHY-PKV Mon Oct 17 12:07:48 2011f +static + void SortPaveBlocks(BOPTools_ListOfPaveBlock &); +static + void SortShell(const Standard_Integer, + BOPTools_PaveBlock *); +static + Standard_Boolean Less(const BOPTools_PaveBlock &, + const BOPTools_PaveBlock &); + +//======================================================================= +// function: RealSplitsInFace +// purpose: +//======================================================================= + void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer nF, + BOPTools_ListOfPaveBlock& aLPBIn) +{ + Standard_Integer j, aNbCBP, nSpIn; + TColStd_MapOfInteger aMFence; + BOPTools_ListOfPaveBlock aLPB; + BOPTools_ListIteratorOfListOfPaveBlock aItPB; + NMTTools_ListIteratorOfListOfCommonBlock aItCB; + // + NMTTools_CommonBlockPool& aCBP=ChangeCommonBlockPool(); + // + aNbCBP=aCBP.Extent(); + for (j=1; j<=aNbCBP; ++j) { + NMTTools_ListOfCommonBlock& aLCB=aCBP(j); + aItCB.Initialize(aLCB); + for (; aItCB.More(); aItCB.Next()) { + NMTTools_CommonBlock& aCB=aItCB.Value(); + if (aCB.IsPaveBlockOnFace(nF)) { + const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(); + nSpIn=aPB1.Edge(); + if (aMFence.Add(nSpIn)){ + aLPB.Append(aPB1); + } + } + } + } + // + SortPaveBlocks(aLPB); + // + aItPB.Initialize(aLPB); + for (; aItPB.More(); aItPB.Next()) { + const BOPTools_PaveBlock& aPB=aItPB.Value(); + aLPBIn.Append(aPB); + } +} +//======================================================================= +// function: SortPaveBlocks +// purpose: +//======================================================================= +void SortPaveBlocks(BOPTools_ListOfPaveBlock &aLPBIn) +{ + Standard_Integer i, aNbPBIn; + BOPTools_ListIteratorOfListOfPaveBlock aItPB; + BOPTools_PaveBlock *pPB; + // + aNbPBIn=aLPBIn.Extent(); + if (aNbPBIn<2) { + return; + } + // + pPB=new BOPTools_PaveBlock[aNbPBIn]; + // + aItPB.Initialize(aLPBIn); + for (i=0; aItPB.More(); aItPB.Next(), ++i) { + const BOPTools_PaveBlock& aPB=aItPB.Value(); + pPB[i]=aPB; + } + // + SortShell(aNbPBIn, pPB); + // + aLPBIn.Clear(); + for (i=0; i -1) goto m30; + }//if (a[l] < a[j]){ + }//for (i=0; i #include #include +#include #include #include @@ -175,21 +176,38 @@ extern "C" if (!TR.IsNull()) { Handle(Transfer_TransientProcess) TP = TR->TransientProcess(); Handle(Standard_Type) tPD = STANDARD_TYPE(StepBasic_ProductDefinition); + Handle(Standard_Type) tShape = STANDARD_TYPE(StepShape_TopologicalRepresentationItem); Standard_Integer nb = Model->NbEntities(); for (Standard_Integer ie = 1; ie <= nb; ie++) { Handle(Standard_Transient) enti = Model->Value(ie); - if (enti->DynamicType() != tPD) continue; - - Handle(StepBasic_ProductDefinition) PD = - Handle(StepBasic_ProductDefinition)::DownCast(enti); - if (PD.IsNull()) continue; - - Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct(); - if (Prod->Name()->UsefullLength() <= 0) continue; + Handle(TCollection_HAsciiString) aName; + if ( enti->IsKind( tShape )) + { + aName = Handle(StepRepr_RepresentationItem)::DownCast(enti)->Name(); + } + else if (enti->DynamicType() == tPD) + { + Handle(StepBasic_ProductDefinition) PD = + Handle(StepBasic_ProductDefinition)::DownCast(enti); + if (PD.IsNull()) continue; - Handle(TCollection_HAsciiString) aName = Prod->Name(); - TCollection_ExtendedString aNameExt (aName->ToCString()); + Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct(); + aName = Prod->Name(); + } + else + { + continue; + } + if ( aName->UsefullLength() < 1 ) + continue; + // skip 'N0NE' name + if ( aName->UsefullLength() == 4 && + toupper (aName->Value(1)) == 'N' && + toupper (aName->Value(2)) == 'O' && + toupper (aName->Value(3)) == 'N' && + toupper (aName->Value(4)) == 'E') + continue; // special check to pass names like "Open CASCADE STEP translator 6.3 1" TCollection_AsciiString aSkipName ("Open CASCADE STEP translator"); @@ -197,6 +215,7 @@ extern "C" if (aName->String().SubString(1, aSkipName.Length()).IsEqual(aSkipName)) continue; } + TCollection_ExtendedString aNameExt (aName->ToCString()); // find target shape Handle(Transfer_Binder) binder = TP->Find(enti); diff --git a/src/ShHealOper/ShHealOper_ChangeOrientation.cxx b/src/ShHealOper/ShHealOper_ChangeOrientation.cxx index 5c7cc0b8d..b81fccd57 100644 --- a/src/ShHealOper/ShHealOper_ChangeOrientation.cxx +++ b/src/ShHealOper/ShHealOper_ChangeOrientation.cxx @@ -18,15 +18,16 @@ // 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: ShHealOper_ChangeOrientation.cxx // Created: 11.07.06 11:46:45 // Author: Sergey KUUL -// + #include #include +#include + #include //======================================================================= @@ -59,7 +60,7 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform() BRep_Builder B; if (myInitShape.ShapeType() == TopAbs_SHELL) { myResultShape = myInitShape.EmptyCopied(); - TopoDS_Iterator itr(myInitShape); + TopoDS_Iterator itr (myInitShape); while (itr.More()) { B.Add(myResultShape,itr.Value().Reversed()); itr.Next(); @@ -67,7 +68,7 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform() } else if (myInitShape.ShapeType() == TopAbs_FACE) { myResultShape = myInitShape.EmptyCopied(); - TopoDS_Iterator itr(myInitShape); + TopoDS_Iterator itr (myInitShape); while (itr.More()) { B.Add(myResultShape,itr.Value()); itr.Next(); @@ -76,7 +77,7 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform() } else if ( myInitShape.ShapeType() == TopAbs_WIRE || myInitShape.ShapeType() == TopAbs_EDGE) { myResultShape = myInitShape.EmptyCopied(); - TopoDS_Iterator itr(myInitShape); + TopoDS_Iterator itr (myInitShape); while (itr.More()) { B.Add(myResultShape,itr.Value()); itr.Next(); @@ -84,9 +85,17 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform() myResultShape.Reverse(); } else { - return false; + BRepBuilderAPI_Copy Copy (myInitShape); + if (!Copy.IsDone()) return false; + + myResultShape = Copy.Shape(); + if (myResultShape.IsNull()) return false; + + if (myResultShape.Orientation() == TopAbs_FORWARD) + myResultShape.Orientation(TopAbs_REVERSED); + else + myResultShape.Orientation(TopAbs_FORWARD); } return true; - } diff --git a/src/ShHealOper/ShHealOper_FillHoles.cxx b/src/ShHealOper/ShHealOper_FillHoles.cxx index 5e3585706..2e55b642f 100644 --- a/src/ShHealOper/ShHealOper_FillHoles.cxx +++ b/src/ShHealOper/ShHealOper_FillHoles.cxx @@ -18,46 +18,50 @@ // 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: ShHealOper_FillHoles.cxx // Created: 26.04.04 17:35:30 // Author: Galina KULIKOVA -// + +#include + +#include +#include #include -#include -#include #include -#include -#include -#include + #include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include #include -#include -#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include -#include -#include -#include + +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include + +#include //======================================================================= //function : ShHealOper_FillHoles() @@ -70,33 +74,31 @@ ShHealOper_FillHoles::ShHealOper_FillHoles () //======================================================================= //function : ShHealOper_FillHoles -//purpose : +//purpose : //======================================================================= - ShHealOper_FillHoles::ShHealOper_FillHoles (const TopoDS_Shape& theShape) { - Init(theShape); InitParameters(); } + //======================================================================= //function : Init -//purpose : +//purpose : //======================================================================= - void ShHealOper_FillHoles::Init(const TopoDS_Shape& theShape) { ShHealOper_Tool::Init(theShape); TopExp::MapShapesAndAncestors( myInitShape, TopAbs_EDGE,TopAbs_SHELL , myEdgeShells); TopExp::MapShapesAndAncestors ( myInitShape, TopAbs_EDGE,TopAbs_COMPOUND, myEdgeComps ); - + TopExp::MapShapesAndAncestors ( myInitShape, TopAbs_EDGE,TopAbs_FACE, myEdgeFaces ); } + //======================================================================= //function : InitParameters -//purpose : +//purpose : //======================================================================= - void ShHealOper_FillHoles::InitParameters(Standard_Integer theDegree, Standard_Integer theNbPtsOnCur, Standard_Integer theNbIter, @@ -119,9 +121,8 @@ void ShHealOper_FillHoles::InitParameters(Standard_Integer theDegree, } //======================================================================= //function : Fill -//purpose : +//purpose : //======================================================================= - Standard_Boolean ShHealOper_FillHoles::Fill() { ShapeAnalysis_FreeBounds sab(myInitShape); @@ -131,17 +132,17 @@ Standard_Boolean ShHealOper_FillHoles::Fill() if(!aCompClosed.IsNull()) { TopoDS_Iterator aIt(aCompClosed); - for( ; aIt.More(); aIt.Next()) + for( ; aIt.More(); aIt.Next()) aFillWires.Append(aIt.Value()); } if(!aCompOpen.IsNull()) { TopoDS_Iterator aIt(aCompOpen); - for( ; aIt.More(); aIt.Next()) + for( ; aIt.More(); aIt.Next()) aFillWires.Append(aIt.Value()); } - + TopExp_Explorer aExp(myInitShape,TopAbs_EDGE,TopAbs_FACE); - + for( ; aExp.More(); aExp.Next()) aFillWires.Append(aExp.Current()); @@ -150,9 +151,8 @@ Standard_Boolean ShHealOper_FillHoles::Fill() //======================================================================= //function : Fill -//purpose : +//purpose : //======================================================================= - Standard_Boolean ShHealOper_FillHoles::Fill(const TopTools_SequenceOfShape& theFillShapes) { myDone = Standard_False; @@ -181,36 +181,36 @@ Standard_Boolean ShHealOper_FillHoles::Fill(const TopTools_SequenceOfShape& theF Handle(Geom_Surface) aSurf = buildSurface(aWire,aCurves2d,aOrders,aSenses); if(aSurf.IsNull()) myErrorStatus = ShHealOper_ErrorExecution; - else + else myDone = (addFace(aSurf,aWire,aCurves2d,aOrders,aSenses) || myDone); } if(myDone) myResultShape = myContext->Apply(myResultShape); return myDone; } + //======================================================================= //function : isCircle -//purpose : +//purpose : //======================================================================= static Standard_Boolean isCircle(const TopoDS_Edge theEdge) { Standard_Real aFirst, aLast; Handle(Geom_Curve) aC3D = BRep_Tool::Curve(theEdge,aFirst, aLast ); if(aC3D.IsNull()) return Standard_False; - Standard_Boolean isCirc = (aC3D->Value(aFirst).Distance(aC3D->Value(aLast)) < + Standard_Boolean isCirc = (aC3D->Value(aFirst).Distance(aC3D->Value(aLast)) < aC3D->Value(aFirst).Distance(aC3D->Value((aFirst +aLast)/2))); return isCirc; } //======================================================================= //function : prepareWires -//purpose : +//purpose : //======================================================================= Standard_Boolean ShHealOper_FillHoles::prepareWires(const TopTools_SequenceOfShape& theFillShapes, Handle(TopTools_HSequenceOfShape)& theSeqWires) { Handle(TopTools_HSequenceOfShape) aSeqEdges = new TopTools_HSequenceOfShape; - BRep_Builder aB; Standard_Integer i =1; for( ; i <= theFillShapes.Length(); i++) { TopExp_Explorer aExp; @@ -231,7 +231,7 @@ Standard_Boolean ShHealOper_FillHoles::prepareWires(const TopTools_SequenceOfSha aSeqEdges->Append(aExp.Current()); } } - + if(aSeqEdges->Length()) { Standard_Real aTol = 0.; @@ -241,23 +241,21 @@ Standard_Boolean ShHealOper_FillHoles::prepareWires(const TopTools_SequenceOfSha Handle(TopTools_HSequenceOfShape) anWiresClosed = new TopTools_HSequenceOfShape, anWiresOpen = new TopTools_HSequenceOfShape; ShapeAnalysis_FreeBounds::SplitWires(aTmpWires, aTol, aShared, anWiresClosed, anWiresOpen); - + for (i = 1; i <= anWiresClosed->Length(); i++) theSeqWires->Append (anWiresClosed->Value (i)); for (i = 1; i <= anWiresOpen->Length(); i++) theSeqWires->Append (anWiresOpen->Value (i)); } - - for( i =1; i <= theSeqWires->Length(); i++) { TopoDS_Wire aWire = TopoDS::Wire(theSeqWires->Value(i)); - + TopoDS_Iterator aIt(aWire); Standard_Integer ne =0; TopoDS_Edge ae; for( ; aIt.More(); aIt.Next(), ne++) - ae = TopoDS::Edge(aIt.Value()); + ae = TopoDS::Edge(aIt.Value()); if((ne == 1) && ( !isCircle(ae))) { theSeqWires->Remove(i--); continue; @@ -267,7 +265,7 @@ Standard_Boolean ShHealOper_FillHoles::prepareWires(const TopTools_SequenceOfSha } //======================================================================= //function : buildSurface -//purpose : +//purpose : //======================================================================= Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWire, @@ -277,7 +275,6 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi { Handle(Geom_BSplineSurface) aSurf; try { - GeomPlate_BuildPlateSurface aBuilder(myDegree, myNbPtsOnCur, myNbIter, myTol2d, myTol3d, myTolAng, myTolCrv); TopoDS_Iterator aIter; @@ -288,7 +285,7 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi Handle(BRepAdaptor_HCurve) aHAD= new BRepAdaptor_HCurve(adC); Handle(BRepFill_CurveConstraint) aConst = new BRepFill_CurveConstraint (aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d); - //Handle(GeomPlate_CurveConstraint) aConst = + //Handle(GeomPlate_CurveConstraint) aConst = // new GeomPlate_CurveConstraint(aHAD, (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d); aBuilder.Add (aConst); } @@ -308,17 +305,16 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi S3d.Clear(); aBuilder.Disc2dContour(4,S2d); aBuilder.Disc3dContour(4,0,S3d); - Standard_Real amaxTol = Max( myTol3d, 10* aDist); + Standard_Real amaxTol = Max( myTol3d, 10* aDist); GeomPlate_PlateG0Criterion Criterion( S2d, S3d, amaxTol ); GeomPlate_MakeApprox Approx( aPlSurf, Criterion, myTol3d, myMaxSeg, myMaxDeg ); aSurf = Approx.Surface(); if(aSurf.IsNull()) return aSurf; - + theCurves2d = aBuilder.Curves2d(); theOrders = aBuilder.Order(); theSenses = aBuilder.Sense(); - } catch (Standard_Failure) { @@ -330,7 +326,7 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi //======================================================================= //function : addFace -//purpose : +//purpose : //======================================================================= Standard_Boolean ShHealOper_FillHoles::addFace(const Handle(Geom_Surface)& theSurf, @@ -339,10 +335,13 @@ Standard_Boolean ShHealOper_FillHoles::addFace(const Handle(Geom_Surface)& theSu const Handle(TColStd_HArray1OfInteger)& theOrders, const Handle(TColStd_HArray1OfInteger)& theSenses) { +#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version + BRepBuilderAPI_MakeFace aMakeFace (theSurf, Precision::Confusion()); +#else BRepBuilderAPI_MakeFace aMakeFace (theSurf); +#endif TopoDS_Face aFace = aMakeFace.Face(); aFace.EmptyCopy(); - TopoDS_Wire aWire; BRep_Builder aB; @@ -358,9 +357,9 @@ Standard_Boolean ShHealOper_FillHoles::addFace(const Handle(Geom_Surface)& theSu BRep_Tool::Range (anEdge, aF, aL); TopLoc_Location aLoc; aB.UpdateEdge (anEdge, theCurves2d->Value (aInd),aFace, 0.); - + aB.Range (anEdge, aFace, aF, aL); - + // Set orientation of the edge: orientation should be changed // if its orientation does not make sence with curve orientation // recommended by GeomPlate @@ -409,7 +408,7 @@ Standard_Boolean ShHealOper_FillHoles::addFace(const Handle(Geom_Surface)& theSu //======================================================================= //function : getResShape -//purpose : +//purpose : //======================================================================= void ShHealOper_FillHoles::getResShape(const TopoDS_Shape& theAddShape, @@ -432,7 +431,6 @@ void ShHealOper_FillHoles::getResShape(const TopoDS_Shape& theAddShape, aB.MakeShell(aTmpShell); TopTools_SequenceOfShape aseqShells; if(anhasShell) { - aB.Add(aTmpShell,theAddShape); Standard_Integer i =1; for( ; i <= aMapParent.Extent(); i++) { @@ -452,9 +450,8 @@ void ShHealOper_FillHoles::getResShape(const TopoDS_Shape& theAddShape, TopoDS_Shape anshape = asfs->Shape(); myContext->Replace(aseqShells.Value(1),anshape); Standard_Integer i =2; - for( ; i<= aseqShells.Length(); i++) + for( ; i<= aseqShells.Length(); i++) myContext->Remove(aseqShells.Value(i)); - } else { TopoDS_Compound aComp; @@ -465,6 +462,5 @@ void ShHealOper_FillHoles::getResShape(const TopoDS_Shape& theAddShape, aB.Add(aComp,aIt.Value()); aB.Add(aComp,theAddShape); myContext->Replace( oldshape,aComp); - } }