smesh/src/Driver/Driver_Mesh.h

84 lines
2.7 KiB
C
Raw Normal View History

2016-03-18 22:10:20 +05:00
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2009-02-17 10:27:49 +05:00
//
2012-08-09 16:03:55 +06:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2009-02-17 10:27:49 +05:00
//
2012-08-09 16:03:55 +06:00
// 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
2014-02-20 18:25:37 +06:00
// version 2.1 of the License, or (at your option) any later version.
2003-07-10 15:06:41 +06:00
//
2012-08-09 16:03:55 +06:00
// 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.
2003-07-10 15:06:41 +06:00
//
2012-08-09 16:03:55 +06:00
// 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
2003-07-10 15:06:41 +06:00
//
2012-08-09 16:03:55 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2003-07-10 15:06:41 +06:00
//
2012-08-09 16:03:55 +06:00
2009-02-17 10:27:49 +05:00
// SMESH Driver : implementaion of driver for reading and writing
2003-07-10 15:06:41 +06:00
// File : Mesh_Reader.h
// Module : SMESH
2009-02-17 10:27:49 +05:00
//
2004-12-01 15:48:31 +05:00
#ifndef _INCLUDE_DRIVER_MESH
#define _INCLUDE_DRIVER_MESH
2003-05-19 20:07:00 +06:00
2012-10-08 17:56:59 +06:00
#include "SMESH_ComputeError.hxx"
2003-05-19 20:07:00 +06:00
#include <string>
2012-08-09 16:03:55 +06:00
#include <vector>
2003-05-19 20:07:00 +06:00
#ifdef WIN32
2012-08-09 16:03:55 +06:00
#if defined MESHDRIVER_EXPORTS || defined MeshDriver_EXPORTS
#define MESHDRIVER_EXPORT __declspec( dllexport )
#else
#define MESHDRIVER_EXPORT __declspec( dllimport )
#endif
2005-08-31 16:10:42 +06:00
#else
#define MESHDRIVER_EXPORT
2005-08-31 16:10:42 +06:00
#endif
class MESHDRIVER_EXPORT Driver_Mesh
2003-09-04 16:56:52 +06:00
{
2004-12-01 15:48:31 +05:00
public:
Driver_Mesh();
virtual ~Driver_Mesh(){}
2003-05-19 20:07:00 +06:00
2004-12-01 15:48:31 +05:00
enum Status {
DRS_OK,
DRS_EMPTY, // a file contains no mesh with the given name
DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
2013-02-12 20:37:44 +06:00
DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
2004-12-01 15:48:31 +05:00
DRS_FAIL // general failure (exception etc.)
};
2012-10-08 17:56:59 +06:00
void SetMeshId(int theMeshId);
virtual void SetFile(const std::string& theFileName);
2012-10-08 17:56:59 +06:00
virtual void SetMeshName(const std::string& theMeshName);
2012-08-09 16:03:55 +06:00
virtual std::string GetMeshName() const;
2004-12-01 15:48:31 +05:00
2012-10-08 17:56:59 +06:00
virtual void SetOption(const std::string& optionName,
const std::string& optionValue) {}
virtual Status Perform() = 0;
virtual SMESH_ComputeErrorPtr GetError();
2004-12-01 15:48:31 +05:00
protected:
std::string myFile;
2012-08-09 16:03:55 +06:00
std::string myMeshName;
2012-10-08 17:56:59 +06:00
int myMeshId;
2003-05-19 20:07:00 +06:00
2012-08-09 16:03:55 +06:00
Status addMessage(const std::string& msg, const bool isFatal=false);
std::vector< std::string > myErrorMessages;
2012-10-08 17:56:59 +06:00
Status myStatus;
2003-05-19 20:07:00 +06:00
};
2004-12-01 15:48:31 +05:00
2003-05-19 20:07:00 +06:00
#endif