try{
#endif
MSG(MYDEBUG,"'"<<theFileName<<"'...");
+ //theFileName = "Apointe.med";
auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
//aCon->GetSize();
//return;
--- /dev/null
+// 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
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,' ','_');
aName = aNewName;
else
aName.sprintf("%s_%d",aNewName,theTimeId);
+ delete[] aNewName;
return aName.latin1();
}
\brief The file contains definitions for basic classes of the VISU CONVERTER package
*/
+#include "VISUConvertor.hxx"
#include "VISU_IDMapper.hxx"
#include "VISU_ConvertorDef.hxx"
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;
extern "C"
{
+VISU_CONVERTOR_EXPORT
//! Instatiate proper VISU_Convertor subclass
- VISU_Convertor*
+ VISU_Convertor*
CreateConvertor(const std::string& theFileName);
};
#include <vtkCellType.h>
+#include "VISUConvertor.hxx"
+
#include "MED_Utilities.hxx"
class vtkUnstructuredGrid;
void
WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName);
- class TTimerLog
+ class VISU_CONVERTOR_EXPORT TTimerLog
{
int myIsDebug;
double myCPUTime;
static int MYVTKDEBUG = 0;
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
static int MYDEBUGWITHFILES = 0;
//#define _DEXCEPT_
#else
}
}
}
+ float aScalarRange[2];
+ theSource->Update();
+ theSource->GetScalarRange( aScalarRange );
+ //cout << theSource->GetNumberOfPoints() << endl;
+ theSource->Print( cout );
+
aFloatArray->Delete();
aDataArray->Delete();
}
aGaussPtsIDFilter->myIsVTKDone = true;
+ anOutput->Print( cout );
+
if(MYDEBUGWITHFILES){
string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
string aFieldName = QString(theFieldName.c_str()).simplifyWhiteSpace().latin1();
class VTKViewer_AppendFilter;
class VISU_MergeFilter;
+#include "VISUConvertor.hxx"
#include "VISU_Convertor.hxx"
#include "MED_SliceArray.hxx"
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);
//---------------------------------------------------------------
//---------------------------------------------------------------
//! 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
//---------------------------------------------------------------
//! 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
//---------------------------------------------------------------
//! Define a container for VTK representation
- class TSource: public virtual TSizeCounter
+ class VISU_CONVERTOR_EXPORT TSource: public virtual TSizeCounter
{
protected:
mutable TVTKSource mySource;
/*!
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:
/*!
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:
typedef TCSlice<TCoordArray> 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
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<std::string> TPointsDim;
//---------------------------------------------------------------
//! 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
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();
typedef std::map<EGeometry,PSubProfileImpl> 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();
//---------------------------------------------------------------
//! 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
typedef SharedPtr<TGaussImpl> 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
//---------------------------------------------------------------
//! Specialize TGaussSubMesh to provide VTK mapping for the entity
- struct TGaussSubMeshImpl: virtual TGaussSubMesh,
+ struct VISU_CONVERTOR_EXPORT TGaussSubMeshImpl: virtual TGaussSubMesh,
virtual TSource
{
TGaussSubMeshImpl();
typedef std::map<EGeometry,PGaussSubMeshImpl> TGeom2GaussSubMesh;
//! Specialize TGaussMesh to provide VTK mapping for the entity
- struct TGaussMeshImpl: virtual TGaussMesh,
+ struct VISU_CONVERTOR_EXPORT TGaussMeshImpl: virtual TGaussMesh,
virtual TAppendFilter
{
TGaussMeshImpl();
//---------------------------------------------------------------
//! 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;
typedef TVector<TConnect> 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
typedef TVector<PSubMeshImpl> 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
{
typedef std::map<EGeometry,TSubMeshID> 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
typedef TVector<PFamilyImpl> 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
typedef TVector<TMinMax> 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
typedef TVector<TValueSlice> 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
typedef std::map<EGeometry,vtkIdType> 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
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();
\brief The file contains declarations for basic interfaces that defines mapping of mesh elements
*/
+#include "VISUConvertor.hxx"
+
#include "MED_SharedPtr.hxx"
#include <vtkSystemIncludes.h>
//---------------------------------------------------------------
//! 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()
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
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;
#define _LOAD_FAMILIES_
#define _EDF_NODE_IDS_
-namespace
+namespace VISU
{
//---------------------------------------------------------------
vtkIdType
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;
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;
TTimerLog aTimerLog(MYDEBUG,"InitGaussMesh");
INITMSG(MYDEBUG,"InitGaussMesh"<<endl);
- if(theMeshOnEntity.myEntity == NODE_ENTITY)
+ if(theMeshOnEntity.myEntity == VISU::NODE_ENTITY)
return;
TGaussMeshMap& aGaussMeshMap = theMeshOnEntity.myGaussMeshMap;
float& aMax = aMinMax.second;
for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
const float& aVal = aMValueSlice[iGauss];
- aMin = min(aMin,aVal);
- aMax = max(aMax,aVal);
+ aMin = std::min(aMin,aVal);
+ aMax = std::max(aMax,aVal);
}
}
}
aValue += aVal*aVal;
}
aValue = sqrt(aValue);
- aMin = min(aMin,aValue);
- aMax = max(aMax,aValue);
+ aMin = std::min(aMin,aValue);
+ aMax = std::max(aMax,aValue);
}
}
}
const TEntity& anEntity = theMeshOnEntity->myEntity;
int isPointsUpdated = 0, isCellsOnEntityUpdated = 0;
- if(anEntity == NODE_ENTITY){
+ if(anEntity == VISU::NODE_ENTITY){
isPointsUpdated += LoadPoints(aMed,theMesh);
}else{
isPointsUpdated += LoadPoints(aMed,theMesh);
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);
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);
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);
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);
//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 = "<<theMesh->myIsDone<<"'\n");
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;
#include "SALOME_NamingService.hxx"
#include "Utils_ExceptHandlers.hxx"
+#include <qmutex.h>
+
using namespace std;
#ifdef _DEBUG_
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)
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);
}
--- /dev/null
+// 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
#include <SALOMEDSClient_SObject.hxx>
-class VisuGUI_TableDlg : public QDialog
+#include "VisuGUITools.h"
+
+class VISU_GUITOOLS_EXPORT VisuGUI_TableDlg : public QDialog
{
Q_OBJECT
class VTKViewer_ShrinkFilter;
class VISU_PipeLine;
-#ifdef _WIN_32
+#ifdef _WIN32
#define VTKOCC_EXPORT __declspec (dllexport)
#else
#define VTKOCC_EXPORT VTK_EXPORT
class vtkImageData;
+#include "VISU_Actor.h"
//============================================================================
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 );
* 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 );
* 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 );
* 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 };
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);
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<vtkImageData> 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<vtkImageData> 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"<<exc.what());
- }catch(...){
+ }
+ catch(...){
MESSAGE("Unknown exception was occured in VISU_Convertor_impl");
}
return 1;
--- /dev/null
+// 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 : VISUPipeline.hxx
+// Author : Oleg UVAROV
+// Module : VISU
+
+#ifndef _VISUPipeline_HXX_
+#define _VISUPipeline_HXX_
+
+#ifdef WNT
+ #if defined VISU_PIPELINE_EXPORTS
+ #if defined WIN32
+ #define VISU_PIPELINE_EXPORT __declspec( dllexport )
+ #else
+ #define VISU_PIPELINE_EXPORT
+ #endif
+ #else
+ #if defined WIN32
+ #define VISU_PIPELINE_EXPORT __declspec( dllimport )
+ #else
+ #define VISU_PIPELINE_EXPORT
+ #endif
+ #endif
+#else
+ #define VISU_PIPELINE_EXPORT
+#endif
+
+#endif
\ No newline at end of file
#ifndef VISU_CutLinesPL_HeaderFile
#define VISU_CutLinesPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_CutPlanesPL.hxx"
class vtkAppendPolyData;
-class VISU_CutLinesPL : public VISU_CutPlanesPL{
+class VISU_PIPELINE_EXPORT VISU_CutLinesPL : public VISU_CutPlanesPL{
protected:
VISU_CutLinesPL();
VISU_CutLinesPL(const VISU_CutLinesPL&);
#ifndef VISU_CutPlanesPL_HeaderFile
#define VISU_CutPlanesPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
#include <vector>
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&);
#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&);
Superclass::Init();
vtkDataSet* aDataSet = GetParentMesh();
+ aDataSet->Update();
+
+ aDataSet->Print( cout );
+
float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
float* aScalarRange = GetScalarRange();
#ifndef VISU_GaussPointsPL_HeaderFile
#define VISU_GaussPointsPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_Convertor.hxx"
* 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();
// purpose :
//==================================================================
#include <vtkFollower.h>
+
+#include "VISUPipeline.hxx"
+
class VISU_UnScaledActor: public vtkFollower
{
class vtkImplicitFunction;
-class VISU_ImplicitFunctionWidget : public vtk3DWidget
+class VISU_PIPELINE_EXPORT VISU_ImplicitFunctionWidget : public vtk3DWidget
{
public:
vtkTypeRevisionMacro(VISU_ImplicitFunctionWidget,vtk3DWidget);
#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&);
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]);
#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&);
#include <vtkTimerLog.h>
#include <vtkTriangle.h>
+#ifndef WIN32
#include <dlfcn.h>
+#endif
#include <stdio.h>
#include <cmath>
#define VTK_PDPSM_NORMAL_TYPE_DOUBLE 0x0020
#define VTK_PDPSM_OPAQUE_COLORS 0x0040
+//#ifndef WIN32
+
#ifndef APIENTRY
#define APIENTRY
#endif
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" );
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;
//-----------------------------------------------------------------------------
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;
# pragma warning ( disable : 4275 )
#endif
+#ifdef WIN32
+#include <windows.h>
+#endif
+
#include <GL/gl.h>
#include <vtkSmartPointer.h>
typedef GLuint GLhandleARB;
#endif
+#include "VISUPipeline.hxx"
+
//----------------------------------------------------------------------------
//! OpenGL Point Sprites PolyData Mapper.
/*!
* 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.
#include <vtkObject.h>
#include <vtkSmartPointer.h>
+#include "VISUPipeline.hxx"
#include "VISU_IDMapper.hxx"
class vtkCell;
typedef VISU::TVTKOutput TInput;
-class VISU_PipeLine : public vtkObject{
+class VISU_PIPELINE_EXPORT VISU_PipeLine : public vtkObject{
public:
vtkTypeMacro(VISU_PipeLine,vtkObject);
virtual
protected:
VISU_PipeLine();
- VISU_PipeLine(const VISU_PipeLine&);
virtual
TInput*
#ifndef VISU_PipeLineUtils_HeaderFile
#define VISU_PipeLineUtils_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_FieldTransform.hxx"
#include "VISU_LookupTable.hxx"
#include "VISU_Extractor.hxx"
#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<class TItem>
void
#ifndef __VISU_PlanesWidget_h
#define __VISU_PlanesWidget_h
+#include "VISUPipeline.hxx"
#include "VISU_ImplicitFunctionWidget.hxx"
class vtkActor;
class vtkPolyDataMapper;
class VISU_UnScaledActor;
class vtkDataSet;
-class VISU_PlanesWidget : public VISU_ImplicitFunctionWidget
+class VISU_PIPELINE_EXPORT VISU_PlanesWidget : public VISU_ImplicitFunctionWidget
{
public:
// Description:
#ifndef VISU_Plot3DPL_HeaderFile
#define VISU_Plot3DPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
#include "VISU_CutPlanesPL.hxx"
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&);
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]);
}
#ifndef VISU_ScalarBarActor_HeaderFile
#define VISU_ScalarBarActor_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_LookupTable.hxx"
#include <vtkActor2D.h>
#define VTK_ORIENT_VERTICAL 1
#endif
-class VISU_ScalarBarActor : public vtkActor2D
+class VISU_PIPELINE_EXPORT VISU_ScalarBarActor : public vtkActor2D
{
public:
vtkTypeRevisionMacro(VISU_ScalarBarActor,vtkActor2D);
#ifndef VISU_ScalarBarCtrl_HeaderFile
#define VISU_ScalarBarCtrl_HeaderFile
+#include "VISUPipeline.hxx"
+
#include <vtkObject.h>
class vtkRenderer;
class vtkLookupTable;
class vtkScalarBarActor;
-class VISU_ScalarBarCtrl : public vtkObject
+class VISU_PIPELINE_EXPORT VISU_ScalarBarCtrl : public vtkObject
{
public:
vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
#ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile
#define VISU_ScalarMapOnDeformedShapePL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
class vtkMergeFilter;
class vtkCellDataToPointData;
class vtkPointDataToCellData;
-class VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
+class VISU_PIPELINE_EXPORT VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
{
protected:
VISU_ScalarMapOnDeformedShapePL();
#ifndef VISU_ScalrMapPL_HeaderFile
#define VISU_ScalrMapPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_PipeLine.hxx"
#include "VISU_ScalarBarActor.hxx"
//============================================================================
-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();
#ifndef __VISU_SphereWidget_h
#define __VISU_SphereWidget_h
+#include "VISUPipeline.hxx"
#include "VISU_ImplicitFunctionWidget.hxx"
class VISU_UnScaledActor;
class vtkImplicitSum;
class vtkImplicitFunction;
//
-class VISU_SphereWidget : public VISU_ImplicitFunctionWidget
+class VISU_PIPELINE_EXPORT VISU_SphereWidget : public VISU_ImplicitFunctionWidget
{
public:
// Description:
#include "VISU_UsedPointsFilter.hxx"
#include "VTKViewer_GeometryFilter.h"
-#include <algo.h>
+#include <algorithm>
#include <vtkCell.h>
#include <vtkPointSet.h>
#ifndef VISU_StreamLinesPL_HeaderFile
#define VISU_StreamLinesPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_DeformedShapePL.hxx"
#include <vtkStreamLine.h>
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&);
#ifndef VISU_VectorsPL_HeaderFile
#define VISU_VectorsPL_HeaderFile
+#include "VISUPipeline.hxx"
#include "VISU_DeformedShapePL.hxx"
class VTKViewer_TransformFilter;
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&);
#ifndef __VISU_WidgetCtrl_hxx
#define __VISU_WidgetCtrl_hxx
+#include "VISUPipeline.hxx"
#include <vtkImplicitFunction.h>
class VISU_SphereWidget;
class VISU_ImplicitFunctionWidget;
-class VISU_WidgetCtrl : public vtkImplicitFunction
+class VISU_PIPELINE_EXPORT VISU_WidgetCtrl : public vtkImplicitFunction
{
public:
static VISU_WidgetCtrl *New();
static int MYDEBUG = 0;
#endif
+#ifdef WIN32
+#define usleep(A) _sleep(A/1000)
+#endif
+
//////////////////////////////////////////////////
// Class: VisuGUI
//////////////////////////////////////////////////
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();
}
}
+ delete [] entries;
+
// Finish transaction
aStudyBuilder->CommitCommand();
}
return getApp()->getViewManager(theType,theIsCreate);
}
-TViewToPrs3d
-VisuGUI
-::getScalarBarsMap()
-{
- return myScalarBarsMap;
-}
LightApp_Displayer* VisuGUI::displayer()
{
if( !myDisplayer )
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* );
// Module : VISU
// $Header$
+#include <string>
using namespace std;
#include "VisuGUI_CursorDlg.h"
#include <qlayout.h>
SALOME_Actor* myPreviewActor;
private slots:
- void editScalarBar();
+ //void editScalarBar();
void orientationChanged( int );
void DrawTable();
void setDefault( int all = -1);
protected slots:
void accept();
void reject();
- void onWindowActivated (SUIT_ViewWindow*);
+ //void onWindowActivated (SUIT_ViewWindow*);
private:
VisuGUI_CutPlanesPane* myCutPane;
#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()
{
private slots:
void changeDefaults( int );
- void changeRange( int );
+ //void changeRange( int );
void XYChanged( double );
void onTextPref();
void onSetDisplayGlobal();
void reject();
private slots:
- void onSelectionActive(bool theActive);
+ //void onSelectionActive(bool theActive);
void StepLengthChanged(double theValue);
void IntegrationStepChanged(double theValue);
void PropagationTimeChanged(double theValue);
// Module : VISU
// $Header$
+#include <string>
using namespace std;
#include "VisuGUI_SweepPrefDlg.h"
#include <qlayout.h>
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)
#ifndef __VISU_CONFIG_H__
#define __VISU_CONFIG_H__
+#include "VISU_I.hxx"
+
// IDL headers
#include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(VISU_Gen)
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:
//===========================================================================
- class Mutex{
+ class VISU_I_EXPORT Mutex{
QMutex* myMutex;
int isQAppLocked;
public:
//===========================================================================
- class Storable : public virtual Base_i {
+ class VISU_I_EXPORT Storable : public virtual Base_i {
protected:
virtual void ToStream(std::ostringstream& theStr) = 0;
public:
};
//===========================================================================
- class RemovableObject_i : public virtual POA_VISU::RemovableObject,
+ class VISU_I_EXPORT RemovableObject_i : public virtual POA_VISU::RemovableObject,
public virtual Storable
{
public:
};
//===========================================================================
- 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);
}
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;
a_last_indx = tmp;
}
std::list<float>::const_iterator aIter = XKeys.begin();
- for (int k=0;k<XKeys.size() and aIter != XKeys.end();k++,aIter++){
+ for (int k=0;k<XKeys.size() && aIter != XKeys.end();k++,aIter++){
// Warning: value '1.0' come from workaround:
// see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
// aDist >= 0 and aDist<=1.0
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:
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:
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:
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:
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)
class ColoredPrs3d_i;
bool
- CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
+ VISU_I_EXPORT CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
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,
--- /dev/null
+// 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
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:
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:
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:
- 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,
#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&);
namespace VISU
{
//----------------------------------------------------------------------------
- class MinMaxCunsomer: public virtual boost::bsignals::trackable
+ class VISU_I_EXPORT MinMaxCunsomer: public virtual boost::bsignals::trackable
{
protected:
bool myMinMaxIsInitilized;
//----------------------------------------------------------------------------
- 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:
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:
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
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:
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 );
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;
};
//==============================================================================
- 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;
};
-class VISU_TimeAnimation: public QObject, public QThread
+class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
{
Q_OBJECT;
public:
};
-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;
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:
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:
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);
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,
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,
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));
}
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)
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:
//===========================================================================
- class XYPlot_i : public virtual POA_VISU::XYPlot,
+ class VISU_I_EXPORT XYPlot_i : public virtual POA_VISU::XYPlot,
public virtual View_i
{
public:
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();
//===========================================================================
- class TableView_i : public virtual POA_VISU::TableView,
+ class VISU_I_EXPORT TableView_i : public virtual POA_VISU::TableView,
public virtual View_i
{
public:
//===========================================================================
- class View3D_i : public virtual POA_VISU::View3D,
+ class VISU_I_EXPORT View3D_i : public virtual POA_VISU::View3D,
public virtual View_i
{
public:
#ifdef WNT
-#ifdef SVTK_EXPORTS
+#ifdef VISU_VVTK_EXPORTS
#define VVTK_EXPORT __declspec(dllexport)
#else
#define VVTK_EXPORT __declspec(dllimport)
#include "VISU_GaussPtsAct.h"
#include "VISU_Event.h"
+#include "SVTK_ViewWindow.h"
#include "SVTK_RenderWindowInteractor.h"
#include "VVTK_Renderer.h"
#include "VVTK_PickingDlg.h"
}
//----------------------------------------------------------------------------
-int
-convertAction( const int accelAction );
-
void
VVTK_MainWindow
::action( const int accelAction )
#include <qpushbutton.h>
#include <qfiledialog.h>
-#include <iostream.h>
+#include <iostream>
using namespace std;
#ifndef VVTK_PRIMITIVEBOX_H
#define VVTK_PRIMITIVEBOX_H
+#include "VVTK.h"
+
#include <qgroupbox.h>
class QLabel;
class QtxDblSpinBox;
class QtxIntSpinBox;
-class VVTK_PrimitiveBox : public QGroupBox
+class VVTK_EXPORT VVTK_PrimitiveBox : public QGroupBox
{
Q_OBJECT
-// SALOME VTKViewer : build VTK viewer into Salome desktop\r
-//\r
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS \r
-// \r
-// This library is free software; you can redistribute it and/or \r
-// modify it under the terms of the GNU Lesser General Public \r
-// License as published by the Free Software Foundation; either \r
-// version 2.1 of the License. \r
-// \r
-// This library is distributed in the hope that it will be useful, \r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of \r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r
-// Lesser General Public License for more details. \r
-// \r
-// You should have received a copy of the GNU Lesser General Public \r
-// License along with this library; if not, write to the Free Software \r
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \r
-// \r
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org \r
-//\r
-//\r
-//\r
-// File :\r
-// Author :\r
-// Module :\r
-// $Header$\r
-\r
-#include "VVTK_Recorder.h"\r
-\r
-#include "VVTK_ImageWriter.h"\r
-#include "VVTK_ImageWriterMgr.h"\r
-\r
-#include <vtkObjectFactory.h>\r
-#include <vtkObject.h>\r
-#include <vtkCallbackCommand.h>\r
-#include <vtkRenderWindow.h>\r
-#include <vtkTimerLog.h>\r
-#include <vtkWindowToImageFilter.h>\r
-#include <vtkJPEGWriter.h>\r
-#include <vtkImageData.h>\r
-\r
-#include <sstream>\r
-#include <iomanip>\r
-#include <iostream>\r
-\r
-#include <unistd.h>\r
-#include <qapplication.h>\r
-#include <qfileinfo.h>\r
-\r
-#include "utilities.h"\r
-\r
-#ifdef _DEBUG_\r
-static int MYDEBUG = 0;\r
-#else\r
-static int MYDEBUG = 0;\r
-#endif\r
-\r
-\r
-namespace\r
-{\r
- //----------------------------------------------------------------------------\r
- inline\r
- void\r
- GetNameJPEG(const std::string& thePreffix, \r
- const int theIndex,\r
- std::string& theName)\r
- {\r
- using namespace std;\r
- ostringstream aStream;\r
- aStream<<thePreffix<<"_"<<setw(6)<<setfill('0')<<theIndex<<".jpeg";\r
- theName = aStream.str();\r
- }\r
-}\r
-\r
-//----------------------------------------------------------------------------\r
-vtkCxxRevisionMacro(VVTK_Recorder,"$Revision$");\r
-vtkStandardNewMacro(VVTK_Recorder);\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_Recorder\r
-::VVTK_Recorder():\r
- myRenderWindow(NULL),\r
- myState(VVTK_Recorder_Stop),\r
- myNbFPS(5.5),\r
- myQuality(100),\r
- myProgressiveMode(true),\r
- myUseSkippedFrames(true),\r
- myErrorStatus(0),\r
- myCommand(vtkCallbackCommand::New()),\r
- myPriority(0.0),\r
- myTimeStart(0.0),\r
- myFrameIndex(0),\r
- myPaused(0),\r
- myFilter(vtkWindowToImageFilter::New()),\r
- myWriterMgr(new VVTK_ImageWriterMgr),\r
- myNbWrittenFrames(0),\r
- myNameAVIMaker("jpeg2yuv")\r
-{\r
- myCommand->SetClientData(this); \r
- myCommand->SetCallback(VVTK_Recorder::ProcessEvents);\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-VVTK_Recorder\r
-::~VVTK_Recorder()\r
-{\r
- myCommand->Delete();\r
- myFilter->Delete();\r
- delete myWriterMgr;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::CheckExistAVIMaker()\r
-{\r
- myErrorStatus = 0;\r
- using namespace std;\r
- ostringstream aStream;\r
- aStream<<"which "<<myNameAVIMaker<<" >& /dev/null";\r
- std::string anAVIMakeCheck = aStream.str();\r
- int iErr = system(anAVIMakeCheck.c_str());\r
- if(iErr != 0)\r
- myErrorStatus = 127;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::SetName(const char* theName)\r
-{\r
- myName = theName;\r
-}\r
-\r
-const char* \r
-VVTK_Recorder::Name() const\r
-{\r
- return myName.c_str();\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::SetNbFPS(const double theNbFPS)\r
-{\r
- myNbFPS = theNbFPS;\r
-}\r
-\r
-double\r
-VVTK_Recorder\r
-::NbFPS() const\r
-{\r
- return myNbFPS;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::SetQuality(int theQuality)\r
-{\r
- myQuality = theQuality;\r
-}\r
-\r
-int\r
-VVTK_Recorder\r
-::GetQuality() const\r
-{\r
- return myQuality;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void \r
-VVTK_Recorder\r
-::SetRenderWindow(vtkRenderWindow* theRenderWindow)\r
-{\r
- myRenderWindow = theRenderWindow;\r
-}\r
-\r
-vtkRenderWindow* \r
-VVTK_Recorder\r
-::RenderWindow()\r
-{\r
- return myRenderWindow;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::SetProgressiveMode(bool theProgressiveMode)\r
-{\r
- myProgressiveMode = theProgressiveMode;\r
-}\r
-\r
-bool\r
-VVTK_Recorder\r
-::GetProgressiveMode() const\r
-{\r
- return myProgressiveMode;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::SetUseSkippedFrames(bool theUseSkippedFrames)\r
-{\r
- myUseSkippedFrames = theUseSkippedFrames;\r
-}\r
-\r
-bool\r
-VVTK_Recorder\r
-::UseSkippedFrames() const\r
-{\r
- return myUseSkippedFrames;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-int\r
-VVTK_Recorder\r
-::ErrorStatus() const\r
-{\r
- return myErrorStatus;\r
-}\r
-\r
-int\r
-VVTK_Recorder\r
-::State() const\r
-{\r
- return myState;\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::ProcessEvents(vtkObject* vtkNotUsed(theObject), \r
- unsigned long theEvent,\r
- void* theClientData, \r
- void* vtkNotUsed(theCallData))\r
-{\r
- if(vtkObject* anObj = reinterpret_cast<vtkObject*>(theClientData)){ \r
- if(VVTK_Recorder* aSelf = dynamic_cast<VVTK_Recorder*>(anObj)){\r
- if(theEvent==vtkCommand::EndEvent){\r
- if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){\r
- aSelf->DoRecord();\r
- }\r
- }\r
- }\r
- }\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::Record()\r
-{\r
- if(myState == VVTK_Recorder_Stop){\r
- if(myRenderWindow){\r
- myState = VVTK_Recorder_Record;\r
- myFilter->SetInput(myRenderWindow);\r
- myFrameIndex = -1;\r
- myNbWrittenFrames = 0;\r
- myRenderWindow->RemoveObserver(myCommand);\r
- myRenderWindow->AddObserver(vtkCommand::EndEvent,\r
- myCommand,\r
- myPriority);\r
- myRenderWindow->Render();\r
- }\r
- }\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::Stop()\r
-{\r
- QApplication::setOverrideCursor( Qt::waitCursor );\r
-\r
- if(myState == VVTK_Recorder_Record){ \r
- if(!myPaused)\r
- DoRecord();\r
-\r
- myWriterMgr->Stop();\r
-\r
- if(myUseSkippedFrames)\r
- AddSkippedFrames();\r
-\r
- myFrameIndexes.clear();\r
-\r
- MakeFileAVI();\r
- }\r
- myState = VVTK_Recorder_Stop;\r
- myPaused = 0;\r
-\r
- QApplication::restoreOverrideCursor();\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::Pause()\r
-{\r
- myPaused = myPaused ? 0 : 1;\r
- if(myPaused && !myFrameIndexes.empty()){\r
- size_t aLastId = myFrameIndexes.size() - 1;\r
- myFrameIndexes[aLastId] *= -1;\r
- }\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::DoRecord()\r
-{\r
- if(myPaused)\r
- return;\r
-\r
- if(myFrameIndex < 0){\r
- myFrameIndex = 0;\r
- myTimeStart = vtkTimerLog::GetCurrentTime();\r
- }else{\r
- double aTimeNow = vtkTimerLog::GetCurrentTime();\r
- double aDelta = aTimeNow - myTimeStart;\r
- if(aDelta < 0.0)\r
- return;\r
-\r
- int aFrameIndex = int(aDelta*myNbFPS);\r
- if(aFrameIndex == myFrameIndex)\r
- return;\r
-\r
- myFrameIndex = aFrameIndex;\r
- }\r
-\r
- myFrameIndexes.push_back(myFrameIndex);\r
- if(MYDEBUG) cout<<"VVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex<<endl;\r
-\r
- myRenderWindow->RemoveObserver(myCommand);\r
- myFilter->Modified();\r
-\r
- std::string aName;\r
- GetNameJPEG(myName,myFrameIndex,aName);\r
-\r
- PreWrite();\r
-\r
- vtkImageData *anImageData = vtkImageData::New(); \r
- anImageData->DeepCopy(myFilter->GetOutput());\r
-\r
- myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality);\r
- myNbWrittenFrames++;\r
-\r
- myRenderWindow->AddObserver(vtkCommand::EndEvent,\r
- myCommand,\r
- myPriority);\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::PreWrite()\r
-{\r
- vtkImageData *anImageData = myFilter->GetOutput();\r
- //\r
- if(!anImageData){\r
- myErrorStatus = 20;\r
- return;\r
- }\r
- anImageData->UpdateInformation();\r
- int *anExtent = anImageData->GetWholeExtent();\r
- anImageData->SetUpdateExtent(anExtent[0], anExtent[1],\r
- anExtent[2], anExtent[3],\r
- 0,0);\r
- anImageData->UpdateData();\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::AddSkippedFrames()\r
-{\r
- myErrorStatus = 0;\r
-\r
- if(myFrameIndexes.size() < 2)\r
- return;\r
-\r
- size_t anId = 0, anEnd = myFrameIndexes.size() - 1;\r
- for(; anId < anEnd; anId++){\r
- int aStartIndex = myFrameIndexes[anId];\r
- if(aStartIndex < 0)\r
- continue;\r
-\r
- int aFinishIndex = abs(myFrameIndexes[anId + 1]);\r
- if(aStartIndex + 1 == aFinishIndex)\r
- continue;\r
-\r
- std::string anInitialName;\r
- std::ostringstream aStream;\r
- GetNameJPEG(myName,aStartIndex,anInitialName);\r
- for(int anIndex = aStartIndex + 1; anIndex < aFinishIndex; anIndex++){\r
- myNbWrittenFrames++;\r
- std::string anCurrentName;\r
- GetNameJPEG(myName,anIndex,anCurrentName);\r
- aStream<<"ln -s "<< anInitialName<<" "<<anCurrentName<<";";\r
- if(anIndex + 1 < aFinishIndex)\r
- aStream<<" \\";\r
- aStream<<endl;\r
- }\r
- std::string aString(aStream.str());\r
- system(aString.c_str());\r
- if(MYDEBUG) cout<<"VVTK_Recorder::AddSkippedFrames - "<<aString<<endl;\r
- }\r
-}\r
-\r
-\r
-//----------------------------------------------------------------------------\r
-void\r
-VVTK_Recorder\r
-::MakeFileAVI()\r
-{\r
- myErrorStatus = 0;\r
- std::ostringstream aStream;\r
- aStream<<myNameAVIMaker<<\r
- " -I p"<<\r
- " -v 0"<<\r
- //" -f "<<int(myNbFPS)<<" "<<\r
- " -f "<<myNbFPS<<" "<<\r
- " -n "<<myNbWrittenFrames<<" "<<\r
- " -j "<<myName<<"_\%06d.jpeg "<<\r
- "| yuv2lav"<<\r
- " -o "<<myName;\r
- \r
- std::string aString(aStream.str());\r
- myErrorStatus = system(aString.c_str());\r
-\r
- if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aString<<endl;\r
-\r
- QFileInfo aFileInfo(myName);\r
- QString aDirPath = aFileInfo.dirPath(TRUE);\r
- QString aBaseName = aFileInfo.fileName();\r
- QString aCommand = \r
- QString("(cd ") + aDirPath + \r
- "; ls " +\r
- " | egrep '" + aBaseName + "_[0-9]*.jpeg'" +\r
- " | xargs rm " +\r
- ")";\r
-\r
- if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aCommand.latin1()<<endl;\r
- system(aCommand.latin1());\r
-}\r
+// 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 <vtkObjectFactory.h>
+#include <vtkObject.h>
+#include <vtkCallbackCommand.h>
+#include <vtkRenderWindow.h>
+#include <vtkTimerLog.h>
+#include <vtkWindowToImageFilter.h>
+#include <vtkJPEGWriter.h>
+#include <vtkImageData.h>
+
+#include <sstream>
+#include <iomanip>
+#include <iostream>
+
+#ifndef WIN32
+#include <unistd.h>
+#endif
+
+#include <qapplication.h>
+#include <qfileinfo.h>
+
+#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<<thePreffix<<"_"<<setw(6)<<setfill('0')<<theIndex<<".jpeg";
+ theName = aStream.str();
+ }
+}
+
+//----------------------------------------------------------------------------
+vtkCxxRevisionMacro(VVTK_Recorder,"$Revision$");
+vtkStandardNewMacro(VVTK_Recorder);
+
+
+//----------------------------------------------------------------------------
+VVTK_Recorder
+::VVTK_Recorder():
+ myRenderWindow(NULL),
+ myState(VVTK_Recorder_Stop),
+ myNbFPS(5.5),
+ myQuality(100),
+ myProgressiveMode(true),
+ myUseSkippedFrames(true),
+ myErrorStatus(0),
+ myCommand(vtkCallbackCommand::New()),
+ myPriority(0.0),
+ myTimeStart(0.0),
+ myFrameIndex(0),
+ myPaused(0),
+ myFilter(vtkWindowToImageFilter::New()),
+ myWriterMgr(new VVTK_ImageWriterMgr),
+ myNbWrittenFrames(0),
+ myNameAVIMaker("jpeg2yuv")
+{
+ myCommand->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 "<<myNameAVIMaker<<" >& /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<vtkObject*>(theClientData)){
+ if(VVTK_Recorder* aSelf = dynamic_cast<VVTK_Recorder*>(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 = "<<myFrameIndex<<endl;
+
+ myRenderWindow->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<<" "<<anCurrentName<<";";
+ if(anIndex + 1 < aFinishIndex)
+ aStream<<" \\";
+ aStream<<endl;
+ }
+ std::string aString(aStream.str());
+ system(aString.c_str());
+ if(MYDEBUG) cout<<"VVTK_Recorder::AddSkippedFrames - "<<aString<<endl;
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_Recorder
+::MakeFileAVI()
+{
+ myErrorStatus = 0;
+ std::ostringstream aStream;
+ aStream<<myNameAVIMaker<<
+ " -I p"<<
+ " -v 0"<<
+ //" -f "<<int(myNbFPS)<<" "<<
+ " -f "<<myNbFPS<<" "<<
+ " -n "<<myNbWrittenFrames<<" "<<
+ " -j "<<myName<<"_\%06d.jpeg "<<
+ "| yuv2lav"<<
+ " -o "<<myName;
+
+ std::string aString(aStream.str());
+ myErrorStatus = system(aString.c_str());
+
+ if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aString<<endl;
+
+ QFileInfo aFileInfo(myName);
+ QString aDirPath = aFileInfo.dirPath(TRUE);
+ QString aBaseName = aFileInfo.fileName();
+ QString aCommand =
+ QString("(cd ") + aDirPath +
+ "; ls " +
+ " | egrep '" + aBaseName + "_[0-9]*.jpeg'" +
+ " | xargs rm " +
+ ")";
+
+ if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aCommand.latin1()<<endl;
+ system(aCommand.latin1());
+}
#ifndef VVTK_SEGMENTATIONCURSORDLG_H
#define VVTK_SEGMENTATIONCURSORDLG_H
+#include "VVTK.h"
+
#include <qdialog.h>
#include <vtkObject.h>
{
typedef vtkSmartPointer<vtkImageData> TTextureValue;
- TTextureValue
+ VVTK_EXPORT TTextureValue
GetTexture(const QString& theMainTexture,
const QString& theAlphaTexture);
}
#ifndef VVTK_SIZEBOX_H
#define VVTK_SIZEBOX_H
+#include "VVTK.h"
+
#include <qvbox.h>
class QLabel;
class QtxDblSpinBox;
class QtxIntSpinBox;
-class VVTK_SizeBox : public QVBox
+class VVTK_EXPORT VVTK_SizeBox : public QVBox
{
Q_OBJECT