Win32 compatibility.

This commit is contained in:
rnv 2013-10-17 07:24:33 +00:00
parent 3e659a8a1d
commit 12c295f71d
35 changed files with 203 additions and 46 deletions

View File

@ -45,7 +45,7 @@ SALOME_CONFIGURE_FILE(conf.py.in conf.py)
# Their root dir were found when looking for Sphinx (FindSalomeSphinx.cmake):
SET(_pydir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
IF(WINDOWS)
IF(WIN32)
STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\${_pydir}\\site-packages\\salome\;%PYTHONPATH%
@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH%
@SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH%
@ -65,7 +65,7 @@ IF(WINDOWS)
")
SET(EXT "bat")
SET(CALL_STR "call")
ELSE(WINDOWS)
ELSE(WIN32)
SET(SCR " export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/${_pydir}/site-packages/salome:\${PYTHONPATH}
export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH}
export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH}
@ -93,7 +93,7 @@ ELSE(WINDOWS)
)
SET(EXT "sh")
SET(CALL_STR ".")
ENDIF(WINDOWS)
ENDIF(WIN32)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}")

View File

@ -34,18 +34,17 @@ SALOME_CONFIGURE_FILE(static/header.html.in ${builddir}/static/header.html)
SALOME_CONFIGURE_FILE(static/header_py.html.in ${builddir}/static/header_py.html)
SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
IF(WINDOWS)
IF(WIN32)
STRING(REPLACE "/" "\\" f ${f})
ENDIF(WINDOWS)
ENDIF(WIN32)
ADD_CUSTOM_TARGET(usr_docs mkdir -p tmp
ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py
COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
COMMAND ${PYTHON_EXECUTABLE} -c "import shutil; shutil.rmtree(r'''tmp''')"
COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''', ignore=shutil.ignore_patterns('*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*')); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM/geompy_doc'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''')"
COMMAND ${CMAKE_COMMAND} -E remove_directory tmp
VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
@ -53,5 +52,16 @@ ADD_CUSTOM_TARGET(usr_docs mkdir -p tmp
ADD_DEPENDENCIES(usr_docs html_docs)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${SALOME_INSTALL_DOC}/gui)
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${SALOME_INSTALL_DOC}/gui
PATTERN "*usr_docs*" EXCLUDE
PATTERN "*CMakeFiles*" EXCLUDE
PATTERN "static" EXCLUDE
PATTERN "Makefile*" EXCLUDE
PATTERN "*.cmake" EXCLUDE
PATTERN "doxyfile*" EXCLUDE
PATTERN "*.vcproj" EXCLUDE
)
INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)

View File

@ -25,9 +25,9 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
)
IF(WINDOWS)
IF(WIN32)
ADD_DEFINITIONS(-DNOGDI)
ENDIF(WINDOWS)
ENDIF(WIN32)
SET(SalomeIDLGEOM_IDLSOURCES

View File

@ -76,6 +76,10 @@
#include <SALOMEDS_wrap.hxx>
#include <GEOMImpl_Types.hxx>
#ifdef max
#undef max
#endif
const int theIntLimit = std::numeric_limits<int>::max() - 10;

View File

@ -40,6 +40,7 @@ SET(_link_LIBRARIES
${CAS_TKCDF}
${CAS_TKG3d}
${KERNEL_SALOMELocalTrace}
${KERNEL_OpUtil}
GEOMSketcher
)

View File

@ -180,9 +180,9 @@ class GEOM_Engine
const TCollection_AsciiString& anEntry,
Resource_DataMapOfAsciiStringAsciiString& aNameToEntry);
void DocumentModified(const int theDocId, const bool isModified);
Standard_EXPORT void DocumentModified(const int theDocId, const bool isModified);
bool DocumentModified(const int theDocId);
Standard_EXPORT bool DocumentModified(const int theDocId);
protected:
Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);

View File

