From: ouv Date: Mon, 17 Apr 2006 11:26:40 +0000 (+0000) Subject: Windows porting. X-Git-Tag: Before_Merging_BR_DEBUG_3_2_0b1_01jun06~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ac2a6743439757382520eef2473a3831ad081c91;p=modules%2Fvisu.git Windows porting. --- diff --git a/src/CONVERTOR/VISUConvertor.cxx b/src/CONVERTOR/VISUConvertor.cxx index 273b62a8..6b7c5c25 100644 --- a/src/CONVERTOR/VISUConvertor.cxx +++ b/src/CONVERTOR/VISUConvertor.cxx @@ -56,6 +56,7 @@ void parseFile(const char* theFileName) try{ #endif MSG(MYDEBUG,"'"< aCon(CreateConvertor(theFileName)); //aCon->GetSize(); //return; diff --git a/src/CONVERTOR/VISUConvertor.hxx b/src/CONVERTOR/VISUConvertor.hxx new file mode 100755 index 00000000..f58b9faa --- /dev/null +++ b/src/CONVERTOR/VISUConvertor.hxx @@ -0,0 +1,47 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : VISUConvertor.hxx +// Author : Oleg UVAROV +// Module : VISU + +#ifndef _VISUConvertor_HXX_ +#define _VISUConvertor_HXX_ + +#ifdef WNT + #if defined VISU_CONVERTOR_EXPORTS + #if defined WIN32 + #define VISU_CONVERTOR_EXPORT __declspec( dllexport ) + #else + #define VISU_CONVERTOR_EXPORT + #endif + #else + #if defined WIN32 + #define VISU_CONVERTOR_EXPORT __declspec( dllimport ) + #else + #define VISU_CONVERTOR_EXPORT + #endif + #endif +#else + #define VISU_CONVERTOR_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/CONVERTOR/VISU_Convertor.cxx b/src/CONVERTOR/VISU_Convertor.cxx index f417ad07..830be503 100644 --- a/src/CONVERTOR/VISU_Convertor.cxx +++ b/src/CONVERTOR/VISU_Convertor.cxx @@ -84,7 +84,7 @@ VISU_Convertor int iEnd = strlen(aName); static int VtkHighLevelLength = 12; //25 if(iEnd > VtkHighLevelLength) iEnd = VtkHighLevelLength; - char aNewName[iEnd+1]; + char* aNewName = new char[iEnd+1]; aNewName[iEnd] = '\0'; strncpy(aNewName,aName,iEnd); replace(aNewName,aNewName+iEnd,' ','_'); @@ -92,5 +92,6 @@ VISU_Convertor aName = aNewName; else aName.sprintf("%s_%d",aNewName,theTimeId); + delete[] aNewName; return aName.latin1(); } diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 4a5ac993..d38f7d22 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -32,6 +32,7 @@ \brief The file contains definitions for basic classes of the VISU CONVERTER package */ +#include "VISUConvertor.hxx" #include "VISU_IDMapper.hxx" #include "VISU_ConvertorDef.hxx" @@ -248,7 +249,7 @@ namespace VISU Also, it can perform some additional work to calculate expected amount of memory to build defined VTK representation */ -class VISU_Convertor +class VISU_CONVERTOR_EXPORT VISU_Convertor { protected: std::string myName; @@ -404,8 +405,9 @@ public: extern "C" { +VISU_CONVERTOR_EXPORT //! Instatiate proper VISU_Convertor subclass - VISU_Convertor* + VISU_Convertor* CreateConvertor(const std::string& theFileName); }; diff --git a/src/CONVERTOR/VISU_ConvertorUtils.hxx b/src/CONVERTOR/VISU_ConvertorUtils.hxx index 154589fc..715e9e60 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.hxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.hxx @@ -31,6 +31,8 @@ #include +#include "VISUConvertor.hxx" + #include "MED_Utilities.hxx" class vtkUnstructuredGrid; @@ -46,7 +48,7 @@ namespace VISU{ void WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName); - class TTimerLog + class VISU_CONVERTOR_EXPORT TTimerLog { int myIsDebug; double myCPUTime; diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index ba2a8ad5..f4948349 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -57,7 +57,7 @@ static float ERR_SIZE_CALC = 1.00; static int MYVTKDEBUG = 0; #ifdef _DEBUG_ -static int MYDEBUG = 0; +static int MYDEBUG = 1; static int MYDEBUGWITHFILES = 0; //#define _DEXCEPT_ #else @@ -1643,6 +1643,12 @@ namespace } } } + float aScalarRange[2]; + theSource->Update(); + theSource->GetScalarRange( aScalarRange ); + //cout << theSource->GetNumberOfPoints() << endl; + theSource->Print( cout ); + aFloatArray->Delete(); aDataArray->Delete(); } @@ -2225,6 +2231,8 @@ VISU_Convertor_impl aGaussPtsIDFilter->myIsVTKDone = true; + anOutput->Print( cout ); + if(MYDEBUGWITHFILES){ string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1(); string aFieldName = QString(theFieldName.c_str()).simplifyWhiteSpace().latin1(); diff --git a/src/CONVERTOR/VISU_Convertor_impl.hxx b/src/CONVERTOR/VISU_Convertor_impl.hxx index c4efc7d2..54602dee 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.hxx +++ b/src/CONVERTOR/VISU_Convertor_impl.hxx @@ -39,6 +39,7 @@ class vtkUnstructuredGrid; class VTKViewer_AppendFilter; class VISU_MergeFilter; +#include "VISUConvertor.hxx" #include "VISU_Convertor.hxx" #include "MED_SliceArray.hxx" @@ -57,11 +58,11 @@ namespace VISU ePOLYGONE=400, ePOLYEDRE=500, eNONE=-1}; //! Get number of nodes for defined geometrical type - vtkIdType + VISU_CONVERTOR_EXPORT vtkIdType VISUGeom2NbNodes(EGeometry theGeom); //! Maps VISU geometrical type to VTK one - vtkIdType + VISU_CONVERTOR_EXPORT vtkIdType VISUGeom2VTK(EGeometry theGeom); //--------------------------------------------------------------- @@ -80,7 +81,7 @@ namespace VISU //--------------------------------------------------------------- //! Define an utility base class which is repsonsible for preventing repetion - struct TIsVTKDone: virtual TBaseStructure + struct VISU_CONVERTOR_EXPORT TIsVTKDone: virtual TBaseStructure { TIsVTKDone(); bool myIsDone; //!< Say, is the corresponding MED entity already loaded into intermediate data structure @@ -90,7 +91,7 @@ namespace VISU //--------------------------------------------------------------- //! Define an utility base class which allow to keep calculated number of cells and their size - struct TSizeCounter: virtual TIsVTKDone + struct VISU_CONVERTOR_EXPORT TSizeCounter: virtual TIsVTKDone { TSizeCounter(); vtkIdType myNbCells; //!< Number of cells contained into corresponding sublclass @@ -100,7 +101,7 @@ namespace VISU //--------------------------------------------------------------- //! Define a container for VTK representation - class TSource: public virtual TSizeCounter + class VISU_CONVERTOR_EXPORT TSource: public virtual TSizeCounter { protected: mutable TVTKSource mySource; @@ -123,7 +124,7 @@ namespace VISU /*! This container allow to combine other VTK representation into single one. */ - class TAppendFilter: public virtual TIsVTKDone, + class VISU_CONVERTOR_EXPORT TAppendFilter: public virtual TIsVTKDone, public virtual TIDMapper { protected: @@ -147,7 +148,7 @@ namespace VISU /*! This container allow to assign data to mesh and represent them into single VTK representation */ - class TMergeFilter: public virtual TIsVTKDone, + class VISU_CONVERTOR_EXPORT TMergeFilter: public virtual TIsVTKDone, public virtual TIDMapper { protected: @@ -172,7 +173,7 @@ namespace VISU typedef TCSlice TCCoordSlice; //! This class is responsible for representation of mesh nodes - class TPointCoords: public virtual TBaseStructure + class VISU_CONVERTOR_EXPORT TPointCoords: public virtual TBaseStructure { protected: vtkIdType myDim; //!< Dimension of the nodal coordinates @@ -226,7 +227,7 @@ namespace VISU In additition to its base functionlity it support mapping of VTK to object numeration and keeps names for each of nodes. */ - class TNamedPointCoords: public virtual TPointCoords + class VISU_CONVERTOR_EXPORT TNamedPointCoords: public virtual TPointCoords { protected: typedef TVector TPointsDim; @@ -270,7 +271,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TMesh to provide VTK mapping for nodes - struct TMeshImpl: virtual TMesh, + struct VISU_CONVERTOR_EXPORT TMeshImpl: virtual TMesh, virtual TIsVTKDone { PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes @@ -288,7 +289,7 @@ namespace VISU typedef enum {eRemoveAll, eAddAll, eAddPart, eNone} ESubMeshStatus; //! Specialize TSubProfile to provide VTK mapping - struct TSubProfileImpl: virtual TSubProfile, + struct VISU_CONVERTOR_EXPORT TSubProfileImpl: virtual TSubProfile, virtual TSource { TSubProfileImpl(); @@ -320,7 +321,7 @@ namespace VISU typedef std::map TGeom2SubProfile; //! Specialize TProfile to provide VTK mapping for MED TIMESTAMP mesh - struct TProfileImpl: virtual TProfile, + struct VISU_CONVERTOR_EXPORT TProfileImpl: virtual TProfile, virtual TAppendFilter { TProfileImpl(); @@ -384,7 +385,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh - struct TIDMapperFilter: virtual TMergeFilter + struct VISU_CONVERTOR_EXPORT TIDMapperFilter: virtual TMergeFilter { TAppendFilter myIDMapper; //!< Responsible for numbering TSource mySource; //!< Keeps assigned data @@ -432,7 +433,7 @@ namespace VISU typedef SharedPtr PGaussImpl; //! Specialize TGauss to provide more detail information of the MED GAUSS entity for VTK mapping - struct TGaussImpl: virtual TGauss + struct VISU_CONVERTOR_EXPORT TGaussImpl: virtual TGauss { EGeometry myGeom; //!< Define, to which geometrical type the MED GAUSS entity belongs std::string myName; //!< Keeps name of the MED GAUSS entity @@ -448,7 +449,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TGaussSubMesh to provide VTK mapping for the entity - struct TGaussSubMeshImpl: virtual TGaussSubMesh, + struct VISU_CONVERTOR_EXPORT TGaussSubMeshImpl: virtual TGaussSubMesh, virtual TSource { TGaussSubMeshImpl(); @@ -477,7 +478,7 @@ namespace VISU typedef std::map TGeom2GaussSubMesh; //! Specialize TGaussMesh to provide VTK mapping for the entity - struct TGaussMeshImpl: virtual TGaussMesh, + struct VISU_CONVERTOR_EXPORT TGaussMeshImpl: virtual TGaussMesh, virtual TAppendFilter { TGaussMeshImpl(); @@ -507,7 +508,7 @@ namespace VISU //--------------------------------------------------------------- //! Specialize TGaussPtsIDMapper to provide VTK mapping for MED TIMESTAMP mesh - struct TGaussPtsIDFilter: virtual TIDMapperFilter, + struct VISU_CONVERTOR_EXPORT TGaussPtsIDFilter: virtual TIDMapperFilter, virtual TGaussPtsIDMapper { PGaussPtsIDMapper myGaussPtsIDMapper; @@ -530,7 +531,7 @@ namespace VISU typedef TVector TCell2Connect; //! The class is responsible for mapping of cells of defined geometrical type - struct TSubMeshImpl: virtual TSource + struct VISU_CONVERTOR_EXPORT TSubMeshImpl: virtual TSource { //! To implement the TIDMapper::GetElemObjID @@ -554,7 +555,7 @@ namespace VISU typedef TVector TSubMeshArr; //! Specialize TMeshOnEntity to provide VTK mapping for the entity - struct TMeshOnEntityImpl: virtual TMeshOnEntity, + struct VISU_CONVERTOR_EXPORT TMeshOnEntityImpl: virtual TMeshOnEntity, virtual TAppendFilter, virtual TSizeCounter { @@ -601,7 +602,7 @@ namespace VISU typedef std::map TGeom2SubMeshID; //! Specialize TFamily to provide VTK mapping for the entity - struct TFamilyImpl: virtual TFamily, + struct VISU_CONVERTOR_EXPORT TFamilyImpl: virtual TFamily, virtual TSource { //! Reimplement the TIDMapper::GetNodeObjID @@ -642,7 +643,7 @@ namespace VISU typedef TVector TFamilyArr; //! Specialize TGroup to provide VTK mapping for the entity - struct TGroupImpl: virtual TGroup, + struct VISU_CONVERTOR_EXPORT TGroupImpl: virtual TGroup, virtual TAppendFilter { //! Calculate pair of values - number of cells and its size @@ -680,7 +681,7 @@ namespace VISU typedef TVector TMinMaxArr; //! Specialize TField to provide VTK mapping for the entity - struct TFieldImpl: virtual TField + struct VISU_CONVERTOR_EXPORT TFieldImpl: virtual TField { vtkIdType myDataSize; //!< Keeps size of the assigned data @@ -709,7 +710,7 @@ namespace VISU typedef TVector TValueSliceArr; //! Define a container to get access to data assigned to mesh - struct TMeshValue + struct VISU_CONVERTOR_EXPORT TMeshValue { TValue myValue; //!< Keeps all values as one dimensional sequence @@ -747,7 +748,7 @@ namespace VISU typedef std::map TGeom2NbGauss; //! Specialize TValForTime to provide VTK mapping for the entity - struct TValForTimeImpl: virtual TValForTime + struct VISU_CONVERTOR_EXPORT TValForTimeImpl: virtual TValForTime { PGaussPtsIDFilter myGaussPtsIDFilter; //!< Keep VTK representation for mesh and data on Gauss Points PIDMapperFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data @@ -778,7 +779,7 @@ namespace VISU It implements VISU_Convertor public interface and declare new pure virtual functions to fill its intermediate data structure from a MED source */ -class VISU_Convertor_impl: public VISU_Convertor +class VISU_CONVERTOR_EXPORT VISU_Convertor_impl: public VISU_Convertor { public: VISU_Convertor_impl(); diff --git a/src/CONVERTOR/VISU_IDMapper.hxx b/src/CONVERTOR/VISU_IDMapper.hxx index 57cf9ee7..7863917d 100644 --- a/src/CONVERTOR/VISU_IDMapper.hxx +++ b/src/CONVERTOR/VISU_IDMapper.hxx @@ -32,6 +32,8 @@ \brief The file contains declarations for basic interfaces that defines mapping of mesh elements */ +#include "VISUConvertor.hxx" + #include "MED_SharedPtr.hxx" #include @@ -46,7 +48,7 @@ namespace VISU //--------------------------------------------------------------- //! Defines a basic class for intemediate data structures - struct TBaseStructure + struct VISU_CONVERTOR_EXPORT TBaseStructure { //! Just to provide possibility of dynamic navigation through the class hierarchy virtual ~TBaseStructure() @@ -64,7 +66,7 @@ namespace VISU Where object ID means ID which attached to corresponding MED entity. For example, each MED node can have its own ID as well as any other mesh cell */ - struct TIDMapper: virtual TBaseStructure + struct VISU_CONVERTOR_EXPORT TIDMapper: virtual TBaseStructure { //! Get node object ID for corresponding VTK ID virtual diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 2eaddcfe..18508813 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -47,10 +47,10 @@ using MED::TFloat; using MED::EBooleen; #ifdef _DEBUG_ -static int MYDEBUG = 0; -static int MYVALUEDEBUG = 0; -static int MY_FAMILY_DEBUG = 0; -static int MY_GROUP_DEBUG = 0; +static int MYDEBUG = 1; +static int MYVALUEDEBUG = 1; +static int MY_FAMILY_DEBUG = 1; +static int MY_GROUP_DEBUG = 1; //#define _DEXCEPT_ #else static int MYDEBUG = 0; @@ -62,7 +62,7 @@ static int MY_GROUP_DEBUG = 0; #define _LOAD_FAMILIES_ #define _EDF_NODE_IDS_ -namespace +namespace VISU { //--------------------------------------------------------------- vtkIdType @@ -135,7 +135,7 @@ namespace MEDEntityToVTK(MED::EEntiteMaillage theMEDEntity) { switch(theMEDEntity){ - case MED::eNOEUD: return NODE_ENTITY; + case MED::eNOEUD: return VISU::NODE_ENTITY; case MED::eARETE: return EDGE_ENTITY; case MED::eFACE: return FACE_ENTITY; case MED::eMAILLE: return CELL_ENTITY; @@ -149,7 +149,7 @@ namespace VTKEntityToMED(TEntity theVTKEntity) { switch(theVTKEntity){ - case NODE_ENTITY: return MED::eNOEUD; + case VISU::NODE_ENTITY: return MED::eNOEUD; case EDGE_ENTITY: return MED::eARETE; case FACE_ENTITY: return MED::eFACE; case CELL_ENTITY: return MED::eMAILLE; @@ -428,7 +428,7 @@ namespace TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh"); INITMSG(MYDEBUG,"InitGaussMesh"<myEntity; int isPointsUpdated = 0, isCellsOnEntityUpdated = 0; - if(anEntity == NODE_ENTITY){ + if(anEntity == VISU::NODE_ENTITY){ isPointsUpdated += LoadPoints(aMed,theMesh); }else{ isPointsUpdated += LoadPoints(aMed,theMesh); @@ -1403,7 +1403,7 @@ VISU_MedConvertor const TEntity& anEntity = theMeshOnEntity->myEntity; int isPointsUpdated = 0, isCellsOnEntityUpdated = 0; - if(anEntity == NODE_ENTITY){ + if(anEntity == VISU::NODE_ENTITY){ isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,theFamily); }else{ isPointsUpdated += LoadPoints(aMed,theMesh); @@ -1430,7 +1430,7 @@ VISU_MedConvertor PMEDFamily aFamily = *aFamilyIter; const TEntity& anEntity = aFamily->myEntity; const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity]; - if(anEntity == NODE_ENTITY){ + if(anEntity == VISU::NODE_ENTITY){ isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily); }else{ isPointsUpdated += LoadPoints(aMed,theMesh); @@ -1458,7 +1458,7 @@ VISU_MedConvertor const TEntity& anEntity = theMeshOnEntity->myEntity; int isPointsUpdated = 0, isCellsOnEntityUpdated = 0; isPointsUpdated += LoadPoints(aMed,theMesh); - if(anEntity != NODE_ENTITY) + if(anEntity != VISU::NODE_ENTITY) isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity); int isFieldUpdated = LoadValForTimeOnMesh(aMed,theMesh,theMeshOnEntity,theField,theValForTime); @@ -1481,7 +1481,7 @@ VISU_MedConvertor const TEntity& anEntity = theMeshOnEntity->myEntity; int isPointsUpdated = 0, isCellsOnEntityUpdated = 0; - if(anEntity != NODE_ENTITY) + if(anEntity != VISU::NODE_ENTITY) isCellsOnEntityUpdated += LoadCellsOnEntity(aMed,theMesh,theMeshOnEntity); int isFieldUpdated = LoadValForTimeOnGaussPts(aMed,theMesh,theMeshOnEntity,theField,theValForTime); @@ -1500,7 +1500,7 @@ VISU_MedConvertor //Check on existing family PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[VISU::NODE_ENTITY]; aMeshOnEntity->myMeshName = theMesh->myName; - aMeshOnEntity->myEntity = NODE_ENTITY; + aMeshOnEntity->myEntity = VISU::NODE_ENTITY; INITMSG(MYDEBUG,"LoadPoints - theMesh->myIsDone = "<myIsDone<<"'\n"); @@ -1524,7 +1524,10 @@ VISU_MedConvertor TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem); MED::TCCoordSlice aMCoordSlice = aNodeInfo->GetCoordSlice(iElem); for(int iDim = 0; iDim < aDim; iDim++) - aVCoordSlice[iDim] = aMCoordSlice[iDim]; + { + cout << iElem << " " << aMCoordSlice[iDim] << endl; + aVCoordSlice[iDim] = aMCoordSlice[iDim]; + } } TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh; diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 45dc68bc..8ac28f76 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -26,6 +26,8 @@ #include "SALOME_NamingService.hxx" #include "Utils_ExceptHandlers.hxx" +#include + using namespace std; #ifdef _DEBUG_ @@ -34,9 +36,20 @@ static int MYDEBUG = 1; static int MYDEBUG = 0; #endif +#ifdef WNT +#ifdef VISU_ENGINE_EXPORTS +#define VISU_ENGINE_EXPORT __declspec(dllexport) +#else +#define VISU_ENGINE_EXPORT __declspec(dllimport) +#endif +#else +#define VISU_ENGINE_EXPORT +#endif + UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception); extern "C" { +VISU_ENGINE_EXPORT PortableServer::ObjectId * VISUEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName) @@ -62,7 +75,8 @@ namespace VISU{ CORBA::Object_ptr anObject = aNamingService.Resolve("/Kernel/Session"); SALOME::Session_var aSession = SALOME::Session::_narrow(anObject); //aSession->GetInterface(); - Engines::Component_var aComponent = aSession->GetComponent("libVISUEngineImpl.so"); + //Engines::Component_var aComponent = aSession->GetComponent("libVISUEngineImpl.so"); + Engines::Component_var aComponent = aSession->GetComponent("VISUEngineImpl.dll"); myVisuGen = VISU::VISU_Gen::_narrow(aComponent); } diff --git a/src/GUITOOLS/VisuGUITools.h b/src/GUITOOLS/VisuGUITools.h new file mode 100755 index 00000000..d8fbf8a6 --- /dev/null +++ b/src/GUITOOLS/VisuGUITools.h @@ -0,0 +1,47 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : VisuGUITools.h +// Author : Oleg UVAROV +// Module : VISU + +#ifndef _VisuGUITools_H_ +#define _VisuGUITools_H_ + +#ifdef WNT + #if defined VISU_GUITOOLS_EXPORTS + #if defined WIN32 + #define VISU_GUITOOLS_EXPORT __declspec( dllexport ) + #else + #define VISU_GUITOOLS_EXPORT + #endif + #else + #if defined WIN32 + #define VISU_GUITOOLS_EXPORT __declspec( dllimport ) + #else + #define VISU_GUITOOLS_EXPORT + #endif + #endif +#else + #define VISU_GUITOOLS_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/GUITOOLS/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h index 82481f9e..859d919a 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.h +++ b/src/GUITOOLS/VisuGUI_TableDlg.h @@ -20,7 +20,9 @@ class VisuGUI_TableWidget; #include -class VisuGUI_TableDlg : public QDialog +#include "VisuGUITools.h" + +class VISU_GUITOOLS_EXPORT VisuGUI_TableDlg : public QDialog { Q_OBJECT diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index ffeab72e..381c0388 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -46,7 +46,7 @@ class vtkInteractorStyle; class VTKViewer_ShrinkFilter; class VISU_PipeLine; -#ifdef _WIN_32 +#ifdef _WIN32 #define VTKOCC_EXPORT __declspec (dllexport) #else #define VTKOCC_EXPORT VTK_EXPORT diff --git a/src/OBJECT/VISU_GaussPtsSettings.h b/src/OBJECT/VISU_GaussPtsSettings.h index 1778521d..c1c89b2d 100644 --- a/src/OBJECT/VISU_GaussPtsSettings.h +++ b/src/OBJECT/VISU_GaussPtsSettings.h @@ -34,6 +34,7 @@ class vtkImageData; +#include "VISU_Actor.h" //============================================================================ namespace VISU @@ -46,7 +47,7 @@ namespace VISU //! Base class of Gauss Points settings. -class VISU_GaussPtsSettings : public vtkObject +class VTKOCC_EXPORT VISU_GaussPtsSettings : public vtkObject { public: vtkTypeMacro( VISU_GaussPtsSettings, vtkObject ); @@ -101,7 +102,7 @@ class VISU_GaussPtsSettings : public vtkObject * Clamp, Texture, Alpha threshold, Const size and Color. * Used by Gauss Points Actor. */ -class VISU_InsideCursorSettings : public VISU_GaussPtsSettings +class VTKOCC_EXPORT VISU_InsideCursorSettings : public VISU_GaussPtsSettings { public: vtkTypeMacro( VISU_InsideCursorSettings, vtkObject ); @@ -132,7 +133,7 @@ class VISU_InsideCursorSettings : public VISU_GaussPtsSettings * Clamp, Texture, Alpha threshold, Const size and Color. * Used by Gauss Points Actor. */ -class VISU_OutsideCursorSettings : public VISU_GaussPtsSettings +class VTKOCC_EXPORT VISU_OutsideCursorSettings : public VISU_GaussPtsSettings { public: vtkTypeMacro( VISU_OutsideCursorSettings, vtkObject ); @@ -168,7 +169,7 @@ class VISU_OutsideCursorSettings : public VISU_GaussPtsSettings * Camera movement steps number and Display parent mesh. * Used by Gauss Points Actor. */ -class VISU_PickingSettings : public vtkObject +class VTKOCC_EXPORT VISU_PickingSettings : public vtkObject { public: enum { BelowPoint = 0, TopLeftCorner }; diff --git a/src/PIPELINE/VISUPipeLine.cxx b/src/PIPELINE/VISUPipeLine.cxx index d1ac8fe3..22852f28 100644 --- a/src/PIPELINE/VISUPipeLine.cxx +++ b/src/PIPELINE/VISUPipeLine.cxx @@ -56,9 +56,11 @@ using namespace std; static int isOnlyMesh = false; -int main(int argc, char** argv){ - try{ - if(argc > 1){ +int main(int argc, char** argv) +{ + try { + if(argc > 1) + { vtkRenderWindow *renWin = vtkRenderWindow::New(); vtkRenderer *ren = vtkRenderer::New(); renWin->AddRenderer(ren); @@ -76,97 +78,104 @@ int main(int argc, char** argv){ const VISU::PMesh aMesh = aMeshMapIter->second; const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter; - if(isOnlyMesh){ - const VISU::TEntity& anEntity = VISU::CELL_ENTITY; - aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity); + if(isOnlyMesh) + { + const VISU::TEntity& anEntity = VISU::CELL_ENTITY; + aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity); - VISU::PIDMapper anIDMapper = - aConvertor->GetMeshOnEntity(aMeshName,anEntity); - VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput(); + VISU::PIDMapper anIDMapper = + aConvertor->GetMeshOnEntity(aMeshName,anEntity); + VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput(); - VISU_MeshPL* aPresent = VISU_MeshPL::New(); - aPresent->SetInput(aDataSet); - aPresent->Build(); + VISU_MeshPL* aPresent = VISU_MeshPL::New(); + aPresent->SetInput(aDataSet); + aPresent->Build(); - vtkActor* aActor = vtkActor::New(); - aActor->SetMapper(aPresent->GetMapper()); - aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME); - //ren->ResetCameraClippingRange(); + vtkActor* aActor = vtkActor::New(); + aActor->SetMapper(aPresent->GetMapper()); + aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME); + //ren->ResetCameraClippingRange(); - ren->AddActor(aActor); + ren->AddActor(aActor); - renWin->Render(); - iren->Start(); - return 0; + renWin->Render(); + iren->Start(); + return 0; } //Import fields aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); - for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) { - const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; - const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; - const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; - VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); - for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){ - const VISU::PField aField = aFieldMapIter->second; - /* - if(aField->myNbComp == 1) - continue; - */ - const string& aFieldName = aFieldMapIter->first; - const VISU::TValField& aValField = aField->myValField; - VISU::TValField::const_iterator aValFieldIter = aValField.begin(); - if(aValFieldIter == aValField.end()) return 0; - int aTimeStamp = aValFieldIter->first; - - TPresent* aPresent = TPresent::New(); - VISU::PIDMapper anIDMapper; - if(anEntity != VISU::NODE_ENTITY){ - VISU::PGaussPtsIDMapper aGaussPtsIDMapper = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp); - aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper); - }else{ - continue; - VISU::PIDMapper anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); - aPresent->SetIDMapper(anIDMapper); - } - - aPresent->Build(); - aPresent->Init(); - - char aMainTexture[80]; - strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) ); - strcat( aMainTexture, "/share/salome/resources/sprite_texture.vti" ); - //cout << aMainTexture << endl; - - char anAlphaTexture[80]; - strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) ); - strcat( anAlphaTexture, "/share/salome/resources/sprite_alpha.vti" ); - //cout << anAlphaTexture << endl; - - vtkSmartPointer aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); - aPresent->SetImageData( aTextureValue.GetPointer() ); - - aPresent->Update(); - - vtkActor* anActor = vtkActor::New(); - anActor->SetMapper(aPresent->GetMapper()); - - VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New(); - aScalarBar->SetLookupTable(aPresent->GetBarTable()); - - ren->AddActor(anActor); - ren->AddActor2D(aScalarBar); - - renWin->Render(); - ren->ResetCamera(); - - iren->Start(); - return 0; - } + for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) + { + const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first; + const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second; + const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); + + for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++) + { + const VISU::PField aField = aFieldMapIter->second; + //if(aField->myNbComp == 1) + // continue; + const string& aFieldName = aFieldMapIter->first; + const VISU::TValField& aValField = aField->myValField; + VISU::TValField::const_iterator aValFieldIter = aValField.begin(); + if(aValFieldIter == aValField.end()) return 0; + int aTimeStamp = aValFieldIter->first; + + TPresent* aPresent = TPresent::New(); + VISU::PIDMapper anIDMapper; + if(anEntity != VISU::NODE_ENTITY) + { + VISU::PGaussPtsIDMapper aGaussPtsIDMapper = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp); + aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper); + } + else + { + continue; + VISU::PIDMapper anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp); + aPresent->SetIDMapper(anIDMapper); + } + + aPresent->Build(); + aPresent->Init(); + + char aMainTexture[80]; + strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) ); + strcat( aMainTexture, "/share/salome/resources/sprite_texture.vti" ); + //cout << aMainTexture << endl; + + char anAlphaTexture[80]; + strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) ); + strcat( anAlphaTexture, "/share/salome/resources/sprite_alpha.vti" ); + //cout << anAlphaTexture << endl; + + vtkSmartPointer aTextureValue = VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture ); + aPresent->SetImageData( aTextureValue.GetPointer() ); + + aPresent->Update(); + + vtkActor* anActor = vtkActor::New(); + anActor->SetMapper(aPresent->GetMapper()); + + VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New(); + aScalarBar->SetLookupTable(aPresent->GetBarTable()); + + ren->AddActor(anActor); + ren->AddActor2D(aScalarBar); + + renWin->Render(); + ren->ResetCamera(); + + iren->Start(); + return 0; + } } } - }catch(std::exception& exc){ + } + catch(std::exception& exc){ MESSAGE("Follow exception was occured :\n"< class vtkAppendPolyData; -class VISU_CutPlanesPL : public VISU_ScalarMapPL{ +class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL{ protected: VISU_CutPlanesPL(); VISU_CutPlanesPL(const VISU_CutPlanesPL&); diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index 9c2f95a7..81c06f03 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -27,13 +27,14 @@ #ifndef VISU_DeformedShapePL_HeaderFile #define VISU_DeformedShapePL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_ScalarMapPL.hxx" class vtkCellDataToPointData; class SALOME_Transform; class vtkWarpVector; -class VISU_DeformedShapePL : public VISU_ScalarMapPL{ +class VISU_PIPELINE_EXPORT VISU_DeformedShapePL : public VISU_ScalarMapPL{ protected: VISU_DeformedShapePL(); VISU_DeformedShapePL(const VISU_DeformedShapePL&); diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 8d1d0dff..a667a8e1 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -196,6 +196,10 @@ VISU_GaussPointsPL Superclass::Init(); vtkDataSet* aDataSet = GetParentMesh(); + aDataSet->Update(); + + aDataSet->Print( cout ); + float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); float* aScalarRange = GetScalarRange(); diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index b342ab56..b0dfa879 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -28,6 +28,7 @@ #ifndef VISU_GaussPointsPL_HeaderFile #define VISU_GaussPointsPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_ScalarMapPL.hxx" #include "VISU_Convertor.hxx" @@ -52,7 +53,7 @@ class SALOME_Transform; * This class uses the special mapper (VISU_OpenGLPointSpriteMapper) * for rendering the Gauss Points as Point Sprites. */ -class VISU_GaussPointsPL : public VISU_ScalarMapPL +class VISU_PIPELINE_EXPORT VISU_GaussPointsPL : public VISU_ScalarMapPL { protected: VISU_GaussPointsPL(); diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx index 8f46e43b..d61549f9 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx @@ -34,6 +34,9 @@ // purpose : //================================================================== #include + +#include "VISUPipeline.hxx" + class VISU_UnScaledActor: public vtkFollower { @@ -60,7 +63,7 @@ protected: class vtkImplicitFunction; -class VISU_ImplicitFunctionWidget : public vtk3DWidget +class VISU_PIPELINE_EXPORT VISU_ImplicitFunctionWidget : public vtk3DWidget { public: vtkTypeRevisionMacro(VISU_ImplicitFunctionWidget,vtk3DWidget); diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index 68732e37..b16d93c0 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -27,12 +27,13 @@ #ifndef VISU_IsoSurfacesPL_HeaderFile #define VISU_IsoSurfacesPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_ScalarMapPL.hxx" class vtkContourFilter; class vtkCellDataToPointData; -class VISU_IsoSurfacesPL : public VISU_ScalarMapPL{ +class VISU_PIPELINE_EXPORT VISU_IsoSurfacesPL : public VISU_ScalarMapPL{ protected: VISU_IsoSurfacesPL(); VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&); diff --git a/src/PIPELINE/VISU_LookupTable.hxx b/src/PIPELINE/VISU_LookupTable.hxx index 20f7c23e..ccaf84f7 100644 --- a/src/PIPELINE/VISU_LookupTable.hxx +++ b/src/PIPELINE/VISU_LookupTable.hxx @@ -23,7 +23,7 @@ class VISU_LookupTable: public vtkLookupTable { float GetMapScale() { return myScale; } void SetMapScale(float theScale = 1.0); - float GetBicolor() { return myBicolor; } + bool GetBicolor() { return myBicolor; } void SetBicolor( bool theBicolor ); static int ComputeLogRange(float inRange[2], float outRange[2]); diff --git a/src/PIPELINE/VISU_MeshPL.hxx b/src/PIPELINE/VISU_MeshPL.hxx index 27be219c..5a1aaf0d 100644 --- a/src/PIPELINE/VISU_MeshPL.hxx +++ b/src/PIPELINE/VISU_MeshPL.hxx @@ -27,9 +27,10 @@ #ifndef VISU_MeshPL_HeaderFile #define VISU_MeshPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_PipeLine.hxx" -class VISU_MeshPL : public VISU_PipeLine{ +class VISU_PIPELINE_EXPORT VISU_MeshPL : public VISU_PipeLine{ protected: VISU_MeshPL(); VISU_MeshPL(const VISU_MeshPL&); diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index d8eb9e8a..b956554f 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -45,7 +45,9 @@ #include #include +#ifndef WIN32 #include +#endif #include #include @@ -65,6 +67,8 @@ vtkStandardNewMacro(VISU_OpenGLPointSpriteMapper); #define VTK_PDPSM_NORMAL_TYPE_DOUBLE 0x0020 #define VTK_PDPSM_OPAQUE_COLORS 0x0040 +//#ifndef WIN32 + #ifndef APIENTRY #define APIENTRY #endif @@ -136,6 +140,27 @@ static PFNGLDELETEBUFFERSARBPROC vglDeleteBuffersARB = NULL int InitializeARB() { +#ifdef WIN32 + HMODULE OpenGLLibrary = ::LoadLibrary( "nvoglnt.dll" ); + + FARPROC vglShaderSourceARB1 = GetProcAddress( OpenGLLibrary, "DrvGetProcAddress" ); + vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)::GetProcAddress( OpenGLLibrary, "glShaderSourceARB" ); + vglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)::GetProcAddress( OpenGLLibrary, "glCreateShaderObjectARB" ); + vglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)::GetProcAddress( OpenGLLibrary, "glCompileShaderARB" ); + vglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)::GetProcAddress( OpenGLLibrary, "glCreateProgramObjectARB" ); + vglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)::GetProcAddress( OpenGLLibrary, "glAttachObjectARB" ); + vglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)::GetProcAddress( OpenGLLibrary, "glLinkProgramARB" ); + vglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)::GetProcAddress( OpenGLLibrary, "glUseProgramObjectARB" ); + vglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)::GetProcAddress( OpenGLLibrary, "glGetObjectParameterivARB" ); + vglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)::GetProcAddress( OpenGLLibrary, "glGetInfoLogARB" ); + vglGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)::GetProcAddress( OpenGLLibrary, "glGetAttribLocationARB" ); + vglVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)::GetProcAddress( OpenGLLibrary, "glVertexAttrib1fARB" ); + + vglGenBuffersARB = (PFNGLGENBUFFERSARBPROC)::GetProcAddress( OpenGLLibrary, "glGenBuffersARB" ); + vglBindBufferARB = (PFNGLBINDBUFFERARBPROC)::GetProcAddress( OpenGLLibrary, "glBindBufferARB" ); + vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)::GetProcAddress( OpenGLLibrary, "glBufferDataARB" ); + vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)::GetProcAddress( OpenGLLibrary, "glDeleteBuffersARB" ); +#else void* OpenGLLibrary = dlopen( "libGL.so", RTLD_LAZY ); vglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)dlsym( OpenGLLibrary, "glShaderSourceARB" ); @@ -154,11 +179,16 @@ int InitializeARB() vglBindBufferARB = (PFNGLBINDBUFFERARBPROC)dlsym( OpenGLLibrary, "glBindBufferARB" ); vglBufferDataARB = (PFNGLBUFFERDATAARBPROC)dlsym( OpenGLLibrary, "glBufferDataARB" ); vglDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)dlsym( OpenGLLibrary, "glDeleteBuffersARB" ); +#endif + return 1; }; static int IsARBInitialized = InitializeARB(); + +//#endif // #ifndef WIN32 + static float Tolerance = 1.0 / VTK_LARGE_FLOAT; //----------------------------------------------------------------------------- @@ -416,7 +446,7 @@ float ViewToDisplay( vtkRenderer* theRenderer ) theRenderer->ViewToDisplay(); theRenderer->GetDisplayPoint( p2 ); - float coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 ); + float coefficient = sqrt( (double)( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) ) / sqrt( (double)2 ); //cout << p1[0] << " " << p1[1] << " " << p1[2] << endl; //cout << p2[0] << " " << p2[1] << " " << p2[2] << endl; //cout << "ZOOM : " << coefficient << endl; diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index 1ddb55ff..10e04be9 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -32,6 +32,10 @@ # pragma warning ( disable : 4275 ) #endif +#ifdef WIN32 +#include +#endif + #include #include @@ -60,6 +64,8 @@ class vtkXMLImageDataReader; typedef GLuint GLhandleARB; #endif +#include "VISUPipeline.hxx" + //---------------------------------------------------------------------------- //! OpenGL Point Sprites PolyData Mapper. /*! @@ -70,7 +76,7 @@ typedef GLuint GLhandleARB; * usage of the pipeline is larger than this limit, the mapper will divide * the data into pieces and render each in a for loop. */ -class VISU_OpenGLPointSpriteMapper : public MAPPER_SUPERCLASS +class VISU_PIPELINE_EXPORT VISU_OpenGLPointSpriteMapper : public MAPPER_SUPERCLASS { public: //! The Point Sprites rendering mode. diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 5e2a1ed8..7485975f 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -31,6 +31,7 @@ #include #include +#include "VISUPipeline.hxx" #include "VISU_IDMapper.hxx" class vtkCell; @@ -81,7 +82,7 @@ class SALOME_ExtractGeometry; typedef VISU::TVTKOutput TInput; -class VISU_PipeLine : public vtkObject{ +class VISU_PIPELINE_EXPORT VISU_PipeLine : public vtkObject{ public: vtkTypeMacro(VISU_PipeLine,vtkObject); virtual @@ -209,7 +210,6 @@ public: protected: VISU_PipeLine(); - VISU_PipeLine(const VISU_PipeLine&); virtual TInput* diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index 7b252350..06d054de 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -27,6 +27,7 @@ #ifndef VISU_PipeLineUtils_HeaderFile #define VISU_PipeLineUtils_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_FieldTransform.hxx" #include "VISU_LookupTable.hxx" #include "VISU_Extractor.hxx" @@ -56,8 +57,8 @@ #endif namespace VISU{ - void Mul(const float A[3], float b, float C[3]); // C = A * b - void Sub(const float A[3], const float B[3], float C[3]); // C = A - B + VISU_PIPELINE_EXPORT void Mul(const float A[3], float b, float C[3]); // C = A * b + VISU_PIPELINE_EXPORT void Sub(const float A[3], const float B[3], float C[3]); // C = A - B template void diff --git a/src/PIPELINE/VISU_PlanesWidget.hxx b/src/PIPELINE/VISU_PlanesWidget.hxx index fdf45367..8561b9c7 100644 --- a/src/PIPELINE/VISU_PlanesWidget.hxx +++ b/src/PIPELINE/VISU_PlanesWidget.hxx @@ -29,6 +29,7 @@ #ifndef __VISU_PlanesWidget_h #define __VISU_PlanesWidget_h +#include "VISUPipeline.hxx" #include "VISU_ImplicitFunctionWidget.hxx" class vtkActor; class vtkPolyDataMapper; @@ -49,7 +50,7 @@ class vtkImplicitFunction; class VISU_UnScaledActor; class vtkDataSet; -class VISU_PlanesWidget : public VISU_ImplicitFunctionWidget +class VISU_PIPELINE_EXPORT VISU_PlanesWidget : public VISU_ImplicitFunctionWidget { public: // Description: diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 9df47b2d..0f620c38 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -27,6 +27,7 @@ #ifndef VISU_Plot3DPL_HeaderFile #define VISU_Plot3DPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_ScalarMapPL.hxx" #include "VISU_CutPlanesPL.hxx" @@ -35,7 +36,7 @@ class vtkContourFilter; class vtkGeometryFilter; class vtkCellDataToPointData; -class VISU_Plot3DPL : public VISU_ScalarMapPL{ +class VISU_PIPELINE_EXPORT VISU_Plot3DPL : public VISU_ScalarMapPL{ protected: VISU_Plot3DPL(); VISU_Plot3DPL(const VISU_Plot3DPL&); diff --git a/src/PIPELINE/VISU_ScalarBarActor.cxx b/src/PIPELINE/VISU_ScalarBarActor.cxx index afa44bd7..9c503ace 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.cxx +++ b/src/PIPELINE/VISU_ScalarBarActor.cxx @@ -531,7 +531,7 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) * (log10(range[1])-log10(range[0])); - val = pow(10,lval); + val = pow((double)10,(double)lval); }else{ val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]); } diff --git a/src/PIPELINE/VISU_ScalarBarActor.hxx b/src/PIPELINE/VISU_ScalarBarActor.hxx index be2f62ce..dfaaf137 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.hxx +++ b/src/PIPELINE/VISU_ScalarBarActor.hxx @@ -27,6 +27,7 @@ #ifndef VISU_ScalarBarActor_HeaderFile #define VISU_ScalarBarActor_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_LookupTable.hxx" #include @@ -45,7 +46,7 @@ class vtkTextProperty; #define VTK_ORIENT_VERTICAL 1 #endif -class VISU_ScalarBarActor : public vtkActor2D +class VISU_PIPELINE_EXPORT VISU_ScalarBarActor : public vtkActor2D { public: vtkTypeRevisionMacro(VISU_ScalarBarActor,vtkActor2D); diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.hxx b/src/PIPELINE/VISU_ScalarBarCtrl.hxx index c1a2f958..2d8387bf 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.hxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.hxx @@ -27,13 +27,15 @@ #ifndef VISU_ScalarBarCtrl_HeaderFile #define VISU_ScalarBarCtrl_HeaderFile +#include "VISUPipeline.hxx" + #include class vtkRenderer; class vtkLookupTable; class vtkScalarBarActor; -class VISU_ScalarBarCtrl : public vtkObject +class VISU_PIPELINE_EXPORT VISU_ScalarBarCtrl : public vtkObject { public: vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject); diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index 6d1ccf9a..69ecbe0c 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -27,6 +27,7 @@ #ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile #define VISU_ScalarMapOnDeformedShapePL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_ScalarMapPL.hxx" class vtkMergeFilter; @@ -35,7 +36,7 @@ class vtkUnstructuredGrid; class vtkCellDataToPointData; class vtkPointDataToCellData; -class VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL +class VISU_PIPELINE_EXPORT VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL { protected: VISU_ScalarMapOnDeformedShapePL(); diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 1d810fb9..0672dbd5 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -28,6 +28,7 @@ #ifndef VISU_ScalrMapPL_HeaderFile #define VISU_ScalrMapPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_PipeLine.hxx" #include "VISU_ScalarBarActor.hxx" @@ -39,11 +40,10 @@ class VISU_FieldTransform; //============================================================================ -class VISU_ScalarMapPL : public VISU_PipeLine +class VISU_PIPELINE_EXPORT VISU_ScalarMapPL : public VISU_PipeLine { protected: VISU_ScalarMapPL(); - VISU_ScalarMapPL(const VISU_ScalarMapPL&); virtual ~VISU_ScalarMapPL(); diff --git a/src/PIPELINE/VISU_SphereWidget.hxx b/src/PIPELINE/VISU_SphereWidget.hxx index 040a4180..6efadaff 100755 --- a/src/PIPELINE/VISU_SphereWidget.hxx +++ b/src/PIPELINE/VISU_SphereWidget.hxx @@ -1,6 +1,7 @@ #ifndef __VISU_SphereWidget_h #define __VISU_SphereWidget_h +#include "VISUPipeline.hxx" #include "VISU_ImplicitFunctionWidget.hxx" class VISU_UnScaledActor; @@ -17,7 +18,7 @@ class vtkSphere; class vtkImplicitSum; class vtkImplicitFunction; // -class VISU_SphereWidget : public VISU_ImplicitFunctionWidget +class VISU_PIPELINE_EXPORT VISU_SphereWidget : public VISU_ImplicitFunctionWidget { public: // Description: diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 509074a9..89e3f71b 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -30,7 +30,7 @@ #include "VISU_UsedPointsFilter.hxx" #include "VTKViewer_GeometryFilter.h" -#include +#include #include #include diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index b360f974..05976293 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -27,6 +27,7 @@ #ifndef VISU_StreamLinesPL_HeaderFile #define VISU_StreamLinesPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_DeformedShapePL.hxx" #include @@ -37,7 +38,7 @@ class vtkCellCenters; class VTKViewer_GeometryFilter; class VISU_UsedPointsFilter; -class VISU_StreamLinesPL : public VISU_DeformedShapePL{ +class VISU_PIPELINE_EXPORT VISU_StreamLinesPL : public VISU_DeformedShapePL{ protected: VISU_StreamLinesPL(); VISU_StreamLinesPL(const VISU_StreamLinesPL&); diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index 312d56fc..7f849663 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -27,6 +27,7 @@ #ifndef VISU_VectorsPL_HeaderFile #define VISU_VectorsPL_HeaderFile +#include "VISUPipeline.hxx" #include "VISU_DeformedShapePL.hxx" class VTKViewer_TransformFilter; @@ -39,7 +40,7 @@ class vtkLineSource; class vtkGlyph3D; -class VISU_VectorsPL : public VISU_DeformedShapePL{ +class VISU_PIPELINE_EXPORT VISU_VectorsPL : public VISU_DeformedShapePL{ protected: VISU_VectorsPL(); VISU_VectorsPL(const VISU_VectorsPL&); diff --git a/src/PIPELINE/VISU_WidgetCtrl.hxx b/src/PIPELINE/VISU_WidgetCtrl.hxx index 8737b5dc..17425276 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.hxx +++ b/src/PIPELINE/VISU_WidgetCtrl.hxx @@ -29,6 +29,7 @@ #ifndef __VISU_WidgetCtrl_hxx #define __VISU_WidgetCtrl_hxx +#include "VISUPipeline.hxx" #include @@ -42,7 +43,7 @@ class VISU_PlanesWidget; class VISU_SphereWidget; class VISU_ImplicitFunctionWidget; -class VISU_WidgetCtrl : public vtkImplicitFunction +class VISU_PIPELINE_EXPORT VISU_WidgetCtrl : public vtkImplicitFunction { public: static VISU_WidgetCtrl *New(); diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 3128e69f..3aa0b6a6 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -150,6 +150,10 @@ static int MYDEBUG = 1; static int MYDEBUG = 0; #endif +#ifdef WIN32 +#define usleep(A) _sleep(A/1000) +#endif + ////////////////////////////////////////////////// // Class: VisuGUI ////////////////////////////////////////////////// @@ -1120,7 +1124,7 @@ OnDeleteObjects() int i = 0, nbSelected = aList.Extent(); if (nbSelected < 1) return; - const char* entries [nbSelected]; + const char** entries = new const char*[nbSelected]; Handle(SALOME_InteractiveObject) anIO; for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) { anIO = it.Value(); @@ -1142,6 +1146,8 @@ OnDeleteObjects() } } + delete [] entries; + // Finish transaction aStudyBuilder->CommitCommand(); } @@ -3055,12 +3061,6 @@ VisuGUI return getApp()->getViewManager(theType,theIsCreate); } -TViewToPrs3d -VisuGUI -::getScalarBarsMap() -{ - return myScalarBarsMap; -} LightApp_Displayer* VisuGUI::displayer() { if( !myDisplayer ) diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 22224d72..3e74e246 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -72,8 +72,8 @@ public: getViewManager(const QString& theType, const bool theIsCreate); - VISU::TViewToPrs3d getScalarBarsMap(); VISU::TViewToPrs3d myScalarBarsMap; + VISU::TViewToPrs3d getScalarBarsMap() { return myScalarBarsMap; } public slots: virtual bool deactivateModule( SUIT_Study* ); diff --git a/src/VISUGUI/VisuGUI_CursorDlg.cxx b/src/VISUGUI/VisuGUI_CursorDlg.cxx index e1adefcf..87100741 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.cxx +++ b/src/VISUGUI/VisuGUI_CursorDlg.cxx @@ -26,6 +26,7 @@ // Module : VISU // $Header$ +#include using namespace std; #include "VisuGUI_CursorDlg.h" #include diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index e5ccea9f..e79e18cd 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -90,7 +90,7 @@ private: SALOME_Actor* myPreviewActor; private slots: - void editScalarBar(); + //void editScalarBar(); void orientationChanged( int ); void DrawTable(); void setDefault( int all = -1); @@ -114,7 +114,7 @@ public: protected slots: void accept(); void reject(); - void onWindowActivated (SUIT_ViewWindow*); + //void onWindowActivated (SUIT_ViewWindow*); private: VisuGUI_CutPlanesPane* myCutPane; diff --git a/src/VISUGUI/VisuGUI_Factory.cxx b/src/VISUGUI/VisuGUI_Factory.cxx index fea679cb..55cb6d5b 100644 --- a/src/VISUGUI/VisuGUI_Factory.cxx +++ b/src/VISUGUI/VisuGUI_Factory.cxx @@ -30,7 +30,18 @@ #include "CAM_Module.h" +#ifdef WNT +#ifdef VISU_VISUGUI_EXPORTS +#define VISU_VISUGUI_EXPORT __declspec(dllexport) +#else +#define VISU_VISUGUI_EXPORT __declspec(dllimport) +#endif +#else +#define VISU_VISUGUI_EXPORT +#endif + extern "C" { +VISU_VISUGUI_EXPORT CAM_Module* createModule() { diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index c845d013..89bf6fec 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -114,7 +114,7 @@ class VisuGUI_GaussScalarBarPane : public QVBox private slots: void changeDefaults( int ); - void changeRange( int ); + //void changeRange( int ); void XYChanged( double ); void onTextPref(); void onSetDisplayGlobal(); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index c5f45e20..a4485ff8 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -42,7 +42,7 @@ protected slots: void reject(); private slots: - void onSelectionActive(bool theActive); + //void onSelectionActive(bool theActive); void StepLengthChanged(double theValue); void IntegrationStepChanged(double theValue); void PropagationTimeChanged(double theValue); diff --git a/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx b/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx index 48ec2dcf..e28a59d0 100644 --- a/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx +++ b/src/VISUGUI/VisuGUI_SweepPrefDlg.cxx @@ -26,6 +26,7 @@ // Module : VISU // $Header$ +#include using namespace std; #include "VisuGUI_SweepPrefDlg.h" #include diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 978a4c24..9e9f523d 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -193,8 +193,8 @@ namespace VISU Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); VISU_Gen_var aVISU = VISU_Gen::_narrow(aComponent); if(!CORBA::is_nil(aVISU)){ - aGen = VISU_Gen_i::GetVisuGenImpl(); - aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule)))); + if( aGen = VISU_Gen_i::GetVisuGenImpl() ) + aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule)))); } } if(!aGen) diff --git a/src/VISU_I/VISUConfig.hh b/src/VISU_I/VISUConfig.hh index 6ec9a2d0..9651c9c6 100644 --- a/src/VISU_I/VISUConfig.hh +++ b/src/VISU_I/VISUConfig.hh @@ -27,6 +27,8 @@ #ifndef __VISU_CONFIG_H__ #define __VISU_CONFIG_H__ +#include "VISU_I.hxx" + // IDL headers #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(VISU_Gen) @@ -64,14 +66,14 @@ class SUIT_ResourceMgr; namespace VISU { - SUIT_Session *GetSession(); - SUIT_ResourceMgr *GetResourceMgr(); + VISU_I_EXPORT SUIT_Session *GetSession(); + VISU_I_EXPORT SUIT_ResourceMgr *GetResourceMgr(); //=========================================================================== class VISU_Gen_i; - class Base_i : public virtual POA_VISU::Base, + class VISU_I_EXPORT Base_i : public virtual POA_VISU::Base, public virtual PortableServer::RefCountServantBase { public: @@ -101,7 +103,7 @@ namespace VISU //=========================================================================== - class Mutex{ + class VISU_I_EXPORT Mutex{ QMutex* myMutex; int isQAppLocked; public: @@ -111,7 +113,7 @@ namespace VISU //=========================================================================== - class Storable : public virtual Base_i { + class VISU_I_EXPORT Storable : public virtual Base_i { protected: virtual void ToStream(std::ostringstream& theStr) = 0; public: @@ -132,7 +134,7 @@ namespace VISU }; //=========================================================================== - class RemovableObject_i : public virtual POA_VISU::RemovableObject, + class VISU_I_EXPORT RemovableObject_i : public virtual POA_VISU::RemovableObject, public virtual Storable { public: @@ -140,40 +142,40 @@ namespace VISU }; //=========================================================================== - const CORBA::Boolean IsMultifile(); - QString GenerateName(const std::string& theFmt, int theId); + VISU_I_EXPORT const CORBA::Boolean IsMultifile(); + VISU_I_EXPORT QString GenerateName(const std::string& theFmt, int theId); - PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); - CORBA::Object_var ClientSObjectToObject(_PTR(SObject) theSObject); - CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr); + VISU_I_EXPORT PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject); + VISU_I_EXPORT CORBA::Object_var ClientSObjectToObject(_PTR(SObject) theSObject); + VISU_I_EXPORT CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr); - _PTR(SComponent) ClientFindOrCreateVisuComponent(_PTR(Study) theStudyDocument); - SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument); + VISU_I_EXPORT _PTR(SComponent) ClientFindOrCreateVisuComponent(_PTR(Study) theStudyDocument); + VISU_I_EXPORT SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument); - std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument, + VISU_I_EXPORT std::string CreateAttributes(SALOMEDS::Study_ptr theStudyDocument, const char* theFatherEntry, const char* theRefFatherEntry, const char* theIOR, const char* theName, const char* thePersistentRef, const char* theComment, CORBA::Boolean theCreateNew = true); - std::string CreateAttributes(_PTR(Study) theStudyDocument, + VISU_I_EXPORT std::string CreateAttributes(_PTR(Study) theStudyDocument, const char* theFatherEntry, const char* theRefFatherEntry, const char* theIOR, const char* theName, const char* thePersistentRef, const char* theComment, CORBA::Boolean theCreateNew = true); - std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry, + VISU_I_EXPORT std::string FindEntryWithComment(SALOMEDS::Study_ptr theStudyDocument, const char* theStartEntry, const char* theComment, int IsAllLevels = true); - SALOMEDS::SObject_var GetSObject(_PTR(SObject)); - _PTR(SObject) GetClientSObject(SALOMEDS::SObject_var, _PTR(Study)); + VISU_I_EXPORT SALOMEDS::SObject_var GetSObject(_PTR(SObject)); + VISU_I_EXPORT _PTR(SObject) GetClientSObject(SALOMEDS::SObject_var, _PTR(Study)); - SALOMEDS::Study_var GetDSStudy(_PTR(Study)); + VISU_I_EXPORT SALOMEDS::Study_var GetDSStudy(_PTR(Study)); - void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject, + VISU_I_EXPORT void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject, bool theIsAttrOnly = true, bool theDestroySubObjects = false); - void RemoveFromStudy(_PTR(SObject) theSObject, + VISU_I_EXPORT void RemoveFromStudy(_PTR(SObject) theSObject, bool theIsAttrOnly = true, bool theDestroySubObjects = false); } diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index e03d772e..4762f3d1 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -34,11 +34,11 @@ class VISU_ScalarMapPL; namespace VISU { //============================================================================ - class ColoredPrs3d_i : public virtual POA_VISU::ColoredPrs3d, + class VISU_I_EXPORT ColoredPrs3d_i : public virtual POA_VISU::ColoredPrs3d, public virtual Prs3d_i { - ColoredPrs3d_i(); ColoredPrs3d_i(const ColoredPrs3d_i&); + public: //---------------------------------------------------------------------------- typedef Prs3d_i TSuperClass; diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 879b0531..d88ecb5d 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -407,7 +407,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ a_last_indx = tmp; } std::list::const_iterator aIter = XKeys.begin(); - for (int k=0;k= 0 and aDist<=1.0 diff --git a/src/VISU_I/VISU_CutLines_i.hh b/src/VISU_I/VISU_CutLines_i.hh index 7acb62a7..18c4bc19 100644 --- a/src/VISU_I/VISU_CutLines_i.hh +++ b/src/VISU_I/VISU_CutLines_i.hh @@ -32,11 +32,10 @@ class VISU_CutLinesPL; namespace VISU{ - class CutLines_i : public virtual POA_VISU::CutLines, + class VISU_I_EXPORT CutLines_i : public virtual POA_VISU::CutLines, public virtual ScalarMap_i { static int myNbPresent; - CutLines_i(); CutLines_i(const CutLines_i&); public: diff --git a/src/VISU_I/VISU_CutPlanes_i.hh b/src/VISU_I/VISU_CutPlanes_i.hh index 1ade4906..46d5e0cd 100644 --- a/src/VISU_I/VISU_CutPlanes_i.hh +++ b/src/VISU_I/VISU_CutPlanes_i.hh @@ -32,11 +32,10 @@ class VISU_CutPlanesPL; namespace VISU{ - class CutPlanes_i : public virtual POA_VISU::CutPlanes, + class VISU_I_EXPORT CutPlanes_i : public virtual POA_VISU::CutPlanes, public virtual ScalarMap_i { static int myNbPresent; - CutPlanes_i(); CutPlanes_i(const CutPlanes_i&); public: diff --git a/src/VISU_I/VISU_DeformedShape_i.hh b/src/VISU_I/VISU_DeformedShape_i.hh index 814438d6..3767af61 100644 --- a/src/VISU_I/VISU_DeformedShape_i.hh +++ b/src/VISU_I/VISU_DeformedShape_i.hh @@ -32,11 +32,10 @@ class VISU_DeformedShapePL; namespace VISU{ - class DeformedShape_i : public virtual POA_VISU::DeformedShape, + class VISU_I_EXPORT DeformedShape_i : public virtual POA_VISU::DeformedShape, public virtual ScalarMap_i { static int myNbPresent; - DeformedShape_i(); DeformedShape_i(const DeformedShape_i&); public: diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh index 5a0fe102..aa9893bb 100644 --- a/src/VISU_I/VISU_GaussPoints_i.hh +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -39,13 +39,12 @@ class VISU_GaussPointsPL; namespace VISU { //! Class of the Gauss Points presentation. - class GaussPoints_i : public virtual POA_VISU::GaussPoints, + class VISU_I_EXPORT GaussPoints_i : public virtual POA_VISU::GaussPoints, public virtual VISU::TGaussPtsActorFactory, public virtual MinMaxCunsomer, public virtual ColoredPrs3d_i { static int myNbPresent; - GaussPoints_i(); GaussPoints_i(const GaussPoints_i&); public: diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index ff03f9f2..be502de4 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -99,7 +99,7 @@ static int MYDEBUG = 0; UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception); -extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, +extern "C" VISU_I_EXPORT VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, SALOME_NamingService* theNamingService, QMutex* theMutex) diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index 1f4f9212..d8008b2f 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -21,7 +21,7 @@ namespace VISU class ColoredPrs3d_i; bool - CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d, + VISU_I_EXPORT CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, @@ -32,7 +32,6 @@ namespace VISU public virtual Base_i { SALOMEDS::Study_var myStudyDocument; - VISU_Gen_i(); VISU_Gen_i(const VISU::VISU_Gen_i &); public: VISU_Gen_i(CORBA::ORB_ptr theORB, diff --git a/src/VISU_I/VISU_I.hxx b/src/VISU_I/VISU_I.hxx new file mode 100755 index 00000000..4b86a475 --- /dev/null +++ b/src/VISU_I/VISU_I.hxx @@ -0,0 +1,47 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : VISU_I.hxx +// Author : Oleg UVAROV +// Module : VISU + +#ifndef _VISU_I_HXX_ +#define _VISU_I_HXX_ + +#ifdef WNT + #if defined VISU_I_EXPORTS + #if defined WIN32 + #define VISU_I_EXPORT __declspec( dllexport ) + #else + #define VISU_I_EXPORT + #endif + #else + #if defined WIN32 + #define VISU_I_EXPORT __declspec( dllimport ) + #else + #define VISU_I_EXPORT + #endif + #endif +#else + #define VISU_I_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/VISU_I/VISU_IsoSurfaces_i.hh b/src/VISU_I/VISU_IsoSurfaces_i.hh index b10ef520..b36074ae 100644 --- a/src/VISU_I/VISU_IsoSurfaces_i.hh +++ b/src/VISU_I/VISU_IsoSurfaces_i.hh @@ -32,11 +32,10 @@ class VISU_IsoSurfacesPL; namespace VISU{ - class IsoSurfaces_i : public virtual POA_VISU::IsoSurfaces, + class VISU_I_EXPORT IsoSurfaces_i : public virtual POA_VISU::IsoSurfaces, public virtual ScalarMap_i { static int myNbPresent; - IsoSurfaces_i(); IsoSurfaces_i(const IsoSurfaces_i&); public: diff --git a/src/VISU_I/VISU_Mesh_i.hh b/src/VISU_I/VISU_Mesh_i.hh index 4bb0809e..7649f1ab 100644 --- a/src/VISU_I/VISU_Mesh_i.hh +++ b/src/VISU_I/VISU_Mesh_i.hh @@ -33,11 +33,10 @@ class VISU_MeshPL; namespace VISU { - class Mesh_i : public virtual POA_VISU::Mesh, + class VISU_I_EXPORT Mesh_i : public virtual POA_VISU::Mesh, public virtual Prs3d_i { static int myNbPresent; - Mesh_i(); Mesh_i(const Mesh_i&); public: diff --git a/src/VISU_I/VISU_Plot3D_i.hh b/src/VISU_I/VISU_Plot3D_i.hh index d612af1e..58006072 100644 --- a/src/VISU_I/VISU_Plot3D_i.hh +++ b/src/VISU_I/VISU_Plot3D_i.hh @@ -26,11 +26,10 @@ class VISU_Plot3DPL; namespace VISU { - class Plot3D_i : public virtual POA_VISU::Plot3D, + class VISU_I_EXPORT Plot3D_i : public virtual POA_VISU::Plot3D, public virtual ScalarMap_i { static int myNbPresent; - Plot3D_i(); Plot3D_i(const Plot3D_i&); public: diff --git a/src/VISU_I/VISU_Prs3d_i.hh b/src/VISU_I/VISU_Prs3d_i.hh index efdd5556..4d410fb2 100644 --- a/src/VISU_I/VISU_Prs3d_i.hh +++ b/src/VISU_I/VISU_Prs3d_i.hh @@ -60,18 +60,17 @@ namespace VISU - implement basic actor management (CreateActor, UpdateActor, UpdateActors, RemoveActor and RemoveActors); - implement common 3D functionality like "clipping planes" and offset. */ - class Prs3d_i : + class VISU_I_EXPORT Prs3d_i : public virtual POA_VISU::Prs3d, public virtual SALOME::GenericObj_i, public virtual TActorFactory, public virtual PrsObject_i { - Prs3d_i(); Prs3d_i(const Prs3d_i&); public: - //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- //! A constructor to create a fresh instance of the class explicit Prs3d_i(Result_i* theResult, diff --git a/src/VISU_I/VISU_PrsObject_i.hh b/src/VISU_I/VISU_PrsObject_i.hh index b9aca61e..d62ada67 100644 --- a/src/VISU_I/VISU_PrsObject_i.hh +++ b/src/VISU_I/VISU_PrsObject_i.hh @@ -30,7 +30,7 @@ #include "VISUConfig.hh" namespace VISU{ - class PrsObject_i : public virtual POA_VISU::PrsObject, + class VISU_I_EXPORT PrsObject_i : public virtual POA_VISU::PrsObject, public virtual RemovableObject_i { PrsObject_i(const PrsObject_i&); diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index ee903de6..c1d4bde4 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -41,7 +41,7 @@ class VISU_Convertor; namespace VISU { //---------------------------------------------------------------------------- - class MinMaxCunsomer: public virtual boost::bsignals::trackable + class VISU_I_EXPORT MinMaxCunsomer: public virtual boost::bsignals::trackable { protected: bool myMinMaxIsInitilized; @@ -59,11 +59,10 @@ namespace VISU //---------------------------------------------------------------------------- - class Result_i : public virtual POA_VISU::Result, + class VISU_I_EXPORT Result_i : public virtual POA_VISU::Result, public virtual RemovableObject_i, public virtual SALOME::GenericObj_i { - Result_i(); Result_i(const Result_i &); public: diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh index b7433720..68b7d6e7 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh @@ -34,11 +34,10 @@ class VISU_ScalarMapOnDeformedShapePL; namespace VISU{ //! Class of Scalar Map on Deformed Shape presentation. - class ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape, + class VISU_I_EXPORT ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape, public virtual ScalarMap_i { static int myNbPresent; - ScalarMapOnDeformedShape_i(); ScalarMapOnDeformedShape_i(const ScalarMapOnDeformedShape_i&); public: diff --git a/src/VISU_I/VISU_ScalarMap_i.hh b/src/VISU_I/VISU_ScalarMap_i.hh index 8506e463..0d275401 100644 --- a/src/VISU_I/VISU_ScalarMap_i.hh +++ b/src/VISU_I/VISU_ScalarMap_i.hh @@ -33,15 +33,14 @@ namespace VISU { //============================================================================ - class ScalarMap_i : public virtual POA_VISU::ScalarMap, + class VISU_I_EXPORT ScalarMap_i : public virtual POA_VISU::ScalarMap, public virtual ColoredPrs3d_i { static int myNbPresent; - ScalarMap_i(); ScalarMap_i(const ScalarMap_i&); public: - //---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- typedef ColoredPrs3d_i TSuperClass; explicit diff --git a/src/VISU_I/VISU_StreamLines_i.hh b/src/VISU_I/VISU_StreamLines_i.hh index 31c9fe7d..4ae3150f 100644 --- a/src/VISU_I/VISU_StreamLines_i.hh +++ b/src/VISU_I/VISU_StreamLines_i.hh @@ -33,11 +33,10 @@ class VISU_StreamLinesPL; class vtkAppendFilter; namespace VISU{ - class StreamLines_i : public virtual POA_VISU::StreamLines, + class VISU_I_EXPORT StreamLines_i : public virtual POA_VISU::StreamLines, public virtual DeformedShape_i { static int myNbPresent; - StreamLines_i(); StreamLines_i(const StreamLines_i&); public: diff --git a/src/VISU_I/VISU_Table_i.hh b/src/VISU_I/VISU_Table_i.hh index 608f5dfe..3fd6dc65 100644 --- a/src/VISU_I/VISU_Table_i.hh +++ b/src/VISU_I/VISU_Table_i.hh @@ -35,11 +35,10 @@ class SPlot2d_Curve; namespace VISU{ //============================================================================== - class Table_i : public virtual POA_VISU::Table, + class VISU_I_EXPORT Table_i : public virtual POA_VISU::Table, public virtual PrsObject_i { static int myNbPresent; - Table_i(); Table_i( const Table_i& ); public: Table_i( SALOMEDS::Study_ptr theStudy, const char* theObject ); @@ -84,7 +83,7 @@ namespace VISU{ SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy); bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName); //============================================================================== - class Curve_i : public virtual POA_VISU::Curve, + class VISU_I_EXPORT Curve_i : public virtual POA_VISU::Curve, public virtual PrsObject_i { static int myNbPresent; @@ -158,7 +157,7 @@ namespace VISU{ }; //============================================================================== - class Container_i : public virtual POA_VISU::Container, + class VISU_I_EXPORT Container_i : public virtual POA_VISU::Container, public virtual PrsObject_i { static int myNbPresent; diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index 315415c8..4e9360f6 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -38,7 +38,7 @@ struct FieldData }; -class VISU_TimeAnimation: public QObject, public QThread +class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread { Q_OBJECT; public: @@ -156,7 +156,7 @@ class VISU_TimeAnimation: public QObject, public QThread }; -class VISU_TimeAnimation_i: public virtual POA_VISU::Animation, +class VISU_I_EXPORT VISU_TimeAnimation_i: public virtual POA_VISU::Animation, public virtual VISU::Base_i { VISU_TimeAnimation* myAnim; diff --git a/src/VISU_I/VISU_Vectors_i.hh b/src/VISU_I/VISU_Vectors_i.hh index 88143087..39eb8e32 100644 --- a/src/VISU_I/VISU_Vectors_i.hh +++ b/src/VISU_I/VISU_Vectors_i.hh @@ -32,11 +32,10 @@ class VISU_VectorsPL; namespace VISU{ - class Vectors_i : public virtual POA_VISU::Vectors, + class VISU_I_EXPORT Vectors_i : public virtual POA_VISU::Vectors, public virtual DeformedShape_i { static int myNbPresent; - Vectors_i(); Vectors_i(const Vectors_i&); public: diff --git a/src/VISU_I/VISU_ViewManager_i.hh b/src/VISU_I/VISU_ViewManager_i.hh index 5fa7284a..276271e0 100644 --- a/src/VISU_I/VISU_ViewManager_i.hh +++ b/src/VISU_I/VISU_ViewManager_i.hh @@ -46,7 +46,7 @@ namespace VISU { class Prs3d_i; class Curve_i; - class ViewManager_i : public virtual POA_VISU::ViewManager, + class VISU_I_EXPORT ViewManager_i : public virtual POA_VISU::ViewManager, public virtual Base_i { public: @@ -74,7 +74,7 @@ namespace VISU { VISU_Actor* UpdateViewer (SUIT_ViewWindow* theStudyFrame, int theDisplaing, Prs3d_i* thePrs = NULL); void UpdatePlot2d (Plot2d_ViewFrame *theView, int theDisplaying, Curve_i* theCurve); - VISU_Actor* GetActor (VISU::Prs3d_i* thePrs, SVTK_ViewWindow* theViewWindow); + VISU_I_EXPORT VISU_Actor* GetActor (VISU::Prs3d_i* thePrs, SVTK_ViewWindow* theViewWindow); void DeleteActors (VISU::Prs3d_i* thePrs); void DeleteActors (VISU::Curve_i* thePrs); diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index 43224cd7..d404fa0f 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -1994,7 +1994,7 @@ namespace VISU { if(MYDEBUG) MESSAGE("View3D_i::SetPointOfView"); SUIT_ViewWindow* aVW = GetViewWindow(); if (aVW) - ProcessVoidEvent(new TSet3DViewParamEvent(&SetPointOfView,aVW,thePosition)); + ProcessVoidEvent(new TSet3DViewParamEvent(&View3D_i::SetPointOfView,aVW,thePosition)); } void View3D_i::GetPointOfView (SUIT_ViewWindow* theViewWindow, @@ -2024,7 +2024,7 @@ namespace VISU { if(MYDEBUG) MESSAGE("View3D_i::SetViewUp"); SUIT_ViewWindow* aVW = GetViewWindow(); if (aVW) - ProcessVoidEvent(new TSet3DViewParamEvent(&SetViewUp,aVW,theViewUp)); + ProcessVoidEvent(new TSet3DViewParamEvent(&View3D_i::SetViewUp,aVW,theViewUp)); } void View3D_i::GetViewUp (SUIT_ViewWindow* theViewWindow, @@ -2054,7 +2054,7 @@ namespace VISU { if(MYDEBUG) MESSAGE("View3D_i::SetFocalPoint"); SUIT_ViewWindow* aVW = GetViewWindow(); if (aVW) - ProcessVoidEvent(new TSet3DViewParamEvent(&SetFocalPoint,aVW,theCoord)); + ProcessVoidEvent(new TSet3DViewParamEvent(&View3D_i::SetFocalPoint,aVW,theCoord)); } @@ -2106,7 +2106,7 @@ namespace VISU { if(MYDEBUG) MESSAGE("View3D_i::SetParallelScale"); SUIT_ViewWindow* aVW = GetViewWindow(); if (aVW) - ProcessVoidEvent(new TSetViewParamEvent(&SetParallelScale,aVW,theScale)); + ProcessVoidEvent(new TSetViewParamEvent(&View3D_i::SetParallelScale,aVW,theScale)); } CORBA::Double View3D_i::GetParallelScale (SUIT_ViewWindow* theViewWindow) diff --git a/src/VISU_I/VISU_View_i.hh b/src/VISU_I/VISU_View_i.hh index 76b44da5..17f19918 100644 --- a/src/VISU_I/VISU_View_i.hh +++ b/src/VISU_I/VISU_View_i.hh @@ -45,7 +45,7 @@ namespace VISU class Prs3d_i; class Curve_i; - class View_i : public virtual POA_VISU::View, + class VISU_I_EXPORT View_i : public virtual POA_VISU::View, public virtual Storable { public: @@ -124,7 +124,7 @@ namespace VISU //=========================================================================== - class XYPlot_i : public virtual POA_VISU::XYPlot, + class VISU_I_EXPORT XYPlot_i : public virtual POA_VISU::XYPlot, public virtual View_i { public: @@ -172,10 +172,10 @@ namespace VISU virtual void Update(); virtual void FitAll(); - virtual void FitXRange(const CORBA::Double xMin,const CORBA::Double xMax); - virtual void FitYRange(const CORBA::Double yMin,const CORBA::Double yMax); - virtual void FitRange(const CORBA::Double xMin,const CORBA::Double xMax, - const CORBA::Double yMin,const CORBA::Double yMax); + virtual void FitXRange(CORBA::Double xMin, CORBA::Double xMax); + virtual void FitYRange(CORBA::Double yMin, CORBA::Double yMax); + virtual void FitRange(CORBA::Double xMin, CORBA::Double xMax, + CORBA::Double yMin, CORBA::Double yMax); virtual void GetFitRanges(double& xMin, double& xMax, double& yMin, double& yMax); virtual void Close(); @@ -187,7 +187,7 @@ namespace VISU //=========================================================================== - class TableView_i : public virtual POA_VISU::TableView, + class VISU_I_EXPORT TableView_i : public virtual POA_VISU::TableView, public virtual View_i { public: @@ -210,7 +210,7 @@ namespace VISU //=========================================================================== - class View3D_i : public virtual POA_VISU::View3D, + class VISU_I_EXPORT View3D_i : public virtual POA_VISU::View3D, public virtual View_i { public: diff --git a/src/VVTK/VVTK.h b/src/VVTK/VVTK.h index d6dd0648..e8b032f1 100755 --- a/src/VVTK/VVTK.h +++ b/src/VVTK/VVTK.h @@ -1,5 +1,5 @@ #ifdef WNT -#ifdef SVTK_EXPORTS +#ifdef VISU_VVTK_EXPORTS #define VVTK_EXPORT __declspec(dllexport) #else #define VVTK_EXPORT __declspec(dllimport) diff --git a/src/VVTK/VVTK_MainWindow.cxx b/src/VVTK/VVTK_MainWindow.cxx index de0ebfd0..5b5e46bf 100644 --- a/src/VVTK/VVTK_MainWindow.cxx +++ b/src/VVTK/VVTK_MainWindow.cxx @@ -34,6 +34,7 @@ #include "VISU_GaussPtsAct.h" #include "VISU_Event.h" +#include "SVTK_ViewWindow.h" #include "SVTK_RenderWindowInteractor.h" #include "VVTK_Renderer.h" #include "VVTK_PickingDlg.h" @@ -237,9 +238,6 @@ void VVTK_MainWindow::OnStopRecording() } //---------------------------------------------------------------------------- -int -convertAction( const int accelAction ); - void VVTK_MainWindow ::action( const int accelAction ) diff --git a/src/VVTK/VVTK_PrimitiveBox.cxx b/src/VVTK/VVTK_PrimitiveBox.cxx index 84ef52b9..f874be7b 100644 --- a/src/VVTK/VVTK_PrimitiveBox.cxx +++ b/src/VVTK/VVTK_PrimitiveBox.cxx @@ -43,7 +43,7 @@ #include #include -#include +#include using namespace std; diff --git a/src/VVTK/VVTK_PrimitiveBox.h b/src/VVTK/VVTK_PrimitiveBox.h index a6b8a0af..5ee04398 100644 --- a/src/VVTK/VVTK_PrimitiveBox.h +++ b/src/VVTK/VVTK_PrimitiveBox.h @@ -28,6 +28,8 @@ #ifndef VVTK_PRIMITIVEBOX_H #define VVTK_PRIMITIVEBOX_H +#include "VVTK.h" + #include class QLabel; @@ -38,7 +40,7 @@ class QRadioButton; class QtxDblSpinBox; class QtxIntSpinBox; -class VVTK_PrimitiveBox : public QGroupBox +class VVTK_EXPORT VVTK_PrimitiveBox : public QGroupBox { Q_OBJECT diff --git a/src/VVTK/VVTK_Recorder.cxx b/src/VVTK/VVTK_Recorder.cxx index e9c734e9..849f810a 100755 --- a/src/VVTK/VVTK_Recorder.cxx +++ b/src/VVTK/VVTK_Recorder.cxx @@ -1,464 +1,467 @@ -// SALOME VTKViewer : build VTK viewer into Salome desktop -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : -// Author : -// Module : -// $Header$ - -#include "VVTK_Recorder.h" - -#include "VVTK_ImageWriter.h" -#include "VVTK_ImageWriterMgr.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include "utilities.h" - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - - -namespace -{ - //---------------------------------------------------------------------------- - inline - void - GetNameJPEG(const std::string& thePreffix, - const int theIndex, - std::string& theName) - { - using namespace std; - ostringstream aStream; - aStream<SetClientData(this); - myCommand->SetCallback(VVTK_Recorder::ProcessEvents); -} - - -//---------------------------------------------------------------------------- -VVTK_Recorder -::~VVTK_Recorder() -{ - myCommand->Delete(); - myFilter->Delete(); - delete myWriterMgr; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::CheckExistAVIMaker() -{ - myErrorStatus = 0; - using namespace std; - ostringstream aStream; - aStream<<"which "<& /dev/null"; - std::string anAVIMakeCheck = aStream.str(); - int iErr = system(anAVIMakeCheck.c_str()); - if(iErr != 0) - myErrorStatus = 127; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetName(const char* theName) -{ - myName = theName; -} - -const char* -VVTK_Recorder::Name() const -{ - return myName.c_str(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetNbFPS(const double theNbFPS) -{ - myNbFPS = theNbFPS; -} - -double -VVTK_Recorder -::NbFPS() const -{ - return myNbFPS; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetQuality(int theQuality) -{ - myQuality = theQuality; -} - -int -VVTK_Recorder -::GetQuality() const -{ - return myQuality; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetRenderWindow(vtkRenderWindow* theRenderWindow) -{ - myRenderWindow = theRenderWindow; -} - -vtkRenderWindow* -VVTK_Recorder -::RenderWindow() -{ - return myRenderWindow; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetProgressiveMode(bool theProgressiveMode) -{ - myProgressiveMode = theProgressiveMode; -} - -bool -VVTK_Recorder -::GetProgressiveMode() const -{ - return myProgressiveMode; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetUseSkippedFrames(bool theUseSkippedFrames) -{ - myUseSkippedFrames = theUseSkippedFrames; -} - -bool -VVTK_Recorder -::UseSkippedFrames() const -{ - return myUseSkippedFrames; -} - - -//---------------------------------------------------------------------------- -int -VVTK_Recorder -::ErrorStatus() const -{ - return myErrorStatus; -} - -int -VVTK_Recorder -::State() const -{ - return myState; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) -{ - if(vtkObject* anObj = reinterpret_cast(theClientData)){ - if(VVTK_Recorder* aSelf = dynamic_cast(anObj)){ - if(theEvent==vtkCommand::EndEvent){ - if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ - aSelf->DoRecord(); - } - } - } - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Record() -{ - if(myState == VVTK_Recorder_Stop){ - if(myRenderWindow){ - myState = VVTK_Recorder_Record; - myFilter->SetInput(myRenderWindow); - myFrameIndex = -1; - myNbWrittenFrames = 0; - myRenderWindow->RemoveObserver(myCommand); - myRenderWindow->AddObserver(vtkCommand::EndEvent, - myCommand, - myPriority); - myRenderWindow->Render(); - } - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Stop() -{ - QApplication::setOverrideCursor( Qt::waitCursor ); - - if(myState == VVTK_Recorder_Record){ - if(!myPaused) - DoRecord(); - - myWriterMgr->Stop(); - - if(myUseSkippedFrames) - AddSkippedFrames(); - - myFrameIndexes.clear(); - - MakeFileAVI(); - } - myState = VVTK_Recorder_Stop; - myPaused = 0; - - QApplication::restoreOverrideCursor(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Pause() -{ - myPaused = myPaused ? 0 : 1; - if(myPaused && !myFrameIndexes.empty()){ - size_t aLastId = myFrameIndexes.size() - 1; - myFrameIndexes[aLastId] *= -1; - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::DoRecord() -{ - if(myPaused) - return; - - if(myFrameIndex < 0){ - myFrameIndex = 0; - myTimeStart = vtkTimerLog::GetCurrentTime(); - }else{ - double aTimeNow = vtkTimerLog::GetCurrentTime(); - double aDelta = aTimeNow - myTimeStart; - if(aDelta < 0.0) - return; - - int aFrameIndex = int(aDelta*myNbFPS); - if(aFrameIndex == myFrameIndex) - return; - - myFrameIndex = aFrameIndex; - } - - myFrameIndexes.push_back(myFrameIndex); - if(MYDEBUG) cout<<"VVTK_Recorder::DoRecord - myFrameIndex = "<RemoveObserver(myCommand); - myFilter->Modified(); - - std::string aName; - GetNameJPEG(myName,myFrameIndex,aName); - - PreWrite(); - - vtkImageData *anImageData = vtkImageData::New(); - anImageData->DeepCopy(myFilter->GetOutput()); - - myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality); - myNbWrittenFrames++; - - myRenderWindow->AddObserver(vtkCommand::EndEvent, - myCommand, - myPriority); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::PreWrite() -{ - vtkImageData *anImageData = myFilter->GetOutput(); - // - if(!anImageData){ - myErrorStatus = 20; - return; - } - anImageData->UpdateInformation(); - int *anExtent = anImageData->GetWholeExtent(); - anImageData->SetUpdateExtent(anExtent[0], anExtent[1], - anExtent[2], anExtent[3], - 0,0); - anImageData->UpdateData(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::AddSkippedFrames() -{ - myErrorStatus = 0; - - if(myFrameIndexes.size() < 2) - return; - - size_t anId = 0, anEnd = myFrameIndexes.size() - 1; - for(; anId < anEnd; anId++){ - int aStartIndex = myFrameIndexes[anId]; - if(aStartIndex < 0) - continue; - - int aFinishIndex = abs(myFrameIndexes[anId + 1]); - if(aStartIndex + 1 == aFinishIndex) - continue; - - std::string anInitialName; - std::ostringstream aStream; - GetNameJPEG(myName,aStartIndex,anInitialName); - for(int anIndex = aStartIndex + 1; anIndex < aFinishIndex; anIndex++){ - myNbWrittenFrames++; - std::string anCurrentName; - GetNameJPEG(myName,anIndex,anCurrentName); - aStream<<"ln -s "<< anInitialName<<" "< +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifndef WIN32 +#include +#endif + +#include +#include + +#include "utilities.h" + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + + +namespace +{ + //---------------------------------------------------------------------------- + inline + void + GetNameJPEG(const std::string& thePreffix, + const int theIndex, + std::string& theName) + { + using namespace std; + ostringstream aStream; + aStream<SetClientData(this); + myCommand->SetCallback(VVTK_Recorder::ProcessEvents); +} + + +//---------------------------------------------------------------------------- +VVTK_Recorder +::~VVTK_Recorder() +{ + myCommand->Delete(); + myFilter->Delete(); + delete myWriterMgr; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::CheckExistAVIMaker() +{ + myErrorStatus = 0; + using namespace std; + ostringstream aStream; + aStream<<"which "<& /dev/null"; + std::string anAVIMakeCheck = aStream.str(); + int iErr = system(anAVIMakeCheck.c_str()); + if(iErr != 0) + myErrorStatus = 127; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetName(const char* theName) +{ + myName = theName; +} + +const char* +VVTK_Recorder::Name() const +{ + return myName.c_str(); +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetNbFPS(const double theNbFPS) +{ + myNbFPS = theNbFPS; +} + +double +VVTK_Recorder +::NbFPS() const +{ + return myNbFPS; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetQuality(int theQuality) +{ + myQuality = theQuality; +} + +int +VVTK_Recorder +::GetQuality() const +{ + return myQuality; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetRenderWindow(vtkRenderWindow* theRenderWindow) +{ + myRenderWindow = theRenderWindow; +} + +vtkRenderWindow* +VVTK_Recorder +::RenderWindow() +{ + return myRenderWindow; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetProgressiveMode(bool theProgressiveMode) +{ + myProgressiveMode = theProgressiveMode; +} + +bool +VVTK_Recorder +::GetProgressiveMode() const +{ + return myProgressiveMode; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetUseSkippedFrames(bool theUseSkippedFrames) +{ + myUseSkippedFrames = theUseSkippedFrames; +} + +bool +VVTK_Recorder +::UseSkippedFrames() const +{ + return myUseSkippedFrames; +} + + +//---------------------------------------------------------------------------- +int +VVTK_Recorder +::ErrorStatus() const +{ + return myErrorStatus; +} + +int +VVTK_Recorder +::State() const +{ + return myState; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::ProcessEvents(vtkObject* vtkNotUsed(theObject), + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) +{ + if(vtkObject* anObj = reinterpret_cast(theClientData)){ + if(VVTK_Recorder* aSelf = dynamic_cast(anObj)){ + if(theEvent==vtkCommand::EndEvent){ + if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ + aSelf->DoRecord(); + } + } + } + } +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::Record() +{ + if(myState == VVTK_Recorder_Stop){ + if(myRenderWindow){ + myState = VVTK_Recorder_Record; + myFilter->SetInput(myRenderWindow); + myFrameIndex = -1; + myNbWrittenFrames = 0; + myRenderWindow->RemoveObserver(myCommand); + myRenderWindow->AddObserver(vtkCommand::EndEvent, + myCommand, + myPriority); + myRenderWindow->Render(); + } + } +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::Stop() +{ + QApplication::setOverrideCursor( Qt::waitCursor ); + + if(myState == VVTK_Recorder_Record){ + if(!myPaused) + DoRecord(); + + myWriterMgr->Stop(); + + if(myUseSkippedFrames) + AddSkippedFrames(); + + myFrameIndexes.clear(); + + MakeFileAVI(); + } + myState = VVTK_Recorder_Stop; + myPaused = 0; + + QApplication::restoreOverrideCursor(); +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::Pause() +{ + myPaused = myPaused ? 0 : 1; + if(myPaused && !myFrameIndexes.empty()){ + size_t aLastId = myFrameIndexes.size() - 1; + myFrameIndexes[aLastId] *= -1; + } +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::DoRecord() +{ + if(myPaused) + return; + + if(myFrameIndex < 0){ + myFrameIndex = 0; + myTimeStart = vtkTimerLog::GetCurrentTime(); + }else{ + double aTimeNow = vtkTimerLog::GetCurrentTime(); + double aDelta = aTimeNow - myTimeStart; + if(aDelta < 0.0) + return; + + int aFrameIndex = int(aDelta*myNbFPS); + if(aFrameIndex == myFrameIndex) + return; + + myFrameIndex = aFrameIndex; + } + + myFrameIndexes.push_back(myFrameIndex); + if(MYDEBUG) cout<<"VVTK_Recorder::DoRecord - myFrameIndex = "<RemoveObserver(myCommand); + myFilter->Modified(); + + std::string aName; + GetNameJPEG(myName,myFrameIndex,aName); + + PreWrite(); + + vtkImageData *anImageData = vtkImageData::New(); + anImageData->DeepCopy(myFilter->GetOutput()); + + myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality); + myNbWrittenFrames++; + + myRenderWindow->AddObserver(vtkCommand::EndEvent, + myCommand, + myPriority); +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::PreWrite() +{ + vtkImageData *anImageData = myFilter->GetOutput(); + // + if(!anImageData){ + myErrorStatus = 20; + return; + } + anImageData->UpdateInformation(); + int *anExtent = anImageData->GetWholeExtent(); + anImageData->SetUpdateExtent(anExtent[0], anExtent[1], + anExtent[2], anExtent[3], + 0,0); + anImageData->UpdateData(); +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::AddSkippedFrames() +{ + myErrorStatus = 0; + + if(myFrameIndexes.size() < 2) + return; + + size_t anId = 0, anEnd = myFrameIndexes.size() - 1; + for(; anId < anEnd; anId++){ + int aStartIndex = myFrameIndexes[anId]; + if(aStartIndex < 0) + continue; + + int aFinishIndex = abs(myFrameIndexes[anId + 1]); + if(aStartIndex + 1 == aFinishIndex) + continue; + + std::string anInitialName; + std::ostringstream aStream; + GetNameJPEG(myName,aStartIndex,anInitialName); + for(int anIndex = aStartIndex + 1; anIndex < aFinishIndex; anIndex++){ + myNbWrittenFrames++; + std::string anCurrentName; + GetNameJPEG(myName,anIndex,anCurrentName); + aStream<<"ln -s "<< anInitialName<<" "< #include @@ -46,7 +48,7 @@ namespace VISU { typedef vtkSmartPointer TTextureValue; - TTextureValue + VVTK_EXPORT TTextureValue GetTexture(const QString& theMainTexture, const QString& theAlphaTexture); } diff --git a/src/VVTK/VVTK_SizeBox.h b/src/VVTK/VVTK_SizeBox.h index a47f342c..85eafa75 100644 --- a/src/VVTK/VVTK_SizeBox.h +++ b/src/VVTK/VVTK_SizeBox.h @@ -28,6 +28,8 @@ #ifndef VVTK_SIZEBOX_H #define VVTK_SIZEBOX_H +#include "VVTK.h" + #include class QLabel; @@ -39,7 +41,7 @@ class QGroupBox; class QtxDblSpinBox; class QtxIntSpinBox; -class VVTK_SizeBox : public QVBox +class VVTK_EXPORT VVTK_SizeBox : public QVBox { Q_OBJECT