From: rnc Date: Thu, 22 Aug 2013 11:40:15 +0000 (+0000) Subject: Merge from V7_main X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d2ee158882138698f25a37da9de5ee265b1c1814;p=modules%2Fsmesh.git Merge from V7_main --- diff --git a/configure.ac b/configure.ac index e97b1b891..07888a278 100644 --- a/configure.ac +++ b/configure.ac @@ -587,9 +587,6 @@ AC_OUTPUT([ \ src/Tools/padder/spadderpy/plugin/Makefile \ src/Tools/padder/spadderpy/plugin/envPlugins.sh \ src/Tools/padder/resources/Makefile \ - src/Tools/padder/resources/appligen/Makefile \ - src/Tools/padder/resources/appligen/appligen.sh \ - src/Tools/padder/resources/appligen/config_appli.xml \ src/Tools/padder/resources/testdata/Makefile \ src/Tools/padder/unittests/Makefile \ src/Tools/padder/unittests/autotest.sh \ diff --git a/doc/salome/examples/Makefile.am b/doc/salome/examples/Makefile.am index 94c233a75..1846b16a2 100644 --- a/doc/salome/examples/Makefile.am +++ b/doc/salome/examples/Makefile.am @@ -110,6 +110,7 @@ GOOD_TESTS = \ grouping_elements_ex08.py \ measurements_ex01.py \ measurements_ex02.py \ + measurements_ex03.py \ modifying_meshes_ex01.py \ modifying_meshes_ex02.py \ modifying_meshes_ex03.py \ diff --git a/doc/salome/examples/measurements_ex03.py b/doc/salome/examples/measurements_ex03.py new file mode 100644 index 000000000..5a44cdaca --- /dev/null +++ b/doc/salome/examples/measurements_ex03.py @@ -0,0 +1,79 @@ +# Basic Properties + + +import salome +salome.salome_init() +import GEOM +from salome.geom import geomBuilder +geompy = geomBuilder.New(salome.myStudy) + +import SMESH, SALOMEDS +from salome.smesh import smeshBuilder +smesh = smeshBuilder.New(salome.myStudy) + +# create a box +box = geompy.MakeBoxDXDYDZ(100,100,100) +face = geompy.SubShapeAllSorted(box, geompy.ShapeType['FACE'])[0] + +# mesh a box +mesh = smesh.Mesh(box) +submesh_1d = mesh.Segment().NumberOfSegments(5) +submesh_2d = mesh.Quadrangle() +submesh_3d = mesh.Hexahedron() +submesh_2d_face = mesh.Triangle(face) +mesh.Compute() + +# create a group + +group_2d = mesh.Group(face) + +# compute basic properties + +print "Get basic properties: approach 1 (via measurements tool) ----" + +measure = smesh.CreateMeasurements() + +print "* for mesh:" +print " length:", measure.Length(mesh.mesh) +print " area:", measure.Area(mesh.mesh) +print " volume:", measure.Volume(mesh.mesh) + +print "* for group (2d):" +print " length:", measure.Length(group_2d) +print " area:", measure.Area(group_2d) +print " volume:", measure.Volume(group_2d) + +print "* for submesh (2d):" +print " length:", measure.Length(submesh_2d_face.GetSubMesh()) +print " area:", measure.Area(submesh_2d_face.GetSubMesh()) +print " volume:", measure.Volume(submesh_2d_face.GetSubMesh()) + +measure.UnRegister() + +print "Get basic properties: approach 2 (via smeshBuilder) ----" + +print "* for mesh:" +print " length:", smesh.GetLength(mesh) +print " area:", smesh.GetArea(mesh) +print " volume:", smesh.GetVolume(mesh) + +print "* for group (2d):" +print " length:", smesh.GetLength(group_2d) +print " area:", smesh.GetArea(group_2d) +print " volume:", smesh.GetVolume(group_2d) + +print "* for submesh (2d):" +print " length:", smesh.GetLength(submesh_2d_face) +print " area:", smesh.GetArea(submesh_2d_face) +print " volume:", smesh.GetVolume(submesh_2d_face) + +print "Get basic properties: approach 3 (via smeshBuilder.Mesh) ----" + +print "* for mesh:" +print " length:", mesh.GetLength() +print " area:", mesh.GetArea() +print " volume:", mesh.GetVolume() + +print "* for group (2d): unsupported" + +print "* for submesh (2d): unsupported" diff --git a/doc/salome/gui/SMESH/images/basic_props.png b/doc/salome/gui/SMESH/images/basic_props.png new file mode 100644 index 000000000..bba200d09 Binary files /dev/null and b/doc/salome/gui/SMESH/images/basic_props.png differ diff --git a/doc/salome/gui/SMESH/images/bnd_box.png b/doc/salome/gui/SMESH/images/bnd_box.png index 6761a76ff..d079eaaa4 100644 Binary files a/doc/salome/gui/SMESH/images/bnd_box.png and b/doc/salome/gui/SMESH/images/bnd_box.png differ diff --git a/doc/salome/gui/SMESH/images/extrusion1.png b/doc/salome/gui/SMESH/images/extrusion1.png deleted file mode 100644 index 540bce24a..000000000 Binary files a/doc/salome/gui/SMESH/images/extrusion1.png and /dev/null differ diff --git a/doc/salome/gui/SMESH/images/extrusion_along_path_dlg.png b/doc/salome/gui/SMESH/images/extrusion_along_path_dlg.png new file mode 100644 index 000000000..540bce24a Binary files /dev/null and b/doc/salome/gui/SMESH/images/extrusion_along_path_dlg.png differ diff --git a/doc/salome/gui/SMESH/images/min_distance.png b/doc/salome/gui/SMESH/images/min_distance.png index 765522e88..486dab376 100644 Binary files a/doc/salome/gui/SMESH/images/min_distance.png and b/doc/salome/gui/SMESH/images/min_distance.png differ diff --git a/doc/salome/gui/SMESH/input/extrusion_along_path.doc b/doc/salome/gui/SMESH/input/extrusion_along_path.doc index e391111d8..d58f9697f 100644 --- a/doc/salome/gui/SMESH/input/extrusion_along_path.doc +++ b/doc/salome/gui/SMESH/input/extrusion_along_path.doc @@ -79,7 +79,7 @@ path item or click "Extrusion along a path" button in the toolbar. The following dialog common for line and planar elements will appear: -\image html extrusion1.png +\image html extrusion_along_path_dlg.png
  • In this dialog: @@ -99,28 +99,31 @@ about filters in the \ref selection_filter_library_page "Selection filter librar
  • -
  • define the Path along which the elements will be extruded, -\n Path definition consists of several elements: - +
  • define the \b Path along which the elements will be extruded.
    + Path definition consists of several elements: +
  • -
  • activate Generate Groups checkbox if it is necessary to copy the groups of -elements of the source mesh to the newly created one.
  • +
  • activate Generate Groups checkbox if it is necessary to copy the groups of + elements of the source mesh to the newly created one.
  • There are two optional parameters, which can be very useful: diff --git a/doc/salome/gui/SMESH/input/measurements.doc b/doc/salome/gui/SMESH/input/measurements.doc index 6514cf287..0787b7c20 100644 --- a/doc/salome/gui/SMESH/input/measurements.doc +++ b/doc/salome/gui/SMESH/input/measurements.doc @@ -64,6 +64,32 @@ viewer. \image html bnd_box_preview.png +\section basic_properties_anchor Basic Properties + +This operation allows calculation of length, area or volume for the the selected +object: +- Length is calculated as a sum of length of all 1D elements; +- Area id a sum of area of all 2D elements +- Volume is a sum of volume of all 3D elements. + +To start one of Basic Properties calculations, select Length, Area +or Volume item from Measurements - Basic Properties menu. + +\image html basic_props.png + +In the dialog box select the required type of calculation (length, area or volume), select +the the object (mesh, sub-mesh or group) and press \em Compute button. + +The result of calculation will be shown in the bottom area of the +dialog box. + +\note +- If mesh consists of 3D elements only, its "length" and "area" will be 0. +- As calculation result is a sum of length, area and volume of all mesh elements, + duplications are not taken into account; i.e. all duplicated elements + (elements built on the same set of nodes) will be included into the result. +- Similarly, intersection of elements is not taken into account. + See Also a sample TUI Script of a \ref tui_measurements_page "Measurement operations". diff --git a/doc/salome/gui/SMESH/input/taper.doc b/doc/salome/gui/SMESH/input/taper.doc index 86472eabe..143c34628 100644 --- a/doc/salome/gui/SMESH/input/taper.doc +++ b/doc/salome/gui/SMESH/input/taper.doc @@ -6,7 +6,8 @@ of two triangles separated by a diagonal. So it can be calculated only for elements consisting of 4 nodes. -\image html image25.png +
    JA=0.25 * (A1 + A2 + A3 + A4) +
    TAPER= MAX(|A1/JA - 1|, |A2/JA - 1|, |A3/JA - 1|, |A4/JA - 1|)

    To apply the Taper quality criterion to your mesh: diff --git a/doc/salome/gui/SMESH/input/tui_measurements.doc b/doc/salome/gui/SMESH/input/tui_measurements.doc index 4d25c7358..950cc2aba 100644 --- a/doc/salome/gui/SMESH/input/tui_measurements.doc +++ b/doc/salome/gui/SMESH/input/tui_measurements.doc @@ -8,4 +8,7 @@ \section tui_bounding_box Bounding Box \tui_script{measurements_ex02.py} +\section tui_bounding_box Basic Properties +\tui_script{measurements_ex03.py} + */ diff --git a/idl/SMESH_Measurements.idl b/idl/SMESH_Measurements.idl index becc67547..43e5bf2bc 100644 --- a/idl/SMESH_Measurements.idl +++ b/idl/SMESH_Measurements.idl @@ -55,6 +55,21 @@ module SMESH * common bounding box of entities */ Measure BoundingBox(in ListOfIDSources sources); + + /*! + * sum of length of 1D elements of the source + */ + double Length(in SMESH_IDSource source); + + /*! + * sum of area of 2D elements of the source + */ + double Area(in SMESH_IDSource source); + + /*! + * sum of volume of 3D elements of the source + */ + double Volume(in SMESH_IDSource source); }; }; diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 4796428fd..fb85b15af 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -277,7 +277,7 @@ module SMESH interface SMESH_Mesh; - interface SMESH_IDSource + interface SMESH_IDSource : SALOME::GenericObj { /*! * Returns a sequence of all element IDs diff --git a/resources/Makefile.am b/resources/Makefile.am index 7a057d202..786c3cd48 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -208,7 +208,11 @@ dist_salomeres_DATA = \ mesh_min_dist.png \ reorient_faces_point.png \ reorient_faces_face.png \ - mesh_ball.png + mesh_ball.png \ + mesh_measure_basic_props.png \ + mesh_measure_length.png \ + mesh_measure_area.png \ + mesh_measure_volume.png # VSR: little trick to avoid putting if SMESHCatalog.xml to the distribution archive nodist_salomeres_SCRIPTS = SMESHCatalog.xml SalomeApp.xml diff --git a/resources/StdMeshers.xml b/resources/StdMeshers.xml index 3deebff7c..6e8791a2a 100644 --- a/resources/StdMeshers.xml +++ b/resources/StdMeshers.xml @@ -30,6 +30,7 @@ diff --git a/resources/mesh_measure_area.png b/resources/mesh_measure_area.png new file mode 100644 index 000000000..72d292be9 Binary files /dev/null and b/resources/mesh_measure_area.png differ diff --git a/resources/mesh_measure_basic_props.png b/resources/mesh_measure_basic_props.png new file mode 100644 index 000000000..4d7ed1378 Binary files /dev/null and b/resources/mesh_measure_basic_props.png differ diff --git a/resources/mesh_measure_length.png b/resources/mesh_measure_length.png new file mode 100644 index 000000000..996f7c311 Binary files /dev/null and b/resources/mesh_measure_length.png differ diff --git a/resources/mesh_measure_volume.png b/resources/mesh_measure_volume.png new file mode 100644 index 000000000..7e4ae014d Binary files /dev/null and b/resources/mesh_measure_volume.png differ diff --git a/src/Controls/Makefile.am b/src/Controls/Makefile.am index 85ea9f18d..59fcdd291 100644 --- a/src/Controls/Makefile.am +++ b/src/Controls/Makefile.am @@ -54,7 +54,8 @@ libSMESHControls_la_LDFLAGS = \ ../SMESHDS/libSMESHDS.la \ ../SMESHUtils/libSMESHUtils.la \ $(CAS_LDPATH) -lTKernel -lTKBRep -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKGeomAlgo \ - $(VTK_LIBS) + $(VTK_LIBS) \ + $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics SMESHControls_CPPFLAGS = \ $(libSMESHControls_la_CPPFLAGS) @@ -64,6 +65,6 @@ SMESHControls_LDADD = \ ../SMDS/libSMDS.la \ ../SMESHDS/libSMESHDS.la \ libSMESHControls.la \ - $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics \ + $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics -lSalomeIDLKernel \ $(GEOM_LDFLAGS) -lGEOMAlgo \ $(CAS_LDPATH) -lTKernel -lTKBRep -lTKG3d diff --git a/src/DriverDAT/Makefile.am b/src/DriverDAT/Makefile.am index 8eb6ba0b6..c5180bfa6 100644 --- a/src/DriverDAT/Makefile.am +++ b/src/DriverDAT/Makefile.am @@ -57,7 +57,7 @@ libMeshDriverDAT_la_CPPFLAGS = \ libMeshDriverDAT_la_LDFLAGS = \ ../Driver/libMeshDriver.la \ - $(KERNEL_LDFLAGS) -lSALOMEBasics \ + $(KERNEL_LDFLAGS) -lSALOMEBasics -lSalomeIDLKernel \ $(CAS_KERNEL) DAT_Test_CPPFLAGS = \ @@ -67,5 +67,5 @@ DAT_Test_LDADD = \ libMeshDriverDAT.la \ ../Driver/libMeshDriver.la \ ../SMDS/libSMDS.la \ - $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics + $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics -lSalomeIDLKernel diff --git a/src/DriverMED/Makefile.am b/src/DriverMED/Makefile.am index dc58802a1..95b5a0153 100644 --- a/src/DriverMED/Makefile.am +++ b/src/DriverMED/Makefile.am @@ -81,6 +81,7 @@ MED_Test_LDADD = \ -lOpUtil \ -lSALOMELocalTrace \ -lSALOMEBasics \ + -lSalomeIDLKernel \ ../MEDWrapper/Factory/libMEDWrapper.la \ ../MEDWrapper/Base/libMEDWrapperBase.la \ ../MEDWrapper/V2_2/libMEDWrapper_V2_2.la \ diff --git a/src/DriverSTL/Makefile.am b/src/DriverSTL/Makefile.am index 8368238b3..3e3864f43 100644 --- a/src/DriverSTL/Makefile.am +++ b/src/DriverSTL/Makefile.am @@ -70,6 +70,6 @@ STL_Test_LDADD = \ libMeshDriverSTL.la \ ../Driver/libMeshDriver.la \ ../SMDS/libSMDS.la \ - $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics \ + $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics -lSalomeIDLKernel \ $(CAS_LDPATH) -lTKernel -lTKSTL -lTKTopAlgo -lTKMesh -lTKBO diff --git a/src/DriverUNV/Makefile.am b/src/DriverUNV/Makefile.am index ce249bc07..0be78fe5b 100644 --- a/src/DriverUNV/Makefile.am +++ b/src/DriverUNV/Makefile.am @@ -82,4 +82,4 @@ UNV_Test_LDADD = \ libMeshDriverUNV.la \ ../Driver/libMeshDriver.la \ ../SMDS/libSMDS.la \ - $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics + $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics -lSalomeIDLKernel diff --git a/src/DriverUNV/UNV164_Structure.cxx b/src/DriverUNV/UNV164_Structure.cxx index 64f5187d1..a4cd6c624 100644 --- a/src/DriverUNV/UNV164_Structure.cxx +++ b/src/DriverUNV/UNV164_Structure.cxx @@ -42,7 +42,7 @@ void UNV164::Read(std::ifstream& in_stream, TRecord& theUnitsRecord ) return; string num_buf; - char line[theMaxLineLen]; + char line[theMaxLineLen] = ""; in_stream >> theUnitsRecord.units_code; in_stream.readsome( line, 20 ); diff --git a/src/SMDS/ObjectPool.hxx b/src/SMDS/ObjectPool.hxx index abb7c15f2..e664c260c 100644 --- a/src/SMDS/ObjectPool.hxx +++ b/src/SMDS/ObjectPool.hxx @@ -42,9 +42,16 @@ private: int _nextFree; int _maxAvail; int _chunkSize; + int _maxOccupied; + int _nbHoles; int getNextFree() { + // Don't iterate on the _freeList if all the "holes" + // are filled. Go straight to the last occupied ID + 1 + if ( _nbHoles == 0 ) + return std::min(_maxOccupied + 1, _maxAvail); + for (int i = _nextFree; i < _maxAvail; i++) if (_freeList[i] == true) { @@ -73,6 +80,8 @@ public: _chunkSize = nblk; _nextFree = 0; _maxAvail = 0; + _maxOccupied = 0; + _nbHoles = 0; _chunkList.clear(); _freeList.clear(); } @@ -103,6 +112,14 @@ public: _freeList[_nextFree] = false; obj = _chunkList[chunkId] + rank; // &_chunkList[chunkId][rank]; } + if (_nextFree < _maxOccupied) + { + _nbHoles-=1; + } + else + { + _maxOccupied = _nextFree; + } //obj->init(); return obj; } @@ -124,6 +141,8 @@ public: _freeList[toFree] = true; if (toFree < _nextFree) _nextFree = toFree; + if (toFree < _maxOccupied) + _nbHoles += 1; //obj->clean(); //checkDelete(i); compactage non fait break; @@ -134,6 +153,8 @@ public: { _nextFree = 0; _maxAvail = 0; + _maxOccupied = 0; + _nbHoles = 0; for (size_t i = 0; i < _chunkList.size(); i++) delete[] _chunkList[i]; clearVector( _chunkList ); diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index b27c89703..b7ec35521 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -3370,6 +3370,7 @@ void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem) myNodes[elemId] = 0; myInfo.myNbNodes--; ((SMDS_MeshNode*) n)->SetPosition(SMDS_SpacePosition::originSpacePosition()); + ((SMDS_MeshNode*) n)->SMDS_MeshElement::init( -1, -1, -1 ); // avoid reuse myNodePool->destroy(static_cast(todest)); myNodeIDFactory->ReleaseID(elemId, vtkId); } diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index 78238dcea..045178942 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -141,7 +141,7 @@ public: * \param node - the node to check * \retval int - node index within the element, -1 if not found */ - int GetNodeIndex( const SMDS_MeshNode* node ) const; + virtual int GetNodeIndex( const SMDS_MeshNode* node ) const; inline ShortType getMeshId() const { return myMeshId; } inline LongType getshapeId() const { return myShapeId; } diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index 80bbf81c8..01a118406 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -165,7 +165,7 @@ public: cellList.push_back(vtkId); } } - myCells = &cellList[0]; + myCells = cellList.empty() ? 0 : &cellList[0]; myNcells = cellList.size(); //MESSAGE("myNcells="<& idNodesOldToNew, int n } newFaceLocations->Squeeze(); newFaces->Squeeze(); - newFaceLocations->Register(this); - newFaces->Register(this); this->SetCells(newTypes, newLocations, newConnectivity, newFaceLocations, newFaces); newFaceLocations->Delete(); newFaces->Delete(); @@ -328,7 +326,7 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes, int start, int end) { - MESSAGE("copyBloc " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start); + //MESSAGE("copyBloc " << alreadyCopied << " " << start << " " << end << " size: " << end - start << " total: " << alreadyCopied + end - start); for (int j = start; j < end; j++) { newTypes->SetValue(alreadyCopied, this->Types->GetValue(j)); diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index 982942827..56e7a3132 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -1507,17 +1507,21 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex, const SMDS_MeshElement** otherV const SMDS_MeshNode** nodes = GetFaceNodes( faceIndex ); // a set of facet nodes w/o medium ones and w/o nodes[0] - set< const SMDS_MeshNode* > nodeSet; + set< const SMDS_MeshElement* > nodeSet; const int di = myVolume->IsQuadratic() ? 2 : 1; for ( int i = di; i < myFaceNbNodes; i += di ) nodeSet.insert( nodes[i] ); SMDS_ElemIteratorPtr eIt = nodes[0]->GetInverseElementIterator( SMDSAbs_Volume ); + SMDS_ElemIteratorPtr nIt; while ( eIt->more() ) { const SMDS_MeshElement* vol = eIt->next(); if ( vol != myVolume ) { size_t nbShared = 0; - SMDS_NodeIteratorPtr nIt = vol->nodeIterator(); + if ( const SMDS_VtkVolume* v = dynamic_cast< const SMDS_VtkVolume* >( vol )) + nIt = v->uniqueNodesIterator(); + else + nIt = vol->nodesIterator(); while ( nIt->more() ) if (( nbShared += nodeSet.count( nIt->next() )) == nodeSet.size() ) { diff --git a/src/SMDS/SMDS_VtkFace.cxx b/src/SMDS/SMDS_VtkFace.cxx index 56787bda0..3d5e82fee 100644 --- a/src/SMDS/SMDS_VtkFace.cxx +++ b/src/SMDS/SMDS_VtkFace.cxx @@ -161,6 +161,22 @@ SMDS_VtkFace::GetNode(const int ind) const return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ ind ]); } +/*! + * \brief Check if a node belongs to the element + * \param node - the node to check + * \retval int - node index within the element, -1 if not found + */ +int SMDS_VtkFace::GetNodeIndex( const SMDS_MeshNode* node ) const +{ + vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); + vtkIdType npts, *pts; + grid->GetCellPoints( this->myVtkID, npts, pts ); + for ( vtkIdType i = 0; i < npts; ++i ) + if ( pts[i] == node->getVtkId() ) + return i; + return -1; +} + bool SMDS_VtkFace::IsQuadratic() const { vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); diff --git a/src/SMDS/SMDS_VtkFace.hxx b/src/SMDS/SMDS_VtkFace.hxx index 5fc10324d..f62b86c00 100644 --- a/src/SMDS/SMDS_VtkFace.hxx +++ b/src/SMDS/SMDS_VtkFace.hxx @@ -47,6 +47,7 @@ public: virtual SMDSAbs_EntityType GetEntityType() const; virtual SMDSAbs_GeometryType GetGeomType() const; virtual const SMDS_MeshNode* GetNode(const int ind) const; + virtual int GetNodeIndex( const SMDS_MeshNode* node ) const; virtual bool IsQuadratic() const; virtual bool IsPoly() const; diff --git a/src/SMDS/SMDS_VtkVolume.cxx b/src/SMDS/SMDS_VtkVolume.cxx index 3db0ba03b..7acdbf37c 100644 --- a/src/SMDS/SMDS_VtkVolume.cxx +++ b/src/SMDS/SMDS_VtkVolume.cxx @@ -448,6 +448,41 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetNode(const int ind) const const std::vector& interlace = SMDS_MeshCell::fromVtkOrder( VTKCellType( aVtkType )); return SMDS_Mesh::_meshList[myMeshId]->FindNodeVtk( pts[ interlace.empty() ? ind : interlace[ind]] ); } +/*! + * \brief Check if a node belongs to the element + * \param node - the node to check + * \retval int - node index within the element, -1 if not found + */ +int SMDS_VtkVolume::GetNodeIndex( const SMDS_MeshNode* node ) const +{ + vtkUnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); + const vtkIdType aVtkType = grid->GetCellType(this->myVtkID); + if ( aVtkType == VTK_POLYHEDRON) + { + vtkIdType nFaces = 0; + vtkIdType* ptIds = 0; + grid->GetFaceStream(this->myVtkID, nFaces, ptIds); + int id = 0; + for (int iF = 0; iF < nFaces; iF++) + { + int nodesInFace = ptIds[id]; + for ( vtkIdType i = 0; i < nodesInFace; ++i ) + if ( ptIds[id+i+1] == node->getVtkId() ) + return id+i-iF; + id += (nodesInFace + 1); + } + return -1; + } + vtkIdType npts, *pts; + grid->GetCellPoints( this->myVtkID, npts, pts ); + for ( vtkIdType i = 0; i < npts; ++i ) + if ( pts[i] == node->getVtkId() ) + { + const std::vector& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( aVtkType )); + return interlace.empty() ? i : interlace[i]; + } + return -1; +} bool SMDS_VtkVolume::IsQuadratic() const { diff --git a/src/SMDS/SMDS_VtkVolume.hxx b/src/SMDS/SMDS_VtkVolume.hxx index 63c41ecb7..827f17fd7 100644 --- a/src/SMDS/SMDS_VtkVolume.hxx +++ b/src/SMDS/SMDS_VtkVolume.hxx @@ -56,6 +56,7 @@ public: virtual SMDSAbs_EntityType GetEntityType() const; virtual SMDSAbs_GeometryType GetGeomType() const; virtual const SMDS_MeshNode* GetNode(const int ind) const; + virtual int GetNodeIndex( const SMDS_MeshNode* node ) const; virtual bool IsQuadratic() const; virtual bool IsPoly() const; virtual bool IsMediumNode(const SMDS_MeshNode* node) const; diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 263a1e673..f08542dc0 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -38,6 +38,7 @@ #include "SMESH_Gen.hxx" #include "SMESH_HypoFilter.hxx" #include "SMESH_Mesh.hxx" +#include "SMESH_MeshAlgos.hxx" #include "SMESH_TypeDefs.hxx" #include "SMESH_subMesh.hxx" @@ -71,6 +72,8 @@ #include #include +#include "SMESH_ProxyMesh.hxx" +#include "SMESH_MesherHelper.hxx" using namespace std; @@ -526,6 +529,57 @@ GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1, return GeomAbs_C0; } +//================================================================================ +/*! + * \brief Return true if an edge can be considered straight + */ +//================================================================================ + +bool SMESH_Algo::isStraight( const TopoDS_Edge & E, + const bool degenResult) +{ + { + double f,l; + if ( BRep_Tool::Curve( E, f, l ).IsNull()) + return degenResult; + } + BRepAdaptor_Curve curve( E ); + switch( curve.GetType() ) + { + case GeomAbs_Line: + return true; + case GeomAbs_Circle: + case GeomAbs_Ellipse: + case GeomAbs_Hyperbola: + case GeomAbs_Parabola: + return false; + // case GeomAbs_BezierCurve: + // case GeomAbs_BSplineCurve: + // case GeomAbs_OtherCurve: + default:; + } + const double f = curve.FirstParameter(); + const double l = curve.LastParameter(); + const gp_Pnt pf = curve.Value( f ); + const gp_Pnt pl = curve.Value( l ); + const gp_Vec v1( pf, pl ); + const double v1Len = v1.Magnitude(); + if ( v1Len < std::numeric_limits< double >::min() ) + return false; // E seems closed + const double tol = Min( 10 * curve.Tolerance(), v1Len * 1e-2 ); + const int nbSamples = 7; + for ( int i = 0; i < nbSamples; ++i ) + { + const double r = ( i + 1 ) / nbSamples; + const gp_Pnt pi = curve.Value( f * r + l * ( 1 - r )); + const gp_Vec vi( pf, pi ); + const double h = 0.5 * v1.Crossed( vi ).Magnitude() / v1Len; + if ( h > tol ) + return false; + } + return true; +} + //================================================================================ /*! * \brief Return the node built on a vertex @@ -848,3 +902,206 @@ int SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W) } +//================================================================================ +/*! + * Method in which an algorithm generating a structured mesh + * fixes positions of in-face nodes after there movement + * due to insertion of viscous layers. + */ +//================================================================================ + +bool SMESH_2D_Algo::FixInternalNodes(const SMESH_ProxyMesh& mesh, + const TopoDS_Face& face) +{ + const SMESHDS_SubMesh* smDS = mesh.GetSubMesh(face); + if ( !smDS || smDS->NbElements() < 1 ) + return false; + + SMESH_MesherHelper helper( *mesh.GetMesh() ); + + // get all faces from a proxy sub-mesh + typedef SMDS_StdIterator< const SMDS_MeshElement*, SMDS_ElemIteratorPtr > TIterator; + TIDSortedElemSet allFaces( TIterator( smDS->GetElements() ), TIterator() ); + TIDSortedElemSet avoidSet, firstRowQuads; + + // indices of nodes to pass to a neighbour quad using SMESH_MeshAlgos::FindFaceInSet() + int iN1, iN2; + + // get two first rows of nodes by passing through the first row of faces + vector< vector< const SMDS_MeshNode* > > nodeRows; + int iRow1 = 0, iRow2 = 1; + const SMDS_MeshElement* quad; + { + // look for a corner quadrangle and it's corner node + const SMDS_MeshElement* cornerQuad = 0; + int cornerNodeInd = -1; + SMDS_ElemIteratorPtr fIt = smDS->GetElements(); + while ( !cornerQuad && fIt->more() ) + { + cornerQuad = fIt->next(); + if ( cornerQuad->NbCornerNodes() != 4 ) + return false; + SMDS_NodeIteratorPtr nIt = cornerQuad->nodeIterator(); + for ( int i = 0; i < 4; ++i ) + { + int nbInverseQuads = 0; + SMDS_ElemIteratorPtr fIt = nIt->next()->GetInverseElementIterator(SMDSAbs_Face); + while ( fIt->more() ) + nbInverseQuads += allFaces.count( fIt->next() ); + if ( nbInverseQuads == 1 ) + cornerNodeInd = i, i = 4; + } + if ( cornerNodeInd < 0 ) + cornerQuad = 0; + } + if ( !cornerQuad || cornerNodeInd < 0 ) + return false; + + iN1 = helper.WrapIndex( cornerNodeInd + 1, 4 ); + iN2 = helper.WrapIndex( cornerNodeInd + 2, 4 ); + int iN3 = helper.WrapIndex( cornerNodeInd + 3, 4 ); + nodeRows.resize(2); + nodeRows[iRow1].push_back( cornerQuad->GetNode( cornerNodeInd )); + nodeRows[iRow1].push_back( cornerQuad->GetNode( iN1 )); + nodeRows[iRow2].push_back( cornerQuad->GetNode( iN3 )); + nodeRows[iRow2].push_back( cornerQuad->GetNode( iN2 )); + firstRowQuads.insert( cornerQuad ); + + // pass through the rest quads in a face row + quad = cornerQuad; + while ( quad ) + { + avoidSet.clear(); + avoidSet.insert( quad ); + if (( quad = SMESH_MeshAlgos::FindFaceInSet( nodeRows[iRow1].back(), + nodeRows[iRow2].back(), + allFaces, avoidSet, &iN1, &iN2))) + { + nodeRows[iRow1].push_back( quad->GetNode( helper.WrapIndex( iN2 + 2, 4 ))); + nodeRows[iRow2].push_back( quad->GetNode( helper.WrapIndex( iN1 + 2, 4 ))); + if ( quad->NbCornerNodes() != 4 ) + return false; + } + } + if ( nodeRows[iRow1].size() < 3 ) + return true; // there is nothing to fix + } + + nodeRows.reserve( smDS->NbElements() / nodeRows[iRow1].size() ); + + // get the rest node rows + while ( true ) + { + ++iRow1, ++iRow2; + + // get the first quad in the next face row + if (( quad = SMESH_MeshAlgos::FindFaceInSet( nodeRows[iRow1][0], + nodeRows[iRow1][1], + allFaces, /*avoid=*/firstRowQuads, + &iN1, &iN2))) + { + if ( quad->NbCornerNodes() != 4 ) + return false; + nodeRows.resize( iRow2+1 ); + nodeRows[iRow2].push_back( quad->GetNode( helper.WrapIndex( iN2 + 2, 4 ))); + nodeRows[iRow2].push_back( quad->GetNode( helper.WrapIndex( iN1 + 2, 4 ))); + firstRowQuads.insert( quad ); + } + else + { + break; // no more rows + } + + // pass through the rest quads in a face row + while ( quad ) + { + avoidSet.clear(); + avoidSet.insert( quad ); + if (( quad = SMESH_MeshAlgos::FindFaceInSet( nodeRows[iRow1][ nodeRows[iRow2].size()-1 ], + nodeRows[iRow2].back(), + allFaces, avoidSet, &iN1, &iN2))) + { + if ( quad->NbCornerNodes() != 4 ) + return false; + nodeRows[iRow2].push_back( quad->GetNode( helper.WrapIndex( iN1 + 2, 4 ))); + } + } + if ( nodeRows[iRow1].size() != nodeRows[iRow2].size() ) + return false; + } + if ( nodeRows.size() < 3 ) + return true; // there is nothing to fix + + // get params of the first (bottom) and last (top) node rows + UVPtStructVec uvB( nodeRows[0].size() ), uvT( nodeRows[0].size() ); + for ( int isBot = 0; isBot < 2; ++isBot ) + { + UVPtStructVec & uvps = isBot ? uvB : uvT; + vector< const SMDS_MeshNode* >& nodes = nodeRows[ isBot ? 0 : nodeRows.size()-1 ]; + for ( size_t i = 0; i < nodes.size(); ++i ) + { + uvps[i].node = nodes[i]; + gp_XY uv = helper.GetNodeUV( face, uvps[i].node ); + uvps[i].u = uv.Coord(1); + uvps[i].v = uv.Coord(2); + uvps[i].x = 0; + } + // calculate x (normalized param) + for ( size_t i = 1; i < nodes.size(); ++i ) + uvps[i].x = uvps[i-1].x + SMESH_TNodeXYZ( uvps[i-1].node ).Distance( uvps[i].node ); + for ( size_t i = 1; i < nodes.size(); ++i ) + uvps[i].x /= uvps.back().x; + } + + // get params of the left and right node rows + UVPtStructVec uvL( nodeRows.size() ), uvR( nodeRows.size() ); + for ( int isLeft = 0; isLeft < 2; ++isLeft ) + { + UVPtStructVec & uvps = isLeft ? uvL : uvR; + const int iCol = isLeft ? 0 : nodeRows[0].size() - 1; + for ( size_t i = 0; i < nodeRows.size(); ++i ) + { + uvps[i].node = nodeRows[i][iCol]; + gp_XY uv = helper.GetNodeUV( face, uvps[i].node ); + uvps[i].u = uv.Coord(1); + uvps[i].v = uv.Coord(2); + uvps[i].y = 0; + } + // calculate y (normalized param) + for ( size_t i = 1; i < nodeRows.size(); ++i ) + uvps[i].y = uvps[i-1].y + SMESH_TNodeXYZ( uvps[i-1].node ).Distance( uvps[i].node ); + for ( size_t i = 1; i < nodeRows.size(); ++i ) + uvps[i].y /= uvps.back().y; + } + + // update node coordinates + SMESHDS_Mesh* meshDS = mesh.GetMeshDS(); + Handle(Geom_Surface) S = BRep_Tool::Surface( face ); + gp_XY a0 ( uvB.front().u, uvB.front().v ); + gp_XY a1 ( uvB.back().u, uvB.back().v ); + gp_XY a2 ( uvT.back().u, uvT.back().v ); + gp_XY a3 ( uvT.front().u, uvT.front().v ); + for ( size_t iRow = 1; iRow < nodeRows.size()-1; ++iRow ) + { + gp_XY p1 ( uvR[ iRow ].u, uvR[ iRow ].v ); + gp_XY p3 ( uvL[ iRow ].u, uvL[ iRow ].v ); + const double y0 = uvL[ iRow ].y; + const double y1 = uvR[ iRow ].y; + for ( size_t iCol = 1; iCol < nodeRows[0].size()-1; ++iCol ) + { + gp_XY p0 ( uvB[ iCol ].u, uvB[ iCol ].v ); + gp_XY p2 ( uvT[ iCol ].u, uvT[ iCol ].v ); + const double x0 = uvB[ iCol ].x; + const double x1 = uvT[ iCol ].x; + double x = (x0 + y0 * (x1 - x0)) / (1 - (y1 - y0) * (x1 - x0)); + double y = y0 + x * (y1 - y0); + gp_XY uv = helper.calcTFI( x, y, a0,a1,a2,a3, p0,p1,p2,p3 ); + gp_Pnt p = S->Value( uv.Coord(1), uv.Coord(2)); + const SMDS_MeshNode* n = nodeRows[iRow][iCol]; + meshDS->MoveNode( n, p.X(), p.Y(), p.Z() ); + if ( SMDS_FacePosition* pos = dynamic_cast< SMDS_FacePosition*>( n->GetPosition() )) + pos->SetParameters( uv.Coord(1), uv.Coord(2) ); + } + } + return true; +} diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index acb852b72..4d22e655d 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -52,6 +52,7 @@ class SMESH_Gen; class SMESH_HypoFilter; class SMESH_Mesh; class SMESH_MesherHelper; +class SMESH_ProxyMesh; class SMESH_subMesh; class TopoDS_Face; class TopoDS_Shape; @@ -356,6 +357,10 @@ public: static bool IsContinuous(const TopoDS_Edge & E1, const TopoDS_Edge & E2) { return ( Continuity( E1, E2 ) >= GeomAbs_G1 ); } + /*! + * \brief Return true if an edge can be considered straight + */ + static bool isStraight( const TopoDS_Edge & E, const bool degenResult=false ); /*! * \brief Return the node built on a vertex @@ -445,6 +450,13 @@ class SMESH_EXPORT SMESH_2D_Algo: public SMESH_Algo { public: SMESH_2D_Algo(int hypId, int studyId, SMESH_Gen* gen); + /*! + * \brief Method in which an algorithm generating a structured mesh + * fixes positions of in-face nodes after there movement + * due to insertion of viscous layers. + */ + virtual bool FixInternalNodes(const SMESH_ProxyMesh& mesh, + const TopoDS_Face& face); }; class SMESH_EXPORT SMESH_3D_Algo: public SMESH_Algo diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index bcddd46d5..a8a789fbd 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -66,6 +66,8 @@ #include #include +#include "SMESH_TryCatch.hxx" // include after OCCT headers! + #include "Utils_ExceptHandlers.hxx" #include @@ -1259,7 +1261,7 @@ void SMESH_Mesh::ExportMED(const char * file, bool theAutoDimension) throw(SALOME_Exception) { - Unexpect aCatch(SalomeException); + SMESH_TRY; DriverMED_W_SMESHDS_Mesh myWriter; myWriter.SetFile ( file, MED::EVersion(theVersion) ); @@ -1306,6 +1308,8 @@ void SMESH_Mesh::ExportMED(const char * file, } // Perform export myWriter.Perform(); + + SMESH_CATCH( SMESH::throwSalomeEx ); } //================================================================================ @@ -1486,12 +1490,16 @@ double SMESH_Mesh::GetComputeProgress() const currentSubIds.Add( smToCompute[i]->GetId() ); } double rate = algo->GetProgress(); - if ( !( 0. < rate && rate < 1.001 )) + if ( 0. < rate && rate < 1.001 ) + { + computedCost += rate * ( algoDoneCost + algoNotDoneCost ); + } + else { rate = algo->GetProgressByTic(); + computedCost += algoDoneCost + rate * algoNotDoneCost; } // cout << "rate: "<RemoveNode( volNodes[i] ); } } // loop on volumes to split - + myLastCreatedNodes = newNodes; myLastCreatedElems = newElems; } @@ -5144,7 +5144,7 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements, const TopoDS_Shape& aS = theTrack->GetShapeToMesh(); - if( aS == SMESH_Mesh::PseudoShape() ) { + if ( !theTrack->HasShapeToMesh() ) { //Mesh without shape const SMDS_MeshNode* currentNode = NULL; const SMDS_MeshNode* prevNode = theN1; @@ -5267,16 +5267,8 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements, if ( BRep_Tool::Degenerated( aTrackEdge ) ) return EXTR_BAD_PATH_SHAPE; TopExp::Vertices( aTrackEdge, aV1, aV2 ); - const SMDS_MeshNode* aN1 = 0; - const SMDS_MeshNode* aN2 = 0; - if ( theTrack->GetSubMesh( aV1 ) && theTrack->GetSubMesh( aV1 )->GetSubMeshDS() ) { - aItN = theTrack->GetSubMesh( aV1 )->GetSubMeshDS()->GetNodes(); - aN1 = aItN->next(); - } - if ( theTrack->GetSubMesh( aV2 ) && theTrack->GetSubMesh( aV2 )->GetSubMeshDS() ) { - aItN = theTrack->GetSubMesh( aV2 )->GetSubMeshDS()->GetNodes(); - aN2 = aItN->next(); - } + const SMDS_MeshNode* aN1 = SMESH_Algo::VertexNode( aV1, pMeshDS ); + const SMDS_MeshNode* aN2 = SMESH_Algo::VertexNode( aV2, pMeshDS ); // starting node must be aN1 or aN2 if ( !( aN1 == theN1 || aN2 == theN1 ) ) return EXTR_BAD_STARTING_NODE; @@ -5324,17 +5316,8 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements, if ( aVprev.IsNull() ) { // if previous vertex is not yet defined, it means that we in the beginning of wire // and we have to find initial vertex corresponding to starting node theN1 - const SMDS_MeshNode* aN1 = 0; - const SMDS_MeshNode* aN2 = 0; - - if ( locTrack->GetFather()->GetSubMesh(aV1) && locTrack->GetFather()->GetSubMesh(aV1)->GetSubMeshDS() ) { - aItN = locTrack->GetFather()->GetSubMesh(aV1)->GetSubMeshDS()->GetNodes(); - aN1 = aItN->next(); - } - if ( locTrack->GetFather()->GetSubMesh(aV2) && locTrack->GetFather()->GetSubMesh(aV2)->GetSubMeshDS() ) { - aItN = locTrack->GetFather()->GetSubMesh(aV2)->GetSubMeshDS()->GetNodes(); - aN2 = aItN->next(); - } + const SMDS_MeshNode* aN1 = SMESH_Algo::VertexNode( aV1, pMeshDS ); + const SMDS_MeshNode* aN2 = SMESH_Algo::VertexNode( aV2, pMeshDS ); // starting node must be aN1 or aN2 aN1isOK = ( aN1 && aN1 == theN1 ); aN2isOK = ( aN2 && aN2 == theN1 ); @@ -5368,27 +5351,21 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements, } } list< list >::iterator itLLPP = LLPPs.begin(); - list firstList = *itLLPP; - list::iterator itPP = firstList.begin(); - for(; itPP!=firstList.end(); itPP++) { - fullList.push_back( *itPP ); - } + list& firstList = *itLLPP; + fullList.splice( fullList.end(), firstList ); + SMESH_MeshEditor_PathPoint PP1 = fullList.back(); fullList.pop_back(); itLLPP++; for(; itLLPP!=LLPPs.end(); itLLPP++) { - list currList = *itLLPP; - itPP = currList.begin(); + list& currList = *itLLPP; SMESH_MeshEditor_PathPoint PP2 = currList.front(); gp_Dir D1 = PP1.Tangent(); gp_Dir D2 = PP2.Tangent(); gp_Dir Dnew( ( D1.XYZ() + D2.XYZ() ) / 2 ); PP1.SetTangent(Dnew); fullList.push_back(PP1); - itPP++; - for(; itPP!=currList.end(); itPP++) { - fullList.push_back( *itPP ); - } + fullList.splice( fullList.end(), currList, ++currList.begin(), currList.end() ); PP1 = fullList.back(); fullList.pop_back(); } @@ -5410,9 +5387,9 @@ SMESH_MeshEditor::ExtrusionAlongTrack (TIDSortedElemSet & theElements, //purpose : auxilary for ExtrusionAlongTrack //======================================================================= SMESH_MeshEditor::Extrusion_Error -SMESH_MeshEditor::MakeEdgePathPoints(std::list& aPrms, - const TopoDS_Edge& aTrackEdge, - bool FirstIsStart, +SMESH_MeshEditor::MakeEdgePathPoints(std::list& aPrms, + const TopoDS_Edge& aTrackEdge, + bool FirstIsStart, list& LPP) { Standard_Real aTx1, aTx2, aL2, aTolVec, aTolVec2; @@ -5465,63 +5442,43 @@ SMESH_MeshEditor::MakeEdgePathPoints(std::list& aPrms, //purpose : auxilary for ExtrusionAlongTrack //======================================================================= SMESH_MeshEditor::Extrusion_Error -SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements, +SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements, list& fullList, - const bool theHasAngles, - list& theAngles, - const bool theLinearVariation, - const bool theHasRefPoint, - const gp_Pnt& theRefPoint, - const bool theMakeGroups) + const bool theHasAngles, + list& theAngles, + const bool theLinearVariation, + const bool theHasRefPoint, + const gp_Pnt& theRefPoint, + const bool theMakeGroups) { - MESSAGE("MakeExtrElements"); - //cout<<"MakeExtrElements fullList.size() = "< aPPs(aNbTP); + const int aNbTP = fullList.size(); // Angles - if( theHasAngles && theAngles.size()>0 && theLinearVariation ) { + if( theHasAngles && !theAngles.empty() && theLinearVariation ) LinearAngleVariation(aNbTP-1, theAngles); - } - vector aAngles( aNbTP ); - int j = 0; - for(; j::iterator aItD = theAngles.begin(); - for ( j=1; (aItD != theAngles.end()) && (j aPPs; list::iterator itPP = fullList.begin(); - for(; itPP!=fullList.end(); itPP++) { - j++; - SMESH_MeshEditor_PathPoint PP = *itPP; - PP.SetAngle(aAngles[j]); - aPPs[j] = PP; + list::iterator itAngles = theAngles.begin(); + aPPs.push_back( *itPP++ ); + for( ; itPP != fullList.end(); itPP++) { + aPPs.push_back( *itPP ); + if ( theHasAngles && itAngles != theAngles.end() ) + aPPs.back().SetAngle( *itAngles ); } - TNodeOfNodeListMap mapNewNodes; + TNodeOfNodeListMap mapNewNodes; TElemOfVecOfNnlmiMap mapElemNewNodes; - TElemOfElemListMap newElemsMap; + TElemOfElemListMap newElemsMap; TIDSortedElemSet::iterator itElem; - double aX, aY, aZ; - int aNb; - SMDSAbs_ElementType aTypeE; // source elements for each generated one SMESH_SequenceOfElemPtr srcElems, srcNodes; // 3. Center of rotation aV0 gp_Pnt aV0 = theRefPoint; - gp_XYZ aGC; - if ( !theHasRefPoint ) { - aNb = 0; - aGC.SetCoord( 0.,0.,0. ); + if ( !theHasRefPoint ) + { + gp_XYZ aGC( 0.,0.,0. ); + TIDSortedElemSet newNodes; itElem = theElements.begin(); for ( ; itElem != theElements.end(); itElem++ ) { @@ -5529,25 +5486,14 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements, SMDS_ElemIteratorPtr itN = elem->nodesIterator(); while ( itN->more() ) { - const SMDS_MeshNode* node = static_cast( itN->next() ); - aX = node->X(); - aY = node->Y(); - aZ = node->Z(); - - if ( mapNewNodes.find( node ) == mapNewNodes.end() ) { - list aLNx; - mapNewNodes[node] = aLNx; - // - gp_XYZ aXYZ( aX, aY, aZ ); - aGC += aXYZ; - ++aNb; - } + const SMDS_MeshElement* node = itN->next(); + if ( newNodes.insert( node ).second ) + aGC += SMESH_TNodeXYZ( node ); } } - aGC /= aNb; + aGC /= newNodes.size(); aV0.SetXYZ( aGC ); } // if (!theHasRefPoint) { - mapNewNodes.clear(); // 4. Processing the elements SMESHDS_Mesh* aMesh = GetMeshDS(); @@ -5555,7 +5501,7 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements, for ( itElem = theElements.begin(); itElem != theElements.end(); itElem++ ) { // check element type const SMDS_MeshElement* elem = *itElem; - aTypeE = elem->GetType(); + SMDSAbs_ElementType aTypeE = elem->GetType(); if ( !elem || ( aTypeE != SMDSAbs_Face && aTypeE != SMDSAbs_Edge ) ) continue; @@ -5577,8 +5523,6 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements, list& listNewNodes = nIt->second; // make new nodes - aX = node->X(); aY = node->Y(); aZ = node->Z(); - Standard_Real aAngle1x, aAngleT1T0, aTolAng; gp_Pnt aP0x, aP1x, aPN0, aPN1, aV0x, aV1x; gp_Ax1 anAx1, anAxT1T0; @@ -5587,17 +5531,17 @@ SMESH_MeshEditor::MakeExtrElements(TIDSortedElemSet& theElements, aTolAng=1.e-4; aV0x = aV0; - aPN0.SetCoord(aX, aY, aZ); + aPN0 = SMESH_TNodeXYZ( node ); const SMESH_MeshEditor_PathPoint& aPP0 = aPPs[0]; aP0x = aPP0.Pnt(); aDT0x= aPP0.Tangent(); //cout<<"j = 0 PP: Pnt("<AddNode( aX, aY, aZ ); + const SMDS_MeshNode* newNode = aMesh->AddNode( aPN1.X(), aPN1.Y(), aPN1.Z() ); myLastCreatedNodes.Append(newNode); srcNodes.Append( node ); listNewNodes.push_back( newNode ); @@ -8505,11 +8446,20 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT if ( !volume ) continue; const SMDSAbs_EntityType type = volume->GetEntityType(); - if (( theToBiQuad && type == SMDSEntity_TriQuad_Hexa ) || - ( !theToBiQuad && type == SMDSEntity_Quad_Hexa )) + if ( volume->IsQuadratic() ) { - aHelper.AddTLinks( static_cast< const SMDS_MeshVolume* >( volume )); - continue; + bool alreadyOK; + switch ( type ) + { + case SMDSEntity_Quad_Hexa: alreadyOK = !theToBiQuad; break; + case SMDSEntity_TriQuad_Hexa: alreadyOK = theToBiQuad; break; + default: alreadyOK = true; + } + if ( alreadyOK ) + { + aHelper.AddTLinks( static_cast< const SMDS_MeshVolume* >( volume )); + continue; + } } const int id = volume->GetID(); vector nodes (volume->begin_nodes(), volume->end_nodes()); @@ -9950,12 +9900,14 @@ namespace { //================================================================================ /*! - \brief Identify the elements that will be affected by node duplication (actual duplication is not performed. + \brief Identify the elements that will be affected by node duplication (actual duplication is not performed). This method is the first step of DoubleNodeElemGroupsInRegion. \param theElems - list of groups of elements (edges or faces) to be replicated \param theNodesNot - list of groups of nodes not to replicated \param theShape - shape to detect affected elements (element which geometric center - located on or inside shape). + located on or inside shape). If the shape is null, detection is done on faces orientations + (select elements with a gravity center on the side given by faces normals). + This mode (null shape) is faster, but works only when theElems are faces, with coherents orientations. The replicated nodes should be associated to affected elements. \return groups of affected elements \sa DoubleNodeElemGroupsInRegion() @@ -9968,44 +9920,145 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl TIDSortedElemSet& theAffectedElems) { if ( theShape.IsNull() ) - return false; - - const double aTol = Precision::Confusion(); - auto_ptr< BRepClass3d_SolidClassifier> bsc3d; - auto_ptr<_FaceClassifier> aFaceClassifier; - if ( theShape.ShapeType() == TopAbs_SOLID ) - { - bsc3d.reset( new BRepClass3d_SolidClassifier(theShape));; - bsc3d->PerformInfinitePoint(aTol); - } - else if (theShape.ShapeType() == TopAbs_FACE ) { - aFaceClassifier.reset( new _FaceClassifier(TopoDS::Face(theShape))); + std::set alreadyCheckedNodes; + std::set alreadyCheckedElems; + std::set edgesToCheck; + alreadyCheckedNodes.clear(); + alreadyCheckedElems.clear(); + edgesToCheck.clear(); + + // --- iterates on elements to be replicated and get elements by back references from their nodes + + TIDSortedElemSet::const_iterator elemItr = theElems.begin(); + int ielem = 1; + for ( ; elemItr != theElems.end(); ++elemItr ) + { + SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr; + if (!anElem || (anElem->GetType() != SMDSAbs_Face)) + continue; + gp_XYZ normal; + SMESH_MeshAlgos::FaceNormal( anElem, normal, /*normalized=*/true ); + MESSAGE("element " << ielem++ << " normal " << normal.X() << " " << normal.Y() << " " << normal.Z()); + std::set nodesElem; + nodesElem.clear(); + SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator(); + while ( nodeItr->more() ) + { + const SMDS_MeshNode* aNode = cast2Node(nodeItr->next()); + nodesElem.insert(aNode); + } + std::set::iterator nodit = nodesElem.begin(); + for (; nodit != nodesElem.end(); nodit++) + { + MESSAGE(" noeud "); + const SMDS_MeshNode* aNode = *nodit; + if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() ) + continue; + if (alreadyCheckedNodes.find(aNode) != alreadyCheckedNodes.end()) + continue; + alreadyCheckedNodes.insert(aNode); + SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator(); + while ( backElemItr->more() ) + { + MESSAGE(" backelem "); + const SMDS_MeshElement* curElem = backElemItr->next(); + if (alreadyCheckedElems.find(curElem) != alreadyCheckedElems.end()) + continue; + if (theElems.find(curElem) != theElems.end()) + continue; + alreadyCheckedElems.insert(curElem); + double x=0, y=0, z=0; + int nb = 0; + SMDS_ElemIteratorPtr nodeItr2 = curElem->nodesIterator(); + while ( nodeItr2->more() ) + { + const SMDS_MeshNode* anotherNode = cast2Node(nodeItr2->next()); + x += anotherNode->X(); + y += anotherNode->Y(); + z += anotherNode->Z(); + nb++; + } + gp_XYZ p; + p.SetCoord( x/nb -aNode->X(), + y/nb -aNode->Y(), + z/nb -aNode->Z() ); + MESSAGE(" check " << p.X() << " " << p.Y() << " " << p.Z()); + if (normal*p > 0) + { + MESSAGE(" --- inserted") + theAffectedElems.insert( curElem ); + } + else if (curElem->GetType() == SMDSAbs_Edge) + edgesToCheck.insert(curElem); + } + } + } + // --- add also edges lying on the set of faces (all nodes in alreadyCheckedNodes) + std::set::iterator eit = edgesToCheck.begin(); + for( ; eit != edgesToCheck.end(); eit++) + { + bool onside = true; + const SMDS_MeshElement* anEdge = *eit; + SMDS_ElemIteratorPtr nodeItr = anEdge->nodesIterator(); + while ( nodeItr->more() ) + { + const SMDS_MeshNode* aNode = cast2Node(nodeItr->next()); + if (alreadyCheckedNodes.find(aNode) == alreadyCheckedNodes.end()) + { + onside = false; + break; + } + } + if (onside) + { + MESSAGE(" --- edge onside inserted") + theAffectedElems.insert(anEdge); + } + } } - - // iterates on indicated elements and get elements by back references from their nodes - TIDSortedElemSet::const_iterator elemItr = theElems.begin(); - for ( ; elemItr != theElems.end(); ++elemItr ) + else { - SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr; - if (!anElem) - continue; + const double aTol = Precision::Confusion(); + auto_ptr< BRepClass3d_SolidClassifier> bsc3d; + auto_ptr<_FaceClassifier> aFaceClassifier; + if ( theShape.ShapeType() == TopAbs_SOLID ) + { + bsc3d.reset( new BRepClass3d_SolidClassifier(theShape));; + bsc3d->PerformInfinitePoint(aTol); + } + else if (theShape.ShapeType() == TopAbs_FACE ) + { + aFaceClassifier.reset( new _FaceClassifier(TopoDS::Face(theShape))); + } - SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator(); - while ( nodeItr->more() ) + // iterates on indicated elements and get elements by back references from their nodes + TIDSortedElemSet::const_iterator elemItr = theElems.begin(); + int ielem = 1; + for ( ; elemItr != theElems.end(); ++elemItr ) { - const SMDS_MeshNode* aNode = cast2Node(nodeItr->next()); - if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() ) + MESSAGE("element " << ielem++); + SMDS_MeshElement* anElem = (SMDS_MeshElement*)*elemItr; + if (!anElem) continue; - SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator(); - while ( backElemItr->more() ) + SMDS_ElemIteratorPtr nodeItr = anElem->nodesIterator(); + while ( nodeItr->more() ) { - const SMDS_MeshElement* curElem = backElemItr->next(); - if ( curElem && theElems.find(curElem) == theElems.end() && - ( bsc3d.get() ? - isInside( curElem, *bsc3d, aTol ) : - isInside( curElem, *aFaceClassifier, aTol ))) - theAffectedElems.insert( curElem ); + MESSAGE(" noeud "); + const SMDS_MeshNode* aNode = cast2Node(nodeItr->next()); + if ( !aNode || theNodesNot.find(aNode) != theNodesNot.end() ) + continue; + SMDS_ElemIteratorPtr backElemItr = aNode->GetInverseElementIterator(); + while ( backElemItr->more() ) + { + MESSAGE(" backelem "); + const SMDS_MeshElement* curElem = backElemItr->next(); + if ( curElem && theElems.find(curElem) == theElems.end() && + ( bsc3d.get() ? + isInside( curElem, *bsc3d, aTol ) : + isInside( curElem, *aFaceClassifier, aTol ))) + theAffectedElems.insert( curElem ); + } } } } diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 316bcea62..ea08fda34 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -600,10 +600,8 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F, for ( TopExp_Explorer vert(F,TopAbs_VERTEX); !uvOK && vert.More(); vert.Next() ) uvOK = ( V == vert.Current() ); if ( !uvOK ) { -#ifdef _DEBUG_ MESSAGE ( "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID - << " not in face " << GetMeshDS()->ShapeToIndex( F ) ); -#endif + << " not in face " << GetMeshDS()->ShapeToIndex( F ) ); // get UV of a vertex closest to the node double dist = 1e100; gp_Pnt pn = XYZ( n ); @@ -944,6 +942,7 @@ bool SMESH_MesherHelper::CheckNodeU(const TopoDS_Edge& E, } Quantity_Parameter U = projector->LowerDistanceParameter(); u = double( U ); + MESSAGE(" f " << f << " l " << l << " u " << u); curvPnt = curve->Value( u ); dist = nodePnt.Distance( curvPnt ); if ( distXYZ ) { @@ -968,6 +967,7 @@ bool SMESH_MesherHelper::CheckNodeU(const TopoDS_Edge& E, } if (( u < f-tol || u > l+tol ) && force ) { + MESSAGE("u < f-tol || u > l+tol ; u " << u << " f " << f << " l " << l); // node is on vertex but is set on periodic but trimmed edge (issue 0020890) try { @@ -4673,4 +4673,3 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError, } } } - diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index f2b4d9ffc..56320951e 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -97,7 +97,7 @@ class SMESH_EXPORT SMESH_MesherHelper * The key of the map is a normalized parameter of each * base node on theBaseSide. Edges in theBaseSide must be sequenced. * This method works in supposition that nodes on the face - * forms a rectangular grid and elements can be quardrangles or triangles + * forms a structured grid and elements can be quardrangles or triangles */ static bool LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap, const TopoDS_Face& theFace, diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 483495be5..cf05b50bc 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1381,7 +1381,7 @@ static void cleanSubMesh( SMESH_subMesh * subMesh ) const SMDS_MeshElement * elt = ite->next(); //MESSAGE( " RM elt: "<GetID()<<" ( "<NbNodes()<<" )" ); //meshDS->RemoveElement(elt); - meshDS->RemoveFreeElement(elt, subMeshDS); + meshDS->RemoveFreeElement(elt, 0); } SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); @@ -1389,10 +1389,11 @@ static void cleanSubMesh( SMESH_subMesh * subMesh ) const SMDS_MeshNode * node = itn->next(); //MESSAGE( " RM node: "<GetID()); if ( node->NbInverseElements() == 0 ) - meshDS->RemoveFreeNode(node, subMeshDS); + meshDS->RemoveFreeNode(node, 0); else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another meshDS->RemoveNode(node); } + subMeshDS->Clear(); } } } diff --git a/src/SMESHClient/Makefile.am b/src/SMESHClient/Makefile.am index e8e42e9fb..ad170b108 100644 --- a/src/SMESHClient/Makefile.am +++ b/src/SMESHClient/Makefile.am @@ -69,11 +69,13 @@ libSMESHClient_la_LDFLAGS = \ ../MEDWrapper/Factory/libMEDWrapper.la \ ../MEDWrapper/Base/libMEDWrapperBase.la \ ../MEDWrapper/V2_2/libMEDWrapper_V2_2.la \ - $(KERNEL_LDFLAGS) -lSalomeLifeCycleCORBA -lSalomeNS -lOpUtil -lSALOMEBasics \ + $(KERNEL_LDFLAGS) -lSalomeLifeCycleCORBA -lSalomeNS -lOpUtil -lSALOMEBasics -lSalomeContainer -lSalomeHDFPersist -lSalomeGenericObj \ + -lRegistry -lResourcesManager -lSalomeResourcesManager -lSalomeNotification \ -lSalomeIDLKernel -lSALOMELocalTrace \ $(GEOM_LDFLAGS) -lNMTDS -lSalomeIDLGEOM \ $(CAS_KERNEL) + SMESHClientBin_CPPFLAGS = \ $(libSMESHClient_la_CPPFLAGS) diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 885a76107..d93e784c3 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -888,8 +888,8 @@ void SMESHDS_Mesh::RemoveFreeNode(const SMDS_MeshNode * n, set::iterator GrIt = myGroups.begin(); for (; GrIt != myGroups.end(); GrIt++) { SMESHDS_Group* group = dynamic_cast(*GrIt); - if (!group || group->IsEmpty()) continue; - group->SMDSGroup().Remove(n); + if (group && !group->IsEmpty()) + group->SMDSGroup().Remove(n); } } @@ -915,11 +915,12 @@ void SMESHDS_Mesh::RemoveElement(const SMDS_MeshElement * elt) if (!hasConstructionEdges() && !hasConstructionFaces()) { SMESHDS_SubMesh* subMesh=0; - map::iterator SubIt = myShapeIndexToSubMesh.begin(); - for ( ; !subMesh && SubIt != myShapeIndexToSubMesh.end(); SubIt++ ) - if (!SubIt->second->IsComplexSubmesh() && SubIt->second->Contains( elt )) + if ( elt->getshapeId() > 0 ) + { + map::iterator SubIt = myShapeIndexToSubMesh.find( elt->getshapeId() ); + if ( SubIt != myShapeIndexToSubMesh.end() ) subMesh = SubIt->second; - //MESSAGE("subMesh " << elt->getshapeId()); + } RemoveFreeElement( elt, subMesh, true); return; } diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index b27ea7b4f..10a132791 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -67,6 +67,7 @@ SMESHDS_SubMesh::~SMESHDS_SubMesh() //function : AddElement //purpose : //======================================================================= + void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME) { if (!IsComplexSubmesh()) @@ -76,7 +77,6 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME) AddNode( static_cast< const SMDS_MeshNode* >( ME )); return; } - //MESSAGE("in " << myIndex << " AddElement "<< ME->GetID()); int oldShapeId = ME->getshapeId(); if ( oldShapeId > 0 ) { @@ -121,32 +121,30 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME) //function : RemoveElement //purpose : //======================================================================= + bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDeleted) { if (!ME) - { - MESSAGE("-----------------> Remove Null Element " << isElemDeleted); - return false; - } - //MESSAGE("-----------------> RemoveElement "<< ME->GetID() << " " << isElemDeleted); + { + MESSAGE("-----------------> Remove Null Element " << isElemDeleted); + return false; + } if (!IsComplexSubmesh()) - { - if ( ME->getshapeId() != myIndex ) - return false; - int idInSubShape = ME->getIdInShape(); - //MESSAGE("in "<< myIndex << " RemoveElement " << ME->GetID() << " " << idInSubShape << " " << myUnusedIdElements); - SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME); - elem->setShapeId(0); - elem->setIdInShape(-1); - if ((idInSubShape >= 0) && (idInSubShape < myElements.size())) - { - myElements[idInSubShape] = 0; // this vector entry is no more used - myUnusedIdElements++; - return true; - } + { + if ( ME->getshapeId() != myIndex ) return false; - // } + int idInSubShape = ME->getIdInShape(); + SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME); + elem->setShapeId(0); + elem->setIdInShape(-1); + if ((idInSubShape >= 0) && (idInSubShape < myElements.size())) + { + myElements[idInSubShape] = 0; // this vector entry is no more used + myUnusedIdElements++; + return true; } + return false; + } MESSAGE("Try to remove an element from a complex submesh "); return false; } @@ -187,26 +185,21 @@ void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N) bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) { if (!IsComplexSubmesh()) - { - // if (!isNodeDeleted) // alive node has valid ID and can be found - // { - if ( N->getshapeId() != myIndex ) - return false; - int idInSubShape = N->getIdInShape(); - //int shapeId = N->getshapeId(); - //MESSAGE("in "<< myIndex << " RemoveNode " << shapeId << " " << idInSubShape << " " << N->GetID()); - SMDS_MeshNode* node = (SMDS_MeshNode*) (N); - node->setShapeId(0); - node->setIdInShape(-1); - if ((idInSubShape >= 0) && (idInSubShape < myNodes.size())) - { - myNodes[idInSubShape] = 0; // this vector entry is no more used - myUnusedIdNodes++; - return true; - } + { + if ( N->getshapeId() != myIndex ) return false; - // } + int idInSubShape = N->getIdInShape(); + SMDS_MeshNode* node = (SMDS_MeshNode*) (N); + node->setShapeId(0); + node->setIdInShape(-1); + if ((idInSubShape >= 0) && (idInSubShape < myNodes.size())) + { + myNodes[idInSubShape] = 0; // this vector entry is no more used + myUnusedIdNodes++; + return true; } + return false; + } MESSAGE("Try to remove a node from a complex submesh"); return false; } @@ -215,9 +208,9 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) //function : NbElements //purpose : //======================================================================= + int SMESHDS_SubMesh::NbElements() const { - //MESSAGE(this << " NbElements " << IsComplexSubmesh() << " " << myElements.size() - myUnusedIdElements); if ( !IsComplexSubmesh() ) return myElements.size() - myUnusedIdElements; @@ -236,7 +229,6 @@ int SMESHDS_SubMesh::NbElements() const int SMESHDS_SubMesh::NbNodes() const { - //MESSAGE(this << " NbNodes " << IsComplexSubmesh() << " " << myNodes.size() - myUnusedIdNodes); if ( !IsComplexSubmesh() ) return myNodes.size() - myUnusedIdNodes; @@ -476,10 +468,13 @@ void SMESHDS_SubMesh::Clear() clearVector( myNodes ); myUnusedIdNodes = 0; myUnusedIdElements = 0; - SMESHDS_SubMeshIteratorPtr sub = GetSubMeshIterator(); - while ( sub->more() ) { - if ( SMESHDS_SubMesh* sm = (SMESHDS_SubMesh*) sub->next()) - sm->Clear(); + if ( NbSubMeshes() > 0 ) + { + SMESHDS_SubMeshIteratorPtr sub = GetSubMeshIterator(); + while ( sub->more() ) { + if ( SMESHDS_SubMesh* sm = (SMESHDS_SubMesh*) sub->next()) + sm->Clear(); + } } } @@ -487,53 +482,38 @@ int SMESHDS_SubMesh::getSize() { int c = NbNodes(); int d = NbElements(); - //cerr << "SMESHDS_SubMesh::NbNodes " << c << endl; - //cerr << "SMESHDS_SubMesh::NbElements " << d << endl; return c+d; } void SMESHDS_SubMesh::compactList() { - //MESSAGE("compactList old: nodes " << myNodes.size() << " elements " << myElements.size()); - //stringstream a; - //stringstream b; - //stringstream c; - //stringstream d; - - std::vector newElems; - newElems.clear(); - for (int i = 0; i < myElements.size(); i++) - if (myElements[i]) + if ( myUnusedIdElements > 0 ) + { + std::vector newElems; + newElems.reserve( myElements.size() - myUnusedIdElements ); + for (size_t i = 0; i < myElements.size(); i++) + if (myElements[i]) { SMDS_MeshElement* elem = (SMDS_MeshElement*)myElements[i]; elem->setIdInShape(newElems.size()); newElems.push_back(elem); - //a << elem->GetID() << " "; - //b << elem->GetID() << " "; } - //else - // a << "_ "; - myElements.swap(newElems); - myUnusedIdElements = 0; - //MESSAGE("in " << myIndex << " oldElems " << a.str()); - //MESSAGE("in " << myIndex << " newElems " << b.str()); + myElements.swap(newElems); + myUnusedIdElements = 0; + } - std::vector newNodes; - newNodes.clear(); - for (int i = 0; i < myNodes.size(); i++) - if (myNodes[i]) + if ( myUnusedIdNodes > 0 ) + { + std::vector newNodes; + newNodes.reserve( myNodes.size() - myUnusedIdNodes ); + for (size_t i = 0; i < myNodes.size(); i++) + if (myNodes[i]) { SMDS_MeshNode* node = (SMDS_MeshNode*)myNodes[i]; node->setIdInShape(newNodes.size()); newNodes.push_back(node); - //c << node->GetID() << " "; - //d << node->GetID() << " "; } - //else - // c << "_ "; - myNodes.swap(newNodes); - myUnusedIdNodes = 0; - //MESSAGE("in " << myIndex << " oldNodes " << c.str()); - //MESSAGE("in " << myIndex << " newNodes " << d.str()); - //MESSAGE("compactList new: nodes " << myNodes.size() << " elements " << myElements.size()); + myNodes.swap(newNodes); + myUnusedIdNodes = 0; + } } diff --git a/src/SMESHGUI/Makefile.am b/src/SMESHGUI/Makefile.am index 446bf6eec..f756e2350 100644 --- a/src/SMESHGUI/Makefile.am +++ b/src/SMESHGUI/Makefile.am @@ -285,4 +285,5 @@ libSMESH_la_LDFLAGS = \ nodist_salomeres_DATA= \ SMESH_images.qm \ SMESH_msg_en.qm \ - SMESH_msg_fr.qm + SMESH_msg_fr.qm \ + SMESH_msg_ja.qm diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 33de52b4d..11eb2b89e 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -361,11 +361,6 @@ SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() ); anEntryList.append( aMeshSO->GetID().c_str() ); - - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - aMeshes[i]->UnRegister(); } else { isEmpty = true; @@ -928,7 +923,8 @@ } } - void AutoColor(){ + void AutoColor() + { SALOME_ListIO selected; SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); if( !app ) @@ -951,6 +947,8 @@ if( aMainObject->_is_nil() ) return; + SUIT_OverrideCursor wc; + aMainObject->SetAutoColor( true ); // mesh groups are re-colored here QList aReservedColors; @@ -967,6 +965,7 @@ SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors ); aReservedColors.append( aColor ); #endif // SIMPLE_AUTOCOLOR + aGroupObject->SetColor( aColor ); _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject); if (aGroupSObject) { @@ -1229,14 +1228,14 @@ aSel->selectedObjects( selected ); if(selected.Extent()){ - Handle(SALOME_InteractiveObject) anIObject = selected.First(); - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - _PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry()); - if (aSObj) { - if ( aStudy->GetUseCaseBuilder()->SortChildren( aSObj, true/*AscendingOrder*/ ) ) { - SMESHGUI::GetSMESHGUI()->updateObjBrowser(); - } - } + Handle(SALOME_InteractiveObject) anIObject = selected.First(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + _PTR(SObject) aSObj = aStudy->FindObjectID(anIObject->getEntry()); + if (aSObj) { + if ( aStudy->GetUseCaseBuilder()->SortChildren( aSObj, true/*AscendingOrder*/ ) ) { + SMESHGUI::GetSMESHGUI()->updateObjBrowser(); + } + } } } } @@ -1790,7 +1789,7 @@ aSO = aRefSObject; // Delete main Object instead of reference listSO.push_back( aSO ); - std::list< _PTR(SObject) >::iterator itSO = listSO.begin(); + std::list< _PTR(SObject) >::iterator itSO = --listSO.end(); for ( ; itSO != listSO.end(); ++itSO ) { _PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO ); for (it->InitEx(false); it->More(); it->Next()) @@ -1835,24 +1834,9 @@ if ( !SO ) continue; std::string anEntry = SO->GetID(); - /** Erase graphical object **/ + /** Erase graphical object and remove all its data **/ if(SO->FindAttribute(anAttr, "AttributeIOR")) { SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true); - // ViewManagerList aViewMenegers = anApp->viewManagers(); - // ViewManagerList::const_iterator it = aViewMenegers.begin(); - // for( ; it != aViewMenegers.end(); it++) { - // SUIT_ViewManager* vm = *it; - // int nbSf = vm ? vm->getViewsCount() : 0; - // if(vm) { - // QVector aViews = vm->getViews(); - // for(int i = 0; i < nbSf; i++){ - // SUIT_ViewWindow *sf = aViews[i]; - // if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){ - // SMESH::RemoveActor(sf,anActor); - // } - // } - // } - // } } /** Remove an object from data structures **/ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO )); @@ -2002,7 +1986,7 @@ bool SMESHGUI::automaticUpdate(unsigned int requestedSize, bool* limitExceeded) */ //============================================================================= bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh, - int* entities, bool* limitExceeded ) + int* entities, bool* limitExceeded, int* hidden ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); if ( !resMgr ) @@ -2015,6 +1999,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh, long requestedSize = theMesh->NbElements(); *entities = SMESH_Actor::eAllEntity; + *hidden = 0; bool exceeded = updateLimit > 0 && requestedSize > updateLimit; @@ -2029,40 +2014,50 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_Mesh_ptr theMesh, long total = 0; if ( nbOdElems > 0 ) { - if ( total + nbOdElems > updateLimit ) + if ( total + nbOdElems > updateLimit ) { *entities = *entities & ~SMESH_Actor::e0DElements; + *hidden = *hidden | SMESH_Actor::e0DElements; + } else exceeded = false; } total += nbOdElems; if ( nbEdges > 0 ) { - if ( total + nbEdges > updateLimit ) + if ( total + nbEdges > updateLimit ) { *entities = *entities & ~SMESH_Actor::eEdges; + *hidden = *hidden | SMESH_Actor::eEdges; + } else exceeded = false; } total += nbEdges; if ( nbFaces > 0 ) { - if ( total + nbFaces > updateLimit ) + if ( total + nbFaces > updateLimit ) { *entities = *entities & ~SMESH_Actor::eFaces; + *hidden = *hidden | SMESH_Actor::eFaces; + } else exceeded = false; } total += nbFaces; if ( nbVolumes > 0 ) { - if ( total + nbVolumes > updateLimit ) + if ( total + nbVolumes > updateLimit ) { *entities = *entities & ~SMESH_Actor::eVolumes; + *hidden = *hidden | SMESH_Actor::eVolumes; + } else exceeded = false; } total += nbVolumes; if ( nbBalls > 0 ) { - if ( total + nbBalls > updateLimit ) + if ( total + nbBalls > updateLimit ) { *entities = *entities & ~SMESH_Actor::eBallElem; + *hidden = *hidden | SMESH_Actor::eBallElem; + } else exceeded = false; } @@ -2529,10 +2524,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if (vtkwnd) { SALOME_ListIteratorOfListIO It( to_process ); for ( ; It.More(); It.Next()) { - MESSAGE("---"); + MESSAGE("---"); Handle(SALOME_InteractiveObject) IOS = It.Value(); if (IOS->hasEntry()) { - MESSAGE("---"); + MESSAGE("---"); if (!SMESH::UpdateView(anAction, IOS->getEntry())) { SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged(); break; // PAL16774 (Crash after display of many groups) @@ -2548,7 +2543,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) // PAL13338 + PAL15161 --> if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy)) { - MESSAGE("anAction = SMESH::eDisplayOnly"); + MESSAGE("anAction = SMESH::eDisplayOnly"); SMESH::UpdateView(); SMESHGUI::GetSMESHGUI()->EmitSignalVisibilityChanged(); } @@ -3546,8 +3541,20 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } case 501: case 502: + case 503: + case 504: + case 505: { - int page = theCommandID == 501 ? SMESHGUI_MeasureDlg::MinDistance : SMESHGUI_MeasureDlg::BoundingBox; + int page = SMESHGUI_MeasureDlg::MinDistance; + if ( theCommandID == 502 ) + page = SMESHGUI_MeasureDlg::BoundingBox; + else if ( theCommandID == 503 ) + page = SMESHGUI_MeasureDlg::Length; + else if ( theCommandID == 504 ) + page = SMESHGUI_MeasureDlg::Area; + else if ( theCommandID == 505 ) + page = SMESHGUI_MeasureDlg::Volume; + EmitSignalDeactivateDialog(); SMESHGUI_MeasureDlg* dlg = new SMESHGUI_MeasureDlg( SMESHGUI::desktop(), page ); dlg->show(); @@ -3849,6 +3856,9 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( 501, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" ); createSMESHAction( 502, "MEASURE_BND_BOX", "ICON_MEASURE_BND_BOX" ); + createSMESHAction( 503, "MEASURE_LENGTH", "ICON_MEASURE_LENGTH" ); + createSMESHAction( 504, "MEASURE_AREA", "ICON_MEASURE_AREA" ); + createSMESHAction( 505, "MEASURE_VOLUME", "ICON_MEASURE_VOLUME" ); createSMESHAction( 300, "HIDE" ); createSMESHAction( 301, "SHOW" ); @@ -3877,7 +3887,8 @@ void SMESHGUI::initialize( CAM_Application* app ) addId = createMenu( tr( "MEN_ADD" ), modifyId, 402 ), removeId = createMenu( tr( "MEN_REMOVE" ), modifyId, 403 ), renumId = createMenu( tr( "MEN_RENUM" ), modifyId, 404 ), - transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 ); + transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 ), + basicPropId = createMenu( tr( "MEN_BASIC_PROPERTIES" ), measureId, -1, 10 ); //createMenu( 111, importId, -1 ); createMenu( 112, importId, -1 ); @@ -4025,6 +4036,9 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( 501, measureId, -1 ); createMenu( 502, measureId, -1 ); + createMenu( 503, basicPropId, -1 ); + createMenu( 504, basicPropId, -1 ); + createMenu( 505, basicPropId, -1 ); createMenu( 214, viewId, -1 ); // ----- create toolbars -------------- diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 8a38ec5ec..74978853c 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -100,7 +100,7 @@ public : bool isActiveStudyLocked(); static bool automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0); - static bool automaticUpdate( SMESH::SMESH_Mesh_ptr, int*, bool* ); + static bool automaticUpdate( SMESH::SMESH_Mesh_ptr, int*, bool*, int* ); static void Modified( bool = true ); diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx index bb3004577..10dbf474e 100644 --- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx @@ -58,6 +58,7 @@ #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_MeshEditor) + #define SPACING 6 #define MARGIN 11 @@ -352,14 +353,17 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply() return false; // get a mesh - SMESH::SMESH_IDSource_var meshObject; - SMESH::SMESH_Mesh_var mesh; + SMESH::SMESH_IDSource_wrap meshObject; + SMESH::SMESH_Mesh_var mesh; if ( !myIO.IsNull() ) { CORBA::Object_var obj = SMESH::IObjectToObject( myIO ); meshObject = SMESH::SMESH_IDSource::_narrow( obj ); if ( !meshObject->_is_nil() ) + { mesh = meshObject->GetMesh(); + meshObject->Register(); + } } if ( mesh->_is_nil() ) { diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 7fbd6530f..a1cf8baaf 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -65,10 +65,6 @@ #define SPACING 6 #define MARGIN 11 -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================= // name : SMESHGUI_BuildCompoundDlg // Purpose : @@ -347,12 +343,6 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() SMESHGUI::Modified(); - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - if (!CORBA::is_nil(aCompoundMesh)) - aCompoundMesh->UnRegister(); - return true; } return false; diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index ec8dd9523..26180bedb 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -895,9 +895,10 @@ void SMESHGUI_BaseComputeOp::computeMesh() bool limitExceeded; long limitSize = resMgr->integerValue( "SMESH", "update_limit", 500000 ); int entities = SMESH_Actor::eAllEntity; + int hidden = 0; if ( !memoryLack ) { - if ( getSMESHGUI()->automaticUpdate( myMesh, &entities, &limitExceeded ) ) + if ( getSMESHGUI()->automaticUpdate( myMesh, &entities, &limitExceeded, &hidden ) ) { try { #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 @@ -905,17 +906,24 @@ void SMESHGUI_BaseComputeOp::computeMesh() #endif SMESH_Actor *anActor = SMESH::FindActorByObject( myMesh ); if ( !anActor ) anActor = SMESH::CreateActor( aMeshSObj->GetStudy(), aMeshSObj->GetID().c_str(), true ); - - anActor->SetEntityMode( entities ); - SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor ); - + if ( anActor ) // actor is not created for an empty mesh + { + anActor->SetEntityMode( entities ); + SMESH::DisplayActor( SMESH::GetActiveWindow(), anActor ); + } SMESH::Update(myIObject, true); if ( limitExceeded ) { + QStringList hiddenMsg; + if ( hidden & SMESH_Actor::e0DElements ) hiddenMsg << tr( "SMESH_ELEMS0D" ); + if ( hidden & SMESH_Actor::eEdges ) hiddenMsg << tr( "SMESH_EDGES" ); + if ( hidden & SMESH_Actor::eFaces ) hiddenMsg << tr( "SMESH_FACES" ); + if ( hidden & SMESH_Actor::eVolumes ) hiddenMsg << tr( "SMESH_VOLUMES" ); + if ( hidden & SMESH_Actor::eBallElem ) hiddenMsg << tr( "SMESH_BALLS" ); SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ), - tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ) ); + tr( "SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED" ).arg( myMesh->NbElements() ).arg( limitSize ).arg( hiddenMsg.join(", ") ) ); } } catch (...) { diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index fbb71ea96..0e1f921cc 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -98,10 +98,6 @@ namespace #define SPACING 6 #define MARGIN 11 -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================ /*! @@ -312,10 +308,11 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() try { SUIT_OverrideCursor aWaitCursor; - SMESH::SMESH_IDSource_var aPartToCopy; + SMESH::SMESH_IDSource_wrap aPartToCopy; if ( myIdSourceCheck->isChecked()) { aPartToCopy = mySelectedObject; + aPartToCopy->Register(); } else { @@ -338,13 +335,8 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() if( !newMesh->_is_nil() ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - newMesh->UnRegister(); -#endif - } catch (...) { + } + catch (...) { } mySMESHGUI->updateObjBrowser(true); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index 6746ba07d..9e18fdab6 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -354,6 +354,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(SelectStartPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(SelectBasePointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(BasePointGrp, SIGNAL(toggled(bool)), this, SLOT(SetEditCurrentArgument())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); @@ -883,7 +884,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument() return; QString aString; - int aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, myMeshActor->getIO(), aString); + int aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, IO, aString); // return if more than one node is selected if (aNbUnits != 1) return; @@ -914,6 +915,8 @@ void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument() void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument() { QToolButton* send = (QToolButton*)sender(); + if ( sender() == BasePointGrp ) + send = SelectBasePointButton; if (send != SelectElementsButton && send != SelectPathMeshButton && send != SelectStartPointButton && @@ -978,17 +981,15 @@ void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(NodeSelection); - SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(SMESH::MESHorSUBMESH); - SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(SMESH::GROUP); + SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(SMESH::IDSOURCE); SMESH_NumberFilter* aVertexFilter = new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE, -1, TopAbs_VERTEX); QList aListOfFilters; if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter); - if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter); if (aVertexFilter) aListOfFilters.append(aVertexFilter); mySelectionMgr->installFilter(new SMESH_LogicalFilter - (aListOfFilters, SMESH_LogicalFilter::LO_OR)); + (aListOfFilters, SMESH_LogicalFilter::LO_OR, true)); } if (myEditCurrentArgument && !myEditCurrentArgument->hasFocus()) @@ -1277,9 +1278,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview SMESH::SMESH_MeshEditor::Extrusion_Error retVal; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); bool NeedGroups = false; - SMESH::ElementType ElemType = SMESH::FACE; - if( GetConstructorId() == 0 ) - ElemType = SMESH::EDGE; + SMESH::ElementType ElemType = ( GetConstructorId() == 0 ) ? SMESH::EDGE : SMESH::FACE; if( !MeshCheck->isChecked() ) { aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(), anAngles, LinearAnglesCheck->isChecked(), @@ -1293,8 +1292,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::onDisplaySimulation( bool toDisplayPreview BasePointGrp->isChecked(), aBasePoint, NeedGroups, ElemType, retVal); } - - wc.suspend(); + if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK ) { SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData(); mySimulation->SetData(aMeshPreviewStruct._retn()); diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index df5618fc2..1a2eab82e 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -1569,7 +1569,8 @@ void SMESHGUI_FilterTable::updateAdditionalWidget() aCriterion != SMESH::FT_OverConstrainedFace && aCriterion != SMESH::FT_OverConstrainedVolume) || - aCriterion == SMESH::FT_CoplanarFaces); + aCriterion == SMESH::FT_CoplanarFaces || + aCriterion == SMESH::FT_EqualNodes); if (!myAddWidgets.contains(anItem)) { @@ -1970,6 +1971,10 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con { isThresholdEditable = true; } + if ( !isThresholdEditable ) + { + aTable->setItem( row, 2, new QTableWidgetItem() ); + } aTable->setEditable( isThresholdEditable, row, 2); @@ -3323,6 +3328,8 @@ bool SMESHGUI_FilterDlg::createFilter (const int theType) aCriteria[ i ] = aCriterion; } + if ( !myFilter[ theType ]->_is_nil() ) + myFilter[ theType ]->UnRegister(); myFilter[ theType ] = aFilterMgr->CreateFilter(); myFilter[ theType ]->SetCriteria(aCriteria.inout()); @@ -3356,9 +3363,29 @@ SMESH::Filter_var SMESHGUI_FilterDlg::GetFilter() const void SMESHGUI_FilterDlg::SetFilter(SMESH::Filter_var filter, int type) { + if ( !filter->_is_nil() ) + filter->Register(); + if ( !myFilter[ type ]->_is_nil() ) + myFilter[ type ]->UnRegister(); + myFilter[ type ] = filter; } +//================================================================================ +/*! + * \brief call UnRegister() for myFilter's + */ +//================================================================================ + +void SMESHGUI_FilterDlg::UnRegisterFilters() +{ + QMap< int, SMESH::Filter_var >::iterator i_f = myFilter.begin(); + for ( ; i_f != myFilter.end(); ++i_f ) + if ( !i_f.value()->_is_nil() ) + i_f.value()->UnRegister(); + myFilter.clear(); +} + //======================================================================= // name : SMESHGUI_FilterDlg::insertFilterInViewer // Purpose : Insert filter in viewer diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index 200973790..157869821 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -234,6 +234,7 @@ public: SMESH::Filter_var GetFilter() const; void SetFilter(SMESH::Filter_var filter, int type); + void UnRegisterFilters(); signals: diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index f0e6f7f63..832ac1c8d 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -38,7 +38,7 @@ #include #include -#include +//#include #include // SALOME GEOM includes @@ -921,7 +921,7 @@ bool SMESHGUI_GroupDlg::onApply() QStringList anEntryList; SMESH::SMESH_GroupBase_var resultGroup; - bool isCreation; + bool isCreation, isConversion = false; if (myGrpTypeId == 0) // standalone { @@ -940,8 +940,9 @@ bool SMESHGUI_GroupDlg::onApply() else myGroup = myMesh->ConvertToStandalone( myGroupOnGeom ); - myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); + myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); myGroupOnFilter = SMESH::SMESH_GroupOnFilter::_nil(); + isConversion = true; } } @@ -1150,7 +1151,17 @@ bool SMESHGUI_GroupDlg::onApply() resultGroup->SetName(myName->text().toLatin1().data()); if ( aMeshGroupSO ) + { if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) { + if ( isConversion ) { // need to reset TVisualObj and actor + Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); + SMESH::RemoveVisualObjectWithActors( anIO->getEntry(), true ); + SMESH::Update( anIO,true); + myActorsList.clear(); + anActor = SMESH::FindActorByEntry( anIO->getEntry() ); + if ( !anActor ) return false; + myActorsList.append( anActor ); + } anActor->setName(myName->text().toLatin1().data()); QColor c; int delta; @@ -1160,16 +1171,17 @@ bool SMESHGUI_GroupDlg::onApply() case grpBallSelection: anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); break; case grpEdgeSelection: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break; case grpVolumeSelection: - SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); - anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; - break; + SMESH::GetColor("SMESH", "volume_color", c , delta, "255,0,170|-100"); + anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, delta ); break; + break; case grpFaceSelection: default: - SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; - break; + SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100"); + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break; + break; } } + } } SMESHGUI::Modified(); mySMESHGUI->updateObjBrowser(true); @@ -1193,6 +1205,8 @@ void SMESHGUI_GroupDlg::onOK() if ( onApply() ) reject(); setIsApplyAndClose( false ); + + if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); } //================================================================================= @@ -2202,6 +2216,8 @@ void SMESHGUI_GroupDlg::reject() mySMESHGUI->ResetState(); QDialog::reject(); + + if ( myFilterDlg ) myFilterDlg->UnRegisterFilters(); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index a6e19527b..77d8ec1b2 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -88,7 +88,7 @@ void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr init create( false, theHypName, parent, obj, slot ); } -void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, +void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, const QString& theHypName, QWidget* theParent, QObject* obj, const QString& slot ) { @@ -100,27 +100,22 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, if (isAlgo) { SMESH::SMESH_Hypothesis_var anAlgo = SMESH::CreateHypothesis( hypType(), theHypName, isAlgo ); - if (!CORBA::is_nil(anAlgo)) - anAlgo->UnRegister(); + anAlgo.out(); // avoid unused variable warning } else { SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::CreateHypothesis( hypType(), theHypName, false ); editHypothesis( aHypothesis.in(), theHypName, theParent, obj, slot ); - if (!CORBA::is_nil(aHypothesis)) - aHypothesis->UnRegister(); } } void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis, - const QString& theHypName, + const QString& theHypName, QWidget* theParent, QObject* obj, const QString& slot ) { if( CORBA::is_nil( theHypothesis ) ) return; - MESSAGE("Edition of hypothesis"); - myIsCreate = false; editHypothesis( theHypothesis, theHypName, theParent, obj, slot ); diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index b0fba1624..3ae4ac699 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -466,14 +466,6 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) if ( !newMesh->_is_nil() ) { if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( newMesh ) ) theEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - newMesh->UnRegister(); -#endif - } - if ( !newGrp->_is_nil() ) { -#ifdef WITHGENERICOBJ - newGrp->UnRegister(); -#endif } ok = true; diff --git a/src/SMESHGUI/SMESHGUI_Measurements.cxx b/src/SMESHGUI/SMESHGUI_Measurements.cxx index 50cae77e5..8cbf40364 100644 --- a/src/SMESHGUI/SMESHGUI_Measurements.cxx +++ b/src/SMESHGUI/SMESHGUI_Measurements.cxx @@ -519,8 +519,8 @@ void SMESHGUI_MinDistance::secondEdited() void SMESHGUI_MinDistance::compute() { SUIT_OverrideCursor wc; - SMESH::SMESH_IDSource_var s1; - SMESH::SMESH_IDSource_var s2; + SMESH::SMESH_IDSource_wrap s1; + SMESH::SMESH_IDSource_wrap s2; bool isOrigin = mySecond->checkedId() == OriginTgt; // process first target @@ -538,6 +538,7 @@ void SMESHGUI_MinDistance::compute() } else { s1 = myFirstSrc; + s1->Register(); } } @@ -556,6 +557,7 @@ void SMESHGUI_MinDistance::compute() } else { s2 = mySecondSrc; + s2->Register(); } } @@ -1035,14 +1037,17 @@ void SMESHGUI_BoundingBox::compute() } else { srcList->length( mySrc.count() ); - for( int i = 0; i < mySrc.count(); i++ ) + for( int i = 0; i < mySrc.count(); i++ ) { srcList[i] = mySrc[i]; + mySrc[i]->Register(); + } } if ( srcList->length() > 0 ) { // compute bounding box int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 ); SMESH::Measurements_var measure = SMESHGUI::GetSMESHGen()->CreateMeasurements(); SMESH::Measure result = measure->BoundingBox( srcList.in() ); + SALOME::UnRegister( srcList ); measure->UnRegister(); myXmin->setText( QString::number( result.minX, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); myXmax->setText( QString::number( result.maxX, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); @@ -1080,6 +1085,219 @@ void SMESHGUI_BoundingBox::clear() erasePreview(); } +/*! + \class SMESHGUI_BasicProperties + \brief basic properties measurement widget. + + Widget to calculate length, area or volume for the selected object(s). +*/ + +/*! + \brief Constructor. + \param parent parent widget +*/ +SMESHGUI_BasicProperties::SMESHGUI_BasicProperties( QWidget* parent ) +: QWidget( parent ) +{ + // Property (length, area or volume) + QGroupBox* aPropertyGrp = new QGroupBox( tr( "PROPERTY" ), this ); + + QRadioButton* aLength = new QRadioButton( tr( "LENGTH" ), aPropertyGrp ); + QRadioButton* anArea = new QRadioButton( tr( "AREA" ), aPropertyGrp ); + QRadioButton* aVolume = new QRadioButton( tr( "VOLUME" ), aPropertyGrp ); + + myMode = new QButtonGroup( this ); + myMode->addButton( aLength, Length ); + myMode->addButton( anArea, Area ); + myMode->addButton( aVolume, Volume ); + + QHBoxLayout* aPropertyLayout = new QHBoxLayout; + aPropertyLayout->addWidget( aLength ); + aPropertyLayout->addWidget( anArea ); + aPropertyLayout->addWidget( aVolume ); + + aPropertyGrp->setLayout( aPropertyLayout ); + + // Source object + QGroupBox* aSourceGrp = new QGroupBox( tr( "SOURCE_MESH_SUBMESH_GROUP" ), this ); + + mySource = new QLineEdit( aSourceGrp ); + mySource->setReadOnly( true ); + + QHBoxLayout* aSourceLayout = new QHBoxLayout; + aSourceLayout->addWidget( mySource ); + + aSourceGrp->setLayout( aSourceLayout ); + + // Compute button + QPushButton* aCompute = new QPushButton( tr( "COMPUTE" ), this ); + + // Result of computation (length, area or volume) + myResultGrp = new QGroupBox( this ); + + myResult = new QLineEdit; + myResult->setReadOnly( true ); + + QHBoxLayout* aResultLayout = new QHBoxLayout; + aResultLayout->addWidget( myResult ); + + myResultGrp->setLayout( aResultLayout ); + + // Layout + QGridLayout* aMainLayout = new QGridLayout( this ); + aMainLayout->setMargin( MARGIN ); + aMainLayout->setSpacing( SPACING ); + + aMainLayout->addWidget( aPropertyGrp, 0, 0, 1, 2 ); + aMainLayout->addWidget( aSourceGrp, 1, 0, 1, 2 ); + aMainLayout->addWidget( aCompute, 2, 0 ); + aMainLayout->addWidget( myResultGrp, 3, 0, 1, 2 ); + aMainLayout->setColumnStretch( 1, 5 ); + aMainLayout->setRowStretch( 4, 5 ); + + // Initial state + setMode( Length ); + + // Connections + connect( myMode, SIGNAL( buttonClicked( int ) ), this, SLOT( modeChanged( int ) ) ); + connect( aCompute, SIGNAL( clicked() ), this, SLOT( compute() ) ); + + // Selection filter + QList filters; + filters.append( new SMESH_TypeFilter( SMESH::MESHorSUBMESH ) ); + filters.append( new SMESH_TypeFilter( SMESH::GROUP ) ); + myFilter = new SMESH_LogicalFilter( filters, SMESH_LogicalFilter::LO_OR ); +} + +/*! + \brief Destructor +*/ +SMESHGUI_BasicProperties::~SMESHGUI_BasicProperties() +{ +} + +/*! + \brief Sets the measurement mode. + \param theMode the mode to set (length, area or volume meausurement) +*/ +void SMESHGUI_BasicProperties::setMode( const Mode theMode ) +{ + QRadioButton* aButton = qobject_cast( myMode->button( theMode ) ); + if ( aButton ) { + aButton->setChecked( true ); + modeChanged( theMode ); + } +} + +/*! + \brief Setup the selection mode. +*/ +void SMESHGUI_BasicProperties::updateSelection() +{ + LightApp_SelectionMgr* selMgr = SMESHGUI::selectionMgr(); + + disconnect( selMgr, 0, this, 0 ); + selMgr->clearFilters(); + + SMESH::SetPointRepresentation( false ); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) { + aViewWindow->SetSelectionMode( ActorSelection ); + } + selMgr->installFilter( myFilter ); + + connect( selMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) ); +} + +/*! + \brief Deactivate widget +*/ +void SMESHGUI_BasicProperties::deactivate() +{ + disconnect( SMESHGUI::selectionMgr(), 0, this, 0 ); +} + +/*! + \brief Called when selection is changed +*/ +void SMESHGUI_BasicProperties::selectionChanged() +{ + SUIT_OverrideCursor wc; + + SALOME_ListIO selected; + SMESHGUI::selectionMgr()->selectedObjects( selected ); + + if ( selected.Extent() == 1 ) { + Handle(SALOME_InteractiveObject) IO = selected.First(); + SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface( IO ); + if ( !CORBA::is_nil( obj ) ) { + mySrc = obj; + + QString aName; + SMESH::GetNameOfSelectedIObjects( SMESHGUI::selectionMgr(), aName ); + mySource->setText( aName ); + } + } + + clear(); +} + +/*! + \brief Called when the measurement mode selection is changed. + \param theMode the selected mode +*/ +void SMESHGUI_BasicProperties::modeChanged( int theMode ) +{ + clear(); + + if ( theMode == Length ) { + myResultGrp->setTitle( tr("LENGTH") ); + } else if ( theMode == Area ) { + myResultGrp->setTitle( tr("AREA") ); + } else if ( theMode == Volume ) { + myResultGrp->setTitle( tr("VOLUME") ); + } +} + +/*! + \brief Calculate length, area or volume for the selected object(s) +*/ +void SMESHGUI_BasicProperties::compute() +{ + SUIT_OverrideCursor wc; + + SMESH::SMESH_IDSource_var source; + + if ( !CORBA::is_nil( mySrc ) ) { + // compute + int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 ); + SMESH::Measurements_var measure = SMESHGUI::GetSMESHGen()->CreateMeasurements(); + + double result = 0; + + if ( myMode->checkedId() == Length ) { + result = measure->Length( mySrc.in() ); + } else if ( myMode->checkedId() == Area ) { + result = measure->Area( mySrc.in() ); + } else if ( myMode->checkedId() == Volume ) { + result = measure->Volume( mySrc.in() ); + } + + measure->UnRegister(); + + myResult->setText( QString::number( result, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); + } else { + clear(); + } +} + +/*! + \brief Reset the widget to the initial state (nullify the result field) +*/ +void SMESHGUI_BasicProperties::clear() +{ + myResult->clear(); +} + /*! \class SMESHGUI_MeshInfoDlg \brief Centralized dialog box for the measurements @@ -1105,12 +1323,17 @@ SMESHGUI_MeasureDlg::SMESHGUI_MeasureDlg( QWidget* parent, int page ) // min distance myMinDist = new SMESHGUI_MinDistance( myTabWidget ); - myTabWidget->addTab( myMinDist, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_MIN_DIST" ) ), tr( "MIN_DIST" ) ); + int aMinDistInd = myTabWidget->addTab( myMinDist, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_MIN_DIST" ) ), tr( "MIN_DIST" ) ); // bounding box myBndBox = new SMESHGUI_BoundingBox( myTabWidget ); - myTabWidget->addTab( myBndBox, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_BND_BOX" ) ), tr( "BND_BOX" ) ); + int aBndBoxInd = myTabWidget->addTab( myBndBox, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_BND_BOX" ) ), tr( "BND_BOX" ) ); + + // basic properties + + myBasicProps = new SMESHGUI_BasicProperties( myTabWidget ); + int aBasicPropInd = myTabWidget->addTab( myBasicProps, resMgr->loadPixmap( "SMESH", tr( "ICON_MEASURE_BASIC_PROPS" ) ), tr( "BASIC_PROPERTIES" ) ); // buttons QPushButton* okBtn = new QPushButton( tr( "SMESH_BUT_OK" ), this ); @@ -1134,7 +1357,19 @@ SMESHGUI_MeasureDlg::SMESHGUI_MeasureDlg( QWidget* parent, int page ) l->addStretch(); l->addLayout( btnLayout ); - myTabWidget->setCurrentIndex( qMax( (int)MinDistance, qMin( (int)BoundingBox, page ) ) ); + int anInd = -1; + if ( page == MinDistance ) { + anInd = aMinDistInd; + } else if ( page == BoundingBox ) { + anInd = aBndBoxInd; + } else if ( page == Length || page == Area || page == Volume ) { + myBasicProps->setMode( (SMESHGUI_BasicProperties::Mode)(page - Length) ); + anInd = aBasicPropInd; + } + + if ( anInd >= 0 ) { + myTabWidget->setCurrentIndex( anInd ); + } connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ) ); @@ -1195,7 +1430,10 @@ void SMESHGUI_MeasureDlg::updateSelection() myMinDist->updateSelection(); else if ( myTabWidget->currentIndex() == BoundingBox ) myBndBox->updateSelection(); - + else { + myBndBox->erasePreview(); + myBasicProps->updateSelection(); + } } /*! @@ -1203,9 +1441,16 @@ void SMESHGUI_MeasureDlg::updateSelection() */ void SMESHGUI_MeasureDlg::help() { - SMESH::ShowHelpFile( myTabWidget->currentIndex() == MinDistance ? - "measurements_page.html#min_distance_anchor" : - "measurements_page.html#bounding_box_anchor" ); + QString aHelpFile; + if ( myTabWidget->currentIndex() == MinDistance ) { + aHelpFile = "measurements_page.html#min_distance_anchor"; + } else if ( myTabWidget->currentIndex() == BoundingBox ) { + aHelpFile = "measurements_page.html#bounding_box_anchor"; + } else { + aHelpFile = "measurements_page.html#basic_properties_anchor"; + } + + SMESH::ShowHelpFile( aHelpFile ); } /*! @@ -1224,6 +1469,7 @@ void SMESHGUI_MeasureDlg::activate() */ void SMESHGUI_MeasureDlg::deactivate() { + myBasicProps->deactivate(); myMinDist->deactivate(); myBndBox->deactivate(); myTabWidget->setEnabled( false ); diff --git a/src/SMESHGUI/SMESHGUI_Measurements.h b/src/SMESHGUI/SMESHGUI_Measurements.h index f4cd672fb..65e3539cd 100644 --- a/src/SMESHGUI/SMESHGUI_Measurements.h +++ b/src/SMESHGUI/SMESHGUI_Measurements.h @@ -32,6 +32,7 @@ class QButtonGroup; class QLineEdit; class QTabWidget; +class QGroupBox; class SUIT_SelectionFilter; class SALOME_Actor; class SMESH_Actor; @@ -101,9 +102,9 @@ public: void updateSelection(); void deactivate(); + void erasePreview(); private: - void erasePreview(); void displayPreview(); void createPreview( double, double, double, double, double, double ); @@ -135,6 +136,37 @@ private: SALOME_Actor* myPreview; }; +class SMESHGUI_EXPORT SMESHGUI_BasicProperties : public QWidget +{ + Q_OBJECT; + +public: + //! Property type + enum Mode { Length, Area, Volume }; + + SMESHGUI_BasicProperties( QWidget* = 0 ); + ~SMESHGUI_BasicProperties(); + + void setMode( const Mode ); + + void updateSelection(); + void deactivate(); + +private slots: + void selectionChanged(); + void modeChanged( int); + void compute(); + void clear(); + +private: + QButtonGroup* myMode; + QLineEdit* mySource; + QGroupBox* myResultGrp; + QLineEdit* myResult; + SMESH::SMESH_IDSource_var mySrc; + SUIT_SelectionFilter* myFilter; +}; + class SMESHGUI_EXPORT SMESHGUI_MeasureDlg : public QDialog { Q_OBJECT; @@ -145,7 +177,10 @@ public: //! Measurement type enum { MinDistance, //!< minimum distance - BoundingBox //!< bounding box + BoundingBox, //!< bounding box + Length, //!< length + Area, //!< area + Volume //!< volume }; SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance ); @@ -167,6 +202,7 @@ private: QTabWidget* myTabWidget; SMESHGUI_MinDistance* myMinDist; SMESHGUI_BoundingBox* myBndBox; + SMESHGUI_BasicProperties* myBasicProps; }; #endif // SMESHGUI_MEASUREMENTS_H diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 786c72f9d..e17221fff 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -2235,7 +2235,7 @@ void SMESHGUI_AddInfo::meshInfo( SMESH::SMESH_Mesh_ptr mesh, QTreeWidgetItem* pa { // type GEOM::GEOM_Object_var shape = mesh->GetShapeToMesh(); - SMESH::MedFileInfo* inf = mesh->GetMEDFileInfo(); + SMESH::MedFileInfo_var inf = mesh->GetMEDFileInfo(); QTreeWidgetItem* typeItem = createItem( parent, Bold ); typeItem->setText( 0, tr( "TYPE" ) ); if ( !CORBA::is_nil( shape ) ) { @@ -3401,6 +3401,7 @@ void SMESHGUI_CtrlInfo::computeAspectRatio() anItem->attach( myPlot ); myPlot->replot(); } + delete aHistogram; } void SMESHGUI_CtrlInfo::computeAspectRatio3D() @@ -3417,6 +3418,7 @@ void SMESHGUI_CtrlInfo::computeAspectRatio3D() anItem->attach( myPlot3D ); myPlot3D->replot(); } + delete aHistogram; } /*! @@ -3518,16 +3520,29 @@ SMESHGUI_CtrlInfoDlg::SMESHGUI_CtrlInfoDlg( QWidget* parent ) okBtn->setAutoDefault( true ); okBtn->setDefault( true ); okBtn->setFocus(); + QPushButton* dumpBtn = new QPushButton( tr( "BUT_DUMP_MESH" ), this ); + dumpBtn->setAutoDefault( true ); + QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this ); + helpBtn->setAutoDefault( true ); + + QHBoxLayout* btnLayout = new QHBoxLayout; + btnLayout->setSpacing( SPACING ); + btnLayout->setMargin( 0 ); + + btnLayout->addWidget( okBtn ); + btnLayout->addWidget( dumpBtn ); + btnLayout->addStretch( 10 ); + btnLayout->addWidget( helpBtn ); - QGridLayout* l = new QGridLayout ( this ); + QVBoxLayout* l = new QVBoxLayout ( this ); l->setMargin( MARGIN ); l->setSpacing( SPACING ); - l->addWidget( myCtrlInfo, 0, 0, 1, 3 ); - l->addWidget( okBtn, 1, 1 ); - l->setColumnStretch( 0, 5 ); - l->setColumnStretch( 2, 5 ); + l->addWidget( myCtrlInfo ); + l->addLayout( btnLayout ); - connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( dumpBtn, SIGNAL( clicked() ), this, SLOT( dump() ) ); + connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ) ); connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ) ); connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) ); @@ -3606,4 +3621,49 @@ void SMESHGUI_CtrlInfoDlg::deactivate() disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) ); } +/*! + * \brief Dump contents into a file + */ +void SMESHGUI_CtrlInfoDlg::dump() +{ + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if ( !app ) return; + SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); + if ( !appStudy ) return; + _PTR( Study ) aStudy = appStudy->studyDS(); + QStringList aFilters; + aFilters.append( tr( "TEXT_FILES" ) ); + + DumpFileDlg fd( this ); + fd.setWindowTitle( tr( "SAVE_INFO" ) ); + fd.setFilters( aFilters ); + fd.myBaseChk->hide(); + fd.myElemChk->hide(); + fd.myAddChk ->hide(); + fd.myCtrlChk->hide(); + if ( fd.exec() == QDialog::Accepted ) + { + QString aFileName = fd.selectedFile(); + if ( !aFileName.isEmpty() ) { + QFileInfo aFileInfo( aFileName ); + if ( aFileInfo.isDir() ) + return; + + QFile aFile( aFileName ); + if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ) ) + return; + + QTextStream out( &aFile ); + myCtrlInfo->saveInfo( out ); + } + } +} + +/*! + * \brief Show help + */ +void SMESHGUI_CtrlInfoDlg::help() +{ + SMESH::ShowHelpFile("mesh_infos_page.html#mesh_quality_info_anchor"); +} diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.h b/src/SMESHGUI/SMESHGUI_MeshInfo.h index 54c101324..bc8c40683 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.h @@ -401,6 +401,8 @@ private slots: void activate(); void deactivate(); void updateSelection(); + void help(); + void dump(); private: SMESHGUI_CtrlInfo* myCtrlInfo; diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 187f12d9d..73d5aab8e 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -75,10 +75,6 @@ #include #include CORBA_CLIENT_HEADER(SMESH_Gen) -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================ /*! * \brief Constructor @@ -1103,14 +1099,10 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim, // Call hypothesis creation server method (without GUI) SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(theTypeName, aHypName, false); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif - } else { + aHyp.out(); + } + else { // Get hypotheses creator client (GUI) - // BUG 0020378 - //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName); SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName); // Create hypothesis @@ -1179,10 +1171,7 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim, else { SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(theTypeName, aHypName, false); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif + aHyp.out(); } } @@ -1653,13 +1642,6 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList ) if ( !anAlgoVar->_is_nil() ) SMESH::AddHypothesisOnMesh( aMeshVar, anAlgoVar ); } -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - if (aMeshSO) - aMeshVar->UnRegister(); -#endif } return true; } @@ -1741,8 +1723,9 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList GEOM::GEOM_Object_wrap aGroupVar = op->CreateGroup(mainGeom, aGroupType); op->UnionList(aGroupVar, aSeq); - if (op->IsDone()) { - aGeomVar = aGroupVar.in(); + if (op->IsDone()) + { + aGeomVar = GEOM::GEOM_Object::_duplicate( aGroupVar.in() ); // publish the GEOM group in study QString aNewGeomGroupName ("Auto_group_for_"); @@ -1918,32 +1901,25 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) if (aHypData) { QString aClientLibName = aHypData->ClientLibName; - if (aClientLibName == "") + if ( aClientLibName.isEmpty() ) { // Call hypothesis creation server method (without GUI) SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(aHypName, aHypName, true); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif + aHyp.out(); } else { // Get hypotheses creator client (GUI) - // BUG 0020378 SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName); // Create algorithm if (aCreator) - aCreator->create(true, aHypName, myDlg, 0, QString::null ); + aCreator->create( true, aHypName, myDlg, 0, QString::null ); else { SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(aHypName, aHypName, true); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif + aHyp.out(); } } QStringList tmpList; diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index ee4e206b2..1384b9376 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -1212,7 +1212,7 @@ bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, { if ( hasObj ) return theEditor->QuadTo4Tri( obj ), true; - SMESH::SMESH_IDSource_var elems = theEditor->MakeIDSource( theIds, SMESH::FACE ); + SMESH::SMESH_IDSource_wrap elems = theEditor->MakeIDSource( theIds, SMESH::FACE ); theEditor->QuadTo4Tri( elems ); return true; } @@ -1466,9 +1466,11 @@ bool SMESHGUI_CuttingIntoTetraDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito const SMESH::long_array& theIds, SMESH::SMESH_IDSource_ptr theObj) { - SMESH::SMESH_IDSource_var obj = theObj; + SMESH::SMESH_IDSource_wrap obj = theObj; if ( CORBA::is_nil( obj )) obj = theEditor->MakeIDSource( theIds, myEntityType ? SMESH::VOLUME : SMESH::FACE ); + else + obj->Register(); try { theEditor->SplitVolumesIntoTetra( obj, myGroupChoice->checkedId()+1 ); } @@ -1476,5 +1478,8 @@ bool SMESHGUI_CuttingIntoTetraDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito SalomeApp_Tools::QtCatchCorbaException( S_ex ); return false; } + catch(...) { + return false; + } return true; } diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index c451a29c4..c53aa66cb 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -85,9 +85,6 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action #define SPACING 8 #define MARGIN 11 -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ //================================================================================= // class : SMESHGUI_RotationDlg() @@ -494,12 +491,6 @@ bool SMESHGUI_RotationDlg::ClickOnApply() if (!mesh->_is_nil()) { if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); -#endif } } } @@ -511,12 +502,6 @@ bool SMESHGUI_RotationDlg::ClickOnApply() if (!mesh->_is_nil()) { if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); -#endif } } break; diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index ef39d4373..83a793fb1 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -100,10 +100,6 @@ private: #define SPACING 6 #define MARGIN 11 -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================= // class : SMESHGUI_ScaleDlg() // purpose : @@ -489,8 +485,9 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); + SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); myMeshes[0]->SetParameters( aParameters.join( ":" ).toLatin1().constData() ); - aMeshEditor->Scale(aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL), aPoint, aScaleFact, false); + aMeshEditor->Scale( src, aPoint, aScaleFact, false); } break; @@ -505,8 +502,9 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); + SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); - groups = aMeshEditor->ScaleMakeGroups(aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL), aPoint, aScaleFact); + groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact); } } else { @@ -519,8 +517,9 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); + SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); - aMeshEditor->Scale(aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL), aPoint, aScaleFact, true); + aMeshEditor->Scale( src, aPoint, aScaleFact, true); } } break; @@ -536,27 +535,16 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() aName.toLatin1().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); -#endif } } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); - mesh = aMeshEditor->ScaleMakeMesh(aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL), aPoint, aScaleFact, makeGroups, - LineEditNewMesh->text().toLatin1().data()); + SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); + mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups, + LineEditNewMesh->text().toLatin1().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); -#endif } break; } @@ -1158,7 +1146,8 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) { } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditPreviewer(); - aMeshEditor->Scale(aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL), aPoint, aScaleFact, copy); + SMESH::SMESH_IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); + aMeshEditor->Scale( src, aPoint, aScaleFact, copy); aMeshPreviewStruct << aMeshEditor->GetPreviewData(); } setSimulationPreview(aMeshPreviewStruct); diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 3dd0cadc1..66b70585b 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -85,10 +85,6 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action #define SPACING 6 #define MARGIN 11 -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================= // class : SMESHGUI_SymmetryDlg() // purpose : @@ -556,12 +552,6 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() aName.toLatin1().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); -#endif } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); @@ -570,12 +560,6 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() LineEditNewMesh->text().toLatin1().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); -#endif } } break; diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 29c51666c..3805733db 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -559,11 +559,6 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() aName.toLatin1().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); - - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); } } else { @@ -573,11 +568,6 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() LineEditNewMesh->text().toLatin1().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); - - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - mesh->UnRegister(); } break; } diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index 26f361984..563e740ad 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -215,10 +215,10 @@ namespace SMESH SalomeApp_Application* app = dynamic_cast (SUIT_Session::session()->activeApplication()); if ( app ) { - QString IOR = app->orb()->object_to_string( theObject ); + CORBA::String_var ior = app->orb()->object_to_string( theObject ); SalomeApp_Study* study = dynamic_cast( app->activeStudy() ); - if ( study && !IOR.isEmpty() ) - res = study->studyDS()->FindObjectIOR( IOR.toLatin1().constData() ); + if ( study && strlen( ior ) > 0 ) + res = study->studyDS()->FindObjectIOR( ior.in() ); } return res; } diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h index 80f1c8460..49a98c2d2 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.h +++ b/src/SMESHGUI/SMESHGUI_Utils.h @@ -35,6 +35,7 @@ // SALOME KERNEL includes #include +#include // SALOME GUI includes #include @@ -43,6 +44,9 @@ //OCC includes #include +#include +#include CORBA_CLIENT_HEADER(SMESH_Mesh) + class SUIT_ViewWindow; class SUIT_Desktop; class SUIT_Study; @@ -176,6 +180,10 @@ SMESHGUI_EXPORT SMESHGUI_EXPORT gp_XYZ getNormale( const SMDS_MeshFace* theFace ); + + // type to use instead of SMESH_IDSource_var for automatic UnRegister() + typedef SALOME::GenericObj_wrap SMESH_IDSource_wrap; + } #endif // SMESHGUI_UTILS_H diff --git a/src/SMESHGUI/SMESH_images.ts b/src/SMESHGUI/SMESH_images.ts index a8fa7fd73..c985f167e 100644 --- a/src/SMESHGUI/SMESH_images.ts +++ b/src/SMESHGUI/SMESH_images.ts @@ -559,6 +559,22 @@ ICON_SPLIT_TO_TETRA split_into_tetra.png + + ICON_MEASURE_LENGTH + mesh_measure_length.png + + + ICON_MEASURE_AREA + mesh_measure_area.png + + + ICON_MEASURE_VOLUME + mesh_measure_volume.png + + + ICON_MEASURE_BASIC_PROPS + mesh_measure_basic_props.png + ICON_MEASURE_MIN_DIST mesh_min_dist.png diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index 6a8b6750f..e989562ed 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -712,6 +712,46 @@ TOP_MEASURE_BND_BOX Bounding box + + MEN_BASIC_PROPERTIES + Basic Properties + + + MEN_MEASURE_LENGTH + Length + + + STB_MEASURE_LENGTH + Calculate sum of length of all 1D elements of the selected object(s) + + + TOP_MEASURE_LENGTH + Length + + + MEN_MEASURE_AREA + Area + + + STB_MEASURE_AREA + Calculate sum of area of all 2D elements of the selected object(s) + + + TOP_MEASURE_AREA + Area + + + MEN_MEASURE_VOLUME + Volume + + + STB_MEASURE_VOLUME + Calculate sum of volume of all 3D elements of the selected object(s) + + + TOP_MEASURE_VOLUME + Volume + MEN_MOVE Move Node @@ -1649,6 +1689,10 @@ Do you want to continue ? SMESH_FACE Face + + SMESH_FACES + Faces + SMESH_FEATUREANGLE Feature Angle @@ -2655,6 +2699,10 @@ Consider saving your work before application crash SMESH_VOLUME Volume + + SMESH_VOLUMES + Volumes + SMESH_WARNING Warning @@ -2717,14 +2765,15 @@ Consider saving your work before application crash SMESH_WRN_SIZE_LIMIT_EXCEEDED - No automatic update of the presentation has been done: new mesh size (%1 elements) exceeds current size limit (%2 elements). -Please check preferences of Mesh module. + No automatic update of the presentation has been done: +New mesh size (%1 elements) exceeds current size limit of automatic update (%2 elements). SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED - New mesh sise (%1 elements) exceeds current size limit (%2 elements). -Not all mesh elements are shown. Please check preferences of Mesh module. + New mesh size (%1 elements) exceeds current size limit of automatic update (%2 elements). +The following elements are not shown: %3. +Use Display Entity menu command to show them. @@ -7247,6 +7296,18 @@ as they are of improper type: CTRL_INFO Quality Info + + BUT_DUMP_MESH + &Dump + + + TEXT_FILES + Text files (*.txt) + + + SAVE_INFO + Save info + SMESHGUI_MinDistance @@ -7287,6 +7348,33 @@ as they are of improper type: Distance + + SMESHGUI_BasicProperties + + PROPERTY + Property + + + LENGTH + Length + + + AREA + Area + + + VOLUME + Volume + + + SOURCE_MESH_SUBMESH_GROUP + Source (mesh, sub-mesh or group) + + + COMPUTE + Compute + + SMESHGUI_CopyMeshDlg @@ -7316,6 +7404,10 @@ as they are of improper type: BND_BOX Bounding Box + + BASIC_PROPERTIES + Basic Properties + SMESHGUI_BoundingBox diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 7423e43ea..6f409879b 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -748,6 +748,46 @@ TOP_MEASURE_BND_BOX Boîte englobante + + MEN_BASIC_PROPERTIES + Basic Properties + + + MEN_MEASURE_LENGTH + Length + + + STB_MEASURE_LENGTH + Calculate sum of length of all 1D elements of the selected object(s) + + + TOP_MEASURE_LENGTH + Length + + + MEN_MEASURE_AREA + Area + + + STB_MEASURE_AREA + Calculate sum of area of all 2D elements of the selected object(s) + + + TOP_MEASURE_AREA + Area + + + MEN_MEASURE_VOLUME + Volume + + + STB_MEASURE_VOLUME + Calculate sum of volume of all 3D elements of the selected object(s) + + + TOP_MEASURE_VOLUME + Volume + MEN_MOVE Déplacer un nœud @@ -1677,6 +1717,10 @@ Voulez-vous continuer ? SMESH_FACE Face + + SMESH_FACES + Faces + SMESH_FEATUREANGLE Montrer l'angle @@ -2663,6 +2707,10 @@ Enregistrez votre travail avant que l'application se plante SMESH_VOLUME Volume + + SMESH_VOLUMES + Volumes + SMESH_WARNING Avertissement @@ -2725,14 +2773,16 @@ Enregistrez votre travail avant que l'application se plante SMESH_WRN_SIZE_LIMIT_EXCEEDED - La présentation n'a pas été mise à jour automatiquement: la nouvelle taille du maillage (%1 éléments) dépasse la limite de taille actuelle (%2 éléments). + La présentation n'a pas été mise à jour automatiquement: +la nouvelle taille du maillage (%1 éléments) dépasse la limite de taille actuelle (%2 éléments). Vérifiez la limite dans les préférences du module Mesh. SMESH_WRN_SIZE_INC_LIMIT_EXCEEDED - New mesh sise (%1 elements) exceeds current size limit (%2 elements). -Not all mesh elements are shown. Please check preferences of Mesh module. + La nouvelle taille de maillage (%1 éléments) dépasse l'actuelle taille limite de la mise à jour automatique (%2 éléments). +Les éléments suivants ne sont pas affichés: %3. +Utilisez le menu "Visualiser une entité" pour les afficher. @@ -7228,6 +7278,18 @@ en raison de leurs types incompatibles: SMESHGUI_CtrlInfoDlg + + SAVE_INFO + Save info + + + TEXT_FILES + Text files (*.txt) + + + BUT_DUMP_MESH + &Dump + CTRL_INFO Quality Info @@ -7272,6 +7334,33 @@ en raison de leurs types incompatibles: Distance + + SMESHGUI_BasicProperties + + PROPERTY + Property + + + LENGTH + Length + + + AREA + Area + + + VOLUME + Volume + + + SOURCE_MESH_SUBMESH_GROUP + Source (mesh, sub-mesh or group) + + + COMPUTE + Compute + + SMESHGUI_CopyMeshDlg @@ -7301,6 +7390,10 @@ en raison de leurs types incompatibles: BND_BOX Boîte englobante + + BASIC_PROPERTIES + Basic Properties + SMESHGUI_BoundingBox diff --git a/src/SMESHGUI/SMESH_msg_ja.ts b/src/SMESHGUI/SMESH_msg_ja.ts new file mode 100644 index 000000000..69c73bcc4 --- /dev/null +++ b/src/SMESHGUI/SMESH_msg_ja.ts @@ -0,0 +1,7003 @@ + + + + + @default + + SMESH_EXPORT_MESH + メッシュをエクスポートします。 + + + MED_FILES_FILTER + 医学ファイル + + + IDEAS_FILES_FILTER + IDEAS ファイル + + + DAT_FILES_FILTER + DAT ファイル + + + TEXT_FILES_FILTER + TXT ファイル + + + MED_VX_FILES_FILTER + MED%1 ファイル + + + STL_FILES_FILTER + STL ファイル + + + STL_ASCII_FILES_FILTER + STL ASCII ファイル + + + CGNS_FILES_FILTER + CGNS ファイル + + + GMF_ASCII_FILES_FILTER + 組み換え ASCII ファイル + + + GMF_BINARY_FILES_FILTER + 組み換えバイナリ ファイル + + + STL_BIN_FILES_FILTER + STL バイナリ ファイル + + + ALL_FILES_FILTER + すべてのファイル + + + SMESH_AND + と + + + AREA_ELEMENTS + エリア + + + MIN_DIAG_ELEMENTS + 最小斜め + + + ASPECTRATIO_3D_ELEMENTS + アスペクト比 3 D + + + ASPECTRATIO_ELEMENTS + アスペクト比 + + + NODE_POSITION + 位置 + + + U_POSITION + U + + + V_POSITION + V + + + COL_ALGO_HEADER + アルゴリズム + + + COL_ERROR_HEADER + エラー + + + COL_SHAPE_HEADER + サブ + + + COMPERR_ALGO_FAILED + 失敗したアルゴリズム + + + COMPERR_BAD_INPUT_MESH + 無効な入力メッシュ + + + COMPERR_BAD_SHAPE + 予期しないジオメトリ + + + COMPERR_EXCEPTION + 不明な例外 + + + COMPERR_MEMORY_PB + メモリ割り当ての問題 + + + COMPERR_OCC_EXCEPTION + OCC 例外 + + + COMPERR_OK + エラーなし + + + COMPERR_SLM_EXCEPTION + サロメ例外 + + + COMPERR_STD_EXCEPTION + スポット + + + COMPERR_UNKNOWN + 不明なエラー + + + COMPERR_CANCELED + 計算のキャンセル + + + COMPERR_NO_MESH_ON_SHAPE + サブに割り当てられたメッシュ要素がないです。 + + + EDITERR_NO_MEDIUM_ON_GEOM + マジェンタ色で表示される要素のゆがみを防ぐジオメトリ上に配置しないいくつかの中のノード + + + SMESH_GEOM + ジオメトリ + + + DIRECT_GEOM_SELECTION + 直接ジオメトリの選択 + + + ELEMENT_ID + 要素の ID + + + ELEMENT_IDS + 要素 Id + + + FREE_BORDERS + 無料の罫線 + + + GEOMETRY_NAME + ジオメトリの名前 + + + GEOM_BY_MESH_ELEM_SELECTION + ジオメトリをメッシュ要素の選択を見つける + + + GLOBAL_ALGO + グローバル + + + INF_SELECT_OBJECT + オブジェクトを選択します。 + + + LENGTH2D_EDGES + 長さ 2 D + + + LENGTH_EDGES + 長さ + + + LOCAL_ALGO + ローカル + + + MAX_ELEMENT_LENGTH_2D + 要素の直径 2 D + + + MAX_ELEMENT_LENGTH_3D + 要素の直径 3 D + + + MEN_ADD + 追加 + + + MEN_ADV_INFO + メッシュ情報 + + + MEN_ALL + すべて + + + MEN_AREA + エリア + + + MEN_ASPECT + アスペクト比 + + + MEN_ASPECT_3D + アスペクト比 3 D + + + MEN_AUTO_COLOR + 自動カラー補正 + + + MEN_AUTO_UPD + 自動更新 + + + MEN_BUILD_COMPOUND + 化合物を構築します。 + + + MEN_COPY_MESH + メッシュをコピーします。 + + + MEN_CLIP + クリッピング + + + MEN_COLORS + プロパティ + + + MEN_COMPUTE + 計算 + + + MEN_PRECOMPUTE + プレビュー + + + MEN_EVALUATE + 評価 + + + MEN_CONNECTION + 複数の罫線 + + + MEN_CONNECTION_2D + 国境で多種の 2 D + + + MEN_CONSTRUCT_GROUP + 構成グループ + + + MEN_CONV_TO_QUAD + 2 次に/から変換します。 + + + MEN_2D_FROM_3D + 境界要素を作成します。 + + + MEN_MESH_ORDER + サブメッシュ優先度の変更 + + + MEN_CREATE_GROUP + グループを作成します。 + + + MEN_CREATE_GEO_GROUP + ジオメトリ グループを作成します。 + + + MEN_CREATE_MESH + メッシュを作成します。 + + + MEN_CREATE_SUBMESH + サブメッシュを作成します。 + + + MEN_CTRL + コントロール + + + MEN_NODE_CTRL + ノードのコントロール + + + MEN_EDGE_CTRL + エッジ コントロール + + + MEN_FACE_CTRL + 顔のコントロール + + + MEN_VOLUME_CTRL + ボリューム コントロール + + + MEN_CUT + 四角形の切断 + + + MEN_CUT_GROUP + グループをカットします。 + + + MEN_IMPORT_DAT + DAT ファイル + + + MEN_DAT + DAT ファイル + + + MEN_DELETE + 削除 + + + MEN_DEL_GROUP + グループの内容を削除します。 + + + MEN_FACE_ORIENTATION + 顔の向き + + + MEN_DISABLE_AUTO_COLOR + 自動カラー補正を無効にします。 + + + MEN_DISPLAY_ONLY + のみを表示します。 + + + MEN_DISPMODE + 表示モード + + + MEN_DISP_ENT + エンティティを表示します。 + + + MEN_ELEM0D + 0 D 要素 + + + MEN_ELEMS0D + 0 D 要素 + + + MEN_0D_ON_ALL_NODES + 要素ノード上の 0 D 要素 + + + MEN_BALL + ボール + + + MEN_BALLS + ボール + + + MEN_EDGE + エッジ + + + MEN_EDGES + エッジ + + + MEN_EDIT + 編集 + + + MEN_EDIT_GROUP + [グループの編集 + + + MEN_EDIT_GEOMGROUP_AS_GROUP + スタンドアロンとしてグループの編集 + + + MEN_EDIT_HYPO + 仮説を編集します。 + + + MEN_EDIT_MESHSUBMESH + メッシュ/サブ mesh を編集します。 + + + MEN_EXPORT + エクスポート + + + MEN_EXPORT_DAT + DAT ファイルにエクスポートします。 + + + MEN_EXPORT_MED + 医学ファイルにエクスポートします。 + + + MEN_EXPORT_CGNS + CGNS ファイルにエクスポートします。 + + + MEN_EXPORT_GMF + 組み換えファイルにエクスポートします。 + + + MEN_EXPORT_SAUV + SAUV ファイルにエクスポートします。 + + + MEN_EXPORT_STL + STL ファイルにエクスポートします。 + + + MEN_EXPORT_UNV + UNV ファイルにエクスポートします。 + + + MEN_EXTRUSION + 押出 + + + MEN_EXTRUSION_ALONG + 押し出しパスに沿って + + + MEN_FACES + 直面しています。 + + + MEN_FILE + ファイル + + + MEN_FIND_ELEM + 要素のポイントを検索します。 + + + TOP_REORIENT_2D + ベクトルによって顔の向きを変更します。 + + + MEN_REORIENT_2D + ベクトルによって顔の向きを変更します。 + + + STB_REORIENT_2D + ベクトルによって顔の向きを変更します。 + + + TOP_FIND_ELEM + 要素のポイントを検索します。 + + + STB_FIND_ELEM + 要素のポイントを検索します。 + + + EQUAL_NODE + 二重ノード + + + MEN_EQUAL_NODE + 二重ノード + + + STB_EQUAL_NODE + 二重ノード + + + TOP_EQUAL_NODE + 二重ノード + + + EQUAL_EDGE + ダブル エッジ + + + MEN_EQUAL_EDGE + ダブル エッジ + + + STB_EQUAL_EDGE + ダブル エッジ + + + TOP_EQUAL_EDGE + ダブル エッジ + + + EQUAL_FACE + 二重の顔 + + + MEN_EQUAL_FACE + 二重の顔 + + + STB_EQUAL_FACE + 二重の顔 + + + TOP_EQUAL_FACE + 二重の顔 + + + EQUAL_VOLUME + ダブル ボリューム + + + MEN_EQUAL_VOLUME + ダブル ボリューム + + + STB_EQUAL_VOLUME + ダブル ボリューム + + + TOP_EQUAL_VOLUME + ダブル ボリューム + + + MEN_BARE_BORDER_VOLUME + ボリュームが裸の枠線 + + + MEN_BARE_BORDER_FACE + 顔が裸の枠線 + + + MEN_OVER_CONSTRAINED_VOLUME + 過剰のボリューム + + + MEN_OVER_CONSTRAINED_FACE + 過剰拘束面 + + + MEN_FREE_BORDER + 無料の罫線 + + + MEN_FREE_EDGE + 自由辺 + + + MEN_FREE_NODE + 無料ノード + + + MEN_FREE_FACES + 無料顔 + + + MEN_GLOBAL_HYPO + グローバルな仮説 + + + MEN_HEXA + 直方体 + + + MEN_HIDE + 非表示 + + + MEN_HYPO + 仮説 + + + MEN_IMPORT + インポート + + + MEN_INT_GROUP + グループが交差します。 + + + MEN_INV + 斜めの反転 + + + MEN_LENGTH + 長さ + + + MEN_LENGTH_2D + 長さ 2 D + + + MEN_MAP + パターンのマッピング + + + MEN_MAX_ELEMENT_LENGTH_2D + 要素の直径 2 D + + + MEN_MAX_ELEMENT_LENGTH_3D + 要素の直径 3 D + + + MEN_IMPORT_MED + 医学ファイル + + + MEN_MED + 医学ファイル + + + MEN_IMPORT_CGNS + CGNS ファイル + + + MEN_CGNS + CGNS ファイル + + + MEN_IMPORT_GMF + 組み換えファイル + + + MEN_GMF + 組み換えファイル + + + MEN_IMPORT_SAUV + SAUV ファイル + + + MEN_SAUV + SAUV ファイル + + + MEN_MERGE + 節点はマージします。 + + + MEN_MERGE_ELEMENTS + 要素をマージします。 + + + MEN_MESH + メッシュ + + + MEN_MESH_THROU_POINT + ノードの移動 + + + MEN_MIN_ANG + 最小角度 + + + MEN_MODIFY + 変更 + + + MEN_MEASURE + 測定 + + + MEN_MEASURE_MIN_DIST + 最小距離 + + + STB_MEASURE_MIN_DIST + 2 つのオブジェクト間の最小距離を計算します。 + + + TOP_MEASURE_MIN_DIST + 最小距離 + + + MEN_MEASURE_BND_BOX + 境界ボックス + + + STB_MEASURE_BND_BOX + 選択したオブジェクトの境界ボックスを計算します。 + + + TOP_MEASURE_BND_BOX + 境界ボックス + + + MEN_MOVE + ノードの移動 + + + MEN_NODE + ノード + + + MEN_NODES + ノード + + + MEN_NUM + 段落番号 + + + MEN_NUM_ELEMENTS + 要素を表示 # + + + MEN_NUM_NODES + ノードを表示 # + + + MEN_ORIENT + 印刷の向き + + + MEN_POLYGON + 多角形 + + + MEN_POLYHEDRON + 多面体 + + + MEN_PRECISION + 精度 + + + MEN_PREF + 設定 + + + MEN_QUAD + 四角形 + + + MEN_QUADRATIC_EDGE + 2 次のエッジ + + + MEN_QUADRATIC_HEXAHEDRON + 二次六面体 + + + MEN_QUADRATIC_PENTAHEDRON + 二次 5面体 + + + MEN_QUADRATIC_PYRAMID + 二次ピラミッド + + + MEN_QUADRATIC_QUADRANGLE + 二次四角形 + + + MEN_QUADRATIC_TETRAHEDRON + 二次四面体 + + + MEN_QUADRATIC_TRIANGLE + 2 次三角形 + + + MEN_QUALITY + 品質コントロール + + + MEN_REMOVE + 削除 + + + MEN_REMOVE_ELEMENTS + 要素 + + + MEN_REMOVE_NODES + ノード + + + MEN_REMOVE_ORPHAN_NODES + 孤児ノード + + + MEN_RENAME + 名前の変更 + + + MEN_RENUM + 番号を付け替える + + + MEN_RENUM_ELEMENTS + 要素 + + + MEN_RENUM_NODES + ノード + + + MEN_RESET + リセット + + + MEN_DISTRIBUTION_CTRL + 配布 + + + MEN_SAVE_DISTRIBUTION + エクスポート. + + + MEN_SHOW_DISTRIBUTION + ショー + + + MEN_PLOT_DISTRIBUTION + プロット + + + DISTRIBUTION_NB_ENT + エンティティ数 + + + MEN_REVOLUTION + 革命 + + + MEN_ROT + 回転 + + + MEN_SCALAR_BAR + スカラー バー + + + MEN_SCALAR_BAR_PROP + スカラー バーのプロパティ + + + MEN_SELECTION + 選択 + + + MEN_SEL_FILTER_LIB + 選択フィルター ライブラリ + + + MEN_SEW + 縫製 + + + MEN_SHADE + 網かけの設定 + + + MEN_QUADRATIC_REPRESENT + 2 D 二次 + + + MEN_LINE_REPRESENTATION + 行 + + + MEN_ARC_REPRESENTATION + 円弧 + + + MEN_SHOW + ショー + + + MEN_SHRINK + 縮小 + + + MEN_SKEW + 傾斜 + + + MEN_SMOOTH + 平滑化 + + + MEN_STD_INFO + 標準的なメッシュ情報 + + + MEN_IMPORT_STL + STL ファイル + + + MEN_STL + STL ファイル + + + MEN_SYM + 対称性 + + + MEN_TAPER + テーパ + + + MEN_TETRA + 四面体 + + + MEN_TOOLS + ツール + + + MEN_TRANS + 翻訳 + + + MEN_SCALE + スケール変換 + + + MEN_DUPLICATE_NODES + 重複したノード + + + MEN_TRANSF + 変換 + + + MEN_TRANSP + 透明性 + + + MEN_TRIANGLE + 三角形 + + + MEN_UNASSIGN + 割り当てを解除します。 + + + MEN_UNION + 三角形の和集合 + + + MEN_UNION2 + 2 つの三角形の和集合 + + + MEN_IMPORT_UNV + UNV ファイル + + + MEN_UNV + UNV ファイル + + + MEN_UN_GROUP + 連合のグループ + + + MEN_UNDERLYING_ELEMS + 基になるエンティティのグループ + + + MEN_UPDATE + 更新プログラム + + + MEN_VIEW + ビュー + + + MEN_VOLUMES + ボリューム + + + MEN_VOLUME_3D + ボリューム + + + MEN_WARP + ワープ角度 + + + MEN_WHAT_IS + メッシュ要素の情報 + + + MEN_WIRE + ワイヤ フレーム + + + MEN_SPLIT_TO_TETRA + 四面体に分割します。 + + + TOP_SPLIT_TO_TETRA + 四面体に分割します。 + + + STB_SPLIT_TO_TETRA + 四面体に分割します。 + + + MESHERS_FILE_CANT_OPEN + リソース ファイルを開くことができません。 + + + MESHERS_FILE_CHECK_VARIABLE + 環境変数 SMESH_MeshersList をチェックします。 + + + MESHERS_FILE_NO_VARIABLE + 環境変数 SMESH_MeshersList が定義されていません + + + MESH_IS_NOT_SELECTED + 選択したメッシュしてください。 がない、メッシュを選択し、もう一度やり直してください。 + + + MESH_NODE + ノード + + + MESH_NODE_TITLE + ノードを追加します。 + + + MINIMUMANGLE_ELEMENTS + 最小角度 + + + MULTI2D_BORDERS + 国境マルチ 2 D で + + + MULTI_BORDERS + 国境 Multi-Connections で + + + GROUP_NAME_IS_EMPTY + グループの名前が指定されていません。作成するか、既存のものを選択する新しいグループの名前を入力してください。 + + + MESH_STANDALONE_GRP_CHOSEN + ジオメトリ上のグループを選択:%1。スタンドアロンのグループに変換しますか。 + + + NODE_ID + ノード ID + + + NODE_IDS + ノード Id + + + NON_SMESH_OBJECTS_SELECTED + あるオブジェクトを選択、%1 コンポーネントに属していません。 + + + PREVIEW + プレビュー + + + SKEW_ELEMENTS + 傾斜 + + + SMESHGUI_INVALID_PARAMETERS + パラメーターが正しく指定されていない正しい値を入力して、もう一度実行してください + + + SMESH_ADD_ALGORITHM + アルゴリズム + + + SMESH_ADD_ALGORITHM_TITLE + アルゴリズムの割り当て + + + SMESH_ADD_ELEM0D + 0 D の要素を追加します。 + + + SMESH_ADD_ELEM0D_TITLE + 0 D の要素を追加します。 + + + SMESH_ADD_BALL + ボールの要素を追加します。 + + + SMESH_ADD_BALL_TITLE + ボールの要素を追加します。 + + + SMESH_ADD_EDGE + エッジを追加します。 + + + SMESH_ADD_EDGE_TITLE + エッジを追加します。 + + + SMESH_ADD_HEXAS + 六面体を追加します。 + + + SMESH_ADD_HEXAS_TITLE + 六面体を追加します。 + + + SMESH_ADD_HYPOTHESIS + 仮説 + + + SMESH_ADD_HYPOTHESIS_TITLE + 仮説の割り当て + + + SMESH_ADD_HYP_WRN + 「割り当て%1」が。 + + + SMESH_ADD_OCTA + 角柱を追加します。 + + + SMESH_ADD_OCTA_TITLE + 角柱を追加します。 + + + SMESH_ADD_POLYGON + 多角形を追加します。 + + + SMESH_ADD_POLYGON_TITLE + 多角形を追加します。 + + + SMESH_ADD_PENTA + 表層五面体を追加します。 + + + SMESH_ADD_PENTA_TITLE + 表層五面体を追加します。 + + + SMESH_ADD_PYRAMID + ピラミッドを追加します。 + + + SMESH_ADD_PYRAMID_TITLE + ピラミッドを追加します。 + + + SMESH_ADD_QUADRANGLE + 四角形を追加します。 + + + SMESH_ADD_QUADRANGLE_TITLE + 四角形を追加します。 + + + SMESH_ADD_QUADRATIC_EDGE_TITLE + 2 次のエッジを追加します。 + + + SMESH_ADD_QUADRATIC_HEXAHEDRON_TITLE + 二次六面体を追加します。 + + + SMESH_ADD_TRIQUADRATIC_HEXAHEDRON_TITLE + TriQuadratic 直方体を追加します。 + + + SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE + 二次 5面体を追加します。 + + + SMESH_ADD_QUADRATIC_PYRAMID_TITLE + 二次ピラミッドを追加します。 + + + SMESH_ADD_BIQUADRATIC_QUADRANGLE_TITLE + バイカッド四角形を追加します。 + + + SMESH_ADD_QUADRATIC_QUADRANGLE_TITLE + 2 次の四角形を追加します。 + + + SMESH_ADD_QUADRATIC_TETRAHEDRON_TITLE + 二次四面体を追加します。 + + + SMESH_ADD_QUADRATIC_TRIANGLE_TITLE + 2 次三角形を追加します。 + + + SMESH_ADD_SUBMESH + サブメッシュ建設 + + + SMESH_ADD_TETRAS + 四面体を追加します。 + + + SMESH_ADD_TETRAS_TITLE + 四面体を追加します。 + + + SMESH_ADD_TO_GROUP + グループに追加します。 + + + SMESH_ADD_TRIANGLE + 三角形を追加します。 + + + SMESH_ADD_TRIANGLE_TITLE + 三角形を追加します。 + + + SMESH_ANGLE + 角度 + + + SMESH_ARGUMENTS + 引数 + + + SMESH_AUTO_GROUPS + 自動的にグループを作成します。 + + + SMESH_REQUIRED_GROUPS + 必要なエンティティのグループを作成します。 + + + SMESH_AVAILABLE + 利用可能です + + + SMESH_AVAILABLE_ALGORITHMS + 利用可能なアルゴリズム + + + SMESH_AVAILABLE_HYPOTHESES + 使用可能な仮説 + + + SMESH_AXIS + 軸 + + + SMESH_BAD_SELECTION + 有効な選択 + + + SMESH_BAD_MESH_SELECTION + 有効なメッシュも選択されていません + + + SMESH_BOUNDARYEDGES + 境界エッジ + + + SMESH_BUILD_COMPOUND_TITLE + 化合物を作成します。 + + + SMESH_COPY_MESH_TITLE + メッシュをコピーします。 + + + SMESH_KEEP_IDS + 要素の Id を保持します。 + + + SMESH_BUT_ADD + A & dd + + + SMESH_BUT_APPLY + & 適用 + + + SMESH_BUT_CANCEL + & [キャンセル + + + SMESH_BUT_CLOSE + & 閉じる + + + SMESH_BUT_CREATE + 作成します。 + + + SMESH_BUT_DELETE + 削除 + + + SMESH_BUT_FILTER + セット & フィルター + + + SMESH_BUT_HELP + & ヘルプ + + + SMESH_BUT_NEW + 新機能 + + + SMESH_BUT_NO + & なし + + + SMESH_BUT_OK + & [Ok] + + + SMESH_BUT_OVERWRITE + 以上 & 書き込み + + + SMESH_BUT_APPLY_AND_CLOSE + A & に当てて行うと閉じる + + + SMESH_BUT_REMOVE + & 削除 + + + SMESH_BUT_SORT + & 一覧を並べ替える + + + SMESH_BUT_YES + & はい + + + SMESH_CANT_ADD_HYP + 「%1」を割り当てることはできません。 + + + SMESH_CANT_RM_HYP + 「%1」の割り当てを解除することができますないです。 + + + SMESH_CHECK_COLOR + 色 + + + SMESH_CLIPPING_FROM + <-- + + + SMESH_CLIPPING_INTO + %> します。 + + + SMESH_CLIPPING_TITLE + クリップを変更します。 + + + SMESH_COMPUTE_SUCCEED + メッシュ計算を成功します。 + + + SMESH_EVALUATE_SUCCEED + メッシュ評価成功します。 + + + SMESH_CONTENT + コンテンツ + + + SMESH_CONTINUE_MESH_VISUALIZATION + それによりアプリケーションがクラッシュ、メッシュを表示するには、十分なメモリがないことようであります。可視化を続行しますか? + + + SMESH_COORDINATES + 座標 + + + SMESH_COPY_ELEMENTS + 要素のコピー + + + SMESH_COPY_GROUPS + コピー グループ + + + SMESH_CREATE_ALGORITHMS + アルゴリズムを作成します。 + + + SMESH_CREATE_COPY + コピーを作成します。 + + + SMESH_CREATE_GROUP_TITLE + グループを作成します。 + + + SMESH_CREATE_GEO_GROUP + ジオメトリ グループを作成します。 + + + SMESH_CREATE_HYPOTHESES + 仮説を作成します。 + + + SMESH_CREATE_MESH + 新しいメッシュを作成します。 + + + SMESH_CREATE_POLYHEDRAL_VOLUME_TITLE + 多面体のボリュームを作成します。 + + + SMESH_DIAGONAL + 斜めの反転 + + + SMESH_DIAGONAL_INVERSION_TITLE + 斜めの反転 + + + SMESH_DISTANCE + 距離 + + + SMESH_DRS_1 + 医学ファイルに指定した名前のメッシュが含まれていません。 + + + SMESH_DRS_2 + 医学ファイルは要素数の範囲を重複しています、ファイルから番号は無視されます。 + + + SMESH_DRS_3 + 不正なファイル データがいくつかの要素がスキップされました + + + SMESH_DRS_4 + ファイルが正しいではない、いくつかのデータが失われて + + + SMESH_DRS_EMPTY + ファイルは空です、何も公開します。 + + + SMESH_DX + dX + + + SMESH_DY + dY + + + SMESH_DZ + アルジェリア + + + SMESH_ELEM0D + 0 D 要素 + + + SMESH_ELEMS0D + 0 D 要素 + + + SMESH_BALL_ELEM + ボール + + + SMESH_BALL + ボール + + + SMESH_BALLS + ボール + + + SMESH_EDGE + エッジ + + + SMESH_EDGES + エッジ + + + SMESH_EDGES_CONNECTIVITY_TITLE + エッジ接続 + + + SMESH_EDIT_GROUP_TITLE + [グループの編集 + + + SMESH_EDIT_GEOMGROUP_AS_GROUP_TITLE + スタンドアロンとしてグループの編集 + + + SMESH_EDIT_HYPOTHESES + 仮説の割り当て + + + SMESH_EDIT_USED + 使用 + + + SMESH_ELEMENTS + 要素 + + + SMESH_ELEMENTS_COLOR + メッシュ要素の色 + + + SMESH_ELEMENTS_TYPE + 要素型 + + + SMESH_ELEMENT_TYPE + 要素の型 + + + SMESH_ERROR + エラー + + + SMESH_ERR_SCALARBAR_PARAMS + 警告 !パラメーターが正しくありません。 + + + SMESH_EXPORT_FAILED + メッシュのエクスポートに失敗しました。おそらく、ないディスクに十分なスペースです。 + + + SMESH_EXPORT_MED_DUPLICATED_GRP + メッシュ「%1」に重複しているグループ名です。エクスポートをキャンセルし、名前を変更することができます、それ以外の場合は、結果のファイル内のいくつかのグループ名もの研究で一致しません。続行しますか。 + + + SMESH_EXPORT_MED_DUPLICATED_MESH_NAMES + いくつかのメッシュ オブジェクトと、選択範囲内の同じ名前です。結果ファイルが正しくない可能性があります。続行しますか。 + + + SMESH_EXPORT_MED_V2_1 + 名 - エクスポート メッシュ中 MED 2.1 ポリゴンと多面体要素に「%1」MED 2.2 は確かに MED の 2.1 にエクスポートする正しいエクスポート用に惜しまれることでしょうか? + + + SMESH_EXPORT_MED_VERSION_COLLISION + ファイル「%1」の音楽配信マック & バージョンは不明であるか、選択したバージョンと一致しません。ファイルを上書きしますか。 + + + SMESH_EXPORT_MED_MESH_NAMES_COLLISION + 選択したファイルには、既に次の名前のメッシュが含まれます:%1 結果ファイルが正しくない可能性があります。ファイルを上書きしますか。 + + + EXPORT_NOT_SUPPORTED + エクスポート中にメッシュ名「%1」に%2%3 に惜しまれることでしょう。続行しますか。 + + + SMESH_EXTRUSION + 押出 + + + SMESH_EXTRUSION_TO_DISTANCE + 押出の距離 + + + SMESH_EXTRUSION_ALONG_VECTOR + ベクトルに沿って押出 + + + SMESH_FACE + 顔 + + + SMESH_FEATUREANGLE + 機能の角度 + + + SMESH_FEATUREEDGES + フィーチャー エッジ + + + SMESH_FILE_EXISTS + ファイル「%1」は既に存在します。それを上書きするか、エクスポートされたデータにその内容を追加しますか。 + + + SMESH_FONT_ARIAL + Ms p ゴシック + + + SMESH_FONT_BOLD + 太字 + + + SMESH_FONT_COURIER + 宅配便 + + + SMESH_FONT_ITALIC + 斜体 + + + SMESH_FONT_SCALARBAR + フォント + + + SMESH_FONT_SHADOW + シャドウ + + + SMESH_FONT_TIMES + 回 + + + SMESH_GEOM_GROUP + ジオメトリ グループ + + + SMESH_GROUP + グループ + + + SMESH_GROUP_GEOMETRY + ジオメトリ グループします。 + + + SMESH_GROUP_FILTER + フィルターをグループ化します。 + + + SMESH_GROUP_SELECTED + %1 グループ + + + SMESH_GROUP_STANDALONE + スタンドアロン グループ + + + SMESH_GROUP_TYPE + グループの種類 + + + SMESH_HEIGHT + 高さ: + + + SMESH_HEXAS + 直方体 + + + SMESH_HEXAHEDRA + Hexahedrons + + + SMESH_HILIGHT_COLOR + 強調表示色 + + + SMESH_HORIZONTAL + 水平方向 + + + SMESH_HYPOTHESES + 仮説 + + + SMESH_HYP_1 + 仮説のアルゴリズムをミスします。 + + + SMESH_HYP_10 + 仮説とサブメッシュの大きさが一致しません + + + SMESH_HYP_11 + 図形は、メインの 1 つもそのサブも、有効なグループでもないです。 + + + SMESH_HYP_12 + アルゴリズムの期待チェック アルゴリズムについてサポートされているジオメトリは、ジオメトリの不一致します。 + + + SMESH_HYP_13 + アルゴリズムは、図形を働くことができません。 + + + SMESH_HYP_2 + 上の図形が同時仮説です。 + + + SMESH_HYP_3 + 仮説の不適切なパラメーター値をが + + + SMESH_HYP_4 + %1 D の要素を生成する上のディメンションの別のアルゴリズムとしてサブメッシュは無視されます。 + + + SMESH_HYP_5 + アルゴリズムよりも低い次元のアルゴリズムがすべての寸法要素を生成することによって非表示にします。 + + + SMESH_HYP_6 + 原因不明の致命的なエラー仮説の定義 + + + SMESH_HYP_7 + 仮説は、現在のコンテキストに適していません。 + + + SMESH_HYP_8 + 非準拠メッシュ応用仮説を使用して生成されます。 + + + SMESH_HYP_9 + そのような次元仮説は、既に図形に割り当てられています。 + + + SMESH_ID_DIAGONAL + Id エッジ + + + SMESH_ID_ELEMENTS + Id 要素 + + + SMESH_ID_FACES + Id の顔 + + + SMESH_ID_NODES + Id ノード + + + SMESH_INCORRECT_INPUT + 不正な入力データ ! + + + SMESH_INFORMATION + 情報 + + + SMESH_INIT + メッシュ + + + SMESH_INIT_MESH + メッシュ構造 + + + SMESH_INSUFFICIENT_DATA + 不十分な入力値 + + + SMESH_LABELS + ラベル: + + + SMESH_LABELS_COLORS_SCALARBAR + 色 && ラベル + + + SMESH_LENGTH + 長さ + + + SMESH_MAKE_GROUPS + グループを生成します。 + + + SMESH_MANIFOLDEDGES + 多様体のエッジ + + + SMESH_MAX + 最大 + + + SMESH_MEN_ALGORITHMS + アルゴリズム + + + SMESH_MEN_APPLIED_ALGORIHTMS + 適用されたアルゴリズム + + + SMESH_MEN_APPLIED_HYPOTHESIS + 応用仮説 + + + SMESH_MEN_COMPONENT + SMESH + + + SMESH_MEN_HYPOTHESIS + 仮説 + + + SMESH_MEN_SubMeshesOnCompound + SubMeshes 化合物 + + + SMESH_MEN_SubMeshesOnEdge + SubMeshes エッジ + + + SMESH_MEN_SubMeshesOnFace + SubMeshes 顔 + + + SMESH_MEN_SubMeshesOnSolid + SubMeshes ソリッド + + + SMESH_MEN_SubMeshesOnVertex + 頂点に subMeshes + + + SMESH_AUTOMATIC + 自動 + + + SMESH_MANUAL + 手動 + + + SMESH_MERGE_ELEMENTS + 要素をマージします。 + + + SMESH_MODE + モード + + + SMESH_MERGED_ELEMENTS + %1 要素をうまくマージしました。 + + + SMESH_MERGED_NODES + %1 ノードが正常にマージします。 + + + SMESH_NO_ELEMENTS_DETECTED + マージ要素はありません。 + + + SMESH_NO_NODES_DETECTED + マージ ノードはありません。 + + + SMESH_MERGE_NODES + 節点はマージします。 + + + SMESH_MESH + メッシュ + + + SMESH_MESHINFO_0DELEMS + 0 D 要素 + + + SMESH_MESHINFO_BALLS + ボール + + + SMESH_MESHINFO_ALL_TYPES + 異種 + + + SMESH_MESHINFO_EDGES + エッジ + + + SMESH_MESHINFO_ELEMENTS + 要素 + + + SMESH_MESHINFO_ENTITIES + エンティティ + + + SMESH_MESHINFO_FACES + 直面しています。 + + + SMESH_MESHINFO_HEXAS + Hexahedrons + + + SMESH_MESHINFO_NAME + 名前 + + + SMESH_MESHINFO_NODES + ノード + + + SMESH_MESHINFO_ORDER0 + 合計 + + + SMESH_MESHINFO_ORDER1 + 線形 + + + SMESH_MESHINFO_ORDER2 + 2 次 + + + SMESH_MESHINFO_HEXAPRISM + 六角形プリズム + + + SMESH_MESHINFO_POLYEDRES + 多面体 + + + SMESH_MESHINFO_POLYGONES + ポリゴン + + + SMESH_MESHINFO_PRISMS + プリズム + + + SMESH_MESHINFO_PYRAS + ピラミッド + + + SMESH_MESHINFO_QUADRANGLES + 四角形 + + + SMESH_MESHINFO_TETRAS + 四面体 + + + SMESH_MESHINFO_TITLE + メッシュ情報 + + + SMESH_MESHINFO_TOTAL + 合計 + + + SMESH_MESHINFO_TRIANGLES + 三角形 + + + SMESH_MESHINFO_TYPE + タイプ + + + SMESH_MESHINFO_VOLUMES + ボリューム + + + SMESH_MIN + 分 + + + SMESH_MOVE + 移動 + + + SMESH_MOVE_ELEMENTS + 要素を移動します。 + + + SMESH_MOVE_NODES_TITLE + ノードの移動 + + + SMESH_NAME + 名前 + + + SMESH_NODES + ノード + + + SMESH_NONMANIFOLDEDGES + 非多様体のエッジ + + + SMESH_NORMAL + 通常 + + + SMESH_NO_MESH_VISUALIZATION + メッシュを表示するには、十分なメモリがありません。 + + + SMESH_NUMBEROFCOLORS + 色の注意: + + + SMESH_NUMBEROFLABELS + ラベルの注意: + + + SMESH_NUMBEROFSTEPS + ステップの数: + + + SMESH_OBJECTS_SELECTED + %1_objects + + + SMESH_OBJECT_ALGORITHM + アルゴリズム + + + SMESH_OBJECT_GEOM + 幾何学的オブジェクト + + + SMESH_OBJECT_HYPOTHESIS + 仮説 + + + SMESH_OBJECT_MESH + メッシュ + + + SMESH_OBJECT_MESHorSUBMESH + メッシュまたはサブメッシュ + + + SMESH_OPERATION_FAILED + 操作に失敗しました + + + SMESH_OCTA + クック プリズム + + + SMESH_OCTAHEDRA + クック プリズム + + + TOP_OCTA + 角柱 + + + MEN_OCTA + 角柱 + + + STB_OCTA + 角柱 + + + SMESH_ORIENTATION + 印刷の向き + + + SMESH_ORIENTATION_ELEMENTS_TITLE + 向きを変更します。 + + + SMESH_OUTLINE_COLOR + メッシュ オブジェクトの色 + + + SMESH_PARAMETERS + パラメーター + + + SMESH_PENTA + 表層五面体 + + + SMESH_PENTAHEDRA + Pentahedrons + + + TOP_PENTA + 表層五面体 + + + MEN_PENTA + 表層五面体 + + + STB_PENTA + 表層五面体 + + + SMESH_PLANE + 飛行機 + + + SMESH_POINT + ポイント + + + SMESH_POINT_1 + ポイント 1 + + + SMESH_POINT_2 + ポイント 2 + + + SMESH_BASE_POINT + 基点 + + + SMESH_POLYEDRE_CREATE_ERROR + Polyedron の作成エラー + + + SMESH_POLYEDRON + 多面体 + + + SMESH_POLYEDRONS + 多面体 + + + SMESH_QUADRATIC_POLYEDRON + 二次多面体 + + + SMESH_QUADRATIC_POLYEDRONS + 二次多面体 + + + SMESH_POLYGON + 多角形 + + + SMESH_POLYGONS + ポリゴン + + + SMESH_QUADRATIC_POLYGON + 二次ポリゴン + + + SMESH_QUADRATIC_POLYGONS + 二次ポリゴン + + + SMESH_POSITION_SIZE_SCALARBAR + 起源 && サイズ + + + SMESH_DISTRIBUTION_SCALARBAR + 配布 + + + SMESH_SHOW_DISTRIBUTION_SCALARBAR + 分布を表示します。 + + + SMESH_PRECISION + 精度 + + + SMESH_PREFERENCES_SCALARBAR + スカラー バー設定項目 + + + SMESH_PREF_SELECTION + 設定 - 選択 + + + SMESH_PRESELECTION + 予選 + + + SMESH_PRISM + プリズム + + + SMESH_PROPERTIES_SCALARBAR + スカラー バーのプロパティ + + + SMESH_PYRAMID + ピラミッド + + + SMESH_PYRAMIDS + ピラミッド + + + MEN_PYRAMID + ピラミッド + + + TOP_PYRAMID + ピラミッド + + + STB_PYRAMID + ピラミッド + + + SMESH_QUADRANGLE + 四角形 + + + SMESH_QUADRANGLES + 四角形 + + + SMESH_QUADRATIC_EDGE + 2 次のエッジ + + + SMESH_QUADRATIC_EDGES + 2 次のエッジ + + + SMESH_QUADRATIC_HEXAHEDRON + 二次六面体 + + + SMESH_QUADRATIC_HEXAHEDRONS + 二次 Hexahedrons + + + SMESH_TRIQUADRATIC_HEXAHEDRON + TriQuadratic 直方体 + + + SMESH_TRIQUADRATIC_HEXAHEDRONS + TriQuadratic Hexahedrons + + + TOP_TRIQUADRATIC_HEXAHEDRON + TriQuadratic 直方体 + + + MEN_TRIQUADRATIC_HEXAHEDRON + TriQuadratic 直方体 + + + STB_TRIQUADRATIC_HEXAHEDRON + TriQuadratic 直方体 + + + SMESH_QUADRATIC_PENTAHEDRON + 二次 5面体 + + + SMESH_QUADRATIC_PENTAHEDRONS + 二次 Pentahedrons + + + SMESH_QUADRATIC_PYRAMID + 二次ピラミッド + + + SMESH_QUADRATIC_PYRAMIDS + 二次ピラミッド + + + SMESH_QUADRATIC_QUADRANGLE + 二次四角形 + + + SMESH_QUADRATIC_QUADRANGLES + 二次四角形 + + + SMESH_BIQUADRATIC_QUADRANGLE + バイカッド四角形 + + + SMESH_BIQUADRATIC_QUADRANGLES + バイカッド四角形 + + + MEN_BIQUADRATIC_QUADRANGLE + バイカッド四角形 + + + TOP_BIQUADRATIC_QUADRANGLE + バイカッド四角形 + + + STB_BIQUADRATIC_QUADRANGLE + バイカッド四角形 + + + SMESH_QUADRATIC_TETRAHEDRON + 二次四面体 + + + SMESH_QUADRATIC_TETRAHEDRONS + 二次四面体 + + + SMESH_QUADRATIC_TRIANGLE + 2 次三角形 + + + SMESH_QUADRATIC_TRIANGLES + 2 次三角形 + + + SMESH_RANGE_MAX + 最大値: + + + SMESH_RANGE_MIN + 最小値: + + + SMESH_RANGE_SCALARBAR + スカラー範囲 + + + SMESH_REALLY_DELETE + 本当にこの%1 オブジェクトを削除しますか。: %2 + + + SMESH_REMOVE + 削除 + + + SMESH_REMOVE_ELEMENTS_TITLE + 要素を削除します。 + + + SMESH_REMOVE_NODES_TITLE + ノードを削除します。 + + + SMESH_RENUMBERING + 番号を付け替える + + + SMESH_RENUMBERING_ELEMENTS_TITLE + 要素の番号を付け替える + + + SMESH_RENUMBERING_NODES_TITLE + ノード番号の再割り当てください。 + + + SMESH_REVERSE + 逆 + + + SMESH_REVOLUTION + 革命 + + + SMESH_RM_HYP_WRN + 「割り当てられていない%1」が。 + + + SMESH_ROTATION + 回転 + + + SMESH_ROTATION_TITLE + 軸についての回転 + + + SMESH_SCALARBAR + スカラー バー + + + SMESH_SEGMENTS + セグメント + + + SMESH_SELECTION + 選択 + + + SMESH_SELECT_FROM + 選択します + + + SMESH_SELECT_WHOLE_MESH + 全体のメッシュ、サブメッシュまたはグループを選択します + + + SMESH_SUBMESH_GROUP + メッシュ、サブメッシュ、グループ + + + SMESH_SET_COLOR + カラー グループ + + + SMESH_SEWING + 縫製 + + + SMESH_SMOOTHING + 平滑化 + + + SMESH_STANDARD_MESHINFO_TITLE + 標準的なメッシュ情報 + + + SMESH_SUBMESH + サブメッシュ + + + SMESH_SUBMESH_SELECTED + %1 SubMeshes + + + SMESH_SYMMETRY + 対称性 + + + SMESH_TETRAS + 四面体 + + + SMESH_TETRAHEDRA + 四面体 + + + SMESH_TITLE + タイトル: + + + SMESH_TOLERANCE + トレランス + + + SMESH_TRANSLATION + 翻訳 + + + SMESH_SCALE_TITLE + スケール変換 + + + SMESH_DUPLICATE_TITLE + 重複したノード + + + SMESH_SCALE + スケール + + + SMESH_SCALE_FACTOR + スケール ファクター。 + + + SMESH_SCALE_FACTOR_X + スケール ファクター X: + + + SMESH_SCALE_FACTOR_Y + スケール ファクター Y: + + + SMESH_SCALE_FACTOR_Z + 尺度係数 Z: + + + SMESH_TRANSPARENCY_OPAQUE + 不透明 + + + SMESH_TRANSPARENCY_TITLE + 透明度を変更します。 + + + SMESH_TRANSPARENCY_TRANSPARENT + 透明 + + + SMESH_TRIANGLE + 三角形 + + + SMESH_TRIANGLES + 三角形 + + + SMESH_UPDATEVIEW + ビューを更新します。 + + + SMESH_VALUE + 値 + + + SMESH_VECTOR + ベクトル + + + SMESH_VERTICAL + 垂直方向 + + + SMESH_DISTRIBUTION_COLORING_TYPE + 着色型 + + + SMESH_MONOCOLOR + 単色 + + + SMESH_DISTRIBUTION_COLOR + 配布の色: + + + SMESH_MULTICOLOR + 多色 + + + SMESH_VISU_PROBLEM + メッシュの可視化は、おそらくためメモリ不足のため失敗 + + + SMESH_VISU_PROBLEM_CLEAR + メッシュの可視化に失敗しました、ライブ アプリケーションに削除されたすべての視覚的なデータも、メッセージを表示するメモリがありません。アプリケーションがクラッシュする前に作業を保存するを検討してください。 + + + SMESH_VOLUME + ボリューム + + + SMESH_WARNING + 警告 + + + SMESH_WHAT_IS_TITLE + メッシュ要素情報 + + + SMESH_WIDTH + 幅: + + + SMESH_WRN_ALGORITHM_ALREADYEXIST + アルゴリズムが既に存在します。 + + + SMESH_WRN_COMPUTE_FAILED + メッシュの計算に失敗しました + + + SMESH_WRN_EVALUATE_FAILED + メッシュ評価に失敗しました + + + SMESH_WRN_EMPTY_NAME + 空の名前が無効です。 + + + SMESH_WRN_HYPOTHESIS_ALREADYEXIST + 仮説が既に存在します。 + + + SMESH_WRN_HYPOTHESIS_NOTEXIST + 仮説またはアルゴリズムが存在するのではないです。 + + + SMESH_WRN_MISSING_PARAMETERS + 不足しているパラメーター + + + SMESH_WRN_NO_AVAILABLE_DATA + 選択に利用可能なデータがありません。 + + + SMESH_WRN_SELECTIONMODE_DIAGONAL + リンク選択モードをアクティブにします。 + + + SMESH_WRN_SELECTIONMODE_ELEMENTS + 要素選択モードをアクティブにします。 + + + SMESH_WRN_SELECTIONMODE_NODES + ノード選択モードをアクティブにします。 + + + SMESH_WRN_VIEWER_VTK + 研究フレーム VTK ビューアーをアクティブ化する必要があります。 + + + SMESH_WRN_SIZE_LIMIT_EXCEEDED + プレゼンテーションの自動更新が行われていない: 新しいメッシュ サイズ (%1 要素) は、現在のサイズ制限 (%2 要素) を超えています。メッシュ モジュールの設定を確認してください。 + + + SMESH_WRN_WARNING + 警告 + + + SMESH_X + X + + + SMESH_X_SCALARBAR + X: + + + SMESH_Y + Y + + + SMESH_Y_SCALARBAR + Y: + + + SMESH_Z + Z + + + STATE_ALGO_MISSING + %3-2 D のアルゴリズムがありません。 + + + STATE_HYP_BAD_GEOMETRY + %3-2 D アルゴリズム「%1」への期待の不一致のジオメトリに割り当てられています。 + + + STATE_HYP_BAD_PARAMETER + %3%の仮説 2 D アルゴリズム「%1」が無効なパラメーター値 + + + STATE_HYP_MISSING + %3%2 D アルゴリズム「%1」ミス%4 D 仮説 + + + STATE_HYP_NOTCONFORM + %3%2 D アルゴリズム「%1」の食材はメッシュ、適合しない: グローバル「適合メッシュできません」hypotesis が見つかりません + + + STB_ADV_INFO + メッシュ オブジェクトに関する基本情報を表示します。 + + + STB_ALL + すべて + + + STB_AREA + エリア + + + STB_ASPECT + アスペクト比 + + + STB_ASPECT_3D + アスペクト比 3 D + + + STB_AUTO_COLOR + 自動カラー補正 + + + STB_AUTO_UPD + 自動更新 + + + STB_BUILD_COMPOUND + 複合メッシュを構築します。 + + + STB_COPY_MESH + メッシュをコピーします。 + + + STB_CLIP + クリッピング + + + STB_COLORS + プロパティ + + + STB_COMPUTE + 計算 + + + STB_PRECOMPUTE + プレビュー + + + STB_EVALUATE + 評価 + + + STB_CONNECTION + 複数の罫線 + + + STB_CONNECTION_2D + 国境で多種の 2 D + + + STB_CONSTRUCT_GROUP + 構成グループ + + + STB_CONV_TO_QUAD + 2 次に/から変換します。 + + + STB_2D_FROM_3D + 境界要素を作成します。 + + + STB_MESH_ORDER + サブメッシュ優先度の変更 + + + STB_CREATE_GROUP + グループを作成します。 + + + STB_CREATE_GEO_GROUP + ジオメトリ グループを作成します。 + + + STB_CREATE_MESH + メッシュを作成します。 + + + STB_CREATE_SUBMESH + サブメッシュを作成します。 + + + STB_CUT + 四角形の切断 + + + STB_CUT_GROUP + グループをカットします。 + + + STB_DAT + DAT ファイルをエクスポートします。 + + + STB_IMPORT_DAT + DAT ファイルのインポート + + + STB_DELETE + 削除 + + + STB_DEL_GROUP + グループの内容を削除します。 + + + STB_FACE_ORIENTATION + 顔の向き + + + STB_DISABLE_AUTO_COLOR + 自動カラー補正を無効にします。 + + + STB_DISPLAY_ONLY + のみを表示します。 + + + STB_DISP_ENT + エンティティを表示します。 + + + STB_ELEM0D + 0 D 要素 + + + STB_0D_ON_ALL_NODES + 0 D 要素の要素ノードを + + + STB_ELEMS0D + 0 D 要素 + + + STB_BALLS + ボールの要素 + + + STB_BALL + ボールの要素 + + + STB_EDGE + エッジ + + + STB_EDGES + エッジ + + + STB_EDIT_GROUP + [グループの編集 + + + STB_EDIT_GEOMGROUP_AS_GROUP + スタンドアロンとしてグループの編集 + + + STB_EDIT_HYPO + 仮説を編集します。 + + + STB_EDIT_MESHSUBMESH + メッシュ/サブ mesh を編集します。 + + + STB_EXPORT_DAT + DAT ファイルにエクスポートします。 + + + STB_EXPORT_MED + 医学ファイルにエクスポートします。 + + + STB_EXPORT_CGNS + CGNS ファイルにエクスポートします。 + + + STB_EXPORT_GMF + 組み換えファイルにエクスポートします。 + + + STB_EXPORT_SAUV + SAUV ファイルにエクスポートします。 + + + STB_EXPORT_STL + STL ファイルにエクスポートします。 + + + STB_EXPORT_UNV + UNV ファイルにエクスポートします。 + + + STB_EXTRUSION + 押出 + + + STB_EXTRUSION_ALONG + 押し出しパスに沿って + + + STB_FACES + 直面しています。 + + + STB_BARE_BORDER_VOLUME + ボリュームが裸の枠線 + + + STB_BARE_BORDER_FACE + 顔が裸の枠線 + + + STB_OVER_CONSTRAINED_VOLUME + 過剰のボリューム + + + STB_OVER_CONSTRAINED_FACE + 過剰拘束面 + + + STB_FREE_BORDER + 無料の罫線 + + + STB_FREE_EDGE + 自由辺 + + + STB_FREE_NODE + 無料ノード + + + STB_FREE_FACES + 無料顔 + + + STB_GLOBAL_HYPO + グローバルな仮説 + + + STB_HEXA + 直方体 + + + STB_HIDE + 非表示 + + + STB_INT_GROUP + グループが交差します。 + + + STB_INV + 斜めの反転 + + + STB_LENGTH + 長さ + + + STB_LENGTH_2D + 長さ 2 D + + + STB_MAP + パターンのマッピング + + + STB_MAX_ELEMENT_LENGTH_2D + 要素の直径 2 D + + + STB_MAX_ELEMENT_LENGTH_3D + 要素の直径 3 D + + + STB_IMPORT_MED + 音楽配信マック & ファイルのインポート + + + STB_MED + 音楽配信マック & ファイルをエクスポートします。 + + + STB_IMPORT_STL + STL ファイルのインポート + + + STB_STL + STL ファイルをエクスポートします。 + + + STB_IMPORT_CGNS + CGNS ファイルのインポート + + + STB_CGNS + CGNS ファイルをエクスポートします。 + + + STB_IMPORT_GMF + 組み換えファイルのインポート + + + STB_GMF + 組み換えファイルをエクスポートします。 + + + STB_IMPORT_SAUV + SAUV ファイルのインポート + + + STB_SAUV + SAUV ファイルをエクスポートします。 + + + STB_MERGE + 節点はマージします。 + + + STB_MERGE_ELEMENTS + 要素をマージします。 + + + STB_MESH_THROU_POINT + ノードの移動 + + + STB_MIN_ANG + 最小角度 + + + STB_MOVE + ノードの移動 + + + STB_NODE + ノード + + + STB_NODES + ノード + + + STB_NUM_ELEMENTS + 要素を表示します。 + + + STB_NUM_NODES + ノードを表示します。 + + + STB_ORIENT + 印刷の向き + + + STB_POLYGON + 多角形 + + + STB_POLYHEDRON + 多面体 + + + STB_PRECISION + 精度 + + + STB_QUAD + 四角形 + + + STB_QUADRATIC_EDGE + 2 次のエッジ + + + STB_QUADRATIC_HEXAHEDRON + 二次六面体 + + + STB_QUADRATIC_PENTAHEDRON + 二次 5面体 + + + STB_QUADRATIC_PYRAMID + 二次ピラミッド + + + STB_QUADRATIC_QUADRANGLE + 二次四角形 + + + STB_QUADRATIC_TETRAHEDRON + 二次四面体 + + + STB_QUADRATIC_TRIANGLE + 2 次三角形 + + + STB_REMOVE_ELEMENTS + 要素を削除します。 + + + STB_REMOVE_NODES + ノードを削除します。 + + + STB_REMOVE_ORPHAN_NODES + 孤児ノードを削除します。 + + + STB_RENAME + 名前の変更 + + + STB_RENUM_ELEMENTS + 要素の番号を付け替える + + + STB_RENUM_NODES + ノード番号の再割り当てください。 + + + STB_RESET + リセット + + + STB_SAVE_DISTRIBUTION + 配布ファイルに保存します。 + + + STB_SHOW_DISTRIBUTION + 分布を表示します。 + + + STB_REVOLUTION + 革命 + + + STB_ROT + 回転 + + + STB_SCALAR_BAR + スカラー バー + + + STB_SCALAR_BAR_PROP + スカラー プロパティ バー + + + STB_SELECTION + 選択 + + + STB_SEL_FILTER_LIB + 選択フィルター ライブラリ + + + STB_SEW + 縫製 + + + STB_SHADE + 網かけの設定 + + + STB_SHOW + ショー + + + STB_SHRINK + 縮小 + + + STB_SKEW + 傾斜 + + + STB_SMOOTH + 平滑化 + + + STB_STD_INFO + 標準的なメッシュ情報 + + + STB_SYM + 対称性 + + + STB_TAPER + テーパ + + + STB_TETRA + 四面体 + + + STB_TRANS + 翻訳 + + + STB_SCALE + スケール変換 + + + STB_DUPLICATE_NODES + 重複したノード + + + STB_TRANSP + 透明性 + + + STB_TRIANGLE + 三角形 + + + STB_UNASSIGN + 割り当てを解除します。 + + + STB_UNION + 三角形の和集合 + + + STB_UNION2 + 2 つの三角形の和集合 + + + STB_IMPORT_UNV + UNV ファイルのインポート + + + STB_UNV + UNV ファイルをエクスポートします。 + + + STB_UN_GROUP + 連合のグループ + + + STB_UNDERLYING_ELEMS + 優れた寸法の既存のグループからのエンティティのグループを作成します。 + + + STB_UPDATE + 更新プログラム + + + STB_VOLUMES + ボリューム + + + STB_VOLUME_3D + ボリューム + + + STB_WARP + ワープ角度 + + + STB_WHAT_IS + メッシュのノードまたはエレメントに関する情報を表示します。 + + + STB_WIRE + ワイヤ フレーム + + + TAPER_ELEMENTS + テーパ + + + TB_ADD_REMOVE + ツールバーの追加と削除 + + + TB_CTRL + コントロール ツールバー + + + TB_DISP_MODE + ツールバーを表示するモード + + + TB_HYPO + 仮説ツールバー + + + TB_MESH + メッシュ ツールバー + + + TB_MODIFY + 変更ツールバー + + + TOP_ADV_INFO + メッシュ情報 + + + TOP_ALL + すべて + + + TOP_AREA + エリア + + + TOP_ASPECT + アスペクト比 + + + TOP_ASPECT_3D + アスペクト比 3 D + + + TOP_AUTO_COLOR + 自動カラー補正 + + + TOP_AUTO_UPD + 自動更新 + + + TOP_BUILD_COMPOUND + 複合メッシュを構築します。 + + + TOP_COPY_MESH + メッシュをコピーします。 + + + TOP_CLIP + クリッピング + + + TOP_COLORS + プロパティ + + + TOP_COMPUTE + 計算 + + + TOP_PRECOMPUTE + プレビュー + + + TOP_EVALUATE + 評価 + + + TOP_CONNECTION + 複数の罫線 + + + TOP_CONNECTION_2D + 国境で多種の 2 D + + + TOP_CONSTRUCT_GROUP + 構成グループ + + + TOP_CONV_TO_QUAD + 2 次に/から変換します。 + + + TOP_2D_FROM_3D + 境界要素を作成します。 + + + TOP_MESH_ORDER + サブメッシュ優先度の変更 + + + TOP_CREATE_GROUP + グループを作成します。 + + + TOP_CREATE_GEO_GROUP + ジオメトリ グループを作成します。 + + + TOP_CREATE_MESH + メッシュを作成します。 + + + TOP_CREATE_SUBMESH + サブメッシュを作成します。 + + + TOP_CUT + 四角形の切断 + + + TOP_CUT_GROUP + グループをカットします。 + + + TOP_IMPORT_DAT + DAT ファイルのインポート + + + TOP_DAT + DAT ファイルをエクスポートします。 + + + TOP_DELETE + 削除 + + + TOP_DEL_GROUP + グループの内容を削除します。 + + + TOP_FACE_ORIENTATION + 顔の向き + + + TOP_DISABLE_AUTO_COLOR + 自動カラー補正を無効にします。 + + + TOP_DISPLAY_ONLY + のみを表示します。 + + + TOP_DISP_ENT + エンティティを表示します。 + + + TOP_0D_ON_ALL_NODES + 0 D 要素の要素ノードを + + + TOP_ELEM0D + 0 D 要素 + + + TOP_ELEMS0D + 0 D 要素 + + + TOP_BALL + ボール + + + TOP_BALLS + ボール + + + TOP_EDGE + エッジ + + + TOP_EDGES + エッジ + + + TOP_EDIT_GROUP + [グループの編集 + + + TOP_EDIT_GEOMGROUP_AS_GROUP + スタンドアロンとしてグループの編集 + + + TOP_EDIT_HYPO + 仮説を編集します。 + + + TOP_EDIT_MESHSUBMESH + メッシュ/サブ mesh を編集します。 + + + TOP_EXPORT_DAT + DAT ファイルにエクスポートします。 + + + TOP_EXPORT_MED + 医学ファイルにエクスポートします。 + + + TOP_EXPORT_SAUV + SAUV ファイルにエクスポートします。 + + + TOP_EXPORT_STL + STL ファイルにエクスポートします。 + + + TOP_EXPORT_UNV + UNV ファイルにエクスポートします。 + + + TOP_EXTRUSION + 押出 + + + TOP_EXTRUSION_ALONG + 押し出しパスに沿って + + + TOP_FACES + 直面しています。 + + + TOP_BARE_BORDER_VOLUME + ボリュームが裸の枠線 + + + TOP_BARE_BORDER_FACE + 顔が裸の枠線 + + + TOP_OVER_CONSTRAINED_VOLUME + 過剰のボリューム + + + TOP_OVER_CONSTRAINED_FACE + 過剰拘束面 + + + TOP_FREE_BORDER + 無料の罫線 + + + TOP_FREE_EDGE + 自由辺 + + + TOP_FREE_NODE + 無料ノード + + + TOP_FREE_FACES + 無料顔 + + + TOP_GLOBAL_HYPO + グローバルな仮説 + + + TOP_HEXA + 直方体 + + + TOP_HIDE + 非表示 + + + TOP_INT_GROUP + グループが交差します。 + + + TOP_INV + 斜めの反転 + + + TOP_LENGTH + 長さ + + + TOP_LENGTH_2D + 長さ 2 D + + + TOP_MAP + パターンのマッピング + + + TOP_MAX_ELEMENT_LENGTH_2D + 要素の直径 2 D + + + TOP_MAX_ELEMENT_LENGTH_3D + 要素の直径 3 D + + + TOP_IMPORT_MED + 音楽配信マック & ファイルのインポート + + + TOP_MED + 音楽配信マック & ファイルをエクスポートします。 + + + TOP_IMPORT_STL + STL ファイルのインポート + + + TOP_STL + STL ファイルをエクスポートします。 + + + TOP_IMPORT_CGNS + CGNS ファイルのインポート + + + TOP_CGNS + CGNS ファイルをエクスポートします。 + + + TOP_IMPORT_GMF + 組み換えファイルのインポート + + + TOP_GMF + 組み換えファイルをエクスポートします。 + + + TOP_IMPORT_SAUV + SAUV ファイルのインポート + + + TOP_SAUV + SAUV ファイルをエクスポートします。 + + + TOP_MERGE + 節点はマージします。 + + + TOP_MERGE_ELEMENTS + 要素をマージします。 + + + TOP_MESH_THROU_POINT + ノードの移動 + + + TOP_MIN_ANG + 最小角度 + + + TOP_MOVE + ノードの移動 + + + TOP_NODE + ノード + + + TOP_NODES + ノード + + + TOP_NUM_ELEMENTS + 要素を表示します。 + + + TOP_NUM_NODES + ノードを表示します。 + + + TOP_ORIENT + 印刷の向き + + + TOP_POLYGON + 多角形 + + + TOP_POLYHEDRON + 多面体 + + + TOP_PRECISION + 精度 + + + TOP_QUAD + 四角形 + + + TOP_QUADRATIC_EDGE + 2 次のエッジ + + + TOP_QUADRATIC_HEXAHEDRON + 二次六面体 + + + TOP_QUADRATIC_PENTAHEDRON + 二次 5面体 + + + TOP_QUADRATIC_PYRAMID + 二次ピラミッド + + + TOP_QUADRATIC_QUADRANGLE + 二次四角形 + + + TOP_QUADRATIC_TETRAHEDRON + 二次四面体 + + + TOP_QUADRATIC_TRIANGLE + 2 次三角形 + + + TOP_REMOVE_ELEMENTS + 要素を削除します。 + + + TOP_REMOVE_NODES + ノードを削除します。 + + + TOP_REMOVE_ORPHAN_NODES + 孤児ノードを削除します。 + + + TOP_RENAME + 名前の変更 + + + TOP_RENUM_ELEMENTS + 要素の番号を付け替える + + + TOP_RENUM_NODES + ノード番号の再割り当てください。 + + + TOP_RESET + リセット + + + TOP_SAVE_DISTRIBUTION + エクスポートの分布 + + + TOP_SHOW_DISTRIBUTION + 分布を表示します。 + + + TOP_REVOLUTION + 革命 + + + TOP_ROT + 回転 + + + TOP_SCALAR_BAR + スカラー バー + + + TOP_SCALAR_BAR_PROP + スカラー プロパティ バー + + + TOP_SELECTION + 選択 + + + TOP_SEL_FILTER_LIB + 選択フィルター ライブラリ + + + TOP_SEW + 縫製 + + + TOP_SHADE + 網かけの設定 + + + TOP_SHOW + ショー + + + TOP_SHRINK + 縮小 + + + TOP_SKEW + 傾斜 + + + TOP_SMOOTH + 平滑化 + + + TOP_STD_INFO + 標準的なメッシュ情報 + + + TOP_SYM + 対称性 + + + TOP_TAPER + テーパ + + + TOP_TETRA + 四面体 + + + TOP_TRANS + 翻訳 + + + TOP_SCALE + スケール変換 + + + TOP_DUPLICATE_NODES + 重複したノード + + + TOP_TRANSP + 透明性 + + + TOP_TRIANGLE + 三角形 + + + TOP_UNASSIGN + 割り当てを解除します。 + + + TOP_UNION + 三角形の和集合 + + + TOP_UNION2 + 2 つの三角形の和集合 + + + TOP_IMPORT_UNV + UNV ファイルのインポート + + + TOP_UNV + UNV ファイルをエクスポートします。 + + + TOP_UN_GROUP + 連合のグループ + + + TOP_UNDERLYING_ELEMS + 優れた寸法の既存のグループからのエンティティのグループを作成します。 + + + TOP_UPDATE + 更新プログラム + + + TOP_VOLUMES + ボリューム + + + TOP_VOLUME_3D + ボリューム + + + TOP_WARP + ワープ角度 + + + TOP_WHAT_IS + メッシュ要素の情報 + + + TOP_WIRE + ワイヤ フレーム + + + UNKNOWN_CONTROL + 不明 + + + VOLUME_3D_ELEMENTS + ボリューム + + + WARP_ELEMENTS + ワープ + + + MEN_FILE_INFO + 医学ファイル情報 + + + SMESH_WRN_NO_APPROPRIATE_SELECTION + 適切なオブジェクトを選択せず + + + MEN_CLEAR_MESH + メッシュ データをクリアします。 + + + TOP_CLEAR_MESH + メッシュ データをクリアします。 + + + STB_CLEAR_MESH + メッシュ データをクリアします。 + + + SMESH_IMPORT_MESH + ファイルからメッシュ データのインポート + + + SMESH_ERR_NOT_SUPPORTED_FORMAT + サポートされていないファイル形式です + + + SMESH_ERR_UNKNOWN_IMPORT_ERROR + 不明なエラー + + + SMESH_IMPORT_ERRORS + インポート操作が完了しました。 + + + SMESH_DRS_SOME_EMPTY + 1 つまたは複数のメッシュ ファイルが空で、データが公開されていません。 + + + NO_MESH_SELECTED + 選択されていないメッシュ + + + SMESH_PREF_def_precision + 既定の精度 + + + SMESH_PREF_length_precision + 長の有効桁数 + + + SMESH_PREF_angle_precision + 角度精度 + + + SMESH_PREF_len_tol_precision + 長さ公差の精度 + + + SMESH_PREF_parametric_precision + パラメトリック精度 + + + SMESH_PREF_area_precision + 領域の精度 + + + FULL_RECOMPUTE_QUESTION + メッシュは、成功の計算ができない場合があります、最後の合計マージング以来編集されています。完全に、変更を破棄するには、メッシュを再計算しますか? + + + SMESH_PREF_vol_precision + ボリュームの精度 + + + SMESH_PRECISION_HINT + 入力値の精度は、メッシュのモジュール設定に '%1' パラメーターを使用して調整できます。 + + + REMOVE_ORPHAN_NODES_QUESTION + 孤児のすべてのノードを削除するよろしいですか。 + + + NB_NODES_REMOVED + %1 ノードを削除します。 + + + SMESH_SAVE_DISTRIBUTION + エクスポートの分布 + + + SMESH_PLUGINS_OTHER + SMESH プラグイン + + + MESH_LOADING_MSG + %0 中では、メッシュの読み込みお待ちください. + + + MESH_LOADING_MSG_FINISHED + メッシュ%0 の実行の読み込み + + + BALL_DIAMETER + 直径 + + + BALL_ELEMENT + ボール + + + DEP_OBJECT + 選択したオブジェクトは、別の 1 つを作成する使用されています。削除できません。 + + + + SMESHGUI_Dialog + + DLG_MESH + メッシュ + + + DLG_HYPO + 仮説 + + + DLG_ALGO + アルゴリズム + + + + SMESHGUI + + NOT_A_VTK_VIEWER + このコマンドは、してください。 VTK ビューアーでのみ利用可能です、VTK ビューアーを作成、もう一度やり直してください。 + + + PREF_AUTO_GROUPS + 自動的に MED の輸出のためのグループを作成します。 + + + PREF_GROUP_SEGMENT_LENGTH + 自動パラメーター + + + PREF_SEGMENT_LENGTH + 境界ボックスの対角線/最大サイズ比 + + + PREF_NB_SEGMENTS + デフォルトのセグメントの数 + + + SMESH_PREF_MESH_LOADING + メッシュの読み込み + + + PREF_FORGET_MESH_AT_HYP_MODIF + 研究仮説修正ファイルからの読み込みもメッシュ + + + PREF_AUTO_UPDATE + 自動更新 + + + PREF_UPDATE_LIMIT + サイズの制限値 (要素) + + + PREF_UPDATE_LIMIT_NOLIMIT + 制限なし + + + PREF_BACKFACE + 裏面の色 + + + PREF_VOLUME + ボリューム ・ カラー + + + PREF_REVERSEDVOLUME + 逆ボリューム ・ カラー + + + PREF_WIREFRAME + ワイヤ フレームの色 + + + PREF_SELECTION + 選択色 + + + PREF_PRE_SELECTION + 一次審査の色 + + + PREF_COLOR + 色 + + + PREF_ORIENTATION_COLOR + 色 + + + PREF_ORIENTATION_3D_VECTORS + 3D ベクトル + + + PREF_ORIENTATION_SCALE + スケール + + + PREF_DISPLAY_ENTITY + エンティティを表示します。 + + + QUADRATIC_REPRESENT_MODE + 2 D の 2 次要素の表現 + + + MAX_ARC_ANGLE + 最大角度 + + + PREF_DISPLAY_MODE + 表示モード + + + PREF_ELEMENTS + 要素 + + + PREF_ELEMENT_COLOR + 要素の色 + + + PREF_FILL + 表面の色 + + + PREF_NOTIFY_MODE + 計算結果の通知を表示します。 + + + PREF_NOTIFY_NEVER + 決して + + + PREF_NOTIFY_ERROR + エラーのみ + + + PREF_NOTIFY_ALWAYS + 常に + + + PREF_ELEM_INFO + メッシュ要素の情報 + + + PREF_ELEM_INFO_SIMPLE + 単純です + + + PREF_ELEM_INFO_TREE + ツリー + + + PREF_GPP_NODES_LIMIT + 自動ノード計算限界 + + + SMESH_PREF_GROUP_PRECISION + 入力フィールドの精度 + + + SMESH_PREF_GROUP_PREVIEW + プレビュー + + + PREF_GROUP_ELEMENTS + 要素 + + + PREF_GROUP_EXPORT + メッシュのエクスポート + + + PREF_GROUP_FACES_ORIENTATION + 顔の向き + + + PREF_GROUP_COMPUTE + 計算をメッシュします。 + + + PREF_GROUP_NODES + ノード + + + PREF_GROUP_GROUPS + グループ + + + PREF_GRP_NAMES + 名前色 + + + PREF_GRP_DEF_COLOR + 既定の色 + + + PREF_GROUP_PRECISION + 精度 + + + PREF_GROUP_PRESELECTION + 予選 + + + PREF_GROUP_QUALITY + 品質コントロール + + + PREF_GROUP_SELECTION + 選択 + + + PREF_GROUP_INFO + メッシュ情報 + + + PREF_HIGHLIGHT_COLOR + 強調表示色 + + + PREF_LABELS_COLOR + ラベル色 + + + PREF_MARKER_SCALE + スケール マーカーの + + + PREF_NODES + ノード + + + PREF_OBJECTS + オブジェクト + + + PREF_OBJECT_COLOR + オブジェクトの色 + + + PREF_OUTLINE + 輪郭の色 + + + PREF_PRECISION_USE + 精度を使用します。 + + + PREF_PRECISION_VALUE + ポイント後の桁数 + + + PREF_EQUAL_NODES_TOL + 二重ノード公差 + + + PREF_RENUMBER + 自動番号を付け替える + + + PREF_SHRINK_COEFF + 縮小係数。 + + + PREF_PYTHON_DUMP + Python をダンプします。 + + + PREF_HISTORICAL_PYTHON_DUMP + 歴史的な python のダンプ + + + PREF_TAB_GENERAL + 一般的な + + + PREF_TAB_MESH + メッシュ + + + PREF_TAB_SELECTION + 選択 + + + PREF_TITLE_COLOR + タイトルの色 + + + PREF_TYPE_OF_MARKER + マーカーの種類 + + + PREF_COLOR_0D + 0 D 要素 + + + PREF_SIZE_0D + 0 D 要素のサイズ + + + PREF_BALL_COLOR + ボール + + + PREF_BALL_SIZE + ボールの要素のサイズ + + + PREF_WIDTH + 線の幅 + + + PREF_OUTLINE_WIDTH + アウトラインの幅 + + + PREF_PREVIEW_CHUNK_SIZE + サブ図形の座標プレビュー チャンク ・ サイズ + + + + SMESHGUI_GroupDlg + + ALLOW_ELEM_LIST_MODIF + マニュアル版を有効にします。 + + + + SMESHGUI_Add0DElemsOnAllNodesDlg + + CAPTION + 0 D 要素の要素ノードを + + + OBJ_BTN + メッシュ、サブメッシュ、グループ + + + NB_NEW_0D + %1 0 D 要素の作成 + + + + SMESHGUI_Add0DElemsOnAllNodesOp + + NB_NEW_0D + %1 0 D 要素の作成 + + + + SMESHGUI_AddQuadraticElementDlg + + SMESH_ADD_QUADRATIC_EDGE + 2 次のエッジを追加します。 + + + SMESH_ADD_QUADRATIC_HEXAHEDRON + 二次六面体を追加します。 + + + SMESH_ADD_TRIQUADRATIC_HEXAHEDRON + TriQuadratic 直方体を追加します。 + + + SMESH_ADD_QUADRATIC_PENTAHEDRON + 二次 5面体を追加します。 + + + SMESH_ADD_QUADRATIC_PYRAMID + 二次ピラミッドを追加します。 + + + SMESH_ADD_QUADRATIC_QUADRANGLE + 2 次の四角形を追加します。 + + + SMESH_ADD_BIQUADRATIC_QUADRANGLE + バイカッド四角形を追加します。 + + + SMESH_ADD_QUADRATIC_TETRAHEDRON + 二次四面体を追加します。 + + + SMESH_ADD_QUADRATIC_TRIANGLE + 2 次三角形を追加します。 + + + SMESH_CORNER_NODES + 角の節: + + + SMESH_MIDFACE_NODES + 今回のノード: + + + SMESH_CENTER_NODE + センター ノード: + + + SMESH_FIRST + 最初 + + + SMESH_LAST + 最後 + + + SMESH_MIDDLE + 中間 + + + + SMESHGUI_BuildCompoundDlg + + COMPOUND + 化合物 + + + COMPOUND_MESH + Compound_Mesh + + + CREATE_COMMON_GROUPS + 初期メッシュの一般的なグループを作成します。 + + + MERGE_NODES_AND_ELEMENTS + 一致する節点と要素をマージします。 + + + MESHES + メッシュ + + + PROCESSING_IDENTICAL_GROUPS + 同じグループの処理 + + + RENAME + 名前の変更 + + + RESULT_NAME + 結果名 + + + UNITE + 団結 + + + + SMESHGUI_ChangeOrientationDlg + + CAPTION + 向きの変更 + + + + SMESHGUI_ComputeDlg + + CAPTION + 計算メッシュに失敗しました + + + CONSTRUCTOR + メッシュを計算します。 + + + EVAL_DLG + メッシュを評価します。 + + + ERRORS + エラー + + + MEMORY_LACK + メモリ割り当ての問題 + + + COMPUTE_WARNING + メッシュは OK のようですが、エラーが報告されます。 + + + PUBLISH_SHAPE + サブを公開します。 + + + SHOW_SHAPE + サブを表示します。 + + + SHOW_BAD_MESH + 悪いメッシュを表示します。 + + + + SMESHGUI_PrecomputeDlg + + CAPTION + プレビューと計算メッシュ + + + PREVIEW + プレビュー + + + PREVIEW_1 + 1 D メッシュ + + + PREVIEW_2 + 2 D メッシュ + + + COMPUTE + 計算 + + + + SMESHGUI_PrecomputeOp + + CLEAR_SUBMESH_QUESTION + 選択したジオメトリに一時 submeshes プレビュー操作中に作成されました。これらのすべての submeshes を削除しますか。 + + + SMESH_WRN_NOTHING_PREVIEW + メッシュ プレビューはありません。 + + + SMESH_REJECT_MESH_ORDER + 優先度のサブメッシュ プレビュー操作中に変更。元のサブメッシュの優先順位を復元しますか。 + + + + SMESHGUI_ConvToQuadDlg + + CAPTION + 2 次に/から変換します。 + + + MEDIUMNDS + ジオメトリ上の中のノード + + + MESH + メッシュまたはサブメッシュ + + + RADIOBTN_1 + 2 次に変換します。 + + + RADIOBTN_2 + 二次から変換します。 + + + NON_CONFORM_WARNING + 警告: メッシュは非共形になることができます。 + + + + SMESHGUI_ConvToQuadOp + + MESH_IS_NOT_SELECTED + メッシュが選択されていないそれを指定して、再試行してください + + + REF_IS_NULL + 有効なメッシュ オブジェクトが選択されていません。 + + + + SMESHGUI_CreatePatternDlg + + CAPTION + パターンの作成 + + + DEFAULT_2D + Pattern_2d + + + DEFAULT_3D + Pattern_3d + + + ERROR_OF_CREATION + 内部エラーが発生中にパターン作成に入力した情報の有効性を確認してください + + + ERROR_OF_SAVING + 内部エラーは、パターンの保存中に発生します。\Free ディスク容量と、このファイルへの書き込み権限を確認してください。 + + + ERR_LOADF_CANT_PROJECT + ノードに顔の射影を実行することは不可能 + + + ERR_LOADF_CLOSED_FACE + 縫い目の刃を持つ顔からパターンを作成することはできません。 + + + ERR_LOADF_NARROW_FACE + 狭い顔からパターンを作成することはできません。 + + + ERR_LOADV_BAD_SHAPE + パターンは、閉殻から作成された、または固体 6 面のみをすることができます。 + + + ERR_LOADV_COMPUTE_PARAMS + ポイントのパラメーターを計算することはできません。 + + + ERR_LOAD_EMPTY_SUBMESH + パターンを作成する要素はありません。 + + + MESH_OR_SUBMESH + メッシュまたはサブメッシュ + + + PATTERN + パターン + + + PATTERN_FILT + パターン files(*.smp) + + + PATTERN_NAME + パターン名 + + + PATTERN_TYPE + パターンの種類 + + + PROJECT + プロジェクト ノードの顔 + + + SAVE + 保存. + + + SAVE_PATTERN + パターンを保存します。 + + + + SMESHGUI_CreatePolyhedralVolumeDlg + + FACES_BY_NODES + 顔のノードによって + + + SMESH_POLYEDRE_CREATE_ERROR + 多面体の作成エラーです。 + + + SMESH_POLYEDRE_PREVIEW + 多面体のプレビュー + + + + SMESHGUI_CuttingOfQuadsDlg + + CAPTION + 四角形の切断 + + + + SMESHGUI_DeleteGroupDlg + + CAPTION + グループの内容を削除します。 + + + NO_SELECTED_GROUPS + くださいグループを選択し、もう一度やり直してください選択したグループはありません。 + + + SELECTED_GROUPS + 選択したグループ + + + + SMESHGUI_MergeDlg + + COINCIDENT_ELEMENTS + 一致する要素 + + + COINCIDENT_NODES + 一致するノード + + + DETECT + 検出 + + + EDIT_SELECTED_GROUP + 選択したグループを編集します。 + + + SELECT_ALL + すべてを選択します。 + + + EXCLUDE_GROUPS + グループを除外します。 + + + + SMESHGUI_ExtrusionAlongPathDlg + + BAD_SHAPE_TYPE + 図形のパスを選択して、エッジではないです。 + + + CANT_GET_TANGENT + 接線パス ノードの 1 つを得ることができません。 + + + EXTRUSION_0D + 0 D 要素の押出し + + + EXTRUSION_1D + 1 次元要素の押出し + + + EXTRUSION_2D + 2 D 要素の押出し + + + EXTRUSION_ALONG_PATH + 押し出しパスに沿って + + + EXTR_BAD_STARTING_NODE + 間違ったパス開始ノード + + + LINEAR_ANGLES + 角度の一次の変化 + + + NO_ELEMENTS_SELECTED + 押し出しメッシュ要素が選択されていません + + + SELECTED_PATH_IS_NOT_EDGE + パス メッシュ エッジの種類する必要があります。 + + + SMESH_ANGLES + 回転角度 + + + SMESH_BASE_POINT + 基点 + + + SMESH_PATH + パス + + + SMESH_PATH_MESH + メッシュまたはサブメッシュ + + + SMESH_PATH_SHAPE + 形状 (エッジ) + + + SMESH_PATH_START + 開始ノード + + + SMESH_USE_ANGLES + 角度を使用します。 + + + SMESH_USE_BASE_POINT + 基点を使用 + + + WRONG_ANGLES_NUMBER + 角の数は、パスのノード数に対応する必要があります。 + + + + SMESHGUI_ExtrusionDlg + + EXTRUSION_0D + ノードの押出し + + + EXTRUSION_1D + 1 次元要素の押出し + + + EXTRUSION_2D + 2 D 要素の押出し + + + EXTRUSION_ALONG_LINE + 押出ラインに沿って + + + + SMESHGUI_FilterDlg + + BAD_SHAPE_NAME + 「幾何学的オブジェクト現在研究に有効なオブジェクトを選択して再試行ください%1」はありません + + + CURRENT_DIALOG + 現在のグループ + + + EDGES_TLT + フィルターの端 + + + FACES_TLT + 顔用のフィルター + + + MESH + メッシュ + + + NODES_TLT + ノード用のフィルター + + + ELEM0D_TLT + 0 D 要素のフィルター + + + BALL_TLT + フィルターのボール + + + SELECTION + 最初の選択 + + + SET_IN_VIEWER + ビューアーでフィルターを挿入します。 + + + SHAPE_IS_NOT_A_CYLINDER + 「%1」してください円筒面を選択してやり直してください、円筒の顔ではないです。 + + + SHAPE_IS_NOT_A_FACE + 「%1」してください顔を選択してやり直してください、顔ではないです。 + + + SHAPE_IS_NOT_A_PLANE + 「%1」してください、平面を選択してもう一度やり直してください、飛行機ではありません。 + + + FACE_ID_NOT_SELECTED + メッシュの面が選択されていないそれを指定して、再試行してください + + + NOT_FACE_ID + 「%1」メッシュの面の ID ではありません。面を選択して再試行してください。 + + + SOURCE + ソース + + + TLT + 選択フィルター + + + VOLUMES_TLT + ボリューム フィルター + + + + SMESHGUI_FilterLibraryDlg + + ADD + 追加 + + + ADD_TO_TLT + 選択フィルターをライブラリに追加します。 + + + ALL_FILES_FILTER + すべてのファイル (*. *) + + + ASSIGN_NEW_NAME + ライブラリに既にフィルターと新しい名前「%2」が追加されたフィルターに割り当てられている名前「%1」が含まれています + + + COPY_FROM_TLT + ライブラリからコピー選択フィルター + + + DELETE + 削除 + + + EDGE + エッジ + + + EDIT_LIB_TLT + 選択フィルター ライブラリ + + + ELEMENT + 要素 + + + EMPTY_FILTER_NAME + フィルターの名前が空に空白以外の名前を入力してください + + + ERROR_FILTER_NAME + フィルターの名前は一意ではない他の名前を入力してください + + + ERROR_LOAD + ライブラリしてくださいチェック ライブラリ ファイル名と属性をロードすることはできません。 + + + ERROR_OF_ADDING + Adiing 新しいフィルター ライブラリの中に内部エラーを発生します。入力した情報の有効性を確認してください。 + + + ERROR_OF_COPYING + ライブラリからのフィルターのコピー中に内部エラーが発生します。入力した情報の有効性を確認してください。 + + + ERROR_OF_DELETING + ライブラリからフィルターを削除中に内部エラーが発生します。入力した情報の有効性を確認してください。 + + + ERROR_OF_EDITING + フィルター ライブラリの編集中に内部エラーが発生します。入力した情報の有効性を確認してください。 + + + ERROR_OF_SAVING + 内部エラー フィルター ライブラリしてください。 チェック入力データの保存が発生、もう一度やり直してください。 + + + FACE + 顔 + + + FILTER + フィルター + + + FILTER_NAME + フィルター名 + + + FILTER_NAMES + フィルターの名前 + + + LIBRARY_FILE + ライブラリのファイル名 + + + LIBRARY_IS_NOT_LOADED + ライブラリが読み込まれていません。ライブラリをロードしてからやり直してください。 + + + LIB_NAME + FilterLib.xml + + + NODE + ノード + + + NO_PERMISSION + このファイルに書き込み権限がありません。 + + + OPEN_LIBRARY + ライブラリを開く + + + SELECTION + 選択 + + + VOLUME + ボリューム + + + XML_FILT + XML files(*.xml) + + + + SMESHGUI_FilterTable + + ADD + 追加 + + + ADDITIONAL_PARAMETERS + 追加のパラメーター + + + ADD_TO + 追加する. + + + AND + と + + + AREA + エリア + + + ASPECT_RATIO + アスペクト比 + + + ASPECT_RATIO_3D + アスペクト比 3 D + + + BAD_ORIENTED_VOLUME + 不正な指向ボリューム + + + BARE_BORDER_VOLUME + ボリュームが裸の枠線 + + + BARE_BORDER_FACE + 顔が裸の枠線 + + + OVER_CONSTRAINED_VOLUME + 過剰のボリューム + + + OVER_CONSTRAINED_FACE + 過剰拘束面 + + + BELONG_TO_CYLINDER + シリンダーに属しています。 + + + BELONG_TO_GENSURFACE + サーフェスに属する + + + BELONG_TO_GEOM + ジオメトリに属しています。 + + + BELONG_TO_PLANE + 平面に属する + + + BINARY + バイナリ + + + CLEAR + 明確な + + + COMPARE + 比較 + + + COPLANAR_FACES + 同一平面上の面 + + + COPY_FROM + コピー. + + + CRITERION + 基準 + + + BALLS + ボール + + + ELEM0D + 0 D 要素 + + + EDGES + エッジ + + + ENTITY_TYPE + エンティティの種類 + + + EQUAL_TO + 等しい + + + ERROR + しきい値が正しく指定されていない正しい値を入力して、再試行してください + + + FACES + 直面しています。 + + + FILTER + フィルター + + + FREE_BORDERS + 無料の罫線 + + + FREE_EDGES + 自由辺 + + + FREE_NODES + 無料ノード + + + FREE_FACES + 無料顔 + + + ID + ID + + + INSERT + 挿入 + + + LENGTH + 長さ + + + LENGTH2D + 長さ 2 D + + + LESS_THAN + 小さい + + + LYING_ON_GEOM + Geom に横たわっています。 + + + MAX_ELEMENT_LENGTH_2D + 要素の直径 2 D + + + MAX_ELEMENT_LENGTH_3D + 要素の直径 3 D + + + MINIMUM_ANGLE + 最小角度 + + + MORE_THAN + 以上 + + + MULTIEDGES_ERROR + 国境 multi-connections でのしきい値値は同じにできません 1 正しい値を入力して、再試行してください + + + GROUPCOLOR_ERROR + グループの色を undefied できないことができる適切な値を入力して、再試行してください + + + MULTI_BORDERS + 国境 multi-connections で + + + NODES + ノード + + + NOT + ない + + + OR + または + + + RANGE_OF_IDS + Id の範囲 + + + REMOVE + 削除 + + + SKEW + 傾斜 + + + TAPER + テーパ + + + THRESHOLD_VALUE + しきい値 + + + UNARY + 単項 + + + VOLUMES + ボリューム + + + VOLUME_3D + ボリューム + + + WARPING + ワープ + + + LINEAR + 線形 + + + GROUP_COLOR + グループの色 + + + ELEMENTS + 要素 + + + GEOM_TYPE + ジオメトリ タイプ + + + GEOM_TYPE_0 + ポイント + + + GEOM_TYPE_1 + エッジ + + + GEOM_TYPE_2 + 三角形 + + + GEOM_TYPE_3 + 四角形 + + + GEOM_TYPE_4 + 多角形 + + + GEOM_TYPE_5 + 四面体 + + + GEOM_TYPE_6 + ピラミッド + + + GEOM_TYPE_7 + 直方体 + + + GEOM_TYPE_8 + 表層五面体 + + + GEOM_TYPE_9 + 角柱 + + + GEOM_TYPE_10 + 多面体 + + + GEOM_TYPE_11 + ボール + + + + SMESHGUI_GroupOpDlg + + ARGUMENTS + 引数 + + + DIFF_MESHES + グループしてください有効な引数を指定してください、異なるメッシュに対応を操作の引数が正しく指定されていません。 + + + DIFF_TYPES + グループが含まれているしてください有効な引数を指定してくださいさまざまな種類の要素を操作の引数が正しく指定されていません。 + + + EMPTY_NAME + 作成するグループの名前は有効ではない空白以外の名前を指定して、再試行してください + + + INCORRECT_ARGUMENTS + 操作の引数が指定されていないそれらを指定して、再試行してください + + + NAME + 名前 + + + OBJECT_1 + オブジェクト 1 + + + OBJECT_2 + オブジェクト 2 + + + RESULT_NAME + 結果名 + + + TOOL_OBJECT + ツール オブジェクト + + + UNION_OF_TWO_GROUPS + 2 つのグループの連合 + + + + SMESHGUI_GroupDlg + + SELECT_ALL + すべてを選択します。 + + + + SMESHGUI_UnionGroupsDlg + + UNION_OF_GROUPS + グループの連合 + + + + SMESHGUI_DimGroupDlg + + CREATE_GROUP_OF_UNDERLYING_ELEMS + 基になるエンティティのグループを作成します。 + + + ELEMENTS_TYPE + 要素型 + + + NODE + ノード + + + EDGE + エッジ + + + FACE + 顔 + + + VOLUME + ボリューム + + + + SMESHGUI_IntersectGroupsDlg + + INTERSECTION_OF_GROUPS + グループの交差部分 + + + + SMESHGUI_CutGroupsDlg + + CUT_OF_GROUPS + グループのカット + + + MAIN_OBJECT + メイン オブジェクト + + + TOOL_OBJECT + ツール オブジェクト + + + + SMESHGUI_MakeNodeAtPointDlg + + AUTO_SEARCH + 目的地に最も近いを見つける + + + CAPTION + ノードの移動 + + + DESTINATION + 宛先 + + + MOVE_NODE + ノードの移動 + + + METHOD + メソッド + + + NODE_2MOVE + ノードを移動するには + + + NODE_2MOVE_ID + ID + + + + SMESHGUI_MakeNodeAtPointOp + + INVALID_ID + ノード ID が無効です。 + + + INVALID_MESH + 選択を変更しないようにメッシュします。 + + + + SMESHGUI_FindElemByPointDlg + + MESH_GROUP + メッシュまたはグループ + + + CAPTION + 要素のポイントを検索します。 + + + CREATE_NEW_METHOD + ノードを作成します。 + + + MESH_PASS_THROUGH_POINT + 時点で、ノードを作る + + + METHOD + メソッド + + + MOVE_EXISTING_METHOD + ノードを移動します。 + + + NODE_2MOVE + ノードを移動するには + + + NODE_2MOVE_ID + ID + + + + SMESHGUI_MeshDlg + + CREATE_MESH + メッシュを作成します。 + + + CREATE_SUBMESH + サブメッシュを作成します。 + + + DIM_0D + 0 D + + + DIM_1D + 1 D + + + DIM_2D + 2 D + + + DIM_3D + 3 D + + + EDIT_MESH_SUBMESH + メッシュ/サブ mesh を編集します。 + + + GEOMETRY + ジオメトリ + + + HYPOTHESES_SETS + 仮説のセットを割り当てる + + + MESH + メッシュ + + + NAME + 名前 + + + + SMESHGUI_MeshOp + + ALGORITHM_WITHOUT_HYPOTHESIS + アルゴリズム%1 ディメンションに定義されてですが、仮説が定義されていません + + + EDIT_SUBMESH_QUESTION + 選択したジオメトリのサブメッシュは既に存在します。このサブメッシュを編集しますか。 + + + SUBMESH_NOT_ALLOWED + グローバルのアルゴリズム「%1」は無視サブメッシュを作成するセンスがないです。 + + + GEOMETRY_OBJECT_IS_NOT_DEFINED + ジオメトリ オブジェクトが定義されていないそれを指定して、再試行してください + + + GEOMETRY_OBJECT_IS_NULL + ジオメトリ オブジェクトが null です。 + + + HYPOTHESES_AND_ALGORITHMS_ARE_NOT_DEFINED + 仮説とアルゴリズムが定義されていません。 + + + HYPOTHESIS_WITHOUT_ALGORITHM + 仮説%1 ディメンションに定義されていますが、アルゴリズムが定義されていません + + + IMPORTED_MESH + メッシュのジオメトリには組み込まれていません + + + INVALID_SUBSHAPE + ジオメトリ オブジェクトは、メッシュ図形のサブ図形ではありません。 + + + MESH_IS_NOT_DEFINED + メッシュが定義されていないそれを指定して、再試行してください + + + MESH_IS_NULL + メッシュが null です。 + + + NAME_OF_MESH_IS_EMPTY + メッシュの名前が空です有効な名前を入力して、再試行してください + + + NAME_OF_SUBMESH_IS_EMPTY + サブメッシュの名前が空です有効な名前を入力して、再試行してください + + + THERE_IS_NO_OBJECT_FOR_EDITING + 編集オブジェクトはありません。メッシュを選択または sub-mesh、再試行してください。 + + + + SMESHGUI_MeshPatternDlg + + 3D_BLOCK + 3 D ブロック + + + CAPTION + パターンのマッピング + + + CREATE_POLYEDRS_NEAR_BOUNDARY + 多面体の境界付近を作成します。 + + + CREATE_POLYGONS_NEAR_BOUNDARY + ポリゴン境界を作成します。 + + + ERROR_OF_LOADING + ファイルからパターンを読み込んでいます。おそらくファイルが破損しているまたはその他の種類のパターンが含まれています + + + ERROR_OF_OPENING + ファイルを開くことはできません。ファイルが存在するかどうかと、このファイルにアクセス許可を確認してください。 + + + ERROR_OF_READING + それは可能ではないしてくださいのパターンをロードするファイルの内容を確認してください + + + ERR_READ_3D_COORD + 3 D の点が [0, 1] の範囲外のパターン座標をロードすることはできません。 + + + ERR_READ_BAD_INDEX + パターン検出ポイントの無効なインデックスをロードすることはできません。 + + + ERR_READ_BAD_KEY_POINT + パターン キー ポイントは、境界ではなくロードすることはできません。 + + + ERR_READ_ELEM_POINTS + パターン要素内のポイント数が無効ですをロードすることはできません。 + + + ERR_READ_NB_POINTS + それは読むことは不可能ではないロード パターンに可能ではないファイルからのポイント数 + + + ERR_READ_NO_ELEMS + それはロード パターンが可能ではないそれに要素がないです。 + + + ERR_READ_NO_KEYPOINT + それはロード パターンが可能ですない 2 D 1 つの要点 + + + ERR_READ_POINT_COORDS + ファイルからポイントの座標を読むことは不可能ではないパターンを読み込むことができるではないです。 + + + ERR_READ_TOO_FEW_POINTS + パターンをロードすることが可能です。ファイル パターンをロードするためにあまりにもいくつかのポイントがあります。 + + + FACE + 顔 + + + LOAD_PATTERN + ロード パターン + + + MESH_FACES + メッシュの面 + + + MESH_VOLUMES + ボリュームをメッシュします。 + + + NEW + 新機能。。。 + + + NODE_1 + ノード 1 + + + NODE_2 + ノード 2 + + + PATTERN + パターン + + + PATTERN_FILT + パターン files(*.smp) + + + PATTERN_TYPE + パターンの種類 + + + PREVIEW + プレビュー + + + REFINE + 選択したメッシュ要素を絞り込む + + + REVERSE + キー点の逆の順序 + + + VERTEX + 頂点 + + + VERTEX1 + 頂点 1 + + + VERTEX2 + 頂点 2 + + + + SMESHGUI_MeshTab + + ADD_HYPOTHESIS + 追加します。仮説 + + + ALGORITHM + アルゴリズム + + + HYPOTHESIS + 仮説 + + + NONE + <None> + + + + SMESHGUI_MultiEditDlg + + ADD + 追加 + + + FILTER + フィルター + + + REMOVE + 削除 + + + SELECT_FROM + 選択します + + + SORT_LIST + 並べ替えリスト + + + SPLIT_JOIN_CRITERION + 基準 + + + TO_ALL + すべてに適用されます。 + + + USE_DIAGONAL_1_3 + 対角 1-3 を使用します。 + + + USE_DIAGONAL_2_4 + 使用して、斜めの 2-4 + + + USE_NUMERIC_FUNC + 数値関数を使用します。 + + + + SMESHGUI_CuttingIntoTetraDlg + + CAPTION + ボリュームに四面体分割 + + + SPLIT_METHOD + 直方体を分割します。 + + + SPLIT_HEX_TO_5_TETRA + 5 四面体に + + + SPLIT_HEX_TO_6_TETRA + 6 四面体に + + + SPLIT_HEX_TO_24_TETRA + 24 四面体に + + + + SMESHGUI_PrecisionDlg + + CAPTION + メッシュ品質制御の精度 + + + NOT_USE + 使用しないでください。 + + + PRECISION + ポイント後の桁数 + + + + SMESHGUI_RevolutionDlg + + ANGLE_BY_STEP + ステップ角度 + + + PREVIEW + プレビュー + + + REVOLUTION_1D + 1 次元要素の革命 + + + REVOLUTION_2D + 2 D 要素の革命 + + + REVOLUTION_AROUND_AXIS + 軸の周りを公転 + + + TOTAL_ANGLE + 合計角度 + + + MEN_POINT_SELECT + 選択したポイントからの起源 + + + MEN_FACE_SELECT + 選択した面に通常 + + + + SMESHGUI_SewingDlg + + BORDER + 枠線 + + + BORDER_1 + ボーダー 1 + + + BORDER_2 + 枠線 2 + + + CREATE_POLYEDRS_NEAR_BOUNDARY + Polyedres によって影響を受けるボリュームを置き換える + + + CREATE_POLYGONS_INSTEAD_SPLITTING + 分割するのではなくポリゴンを作成します。 + + + ERROR_1 + 無料 Border1 によって選択されたノードが見つかりません + + + ERROR_2 + 無料 Border2 によって選択されたノードが見つかりません + + + ERROR_3 + 無料の Border1 と Border2 によって選択されたノードが見つかりません + + + ERROR_4 + 側の最初のノードから最後の側のノードへのパスが発見されてないです。 + + + ERROR_5 + におけるスプリット ボリューム側にすることはできません ! + + + ERROR_6 + 両側に選択された要素の数が異なる + + + ERROR_7 + 要素セットがトポロジ的に異なるか、与えられたノードが便利です。 + + + ERROR_8 + ノード 1 の側にもリンクされていない、または要素に敷設ではないの境界設定 + + + ERROR_9 + ノード 2 の面にもリンクされていないまたは要素に敷設ではないの境界設定 + + + FIRST_NODE_ID + 最初のノード ID + + + LAST_NODE_ID + 最後のノード ID + + + MERGE_EQUAL_ELEMENTS + 等値要素をマージします。 + + + NODE1_TO_MERGE + ノード 1 をマージ + + + NODE2_TO_MERGE + ノード 2 に結合する + + + SECOND_NODE_ID + 2 番目のノード ID + + + SEW_BORDER_TO_SIDE + 国境側を縫う + + + SEW_CONFORM_FREE_BORDERS + 縫う無料国境に適合 + + + SEW_FREE_BORDERS + 無料国境を縫う + + + SEW_SIDE_ELEMENTS + 側の要素を縫う + + + SIDE + 側 + + + SIDE_1 + サイド 1 + + + SIDE_2 + サイド 2 + + + + SMESHGUI_ShapeByMeshDlg + + CAPTION + ジオメトリをメッシュ要素を検索します。 + + + + SMESHGUI_SingleEditDlg + + EDGE_BETWEEN + 隣接する三角形の間のエッジ + + + + SMESHGUI_SmoothingDlg + + CENTROIDAL + 中心 + + + FIXED_NODES_IDS + 固定ノード id + + + IS_PARAMETRIC + パラメーター空間で + + + ITERATION_LIMIT + 反復の制限 + + + LAPLACIAN + ラプラシアン + + + MAX_ASPECT_RATIO + 最大。アスペクト比 + + + METHOD + メソッド + + + + SMESHGUI_TrianglesInversionDlg + + CAPTION + 斜めの反転 + + + + SMESHGUI_UnionOfTrianglesDlg + + CAPTION + 三角形の和集合 + + + MAXIMUM_ANGLE + 最大ベンド角度 + + + + SMESHGUI_UnionOfTwoTrianglesDlg + + CAPTION + 2 つの三角形の和集合 + + + + SMESHGUI_FileInfoDlg + + CAPTION + ファイル情報 + + + FILE_NAME + ファイル名 + + + FILE_SIZE + ファイル サイズ (バイト) + + + MED_VERSION + 音楽配信マック & バージョン + + + + SMESHGUI_GroupOnShapeDlg + + SMESH_CREATE_GROUP_FROM_GEOM + ジオメトリ グループを作成します。 + + + + SMESHGUI_MeshOrderDlg + + SMESH_MESHORDER_TITLE + プロセスをメッシュのサブメッシュの順序 + + + + SMESHGUI_MeshOrderOp + + SMESH_NO_CONCURENT_MESH + 検出されたない同時 submeshes + + + + SMESHGUI_ClippingDlg + + CLIP_PLANES + クリップ面 + + + MESHES_SUBMESHES_GROUPS + メッシュ、サブメッシュおよびグループ + + + SELECT_ALL + すべてを選択します。 + + + ROTATION_AROUND_X_Y2Z + 回転 X (Z に Y): + + + ROTATION_AROUND_Y_X2Z + Y (X Z) を回転: + + + ROTATION_AROUND_Z_Y2X + Z (Y へ) の回転: + + + ROTATION_AROUND_X_Z2Y + 回転軸 (Y に Z) X: + + + ROTATION_AROUND_Y_Z2X + Y (x Z) を回転: + + + ROTATION_AROUND_Z_X2Y + 回転 Z (X Y): + + + SHOW_PREVIEW + プレビューを表示します。 + + + AUTO_APPLY + 自動適用します。 + + + ALONG_XY + ||X と Y + + + ALONG_YZ + ||Y Z + + + ALONG_ZX + ||Z X + + + PLANE_NUM + 平面 #%1 + + + NO_PLANES + ないプレーン + + + + SMESHGUI_DuplicateNodesDlg + + DUPLICATION_MODE + 複製モード + + + DUPLICATION_WITHOUT_ELEMS + 境界要素の重複なし + + + GROUP_NODES_TO_DUPLICATE + 重複したノードのグループ + + + GROUP_NODES_TO_REPLACE + ノードを新しいものに交換する要素のグループ + + + DUPLICATION_WITH_ELEMS + 境界要素の重複 + + + GROUP_ELEMS_TO_DUPLICATE + 重複した要素のグループ + + + GROUP_NODES_NOT_DUPLICATE + 重複ノードのグループ + + + GROUP_ELEMS_TO_REPLACE + ノードを新しいものに交換する要素のグループ + + + CONSTRUCT_NEW_GROUP_NODES + 新しく作成したノードにグループを作成します。 + + + CONSTRUCT_NEW_GROUP_ELEMENTS + 新しく作成された要素を持つグループを作成します。 + + + + SMESHGUI_Make2DFrom3DDlg + + CAPTION + 境界要素を作成します。 + + + Groups + メッシュまたはグループ + + + MODE + モード + + + 2D_FROM_3D + 2 D 3 D から + + + 1D_FROM_3D + 1 D 2 D グループから + + + 1D_FROM_2D + 1 D 2 D から + + + TARGET + ターゲット + + + THIS_MESH + このメッシュ + + + NEW_MESH + 新しいメッシュ + + + COPY_SRC + ソース メッシュをコピーします。 + + + MISSING_ONLY + 不足している要素のみをコピーします。 + + + CREATE_GROUP + グループを作成します。 + + + + SMESHGUI_Make2DFrom3DOp + + NB_ADDED + %1 境界要素追加されています。 + + + WRONG_GROUPS + 不適切な種類は、次のグループが処理されていない:%1 + + + SMESH_ERR_NO_INPUT_MESH + ソース メッシュが指定されていません。 + + + SMESH_TOO_MANY_MESHES + のみ 1 つのメッシュを一度に処理することができます。 + + + SMESH_NOT_ONLY_GROUPS + メッシュとグループを一度に処理することはできません。 + + + SMESH_ERR_NO_3D_ELEMENTS + ソース オブジェクトが 3 D の要素を含まない + + + SMESH_ERR_NO_2D_ELEMENTS + ソース オブジェクトが 2D 要素を含まない + + + SMESH_ERR_MESH_NAME_NOT_SPECIFIED + 新しいメッシュ名が指定されていません。 + + + SMESH_ERR_GRP_NAME_NOT_SPECIFIED + グループ名が指定されていません。 + + + + SMESHGUI_MeshInfo + + NAME_LAB + 名前: + + + OBJECT_LAB + オブジェクト: + + + NODES_LAB + ノード: + + + ELEMENTS_LAB + 要素: + + + TOTAL_LAB + 合計 + + + LINEAR_LAB + 線形 + + + QUADRATIC_LAB + 2 次 + + + 0D_LAB + 0 D: + + + BALL_LAB + ボールは: + + + 1D_LAB + 1 D (エッジ): + + + 2D_LAB + 2 D (面): + + + TRIANGLES_LAB + 三角形: + + + QUADRANGLES_LAB + 四角形: + + + POLYGONS_LAB + ポリゴン: + + + 3D_LAB + 3 D (ボリューム): + + + TETRAHEDRONS_LAB + 四面体: + + + HEXAHEDONRS_LAB + Hexahedrons: + + + PYRAMIDS_LAB + ピラミッド: + + + PRISMS_LAB + プリズム: + + + HEX_PRISMS_LAB + 六角形プリズム: + + + POLYHEDRONS_LAB + 多面体: + + + OBJECT_MESH + メッシュ + + + OBJECT_SUBMESH + サブメッシュ + + + OBJECT_GROUP + グループ + + + OBJECT_GROUP_NODES + ノードのグループ + + + OBJECT_GROUP_EDGES + エッジのグループ + + + OBJECT_GROUP_FACES + 面のグループ + + + OBJECT_GROUP_VOLUMES + ボリューム ・ グループ + + + OBJECT_GROUP_0DELEMS + 0 D 要素のグループ + + + OBJECT_GROUP_BALLS + ボールのグループ + + + BUT_LOAD_MESH + サーバーからメッシュをロードします。 + + + + SMESHGUI_MeshInfoDlg + + MESH_INFO + メッシュ情報 + + + BASE_INFO + 基本情報 + + + ELEM_INFO + 要素情報 + + + ADDITIONAL_INFO + 追加情報 + + + NODE_MODE + ノード + + + ELEM_MODE + 要素 + + + X_FROM_Y_ITEMS_SHOWN + %1%2%3 の項目の表示から + + + + SMESHGUI_ElemInfo + + COORDINATES + 座標 + + + CONNECTIVITY + 接続 + + + GRAVITY_CENTER + 重心 + + + NODE + ノード + + + 0D_ELEMENT + 0 D 要素 + + + 0D_ELEMENTS + 0 D 要素 + + + BALL_ELEMENT + ボールの要素 + + + BALL_ELEMENTS + ボールの要素 + + + EDGE + エッジ + + + EDGES + エッジ + + + FACE + 顔 + + + FACES + 直面しています。 + + + VOLUME + ボリューム + + + VOLUMES + ボリューム + + + FREE_NODE + 無料ノード (接続なし) + + + TYPE + タイプ + + + TRIANGLE + 三角形 + + + QUADRANGLE + 四角形 + + + POLYGON + 多角形 + + + TETRAHEDRON + 四面体 + + + HEXAHEDRON + 直方体 + + + PYRAMID + ピラミッド + + + PRISM + プリズム + + + HEX_PRISM + 角柱 + + + POLYHEDRON + 多面体 + + + QUADRATIC + 2 次 + + + YES + はい + + + NO + いいえ + + + PROPERTY + プロパティ + + + VALUE + 値 + + + + SMESHGUI_AddInfo + + NAME + 名前 + + + GROUPS + グループ + + + GROUPS_1 + ノード + + + GROUPS_2 + エッジ + + + GROUPS_3 + 直面しています。 + + + GROUPS_4 + ボリューム + + + GROUPS_5 + 0 D 要素 + + + GROUPS_6 + ボールの要素 + + + PARENT_MESH + 親メッシュ + + + TYPE + タイプ + + + STANDALONE_GROUP + スタンドアロン グループ + + + GROUP_ON_GEOMETRY + ジオメトリ グループします。 + + + GROUP_ON_FILTER + フィルターをグループ化します。 + + + GEOM_OBJECT + 図形 + + + NODE + ノード + + + EDGE + エッジ + + + FACE + 顔 + + + VOLUME + ボリューム + + + 0DELEM + 0 D 要素 + + + BALL_ELEMENT + ボール + + + UNKNOWN + 不明 + + + ENTITY_TYPE + エンティティの種類 + + + SIZE + サイズ + + + COLOR + 色 + + + NB_NODES + 基になるノード + + + COMPUTE + 計算 + + + LOAD + 負荷 + + + MESH_ON_GEOMETRY + 幾何学に基づく + + + MESH_FROM_FILE + インポート + + + FILE_NAME + ファイル名 + + + STANDALONE_MESH + スタンドアロン + + + SUBMESHES + サブメッシュ + + + SUBMESHES_0 + 化合物 + + + SUBMESHES_2 + 固体 + + + SUBMESHES_3 + シェル + + + SUBMESHES_4 + 顔 + + + SUBMESHES_5 + ワイヤー + + + SUBMESHES_6 + エッジ + + + SUBMESHES_7 + 頂点 + + + + SMESHGUI_MinDistance + + FIRST_TARGET + 最初のターゲット + + + SECOND_TARGET + 2 番目のターゲット + + + NODE + ノード + + + ELEMENT + 要素 + + + OBJECT + オブジェクト + + + ORIGIN + 起源 + + + COMPUTE + 計算 + + + RESULT + ターゲット間の距離 + + + DISTANCE + 距離 + + + + SMESHGUI_CopyMeshDlg + + OBJECT_NAME + ソース オブジェクト + + + ELEM_IDS + ソース要素 Id + + + NEW_NAME + 新しいメッシュ名 + + + + SMESHGUI_MeasureDlg + + MEASUREMENTS + 測定 + + + MIN_DIST + 最小距離 + + + BND_BOX + 境界ボックス + + + + SMESHGUI_BoundingBox + + SOURCE + ソース + + + OBJECTS + オブジェクト + + + NODES + ノード + + + ELEMENTS + 要素 + + + COMPUTE + 計算 + + + RESULT + 境界ボックス + + + SELECTED_NB_OBJ + %選択した 1%2 + + + NB_NODES + ノード + + + NB_ELEMENTS + 要素 + + + + SMESHGUI_MeshLoadingProgress + + MESH_LOAD_PROGRESS_TITLE + メッシュの読み込み + + + + StdMeshersGUI_SubShapeSelectorWdg + + X_FROM_Y_ITEMS_SHOWN + %1%2%3 の項目の表示から + + + + SMESHGUI_ReorientFacesDlg + + CAPTION + ベクトルによって顔の向きを変更します。 + + + REORIENT_FACES + 向きを変える + + + DIRECTION + 方向 + + + OBJECT + オブジェクト + + + POINT + ポイント + + + FACE + 顔 + + + FACES + 顔のソース + + + ORIENTATION + 印刷の向き + + + + SMESHGUI_ReorientFacesOp + + NO_OBJECT_SELECTED + 選択したオブジェクトがありません。 + + + NO_FACES + オブジェクトに顔が含まれていません + + + ZERO_SIZE_VECTOR + サイズ ベクトルは 0 します。 + + + INVALID_FACE + 有効でない顔 + + + NB_REORIENTED + %逆に 1 面 + + + + SMESHGUI_PropertiesDlg + + TITLE + プロパティ + + + NODES + ノード + + + EDGES + エッジ/ワイヤ フレーム + + + FACES + 直面しています。 + + + VOLUMES + ボリューム + + + OUTLINES + 概要 + + + 0D_ELEMENTS + 0 D 要素 + + + BALLS + ボール + + + ORIENTATIONS + 方向ベクトル + + + COLOR + 色: + + + WIDTH + 幅: + + + FACE_FRONT + フロント: + + + FACE_BACK + 戻る: + + + VOLUME_NORMAL + 標準: + + + VOLUME_REVERSED + 元に戻します。 + + + SIZE + サイズ: + + + ORIENTATION_SCALE + スケール: + + + ORIENTATION_3D + 3D ベクトル + + + SHRINK + 縮小係数: + + + diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index d0d6008d3..45acf33b1 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -210,7 +210,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() void getElementsInSphere ( const gp_XYZ& center, const double radius, TIDSortedElemSet& foundElems); size_t getSize() { return std::max( _size, _elements.size() ); } - ~ElementBndBoxTree(); + virtual ~ElementBndBoxTree(); protected: ElementBndBoxTree():_size(0) {} @@ -410,6 +410,10 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() */ //======================================================================= +SMESH_ElementSearcher::~SMESH_ElementSearcher() +{ +} + struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher { SMDS_Mesh* _mesh; @@ -423,7 +427,7 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher SMESH_ElementSearcherImpl( SMDS_Mesh& mesh, SMDS_ElemIteratorPtr elemIt=SMDS_ElemIteratorPtr()) : _mesh(&mesh),_meshPartIt(elemIt),_ebbTree(0),_nodeSearcher(0),_tolerance(-1),_outerFacesFound(false) {} - ~SMESH_ElementSearcherImpl() + virtual ~SMESH_ElementSearcherImpl() { if ( _ebbTree ) delete _ebbTree; _ebbTree = 0; if ( _nodeSearcher ) delete _nodeSearcher; _nodeSearcher = 0; diff --git a/src/SMESHUtils/SMESH_MeshAlgos.hxx b/src/SMESHUtils/SMESH_MeshAlgos.hxx index 42ff8923a..0236f6737 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.hxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.hxx @@ -87,6 +87,7 @@ struct SMESH_ElementSearcher * \brief Find out if the given point is out of closed 2D mesh. */ virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0; + virtual ~SMESH_ElementSearcher(); }; namespace SMESH_MeshAlgos diff --git a/src/SMESHUtils/SMESH_Octree.hxx b/src/SMESHUtils/SMESH_Octree.hxx index 5fa0e6533..adb74b560 100644 --- a/src/SMESHUtils/SMESH_Octree.hxx +++ b/src/SMESHUtils/SMESH_Octree.hxx @@ -49,6 +49,7 @@ public: // Constructor. limit must be provided at tree root construction. // limit will be deleted by SMESH_Octree SMESH_Octree (SMESH_TreeLimit* limit=0); + virtual ~SMESH_Octree() {}; // Compute the bigger dimension of my box double maxSize() const; diff --git a/src/SMESHUtils/SMESH_OctreeNode.cxx b/src/SMESHUtils/SMESH_OctreeNode.cxx index db85eb05a..95353575f 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.cxx +++ b/src/SMESHUtils/SMESH_OctreeNode.cxx @@ -327,29 +327,27 @@ void SMESH_OctreeNode::FindCoincidentNodes ( TIDSortedNodeSet* theSetOfNodes, * \param precision - Precision used */ //====================================================================================== -void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node, - TIDSortedNodeSet* SetOfNodes, +void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node, + TIDSortedNodeSet* SetOfNodes, list* Result, - const double precision) + const double precision) { - gp_XYZ p(Node->X(), Node->Y(), Node->Z()); - bool isInsideBool = isInside(p, precision); + gp_Pnt p1 (Node->X(), Node->Y(), Node->Z()); + bool isInsideBool = isInside( p1.XYZ(), precision ); if (isInsideBool) { // I'm only looking in the leaves, since all the nodes are stored there. if (isLeaf()) { - gp_Pnt p1 (Node->X(), Node->Y(), Node->Z()); - - TIDSortedNodeSet myNodesCopy = myNodes; - TIDSortedNodeSet::iterator it = myNodesCopy.begin(); - double tol2 = precision * precision; + TIDSortedNodeSet::iterator it = myNodes.begin(); + const double tol2 = precision * precision; bool squareBool; - while (it != myNodesCopy.end()) + while (it != myNodes.end()) { const SMDS_MeshNode* n2 = *it; + squareBool = false; // We're only looking at nodes with a superior Id. // JFA: Why? //if (Node->GetID() < n2->GetID()) @@ -364,14 +362,13 @@ void SMESH_OctreeNode::FindCoincidentNodes (const SMDS_MeshNode * Node, { Result->insert(Result->begin(), n2); SetOfNodes->erase( n2 ); - myNodes.erase( n2 ); + myNodes.erase( *it++ ); // it++ goes forward and returns it's previous position } } - //myNodesCopy.erase( it ); - //it = myNodesCopy.begin(); - it++; + if ( !squareBool ) + it++; } - if (Result->size() > 0) + if ( !Result->empty() ) myNodes.erase(Node); // JFA: for bug 0020185 } else diff --git a/src/SMESHUtils/SMESH_Tree.hxx b/src/SMESHUtils/SMESH_Tree.hxx index bf099d305..36d412420 100644 --- a/src/SMESHUtils/SMESH_Tree.hxx +++ b/src/SMESHUtils/SMESH_Tree.hxx @@ -19,257 +19,260 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - -// SMESH SMESH_Tree : tree implementation -// File : SMESH_Tree.hxx -// Created : Tue Jan 16 16:00:00 2007 -// Author : Nicolas Geimer & Aurélien Motteux (OCC) -// Module : SMESH -// -#ifndef _SMESH_Tree_HXX_ -#define _SMESH_Tree_HXX_ - -#include "SMESH_Utils.hxx" - -//================================================================================ -// Data limiting the tree height -struct SMESH_TreeLimit { - // MaxLevel of the Tree - int myMaxLevel; - // Minimal size of the Box - double myMinBoxSize; - - // Default: - // maxLevel-> 8^8 = 16777216 terminal trees at most - // minSize -> box size not checked - SMESH_TreeLimit(int maxLevel=8, double minSize=0.):myMaxLevel(maxLevel),myMinBoxSize(minSize) {} - virtual ~SMESH_TreeLimit() {} // it can be inherited -}; - -//================================================================================ -/*! - * \brief Base class for 2D and 3D trees - */ -//================================================================================ - -template< class BND_BOX, - int NB_CHILDREN> -class SMESH_Tree -{ - public: - - typedef BND_BOX box_type; - - // Constructor. limit must be provided at tree root construction. - // limit will be deleted by SMESH_Tree - SMESH_Tree (SMESH_TreeLimit* limit=0); - - // Destructor - virtual ~SMESH_Tree (); - - // Compute the Tree. Must be called by constructor of inheriting class - void compute(); - - // Tell if Tree is a leaf or not. - // An inheriting class can influence it via myIsLeaf protected field - bool isLeaf() const; - - // Return its level - int level() const { return myLevel; } - - // Return Bounding Box of the Tree - const box_type* getBox() const { return myBox; } - - // Return height of the tree, full or from this level to topest leaf - int getHeight(const bool full=true) const; - - static int nbChildren() { return NB_CHILDREN; } - - // Compute the bigger dimension of my box - virtual double maxSize() const = 0; - -protected: - // Return box of the whole tree - virtual box_type* buildRootBox() = 0; - - // Allocate a child - virtual SMESH_Tree* newChild() const = 0; - - // Allocate a bndbox according to childIndex. childIndex is zero based - virtual box_type* newChildBox(int childIndex) const = 0; - - // Fill in data of the children - virtual void buildChildrenData() = 0; - - // members - - // Array of children - SMESH_Tree** myChildren; - - // Point the father, NULL for the level 0 - SMESH_Tree* myFather; - - // Tell us if the Tree is a leaf or not - bool myIsLeaf; - - // Tree limit - const SMESH_TreeLimit* myLimit; - -private: - // Build the children recursively - void buildChildren(); - - // Level of the Tree - int myLevel; - - box_type* myBox; -}; - -//=========================================================================== -/*! - * Constructor. limit must be provided at tree root construction. - * limit will be deleted by SMESH_Tree. - */ -//=========================================================================== - -template< class BND_BOX, int NB_CHILDREN> -SMESH_Tree::SMESH_Tree (SMESH_TreeLimit* limit): - myChildren(0), - myFather(0), - myIsLeaf( false ), - myLimit( limit ), - myLevel(0), - myBox(0) -{ - if ( !myLimit ) myLimit = new SMESH_TreeLimit(); -} - -//================================================================================ -/*! - * \brief Compute the Tree - */ -//================================================================================ - -template< class BND_BOX, int NB_CHILDREN> -void SMESH_Tree::compute() -{ - if ( myLevel==0 ) - { - myBox = buildRootBox(); - if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize ) - myIsLeaf = true; - else - buildChildren(); - } -} - -//====================================== -/*! - * \brief SMESH_Tree Destructor - */ -//====================================== - -template< class BND_BOX, int NB_CHILDREN> -SMESH_Tree::~SMESH_Tree () -{ - if ( myChildren ) - { - if ( !isLeaf() ) - { - for(int i = 0; i -void SMESH_Tree::buildChildren() -{ - if ( isLeaf() ) return; - - myChildren = new SMESH_Tree*[NB_CHILDREN]; - - // get the whole model size - double rootSize = 0; - { - SMESH_Tree* root = this; - while ( root->myLevel > 0 ) - root = root->myFather; - rootSize = root->maxSize(); - } - for (int i = 0; i < NB_CHILDREN; i++) - { - // The child is of the same type than its father (For instance, a SMESH_OctreeNode) - // We allocate the memory we need for the child - myChildren[i] = newChild(); - // and we assign to him its box. - myChildren[i]->myFather = this; - myChildren[i]->myLimit = myLimit; - myChildren[i]->myLevel = myLevel + 1; - myChildren[i]->myBox = newChildBox( i ); - myChildren[i]->myBox->Enlarge( rootSize * 1e-10 ); - if ( myLimit->myMinBoxSize > 0. && myChildren[i]->maxSize() <= myLimit->myMinBoxSize ) - myChildren[i]->myIsLeaf = true; - } - - // After building the NB_CHILDREN boxes, we put the data into the children. - buildChildrenData(); - - //After we pass to the next level of the Tree - for (int i = 0; ibuildChildren(); -} - -//================================================================================ -/*! - * \brief Tell if Tree is a leaf or not - * An inheriting class can influence it via myIsLeaf protected field - */ -//================================================================================ - -template< class BND_BOX, int NB_CHILDREN> -bool SMESH_Tree::isLeaf() const -{ - return myIsLeaf || ((myLimit->myMaxLevel > 0) ? (level() >= myLimit->myMaxLevel) : false ); -} - -//================================================================================ -/*! - * \brief Return height of the tree, full or from this level to topest leaf - */ -//================================================================================ - -template< class BND_BOX, int NB_CHILDREN> -int SMESH_Tree::getHeight(const bool full) const -{ - if ( full && myFather ) - return myFather->getHeight( true ); - - if ( isLeaf() ) - return 1; - - int heigth = 0; - for (int i = 0; igetHeight( false ); - if ( h > heigth ) - heigth = h; - } - return heigth + 1; -} - -#endif + +// SMESH SMESH_Tree : tree implementation +// File : SMESH_Tree.hxx +// Created : Tue Jan 16 16:00:00 2007 +// Author : Nicolas Geimer & Aurélien Motteux (OCC) +// Module : SMESH +// +#ifndef _SMESH_Tree_HXX_ +#define _SMESH_Tree_HXX_ + +#include "SMESH_Utils.hxx" + +//================================================================================ +// Data limiting the tree height +struct SMESH_TreeLimit { + // MaxLevel of the Tree + int myMaxLevel; + // Minimal size of the Box + double myMinBoxSize; + + // Default: + // maxLevel-> 8^8 = 16777216 terminal trees at most + // minSize -> box size not checked + SMESH_TreeLimit(int maxLevel=8, double minSize=0.):myMaxLevel(maxLevel),myMinBoxSize(minSize) {} + virtual ~SMESH_TreeLimit() {} // it can be inherited +}; + +//================================================================================ +/*! + * \brief Base class for 2D and 3D trees + */ +//================================================================================ + +template< class BND_BOX, + int NB_CHILDREN> +class SMESH_Tree +{ + public: + + typedef BND_BOX box_type; + + // Constructor. limit must be provided at tree root construction. + // limit will be deleted by SMESH_Tree + SMESH_Tree (SMESH_TreeLimit* limit=0); + + // Destructor + virtual ~SMESH_Tree (); + + // Compute the Tree. Must be called by constructor of inheriting class + void compute(); + + // Tell if Tree is a leaf or not. + // An inheriting class can influence it via myIsLeaf protected field + bool isLeaf() const; + + // Return its level + int level() const { return myLevel; } + + // Return Bounding Box of the Tree + const box_type* getBox() const { return myBox; } + + // Return height of the tree, full or from this level to topest leaf + int getHeight(const bool full=true) const; + + static int nbChildren() { return NB_CHILDREN; } + + // Compute the biggest dimension of my box + virtual double maxSize() const = 0; + +protected: + // Return box of the whole tree + virtual box_type* buildRootBox() = 0; + + // Allocate a child + virtual SMESH_Tree* newChild() const = 0; + + // Allocate a bndbox according to childIndex. childIndex is zero based + virtual box_type* newChildBox(int childIndex) const = 0; + + // Fill in data of the children + virtual void buildChildrenData() = 0; + + // members + + // Array of children + SMESH_Tree** myChildren; + + // Point the father, NULL for the level 0 + SMESH_Tree* myFather; + + // Tell us if the Tree is a leaf or not + bool myIsLeaf; + + // Tree limit + const SMESH_TreeLimit* myLimit; + +private: + // Build the children recursively + void buildChildren(); + + // Level of the Tree + int myLevel; + + box_type* myBox; +}; + +//=========================================================================== +/*! + * Constructor. limit must be provided at tree root construction. + * limit will be deleted by SMESH_Tree. + */ +//=========================================================================== + +template< class BND_BOX, int NB_CHILDREN> +SMESH_Tree::SMESH_Tree (SMESH_TreeLimit* limit): + myChildren(0), + myFather(0), + myIsLeaf( false ), + myLimit( limit ), + myLevel(0), + myBox(0) +{ + //if ( !myLimit ) myLimit = new SMESH_TreeLimit(); +} + +//================================================================================ +/*! + * \brief Compute the Tree + */ +//================================================================================ + +template< class BND_BOX, int NB_CHILDREN> +void SMESH_Tree::compute() +{ + if ( myLevel==0 ) + { + if ( !myLimit ) myLimit = new SMESH_TreeLimit(); + myBox = buildRootBox(); + if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize ) + myIsLeaf = true; + else + buildChildren(); + } +} + +//====================================== +/*! + * \brief SMESH_Tree Destructor + */ +//====================================== + +template< class BND_BOX, int NB_CHILDREN> +SMESH_Tree::~SMESH_Tree () +{ + if ( myChildren ) + { + if ( !isLeaf() ) + { + for(int i = 0; i +void SMESH_Tree::buildChildren() +{ + if ( isLeaf() ) return; + + myChildren = new SMESH_Tree*[NB_CHILDREN]; + + // get the whole model size + double rootSize = 0; + { + SMESH_Tree* root = this; + while ( root->myLevel > 0 ) + root = root->myFather; + rootSize = root->maxSize(); + } + for (int i = 0; i < NB_CHILDREN; i++) + { + // The child is of the same type than its father (For instance, a SMESH_OctreeNode) + // We allocate the memory we need for the child + myChildren[i] = newChild(); + // and we assign to him its box. + myChildren[i]->myFather = this; + if (myChildren[i]->myLimit) + delete myChildren[i]->myLimit; + myChildren[i]->myLimit = myLimit; + myChildren[i]->myLevel = myLevel + 1; + myChildren[i]->myBox = newChildBox( i ); + myChildren[i]->myBox->Enlarge( rootSize * 1e-10 ); + if ( myLimit->myMinBoxSize > 0. && myChildren[i]->maxSize() <= myLimit->myMinBoxSize ) + myChildren[i]->myIsLeaf = true; + } + + // After building the NB_CHILDREN boxes, we put the data into the children. + buildChildrenData(); + + //After we pass to the next level of the Tree + for (int i = 0; ibuildChildren(); +} + +//================================================================================ +/*! + * \brief Tell if Tree is a leaf or not + * An inheriting class can influence it via myIsLeaf protected field + */ +//================================================================================ + +template< class BND_BOX, int NB_CHILDREN> +bool SMESH_Tree::isLeaf() const +{ + return myIsLeaf || ((myLimit->myMaxLevel > 0) ? (level() >= myLimit->myMaxLevel) : false ); +} + +//================================================================================ +/*! + * \brief Return height of the tree, full or from this level to topest leaf + */ +//================================================================================ + +template< class BND_BOX, int NB_CHILDREN> +int SMESH_Tree::getHeight(const bool full) const +{ + if ( full && myFather ) + return myFather->getHeight( true ); + + if ( isLeaf() ) + return 1; + + int heigth = 0; + for (int i = 0; igetHeight( false ); + if ( h > heigth ) + heigth = h; + } + return heigth + 1; +} + +#endif diff --git a/src/SMESH_I/Makefile.am b/src/SMESH_I/Makefile.am index d76a6c7dc..e5ddeed57 100644 --- a/src/SMESH_I/Makefile.am +++ b/src/SMESH_I/Makefile.am @@ -110,6 +110,11 @@ libSMESHEngine_la_LDFLAGS = \ ../SMESHDS/libSMESHDS.la \ ../Controls/libSMESHControls.la \ $(KERNEL_LDFLAGS) \ + -lOpUtil \ + -lSalomeNotification \ + -lResourcesManager \ + -lSalomeResourcesManager \ + -lSALOMEBasics \ -lSalomeContainer \ -lSalomeNS \ -lRegistry \ diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index b0a202b5e..60c0b2491 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -369,7 +369,8 @@ namespace { "ExtrusionSweepObject1D","ExtrusionSweepObject1DMakeGroups", "ExtrusionSweepObject2D","ExtrusionSweepObject2DMakeGroups", "Translate","TranslateMakeGroups","TranslateMakeMesh", - "TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh" + "TranslateObject","TranslateObjectMakeGroups", "TranslateObjectMakeMesh", + "ExtrusionAlongPathX","ExtrusionAlongPathObjX" ,"" }; // <- mark of the end methodsAcceptingList.Insert( methodNames ); } @@ -621,21 +622,31 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand // Prevent moving a command creating a sub-mesh to the end of the script // if the sub-mesh is used in theCommand as argument - if ( _pySubMesh::CanBeArgOfMethod( aCommand->GetMethod() )) - { - PlaceSubmeshAfterItsCreation( aCommand ); - } + // if ( _pySubMesh::CanBeArgOfMethod( aCommand->GetMethod() )) + // { + // PlaceSubmeshAfterItsCreation( aCommand ); + // } - // Method( SMESH.PointStruct(x,y,z) -> Method( [x,y,z] + // Method( SMESH.PointStruct(x,y,z)... -> Method( [x,y,z]... StructToList( aCommand ); + // not to erase _pySelfEraser's etc. used as args in some commands + std::list< _pyID >::const_iterator id = myKeepAgrCmdsIDs.begin(); + for ( ; id != myKeepAgrCmdsIDs.end(); ++id ) + if ( *id != objID && theCommand.Search( *id ) > id->Length() ) + { + Handle(_pyObject) obj = FindObject( *id ); + if ( !obj.IsNull() ) + obj->AddArgCmd( aCommand ); + } + // Find an object to process theCommand // SMESH_Gen method? if ( objID == this->GetID() || objID == SMESH_2smeshpy::GenName()) { this->Process( aCommand ); - addFilterUser( aCommand, theGen ); // protect filters from clearing + //addFilterUser( aCommand, theGen ); // protect filters from clearing return aCommand; } @@ -656,13 +667,14 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand else if ( aCommand->GetMethod() == "GetSubMesh" ) { // SubMesh creation _pyID subMeshID = aCommand->GetResultValue(); Handle(_pySubMesh) subMesh = new _pySubMesh( aCommand ); + CheckObjectIsReCreated( subMesh ); myObjects.insert( make_pair( subMeshID, subMesh )); } // Method( mesh.GetIDSource([id1,id2]) -> Method( [id1,id2] GetIDSourceToList( aCommand ); - addFilterUser( aCommand, theGen ); // protect filters from clearing + //addFilterUser( aCommand, theGen ); // protect filters from clearing id_mesh->second->Process( aCommand ); id_mesh->second->AddProcessedCmd( aCommand ); @@ -676,7 +688,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand // Method( mesh.GetIDSource([id1,id2]) -> Method( [id1,id2] GetIDSourceToList( aCommand ); - addFilterUser( aCommand, theGen ); // protect filters from clearing + //addFilterUser( aCommand, theGen ); // protect filters from clearing const TCollection_AsciiString& method = aCommand->GetMethod(); @@ -716,8 +728,9 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand !myMeshes.count( meshID ) && aCommand->IsStudyEntry( meshID )) { - TCollection_AsciiString processedCommand = aCommand->GetString(); + _AString processedCommand = aCommand->GetString(); Handle(_pyMesh) mesh = new _pyMesh( aCommand, meshID ); + CheckObjectIsReCreated( mesh ); myMeshes.insert( make_pair( meshID, mesh )); aCommand->Clear(); aCommand->GetString() = processedCommand; // discard changes made by _pyMesh @@ -743,13 +756,13 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand } // SMESH_MeshEditor methods // SMESH_Hypothesis method? - list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); - for ( ; hyp != myHypos.end(); ++hyp ) - if ( !(*hyp)->IsAlgo() && objID == (*hyp)->GetID() ) { - (*hyp)->Process( aCommand ); - (*hyp)->AddProcessedCmd( aCommand ); - return aCommand; - } + Handle(_pyHypothesis) hyp = FindHyp( objID ); + if ( !hyp.IsNull() && !hyp->IsAlgo() ) + { + hyp->Process( aCommand ); + hyp->AddProcessedCmd( aCommand ); + return aCommand; + } // aFilterManager.CreateFilter() ? if ( aCommand->GetMethod() == "CreateFilter" ) @@ -764,6 +777,14 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Handle(_pyObject) filter( new _pyFilter( aCommand, newID )); AddObject( filter ); } + // aFreeNodes0x5011f80 = aFilterManager.CreateFreeNodes() ## issue 0020976 + else if ( theCommand.Search( "aFilterManager.Create" ) > 0 ) + { + // create _pySelfEraser for functors + Handle(_pySelfEraser) functor = new _pySelfEraser( aCommand ); + functor->IgnoreOwnCalls(); // to erase if not used as an argument + AddObject( functor ); + } // other object method? map< _pyID, Handle(_pyObject) >::iterator id_obj = myObjects.find( objID ); @@ -914,7 +935,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) if ( method == "CreateMesh" || method == "CreateEmptyMesh") { Handle(_pyMesh) mesh = new _pyMesh( theCommand ); - myMeshes.insert( make_pair( mesh->GetID(), mesh )); + AddObject( mesh ); return; } if ( method == "CreateMeshesFromUNV" || @@ -922,7 +943,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) method == "CopyMesh" ) // command result is a mesh { Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() ); - myMeshes.insert( make_pair( mesh->GetID(), mesh )); + AddObject( mesh ); return; } if( method == "CreateMeshesFromMED" || @@ -935,7 +956,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) _pyID meshID = theCommand->GetResultValue(ind+1); if ( !theCommand->IsStudyEntry( meshID ) ) continue; Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue(ind+1)); - myMeshes.insert( make_pair( mesh->GetID(), mesh )); + AddObject( mesh ); } if ( method == "CreateMeshesFromGMF" ) { @@ -953,13 +974,16 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) // issue 199929, remove standard library name (default parameter) const TCollection_AsciiString & aLibName = theCommand->GetArg( 2 ); if ( aLibName.Search( "StdMeshersEngine" ) != -1 ) { - // keep first argument + // keep the first argument TCollection_AsciiString arg = theCommand->GetArg( 1 ); theCommand->RemoveArgs(); theCommand->SetArg( 1, arg ); } - myHypos.push_back( _pyHypothesis::NewHypothesis( theCommand )); + Handle(_pyHypothesis) hyp = _pyHypothesis::NewHypothesis( theCommand ); + CheckObjectIsReCreated( hyp ); + myHypos.insert( make_pair( hyp->GetID(), hyp )); + return; } @@ -996,7 +1020,8 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) // SMESH_Pattern, FilterManager if ( method == "GetPattern" || method == "CreateFilterManager" || - method == "CreateMeasurements" ) { + method == "CreateMeasurements" ) + { Handle(_pyObject) obj = new _pySelfEraser( theCommand ); if ( !myObjects.insert( make_pair( obj->GetID(), obj )).second ) theCommand->Clear(); // already created @@ -1009,7 +1034,7 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand ) theCommand->SetArg( theCommand->GetNbArgs() + 1, "True" ); } Handle(_pyMesh) mesh = new _pyMesh( theCommand, theCommand->GetResultValue() ); - myMeshes.insert( make_pair( mesh->GetID(), mesh )); + AddObject( mesh ); AddMeshAccessorMethod( theCommand ); } else if ( method == "SetName" ) // SetName(obj,name) @@ -1053,15 +1078,15 @@ void _pyGen::Flush() map< _pyID, Handle(_pyMesh) >::iterator id_mesh; map< _pyID, Handle(_pyObject) >::iterator id_obj; - list< Handle(_pyHypothesis) >::iterator hyp; + map< _pyID, Handle(_pyHypothesis) >::iterator id_hyp; if ( IsToKeepAllCommands() ) // historical dump { // set myIsPublished = true to all objects for ( id_mesh = myMeshes.begin(); id_mesh != myMeshes.end(); ++id_mesh ) id_mesh->second->SetRemovedFromStudy( false ); - for ( hyp = myHypos.begin(); hyp != myHypos.end(); ++hyp ) - (*hyp)->SetRemovedFromStudy( false ); + for ( id_hyp = myHypos.begin(); id_hyp != myHypos.end(); ++id_hyp ) + id_hyp->second->SetRemovedFromStudy( false ); for ( id_obj = myObjects.begin(); id_obj != myObjects.end(); ++id_obj ) id_obj->second->SetRemovedFromStudy( false ); } @@ -1070,9 +1095,9 @@ void _pyGen::Flush() // let hypotheses find referred objects in order to prevent clearing // not published referred hyps (it's needed for hyps like "LayerDistribution") list< Handle(_pyMesh) > fatherMeshes; - for ( hyp = myHypos.begin(); hyp != myHypos.end(); ++hyp ) - if ( !hyp->IsNull() ) - (*hyp)->GetReferredMeshesAndGeom( fatherMeshes ); + for ( id_hyp = myHypos.begin(); id_hyp != myHypos.end(); ++id_hyp ) + if ( !id_hyp->second.IsNull() ) + id_hyp->second->GetReferredMeshesAndGeom( fatherMeshes ); } // set myIsPublished = false to all objects depending on // meshes built on a removed geometry @@ -1086,12 +1111,12 @@ void _pyGen::Flush() id_mesh->second->Flush(); // Flush hyps - for ( hyp = myHypos.begin(); hyp != myHypos.end(); ++hyp ) - if ( !hyp->IsNull() ) { - (*hyp)->Flush(); + for ( id_hyp = myHypos.begin(); id_hyp != myHypos.end(); ++id_hyp ) + if ( !id_hyp->second.IsNull() ) { + id_hyp->second->Flush(); // smeshgen.CreateHypothesis() --> smesh.CreateHypothesis() - if ( !(*hyp)->IsWrapped() ) - (*hyp)->GetCreationCmd()->SetObject( SMESH_2smeshpy::GenName() ); + if ( !id_hyp->second->IsWrapped() ) + id_hyp->second->GetCreationCmd()->SetObject( SMESH_2smeshpy::GenName() ); } // Flush other objects @@ -1143,10 +1168,10 @@ void _pyGen::ClearCommands() for ( ; id_mesh != myMeshes.end(); ++id_mesh ) id_mesh->second->ClearCommands(); - list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); - for ( ; hyp != myHypos.end(); ++hyp ) - if ( !hyp->IsNull() ) - (*hyp)->ClearCommands(); + map< _pyID, Handle(_pyHypothesis) >::iterator id_hyp = myHypos.begin(); + for ( ; id_hyp != myHypos.end(); ++id_hyp ) + if ( !id_hyp->second.IsNull() ) + id_hyp->second->ClearCommands(); map< _pyID, Handle(_pyObject) >::iterator id_obj = myObjects.begin(); for ( ; id_obj != myObjects.end(); ++id_obj ) @@ -1176,10 +1201,10 @@ void _pyGen::Free() id_obj->second->Free(); myObjects.clear(); - list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); - for ( ; hyp != myHypos.end(); ++hyp ) - if ( !hyp->IsNull() ) - (*hyp)->Free(); + map< _pyID, Handle(_pyHypothesis) >::iterator id_hyp = myHypos.begin(); + for ( ; id_hyp != myHypos.end(); ++id_hyp ) + if ( !id_hyp->second.IsNull() ) + id_hyp->second->Free(); myHypos.clear(); myFile2ExportedMesh.clear(); @@ -1215,12 +1240,14 @@ bool _pyGen::AddMeshAccessorMethod( Handle(_pyCommand) theCmd ) const bool _pyGen::AddAlgoAccessorMethod( Handle(_pyCommand) theCmd ) const { bool added = false; - list< Handle(_pyHypothesis) >::const_iterator hyp = myHypos.begin(); - for ( ; hyp != myHypos.end(); ++hyp ) { - if ( (*hyp)->IsAlgo() && /*(*hyp)->IsWrapped() &&*/ - theCmd->AddAccessorMethod( (*hyp)->GetID(), (*hyp)->AccessorMethod() )) + map< _pyID, Handle(_pyHypothesis) >::const_iterator id_hyp = myHypos.begin(); + for ( ; id_hyp != myHypos.end(); ++id_hyp ) + if ( !id_hyp->second.IsNull() && + id_hyp->second->IsAlgo() && /*(*hyp)->IsWrapped() &&*/ + theCmd->AddAccessorMethod( id_hyp->second->GetID(), + id_hyp->second->AccessorMethod() )) added = true; - } + return added; } @@ -1234,19 +1261,20 @@ bool _pyGen::AddAlgoAccessorMethod( Handle(_pyCommand) theCmd ) const Handle(_pyHypothesis) _pyGen::FindHyp( const _pyID& theHypID ) { - list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); - for ( ; hyp != myHypos.end(); ++hyp ) - if ( !hyp->IsNull() && theHypID == (*hyp)->GetID() ) - return *hyp; + map< _pyID, Handle(_pyHypothesis) >::iterator id_hyp = myHypos.find( theHypID ); + if ( id_hyp != myHypos.end() && + !id_hyp->second.IsNull() && + theHypID == id_hyp->second->GetID() ) + return id_hyp->second; return Handle(_pyHypothesis)(); } //================================================================================ /*! - * \brief Find algorithm the created algorithm + * \brief Find algorithm able to create a hypothesis * \param theGeom - The shape ID the algorithm was created on * \param theMesh - The mesh ID that created the algorithm - * \param dim - The algo dimension + * \param theHypothesis - The hypothesis the algorithm sould be able to create * \retval Handle(_pyHypothesis) - The found algo */ //================================================================================ @@ -1254,15 +1282,15 @@ Handle(_pyHypothesis) _pyGen::FindHyp( const _pyID& theHypID ) Handle(_pyHypothesis) _pyGen::FindAlgo( const _pyID& theGeom, const _pyID& theMesh, const Handle(_pyHypothesis)& theHypothesis ) { - list< Handle(_pyHypothesis) >::iterator hyp = myHypos.begin(); - for ( ; hyp != myHypos.end(); ++hyp ) - if ( !hyp->IsNull() && - (*hyp)->IsAlgo() && - theHypothesis->CanBeCreatedBy( (*hyp)->GetAlgoType() ) && - (*hyp)->GetGeom() == theGeom && - (*hyp)->GetMesh() == theMesh ) - return *hyp; - return 0; + map< _pyID, Handle(_pyHypothesis) >::iterator id_hyp = myHypos.begin(); + for ( ; id_hyp != myHypos.end(); ++id_hyp ) + if ( !id_hyp->second.IsNull() && + id_hyp->second->IsAlgo() && + theHypothesis->CanBeCreatedBy( id_hyp->second->GetAlgoType() ) && + id_hyp->second->GetGeom() == theGeom && + id_hyp->second->GetMesh() == theMesh ) + return id_hyp->second; + return Handle(_pyHypothesis)(); } //================================================================================ @@ -1362,28 +1390,30 @@ void _pyGen::setNeighbourCommand( Handle(_pyCommand)& theCmd, */ //================================================================================ -void _pyGen::addFilterUser( Handle(_pyCommand)& theCommand, const Handle(_pyObject)& user ) -{ - const char filterPrefix[] = "aFilter0x"; - if ( theCommand->GetString().Search( filterPrefix ) < 1 ) - return; +// void _pyGen::addFilterUser( Handle(_pyCommand)& theCommand, const Handle(_pyObject)& user ) +// { + // No more needed after adding _pyObject::myArgCommands - for ( int i = theCommand->GetNbArgs(); i > 0; --i ) - { - const _AString & arg = theCommand->GetArg( i ); - // NOT TREATED CASE: arg == "[something, aFilter0x36a2f60]" - if ( arg.Search( filterPrefix ) != 1 ) - continue; +// const char filterPrefix[] = "aFilter0x"; +// if ( theCommand->GetString().Search( filterPrefix ) < 1 ) +// return; - Handle(_pyFilter) filter = Handle(_pyFilter)::DownCast( FindObject( arg )); - if ( !filter.IsNull() ) - { - filter->AddUser( user ); - if ( !filter->GetNewID().IsEmpty() ) - theCommand->SetArg( i, filter->GetNewID() ); - } - } -} +// for ( int i = theCommand->GetNbArgs(); i > 0; --i ) +// { +// const _AString & arg = theCommand->GetArg( i ); +// // NOT TREATED CASE: arg == "[something, aFilter0x36a2f60]" +// if ( arg.Search( filterPrefix ) != 1 ) +// continue; + +// Handle(_pyFilter) filter = Handle(_pyFilter)::DownCast( FindObject( arg )); +// if ( !filter.IsNull() ) +// { +// filter->AddUser( user ); +// if ( !filter->GetNewID().IsEmpty() ) +// theCommand->SetArg( i, filter->GetNewID() ); +// } +// } +//} //================================================================================ /*! @@ -1442,6 +1472,8 @@ void _pyGen::AddObject( Handle(_pyObject)& theObj ) { if ( theObj.IsNull() ) return; + CheckObjectIsReCreated( theObj ); + if ( theObj->IsKind( STANDARD_TYPE( _pyMesh ))) myMeshes.insert( make_pair( theObj->GetID(), Handle(_pyMesh)::DownCast( theObj ))); @@ -1452,6 +1484,41 @@ void _pyGen::AddObject( Handle(_pyObject)& theObj ) myObjects.insert( make_pair( theObj->GetID(), theObj )); } +//================================================================================ +/*! + * \brief Erases an existing object with the same ID. This method should be called + * before storing theObj in _pyGen + */ +//================================================================================ + +void _pyGen::CheckObjectIsReCreated( Handle(_pyObject)& theObj ) +{ + if ( theObj.IsNull() || !_pyCommand::IsStudyEntry( theObj->GetID() )) + return; + + const bool isHyp = theObj->IsKind( STANDARD_TYPE( _pyHypothesis )); + Handle(_pyObject) existing = + isHyp ? FindHyp( theObj->GetID() ) : FindObject( theObj->GetID() ); + if ( !existing.IsNull() && existing != theObj ) + { + existing->SetRemovedFromStudy( true ); + existing->ClearCommands(); + if ( isHyp ) + { + if ( myHypos.count( theObj->GetID() )) + myHypos.erase( theObj->GetID() ); + } + else if ( myMeshes.count( theObj->GetID() )) + { + myMeshes.erase( theObj->GetID() ); + } + else if ( myObjects.count( theObj->GetID() )) + { + myObjects.erase( theObj->GetID() ); + } + } +} + //================================================================================ /*! * \brief Re-register an object with other ID to make it Process() commands of @@ -3480,7 +3547,7 @@ const TCollection_AsciiString & _pyCommand::GetObject() if ( GetBegPos( OBJECT_IND ) == UNKNOWN ) { // beginning - int begPos = GetBegPos( RESULT_IND ) + myRes.Length(); + int begPos = GetBegPos( RESULT_IND ); if ( begPos < 1 ) { begPos = myString.Location( "=", 1, Length() ) + 1; // is '=' in the string argument (for example, name) or not @@ -3497,6 +3564,9 @@ const TCollection_AsciiString & _pyCommand::GetObject() if ( nb1 % 2 != 0 || nb2 % 2 != 0 ) begPos = 1; } + else { + begPos += myRes.Length(); + } myObj = GetWord( myString, begPos, true ); if ( begPos != EMPTY ) { @@ -4047,19 +4117,48 @@ _pyID _pyObject::FatherID(const _pyID & childID) */ //================================================================================ +_pySelfEraser::_pySelfEraser(const Handle(_pyCommand)& theCreationCmd) + :_pyObject(theCreationCmd), myIgnoreOwnCalls(false) +{ + myIsPublished = true; // prevent clearing as a not published + theGen->KeepAgrCmds( GetID() ); // ask to fill myArgCmds +} + +//================================================================================ +/*! + * \brief SelfEraser erases creation command if no more it's commands invoked + */ +//================================================================================ + void _pySelfEraser::Flush() { - int nbCalls = GetNbCalls(); - if ( nbCalls > 0 ) + bool toErase = false; + if ( myIgnoreOwnCalls ) // check if this obj is used as argument { - // ignore cleared commands - std::list< Handle(_pyCommand) >& cmds = GetProcessedCmds(); - std::list< Handle(_pyCommand) >::const_iterator cmd = cmds.begin(); - for ( ; cmd != cmds.end(); ++cmd ) - nbCalls -= (*cmd)->IsEmpty(); + int nbArgUses = 0; + list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin(); + for ( ; cmd != myArgCmds.end(); ++cmd ) + nbArgUses += !(*cmd)->IsEmpty(); + toErase = ( nbArgUses < 1 ); + } + else + { + int nbCalls = GetNbCalls(); + if ( nbCalls > 0 ) + { + // ignore cleared commands + std::list< Handle(_pyCommand) >& cmds = GetProcessedCmds(); + std::list< Handle(_pyCommand) >::const_iterator cmd = cmds.begin(); + for ( ; cmd != cmds.end(); ++cmd ) + nbCalls -= (*cmd)->IsEmpty(); + } + toErase = ( nbCalls < 1 ); + } + if ( toErase ) + { + myIsPublished = false; + _pyObject::ClearCommands(); } - if ( nbCalls < 1 ) - GetCreationCmd()->Clear(); } //================================================================================ @@ -4072,6 +4171,7 @@ _pySubMesh::_pySubMesh(const Handle(_pyCommand)& theCreationCmd): _pyObject(theCreationCmd) { myMesh = ObjectToMesh( theGen->FindObject( theCreationCmd->GetObject() )); + theGen->KeepAgrCmds( GetID() ); // ask to fill myArgCmds } //================================================================================ @@ -4082,39 +4182,40 @@ _pySubMesh::_pySubMesh(const Handle(_pyCommand)& theCreationCmd): bool _pySubMesh::CanBeArgOfMethod(const _AString& theMethodName) { - // names of all methods where a sub-mesh can be used as argument - static TStringSet methods; - if ( methods.empty() ) { - const char * names[] = { - // methods of SMESH_Gen - "CopyMesh", - // methods of SMESH_Group - "AddFrom", - // methods of SMESH_Measurements - "MinDistance", - // methods of SMESH_Mesh - "ExportPartToMED","ExportCGNS","ExportPartToDAT","ExportPartToUNV","ExportPartToSTL", - "RemoveSubMesh", - // methods of SMESH_MeshEditor - "ReorientObject","Reorient2D","TriToQuadObject","QuadToTriObject","SplitQuadObject", - "SplitVolumesIntoTetra","SmoothObject","SmoothParametricObject","ConvertFromQuadraticObject", - "RotationSweepObject","RotationSweepObjectMakeGroups","RotationSweepObject1D", - "RotationSweepObject1DMakeGroups","RotationSweepObject2D","RotationSweepObject2DMakeGroups", - "ExtrusionSweepObject","ExtrusionSweepObjectMakeGroups","ExtrusionSweepObject0D", - "ExtrusionSweepObject0DMakeGroups","ExtrusionSweepObject1D","ExtrusionSweepObject2D", - "ExtrusionSweepObject1DMakeGroups","ExtrusionSweepObject2DMakeGroups", - "ExtrusionAlongPathObjX","ExtrusionAlongPathObject","ExtrusionAlongPathObjectMakeGroups", - "ExtrusionAlongPathObject1D","ExtrusionAlongPathObject1DMakeGroups", - "ExtrusionAlongPathObject2D","ExtrusionAlongPathObject2DMakeGroups","MirrorObject", - "MirrorObjectMakeGroups","MirrorObjectMakeMesh","TranslateObject","Scale", - "TranslateObjectMakeGroups","TranslateObjectMakeMesh","ScaleMakeGroups","ScaleMakeMesh", - "RotateObject","RotateObjectMakeGroups","RotateObjectMakeMesh","FindCoincidentNodesOnPart", - "FindCoincidentNodesOnPartBut","FindEqualElements","FindAmongElementsByPoint", - "MakeBoundaryMesh","Create0DElementsOnAllNodes", - "" }; // <- mark of end - methods.Insert( names ); - } - return methods.Contains( theMethodName ); + return false; +// // names of all methods where a sub-mesh can be used as argument +// static TStringSet methods; +// if ( methods.empty() ) { +// const char * names[] = { +// // methods of SMESH_Gen +// "CopyMesh", +// // methods of SMESH_Group +// "AddFrom", +// // methods of SMESH_Measurements +// "MinDistance", +// // methods of SMESH_Mesh +// "ExportPartToMED","ExportCGNS","ExportPartToDAT","ExportPartToUNV","ExportPartToSTL", +// "RemoveSubMesh", +// // methods of SMESH_MeshEditor +// "ReorientObject","Reorient2D","TriToQuadObject","QuadToTriObject","SplitQuadObject", +// "SplitVolumesIntoTetra","SmoothObject","SmoothParametricObject","ConvertFromQuadraticObject", +// "RotationSweepObject","RotationSweepObjectMakeGroups","RotationSweepObject1D", +// "RotationSweepObject1DMakeGroups","RotationSweepObject2D","RotationSweepObject2DMakeGroups", +// "ExtrusionSweepObject","ExtrusionSweepObjectMakeGroups","ExtrusionSweepObject0D", +// "ExtrusionSweepObject0DMakeGroups","ExtrusionSweepObject1D","ExtrusionSweepObject2D", +// "ExtrusionSweepObject1DMakeGroups","ExtrusionSweepObject2DMakeGroups", +// "ExtrusionAlongPathObjX","ExtrusionAlongPathObject","ExtrusionAlongPathObjectMakeGroups", +// "ExtrusionAlongPathObject1D","ExtrusionAlongPathObject1DMakeGroups", +// "ExtrusionAlongPathObject2D","ExtrusionAlongPathObject2DMakeGroups","MirrorObject", +// "MirrorObjectMakeGroups","MirrorObjectMakeMesh","TranslateObject","Scale", +// "TranslateObjectMakeGroups","TranslateObjectMakeMesh","ScaleMakeGroups","ScaleMakeMesh", +// "RotateObject","RotateObjectMakeGroups","RotateObjectMakeMesh","FindCoincidentNodesOnPart", +// "FindCoincidentNodesOnPartBut","FindEqualElements","FindAmongElementsByPoint", +// "MakeBoundaryMesh","Create0DElementsOnAllNodes", +// "" }; // <- mark of end +// methods.Insert( names ); +// } +// return methods.Contains( theMethodName ); } //================================================================================ @@ -4126,7 +4227,6 @@ bool _pySubMesh::CanBeArgOfMethod(const _AString& theMethodName) void _pySubMesh::Process( const Handle(_pyCommand)& theCommand ) { _pyObject::Process(theCommand); // count calls of Process() - GetCreationCmd()->AddDependantCmd( theCommand ); } //================================================================================ @@ -4137,11 +4237,17 @@ void _pySubMesh::Process( const Handle(_pyCommand)& theCommand ) void _pySubMesh::Flush() { - if ( GetNbCalls() == 0 ) // move to the end of all commands + if ( GetNbCalls() == 0 && myArgCmds.empty() ) // move to the end of all commands theGen->GetLastCommand()->AddDependantCmd( GetCreationCmd() ); else if ( !myCreator.IsNull() ) // move to be just after creator myCreator->GetCreationCmd()->AddDependantCmd( GetCreationCmd() ); + + // move sub-mesh usage after creation cmd + list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin(); + for ( ; cmd != myArgCmds.end(); ++cmd ) + if ( !(*cmd)->IsEmpty() ) + GetCreationCmd()->AddDependantCmd( *cmd ); } //================================================================================ @@ -4196,7 +4302,7 @@ _pyGroup::_pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id) { if ( !filter->GetNewID().IsEmpty() ) theCreationCmd->SetArg( 3, filter->GetNewID() ); - filter->AddUser( this ); + //filter->AddUser( this ); } myFilter = filter; } @@ -4224,7 +4330,9 @@ bool _pyGroup::CanClear() if ( IsInStudy() ) return false; - if ( !myCanClearCreationCmd && myCreationCmd->GetMethod() == "GetGroups" ) + if ( !myCanClearCreationCmd && + !myCreationCmd.IsNull() && + myCreationCmd->GetMethod() == "GetGroups" ) { TCollection_AsciiString grIDs = myCreationCmd->GetResultValue(); list< _pyID > idList = myCreationCmd->GetStudyEntries( grIDs ); @@ -4310,6 +4418,7 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand) makeGroupCmd->SetMethod( "MakeGroupByFilter" ); makeGroupCmd->SetArg( 1, name ); makeGroupCmd->SetArg( 2, idSource ); + filter->AddArgCmd( makeGroupCmd ); } } else if ( theCommand->GetMethod() == "SetFilter" ) @@ -4334,8 +4443,8 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand) } } - if ( !filter.IsNull() ) - filter->AddUser( this ); + // if ( !filter.IsNull() ) + // filter->AddUser( this ); theGen->AddMeshAccessorMethod( theCommand ); } @@ -4349,7 +4458,7 @@ void _pyGroup::Process( const Handle(_pyCommand)& theCommand) void _pyGroup::Flush() { if ( !theGen->IsToKeepAllCommands() && - myCreationCmd && !myCanClearCreationCmd ) + !myCreationCmd.IsNull() && !myCanClearCreationCmd ) { myCreationCmd.Nullify(); // this way myCreationCmd won't be cleared } @@ -4364,6 +4473,8 @@ void _pyGroup::Flush() _pyFilter::_pyFilter(const Handle(_pyCommand)& theCreationCmd, const _pyID& newID/*=""*/) :_pyObject(theCreationCmd), myNewID( newID ) { + //myIsPublished = true; // prevent clearing as a not published + theGen->KeepAgrCmds( GetID() ); // ask to fill myArgCmds } //================================================================================ @@ -4396,8 +4507,11 @@ void _pyFilter::Process( const Handle(_pyCommand)& theCommand) theCommand->SetObject( SMESH_2smeshpy::GenName() ); theCommand->SetMethod( "GetFilterFromCriteria" ); - // Clear aFilterManager.CreateFilter() + // Swap "aFilterManager.CreateFilter()" and "smesh.GetFilterFromCriteria(criteria)" GetCreationCmd()->Clear(); + GetCreationCmd()->GetString() = theCommand->GetString(); + theCommand->Clear(); + theCommand->AddDependantCmd( GetCreationCmd() ); } else if ( theCommand->GetMethod() == "SetMesh" ) { @@ -4411,13 +4525,31 @@ void _pyFilter::Process( const Handle(_pyCommand)& theCommand) //================================================================================ /*! - * \brief Set new filter name to the creation command + * \brief Set new filter name to the creation command and to myArgCmds */ //================================================================================ void _pyFilter::Flush() { - if ( !myNewID.IsEmpty() && !GetCreationCmd()->IsEmpty() ) + if ( myNewID.IsEmpty() ) return; + + list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin(); + for ( ; cmd != myArgCmds.end(); ++cmd ) + if ( !(*cmd)->IsEmpty() ) + { + _AString cmdStr = (*cmd)->GetString(); + _AString id = GetID(); + int pos = cmdStr.Search( id ); + if ( pos > 0 ) + { + cmdStr.Remove( pos, id.Length() ); + cmdStr.Insert( pos, myNewID ); + } + (*cmd)->Clear(); + (*cmd)->GetString() = cmdStr; + } + + if ( !GetCreationCmd()->IsEmpty() ) GetCreationCmd()->SetResultValue( myNewID ); } @@ -4427,14 +4559,17 @@ void _pyFilter::Flush() */ //================================================================================ -bool _pyFilter::CanClear() +bool _pyObject::CanClear() { - list< Handle(_pyObject) >::iterator obj = myUsers.begin(); - for ( ; obj != myUsers.end(); ++obj ) - if ( !(*obj)->CanClear() ) - return false; - - return true; + list< Handle(_pyCommand) >::iterator cmd = myArgCmds.begin(); + for ( ; cmd != myArgCmds.end(); ++cmd ) + if ( !(*cmd)->IsEmpty() ) + { + Handle(_pyObject) obj = theGen->FindObject( (*cmd)->GetObject() ); + if ( !obj.IsNull() && !obj->CanClear() ) + return false; + } + return ( !myIsPublished ); } //================================================================================ diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index 32ad5cd94..f5550889b 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -166,6 +166,7 @@ protected: _pyID myID; Handle(_pyCommand) myCreationCmd; std::list< Handle(_pyCommand) > myProcessedCmds; + std::list< Handle(_pyCommand) > myArgCmds; // where this obj is used as an argument bool myIsPublished; void setID(const _pyID& theID); @@ -182,10 +183,11 @@ public: void AddProcessedCmd( const Handle(_pyCommand) & cmd ) { if (myProcessedCmds.empty() || myProcessedCmds.back()!=cmd) myProcessedCmds.push_back( cmd );} std::list< Handle(_pyCommand) >& GetProcessedCmds() { return myProcessedCmds; } + void AddArgCmd( const Handle(_pyCommand) & cmd ) { myArgCmds.push_back( cmd ); } virtual void Process(const Handle(_pyCommand) & cmd) { AddProcessedCmd(cmd); } virtual void Flush() = 0; virtual const char* AccessorMethod() const; - virtual bool CanClear() { return !myIsPublished; } + virtual bool CanClear(); virtual void ClearCommands(); virtual void Free() {} @@ -228,14 +230,15 @@ public: const bool theToKeepAllCommands); Handle(_pyCommand) AddCommand( const _AString& theCommand ); void ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) theCmd2 ); - void SetCommandAfter( Handle(_pyCommand) theCmd, Handle(_pyCommand) theAfterCmd ); - void SetCommandBefore( Handle(_pyCommand) theCmd, Handle(_pyCommand) theBeforeCmd ); + void SetCommandAfter ( Handle(_pyCommand) theCmd, Handle(_pyCommand) theAfterCmd ); + void SetCommandBefore( Handle(_pyCommand) theCmd, Handle(_pyCommand) theBeforeCmd ); Handle(_pyCommand)& GetLastCommand(); std::list< Handle(_pyCommand) >& GetCommands() { return myCommands; } void PlaceSubmeshAfterItsCreation( Handle(_pyCommand) theCmdUsingSubmesh ) const; _pyID GenerateNewID( const _pyID& theID ); void AddObject( Handle(_pyObject)& theObj ); + void CheckObjectIsReCreated( Handle(_pyObject)& theObj ); void SetProxyObject( const _pyID& theID, Handle(_pyObject)& theObj ); Handle(_pyObject) FindObject( const _pyID& theObjID ) const; Handle(_pySubMesh) FindSubMesh( const _pyID& theSubMeshID ); @@ -251,6 +254,7 @@ public: bool IsGeomObject(const _pyID& theObjID) const; bool IsNotPublished(const _pyID& theObjID) const; void ObjectCreationRemoved(const _pyID& theObjID); + void KeepAgrCmds(const _pyID& theObjID) { myKeepAgrCmdsIDs.push_back( theObjID ); } bool IsToKeepAllCommands() const { return myToKeepAllCommands; } void AddExportedMesh(const _AString& file, const ExportedMeshData& mesh ) { myFile2ExportedMesh[ file ] = mesh; } @@ -268,13 +272,14 @@ private: void setNeighbourCommand( Handle(_pyCommand)& theCmd, Handle(_pyCommand)& theOtherCmd, const bool theIsAfter ); - void addFilterUser( Handle(_pyCommand)& theCmd, const Handle(_pyObject)& user ); + //void addFilterUser( Handle(_pyCommand)& theCmd, const Handle(_pyObject)& user ); private: std::map< _pyID, Handle(_pyMesh) > myMeshes; std::map< _pyID, Handle(_pyMeshEditor) > myMeshEditors; std::map< _pyID, Handle(_pyObject) > myObjects; - std::list< Handle(_pyHypothesis) > myHypos; + std::map< _pyID, Handle(_pyHypothesis) > myHypos; + std::list< _pyID > myKeepAgrCmdsIDs; std::list< Handle(_pyCommand) > myCommands; int myNbCommands; Resource_DataMapOfAsciiStringAsciiString& myID2AccessorMethod; @@ -530,9 +535,10 @@ DEFINE_STANDARD_HANDLE (_pySegmentLengthAroundVertexHyp, _pyHypothesis); // ------------------------------------------------------------------------------------- class _pySelfEraser: public _pyObject { + bool myIgnoreOwnCalls; // not to erase only if this obj is used as argument public: - _pySelfEraser(const Handle(_pyCommand)& theCreationCmd) - :_pyObject(theCreationCmd) { myIsPublished = true; } + _pySelfEraser(const Handle(_pyCommand)& theCreationCmd); + void IgnoreOwnCalls() { myIgnoreOwnCalls = true; } virtual void Flush(); DEFINE_STANDARD_RTTI (_pySelfEraser) @@ -567,14 +573,14 @@ public: class _pyFilter: public _pyObject { _pyID myNewID, myMesh; - std::list< Handle(_pyObject) > myUsers; + //std::list< Handle(_pyObject) > myUsers; public: _pyFilter(const Handle(_pyCommand)& theCreationCmd, const _pyID& newID=""); - void AddUser( const Handle(_pyObject)& user) { myUsers.push_back( user ); } + //void AddUser( const Handle(_pyObject)& user) { myUsers.push_back( user ); } virtual void Process( const Handle(_pyCommand)& theCommand); virtual void Flush(); - virtual bool CanClear(); - virtual void Free() { myUsers.clear(); } + //virtual bool CanClear(); + //virtual void Free() { myUsers.clear(); } const _pyID& GetNewID() const { return myNewID; } DEFINE_STANDARD_RTTI (_pyFilter) diff --git a/src/SMESH_I/SMESH_DumpPython.cxx b/src/SMESH_I/SMESH_DumpPython.cxx index c9ca6c870..3a5af32a3 100644 --- a/src/SMESH_I/SMESH_DumpPython.cxx +++ b/src/SMESH_I/SMESH_DumpPython.cxx @@ -36,6 +36,7 @@ #include #include +#include #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -846,6 +847,45 @@ namespace { } return isValidName; } + + //================================================================================ + /*! + * \brief Return Python module names of available plug-ins. + */ + //================================================================================ + + std::vector getPluginNames() + { + std::vector pluginNames; + std::vector< std::string > xmlPaths = SMESH_Gen::GetPluginXMLPaths(); + LDOMParser xmlParser; + for ( size_t i = 0; i < xmlPaths.size(); ++i ) + { + bool error = xmlParser.parse( xmlPaths[i].c_str() ); + if ( error ) + { + TCollection_AsciiString data; + INFOS( xmlParser.GetError(data) ); + continue; + } + // + LDOM_Document xmlDoc = xmlParser.getDocument(); + LDOM_NodeList nodeList = xmlDoc.getElementsByTagName( "meshers-group" ); + for ( int i = 0; i < nodeList.getLength(); ++i ) + { + LDOM_Node node = nodeList.item( i ); + LDOM_Element& elem = (LDOM_Element&) node; + LDOMString idlModule = elem.getAttribute( "idl-module" ); + if ( strlen( idlModule.GetString() ) > 0 ) + pluginNames.push_back( idlModule.GetString() ); + } + } + return pluginNames; + } } //============================================================================= @@ -873,6 +913,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl TCollection_AsciiString aScript; if( isMultiFile ) aScript += "def RebuildData(theStudy):"; + aScript += "\n\t"; if ( isPublished ) aScript += aSMESHGen + " = smeshBuilder.New(theStudy)\n\t"; @@ -881,17 +922,6 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl aScript += helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()\n\t"; aScript += helper + "aMeasurements = " + aSMESHGen + ".CreateMeasurements()\n\t"; - // This is not needed since entering a plug-in system to smesh.py - // import python files corresponding to plugins - // set moduleNameSet; - // map::iterator hyp_creator = myHypCreatorMap.begin(); - // for ( ; hyp_creator != myHypCreatorMap.end(); ++hyp_creator ) { - // string moduleName = hyp_creator->second->GetModuleName(); - // bool newModule = moduleNameSet.insert( moduleName ).second; - // if ( newModule ) - // aScript += helper + "\n\t" + "from salome." + (char*) moduleName.c_str() + " import " + (char*) moduleName.c_str() +"Builder"; - // } - // Dump trace of restored study if (theSavedTrace.Length() > 0) { // For the convertion of IDL API calls -> smeshBuilder.py API, "smesh" standing for SMESH_Gen @@ -924,6 +954,30 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl aScript += helper + "\n" + aNewLines; } + // import python files corresponding to plugins if they are used in aScript + { + TCollection_AsciiString importStr; + std::vector pluginNames = getPluginNames(); + for ( size_t i = 0; i < pluginNames.size(); ++i ) + { + // Convert access to plugin members: + // e.g. StdMeshers.QUAD_REDUCED -> StdMeshersBuilder.QUAD_REDUCED + TCollection_AsciiString pluginAccess = (pluginNames[i] + ".").c_str() ; + int iFrom = 1, iPos; + while (( iPos = aScript.Location( pluginAccess, iFrom, aScript.Length() ))) + { + aScript.Insert( iPos + pluginNames[i].size(), "Builder" ); + iFrom = iPos + pluginNames[i].size() + 8; + } + // if any plugin member is used, import the plugin + if ( iFrom > 1 ) + importStr += ( helper + "\n\t" + "from salome." + (char*) pluginNames[i].c_str() + + " import " + (char*) pluginNames[i].c_str() +"Builder" ); + } + if ( !importStr.IsEmpty() ) + aScript.Insert( 1, importStr + "\n\t" ); + } + // Convert IDL API calls into smeshBuilder.py API. // Some objects are wrapped with python classes and // Resource_DataMapOfAsciiStringAsciiString holds methods returning wrapped objects diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index b7b0e53e1..e52d29b55 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -3070,8 +3070,7 @@ CORBA::Boolean Filter_i::GetCriteria( SMESH::Filter::Criteria_out theCriteria ) //======================================================================= CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria ) { - if ( myPredicate != 0 ) - myPredicate->UnRegister(); + SetPredicate( SMESH::Predicate::_nil() ); SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i(); FilterManager_ptr aFilterMgr = aFilter->_this(); @@ -3424,6 +3423,8 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria SetPredicate( aResPredicate ); + aResPredicate->UnRegister(); + return !aResPredicate->_is_nil(); } diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index f393b918c..4a4fc1499 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -93,7 +93,7 @@ #include "SMESH_Mesh_i.hxx" #include "SMESH_PreMeshInfo.hxx" #include "SMESH_PythonDump.hxx" -#include "memoire.h" +//#include "memoire.h" #include CORBA_SERVER_HEADER(SMESH_Group) #include CORBA_SERVER_HEADER(SMESH_Filter) @@ -360,10 +360,10 @@ SMESH_Gen_i::~SMESH_Gen_i() //============================================================================= SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName, const char* theLibName) - throw (SALOME::SALOME_Exception) + throw (SALOME::SALOME_Exception) { /* It's Need to tranlate lib name for WIN32 or X platform */ - char* aPlatformLibName = 0; + std::string aPlatformLibName; if ( theLibName && theLibName[0] != '\0' ) { int libNameLen = strlen(theLibName); @@ -374,39 +374,24 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName { //the old format #ifdef WNT - aPlatformLibName = new char[libNameLen - 1]; - aPlatformLibName[0] = '\0'; - aPlatformLibName = strncat( aPlatformLibName, theLibName+3, libNameLen-6 ); - aPlatformLibName = strcat( aPlatformLibName, ".dll" ); - aPlatformLibName[libNameLen - 2] = '\0'; + aPlatformLibName = std::string( theLibName+3, libNameLen-6 ) + ".dll"; #else - aPlatformLibName = new char[ libNameLen + 1]; - aPlatformLibName[0] = '\0'; - aPlatformLibName = strcat( aPlatformLibName, theLibName ); - aPlatformLibName[libNameLen] = '\0'; + aPlatformLibName = theLibName; #endif } else { //try to use new format #ifdef WNT - aPlatformLibName = new char[ libNameLen + 5 ]; - aPlatformLibName[0] = '\0'; - aPlatformLibName = strcat( aPlatformLibName, theLibName ); - aPlatformLibName = strcat( aPlatformLibName, ".dll" ); + aPlatformLibName = theLibName + ".dll"; #else - aPlatformLibName = new char[ libNameLen + 7 ]; - aPlatformLibName[0] = '\0'; - aPlatformLibName = strcat( aPlatformLibName, "lib" ); - aPlatformLibName = strcat( aPlatformLibName, theLibName ); - aPlatformLibName = strcat( aPlatformLibName, ".so" ); + aPlatformLibName = "lib" + std::string( theLibName ) + ".so"; #endif } } - Unexpect aCatch(SALOME_SalomeException); - if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << aPlatformLibName/*theLibName*/); + if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << aPlatformLibName); // create a new hypothesis object servant SMESH_Hypothesis_i* myHypothesis_i = 0; @@ -419,7 +404,7 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName { // load plugin library if(MYDEBUG) MESSAGE("Loading server meshers plugin library ..."); - LibHandle libHandle = LoadLib( aPlatformLibName/*theLibName*/ ); + LibHandle libHandle = LoadLib( aPlatformLibName.c_str() ); if (!libHandle) { // report any error, if occured @@ -458,21 +443,18 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName if(MYDEBUG) MESSAGE("Create Hypothesis " << theHypName); myHypothesis_i = myHypCreatorMap[string(theHypName)]->Create(myPoa, GetCurrentStudyID(), &myGen); - myHypothesis_i->SetLibName(aPlatformLibName/*theLibName*/); // for persistency assurance + myHypothesis_i->SetLibName(aPlatformLibName.c_str()); // for persistency assurance } catch (SALOME_Exception& S_ex) { THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); } - if ( aPlatformLibName ) - delete[] aPlatformLibName; - if (!myHypothesis_i) return hypothesis_i._retn(); // activate the CORBA servant of hypothesis - hypothesis_i = SMESH::SMESH_Hypothesis::_narrow( myHypothesis_i->_this() ); + hypothesis_i = myHypothesis_i->_this(); int nextId = RegisterObject( hypothesis_i ); if(MYDEBUG) { MESSAGE( "Add hypo to map with id = "<< nextId ); } else { nextId = 0; } // avoid "unused variable" warning in release mode @@ -1712,7 +1694,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject ) throw ( SALOME::SALOME_Exception ) { - MEMOSTAT; + //MEMOSTAT; Unexpect aCatch(SALOME_SalomeException); if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Compute" ); @@ -3957,7 +3939,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, // Get temporary files location TCollection_AsciiString tmpDir = - isMultiFile ? TCollection_AsciiString( ( char* )theURL ) : ( char* )SALOMEDS_Tool::GetTmpDir().c_str(); + ( char* )( isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir().c_str() ); INFOS( "THE URL++++++++++++++" ); INFOS( theURL ); @@ -3969,12 +3951,13 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, tmpDir.ToCString(), isMultiFile ); TCollection_AsciiString aStudyName( "" ); - if ( isMultiFile ) - aStudyName = ( (char*)SALOMEDS_Tool::GetNameFromPath( myCurrentStudy->URL() ).c_str() ); - + if ( isMultiFile ) { + CORBA::String_var url = myCurrentStudy->URL(); + aStudyName = (char*)SALOMEDS_Tool::GetNameFromPath( url.in() ).c_str(); + } // Set names of temporary files - TCollection_AsciiString filename = tmpDir + aStudyName + TCollection_AsciiString( "_SMESH.hdf" ); - TCollection_AsciiString meshfile = tmpDir + aStudyName + TCollection_AsciiString( "_SMESH_Mesh.med" ); + TCollection_AsciiString filename = tmpDir + aStudyName + "_SMESH.hdf"; + TCollection_AsciiString meshfile = tmpDir + aStudyName + "_SMESH_Mesh.med"; int size; HDFfile* aFile; @@ -4430,21 +4413,21 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, // --> try to find SUB-MESHES containers for each type of submesh for ( int j = GetSubMeshOnVertexTag(); j <= GetSubMeshOnCompoundTag(); j++ ) { - char name_meshgroup[ 30 ]; + const char* name_meshgroup; if ( j == GetSubMeshOnVertexTag() ) - strcpy( name_meshgroup, "SubMeshes On Vertex" ); + name_meshgroup = "SubMeshes On Vertex"; else if ( j == GetSubMeshOnEdgeTag() ) - strcpy( name_meshgroup, "SubMeshes On Edge" ); + name_meshgroup = "SubMeshes On Edge"; else if ( j == GetSubMeshOnWireTag() ) - strcpy( name_meshgroup, "SubMeshes On Wire" ); + name_meshgroup = "SubMeshes On Wire"; else if ( j == GetSubMeshOnFaceTag() ) - strcpy( name_meshgroup, "SubMeshes On Face" ); + name_meshgroup = "SubMeshes On Face"; else if ( j == GetSubMeshOnShellTag() ) - strcpy( name_meshgroup, "SubMeshes On Shell" ); + name_meshgroup = "SubMeshes On Shell"; else if ( j == GetSubMeshOnSolidTag() ) - strcpy( name_meshgroup, "SubMeshes On Solid" ); + name_meshgroup = "SubMeshes On Solid"; else if ( j == GetSubMeshOnCompoundTag() ) - strcpy( name_meshgroup, "SubMeshes On Compound" ); + name_meshgroup = "SubMeshes On Compound"; // try to get submeshes container HDF group if ( aTopGroup->ExistInternalObject( name_meshgroup ) ) { @@ -4458,9 +4441,9 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, // identify submesh char name_submeshgroup[ HDF_NAME_MAX_LEN+1 ]; aGroup->InternalObjectIndentify( k, name_submeshgroup ); - if ( string( name_submeshgroup ).substr( 0, 7 ) == string( "SubMesh" ) ) { + if ( strncmp( name_submeshgroup, "SubMesh", 7 ) == 0 ) { // --> get submesh id - int subid = atoi( string( name_submeshgroup ).substr( 7 ).c_str() ); + int subid = atoi( name_submeshgroup + 7 ); if ( subid <= 0 ) continue; // open submesh HDF group @@ -4510,7 +4493,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, char name_dataset[ HDF_NAME_MAX_LEN+1 ]; aSubSubGroup->InternalObjectIndentify( l, name_dataset ); // check if it is an algorithm - if ( string( name_dataset ).substr( 0, 4 ) == string( "Algo" ) ) { + if ( strncmp( name_dataset, "Algo", 4 ) == 0 ) { aDataset = new HDFdataset( name_dataset, aSubSubGroup ); aDataset->OpenOnDisk(); size = aDataset->GetSize(); @@ -4675,8 +4658,10 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, if ( SMESH_GroupOnFilter_i* aFilterGroup = dynamic_cast< SMESH_GroupOnFilter_i*>( aGroupImpl )) + { aFilterGroup->SetFilter( filter ); - + filter->UnRegister(); + } SMESHDS_GroupBase* aGroupBaseDS = aGroupImpl->GetGroupDS(); if ( !aGroupBaseDS ) continue; @@ -4792,11 +4777,11 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, // creation of tree nodes for all data objects in the study // to support tree representation customization and drag-n-drop: - SALOMEDS::UseCaseBuilder_var useCaseBuilder = theComponent->GetStudy()->GetUseCaseBuilder(); + SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = theComponent->GetStudy()->GetUseCaseBuilder(); if ( !useCaseBuilder->IsUseCaseNode( theComponent ) ) { useCaseBuilder->SetRootCurrent(); useCaseBuilder->Append( theComponent ); // component object is added as the top level item - SALOMEDS::ChildIterator_var it = theComponent->GetStudy()->NewChildIterator( theComponent ); + SALOMEDS::ChildIterator_wrap it = theComponent->GetStudy()->NewChildIterator( theComponent ); for (it->InitEx(true); it->More(); it->Next()) { useCaseBuilder->AppendTo( it->Value()->GetFather(), it->Value() ); } @@ -5015,8 +5000,8 @@ char* SMESH_Gen_i::getVersion() // Is used in the drag-n-drop functionality. //================================================================================= void SMESH_Gen_i::Move( const SMESH::sobject_list& what, - SALOMEDS::SObject_ptr where, - CORBA::Long row ) + SALOMEDS::SObject_ptr where, + CORBA::Long row ) { if ( CORBA::is_nil( where ) ) return; diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 403fb7ee5..f6531cf1a 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -587,8 +587,8 @@ public: // Move objects to the specified position void Move( const SMESH::sobject_list& what, - SALOMEDS::SObject_ptr where, - CORBA::Long row ); + SALOMEDS::SObject_ptr where, + CORBA::Long row ); private: // Create hypothesis of given type diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index fc50bc409..85ab4def0 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -260,13 +260,34 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, const bool theSelectable = true) { SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( theStudy, theIOR ); - SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); SALOMEDS::UseCaseBuilder_var useCaseBuilder = theStudy->GetUseCaseBuilder(); + SALOMEDS::SObject_wrap objAfter; if ( SO->_is_nil() ) { - if ( theTag == 0 ) + if ( theTag == 0 ) { SO = aStudyBuilder->NewObject( theFatherObject ); - else if ( !theFatherObject->FindSubObject( theTag, SO.inout() )) + } else if ( !theFatherObject->FindSubObject( theTag, SO.inout() )) { SO = aStudyBuilder->NewObjectToTag( theFatherObject, theTag ); + + // define the next tag after given one in the data tree to insert SOobject + std::string anEntry; + int last2Pnt_pos = -1; + int tagAfter = -1; + CORBA::String_var entry; + SALOMEDS::SObject_wrap curObj; + SALOMEDS::UseCaseIterator_var anUseCaseIter = useCaseBuilder->GetUseCaseIterator(theFatherObject); + for ( ; anUseCaseIter->More(); anUseCaseIter->Next() ) { + curObj = anUseCaseIter->Value(); + entry = curObj->GetID(); + anEntry = entry.in(); + last2Pnt_pos = anEntry.rfind( ":" ); + tagAfter = atoi( anEntry.substr( last2Pnt_pos+1 ).c_str() ); + if ( tagAfter > theTag ) { + objAfter = curObj; + break; + } + } + } } SALOMEDS::GenericAttribute_wrap anAttr; @@ -275,6 +296,10 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR ); SALOMEDS::AttributeIOR_wrap iorAttr = anAttr; iorAttr->SetValue( objStr.in() ); + // UnRegister() !!! + SALOME::GenericObj_var genObj = SALOME::GenericObj::_narrow( theIOR ); + if ( !genObj->_is_nil() ) + genObj->UnRegister(); } if ( thePixMap ) { anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" ); @@ -289,7 +314,11 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, // add object to the use case tree // (to support tree representation customization and drag-n-drop) - useCaseBuilder->AppendTo( SO->GetFather(), SO ); + if ( !CORBA::is_nil( objAfter ) ) { + useCaseBuilder->InsertBefore( SO, objAfter ); // insert at given tag + } else if ( !useCaseBuilder->IsUseCaseNode( SO ) ) { + useCaseBuilder->AppendTo( theFatherObject, SO ); // append to the end of list + } return SO._retn(); } @@ -1179,7 +1208,7 @@ char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject) { CORBA::String_var aResult(""); - SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy,theObject); + SALOMEDS::SObject_wrap aSObj = ObjectToSObject( myCurrentStudy, theObject ); if ( !aSObj->_is_nil() ) { SALOMEDS::GenericAttribute_wrap attr; @@ -1189,6 +1218,5 @@ char* SMESH_Gen_i::GetParameters(CORBA::Object_ptr theObject) aResult = strAttr->Value(); } } - - return CORBA::string_dup( aResult.in() ); + return aResult._retn(); } diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index d5c06b37c..76dae4673 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -101,10 +101,6 @@ SMESH_GroupOnFilter_i::SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA, SMESH_GroupBase_i::~SMESH_GroupBase_i() { - MESSAGE("~SMESH_GroupBase_i; this = "<removeGroup(myLocalID); - if ( myPreMeshInfo ) delete myPreMeshInfo; myPreMeshInfo = NULL; } @@ -156,15 +152,16 @@ void SMESH_GroupBase_i::SetName( const char* theName ) aGroup->SetName(theName); // Update group name in a study - SMESH_Gen_i* aGen = myMeshServant->GetGen(); - SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy(); - SALOMEDS::SObject_var anSO = aGen->ObjectToSObject( aStudy, _this() ); + SMESH_Gen_i* aGen = myMeshServant->GetGen(); + SALOMEDS::Study_var aStudy = aGen->GetCurrentStudy(); + SMESH::SMESH_GroupBase_var aGrp = _this(); + SALOMEDS::SObject_var anSO = aGen->ObjectToSObject( aStudy, aGrp ); if ( !anSO->_is_nil() ) { aGen->SetName( anSO, theName ); // Update Python script - TPythonDump() << _this() << ".SetName( '" << theName << "' )"; + TPythonDump() << anSO << ".SetName( '" << theName << "' )"; } } @@ -259,7 +256,7 @@ void SMESH_Group_i::Clear() myPreMeshInfo->FullLoadFromFile(); // Update Python script - TPythonDump() << _this() << ".Clear()"; + TPythonDump() << SMESH::SMESH_Group_var(_this()) << ".Clear()"; // Clear the group SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); @@ -300,7 +297,7 @@ CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs ) myPreMeshInfo->FullLoadFromFile(); // Update Python script - TPythonDump() << "nbAdd = " << _this() << ".Add( " << theIDs << " )"; + TPythonDump() << "nbAdd = " << SMESH::SMESH_Group_var(_this()) << ".Add( " << theIDs << " )"; // Add elements to the group SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); @@ -329,7 +326,8 @@ CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs ) myPreMeshInfo->FullLoadFromFile(); // Update Python script - TPythonDump() << "nbDel = " << _this() << ".Remove( " << theIDs << " )"; + TPythonDump() << "nbDel = " << SMESH::SMESH_Group_var(_this()) + << ".Remove( " << theIDs << " )"; // Remove elements from the group SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); @@ -382,8 +380,9 @@ AddByPredicate( SMESH::Predicate_ptr thePredicate ) myPreMeshInfo->FullLoadFromFile(); if(SMESH::Predicate_i* aPredicate = SMESH::GetPredicate(thePredicate)){ - TPythonDump()<<_this()<<".AddByPredicate("<FullLoadFromFile(); if(SMESH::Predicate_i* aPredicate = SMESH::GetPredicate(thePredicate)){ - TPythonDump()<<_this()<<".RemoveByPredicate("<FullLoadFromFile(); TPythonDump pd; - long nbAdd = 0; + long prevNb = Size(); SMESHDS_Group* aGroupDS = dynamic_cast( GetGroupDS() ); if (aGroupDS) { - SMESH::long_array_var anIds; - SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow(theSource); - SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow(theSource); - SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow(theSource); - SMESH::Filter_var filter = SMESH::Filter::_narrow(theSource); - if ( !group->_is_nil()) - anIds = group->GetType()==GetType() ? theSource->GetIDs() : new SMESH::long_array(); - else if ( !mesh->_is_nil() ) - anIds = mesh->GetElementsByType( GetType() ); - else if ( !submesh->_is_nil()) - anIds = submesh->GetElementsByType( GetType() ); - else if ( !filter->_is_nil() ) { - filter->SetMesh( GetMeshServant()->_this() ); - anIds = filter->GetElementType()==GetType() ? theSource->GetIDs() : new SMESH::long_array(); - } - else - anIds = theSource->GetIDs(); - for ( int i = 0, total = anIds->length(); i < total; i++ ) { - if ( aGroupDS->Add((int)anIds[i]) ) nbAdd++; - } + SMDS_ElemIteratorPtr elemIt = SMESH_Mesh_i::GetElements( theSource, GetType() ); + while ( elemIt->more() ) + aGroupDS->SMDSGroup().Add( elemIt->next() ); } // Update Python script - pd << "nbAdd = " << _this() << ".AddFrom( " << theSource << " )"; + pd << "nbAdd = " << SMESH::SMESH_Group_var(_this()) << ".AddFrom( " << theSource << " )"; - return nbAdd; + return prevNb - Size(); } //============================================================================= @@ -583,7 +566,7 @@ SMESH::SMESH_Mesh_ptr SMESH_GroupBase_i::GetMesh() { SMESH::SMESH_Mesh_var aMesh; if ( myMeshServant ) - aMesh = SMESH::SMESH_Mesh::_narrow( myMeshServant->_this() ); + aMesh = myMeshServant->_this(); return aMesh._retn(); } @@ -640,7 +623,9 @@ void SMESH_GroupBase_i::SetColor(const SALOMEDS::Color& color) if ( oldColor != aQColor ) { aGroupDS->SetColor(aQColor); - TPythonDump()<<_this()<<".SetColor( SALOMEDS.Color( "<SetColorGroup(color); - TPythonDump()<<_this()<<".SetColorNumber( "<( GetGroupDS() )) grDS->SetPredicate( GetPredicate( myFilter )); - TPythonDump()<< _this() <<".SetFilter( "<length() > 0 && theTypes[0] == SMESH::NODE; } +static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Controls::NumericalFunctorPtr theFunctor) +{ + double value = 0; + + if ( !CORBA::is_nil( theSource ) ) { + const SMESHDS_Mesh* aMesh = getMesh( theSource ); + if ( aMesh ) { + theFunctor->SetMesh( aMesh ); + + SMESH::long_array_var anElementsId = theSource->GetIDs(); + for (int i = 0; i < anElementsId->length(); i++) { + value += theFunctor->GetValue( anElementsId[i] ); + } + } + } + return value; +} + //======================================================================= // name : MinDistance // Purpose : minimal distance between two given entities @@ -257,3 +276,30 @@ SMESH::Measure Measurements_i::BoundingBox (const SMESH::ListOfIDSources& theSou return aMeasure; } + +//======================================================================= +// name : Length +// Purpose : sum of length of 1D elements of the source +//======================================================================= +double Measurements_i::Length(SMESH::SMESH_IDSource_ptr theSource) +{ + return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Length()) ); +} + +//======================================================================= +// name : Area +// Purpose : sum of area of 2D elements of the source +//======================================================================= +double Measurements_i::Area(SMESH::SMESH_IDSource_ptr theSource) +{ + return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Area()) ); +} + +//======================================================================= +// name : Volume +// Purpose : sum of volume of 3D elements of the source +//======================================================================= +double Measurements_i::Volume(SMESH::SMESH_IDSource_ptr theSource) +{ + return getNumericalValue( theSource, SMESH::Controls::NumericalFunctorPtr(new SMESH::Controls::Volume()) ); +} diff --git a/src/SMESH_I/SMESH_Measurements_i.hxx b/src/SMESH_I/SMESH_Measurements_i.hxx index 0f1bbadac..f7135ae44 100644 --- a/src/SMESH_I/SMESH_Measurements_i.hxx +++ b/src/SMESH_I/SMESH_Measurements_i.hxx @@ -57,6 +57,22 @@ namespace SMESH * common bounding box of entities */ SMESH::Measure BoundingBox(const SMESH::ListOfIDSources& theSources); + + + /*! + * sum of length of 1D elements of the source + */ + double Length(SMESH::SMESH_IDSource_ptr theSource); + + /*! + * sum of area of 2D elements of the source + */ + double Area(SMESH::SMESH_IDSource_ptr); + + /*! + * sum of volume of 3D elements of the source + */ + double Volume(SMESH::SMESH_IDSource_ptr); }; } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 25750af0e..7392590f4 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -453,7 +454,7 @@ SMESH_MeshEditor_i::SMESH_MeshEditor_i(SMESH_Mesh_i* theMesh, bool isPreview): SMESH_MeshEditor_i::~SMESH_MeshEditor_i() { - deleteAuxIDSources(); + //deleteAuxIDSources(); delete myPreviewMesh; myPreviewMesh = 0; delete myPreviewEditor; myPreviewEditor = 0; } @@ -711,10 +712,12 @@ SMESH::ComputeError* SMESH_MeshEditor_i::GetLastError() //======================================================================= //function : MakeIDSource -//purpose : Wrap a sequence of ids in a SMESH_IDSource +//purpose : Wrap a sequence of ids in a SMESH_IDSource. +// Call UnRegister() as you fininsh using it!! //======================================================================= -struct SMESH_MeshEditor_i::_IDSource : public POA_SMESH::SMESH_IDSource +struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource, + public virtual SALOME::GenericObj_i { SMESH::long_array _ids; SMESH::ElementType _type; @@ -745,14 +748,16 @@ struct SMESH_MeshEditor_i::_IDSource : public POA_SMESH::SMESH_IDSource SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids, SMESH::ElementType type) { - if ( myAuxIDSources.size() > 10 ) - deleteAuxIDSources(); + // if ( myAuxIDSources.size() > 10 ) { + // delete myAuxIDSources.front(); + // myAuxIDSources.pop_front(); + // } _IDSource* idSrc = new _IDSource; idSrc->_mesh = myMesh_i->_this(); idSrc->_ids = ids; idSrc->_type = type; - myAuxIDSources.push_back( idSrc ); + //myAuxIDSources.push_back( idSrc ); SMESH::SMESH_IDSource_var anIDSourceVar = idSrc->_this(); @@ -776,13 +781,13 @@ CORBA::Long* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idS return 0; } -void SMESH_MeshEditor_i::deleteAuxIDSources() -{ - std::list< _IDSource* >::iterator idSrcIt = myAuxIDSources.begin(); - for ( ; idSrcIt != myAuxIDSources.end(); ++idSrcIt ) - delete *idSrcIt; - myAuxIDSources.clear(); -} +// void SMESH_MeshEditor_i::deleteAuxIDSources() +// { +// std::list< _IDSource* >::iterator idSrcIt = myAuxIDSources.begin(); +// for ( ; idSrcIt != myAuxIDSources.end(); ++idSrcIt ) +// delete *idSrcIt; +// myAuxIDSources.clear(); +// } //============================================================================= /*! diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index ec6ae3b84..e74df3788 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -1097,8 +1097,8 @@ private: //!< fields // temporary IDSources struct _IDSource; - std::list< _IDSource* > myAuxIDSources; - void deleteAuxIDSources(); + // std::list< _IDSource* > myAuxIDSources; + // void deleteAuxIDSources(); }; #endif diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 41cfc153c..812d3c0cd 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -113,11 +113,13 @@ SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA, : SALOME::GenericObj_i( thePOA ) { MESSAGE("SMESH_Mesh_i"); - _impl = NULL; - _gen_i = gen_i; - _id = _idGenerator++; - _studyId = studyId; - _preMeshInfo = NULL; + _impl = NULL; + _gen_i = gen_i; + _id = _idGenerator++; + _studyId = studyId; + _editor = NULL; + _previewEditor = NULL; + _preMeshInfo = NULL; } //============================================================================= @@ -135,10 +137,8 @@ SMESH_Mesh_i::~SMESH_Mesh_i() for (itGr = _mapGroups.begin(); itGr != _mapGroups.end(); itGr++) if (SMESH_GroupBase_i* aGroup = SMESH::DownCast(itGr->second)) { - // _impl->RemoveGroup() is called by ~SMESH_GroupBase_i() (PAL6331) - //_impl->RemoveGroup( aGroup->GetLocalID() ); - aGroup->myMeshServant = 0; aGroup->UnRegister(); + SMESH::SMESH_GroupBase_var( itGr->second ); } _mapGroups.clear(); @@ -148,18 +148,24 @@ SMESH_Mesh_i::~SMESH_Mesh_i() if ( SMESH_subMesh_i* aSubMesh = SMESH::DownCast( itSM->second )) { aSubMesh->UnRegister(); + SMESH::SMESH_subMesh_var( itSM->second ); } _mapSubMeshIor.clear(); - // destroy hypotheses + // destroy hypotheses. _mapHypo contains all hyps ever been assigned map::iterator itH; - for ( itH = _mapHypo.begin(); itH != _mapHypo.end(); itH++ ) - if ( SMESH_Hypothesis_i* aHypo = SMESH::DownCast( itH->second )) - { - aHypo->UnRegister(); - } + for ( itH = _mapHypo.begin(); itH != _mapHypo.end(); itH++ ) { + if ( SMESH_Hypothesis_i* hyp_i = SMESH::DownCast( itH->second )) + if ( SMESH_Hypothesis * smHyp = _impl->GetHypothesis( itH->first )) + if ( _impl->GetMeshDS()->IsUsedHypothesis( smHyp )) + hyp_i->UnRegister(); + + SMESH::SMESH_Hypothesis_var( itH->second ); // decref CORBA object + } _mapHypo.clear(); + delete _editor; _editor = NULL; + delete _previewEditor; _previewEditor = NULL; delete _impl; _impl = NULL; delete _preMeshInfo; _preMeshInfo = NULL; } @@ -185,7 +191,8 @@ void SMESH_Mesh_i::SetShape( GEOM::GEOM_Object_ptr theShapeObject ) THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); } // to track changes of GEOM groups - addGeomGroupData( theShapeObject, _this() ); + SMESH::SMESH_Mesh_var mesh = _this(); + addGeomGroupData( theShapeObject, mesh ); } //================================================================================ @@ -275,7 +282,7 @@ void SMESH_Mesh_i::Clear() throw (SALOME::SALOME_Exception) } _impl->GetMeshDS()->Modified(); - TPythonDump() << _this() << ".Clear()"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".Clear()"; } //================================================================================ @@ -299,7 +306,7 @@ void SMESH_Mesh_i::ClearSubMesh(CORBA::Long ShapeID) } _impl->GetMeshDS()->Modified(); - TPythonDump() << _this() << ".ClearSubMesh( " << ShapeID << " )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ClearSubMesh( " << ShapeID << " )"; } //============================================================================= @@ -348,7 +355,7 @@ static SMESH::ComputeError* ConvertComputeError( SMESH_ComputeErrorPtr errorPtr } else { - errVar->code = ConvertDriverMEDReadStatus( errorPtr->myName ); + errVar->code = ConvertDriverMEDReadStatus( errorPtr->myName ); errVar->comment = errorPtr->myComment.c_str(); } return errVar._retn(); @@ -386,6 +393,9 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) _medFileInfo = new SMESH::MedFileInfo(); _medFileInfo->fileName = theFileName; _medFileInfo->fileSize = 0; + _medFileInfo->major = major; + _medFileInfo->minor = minor; + _medFileInfo->release = release; #ifdef WIN32 struct _stati64 d; if ( ::_stati64( theFileName, &d ) != -1 ) @@ -394,9 +404,6 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName ) if ( ::stat64( theFileName, &d ) != -1 ) #endif _medFileInfo->fileSize = d.st_size; - _medFileInfo->major = major; - _medFileInfo->minor = minor; - _medFileInfo->release = release; return ConvertDriverMEDReadStatus(status); } @@ -438,7 +445,7 @@ SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportCGNSFile( const char* theFileNa char* SMESH_Mesh_i::GetVersionString(SMESH::MED_VERSION version, CORBA::Short nbDigits) { string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(MED::EVersion(version), - nbDigits); + nbDigits); return CORBA::string_dup( ver.c_str() ); } @@ -577,21 +584,24 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr SMESH_Hypothesis::Hypothesis_Status status = addHypothesis( aSubShapeObject, anHyp ); + SMESH::SMESH_Mesh_var mesh( _this() ); if ( !SMESH_Hypothesis::IsStatusFatal(status) ) - _gen_i->AddHypothesisToShape(_gen_i->GetCurrentStudy(), _this(), - aSubShapeObject, anHyp ); - + { + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); + _gen_i->AddHypothesisToShape( study, mesh, aSubShapeObject, anHyp ); + } if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status ); // Update Python script - //if(_impl->HasShapeToMesh()) { - TPythonDump() << "status = " << _this() << ".AddHypothesis( " + //if(_impl->HasShapeToMesh()) + { + TPythonDump() << "status = " << mesh << ".AddHypothesis( " << aSubShapeObject << ", " << anHyp << " )"; - // } + } // else { - // TPythonDump() << "status = " << _this() << ".AddHypothesis( "<< anHyp << " )"; + // TPythonDump() << "status = " << mesh << ".AddHypothesis( "<< anHyp << " )"; // } - + return ConvertHypothesisStatus(status); } @@ -602,19 +612,16 @@ SMESH::Hypothesis_Status SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr //============================================================================= SMESH_Hypothesis::Hypothesis_Status - SMESH_Mesh_i::addHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, - SMESH::SMESH_Hypothesis_ptr anHyp) +SMESH_Mesh_i::addHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, + SMESH::SMESH_Hypothesis_ptr anHyp) { if(MYDEBUG) MESSAGE("addHypothesis"); - if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh()) - THROW_SALOME_CORBA_EXCEPTION("bad Sub-shape reference", - SALOME::BAD_PARAM); + if (CORBA::is_nil( aSubShapeObject ) && HasShapeToMesh()) + THROW_SALOME_CORBA_EXCEPTION("bad Sub-shape reference",SALOME::BAD_PARAM); - SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp); - if (CORBA::is_nil(myHyp)) - THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", - SALOME::BAD_PARAM); + if (CORBA::is_nil( anHyp )) + THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference",SALOME::BAD_PARAM); SMESH_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK; try @@ -626,16 +633,16 @@ SMESH_Hypothesis::Hypothesis_Status else myLocSubShape = _impl->GetShapeToMesh(); - int hypId = myHyp->GetId(); + const int hypId = anHyp->GetId(); status = _impl->AddHypothesis(myLocSubShape, hypId); if ( !SMESH_Hypothesis::IsStatusFatal(status) ) { - _mapHypo[hypId] = SMESH::SMESH_Hypothesis::_duplicate( myHyp ); - _mapHypo[hypId]->Register(); + _mapHypo[hypId] = SMESH::SMESH_Hypothesis::_duplicate( anHyp ); + anHyp->Register(); // assure there is a corresponding submesh if ( !_impl->IsMainShape( myLocSubShape )) { int shapeId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape ); if ( _mapSubMesh_i.find( shapeId ) == _mapSubMesh_i.end() ) - createSubMesh( aSubShapeObject ); + SMESH::SMESH_subMesh_var( createSubMesh( aSubShapeObject )); } } } @@ -654,28 +661,27 @@ SMESH_Hypothesis::Hypothesis_Status SMESH::Hypothesis_Status SMESH_Mesh_i::RemoveHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_Hypothesis_ptr anHyp) - throw(SALOME::SALOME_Exception) + throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->ForgetOrLoad(); SMESH_Hypothesis::Hypothesis_Status status = removeHypothesis( aSubShapeObject, anHyp ); + SMESH::SMESH_Mesh_var mesh = _this(); if ( !SMESH_Hypothesis::IsStatusFatal(status) ) - _gen_i->RemoveHypothesisFromShape(_gen_i->GetCurrentStudy(), _this(), - aSubShapeObject, anHyp ); - - // Update Python script - // Update Python script - if(_impl->HasShapeToMesh()) { - TPythonDump() << "status = " << _this() << ".RemoveHypothesis( " - << aSubShapeObject << ", " << anHyp << " )"; + { + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); + _gen_i->RemoveHypothesisFromShape( study, mesh, aSubShapeObject, anHyp ); } - else { - TPythonDump() << "status = " << _this() << ".RemoveHypothesis( " + // Update Python script + if(_impl->HasShapeToMesh()) + TPythonDump() << "status = " << mesh << ".RemoveHypothesis( " + << aSubShapeObject << ", " << anHyp << " )"; + else + TPythonDump() << "status = " << mesh << ".RemoveHypothesis( " << anHyp << " )"; - } return ConvertHypothesisStatus(status); } @@ -691,13 +697,11 @@ SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, SMESH::SMESH_Hypothesis_ptr anHyp) { if(MYDEBUG) MESSAGE("removeHypothesis()"); - // **** proposer liste de sub-shape (selection multiple) - if (CORBA::is_nil(aSubShapeObject) && HasShapeToMesh()) + if (CORBA::is_nil( aSubShapeObject ) && HasShapeToMesh()) THROW_SALOME_CORBA_EXCEPTION("bad Sub-shape reference", SALOME::BAD_PARAM); - SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow(anHyp); - if (CORBA::is_nil(myHyp)) + if (CORBA::is_nil( anHyp )) THROW_SALOME_CORBA_EXCEPTION("bad hypothesis reference", SALOME::BAD_PARAM); SMESH_Hypothesis::Hypothesis_Status status = SMESH_Hypothesis::HYP_OK; @@ -705,15 +709,18 @@ SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, { TopoDS_Shape myLocSubShape; //use PseudoShape in case if mesh has no shape - if(HasShapeToMesh()) - myLocSubShape = _gen_i->GeomObjectToShape( aSubShapeObject); + if( _impl->HasShapeToMesh() ) + myLocSubShape = _gen_i->GeomObjectToShape( aSubShapeObject ); else myLocSubShape = _impl->GetShapeToMesh(); - int hypId = myHyp->GetId(); + const int hypId = anHyp->GetId(); status = _impl->RemoveHypothesis(myLocSubShape, hypId); -// if ( !SMESH_Hypothesis::IsStatusFatal(status) ) EAP: hyp can be used on many sub-shapes -// _mapHypo.erase( hypId ); + if ( !SMESH_Hypothesis::IsStatusFatal(status) ) + { + // _mapHypo.erase( hypId ); EAP: hyp can be used on many sub-shapes + anHyp->UnRegister(); + } } catch(SALOME_Exception & S_ex) { @@ -729,7 +736,7 @@ SMESH_Mesh_i::removeHypothesis(GEOM::GEOM_Object_ptr aSubShapeObject, //============================================================================= SMESH::ListOfHypothesis * - SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject) +SMESH_Mesh_i::GetHypothesisList(GEOM::GEOM_Object_ptr aSubShapeObject) throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); @@ -747,12 +754,14 @@ throw(SALOME::SALOME_Exception) int i = 0, n = aLocalList.size(); aList->length( n ); - for ( list::const_iterator anIt = aLocalList.begin(); i < n && anIt != aLocalList.end(); anIt++ ) { - SMESHDS_Hypothesis* aHyp = (SMESHDS_Hypothesis*)(*anIt); - if ( _mapHypo.find( aHyp->GetID() ) != _mapHypo.end() ) - aList[i++] = SMESH::SMESH_Hypothesis::_narrow( _mapHypo[aHyp->GetID()] ); + list::const_iterator aHyp = aLocalList.begin(); + std::map::iterator id_hypptr; + for ( ; i < n && aHyp != aLocalList.end(); aHyp++ ) + { + id_hypptr = _mapHypo.find( (*aHyp)->GetID() ); + if ( id_hypptr != _mapHypo.end() ) + aList[i++] = SMESH::SMESH_Hypothesis::_narrow( id_hypptr->second ); } - aList->length( i ); } catch(SALOME_Exception & S_ex) { @@ -793,7 +802,7 @@ SMESH::submesh_array* SMESH_Mesh_i::GetSubMeshes() throw (SALOME::SALOME_Excepti // Update Python script if ( !_mapSubMeshIor.empty() ) - aPythonDump << " ] = " << _this() << ".GetSubMeshes()"; + aPythonDump << " ] = " << SMESH::SMESH_Mesh_var( _this() ) << ".GetSubMeshes()"; return aList._retn(); } @@ -803,18 +812,17 @@ SMESH::submesh_array* SMESH_Mesh_i::GetSubMeshes() throw (SALOME::SALOME_Excepti * */ //============================================================================= + SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShapeObject, const char* theName ) throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); - MESSAGE("SMESH_Mesh_i::GetSubMesh"); if (CORBA::is_nil(aSubShapeObject)) - THROW_SALOME_CORBA_EXCEPTION("bad Sub-shape reference", - SALOME::BAD_PARAM); + THROW_SALOME_CORBA_EXCEPTION("bad Sub-shape reference", SALOME::BAD_PARAM); SMESH::SMESH_subMesh_var subMesh; - SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(_this()); + SMESH::SMESH_Mesh_var aMesh = _this(); try { TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(aSubShapeObject); @@ -833,13 +841,14 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap // create a new subMesh object servant if there is none for the shape if ( subMesh->_is_nil() ) subMesh = createSubMesh( aSubShapeObject ); - if ( _gen_i->CanPublishInStudy( subMesh )) { + if ( _gen_i->CanPublishInStudy( subMesh )) + { + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); SALOMEDS::SObject_wrap aSO = - _gen_i->PublishSubMesh(_gen_i->GetCurrentStudy(), aMesh, - subMesh, aSubShapeObject, theName ); + _gen_i->PublishSubMesh( study, aMesh, subMesh, aSubShapeObject, theName ); if ( !aSO->_is_nil()) { // Update Python script - TPythonDump() << aSO << " = " << _this() << ".GetSubMesh( " + TPythonDump() << aSO << " = " << aMesh << ".GetSubMesh( " << aSubShapeObject << ", '" << theName << "' )"; } } @@ -860,7 +869,7 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh ) throw (SALOME::SALOME_Exception) { SMESH_TRY; - + if ( theSubMesh->_is_nil() ) return; @@ -885,7 +894,7 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh ) builder->RemoveObjectWithChildren( anSO ); // Update Python script - TPythonDump() << _this() << ".RemoveSubMesh( " << anSO << " )"; + TPythonDump() << SMESH::SMESH_Mesh_var( _this() ) << ".RemoveSubMesh( " << anSO << " )"; } } @@ -904,7 +913,7 @@ void SMESH_Mesh_i::RemoveSubMesh( SMESH::SMESH_subMesh_ptr theSubMesh ) SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType, const char* theName ) - throw(SALOME::SALOME_Exception) + throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -913,20 +922,20 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType SMESH::SMESH_Group_var aNewGroup = SMESH::SMESH_Group::_narrow( createGroup( theElemType, theName )); - if ( _gen_i->CanPublishInStudy( aNewGroup ) ) { + if ( _gen_i->CanPublishInStudy( aNewGroup ) ) + { + SMESH::SMESH_Mesh_var mesh = _this(); + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); SALOMEDS::SObject_wrap aSO = - _gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(), - aNewGroup, GEOM::GEOM_Object::_nil(), theName); - if ( !aSO->_is_nil()) { + _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName); + if ( !aSO->_is_nil()) // Update Python script - TPythonDump() << aSO << " = " << _this() << ".CreateGroup( " + TPythonDump() << aSO << " = " << mesh << ".CreateGroup( " << theElemType << ", '" << theName << "' )"; - } } return aNewGroup._retn(); } - //============================================================================= /*! * @@ -936,7 +945,7 @@ SMESH::SMESH_GroupOnGeom_ptr SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementType theElemType, const char* theName, GEOM::GEOM_Object_ptr theGeomObj) - throw(SALOME::SALOME_Exception) + throw(SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -947,18 +956,18 @@ SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementType theElemType, TopoDS_Shape aShape = _gen_i->GeomObjectToShape( theGeomObj ); if ( !aShape.IsNull() ) { - aNewGroup = SMESH::SMESH_GroupOnGeom::_narrow - ( createGroup( theElemType, theName, aShape )); + aNewGroup = + SMESH::SMESH_GroupOnGeom::_narrow( createGroup( theElemType, theName, aShape )); - if ( _gen_i->CanPublishInStudy( aNewGroup ) ) { + if ( _gen_i->CanPublishInStudy( aNewGroup ) ) + { + SMESH::SMESH_Mesh_var mesh = _this(); + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); SALOMEDS::SObject_wrap aSO = - _gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(), - aNewGroup, theGeomObj, theName); - if ( !aSO->_is_nil()) { - // Update Python script - TPythonDump() << aSO << " = " << _this() << ".CreateGroupFromGEOM(" + _gen_i->PublishGroup( study, mesh, aNewGroup, theGeomObj, theName ); + if ( !aSO->_is_nil()) + TPythonDump() << aSO << " = " << mesh << ".CreateGroupFromGEOM( " << theElemType << ", '" << theName << "', " << theGeomObj << " )"; - } } } @@ -979,7 +988,7 @@ SMESH::SMESH_GroupOnFilter_ptr SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType, const char* theName, SMESH::Filter_ptr theFilter ) - throw (SALOME::SALOME_Exception) + throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -1001,16 +1010,15 @@ SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType, if ( _gen_i->CanPublishInStudy( aNewGroup ) ) { + SMESH::SMESH_Mesh_var mesh = _this(); + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); SALOMEDS::SObject_wrap aSO = - _gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(), aNewGroup, - GEOM::GEOM_Object::_nil(), theName); - if ( !aSO->_is_nil()) { - // Update Python script - pd << aSO << " = " << _this() << ".CreateGroupFromFilter(" + _gen_i->PublishGroup( study, mesh, aNewGroup, GEOM::GEOM_Object::_nil(), theName ); + + if ( !aSO->_is_nil()) + pd << aSO << " = " << mesh << ".CreateGroupFromFilter( " << theElemType << ", '" << theName << "', " << theFilter << " )"; - } } - return aNewGroup._retn(); } @@ -1021,25 +1029,25 @@ SMESH_Mesh_i::CreateGroupFromFilter(SMESH::ElementType theElemType, //============================================================================= void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup ) - throw (SALOME::SALOME_Exception) + throw (SALOME::SALOME_Exception) { if ( theGroup->_is_nil() ) return; SMESH_TRY; - SMESH_GroupBase_i* aGroup = - dynamic_cast( SMESH_Gen_i::GetServant( theGroup ).in() ); + SMESH_GroupBase_i* aGroup = SMESH::DownCast( theGroup ); if ( !aGroup ) return; SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy(); - if ( !aStudy->_is_nil() ) { + if ( !aStudy->_is_nil() ) + { SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( aStudy, theGroup ); - - if ( !aGroupSO->_is_nil() ) { + if ( !aGroupSO->_is_nil() ) + { // Update Python script - TPythonDump() << _this() << ".RemoveGroup( " << aGroupSO << " )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".RemoveGroup( " << aGroupSO << " )"; // Remove group's SObject SALOMEDS::StudyBuilder_var builder = aStudy->NewBuilder(); @@ -1069,24 +1077,17 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup if ( theGroup->_is_nil() ) return; - SMESH_GroupBase_i* aGroup = - dynamic_cast( SMESH_Gen_i::GetServant( theGroup ).in() ); - if ( !aGroup ) - return; - - SMESH::long_array_var anIds = aGroup->GetListOfID(); - SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH_Mesh_i::GetMeshEditor(); - - TPythonDump pyDump; // Supress dump from RemoveNodes/Elements() and RemoveGroup() - // Remove contents - if ( aGroup->GetType() == SMESH::NODE ) - aMeshEditor->RemoveNodes( anIds ); - else - aMeshEditor->RemoveElements( anIds ); + SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( theGroup ); + SMDS_ElemIteratorPtr elemIt = GetElements( idSrc, theGroup->GetType() ); + while ( elemIt->more() ) + _impl->GetMeshDS()->RemoveElement( elemIt->next() ); + + TPythonDump pyDump; // Supress dump from RemoveGroup() // Update Python script (theGroup must be alive for this) - pyDump << _this() << ".RemoveGroupWithContents( " << theGroup << " )"; + pyDump << SMESH::SMESH_Mesh_var(_this()) + << ".RemoveGroupWithContents( " << theGroup << " )"; // Remove group RemoveGroup( theGroup ); @@ -1097,7 +1098,7 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup //================================================================================ /*! * \brief Get the list of groups existing in the mesh - * \retval SMESH::ListOfGroups * - list of groups + * \retval SMESH::ListOfGroups * - list of groups */ //================================================================================ @@ -1129,7 +1130,7 @@ SMESH::ListOfGroups * SMESH_Mesh_i::GetGroups() throw(SALOME::SALOME_Exception) catch(SALOME_Exception & S_ex) { THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); } - aPythonDump << " ] = " << _this() << ".GetGroups()"; + aPythonDump << " ] = " << SMESH::SMESH_Mesh_var(_this()) << ".GetGroups()"; } return aList._retn(); } @@ -1147,14 +1148,14 @@ CORBA::Long SMESH_Mesh_i::NbGroups() throw (SALOME::SALOME_Exception) } //============================================================================= -/*! UnionGroups - * New group is created. All mesh elements that are - * present in initial groups are added to the new one +/*! + * New group including all mesh elements present in initial groups is created. */ //============================================================================= + SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, - const char* theName ) + const char* theName ) throw (SALOME::SALOME_Exception) { SMESH::SMESH_Group_var aResGrp; @@ -1163,10 +1164,12 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - if ( theGroup1->_is_nil() || theGroup2->_is_nil() || - theGroup1->GetType() != theGroup2->GetType() ) - return SMESH::SMESH_Group::_nil(); - + if ( theGroup1->_is_nil() || theGroup2->_is_nil() ) + THROW_SALOME_CORBA_EXCEPTION("UnionGroups(): NULL Group", + SALOME::BAD_PARAM); + if ( theGroup1->GetType() != theGroup2->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("UnionGroups(): different group types", + SALOME::BAD_PARAM); TPythonDump pyDump; // Create Union @@ -1174,31 +1177,12 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the if ( aResGrp->_is_nil() ) return SMESH::SMESH_Group::_nil(); - SMESH::long_array_var anIds1 = theGroup1->GetListOfID(); - SMESH::long_array_var anIds2 = theGroup2->GetListOfID(); - - TColStd_MapOfInteger aResMap; - - for ( int i1 = 0, n1 = anIds1->length(); i1 < n1; i1++ ) - aResMap.Add( anIds1[ i1 ] ); - - for ( int i2 = 0, n2 = anIds2->length(); i2 < n2; i2++ ) - aResMap.Add( anIds2[ i2 ] ); - - SMESH::long_array_var aResIds = new SMESH::long_array; - aResIds->length( aResMap.Extent() ); - - int resI = 0; - TColStd_MapIteratorOfMapOfInteger anIter( aResMap ); - for( ; anIter.More(); anIter.Next() ) - aResIds[ resI++ ] = anIter.Key(); - - aResGrp->Add( aResIds ); + aResGrp->AddFrom( theGroup1 ); + aResGrp->AddFrom( theGroup2 ); // Update Python script - pyDump << aResGrp << " = " << _this() << ".UnionGroups( " - << theGroup1 << ", " << theGroup2 << ", '" - << theName << "' )"; + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var(_this()) + << ".UnionGroups( " << theGroup1 << ", " << theGroup2 << ", '" << theName << "' )"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1207,72 +1191,62 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionGroups( SMESH::SMESH_GroupBase_ptr the //============================================================================= /*! - \brief Union list of groups. New group is created. All mesh elements that are - present in initial groups are added to the new one. - \param theGroups list of groups - \param theName name of group to be created - \return pointer on the group -*/ + * \brief New group including all mesh elements present in initial groups is created. + * \param theGroups list of groups + * \param theName name of group to be created + * \return pointer to the new group + */ //============================================================================= + SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionListOfGroups(const SMESH::ListOfGroups& theGroups, const char* theName ) throw (SALOME::SALOME_Exception) { + SMESH::SMESH_Group_var aResGrp; + if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); if ( !theName ) return SMESH::SMESH_Group::_nil(); - SMESH::SMESH_Group_var aResGrp; - SMESH_TRY; - vector< int > anIds; + // check types SMESH::ElementType aType = SMESH::ALL; for ( int g = 0, n = theGroups.length(); g < n; g++ ) { SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ]; if ( CORBA::is_nil( aGrp ) ) continue; - - // check type - SMESH::ElementType aCurrType = aGrp->GetType(); if ( aType == SMESH::ALL ) - aType = aCurrType; - else - { - if ( aType != aCurrType ) - return SMESH::SMESH_Group::_nil(); - } - - // unite ids - SMESH::long_array_var aCurrIds = aGrp->GetListOfID(); - for ( int i = 0, n = aCurrIds->length(); i < n; i++ ) - { - int aCurrId = aCurrIds[ i ]; - anIds.push_back( aCurrId ); - } + aType = aGrp->GetType(); + else if ( aType != aGrp->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("UnionListOfGroups(): different group types", + SALOME::BAD_PARAM); } + if ( aType == SMESH::ALL ) + return SMESH::SMESH_Group::_nil(); TPythonDump pyDump; - // Create group + // Create Union aResGrp = CreateGroup( aType, theName ); if ( aResGrp->_is_nil() ) return SMESH::SMESH_Group::_nil(); - // Create array of identifiers - SMESH::long_array_var aResIds = new SMESH::long_array; - aResIds->length( anIds.size() ); - - for ( size_t i = 0; iAdd( aResIds ); - - // Update Python script - pyDump << aResGrp << " = " << _this() << ".UnionListOfGroups( " - << &theGroups << ", '" << theName << "' )"; + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var(_this()) << ".UnionListOfGroups([ "; + for ( int g = 0, n = theGroups.length(); g < n; g++ ) + { + SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ]; + if ( !CORBA::is_nil( aGrp ) ) + { + aResGrp->AddFrom( aGrp ); + if ( g > 0 ) pyDump << ", "; + pyDump << aGrp; + } + } + pyDump << " ], '" << theName << "' )"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1280,11 +1254,12 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::UnionListOfGroups(const SMESH::ListOfGroups } //============================================================================= -/*! IntersectGroups +/*! * New group is created. All mesh elements that are * present in both initial groups are added to the new one. */ //============================================================================= + SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char* theName ) @@ -1293,41 +1268,47 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::IntersectGroups( SMESH::SMESH_GroupBase_ptr SMESH::SMESH_Group_var aResGrp; SMESH_TRY; + if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - if ( theGroup1->_is_nil() || theGroup2->_is_nil() || - theGroup1->GetType() != theGroup2->GetType() ) - return SMESH::SMESH_Group::_nil(); - + if ( theGroup1->_is_nil() || theGroup2->_is_nil() ) + THROW_SALOME_CORBA_EXCEPTION("IntersectGroups(): NULL Group", + SALOME::BAD_PARAM); + if ( theGroup1->GetType() != theGroup2->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("IntersectGroups(): different group types", + SALOME::BAD_PARAM); TPythonDump pyDump; // Create Intersection aResGrp = CreateGroup( theGroup1->GetType(), theName ); if ( aResGrp->_is_nil() ) - return aResGrp; - - SMESH::long_array_var anIds1 = theGroup1->GetListOfID(); - SMESH::long_array_var anIds2 = theGroup2->GetListOfID(); + return aResGrp._retn(); - TColStd_MapOfInteger aMap1; + SMESHDS_GroupBase* groupDS1 = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( theGroup1 )) + groupDS1 = grp_i->GetGroupDS(); - for ( int i1 = 0, n1 = anIds1->length(); i1 < n1; i1++ ) - aMap1.Add( anIds1[ i1 ] ); + SMESHDS_GroupBase* groupDS2 = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( theGroup2 )) + groupDS2 = grp_i->GetGroupDS(); - TColStd_SequenceOfInteger aSeq; - for ( int i2 = 0, n2 = anIds2->length(); i2 < n2; i2++ ) - if ( aMap1.Contains( anIds2[ i2 ] ) ) - aSeq.Append( anIds2[ i2 ] ); - - SMESH::long_array_var aResIds = new SMESH::long_array; - aResIds->length( aSeq.Length() ); - for ( size_t resI = 0, resN = aSeq.Length(); resI < resN; resI++ ) - aResIds[ resI ] = aSeq( resI + 1 ); - aResGrp->Add( aResIds ); + SMESHDS_Group* resGroupDS = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aResGrp )) + resGroupDS = dynamic_cast( grp_i->GetGroupDS() ); + if ( groupDS1 && groupDS2 && resGroupDS && !groupDS2->IsEmpty() ) + { + SMDS_ElemIteratorPtr elemIt1 = groupDS1->GetElements(); + while ( elemIt1->more() ) + { + const SMDS_MeshElement* e = elemIt1->next(); + if ( groupDS2->Contains( e )) + resGroupDS->SMDSGroup().Add( e ); + } + } // Update Python script - pyDump << aResGrp << " = " << _this() << ".IntersectGroups( " + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var(_this()) << ".IntersectGroups( " << theGroup1 << ", " << theGroup2 << ", '" << theName << "')"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1352,72 +1333,69 @@ SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups, SMESH::SMESH_Group_var aResGrp; SMESH_TRY; + if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); if ( !theName ) return SMESH::SMESH_Group::_nil(); - NCollection_DataMap< int, int > anIdToCount; + // check types and get SMESHDS_GroupBase's SMESH::ElementType aType = SMESH::ALL; + vector< SMESHDS_GroupBase* > groupVec; for ( int g = 0, n = theGroups.length(); g < n; g++ ) { SMESH::SMESH_GroupBase_var aGrp = theGroups[ g ]; if ( CORBA::is_nil( aGrp ) ) continue; - - // check type - SMESH::ElementType aCurrType = aGrp->GetType(); if ( aType == SMESH::ALL ) - aType = aCurrType; - else - { - if ( aType != aCurrType ) - return SMESH::SMESH_Group::_nil(); - } + aType = aGrp->GetType(); + else if ( aType != aGrp->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("IntersectListOfGroups(): different group types", + SALOME::BAD_PARAM); - // calculates number of occurance ids in groups - SMESH::long_array_var aCurrIds = aGrp->GetListOfID(); - for ( int i = 0, n = aCurrIds->length(); i < n; i++ ) - { - int aCurrId = aCurrIds[ i ]; - if ( !anIdToCount.IsBound( aCurrId ) ) - anIdToCount.Bind( aCurrId, 1 ); - else - anIdToCount( aCurrId ) = anIdToCount( aCurrId ) + 1; - } - } - - // create map of ids - int nbGrp = theGroups.length(); - vector< int > anIds; - NCollection_DataMap< int, int >::Iterator anIter( anIdToCount ); - for ( ; anIter.More(); anIter.Next() ) - { - int aCurrId = anIter.Key(); - int aCurrNb = anIter.Value(); - if ( aCurrNb == nbGrp ) - anIds.push_back( aCurrId ); + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aGrp )) + if ( SMESHDS_GroupBase* grpDS = grp_i->GetGroupDS() ) + { + if ( grpDS->IsEmpty() ) + { + groupVec.clear(); + break; + } + groupVec.push_back( grpDS ); + } } + if ( aType == SMESH::ALL ) // all groups are nil + return SMESH::SMESH_Group::_nil(); TPythonDump pyDump; - // Create group + // Create a group aResGrp = CreateGroup( aType, theName ); - if ( aResGrp->_is_nil() ) - return SMESH::SMESH_Group::_nil(); - // Create array of identifiers - SMESH::long_array_var aResIds = new SMESH::long_array; - aResIds->length( anIds.size() ); + SMESHDS_Group* resGroupDS = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aResGrp )) + resGroupDS = dynamic_cast( grp_i->GetGroupDS() ); + if ( !resGroupDS || groupVec.empty() ) + return aResGrp._retn(); + + // Fill the group + size_t i, nb = groupVec.size(); + SMDS_ElemIteratorPtr elemIt1 = groupVec[0]->GetElements(); + while ( elemIt1->more() ) + { + const SMDS_MeshElement* e = elemIt1->next(); + bool inAll = true; + for ( i = 1; ( i < nb && inAll ); ++i ) + inAll = groupVec[i]->Contains( e ); - for ( size_t i = 0; iAdd( aResIds ); + if ( inAll ) + resGroupDS->SMDSGroup().Add( e ); + } // Update Python script - pyDump << aResGrp << " = " << _this() << ".IntersectListOfGroups( " - << &theGroups << ", '" << theName << "' )"; + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var( _this() ) + << ".IntersectListOfGroups( " << theGroups << ", '" << theName << "' )"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1425,11 +1403,12 @@ SMESH_Mesh_i::IntersectListOfGroups(const SMESH::ListOfGroups& theGroups, } //============================================================================= -/*! CutGroups +/*! * New group is created. All mesh elements that are present in - * main group but do not present in tool group are added to the new one + * a main group but is not present in a tool group are added to the new one */ //============================================================================= + SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups( SMESH::SMESH_GroupBase_ptr theGroup1, SMESH::SMESH_GroupBase_ptr theGroup2, const char* theName ) @@ -1438,44 +1417,47 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CutGroups( SMESH::SMESH_GroupBase_ptr theGr SMESH::SMESH_Group_var aResGrp; SMESH_TRY; + if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - if ( theGroup1->_is_nil() || theGroup2->_is_nil() || - theGroup1->GetType() != theGroup2->GetType() ) - return SMESH::SMESH_Group::_nil(); - + if ( theGroup1->_is_nil() || theGroup2->_is_nil() ) + THROW_SALOME_CORBA_EXCEPTION("CutGroups(): NULL Group", + SALOME::BAD_PARAM); + if ( theGroup1->GetType() != theGroup2->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("CutGroups(): different group types", + SALOME::BAD_PARAM); TPythonDump pyDump; - // Perform Cutting aResGrp = CreateGroup( theGroup1->GetType(), theName ); if ( aResGrp->_is_nil() ) - return aResGrp; - - SMESH::long_array_var anIds1 = theGroup1->GetListOfID(); - SMESH::long_array_var anIds2 = theGroup2->GetListOfID(); - - TColStd_MapOfInteger aMap2; + return aResGrp._retn(); - for ( int i2 = 0, n2 = anIds2->length(); i2 < n2; i2++ ) - aMap2.Add( anIds2[ i2 ] ); + SMESHDS_GroupBase* groupDS1 = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( theGroup1 )) + groupDS1 = grp_i->GetGroupDS(); - TColStd_SequenceOfInteger aSeq; - for ( int i1 = 0, n1 = anIds1->length(); i1 < n1; i1++ ) - if ( !aMap2.Contains( anIds1[ i1 ] ) ) - aSeq.Append( anIds1[ i1 ] ); + SMESHDS_GroupBase* groupDS2 = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( theGroup2 )) + groupDS2 = grp_i->GetGroupDS(); - SMESH::long_array_var aResIds = new SMESH::long_array; - aResIds->length( aSeq.Length() ); - - for ( int resI = 0, resN = aSeq.Length(); resI < resN; resI++ ) - aResIds[ resI ] = aSeq( resI + 1 ); - aResGrp->Add( aResIds ); + SMESHDS_Group* resGroupDS = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aResGrp )) + resGroupDS = dynamic_cast( grp_i->GetGroupDS() ); + if ( groupDS1 && groupDS2 && resGroupDS ) + { + SMDS_ElemIteratorPtr elemIt1 = groupDS1->GetElements(); + while ( elemIt1->more() ) + { + const SMDS_MeshElement* e = elemIt1->next(); + if ( !groupDS2->Contains( e )) + resGroupDS->SMDSGroup().Add( e ); + } + } // Update Python script - pyDump << aResGrp << " = " << _this() << ".CutGroups( " - << theGroup1 << ", " << theGroup2 << ", '" - << theName << "' )"; + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var(_this()) << ".CutGroups( " + << theGroup1 << ", " << theGroup2 << ", '" << theName << "')"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1501,89 +1483,82 @@ SMESH_Mesh_i::CutListOfGroups(const SMESH::ListOfGroups& theMainGroups, SMESH::SMESH_Group_var aResGrp; SMESH_TRY; + if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); if ( !theName ) return SMESH::SMESH_Group::_nil(); - set< int > aToolIds; + // check types and get SMESHDS_GroupBase's SMESH::ElementType aType = SMESH::ALL; - int g, n; - // iterate through tool groups - for ( g = 0, n = theToolGroups.length(); g < n; g++ ) + vector< SMESHDS_GroupBase* > toolGroupVec; + vector< SMDS_ElemIteratorPtr > mainIterVec; + + for ( int g = 0, n = theMainGroups.length(); g < n; g++ ) { - SMESH::SMESH_GroupBase_var aGrp = theToolGroups[ g ]; + SMESH::SMESH_GroupBase_var aGrp = theMainGroups[ g ]; if ( CORBA::is_nil( aGrp ) ) continue; - - // check type - SMESH::ElementType aCurrType = aGrp->GetType(); if ( aType == SMESH::ALL ) - aType = aCurrType; - else - { - if ( aType != aCurrType ) - return SMESH::SMESH_Group::_nil(); - } - - // unite tool ids - SMESH::long_array_var aCurrIds = aGrp->GetListOfID(); - for ( int i = 0, n = aCurrIds->length(); i < n; i++ ) - { - int aCurrId = aCurrIds[ i ]; - aToolIds.insert( aCurrId ); - } + aType = aGrp->GetType(); + else if ( aType != aGrp->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("UnionListOfGroups(): different group types", + SALOME::BAD_PARAM); + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aGrp )) + if ( SMESHDS_GroupBase* grpDS = grp_i->GetGroupDS() ) + if ( !grpDS->IsEmpty() ) + mainIterVec.push_back( grpDS->GetElements() ); } + if ( aType == SMESH::ALL ) // all main groups are nil + return SMESH::SMESH_Group::_nil(); + if ( mainIterVec.empty() ) // all main groups are empty + return aResGrp._retn(); - vector< int > anIds; // result - - // Iterate through main group - for ( g = 0, n = theMainGroups.length(); g < n; g++ ) + for ( int g = 0, n = theToolGroups.length(); g < n; g++ ) { - SMESH::SMESH_GroupBase_var aGrp = theMainGroups[ g ]; + SMESH::SMESH_GroupBase_var aGrp = theToolGroups[ g ]; if ( CORBA::is_nil( aGrp ) ) continue; - - // check type - SMESH::ElementType aCurrType = aGrp->GetType(); - if ( aType == SMESH::ALL ) - aType = aCurrType; - else - { - if ( aType != aCurrType ) - return SMESH::SMESH_Group::_nil(); - } - - // unite tool ids - SMESH::long_array_var aCurrIds = aGrp->GetListOfID(); - for ( int i = 0, n = aCurrIds->length(); i < n; i++ ) - { - int aCurrId = aCurrIds[ i ]; - if ( !aToolIds.count( aCurrId ) ) - anIds.push_back( aCurrId ); - } + if ( aType != aGrp->GetType() ) + THROW_SALOME_CORBA_EXCEPTION("UnionListOfGroups(): different group types", + SALOME::BAD_PARAM); + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aGrp )) + if ( SMESHDS_GroupBase* grpDS = grp_i->GetGroupDS() ) + toolGroupVec.push_back( grpDS ); } TPythonDump pyDump; - // Create group + // Create a group aResGrp = CreateGroup( aType, theName ); - if ( aResGrp->_is_nil() ) - return SMESH::SMESH_Group::_nil(); - // Create array of identifiers - SMESH::long_array_var aResIds = new SMESH::long_array; - aResIds->length( anIds.size() ); + SMESHDS_Group* resGroupDS = 0; + if ( SMESH_GroupBase_i* grp_i = SMESH::DownCast< SMESH_GroupBase_i* >( aResGrp )) + resGroupDS = dynamic_cast( grp_i->GetGroupDS() ); + if ( !resGroupDS ) + return aResGrp._retn(); + + // Fill the group + size_t i, nb = toolGroupVec.size(); + SMDS_ElemIteratorPtr mainElemIt + ( new SMDS_IteratorOnIterators + < const SMDS_MeshElement*, vector< SMDS_ElemIteratorPtr > >( mainIterVec )); + while ( mainElemIt->more() ) + { + const SMDS_MeshElement* e = mainElemIt->next(); + bool isIn = false; + for ( i = 0; ( i < nb && !isIn ); ++i ) + isIn = toolGroupVec[i]->Contains( e ); - for (int i=0; iAdd( aResIds ); + if ( !isIn ) + resGroupDS->SMDSGroup().Add( e ); + } // Update Python script - pyDump << aResGrp << " = " << _this() << ".CutListOfGroups( " - << &theMainGroups << ", " << &theToolGroups << ", '" - << theName << "' )"; + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var( _this() ) + << ".CutListOfGroups( " << theMainGroups + << theToolGroups << ", '" << theName << "' )"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1685,8 +1660,9 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfGroups& theGroups, } // Update Python script - pyDump << aResGrp << " = " << _this() << ".CreateDimGroup( " - << &theGroups << ", " << theElemType << ", '" << theName << "' )"; + pyDump << aResGrp << " = " << SMESH::SMESH_Mesh_var( _this()) + << ".CreateDimGroup( " + << theGroups << ", " << theElemType << ", '" << theName << "' )"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -1705,7 +1681,7 @@ void SMESH_Mesh_i::addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj, if ( CORBA::is_nil( theGeomObj ) || theGeomObj->GetType() != GEOM_GROUP ) return; // group SO - SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); SALOMEDS::SObject_wrap groupSO = _gen_i->ObjectToSObject( study, theGeomObj ); if ( groupSO->_is_nil() ) return; @@ -1725,7 +1701,7 @@ void SMESH_Mesh_i::addGeomGroupData(GEOM::GEOM_Object_ptr theGeomObj, for ( int i = 0; i < ids->length(); ++i ) groupData._indices.insert( ids[i] ); // SMESH object - groupData._smeshObject = theSmeshObj; + groupData._smeshObject = CORBA::Object::_duplicate( theSmeshObj ); } //================================================================================ @@ -1783,8 +1759,8 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData) GEOM_Client* geomClient = _gen_i->GetShapeReader(); if ( !geomClient ) return newShape; - TCollection_AsciiString groupIOR = geomGen->GetStringFromIOR( geomGroup ); - geomClient->RemoveShapeFromBuffer( groupIOR ); + CORBA::String_var groupIOR = geomGen->GetStringFromIOR( geomGroup ); + geomClient->RemoveShapeFromBuffer( groupIOR.in() ); newShape = _gen_i->GeomObjectToShape( geomGroup ); } @@ -1862,7 +1838,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif() if ( !submesh->_is_nil() ) // -------------- Sub mesh --------------------- { int oldID = submesh->GetId(); - if ( _mapSubMeshIor.find( oldID ) == _mapSubMeshIor.end() ) + if ( !_mapSubMeshIor.count( oldID )) continue; TopoDS_Shape oldShape = _mapSubMesh[oldID]->GetSubShape(); @@ -2067,14 +2043,13 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase if ( theGroup->_is_nil() ) return aGroup._retn(); - SMESH_GroupBase_i* aGroupToRem = - dynamic_cast( SMESH_Gen_i::GetServant( theGroup ).in() ); + SMESH_GroupBase_i* aGroupToRem = SMESH::DownCast( theGroup ); if ( !aGroupToRem ) return aGroup._retn(); const bool isOnFilter = ( SMESH::DownCast< SMESH_GroupOnFilter_i* > ( theGroup )); - int anId = aGroupToRem->GetLocalID(); + const int anId = aGroupToRem->GetLocalID(); if ( !_impl->ConvertToStandalone( anId ) ) return aGroup._retn(); removeGeomGroupData( theGroup ); @@ -2082,10 +2057,11 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase SMESH_GroupBase_i* aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId ); // remove old instance of group from own map + { SMESH::SMESH_GroupBase_var var( _mapGroups[anId] ); } // decref CORBA object _mapGroups.erase( anId ); SALOMEDS::StudyBuilder_var builder; - SALOMEDS::SObject_wrap aGroupSO; + SALOMEDS::SObject_wrap aGroupSO; SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy(); if ( !aStudy->_is_nil() ) { builder = aStudy->NewBuilder(); @@ -2099,8 +2075,8 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase builder->RemoveObject( chItr->Value() ); // Update Python script - TPythonDump() << aGroupSO << " = " << _this() << ".ConvertToStandalone( " - << aGroupSO << " )"; + TPythonDump() << aGroupSO << " = " << SMESH::SMESH_Mesh_var(_this()) + << ".ConvertToStandalone( " << aGroupSO << " )"; // change icon of Group on Filter if ( isOnFilter ) @@ -2126,7 +2102,9 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase _gen_i->RegisterObject( aGroup ); CORBA::String_var ior = _gen_i->GetORB()->object_to_string( aGroup ); - builder->SetIOR( aGroupSO, ior.in() ); + builder->SetIOR( aGroupSO, ior.in() ); // == aGroup->Register(); + //aGroup->Register(); + aGroupToRem->UnRegister(); SMESH_CATCH( SMESH::throwCorbaException ); @@ -2142,22 +2120,23 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theSubShapeObject ) { if(MYDEBUG) MESSAGE( "createSubMesh" ); - TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject); - + TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject); ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape); - int subMeshId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape ); - SMESH_subMesh_i *subMeshServant = new SMESH_subMesh_i(myPOA, _gen_i, this, subMeshId); - SMESH::SMESH_subMesh_var subMesh - = SMESH::SMESH_subMesh::_narrow(subMeshServant->_this()); + const int subMeshId = mySubMesh->GetId(); + + SMESH_subMesh_i * subMeshServant = new SMESH_subMesh_i(myPOA, _gen_i, this, subMeshId); + SMESH::SMESH_subMesh_var subMesh = subMeshServant->_this(); + + _mapSubMesh [subMeshId] = mySubMesh; + _mapSubMesh_i [subMeshId] = subMeshServant; + _mapSubMeshIor[subMeshId] = SMESH::SMESH_subMesh::_duplicate( subMesh ); - _mapSubMesh[subMeshId] = mySubMesh; - _mapSubMesh_i[subMeshId] = subMeshServant; - _mapSubMeshIor[subMeshId] = SMESH::SMESH_subMesh::_duplicate(subMesh); + subMeshServant->Register(); // register CORBA object for persistence int nextId = _gen_i->RegisterObject( subMesh ); if(MYDEBUG) { MESSAGE( "Add submesh to map with id = "<< nextId); } - else { nextId = 0; } // avoid "unused variable" warning in release mode + else { nextId = 0; } // avoid "unused variable" warning // to track changes of GEOM groups addGeomGroupData( theSubShapeObject, subMesh ); @@ -2179,7 +2158,6 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::getSubMesh(int shapeID) return SMESH::SMESH_subMesh::_duplicate( (*it).second ); } - //============================================================================= /*! * @@ -2193,12 +2171,13 @@ bool SMESH_Mesh_i::removeSubMesh (SMESH::SMESH_subMesh_ptr theSubMesh, if ( theSubMesh->_is_nil() /*|| theSubShapeObject->_is_nil()*/ ) return isHypChanged; + const int subMeshId = theSubMesh->GetId(); + if ( theSubShapeObject->_is_nil() ) // not published shape (IPAL13617) { - CORBA::Long shapeId = theSubMesh->GetId(); - if ( _mapSubMesh.find( shapeId ) != _mapSubMesh.end()) + if ( _mapSubMesh.find( subMeshId ) != _mapSubMesh.end()) { - TopoDS_Shape S = _mapSubMesh[ shapeId ]->GetSubShape(); + TopoDS_Shape S = _mapSubMesh[ subMeshId ]->GetSubShape(); if ( !S.IsNull() ) { list hyps = _impl->GetHypothesisList( S ); @@ -2223,7 +2202,16 @@ bool SMESH_Mesh_i::removeSubMesh (SMESH::SMESH_subMesh_ptr theSubMesh, } removeGeomGroupData( theSubShapeObject ); } - int subMeshId = theSubMesh->GetId(); + + // remove a servant + std::map::iterator id_smi = _mapSubMesh_i.find( subMeshId ); + if ( id_smi != _mapSubMesh_i.end() ) + id_smi->second->UnRegister(); + + // remove a CORBA object + std::map::iterator id_smptr = _mapSubMeshIor.find( subMeshId ); + if ( id_smptr != _mapSubMeshIor.end() ) + SMESH::SMESH_subMesh_var( id_smptr->second ); _mapSubMesh.erase(subMeshId); _mapSubMesh_i.erase(subMeshId); @@ -2249,7 +2237,10 @@ SMESH::SMESH_GroupBase_ptr SMESH_Mesh_i::createGroup (SMESH::ElementType std::set< std::string > presentNames; std::map::const_iterator i_gr = _mapGroups.begin(); for ( ; i_gr != _mapGroups.end(); ++i_gr ) - presentNames.insert( i_gr->second->GetName() ); + { + CORBA::String_var name = i_gr->second->GetName(); + presentNames.insert( name.in() ); + } do { newName = "noname_Group_" + SMESH_Comment( presentNames.size() + 1 ); } while ( !presentNames.insert( newName ).second ); @@ -2267,8 +2258,9 @@ SMESH::SMESH_GroupBase_ptr SMESH_Mesh_i::createGroup (SMESH::ElementType else aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId ); - aGroup = SMESH::SMESH_GroupBase::_narrow( aGroupImpl->_this() ); + aGroup = aGroupImpl->_this(); _mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( aGroup ); + aGroupImpl->Register(); // register CORBA object for persistence int nextId = _gen_i->RegisterObject( aGroup ); @@ -2296,14 +2288,15 @@ void SMESH_Mesh_i::removeGroup( const int theId ) { if(MYDEBUG) MESSAGE("SMESH_Mesh_i::removeGroup()" ); if ( _mapGroups.find( theId ) != _mapGroups.end() ) { - SMESH::SMESH_GroupBase_ptr group = _mapGroups[theId]; + SMESH::SMESH_GroupBase_var group = _mapGroups[theId]; _mapGroups.erase( theId ); removeGeomGroupData( group ); - if (! _impl->RemoveGroup( theId )) + if ( !_impl->RemoveGroup( theId )) { // it seems to be a call up from _impl caused by hyp modification (issue 0020918) RemoveGroup( group ); } + group->UnRegister(); } } @@ -2474,11 +2467,13 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor() _preMeshInfo->FullLoadFromFile(); // Create MeshEditor - SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( this, false ); - aMeshEdVar = aMeshEditor->_this(); + if ( !_editor ) + _editor = new SMESH_MeshEditor_i( this, false ); + aMeshEdVar = _editor->_this(); // Update Python script - TPythonDump() << aMeshEditor << " = " << _this() << ".GetMeshEditor()"; + TPythonDump() << _editor << " = " + << SMESH::SMESH_Mesh_var(_this()) << ".GetMeshEditor()"; SMESH_CATCH( SMESH::throwCorbaException ); @@ -2500,8 +2495,9 @@ SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditPreviewer() if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( this, true ); - aMeshEdVar = aMeshEditor->_this(); + if ( !_previewEditor ) + _previewEditor = new SMESH_MeshEditor_i( this, true ); + aMeshEdVar = _previewEditor->_this(); SMESH_CATCH( SMESH::throwCorbaException ); @@ -2569,7 +2565,7 @@ void SMESH_Mesh_i::SetAutoColor(CORBA::Boolean theAutoColor) throw(SALOME::SALOM _impl->SetAutoColor(theAutoColor); TPythonDump pyDump; // not to dump group->SetColor() from below code - pyDump<<_this()<<".SetAutoColor( "< aReservedColors; map::iterator it = _mapGroups.begin(); @@ -2692,7 +2688,8 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char* file, } // Update Python script // set name of mesh before export - TPythonDump() << _gen_i << ".SetName(" << _this() << ", '" << aMeshName.c_str() << "')"; + TPythonDump() << _gen_i << ".SetName(" + << SMESH::SMESH_Mesh_var(_this()) << ", '" << aMeshName.c_str() << "')"; // check names of groups checkGroupNames(); @@ -2713,17 +2710,19 @@ void SMESH_Mesh_i::ExportToMEDX (const char* file, CORBA::Boolean autoDimension) throw(SALOME::SALOME_Exception) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); string aMeshName = prepareMeshNameAndGroups(file, overwrite); - TPythonDump() << _this() << ".ExportToMEDX( r'" + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportToMEDX( r'" << file << "', " << auto_groups << ", " << theVersion << ", " << overwrite << ", " << autoDimension << " )"; _impl->ExportMED( file, aMeshName.c_str(), auto_groups, theVersion, 0, autoDimension ); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -2768,7 +2767,8 @@ void SMESH_Mesh_i::ExportSAUV (const char* file, _preMeshInfo->FullLoadFromFile(); string aMeshName = prepareMeshNameAndGroups(file, true); - TPythonDump() << _this() << ".ExportSAUV( r'" << file << "', " << auto_groups << " )"; + TPythonDump() << SMESH::SMESH_Mesh_var( _this()) + << ".ExportSAUV( r'" << file << "', " << auto_groups << " )"; _impl->ExportSAUV(file, aMeshName.c_str(), auto_groups); } @@ -2789,7 +2789,7 @@ void SMESH_Mesh_i::ExportDAT (const char *file) // Update Python script // check names of groups checkGroupNames(); - TPythonDump() << _this() << ".ExportDAT( r'" << file << "' )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportDAT( r'" << file << "' )"; // Perform Export PrepareForWriting(file); @@ -2812,7 +2812,7 @@ void SMESH_Mesh_i::ExportUNV (const char *file) // Update Python script // check names of groups checkGroupNames(); - TPythonDump() << _this() << ".ExportUNV( r'" << file << "' )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportUNV( r'" << file << "' )"; // Perform Export PrepareForWriting(file); @@ -2835,7 +2835,8 @@ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii) // Update Python script // check names of groups checkGroupNames(); - TPythonDump() << _this() << ".ExportSTL( r'" << file << "', " << isascii << " )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) + << ".ExportSTL( r'" << file << "', " << isascii << " )"; // Perform Export PrepareForWriting(file); @@ -2882,7 +2883,8 @@ void SMESH_Mesh_i::ExportPartToMED(::SMESH::SMESH_IDSource_ptr meshPart, SMESH_MeshPartDS partDS( meshPart ); _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version, &partDS, autoDimension ); } - pyDump << _this() << ".ExportPartToMED( " << meshPart << ", r'" << file << "', " + pyDump << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToMED( " + << meshPart << ", r'" << file << "', " << auto_groups << ", " << version << ", " << overwrite << ", " << autoDimension << " )"; } @@ -2906,7 +2908,8 @@ void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, SMESH_MeshPartDS partDS( meshPart ); _impl->ExportDAT(file,&partDS); - TPythonDump() << _this() << ".ExportPartToDAT( " << meshPart << ", r'" << file << "' )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) + << ".ExportPartToDAT( " << meshPart << ", r'" << file << "' )"; } //================================================================================ /*! @@ -2927,7 +2930,8 @@ void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart, SMESH_MeshPartDS partDS( meshPart ); _impl->ExportUNV(file, &partDS); - TPythonDump() << _this() << ".ExportPartToUNV( " << meshPart<< ", r'" << file << "' )"; + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) + << ".ExportPartToUNV( " << meshPart<< ", r'" << file << "' )"; } //================================================================================ /*! @@ -2949,7 +2953,7 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart, SMESH_MeshPartDS partDS( meshPart ); _impl->ExportSTL(file, isascii, &partDS); - TPythonDump() << _this() << ".ExportPartToSTL( " + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( " << meshPart<< ", r'" << file << "', " << isascii << ")"; } @@ -2974,7 +2978,7 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart, SMESH_MeshPartDS partDS( meshPart ); _impl->ExportCGNS(file, &partDS); - TPythonDump() << _this() << ".ExportCGNS( " + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( " << meshPart<< ", r'" << file << "', " << overwrite << ")"; #else THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR); @@ -3001,7 +3005,7 @@ void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart, SMESH_MeshPartDS partDS( meshPart ); _impl->ExportGMF(file, &partDS, withRequiredGroups); - TPythonDump() << _this() << ".ExportGMF( " + TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportGMF( " << meshPart<< ", r'" << file << "', " << withRequiredGroups << ")"; @@ -3331,7 +3335,7 @@ SMESH::long_array* SMESH_Mesh_i::GetIDs() //============================================================================= SMESH::long_array* SMESH_Mesh_i::GetElementsId() - throw (SALOME::SALOME_Exception) + throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -3384,12 +3388,9 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemTy int i = 0; - SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator(); - while ( i < nbElements && anIt->more() ) { - const SMDS_MeshElement* anElem = anIt->next(); - if ( theElemType == SMESH::ALL || anElem->GetType() == (SMDSAbs_ElementType)theElemType ) - aResult[i++] = anElem->GetID(); - } + SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator( (SMDSAbs_ElementType)theElemType ); + while ( i < nbElements && anIt->more() ) + aResult[i++] = anIt->next()->GetID(); aResult->length( i ); @@ -3498,7 +3499,6 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) return aResult._retn(); } - //============================================================================= /*! * Returns ID of nodes for given submesh @@ -3506,6 +3506,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) * returns only nodes on shapes. */ //============================================================================= + SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CORBA::Boolean all) throw (SALOME::SALOME_Exception) @@ -4228,8 +4229,10 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID, groups[ ++iG ] = createGroup( SMESH::ElementType(i), theGroupName ); if ( _gen_i->CanPublishInStudy( groups[ iG ] )) { + SALOMEDS::Study_var study = _gen_i->GetCurrentStudy(); + SMESH::SMESH_Mesh_var mesh = _this(); SALOMEDS::SObject_wrap aSO = - _gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(), groups[ iG ], + _gen_i->PublishGroup( study, mesh, groups[ iG ], GEOM::GEOM_Object::_nil(), theGroupName); aSO->_is_nil(); // avoid "unused variable" warning } @@ -4254,7 +4257,8 @@ SMESH_Mesh_i::MakeGroupsOfBadInputElements( int theSubShapeID, void SMESH_Mesh_i::CreateGroupServants() { - SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy(); + SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy(); + SMESH::SMESH_Mesh_var aMesh = _this(); set addedIDs; ::SMESH_Mesh::GroupIteratorPtr groupIt = _impl->GetGroups(); @@ -4280,9 +4284,9 @@ void SMESH_Mesh_i::CreateGroupServants() aGroupImpl = new SMESH_Group_i( SMESH_Gen_i::GetPOA(), this, anId ); } - SMESH::SMESH_GroupBase_var groupVar = - SMESH::SMESH_GroupBase::_narrow( aGroupImpl->_this() ); + SMESH::SMESH_GroupBase_var groupVar = aGroupImpl->_this(); _mapGroups[anId] = SMESH::SMESH_GroupBase::_duplicate( groupVar ); + aGroupImpl->Register(); // register CORBA object for persistence int nextId = _gen_i->RegisterObject( groupVar ); @@ -4292,7 +4296,7 @@ void SMESH_Mesh_i::CreateGroupServants() // publishing the groups in the study if ( !aStudy->_is_nil() ) { GEOM::GEOM_Object_var shapeVar = _gen_i->ShapeToGeomObject( shape ); - _gen_i->PublishGroup( aStudy, _this(), groupVar, shapeVar, groupVar->GetName()); + _gen_i->PublishGroup( aStudy, aMesh, groupVar, shapeVar, group->GetName()); } } if ( !addedIDs.empty() ) @@ -4303,7 +4307,7 @@ void SMESH_Mesh_i::CreateGroupServants() { map::iterator it = _mapGroups.find(*id); int i = std::distance( _mapGroups.begin(), it ); - TPythonDump() << it->second << " = " << _this() << ".GetGroups()[ "<< i << " ]"; + TPythonDump() << it->second << " = " << aMesh << ".GetGroups()[ "<< i << " ]"; } } } @@ -4402,10 +4406,10 @@ void SMESH_Mesh_i::SetParameters(const char* theParameters) * \brief Returns list of notebook variables used for Mesh operations separated by ":" symbol */ //============================================================================= + char* SMESH_Mesh_i::GetParameters() { - SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen(); - return CORBA::string_dup(gen->GetParameters(SMESH::SMESH_Mesh::_narrow(_this()))); + return SMESH_Gen_i::GetSMESHGen()->GetParameters( SMESH::SMESH_Mesh_var( _this()) ); } //============================================================================= @@ -4418,9 +4422,9 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters() SMESH::string_array_var aResult = new SMESH::string_array(); SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen(); if(gen) { - char *aParameters = GetParameters(); - SALOMEDS::Study_var aStudy = gen->GetCurrentStudy(); - if(!aStudy->_is_nil()) { + CORBA::String_var aParameters = GetParameters(); + SALOMEDS::Study_var aStudy = gen->GetCurrentStudy(); + if ( !aStudy->_is_nil()) { SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aParameters); if(aSections->length() > 0) { SALOMEDS::ListOfStrings aVars = aSections[aSections->length()-1]; @@ -5166,7 +5170,7 @@ SMESH::submesh_array_array* SMESH_Mesh_i::GetMeshOrder() ::SMESH_Mesh& mesh = GetImpl(); TPythonDump aPythonDump; // prevent dump of called methods - aPythonDump << "isDone = " << _this() << ".SetMeshOrder( [ "; + aPythonDump << "isDone = " << SMESH::SMESH_Mesh_var(_this()) << ".SetMeshOrder( [ "; TListOfListOfInt subMeshOrder; for ( int i = 0, n = theSubMeshArray.length(); i < n; i++ ) @@ -5258,7 +5262,7 @@ void SMESH_Mesh_i::convertMeshOrder (const TListOfListOfInt& theIdsOrder, if ( theIsDump ) { // finilise python dump aPythonDump << " ]"; - aPythonDump << " = " << _this() << ".GetMeshOrder()"; + aPythonDump << " = " << SMESH::SMESH_Mesh_var(_this()) << ".GetMeshOrder()"; } } diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index cead1dc06..c52699bb2 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -28,6 +28,11 @@ #include "SMESH.hxx" +#include "SMESH_Hypothesis.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_subMesh.hxx" + +#include #include #include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -35,18 +40,13 @@ #include CORBA_SERVER_HEADER(SMESH_Hypothesis) #include CORBA_CLIENT_HEADER(GEOM_Gen) -#include "SMESH_Hypothesis.hxx" -#include "SMESH_Mesh.hxx" -#include "SMESH_subMesh.hxx" - -#include "SALOME_GenericObj_i.hh" +#include class SMESH_Gen_i; class SMESH_GroupBase_i; class SMESH_subMesh_i; class SMESH_PreMeshInfo; - -#include +class SMESH_MeshEditor_i; class SMESH_I_EXPORT SMESH_Mesh_i: public virtual POA_SMESH::SMESH_Mesh, @@ -655,6 +655,8 @@ private: std::map _mapSubMeshIor; std::map _mapGroups; std::map _mapHypo; + SMESH_MeshEditor_i* _editor; + SMESH_MeshEditor_i* _previewEditor; SMESH::MedFileInfo_var _medFileInfo; SMESH_PreMeshInfo* _preMeshInfo; // mesh info before full loading from study file @@ -669,7 +671,7 @@ private: // number of items in a group varies (1) <-> (>1) std::string _groupEntry; std::set _indices; // indices of group items within group's main shape - CORBA::Object_ptr _smeshObject; // SMESH object depending on GEOM group + CORBA::Object_var _smeshObject; // SMESH object depending on GEOM group }; std::list _geomGroupData; @@ -683,7 +685,7 @@ private: */ void removeGeomGroupData(CORBA::Object_ptr theSmeshObj); /*! - * \brief Return new group contents if it has been changed and update group data + * Return new group contents if it has been changed and update group data */ TopoDS_Shape newGroupShape( TGeomGroupData & groupData); diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 30c8cc52a..19a483dcb 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -227,6 +227,7 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) if (( aSubMeshDS = aSubMesh->GetSubMeshDS() )) nbNodes += aSubMeshDS->NbNodes(); } + return nbNodes; } return aSubMeshDS ? aSubMeshDS->NbNodes() : 0; diff --git a/src/SMESH_PY/smeshstudytools.py b/src/SMESH_PY/smeshstudytools.py index 5bf1250b0..7b83e570e 100644 --- a/src/SMESH_PY/smeshstudytools.py +++ b/src/SMESH_PY/smeshstudytools.py @@ -27,10 +27,9 @@ import salome SMESH = None # SMESH module is loaded only when needed from salome.kernel.studyedit import getStudyEditor -try: - from salome.gui import helper -except ImportError: - pass +from salome.kernel.deprecation import is_called_by_sphinx +if not is_called_by_sphinx(): + from salome.gui import helper class SMeshStudyTools: """ diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 852b6ba50..9d583de04 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -551,7 +551,9 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): aMeshes = [ Mesh(self, self.geompyD, m) for m in aSmeshMeshes ] return aMeshes, aStatus - ## Creates a Mesh object importing data from the given GMF file + ## Creates a Mesh object importing data from the given GMF file. + # GMF files have .mesh extension for the ASCII format and .meshb for + # the bynary format. # @return [ an instance of Mesh class, SMESH.ComputeError ] # @ingroup l2_impexp def CreateMeshesFromGMF( self, theFileName ): @@ -980,6 +982,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): if not hasattr(src1, "_narrow"): return None src1 = src1._narrow(SMESH.SMESH_IDSource) if not src1: return None + unRegister = genObjUnRegister() if id1 != 0: m = src1.GetMesh() e = m.GetMeshEditor() @@ -987,6 +990,7 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): src1 = e.MakeIDSource([id1], SMESH.FACE) else: src1 = e.MakeIDSource([id1], SMESH.NODE) + unRegister.set( src1 ) pass if hasattr(src2, "_narrow"): src2 = src2._narrow(SMESH.SMESH_IDSource) @@ -997,11 +1001,12 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): src2 = e.MakeIDSource([id2], SMESH.FACE) else: src2 = e.MakeIDSource([id2], SMESH.NODE) + unRegister.set( src2 ) pass pass aMeasurements = self.CreateMeasurements() + unRegister.set( aMeasurements ) result = aMeasurements.MinDistance(src1, src2) - aMeasurements.UnRegister() return result ## Get bounding box of the specified object(s) @@ -1041,6 +1046,44 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen): aMeasurements.UnRegister() return result + ## Get sum of lengths of all 1D elements in the mesh object. + # @param elemId obj mesh, submesh or group + # @return sum of lengths of all 1D elements + # @ingroup l1_measurements + def GetLength(self, obj): + if isinstance(obj, Mesh): obj = obj.mesh + if isinstance(obj, Mesh_Algorithm): obj = obj.GetSubMesh() + aMeasurements = self.CreateMeasurements() + value = aMeasurements.Length(obj) + aMeasurements.UnRegister() + return value + + ## Get sum of areas of all 2D elements in the mesh object. + # @param elemId obj mesh, submesh or group + # @return sum of areas of all 2D elements + # @ingroup l1_measurements + def GetArea(self, obj): + if isinstance(obj, Mesh): obj = obj.mesh + if isinstance(obj, Mesh_Algorithm): obj = obj.GetSubMesh() + aMeasurements = self.CreateMeasurements() + value = aMeasurements.Area(obj) + aMeasurements.UnRegister() + return value + + ## Get sum of volumes of all 3D elements in the mesh object. + # @param elemId obj mesh, submesh or group + # @return sum of volumes of all 3D elements + # @ingroup l1_measurements + def GetVolume(self, obj): + if isinstance(obj, Mesh): obj = obj.mesh + if isinstance(obj, Mesh_Algorithm): obj = obj.GetSubMesh() + aMeasurements = self.CreateMeasurements() + value = aMeasurements.Volume(obj) + aMeasurements.UnRegister() + return value + + pass # end of class smeshBuilder + import omniORB #Registering the new proxy for SMESH_Gen omniORB.registerObjref(SMESH._objref_SMESH_Gen._NP_RepositoryId, smeshBuilder) @@ -1577,8 +1620,10 @@ class Mesh: def ExportMED(self, f, auto_groups=0, version=MED_V2_2, overwrite=1, meshPart=None, autoDimension=True): if meshPart: + unRegister = genObjUnRegister() if isinstance( meshPart, list ): meshPart = self.GetIDSource( meshPart, SMESH.ALL ) + unRegister.set( meshPart ) self.mesh.ExportPartToMED( meshPart, f, auto_groups, version, overwrite, autoDimension) else: self.mesh.ExportToMEDX(f, auto_groups, version, overwrite, autoDimension) @@ -1598,8 +1643,10 @@ class Mesh: # @ingroup l2_impexp def ExportDAT(self, f, meshPart=None): if meshPart: + unRegister = genObjUnRegister() if isinstance( meshPart, list ): meshPart = self.GetIDSource( meshPart, SMESH.ALL ) + unRegister.set( meshPart ) self.mesh.ExportPartToDAT( meshPart, f ) else: self.mesh.ExportDAT(f) @@ -1610,8 +1657,10 @@ class Mesh: # @ingroup l2_impexp def ExportUNV(self, f, meshPart=None): if meshPart: + unRegister = genObjUnRegister() if isinstance( meshPart, list ): meshPart = self.GetIDSource( meshPart, SMESH.ALL ) + unRegister.set( meshPart ) self.mesh.ExportPartToUNV( meshPart, f ) else: self.mesh.ExportUNV(f) @@ -1623,8 +1672,10 @@ class Mesh: # @ingroup l2_impexp def ExportSTL(self, f, ascii=1, meshPart=None): if meshPart: + unRegister = genObjUnRegister() if isinstance( meshPart, list ): meshPart = self.GetIDSource( meshPart, SMESH.ALL ) + unRegister.set( meshPart ) self.mesh.ExportPartToSTL( meshPart, f, ascii ) else: self.mesh.ExportSTL(f, ascii) @@ -1635,21 +1686,27 @@ class Mesh: # @param meshPart a part of mesh (group, sub-mesh) to export instead of the mesh # @ingroup l2_impexp def ExportCGNS(self, f, overwrite=1, meshPart=None): + unRegister = genObjUnRegister() if isinstance( meshPart, list ): meshPart = self.GetIDSource( meshPart, SMESH.ALL ) + unRegister.set( meshPart ) if isinstance( meshPart, Mesh ): meshPart = meshPart.mesh elif not meshPart: meshPart = self.mesh self.mesh.ExportCGNS(meshPart, f, overwrite) - ## Exports the mesh in a file in GMF format + ## Exports the mesh in a file in GMF format. + # GMF files must have .mesh extension for the ASCII format and .meshb for + # the bynary format. Other extensions are not allowed. # @param f is the file name # @param meshPart a part of mesh (group, sub-mesh) to export instead of the mesh # @ingroup l2_impexp def ExportGMF(self, f, meshPart=None): + unRegister = genObjUnRegister() if isinstance( meshPart, list ): meshPart = self.GetIDSource( meshPart, SMESH.ALL ) + unRegister.set( meshPart ) if isinstance( meshPart, Mesh ): meshPart = meshPart.mesh elif not meshPart: @@ -1664,9 +1721,15 @@ class Mesh: # @param opt boolean parameter for creating/not creating # the groups Group_On_All_Nodes, Group_On_All_Faces, ... # @param overwrite boolean parameter for overwriting/not overwriting the file + # @param autoDimension: if @c True (default), a space dimension of a MED mesh can be either + # - 1D if all mesh nodes lie on OX coordinate axis, or + # - 2D if all mesh nodes lie on XOY coordinate plane, or + # - 3D in the rest cases. + # + # If @a autoDimension is @c False, the space dimension is always 3. # @ingroup l2_impexp - def ExportToMED(self, f, version, opt=0, overwrite=1): - self.mesh.ExportToMEDX(f, opt, version, overwrite) + def ExportToMED(self, f, version, opt=0, overwrite=1, autoDimension=True): + self.mesh.ExportToMEDX(f, opt, version, overwrite, autoDimension) # Operations with groups: # ---------------------- @@ -2428,7 +2491,7 @@ class Mesh: aMeasurements = self.smeshpyD.CreateMeasurements() aMeasure = aMeasurements.MinDistance(id1, id2) - aMeasurements.UnRegister() + genObjUnRegister([aMeasurements,id1, id2]) return aMeasure ## Get bounding box of the specified object(s) @@ -2461,6 +2524,7 @@ class Mesh: if len(IDs) > 0 and isinstance(IDs[0], int): IDs = [IDs] srclist = [] + unRegister = genObjUnRegister() for o in IDs: if isinstance(o, Mesh): srclist.append(o.mesh) @@ -2473,11 +2537,12 @@ class Mesh: srclist.append(self.editor.MakeIDSource(o, SMESH.FACE)) else: srclist.append(self.editor.MakeIDSource(o, SMESH.NODE)) + unRegister.set( srclist[-1] ) pass pass aMeasurements = self.smeshpyD.CreateMeasurements() + unRegister.set( aMeasurements ) aMeasure = aMeasurements.BoundingBox(srclist) - aMeasurements.UnRegister() return aMeasure # Mesh edition (SMESH_MeshEditor functionality): @@ -2530,10 +2595,12 @@ class Mesh: # can be retrieved from the returned object by calling GetIDs() # @ingroup l2_modif_add def Add0DElementsToAllNodes(self, theObject, theGroupName=""): + unRegister = genObjUnRegister() if isinstance( theObject, Mesh ): theObject = theObject.GetMesh() if isinstance( theObject, list ): theObject = self.GetIDSource( theObject, SMESH.ALL ) + unRegister.set( theObject ) return self.editor.Create0DElementsOnAllNodes( theObject, theGroupName ) ## Creates a ball element on a node with given ID. @@ -2803,11 +2870,13 @@ class Mesh: # @return number of reoriented faces # @ingroup l2_modif_changori def Reorient2D(self, the2DObject, theDirection, theFaceOrPoint ): + unRegister = genObjUnRegister() # check the2DObject if isinstance( the2DObject, Mesh ): the2DObject = the2DObject.GetMesh() if isinstance( the2DObject, list ): the2DObject = self.GetIDSource( the2DObject, SMESH.FACE ) + unRegister.set( the2DObject ) # check theDirection if isinstance( theDirection, geomBuilder.GEOM._objref_GEOM_Object): theDirection = self.smeshpyD.GetDirStruct( theDirection ) @@ -2897,12 +2966,14 @@ class Mesh: # group or a list of face IDs. By default all quadrangles are split # @ingroup l2_modif_cutquadr def QuadTo4Tri (self, theElements=[]): + unRegister = genObjUnRegister() if isinstance( theElements, Mesh ): theElements = theElements.mesh elif not theElements: theElements = self.mesh elif isinstance( theElements, list ): theElements = self.GetIDSource( theElements, SMESH.FACE ) + unRegister.set( theElements ) return self.editor.QuadTo4Tri( theElements ) ## Splits quadrangles into triangles. @@ -2942,10 +3013,12 @@ class Mesh: # Hex_5Tet - split the hexahedron into 5 tetrahedrons, etc # @ingroup l2_modif_cutquadr def SplitVolumesIntoTetra(self, elemIDs, method=smeshBuilder.Hex_5Tet ): + unRegister = genObjUnRegister() if isinstance( elemIDs, Mesh ): elemIDs = elemIDs.GetMesh() if ( isinstance( elemIDs, list )): elemIDs = self.editor.MakeIDSource(elemIDs, SMESH.VOLUME) + unRegister.set( elemIDs ) self.editor.SplitVolumesIntoTetra(elemIDs, method) ## Splits quadrangle faces near triangular facets of volumes @@ -3216,12 +3289,14 @@ class Mesh: # @ingroup l2_modif_edit def MakeBoundaryMesh(self, elements, dimension=SMESH.BND_2DFROM3D, groupName="", meshName="", toCopyElements=False, toCopyExistingBondary=False): + unRegister = genObjUnRegister() if isinstance( elements, Mesh ): elements = elements.GetMesh() if ( isinstance( elements, list )): elemType = SMESH.ALL if elements: elemType = self.GetElementType( elements[0], iselem=True) elements = self.editor.MakeIDSource(elements, elemType) + unRegister.set( elements ) mesh, group = self.editor.MakeBoundaryMesh(elements,dimension,groupName,meshName, toCopyElements,toCopyExistingBondary) if mesh: mesh = self.smeshpyD.Mesh(mesh) @@ -3530,8 +3605,10 @@ class Mesh: # @param LinearVariation forces the computation of rotation angles as linear # variation of the given Angles along path steps # @param HasRefPoint allows using the reference point - # @param RefPoint the point around which the shape is rotated (the mass center of the shape by default). + # @param RefPoint the point around which the elements are rotated (the mass + # center of the elements by default). # The User can specify any point as the Reference Point. + # RefPoint can be either GEOM Vertex, [x,y,z] or SMESH.PointStruct # @param MakeGroups forces the generation of new groups from existing ones # @param ElemType type of elements for extrusion (if param Base is a mesh) # @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True, @@ -3540,9 +3617,12 @@ class Mesh: def ExtrusionAlongPathX(self, Base, Path, NodeStart, HasAngles, Angles, LinearVariation, HasRefPoint, RefPoint, MakeGroups, ElemType): - if ( isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object)): + if isinstance( RefPoint, geomBuilder.GEOM._objref_GEOM_Object): RefPoint = self.smeshpyD.GetPointStruct(RefPoint) pass + elif isinstance( RefPoint, list ): + RefPoint = PointStruct(*RefPoint) + pass Angles,AnglesParameters,hasVars = ParseAngles(Angles) Parameters = AnglesParameters + var_separator + RefPoint.parameters self.mesh.SetParameters(Parameters) @@ -3899,10 +3979,12 @@ class Mesh: # @return list of created groups (SMESH_GroupBase) if MakeGroups=True, # empty list otherwise def Scale(self, theObject, thePoint, theScaleFact, Copy, MakeGroups=False): + unRegister = genObjUnRegister() if ( isinstance( theObject, Mesh )): theObject = theObject.GetMesh() if ( isinstance( theObject, list )): theObject = self.GetIDSource(theObject, SMESH.ALL) + unRegister.set( theObject ) if ( isinstance( theScaleFact, float )): theScaleFact = [theScaleFact] if ( isinstance( theScaleFact, int )): @@ -3923,10 +4005,12 @@ class Mesh: # @param NewMeshName - the name of the newly created mesh # @return instance of Mesh class def ScaleMakeMesh(self, theObject, thePoint, theScaleFact, MakeGroups=False, NewMeshName=""): + unRegister = genObjUnRegister() if (isinstance(theObject, Mesh)): theObject = theObject.GetMesh() if ( isinstance( theObject, list )): theObject = self.GetIDSource(theObject,SMESH.ALL) + unRegister.set( theObject ) if ( isinstance( theScaleFact, float )): theScaleFact = [theScaleFact] if ( isinstance( theScaleFact, int )): @@ -4035,12 +4119,14 @@ class Mesh: # @return the list of groups of nodes # @ingroup l2_modif_trsf def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance, exceptNodes=[]): + unRegister = genObjUnRegister() if (isinstance( SubMeshOrGroup, Mesh )): SubMeshOrGroup = SubMeshOrGroup.GetMesh() if not isinstance( exceptNodes, list): exceptNodes = [ exceptNodes ] if exceptNodes and isinstance( exceptNodes[0], int): exceptNodes = [ self.GetIDSource( exceptNodes, SMESH.NODE)] + unRegister.set( exceptNodes ) return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes) ## Merges nodes @@ -4151,10 +4237,12 @@ class Mesh: # @return a group where the new elements are added. None if theGroupName == "". # @ingroup l2_modif_edit def DoubleElements(self, theElements, theGroupName=""): + unRegister = genObjUnRegister() if isinstance( theElements, Mesh ): theElements = theElements.mesh elif isinstance( theElements, list ): theElements = self.GetIDSource( theElements, SMESH.ALL ) + unRegister.set( theElements ) return self.editor.DoubleElements(theElements, theGroupName) ## Creates a hole in a mesh by doubling the nodes of some particular elements @@ -4347,26 +4435,41 @@ class Mesh: val = 0 return val - ## Get length of 1D element. - # @param elemId mesh element ID - # @return element's length value + ## Get length of 1D element or sum of lengths of all 1D mesh elements + # @param elemId mesh element ID (if not defined - sum of length of all 1D elements will be calculated) + # @return element's length value if \a elemId is specified or sum of all 1D mesh elements' lengths otherwise # @ingroup l1_measurements - def GetLength(self, elemId): - return self._valueFromFunctor(SMESH.FT_Length, elemId) + def GetLength(self, elemId=None): + length = 0 + if elemId == None: + length = self.smeshpyD.GetLength(self) + else: + length = self._valueFromFunctor(SMESH.FT_Length, elemId) + return length - ## Get area of 2D element. - # @param elemId mesh element ID - # @return element's area value + ## Get area of 2D element or sum of areas of all 2D mesh elements + # @param elemId mesh element ID (if not defined - sum of areas of all 2D elements will be calculated) + # @return element's area value if \a elemId is specified or sum of all 2D mesh elements' areas otherwise # @ingroup l1_measurements - def GetArea(self, elemId): - return self._valueFromFunctor(SMESH.FT_Area, elemId) + def GetArea(self, elemId=None): + area = 0 + if elemId == None: + area = self.smeshpyD.GetArea(self) + else: + area = self._valueFromFunctor(SMESH.FT_Area, elemId) + return area - ## Get volume of 3D element. - # @param elemId mesh element ID - # @return element's volume value + ## Get volume of 3D element or sum of volumes of all 3D mesh elements + # @param elemId mesh element ID (if not defined - sum of volumes of all 3D elements will be calculated) + # @return element's volume value if \a elemId is specified or sum of all 3D mesh elements' volumes otherwise # @ingroup l1_measurements - def GetVolume(self, elemId): - return self._valueFromFunctor(SMESH.FT_Volume3D, elemId) + def GetVolume(self, elemId=None): + volume = 0 + if elemId == None: + volume = self.smeshpyD.GetVolume(self) + else: + volume = self._valueFromFunctor(SMESH.FT_Volume3D, elemId) + return volume ## Get maximum element length. # @param elemId mesh element ID @@ -4510,6 +4613,28 @@ class hypMethodWrapper: raise ValueError, detail # wrong variable name return result + pass + +# A helper class that call UnRegister() of SALOME.GenericObj'es stored in it +class genObjUnRegister: + + def __init__(self, genObj=None): + self.genObjList = [] + self.set( genObj ) + return + + def set(self, genObj): + "Store one or a list of of SALOME.GenericObj'es" + if isinstance( genObj, list ): + self.genObjList.extend( genObj ) + else: + self.genObjList.append( genObj ) + return + + def __del__(self): + for genObj in self.genObjList: + if genObj and hasattr( genObj, "UnRegister" ): + genObj.UnRegister() for pluginName in os.environ[ "SMESH_MeshersList" ].split( ":" ): # diff --git a/src/StdMeshers/StdMeshers_Import_1D.cxx b/src/StdMeshers/StdMeshers_Import_1D.cxx index 03b89eda3..c24c20aac 100644 --- a/src/StdMeshers/StdMeshers_Import_1D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D.cxx @@ -182,10 +182,11 @@ namespace // INTERNAL STUFF if ( !_importMeshSubDS ) return; SMDS_ElemIteratorPtr eIt = _importMeshSubDS->GetElements(); while ( eIt->more() ) - meshDS->RemoveFreeElement( eIt->next(), _importMeshSubDS, /*fromGroups=*/false ); + meshDS->RemoveFreeElement( eIt->next(), 0, /*fromGroups=*/false ); SMDS_NodeIteratorPtr nIt = _importMeshSubDS->GetNodes(); while ( nIt->more() ) - meshDS->RemoveFreeNode( nIt->next(), _importMeshSubDS, /*fromGroups=*/false ); + meshDS->RemoveFreeNode( nIt->next(), 0, /*fromGroups=*/false ); + _importMeshSubDS->Clear(); _n2n.clear(); _e2e.clear(); } @@ -266,6 +267,7 @@ namespace // INTERNAL STUFF const SMESH_Hypothesis* hyp); void removeSubmesh( SMESH_subMesh* sm, _ListenerData* data ); void clearSubmesh ( SMESH_subMesh* sm, _ListenerData* data, bool clearAllSub ); + void clearN2N ( SMESH_Mesh* tgtMesh ); // mark sm as missing src hyp with valid groups static void waitHypModification(SMESH_subMesh* sm) @@ -347,6 +349,18 @@ namespace // INTERNAL STUFF } } //-------------------------------------------------------------------------------- + /*! + * \brief Clear _ImportData::_n2n. + * _n2n is usefull within one mesh.Compute() only + */ + void _Listener::clearN2N( SMESH_Mesh* tgtMesh ) + { + list< _ImportData >& dList = get()->_tgtMesh2ImportData[tgtMesh]; + list< _ImportData >::iterator d = dList.begin(); + for ( ; d != dList.end(); ++d ) + d->_n2n.clear(); + } + //-------------------------------------------------------------------------------- /*! * \brief Clear submeshes and remove imported mesh and/or groups if necessary * \param sm - cleared submesh @@ -448,6 +462,8 @@ namespace // INTERNAL STUFF default:; } } + if ( !data->mySubMeshes.empty() ) + clearN2N( data->mySubMeshes.front()->GetFather() ); } else // event of Import submesh { @@ -496,6 +512,10 @@ namespace // INTERNAL STUFF d->_computedSubM.insert( *smIt); } } + // Clear _ImportData::_n2n if it's no more useful, i.e. when + // the event is not within mesh.Compute() + if ( SMESH_subMesh::ALGO_EVENT == eventType ) + clearN2N( subMesh->GetFather() ); } } @@ -621,6 +641,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th { if ( !_sourceHyp ) return false; + //MESSAGE("---------> StdMeshers_Import_1D::Compute"); const vector& srcGroups = _sourceHyp->GetGroups(/*loaded=*/true); if ( srcGroups.empty() ) return error("Invalid source groups"); @@ -650,9 +671,11 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th { _gen->Compute(theMesh,v,/*anUpward=*/true); n = SMESH_Algo::VertexNode( v, tgtMesh ); + //MESSAGE("_gen->Compute " << n); if ( !n ) return false; // very strange } vertexNodes.push_back( SMESH_TNodeXYZ( n )); + //MESSAGE("SMESH_Algo::VertexNode " << n->GetID() << " " << n->X() << " " << n->Y() << " " << n->Z() ); } // import edges from groups @@ -670,17 +693,19 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th SMDS_ElemIteratorPtr srcElems = srcGroup->GetElements(); vector newNodes; SMDS_MeshNode *tmpNode = helper.AddNode(0,0,0); - double u = 0; + double u = 0.314159; // "random" value between 0 and 1, avoid 0 and 1, false detection possible on edge restrictions while ( srcElems->more() ) // loop on group contents { const SMDS_MeshElement* edge = srcElems->next(); // find or create nodes of a new edge newNodes.resize( edge->NbNodes() ); + //MESSAGE("edge->NbNodes " << edge->NbNodes()); newNodes.back() = 0; SMDS_MeshElement::iterator node = edge->begin_nodes(); SMESH_TNodeXYZ a(edge->GetNode(0)); // --- define a tolerance relative to the length of an edge double mytol = a.Distance(edge->GetNode(edge->NbNodes()-1))/25; + //mytol = max(1.E-5, 10*edgeTol); // too strict and not necessary //MESSAGE("mytol = " << mytol); for ( unsigned i = 0; i < newNodes.size(); ++i, ++node ) { @@ -697,22 +722,26 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th for ( vNIt = vertexNodes.begin(); vNIt != vertexNodes.end(); ++vNIt) if ( vNIt->SquareDistance( *node ) < checktol) { - //MESSAGE("SquareDistance " << vNIt->SquareDistance( *node ) << " checktol " << checktol); + //MESSAGE("SquareDistance " << vNIt->SquareDistance( *node ) << " checktol " << checktol <<" "<X()<<" "<Y()<<" "<Z()); (*n2nIt).second = vNIt->_node; vertexNodes.erase( vNIt ); break; } + else if ( vNIt->SquareDistance( *node ) < 10*checktol) + MESSAGE("SquareDistance missed" << vNIt->SquareDistance( *node ) << " checktol " << checktol <<" "<X()<<" "<Y()<<" "<Z()); } if ( !n2nIt->second ) { // find out if node lies on theShape + //double dxyz[4]; tmpNode->setXYZ( (*node)->X(), (*node)->Y(), (*node)->Z()); - if ( helper.CheckNodeU( geomEdge, tmpNode, u, mytol, /*force=*/true )) + if ( helper.CheckNodeU( geomEdge, tmpNode, u, mytol, /*force=*/true)) // , dxyz )) // dxyz used for debug purposes { SMDS_MeshNode* newNode = tgtMesh->AddNode( (*node)->X(), (*node)->Y(), (*node)->Z()); n2nIt->second = newNode; tgtMesh->SetNodeOnEdge( newNode, shapeID, u ); - //MESSAGE("u=" << u); + //MESSAGE("u=" << u << " " << newNode->X()<< " " << newNode->Y()<< " " << newNode->Z()); + //MESSAGE("d=" << dxyz[0] << " " << dxyz[1] << " " << dxyz[2] << " " << dxyz[3]); } } if ( !(newNodes[i] = n2nIt->second )) @@ -730,7 +759,7 @@ bool StdMeshers_Import_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & th newEdge = tgtMesh->AddEdge( newNodes[0], newNodes[1], newNodes[2] ); else newEdge = tgtMesh->AddEdge( newNodes[0], newNodes[1]); - //MESSAGE("add Edge"); + //MESSAGE("add Edge " << newNodes[0]->GetID() << " " << newNodes[1]->GetID()); tgtMesh->SetMeshElementOnShape( newEdge, shapeID ); e2e->insert( make_pair( edge, newEdge )); } diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 33f261506..6ba56c39c 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -371,6 +371,61 @@ namespace { return nbRemoved; } + //================================================================================ + /*! + * Consider continuous straight EDGES as one side - mark them to unite + */ + //================================================================================ + + int countNbSides( const Prism_3D::TPrismTopo & thePrism, + vector & nbUnitePerEdge ) + { + int nbEdges = thePrism.myNbEdgesInWires.front(); // nb outer edges + int nbSides = nbEdges; + + list< TopoDS_Edge >::const_iterator edgeIt = thePrism.myBottomEdges.begin(); + std::advance( edgeIt, nbEdges-1 ); + TopoDS_Edge prevE = *edgeIt; + bool isPrevStraight = SMESH_Algo::isStraight( prevE ); + int iPrev = nbEdges - 1; + + int iUnite = -1; // the first of united EDGEs + + edgeIt = thePrism.myBottomEdges.begin(); + for ( int iE = 0; iE < nbEdges; ++iE, ++edgeIt ) + { + const TopoDS_Edge& curE = *edgeIt; + const bool isCurStraight = SMESH_Algo::isStraight( curE ); + if ( isPrevStraight && isCurStraight && SMESH_Algo::IsContinuous( prevE, curE )) + { + if ( iUnite < 0 ) + iUnite = iPrev; + nbUnitePerEdge[ iUnite ]++; + nbUnitePerEdge[ iE ] = -1; + --nbSides; + } + else + { + iUnite = -1; + } + prevE = curE; + isPrevStraight = isCurStraight; + iPrev = iE; + } + + return nbSides; + } + + void pointsToPython(const std::vector& p) + { +#ifdef _DEBUG_ + for ( int i = SMESH_Block::ID_V000; i < p.size(); ++i ) + { + cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ; + SMESH_Block::DumpShapeID( i, cout ) << endl; + } +#endif + } } // namespace //======================================================================= @@ -705,10 +760,11 @@ bool StdMeshers_Prism_3D::getWallFaces( Prism_3D::TPrismTopo & thePrism, list< TopoDS_Edge >::iterator edge = thePrism.myBottomEdges.begin(); std::list< int >::iterator nbE = thePrism.myNbEdgesInWires.begin(); int iE = 0; + double f,l; while ( edge != thePrism.myBottomEdges.end() ) { ++iE; - if ( BRep_Tool::Degenerated( *edge )) + if ( BRep_Tool::Curve( *edge, f,l ).IsNull() ) { edge = thePrism.myBottomEdges.erase( edge ); --iE; @@ -989,6 +1045,9 @@ bool StdMeshers_Prism_3D::compute(const Prism_3D::TPrismTopo& thePrism) if ( !SMESH_Block::ShellPoint( params, myShapeXYZ, coords )) return toSM( error("Can't compute coordinates by normalized parameters")); + // if ( !meshDS->MeshElements( volumeID ) || + // meshDS->MeshElements( volumeID )->NbNodes() == 0 ) + // pointsToPython(myShapeXYZ); SHOWYXZ("TOPFacePoint ",myShapeXYZ[ ID_TOP_FACE]); SHOWYXZ("BOT Node "<< tBotNode.myNode->GetID(),gpXYZ(tBotNode.myNode)); SHOWYXZ("ShellPoint ",coords); @@ -2150,9 +2209,16 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, myParam2ColumnMaps.resize( thePrism.myBottomEdges.size() ); // total nb edges size_t iE, nbEdges = thePrism.myNbEdgesInWires.front(); // nb outer edges - vector< double > edgeLength( nbEdges ); + vector< double > edgeLength( nbEdges ); multimap< double, int > len2edgeMap; + // for each EDGE: either split into several parts, or join with several next EDGEs + vector nbSplitPerEdge( nbEdges, 0 ); + vector nbUnitePerEdge( nbEdges, 0 ); // -1 means "joined to a previous" + + // consider continuous straight EDGEs as one side + const int nbSides = countNbSides( thePrism, nbUnitePerEdge ); + list< TopoDS_Edge >::const_iterator edgeIt = thePrism.myBottomEdges.begin(); for ( iE = 0; iE < nbEdges; ++iE, ++edgeIt ) { @@ -2172,14 +2238,8 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, edgeLength[ iE ] = SMESH_Algo::EdgeLength( *edgeIt ); - if ( nbEdges < NB_WALL_FACES ) // fill map used to split faces - { - SMESHDS_SubMesh* smDS = meshDS->MeshElements( *edgeIt); - if ( !smDS ) - return error(COMPERR_BAD_INPUT_MESH, TCom("Null submesh on the edge #") - << MeshDS()->ShapeToIndex( *edgeIt )); - len2edgeMap.insert( make_pair( edgeLength[ iE ], iE )); - } + if ( nbSides < NB_WALL_FACES ) // fill map used to split faces + len2edgeMap.insert( make_pair( edgeLength[ iE ], iE )); // sort edges by length } // Load columns of internal edges (forming holes) // and fill map ShapeIndex to TParam2ColumnMap for them @@ -2217,10 +2277,9 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, // Create 4 wall faces of a block // ------------------------------- - if ( nbEdges <= NB_WALL_FACES ) // ************* Split faces if necessary + if ( nbSides <= NB_WALL_FACES ) // ************* Split faces if necessary { - map< int, int > iE2nbSplit; - if ( nbEdges != NB_WALL_FACES ) // define how to split + if ( nbSides != NB_WALL_FACES ) // define how to split { if ( len2edgeMap.size() != nbEdges ) RETURN_BAD_RESULT("Uniqueness of edge lengths not assured"); @@ -2232,80 +2291,106 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, double midLen = ( len2edgeMap.size() == 1 ) ? 0 : midLen_i->first; switch ( nbEdges ) { case 1: // 0-th edge is split into 4 parts - iE2nbSplit.insert( make_pair( 0, 4 )); break; + nbSplitPerEdge[ 0 ] = 4; + break; case 2: // either the longest edge is split into 3 parts, or both edges into halves if ( maxLen / 3 > midLen / 2 ) { - iE2nbSplit.insert( make_pair( maxLen_i->second, 3 )); + nbSplitPerEdge[ maxLen_i->second ] = 3; } else { - iE2nbSplit.insert( make_pair( maxLen_i->second, 2 )); - iE2nbSplit.insert( make_pair( midLen_i->second, 2 )); + nbSplitPerEdge[ maxLen_i->second ] = 2; + nbSplitPerEdge[ midLen_i->second ] = 2; } break; case 3: - // split longest into halves - iE2nbSplit.insert( make_pair( maxLen_i->second, 2 )); + if ( nbSides == 2 ) + // split longest into 3 parts + nbSplitPerEdge[ maxLen_i->second ] = 3; + else + // split longest into halves + nbSplitPerEdge[ maxLen_i->second ] = 2; } } - // Create TSideFace's - int iSide = 0; - list< TopoDS_Edge >::const_iterator botE = thePrism.myBottomEdges.begin(); - for ( iE = 0; iE < nbEdges; ++iE, ++botE ) + } + else // **************************** Unite faces + { + int nbExraFaces = nbSides - 3; // nb of faces to fuse + for ( iE = 0; iE < nbEdges; ++iE ) { - TFaceQuadStructPtr quad = thePrism.myWallQuads[ iE ].front(); - // split? - map< int, int >::iterator i_nb = iE2nbSplit.find( iE ); - if ( i_nb != iE2nbSplit.end() ) { - // split! - int nbSplit = i_nb->second; - vector< double > params; - splitParams( nbSplit, &myParam2ColumnMaps[ iE ], params ); - const bool isForward = - StdMeshers_PrismAsBlock::IsForwardEdge( myHelper->GetMeshDS(), - myParam2ColumnMaps[iE], - *botE, SMESH_Block::ID_Fx0z ); - for ( int i = 0; i < nbSplit; ++i ) { - double f = ( isForward ? params[ i ] : params[ nbSplit - i-1 ]); - double l = ( isForward ? params[ i+1 ] : params[ nbSplit - i ]); - TSideFace* comp = new TSideFace( *mesh, wallFaceIds[ iSide ], - thePrism.myWallQuads[ iE ], *botE, - &myParam2ColumnMaps[ iE ], f, l ); - mySide->SetComponent( iSide++, comp ); - } + if ( nbUnitePerEdge[ iE ] < 0 ) + continue; + // look for already united faces + for ( int i = iE; i < iE + nbExraFaces; ++i ) + { + if ( nbUnitePerEdge[ i ] > 0 ) // a side including nbUnitePerEdge[i]+1 edge + nbExraFaces += nbUnitePerEdge[ i ]; + nbUnitePerEdge[ i ] = -1; } - else { + nbUnitePerEdge[ iE ] = nbExraFaces; + break; + } + } + + // Create TSideFace's + int iSide = 0; + list< TopoDS_Edge >::const_iterator botE = thePrism.myBottomEdges.begin(); + for ( iE = 0; iE < nbEdges; ++iE, ++botE ) + { + TFaceQuadStructPtr quad = thePrism.myWallQuads[ iE ].front(); + const int nbSplit = nbSplitPerEdge[ iE ]; + const int nbExraFaces = nbUnitePerEdge[ iE ] + 1; + if ( nbSplit > 0 ) // split + { + vector< double > params; + splitParams( nbSplit, &myParam2ColumnMaps[ iE ], params ); + const bool isForward = + StdMeshers_PrismAsBlock::IsForwardEdge( myHelper->GetMeshDS(), + myParam2ColumnMaps[iE], + *botE, SMESH_Block::ID_Fx0z ); + for ( int i = 0; i < nbSplit; ++i ) { + double f = ( isForward ? params[ i ] : params[ nbSplit - i-1 ]); + double l = ( isForward ? params[ i+1 ] : params[ nbSplit - i ]); TSideFace* comp = new TSideFace( *mesh, wallFaceIds[ iSide ], thePrism.myWallQuads[ iE ], *botE, - &myParam2ColumnMaps[ iE ]); + &myParam2ColumnMaps[ iE ], f, l ); mySide->SetComponent( iSide++, comp ); } } - } - else { // **************************** Unite faces - - // unite first faces - int nbExraFaces = nbEdges - 3; - int iSide = 0, iE; - double u0 = 0, sumLen = 0; - for ( iE = 0; iE < nbExraFaces; ++iE ) - sumLen += edgeLength[ iE ]; - - vector< TSideFace* > components( nbExraFaces ); - vector< pair< double, double> > params( nbExraFaces ); - list< TopoDS_Edge >::const_iterator botE = thePrism.myBottomEdges.begin(); - for ( iE = 0; iE < nbExraFaces; ++iE, ++botE ) + else if ( nbExraFaces > 1 ) // unite { - components[ iE ] = new TSideFace( *mesh, wallFaceIds[ iSide ], - thePrism.myWallQuads[ iE ], *botE, - &myParam2ColumnMaps[ iE ]); - double u1 = u0 + edgeLength[ iE ] / sumLen; - params[ iE ] = make_pair( u0 , u1 ); - u0 = u1; + double u0 = 0, sumLen = 0; + for ( int i = iE; i < iE + nbExraFaces; ++i ) + sumLen += edgeLength[ i ]; + + vector< TSideFace* > components( nbExraFaces ); + vector< pair< double, double> > params( nbExraFaces ); + bool endReached = false; + for ( int i = 0; i < nbExraFaces; ++i, ++botE, ++iE ) + { + if ( iE == nbEdges ) + { + endReached = true; + botE = thePrism.myBottomEdges.begin(); + iE = 0; + } + components[ i ] = new TSideFace( *mesh, wallFaceIds[ iSide ], + thePrism.myWallQuads[ iE ], *botE, + &myParam2ColumnMaps[ iE ]); + double u1 = u0 + edgeLength[ iE ] / sumLen; + params[ i ] = make_pair( u0 , u1 ); + u0 = u1; + } + TSideFace* comp = new TSideFace( *mesh, components, params ); + mySide->SetComponent( iSide++, comp ); + if ( endReached ) + break; + --iE; // for increment in an external loop on iE + --botE; } - mySide->SetComponent( iSide++, new TSideFace( *mesh, components, params )); - - // fill the rest faces - for ( ; iE < nbEdges; ++iE, ++botE ) + else if ( nbExraFaces < 0 ) // skip already united face + { + } + else // use as is { TSideFace* comp = new TSideFace( *mesh, wallFaceIds[ iSide ], thePrism.myWallQuads[ iE ], *botE, @@ -2423,15 +2508,20 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, } } -// gp_XYZ testPar(0.25, 0.25, 0), testCoord; -// if ( !FacePoint( ID_BOT_FACE, testPar, testCoord )) -// RETURN_BAD_RESULT("TEST FacePoint() FAILED"); -// SHOWYXZ("IN TEST PARAM" , testPar); -// SHOWYXZ("OUT TEST CORD" , testCoord); -// if ( !ComputeParameters( testCoord, testPar , ID_BOT_FACE)) -// RETURN_BAD_RESULT("TEST ComputeParameters() FAILED"); -// SHOWYXZ("OUT TEST PARAM" , testPar); - + // double _u[]={ 0.1, 0.1, 0.9, 0.9 }; + // double _v[]={ 0.1, 0.9, 0.1, 0.9, }; + // for ( int i = 0; i < 4; ++i ) + // { + // //gp_XYZ testPar(0.25, 0.25, 0), testCoord; + // gp_XYZ testPar(_u[i], _v[i], 0), testCoord; + // if ( !FacePoint( ID_BOT_FACE, testPar, testCoord )) + // RETURN_BAD_RESULT("TEST FacePoint() FAILED"); + // SHOWYXZ("IN TEST PARAM" , testPar); + // SHOWYXZ("OUT TEST CORD" , testCoord); + // if ( !ComputeParameters( testCoord, testPar , ID_BOT_FACE)) + // RETURN_BAD_RESULT("TEST ComputeParameters() FAILED"); + // SHOWYXZ("OUT TEST PARAM" , testPar); + // } return true; } @@ -2603,6 +2693,8 @@ StdMeshers_PrismAsBlock::TSideFace::TSideFace(SMESH_Mesh& mesh, myIsForward = StdMeshers_PrismAsBlock::IsForwardEdge( myHelper.GetMeshDS(), *myParamToColumnMap, myBaseEdge, myID ); + myHelper.SetSubShape( quadList.front()->face ); + if ( quadList.size() > 1 ) // side is vertically composite { // fill myShapeID2Surf map to enable finding a right surface by any sub-shape ID @@ -2646,7 +2738,20 @@ TSideFace(SMESH_Mesh& mesh, myIsForward( true ), myComponents( components ), myHelper( mesh ) -{} +{ + if ( myID == ID_Fx1z || myID == ID_F0yz ) + { + // reverse components + std::reverse( myComponents.begin(), myComponents.end() ); + std::reverse( myParams.begin(), myParams.end() ); + for ( size_t i = 0; i < myParams.size(); ++i ) + { + const double f = myParams[i].first; + const double l = myParams[i].second; + myParams[i] = make_pair( 1. - l, 1. - f ); + } + } +} //================================================================================ /*! * \brief Copy constructor @@ -2925,7 +3030,8 @@ gp_Pnt StdMeshers_PrismAsBlock::TSideFace::Value(const Standard_Real U, throw SALOME_Exception("StdMeshers_PrismAsBlock::TSideFace::Value() !mySurface"); } } - + ((TSideFace*) this)->myHelper.SetSubShape( mySurface->Face() ); + gp_XY uv1 = myHelper.GetNodeUV( mySurface->Face(), nn[0], nn[2]); gp_XY uv2 = myHelper.GetNodeUV( mySurface->Face(), nn[1], nn[3]); gp_XY uv12 = uv1 * ( 1 - vR ) + uv2 * vR; diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx index 5233cf9fd..a50a84b6d 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx @@ -62,21 +62,22 @@ public: StdMeshers_Quadrangle_2D(int hypId, int studyId, SMESH_Gen* gen); virtual ~StdMeshers_Quadrangle_2D(); - virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, - SMESH_Hypothesis::Hypothesis_Status& aStatus); + Hypothesis_Status& aStatus); - virtual bool Compute(SMESH_Mesh& aMesh, + virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); - virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - MapShapeNbElems& aResMap); + virtual bool Evaluate(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + MapShapeNbElems& aResMap); - FaceQuadStruct::Ptr CheckAnd2Dcompute(SMESH_Mesh& aMesh, + FaceQuadStruct::Ptr CheckAnd2Dcompute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, - const bool CreateQuadratic); + const bool CreateQuadratic); - FaceQuadStruct::Ptr CheckNbEdges(SMESH_Mesh& aMesh, + FaceQuadStruct::Ptr CheckNbEdges(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); protected: diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index d4a595ec5..5ec3c8fa1 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -42,8 +42,6 @@ #include "SMESH_subMesh.hxx" #include "SMESH_subMeshEventListener.hxx" -#include "utilities.h" - #include #include #include @@ -225,8 +223,11 @@ namespace VISCOUS_3D struct _Simplex { const SMDS_MeshNode *_nPrev, *_nNext; // nodes on a smoothed mesh surface - _Simplex(const SMDS_MeshNode* nPrev=0, const SMDS_MeshNode* nNext=0) - : _nPrev(nPrev), _nNext(nNext) {} + const SMDS_MeshNode *_nOpp; // in 2D case, a node opposite to a smoothed node in QUAD + _Simplex(const SMDS_MeshNode* nPrev=0, + const SMDS_MeshNode* nNext=0, + const SMDS_MeshNode* nOpp=0) + : _nPrev(nPrev), _nNext(nNext), _nOpp(nOpp) {} bool IsForward(const SMDS_MeshNode* nSrc, const gp_XYZ* pntTgt) const { const double M[3][3] = @@ -432,12 +433,18 @@ namespace VISCOUS_3D //vector _nodesAround; vector<_Simplex> _simplices; // for quality check + enum SmoothType { LAPLACIAN, CENTROIDAL, ANGULAR }; + bool Smooth(int& badNb, Handle(Geom_Surface)& surface, SMESH_MesherHelper& helper, const double refSign, - bool isCentroidal, + SmoothType how, bool set3D); + + gp_XY computeAngularPos(vector& uv, + const gp_XY& uvToFix, + const double refSign ); }; //-------------------------------------------------------------------------------- /*! @@ -1964,9 +1971,10 @@ void _ViscousBuilder::getSimplices( const SMDS_MeshNode* node, int srcInd = f->GetNodeIndex( node ); const SMDS_MeshNode* nPrev = f->GetNode( SMESH_MesherHelper::WrapIndex( srcInd-1, nbNodes )); const SMDS_MeshNode* nNext = f->GetNode( SMESH_MesherHelper::WrapIndex( srcInd+1, nbNodes )); + const SMDS_MeshNode* nOpp = f->GetNode( SMESH_MesherHelper::WrapIndex( srcInd+2, nbNodes )); if ( dataToCheckOri && dataToCheckOri->_reversedFaceIds.count( shapeInd )) std::swap( nPrev, nNext ); - simplices.push_back( _Simplex( nPrev, nNext )); + simplices.push_back( _Simplex( nPrev, nNext, nOpp )); } if ( toSort ) @@ -3553,7 +3561,7 @@ bool _ViscousBuilder::shrink() sm->getDependsOnIterator(/*includeSelf=*/false, /*complexShapeFirst=*/false); while ( subIt->more() ) { - SMESH_subMesh* sub = subIt->next(); + SMESH_subMesh* sub = subIt->next(); SMESHDS_SubMesh* subDS = sub->GetSubMeshDS(); if ( subDS->NbNodes() == 0 || !n2eMap.count( subDS->GetNodes()->next() )) continue; @@ -3597,12 +3605,13 @@ bool _ViscousBuilder::shrink() vector< _SmoothNode > nodesToSmooth( smoothNodes.size() ); { dumpFunction(SMESH_Comment("beforeShrinkFace")<first); // debug + const bool sortSimplices = isConcaveFace; for ( unsigned i = 0; i < smoothNodes.size(); ++i ) { const SMDS_MeshNode* n = smoothNodes[i]; nodesToSmooth[ i ]._node = n; // src nodes must be replaced by tgt nodes to have tgt nodes in _simplices - getSimplices( n, nodesToSmooth[ i ]._simplices, ignoreShapes, NULL, isConcaveFace ); + getSimplices( n, nodesToSmooth[ i ]._simplices, ignoreShapes, NULL, sortSimplices ); // fix up incorrect uv of nodes on the FACE helper.GetNodeUV( F, n, 0, &isOkUV); dumpMove( n ); @@ -3637,6 +3646,8 @@ bool _ViscousBuilder::shrink() bool shrinked = true; int badNb, shriStep=0, smooStep=0; + _SmoothNode::SmoothType smoothType + = isConcaveFace ? _SmoothNode::CENTROIDAL : _SmoothNode::LAPLACIAN; while ( shrinked ) { // Move boundary nodes (actually just set new UV) @@ -3650,6 +3661,7 @@ bool _ViscousBuilder::shrink() dumpFunctionEnd(); // Move nodes on EDGE's + // (XYZ is set as soon as a needed length reached in SetNewLength2d()) set< _Shrinker1D* >::iterator shr = eShri1D.begin(); for ( ; shr != eShri1D.end(); ++shr ) (*shr)->Compute( /*set3D=*/false, helper ); @@ -3669,8 +3681,7 @@ bool _ViscousBuilder::shrink() for ( unsigned i = 0; i < nodesToSmooth.size(); ++i ) { moved |= nodesToSmooth[i].Smooth( badNb,surface,helper,refSign, - /*isCentroidal=*/isConcaveFace, - /*set3D=*/isConcaveFace); + smoothType, /*set3D=*/isConcaveFace); } if ( badNb < oldBadNb ) nbNoImpSteps = 0; @@ -3682,32 +3693,26 @@ bool _ViscousBuilder::shrink() if ( badNb > 0 ) return error(SMESH_Comment("Can't shrink 2D mesh on face ") << f2sd->first ); } + // No wrongly shaped faces remain; final smooth. Set node XYZ. - // First, find out a needed quality of smoothing (high for quadrangles only) - bool highQuality; + bool isStructuredFixed = false; + if ( SMESH_2D_Algo* algo = dynamic_cast( sm->GetAlgo() )) + isStructuredFixed = algo->FixInternalNodes( *data._proxyMesh, F ); + if ( !isStructuredFixed ) { - const bool hasTria = _mesh->NbTriangles(), hasQuad = _mesh->NbQuadrangles(); - if ( hasTria != hasQuad ) { - highQuality = hasQuad; - } - else { - set nbNodesSet; - SMDS_ElemIteratorPtr fIt = smDS->GetElements(); - while ( fIt->more() && nbNodesSet.size() < 2 ) - nbNodesSet.insert( fIt->next()->NbCornerNodes() ); - highQuality = ( *nbNodesSet.begin() == 4 ); + if ( isConcaveFace ) + fixBadFaces( F, helper ); // fix narrow faces by swapping diagonals + for ( int st = /*highQuality ? 10 :*/ 3; st; --st ) + { + dumpFunction(SMESH_Comment("shrinkFace")<first<<"_st"<<++smooStep); // debug + for ( unsigned i = 0; i < nodesToSmooth.size(); ++i ) + { + nodesToSmooth[i].Smooth( badNb,surface,helper,refSign, + smoothType,/*set3D=*/st==1 ); + } + dumpFunctionEnd(); } } - if ( !highQuality && isConcaveFace ) - fixBadFaces( F, helper ); // fix narrow faces by swaping diagonals - for ( int st = highQuality ? 10 : 3; st; --st ) - { - dumpFunction(SMESH_Comment("shrinkFace")<first<<"_st"<<++smooStep); // debug - for ( unsigned i = 0; i < nodesToSmooth.size(); ++i ) - nodesToSmooth[i].Smooth( badNb,surface,helper,refSign, - /*isCentroidal=*/isConcaveFace,/*set3D=*/st==1 ); - dumpFunctionEnd(); - } // Set an event listener to clear FACE sub-mesh together with SOLID sub-mesh VISCOUS_3D::ToClearSubWithMain( sm, data._solid ); @@ -3755,6 +3760,7 @@ bool _ViscousBuilder::prepareEdgeToShrink( _LayerEdge& edge, double uvLen = uvDir.Magnitude(); uvDir /= uvLen; edge._normal.SetCoord( uvDir.X(),uvDir.Y(), 0); + edge._len = uvLen; // IMPORTANT to have src nodes NOT yet REPLACED by tgt nodes in shrinked faces vector faces; @@ -3784,7 +3790,7 @@ bool _ViscousBuilder::prepareEdgeToShrink( _LayerEdge& edge, } multimap< double, const SMDS_MeshNode* >::iterator p2n = proj2node.begin(), p2nEnd; - const double minProj = p2n->first; + const double minProj = p2n->first; const double projThreshold = 1.1 * uvLen; if ( minProj > projThreshold ) { @@ -4060,11 +4066,13 @@ bool _LayerEdge::SetNewLength2d( Handle(Geom_Surface)& surface, double proj = uvDirN * uvDir * kSafe; if ( proj < stepSize && proj > minStepSize ) stepSize = proj; + else if ( proj < minStepSize ) + stepSize = minStepSize; } } gp_Pnt2d newUV; - if ( stepSize == uvLen ) + if ( uvLen - stepSize < _len / 20. ) { newUV = tgtUV; _pos.clear(); @@ -4088,22 +4096,22 @@ bool _LayerEdge::SetNewLength2d( Handle(Geom_Surface)& surface, { TopoDS_Edge E = TopoDS::Edge( _sWOL ); const SMDS_MeshNode* n2 = _simplices[0]._nPrev; + SMDS_EdgePosition* tgtPos = static_cast( tgtNode->GetPosition() ); const double u2 = helper.GetNodeU( E, n2, tgtNode ); const double uSrc = _pos[0].Coord( U_SRC ); const double lenTgt = _pos[0].Coord( LEN_TGT ); double newU = _pos[0].Coord( U_TGT ); - if ( lenTgt < 0.99 * fabs( uSrc-u2 )) + if ( lenTgt < 0.99 * fabs( uSrc-u2 )) // n2 got out of src-tgt range { _pos.clear(); } else { - newU = 0.1 * uSrc + 0.9 * u2; + newU = 0.1 * tgtPos->GetUParameter() + 0.9 * u2; } - SMDS_EdgePosition* pos = static_cast( tgtNode->GetPosition() ); - pos->SetUParameter( newU ); + tgtPos->SetUParameter( newU ); #ifdef __myDEBUG gp_XY newUV = helper.GetNodeUV( F, tgtNode, _nodes[0]); gp_Pnt p = surface->Value( newUV.X(), newUV.Y() ); @@ -4125,7 +4133,7 @@ bool _SmoothNode::Smooth(int& badNb, Handle(Geom_Surface)& surface, SMESH_MesherHelper& helper, const double refSign, - bool isCentroidal, + SmoothType how, bool set3D) { const TopoDS_Face& face = TopoDS::Face( helper.GetSubShape() ); @@ -4137,7 +4145,30 @@ bool _SmoothNode::Smooth(int& badNb, // compute new UV for the node gp_XY newPos (0,0); - if ( isCentroidal && _simplices.size() > 3 ) +/* if ( how == ANGULAR && _simplices.size() == 4 ) + { + vector corners; corners.reserve(4); + for ( size_t i = 0; i < _simplices.size(); ++i ) + if ( _simplices[i]._nOpp ) + corners.push_back( helper.GetNodeUV( face, _simplices[i]._nOpp, _node )); + if ( corners.size() == 4 ) + { + newPos = helper.calcTFI + ( 0.5, 0.5, + corners[0], corners[1], corners[2], corners[3], + uv[1], uv[2], uv[3], uv[0] ); + } + // vector p( _simplices.size() * 2 + 1 ); + // p.clear(); + // for ( size_t i = 0; i < _simplices.size(); ++i ) + // { + // p.push_back( uv[i] ); + // if ( _simplices[i]._nOpp ) + // p.push_back( helper.GetNodeUV( face, _simplices[i]._nOpp, _node )); + // } + // newPos = computeAngularPos( p, helper.GetNodeUV( face, _node ), refSign ); + } + else*/ if ( how == CENTROIDAL && _simplices.size() > 3 ) { // average centers of diagonals wieghted with their reciprocal lengths if ( _simplices.size() == 4 ) @@ -4162,13 +4193,13 @@ bool _SmoothNode::Smooth(int& badNb, newPos += w * ( uv[i]+uv[i2] ); } } - newPos /= 2 * sumWeight; + newPos /= 2 * sumWeight; // 2 is to get a middle between uv's } } else { // Laplacian smooth - isCentroidal = false; + //isCentroidal = false; for ( size_t i = 0; i < _simplices.size(); ++i ) newPos += uv[i]; newPos /= _simplices.size(); @@ -4210,6 +4241,66 @@ bool _SmoothNode::Smooth(int& badNb, return ( (tgtUV-newPos).SquareModulus() > 1e-10 ); } +//================================================================================ +/*! + * \brief Computes new UV using angle based smoothing technic + */ +//================================================================================ + +gp_XY _SmoothNode::computeAngularPos(vector& uv, + const gp_XY& uvToFix, + const double refSign) +{ + uv.push_back( uv.front() ); + + vector< gp_XY > edgeDir( uv.size() ); + vector< double > edgeSize( uv.size() ); + for ( size_t i = 1; i < edgeDir.size(); ++i ) + { + edgeDir[i-1] = uv[i] - uv[i-1]; + edgeSize[i-1] = edgeDir[i-1].Modulus(); + if ( edgeSize[i-1] < numeric_limits::min() ) + edgeDir[i-1].SetX( 100 ); + else + edgeDir[i-1] /= edgeSize[i-1] * refSign; + } + edgeDir.back() = edgeDir.front(); + edgeSize.back() = edgeSize.front(); + + gp_XY newPos(0,0); + int nbEdges = 0; + double sumSize = 0; + for ( size_t i = 1; i < edgeDir.size(); ++i ) + { + if ( edgeDir[i-1].X() > 1. ) continue; + int i1 = i-1; + while ( edgeDir[i].X() > 1. && ++i < edgeDir.size() ); + if ( i == edgeDir.size() ) break; + gp_XY p = uv[i]; + gp_XY norm1( -edgeDir[i1].Y(), edgeDir[i1].X() ); + gp_XY norm2( -edgeDir[i].Y(), edgeDir[i].X() ); + gp_XY bisec = norm1 + norm2; + double bisecSize = bisec.Modulus(); + if ( bisecSize < numeric_limits::min() ) + { + bisec = -edgeDir[i1] + edgeDir[i]; + bisecSize = bisec.Modulus(); + } + bisec /= bisecSize; + + gp_XY dirToN = uvToFix - p; + double distToN = dirToN.Modulus(); + if ( bisec * dirToN < 0 ) + distToN = -distToN; + + newPos += ( p + bisec * distToN ) * ( edgeSize[i1] + edgeSize[i] ); + ++nbEdges; + sumSize += edgeSize[i1] + edgeSize[i]; + } + newPos /= /*nbEdges * */sumSize; + return newPos; +} + //================================================================================ /*! * \brief Delete _SolidData diff --git a/src/StdMeshersGUI/Makefile.am b/src/StdMeshersGUI/Makefile.am index da78f1cd9..237a974d7 100644 --- a/src/StdMeshersGUI/Makefile.am +++ b/src/StdMeshersGUI/Makefile.am @@ -110,4 +110,5 @@ libStdMeshersGUI_la_LDFLAGS = \ nodist_salomeres_DATA= \ StdMeshers_images.qm \ StdMeshers_msg_en.qm \ - StdMeshers_msg_fr.qm + StdMeshers_msg_fr.qm \ + StdMeshers_msg_ja.qm diff --git a/src/StdMeshersGUI/StdMeshers_msg_ja.ts b/src/StdMeshersGUI/StdMeshers_msg_ja.ts new file mode 100644 index 000000000..6c203b2bf --- /dev/null +++ b/src/StdMeshersGUI/StdMeshers_msg_ja.ts @@ -0,0 +1,487 @@ + + + + + @default + + SMESH_ARITHMETIC_1D_HYPOTHESIS + 算数 1 D + + + SMESH_ARITHMETIC_1D_PARAM + 算術の理由 + + + SMESH_ARITHMETIC_1D_TITLE + 仮説構築 + + + SMESH_AUTOMATIC_LENGTH_HYPOTHESIS + 長さの自動調整 + + + SMESH_AUTOMATIC_LENGTH_TITLE + 仮説構築 + + + SMESH_CONV_MODE + 変換モード + + + SMESH_CUT_NEG_MODE + 否定的なカットします。 + + + SMESH_DEFLECTION1D_HYPOTHESIS + たわみ 1 D + + + SMESH_DEFLECTION1D_PARAM + たわみ + + + SMESH_DEFLECTION1D_TITLE + 仮説構築 + + + SMESH_DENSITY_FUNC + 密度関数 + + + SMESH_DISTR + 配布 + + + SMESH_DISTR_EXPR + ピエゾ密度分布 + + + SMESH_DISTR_REGULAR + 等距離の分布 + + + SMESH_DISTR_SCALE + 規模の分布 + + + SMESH_DISTR_TAB + テーブルの密度分布 + + + SMESH_DISTR_TYPE + 分布の種類 + + + SMESH_END_LENGTH_PARAM + 最後の長さ + + + SMESH_EXPR_FUNC + 密度関数 + + + SMESH_EXP_MODE + 指数 + + + SMESH_FINENESS_PARAM + 細かさ + + + SMESH_FUNC_DOMAIN + 警告: 関数はセグメント [0..1] に定義する必要があります。 + + + SMESH_INSERT_ROW + 行を挿入します。 + + + SMESH_INVALID_FUNCTION + 関数が無効です。 + + + SMESH_LAYERS_DISTRIBUTION + 1 次元仮説 + + + SMESH_LAYER_DISTRIBUTION_HYPOTHESIS + 層の分布 + + + SMESH_LAYER_DISTRIBUTION_TITLE + 仮説構築 + + + SMESH_LOCAL_LENGTH_HYPOTHESIS + ローカルの長さ + + + SMESH_LOCAL_LENGTH_PARAM + 長さ + + + SMESH_LOCAL_LENGTH_PRECISION + 精度 + + + SMESH_LOCAL_LENGTH_TITLE + 仮説構築 + + + SMESH_FIXED_POINTS_1D_HYPOTHESIS + 固定ポイント 1 D + + + SMESH_FIXED_POINTS_1D_TITLE + 仮説構築 + + + SMESH_MAX_LENGTH_HYPOTHESIS + 最大長 + + + SMESH_CARTESIAN_PARAMS_HYPOTHESIS + 体継ぎ手パラメーター + + + SMESH_USE_PREESTIMATED_LENGTH + 伴う長さを使用します。 + + + SMESH_VISCOUS_LAYERS_HYPOTHESIS + 粘性層 + + + SMESH_VISCOUS_LAYERS_TITLE + 仮説構築 + + + SMESH_TOTAL_THICKNESS + 総厚 + + + SMESH_STRETCH_FACTOR + 伸縮係数 + + + SMESH_FACES_WO_LAYERS + 顔にレイヤー (入り江と oulets) + + + SMESH_EDGES_WO_LAYERS + エッジ層 (入り江と oulets) が不要 + + + SMESH_MAX_LENGTH_TITLE + 仮説構築 + + + SMESH_CARTESIAN_PARAMS_TITLE + 仮説構築 + + + SMESH_MAX_ELEMENT_AREA_HYPOTHESIS + 最大。要素エリア + + + SMESH_MAX_ELEMENT_AREA_PARAM + 最大。エリア + + + SMESH_MAX_ELEMENT_AREA_TITLE + 仮説構築 + + + SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS + 最大。要素音量 + + + SMESH_MAX_ELEMENT_VOLUME_PARAM + 最大。ボリューム + + + SMESH_MAX_ELEMENT_VOLUME_TITLE + 仮説構築 + + + SMESH_NB_SEGMENTS_HYPOTHESIS + セグメントの数 + + + SMESH_NB_SEGMENTS_PARAM + セグメントの数 + + + SMESH_NB_SEGMENTS_SCALE_PARAM + 尺度係数 + + + SMESH_NB_SEGMENTS_TITLE + 仮説構築 + + + SMESH_NO_CONV + 変換なし + + + SMESH_NUMBER_OF_LAYERS + 層の数 + + + SMESH_NUMBER_OF_LAYERS_HYPOTHESIS + ラジアル プリズム パラメーター + + + SMESH_NUMBER_OF_LAYERS_2D_HYPOTHESIS + 放射状の四角形パラメーター + + + SMESH_NUMBER_OF_LAYERS_TITLE + 仮説構築 + + + SMESH_NUMBER_OF_LAYERS_2D_TITLE + 仮説構築 + + + SMESH_PROJECTION_SOURCE_1D_HYPOTHESIS + 投射の源 1 D + + + SMESH_PROJECTION_SOURCE_1D_TITLE + 仮説構築 + + + SMESH_PROJECTION_SOURCE_2D_HYPOTHESIS + 投影ソース 2 D + + + SMESH_PROJECTION_SOURCE_2D_TITLE + 仮説構築 + + + SMESH_PROJECTION_SOURCE_3D_HYPOTHESIS + 投影ソースの 3 D + + + SMESH_PROJECTION_SOURCE_3D_TITLE + 仮説構築 + + + SMESH_IMPORT_SOURCE_1D_HYPOTHESIS + ソース エッジ + + + SMESH_IMPORT_SOURCE_1D_TITLE + 仮説構築 + + + SMESH_IMPORT_SOURCE_2D_HYPOTHESIS + ソース顔 + + + SMESH_IMPORT_SOURCE_2D_TITLE + 仮説構築 + + + SMESH_REMOVE_ROW + 行を削除します。 + + + SMESH_REVERSED_EDGES + 逆のエッジ + + + SMESH_FIXED_POINTS + 固定ポイント + + + SMESH_RANGE + 範囲 + + + SMESH_NB_SEGMENTS + 注意セグメント + + + SMESH_SAME_NB_SEGMENTS + 同じ注意セグメントすべての間隔 + + + SMESH_BASE_VERTEX + ベース頂点 + + + SMESH_SEGMENT_LENGTH_AROUND_VERTEX_HYPOTHESIS + 頂点の周りのセグメントの長さ + + + SMESH_SEGMENT_LENGTH_AROUND_VERTEX_PARAM + 長さ + + + SMESH_SEGMENT_LENGTH_AROUND_VERTEX_TITLE + 仮説構築 + + + SMESH_SOURCE_3DSHAPE + 元の 3 D 図形 + + + SMESH_SOURCE_EDGE + ソース エッジ + + + SMESH_SOURCE_EDGES + エッジのグループ + + + SMESH_SOURCE_FACE + ソース顔 + + + SMESH_SOURCE_FACES + 面のグループ + + + SMESH_SOURCE_MESH + ソース メッシュ + + + SMESH_COPY_MESH + メッシュをコピーするには + + + SMESH_TO_COPY_GROUPS + グループをコピーするには + + + SMESH_SOURCE_VERTEX + ソース頂点 + + + SMESH_SOURCE_VERTEX1 + ソース頂点 1 + + + SMESH_SOURCE_VERTEX2 + ソース頂点 2 + + + SMESH_START_END_LENGTH_HYPOTHESIS + 開始と終了ローカルの長さ + + + SMESH_START_END_LENGTH_TITLE + 仮説構築 + + + SMESH_START_LENGTH_PARAM + 長さを開始します。 + + + SMESH_TAB_FUNC + テーブル関数 + + + SMESH_TARGET_VERTEX + ターゲットの頂点 + + + SMESH_TARGET_VERTEX1 + ターゲット頂点 1 + + + SMESH_TARGET_VERTEX2 + ターゲット頂点 2 + + + SMESH_QUADRANGLE_PARAMS_HYPOTHESIS + 四角形のパラメーター + + + SMESH_QUADRANGLE_PARAMS_TITLE + 仮説構築 + + + SMESH_QUAD_TYPE + タイプ + + + + StdMeshersGUI_QuadrangleParamWdg + + SMESH_QUAD_TYPE_0 + 標準 + + + SMESH_QUAD_TYPE_1 + 三角形の好み + + + SMESH_QUAD_TYPE_2 + 四角形の設定 + + + SMESH_QUAD_TYPE_3 + (逆に) の四角形の設定 + + + SMESH_QUAD_TYPE_4 + 削減 + + + + StdMeshersGUI_LayerDistributionParamWdg + + CHANGE_TYPE + 種類の変更 + + + CREATE + 作成します。 + + + EDIT + 編集 + + + + StdMeshersGUI_CartesianParamCreator + + THRESHOLD + しきい値 + + + AXIS_X + X 軸 + + + AXIS_Y + Y 軸 + + + AXIS_Z + 軸、Z 軸 + + + + StdMeshersGUI::GridAxisTab + + GRID_DEF_MODE + 定義モード + + + SPACING + 間隔 + + + INSERT + 挿入 + + + COORD_STEP + ステップ + + + diff --git a/src/Tools/padder/meshjob/idl/MESHJOB.idl b/src/Tools/padder/meshjob/idl/MESHJOB.idl index 7b38811a5..92a87d986 100644 --- a/src/Tools/padder/meshjob/idl/MESHJOB.idl +++ b/src/Tools/padder/meshjob/idl/MESHJOB.idl @@ -50,7 +50,7 @@ module MESHJOB // // This defines the set of temporary folders used by the jobmanager - // when executing a job (may depends on the job). + // when executing a job (may depend on the job). struct MeshJobPaths { string local_inputdir; diff --git a/src/Tools/padder/resources/Makefile.am b/src/Tools/padder/resources/Makefile.am index 8d7907c84..bfb9c6a60 100644 --- a/src/Tools/padder/resources/Makefile.am +++ b/src/Tools/padder/resources/Makefile.am @@ -17,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SUBDIRS = appligen testdata +SUBDIRS = testdata include $(top_srcdir)/adm_local/unix/make_common_starter.am diff --git a/src/Tools/padder/resources/appligen/Makefile.am b/src/Tools/padder/resources/appligen/Makefile.am deleted file mode 100644 index 32c47ddd9..000000000 --- a/src/Tools/padder/resources/appligen/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2011-2013 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -include $(top_srcdir)/adm_local/unix/make_common_starter.am - -appligendir = $(salomeresdir)/appligen - -dist_appligen_DATA= \ - appli-splashscreen.jpg \ - SalomeApp.xml \ - CatalogResources.xml - -nodist_appligen_DATA= \ - envappli.sh \ - config_appli.xml - -nodist_appligen_SCRIPTS= \ - appligen.sh - -envappli.sh: - $(srcdir)/genenv.sh envappli.sh - -EXTRA_DIST += README.txt genenv.sh -CLEANFILES = envappli.sh diff --git a/src/Tools/padder/resources/appligen/README.txt b/src/Tools/padder/resources/appligen/README.txt index 6fb376cba..d865e0b1f 100644 --- a/src/Tools/padder/resources/appligen/README.txt +++ b/src/Tools/padder/resources/appligen/README.txt @@ -1,24 +1,4 @@ -This package defines a build procedure that creates a -set of files ready to use to generate a SALOME application -embedding this module. - -The files are created in the directory: - - /share/salome/resources//appligen - -Where is the installation directory of the module. - -To generate a SALOME application, just change directory to go -where you want to install the SALOME application and type the -following command in a standard shell (the SALOME environment -is not required, all paths are "hard" coded in the script): - - $ /share/salome/resources//appligen/appligen.sh - -This script generates an application in a directory ./appli. -Then type the following command to run a SALOME application -embedding your module: - - $ ./appli/runAppli -k - +This folder contains resources files that can be used to define +a custom application for the padder plugin. See the KERNEL documentation +concerning the SALOME application principles. diff --git a/src/Tools/padder/resources/appligen/appligen.sh.in b/src/Tools/padder/resources/appligen/appligen.sh.in deleted file mode 100755 index 2e63d01b1..000000000 --- a/src/Tools/padder/resources/appligen/appligen.sh.in +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# Copyright (C) 2011-2013 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# -# This script installs or updates a SALOME application for testing the -# PADDER plugin for SMESH. The application is installed in the -# directory ./appli. The configuration file is supposed to be adapted -# to your own environment (see config_appli.xml). -# -# To run this script, you should have first configure your -# shell with the SALOME environment, i.e. source the files -# prerequis.sh and envSalome.sh (or equivalent) that fit -# your configuration. You can alternatively customize the env.sh file -# to fit your SALOME environment and let the script do the job (see -# source below). -# -# (gboulant - 3/2/2011) -# - -here=$(dirname $0) - -# -# Run the appli_gen.py -# -APPLIDIR="./appli" -@KERNEL_ROOT_DIR@/bin/salome/appli_gen.py --prefix=$APPLIDIR --config=$here/config_appli.xml - -# -# Copy customized configuration files in the application -# -cp $here/SalomeApp.xml $APPLIDIR/. -cp $here/CatalogResources.xml $APPLIDIR/. -cp @prefix@/plugins/envPlugins.sh $APPLIDIR/env.d/. diff --git a/src/Tools/padder/resources/appligen/config_appli.xml.in b/src/Tools/padder/resources/appligen/config_appli.xml.in deleted file mode 100644 index 2f77f06a3..000000000 --- a/src/Tools/padder/resources/appligen/config_appli.xml.in +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/Tools/padder/resources/appligen/genenv.sh b/src/Tools/padder/resources/appligen/genenv.sh deleted file mode 100755 index b4323d1ae..000000000 --- a/src/Tools/padder/resources/appligen/genenv.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2011-2013 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This script creates a source file that defines a SALOME shell -# environment. We assume here that the SALOME environment has been -# previously set, so that the env command get all environment -# variables required for building and executing SALOME. We talk -# about third party software programs and libraries. The environment -# variables defining SALOME module are exluded (i.e. *_ROOT_DIR) -# because they are automatically set when generating a SALOME application.. -# -# The argument is the filepath to be created. -# - -if [ $# == 1 ]; then - ENVAPPLI_SH=$1 -else - ENVAPPLI_SH=envappli.sh -fi - -function header { - echo "#" - echo "# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - echo "# THIS FILE IS GENERATED from the shell environment used to build the SALOME module." - echo "# IT SHOULD NOT BE EDITED, it is generated for the need of the SALOME application " - echo "# that embeds the module (for test purposes). " - echo "# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - echo "#" -} -header > $ENVAPPLI_SH -env | grep -v -e PWD -e SalomeAppConfig -e _ROOT_DIR | while read f; do - key=$(echo $f | cut -d"=" -f1) - value=$(echo $f | cut -d"=" -f2-) - - # if the key is a path (LD_LIBRARY_PATH, PATH and PYTHONPATH) then - # we must extends the variable. - if [ $key == "LD_LIBRARY_PATH" -o $key == "PATH" -o $key == "PYTHONPATH" ]; then - echo export $key=\"$value:\$$key\" - else - echo export $key=\"$value\" - fi -done >> $ENVAPPLI_SH