@ -77,9 +77,9 @@ SET(_swig_SCRIPTS
SWIG_ADD_MODULE(libGEOM_Swig python libGEOM_Swig.i libGEOM_Swig.cxx)
SWIG_LINK_LIBRARIES(libGEOM_Swig "${_link_LIBRARIES}")
IF(WINDOWS)
IF(WIN32)
SET_TARGET_PROPERTIES(_libGEOM_Swig PROPERTIES DEBUG_OUTPUT_NAME _libGEOM_Swig_d)
ENDIF(WINDOWS)
ENDIF(WIN32)
INSTALL(TARGETS _libGEOM_Swig DESTINATION ${SALOME_INSTALL_PYTHON})

View File

@ -67,7 +67,7 @@ private slots:
void ClickOnOk();
bool ClickOnApply();
void ActivateThisDialog();
void LineEditReturnPressed();
// void LineEditReturnPressed();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void btnFileSelectClicked();

View File

@ -59,7 +59,7 @@ private slots:
void ClickOnOk();
bool ClickOnApply();
void ActivateThisDialog();
void LineEditReturnPressed();
// void LineEditReturnPressed();
void btnFileSelectClicked();
};

View File

@ -40,12 +40,13 @@ ADD_DEFINITIONS(
SET(_link_LIBRARIES
${PTHREAD_LIBRARIES}
${LIBXML2_LIBRARIES}
${CAS_TKBRep} ${CAS_TKTopAlgo}
${CAS_TKBRep} ${CAS_TKTopAlgo} ${CAS_TKG2d}
)
# --- headers ---
SET(XAO_HEADERS
XAO.hxx
XAO_BooleanField.hxx
XAO_BooleanStep.hxx
XAO_BrepGeometry.hxx

33
src/XAO/XAO.hxx Executable file
View File

@ -0,0 +1,33 @@
// Copyright (C) 2013 CEA/DEN, 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
//
// Author : Roman NIKOLAEV (OpenCascade)
#if defined XAO_EXPORTS || defined Xao_EXPORTS
#if defined WIN32
#define XAO_EXPORT __declspec( dllexport )
#else
#define XAO_EXPORT
#endif
#else
#if defined WIN32
#define XAO_EXPORT __declspec( dllimport )
#else
#define XAO_EXPORT
#endif
#endif

View File

@ -23,17 +23,23 @@
#include <string>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Field.hxx"
#include "XAO_BooleanStep.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class BooleanField
* Represents a field with boolean values.
*/
class BooleanField : public Field
class XAO_EXPORT BooleanField : public Field
{
public:
/**

View File

@ -23,16 +23,23 @@
#include <vector>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Step.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
/**
* @class BooleanStep
* Step with boolean values.
*/
class BooleanStep : public Step
class XAO_EXPORT BooleanStep : public Step
{
public:
/**

View File

@ -26,16 +26,22 @@
#include <TopoDS_Shape.hxx>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Geometry.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class BrepGeometry
* Representation of a BRep Geometry.
*/
class BrepGeometry : public Geometry
class XAO_EXPORT BrepGeometry : public Geometry
{
public:
/**

View File

@ -23,17 +23,23 @@
#include <string>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Field.hxx"
#include "XAO_DoubleStep.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class DoubleField
* Represents a field with double values.
*/
class DoubleField : public Field
class XAO_EXPORT DoubleField : public Field
{
public:
/**

View File

@ -23,16 +23,22 @@
#include <vector>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Step.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class DoubleStep
* Step with double values.
*/
class DoubleStep : public Step
class XAO_EXPORT DoubleStep : public Step
{
public:
/**

View File

@ -21,13 +21,16 @@
#ifndef __XAO_EXCEPTION_HXX__
#define __XAO_EXCEPTION_HXX__
#include "XAO.hxx"
#include <exception>
namespace XAO
{
/**
* \class XAO_Exception
* Exception for XAO operations.
*/
class XAO_Exception : public std::exception
class XAO_EXPORT XAO_Exception : public std::exception
{
public:
/**

View File

@ -44,7 +44,7 @@ Field::Field(const XAO::Dimension& dimension,
Field::~Field()
{
for (int i = 0; i < m_steps.size(); ++i)
for (unsigned int i = 0; i < m_steps.size(); ++i)
delete m_steps[i];
}
@ -81,7 +81,7 @@ throw (XAO_Exception)
void Field::setComponentsNames(const std::vector<std::string>& names)
throw (XAO_Exception)
{
for (int i = 0; i < names.size(); ++i)
for (unsigned int i = 0; i < names.size(); ++i)
{
if (i < m_nbComponents)
m_components[i] = names[i];

View File

@ -24,9 +24,16 @@
#include <string>
#include <vector>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Step.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
typedef std::vector<Step*>::iterator stepIterator;
@ -35,7 +42,7 @@ namespace XAO
* @class Field
* A geometrical Field.
*/
class Field
class XAO_EXPORT Field
{
protected:
/**

View File

@ -23,15 +23,23 @@
#include <string>
#include <map>
#include "XAO.hxx"
#include "XAO_Exception.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
/**
* \class GeometricElement
* Generic class to manipulate a topologic element (vertex, edge, face or solid).
*/
class GeometricElement
class XAO_EXPORT GeometricElement
{
public:
/**
@ -100,7 +108,7 @@ namespace XAO
* \class GeometricElementList
* Generic class to manipulate a list of topologic element.
*/
class GeometricElementList
class XAO_EXPORT GeometricElementList
{
public:
/**

View File

@ -23,17 +23,23 @@
#include <string>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Exception.hxx"
#include "XAO_GeometricElement.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class Geometry
* Base class for geometries.
*/
class Geometry
class XAO_EXPORT Geometry
{
protected:
/**

View File

@ -24,15 +24,18 @@
#include <string>
#include <set>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#ifdef WIN32
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
/**
* \class Group
* Class to represent a Geometrical Group.
*/
class Group
class XAO_EXPORT Group
{
public:
/**

View File

@ -23,17 +23,23 @@
#include <string>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Field.hxx"
#include "XAO_IntegerStep.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class IntegerField
* Represents a field with integer values.
*/
class IntegerField : public Field
class XAO_EXPORT IntegerField : public Field
{
public:
/**

View File

@ -23,16 +23,23 @@
#include <vector>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Step.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
/**
* @class IntegerStep
* Step with integer values.
*/
class IntegerStep : public Step
class XAO_EXPORT IntegerStep : public Step
{
public:
/**

View File

@ -21,15 +21,21 @@
#ifndef __XAO_STEP_HXX__
#define __XAO_STEP_HXX__
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class Step
* Base class for steps.
*/
class Step
class XAO_EXPORT Step
{
protected:
/** Default constructor. */

View File

@ -23,17 +23,22 @@
#include <string>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Field.hxx"
#include "XAO_StringStep.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class StringField
* Represents a field with string values.
*/
class StringField : public Field
class XAO_EXPORT StringField : public Field
{
public:
/**

View File

@ -24,16 +24,22 @@
#include <string>
#include <vector>
#include "XAO.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Step.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
/**
* @class StringStep
* Step with strings values.
*/
class StringStep : public Step
class XAO_EXPORT StringStep : public Step
{
public:
/**

View File

@ -23,10 +23,17 @@
#include <string>
#include <list>
#include "XAO.hxx"
#include "XAO_Exception.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Geometry.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#pragma warning(disable:4251) // Warning dll-interface ...
#endif
namespace XAO
{
class Group;
@ -40,7 +47,7 @@ namespace XAO
* @class Xao
* The Xao class describes the XAO format.
*/
class Xao
class XAO_EXPORT Xao
{
public:
/**

View File

@ -21,18 +21,23 @@
#ifndef __XAO_XAOEXPORTER_HXX__
#define __XAO_XAOEXPORTER_HXX__
#include "XAO.hxx"
#include "XAO_Xao.hxx"
#include "XAO_Geometry.hxx"
#include "XAO_Group.hxx"
#include "XAO_Field.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
/**
* @class XaoExporter
* Util class for import/export XAO.
*/
class XaoExporter
class XAO_EXPORT XaoExporter
{
public:
/**

View File

@ -20,6 +20,7 @@
#include <sstream>
#include "XAO_Exception.hxx"
#include "XAO_Xao.hxx"
#include "XAO_XaoUtils.hxx"

View File

@ -25,8 +25,12 @@
#include <string>
#include <exception>
#include "XAO.hxx"
#include "XAO_Exception.hxx"
#ifdef WIN32
#pragma warning(disable:4290) // Warning Exception ...
#endif
namespace XAO
{
@ -66,7 +70,7 @@ namespace XAO
* \class XaoUtils
* Utilities class to convert types.
*/
class XaoUtils
class XAO_EXPORT XaoUtils
{
public:
/**

View File

@ -152,7 +152,7 @@ void BrepGeometryTest::testGetEdgeVertices()
void printVector(std::vector<int>& v)
{
std::cout << "# ";
for (int i = 0; i < v.size(); i++)
for (unsigned int i = 0; i < v.size(); i++)
std::cout << v[i] << ", ";
std::cout << std::endl;
}
@ -266,7 +266,7 @@ void BrepGeometryTest::testParse()
{
std::cout << " Shell #" << shellIndex << std::endl;
std::vector<int> faces = geom->getSolidFaces(solidIndex, shellIndex);
for (int indf = 0; indf < faces.size(); ++indf)
for (unsigned int indf = 0; indf < faces.size(); ++indf)
{
int faceIndex = faces[indf];
std::cout << " Face #" << geom->getFaceReference(faceIndex) << std::endl;
@ -276,7 +276,7 @@ void BrepGeometryTest::testParse()
{
std::cout << " Wire #" << wireIndex << std::endl;
std::vector<int> edges = geom->getFaceEdges(faceIndex, wireIndex);
for (int inde = 0; inde < edges.size(); ++inde)
for (unsigned int inde = 0; inde < edges.size(); ++inde)
{
int edgeIndex = edges[inde];
std::cout << " Edge #" << geom->getEdgeReference(edgeIndex) << " : ";

View File

@ -12,7 +12,8 @@ namespace XAO
static std::string getTestFilePath(const std::string& fileName)
{
std::string dataDir = getenv("GEOM_SRC_DIR");
dataDir += "/src/XAO/tests/data/" + fileName;
dataDir += "/src/XAO/tests/data/";
dataDir += fileName;
return dataDir;
}

View File

@ -59,9 +59,9 @@ SET_SOURCE_FILES_PROPERTIES(xao.i PROPERTIES SWIG_DEFINITIONS "-shadow")
SWIG_ADD_MODULE(xao python xao.i)
SWIG_LINK_LIBRARIES(xao "${_link_LIBRARIES}")
IF(WINDOWS)
IF(WIN32)
SET_TARGET_PROPERTIES(_xao PROPERTIES DEBUG_OUTPUT_NAME _xao_d)
ENDIF(WINDOWS)
ENDIF(WIN32)
INSTALL(TARGETS _xao DESTINATION ${SALOME_INSTALL_PYTHON})
INSTALL(FILES xao.i DESTINATION ${SALOME_INSTALL_HEADERS})

View File

@ -1,5 +1,6 @@
%module xao
%{
#include "XAO.hxx"
#include "XAO_Exception.hxx"
#include "XAO_XaoUtils.hxx"
#include "XAO_Xao.hxx"
@ -48,6 +49,7 @@ namespace std
%ignore XAO::MsgBuilder;
%ignore XAO::XaoUtils;
%include "XAO.hxx"
%include XAO_Exception.hxx
%include XAO_XaoUtils.hxx