-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_Arithmetic1D.cxx
// Author : Damien COQUERET, OCC
*/
//=============================================================================
+void StdMeshers_Arithmetic1D::SetReversedEdges( std::vector<int>& ids )
+{
+ if ( ids != _edgeIDs ) {
+ _edgeIDs = ids;
+
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+
ostream & StdMeshers_Arithmetic1D::SaveTo(ostream & save)
{
- save << _begLength << " " << _endLength;
+ int listSize = _edgeIDs.size();
+ save << _begLength << " " << _endLength << " " << listSize;
+
+ if ( listSize > 0 ) {
+ for ( int i = 0; i < listSize; i++)
+ save << " " << _edgeIDs[i];
+ save << " " << _objEntry;
+ }
+
return save;
}
istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load)
{
bool isOK = true;
+ int intVal;
isOK = (load >> _begLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
isOK = (load >> _endLength);
+
if (!isOK)
load.clear(ios::badbit | load.rdstate());
+
+ isOK = (load >> intVal);
+ if (isOK && intVal > 0) {
+ _edgeIDs.reserve( intVal );
+ for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+ isOK = (load >> intVal);
+ if ( isOK ) _edgeIDs.push_back( intVal );
+ }
+ isOK = (load >> _objEntry);
+ }
+
return load;
}