X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_StartEndLength.cxx;h=58a5584ad3ec08e1f6d46275fcc24573db88d2cb;hp=9974f6a3b4a600c13dfcec3e5bf9d04fbb7f0934;hb=cb55604f37e3d2583272fd436bb6557b041948b5;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index 9974f6a3b..58a5584ad 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // 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. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,7 +20,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// SMESH StdMeshers_StartEndLength : implementaion of SMESH idl descriptions +// SMESH StdMeshers_StartEndLength : implementation of SMESH idl descriptions // File : StdMeshers_StartEndLength.cxx // Module : SMESH // @@ -47,10 +47,8 @@ using namespace std; */ //============================================================================= -StdMeshers_StartEndLength::StdMeshers_StartEndLength(int hypId, - int studyId, - SMESH_Gen * gen) - :SMESH_Hypothesis(hypId, studyId, gen) +StdMeshers_StartEndLength::StdMeshers_StartEndLength( int hypId, SMESH_Gen* gen ) + :StdMeshers_Reversible1D(hypId, gen) { _begLength = 1.; _endLength = 10.; @@ -75,7 +73,6 @@ StdMeshers_StartEndLength::~StdMeshers_StartEndLength() //============================================================================= void StdMeshers_StartEndLength::SetLength(double length, bool isStartLength) - throw(SALOME_Exception) { if ( (isStartLength ? _begLength : _endLength) != length ) { if (length <= 0) @@ -106,21 +103,6 @@ double StdMeshers_StartEndLength::GetLength(bool isStartLength) const */ //============================================================================= -void StdMeshers_StartEndLength::SetReversedEdges( std::vector& ids ) -{ - if ( ids != _edgeIDs ) { - _edgeIDs = ids; - - NotifySubMeshesHypothesisModification(); - } -} - -//============================================================================= -/*! - * - */ -//============================================================================= - ostream & StdMeshers_StartEndLength::SaveTo(ostream & save) { int listSize = _edgeIDs.size(); @@ -146,49 +128,27 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load) { bool isOK = true; int intVal; - isOK = (load >> _begLength); + isOK = static_cast(load >> _begLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _endLength); + isOK = static_cast(load >> _endLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - - isOK = (load >> intVal); + + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; } -//============================================================================= -/*! - * - */ -//============================================================================= - -ostream & operator <<(ostream & save, StdMeshers_StartEndLength & hyp) -{ - return hyp.SaveTo( save ); -} - -//============================================================================= -/*! - * - */ -//============================================================================= - -istream & operator >>(istream & load, StdMeshers_StartEndLength & hyp) -{ - return hyp.LoadFrom( load ); -} - //================================================================================ /*! * \brief Initialize start and end length by the mesh built on the geometry