STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
${KERNEL_INCLUDE_DIRS}
${GUI_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}
- ${CAS_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${QT_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS})
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
# libraries to link to
// --- Menu "Help"
int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 );
- int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aHelpMnu, -1, 0 );
+ int aUsersGuide = createMenu( tr( "User's Guide" ), aHelpMnu, -1 );
+ int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aUsersGuide, -1, 5 );
#ifdef HAS_PV_DOC
createMenu( ParaViewHelpId, aPVHelpMnu );
createMenu( separator(), aPVHelpMnu );
ENDIF(NOT ParaView_FOUND)
INCLUDE(${PARAVIEW_USE_FILE})
# Load information about VTK/ParaView modules loaded/available.
- PV_SETUP_MODULE_ENVIRONMENT("vtkMEDReader")
ELSE(MEDReader_BUILD_ParaView_Plugin)
FIND_PACKAGE(VTK REQUIRED)
if(NOT VTK_FOUND)
MESSAGE(FATAL_ERROR "Please locate ParaView." )
ENDIF(NOT ParaView_FOUND)
INCLUDE(${PARAVIEW_USE_FILE})
-PV_SETUP_MODULE_ENVIRONMENT("vtkMEDWriter")
OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ${VTK_BUILD_SHARED_LIBS})
vtkCellArray *cc(ds->GetLines());
if(cc)
{
- MCAuto<MEDCouplingUMesh> subMesh(BuildMeshFromCellArray(cc,coords,1,INTERP_KERNEL::NORM_SEG2));
+ MCAuto<MEDCouplingUMesh> subMesh;
+ try
+ {
+ subMesh=BuildMeshFromCellArray(cc,coords,1,INTERP_KERNEL::NORM_SEG2);
+ }
+ catch(INTERP_KERNEL::Exception& e)
+ {
+ std::ostringstream oss; oss << "MEDWriter does not manage polyline cell type because MED file format does not support it ! Maybe it is the source of the problem ? The cause of this exception was " << e.what() << std::endl;
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
if((const MEDCouplingUMesh *)subMesh)
{
std::vector<MCAuto<DataArray> > cellFs(AddPartFields2(offset,offset+subMesh->getNumberOfCells(),ds->GetCellData()));
}
else
{
- std::ostringstream oss; oss << "ConvertFromUnstructuredGrid : at pos #" << i << " unrecognized VTK cell with type =" << ctPtr[i];
- throw MZCException(oss.str());
+ if(ctPtr[i]==VTK_POLY_VERTEX)
+ {
+ const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(INTERP_KERNEL::NORM_POINT1));
+ levPtr[i]=cm.getDimension();
+ }
+ else
+ {
+ std::ostringstream oss; oss << "ConvertFromUnstructuredGrid : at pos #" << i << " unrecognized VTK cell with type =" << ctPtr[i];
+ throw MZCException(oss.str());
+ }
}
}
int dummy(0);
MCAuto<DataArrayInt> cellIdsCurLev(lev->findIdsEqual(*curLev));
for(const int *cellId=cellIdsCurLev->begin();cellId!=cellIdsCurLev->end();cellId++)
{
- std::map<int,int>::iterator it(m.find(ctPtr[*cellId]));
+ int vtkType(ctPtr[*cellId]);
+ std::map<int,int>::iterator it(m.find(vtkType));
vtkIdType offset(claPtr[*cellId]);
vtkIdType sz(caPtr[offset]);
- INTERP_KERNEL::NormalizedCellType ct((INTERP_KERNEL::NormalizedCellType)(*it).second);
- if(ct!=INTERP_KERNEL::NORM_POLYHED)
+ INTERP_KERNEL::NormalizedCellType ct=it!=m.end()?(INTERP_KERNEL::NormalizedCellType)((*it).second):INTERP_KERNEL::NORM_POINT1;
+ if(ct!=INTERP_KERNEL::NORM_POLYHED && vtkType!=VTK_POLY_VERTEX)
{
std::vector<int> conn2(sz);
for(int kk=0;kk<sz;kk++)
conn2[kk]=caPtr[offset+1+kk];
m0->insertNextCell(ct,sz,&conn2[0]);
}
- else
+ else if(ct==INTERP_KERNEL::NORM_POLYHED)
{
if(!faces || !faceLoc)
throw MZCException("ConvertFromUnstructuredGrid : faces are expected when there are polyhedra !");
}
m0->insertNextCell(ct,conn.size(),&conn[0]);
}
+ else
+ {
+ if(sz!=1)
+ throw MZCException("ConvertFromUnstructuredGrid : non single poly vertex not managed by MED !");
+ m0->insertNextCell(ct,1,caPtr+offset+1);
+ }
}
std::vector<MCAuto<DataArray> > cellFs(AddPartFields(cellIdsCurLev,ds->GetCellData()));
ms.push_back(MicroField(m0,cellFs));
return 1;
}
+void ExceptionDisplayer(vtkMEDWriter *self, const std::string& fileName, std::exception& e)
+{
+ std::ostringstream oss;
+ oss << "Exception has been thrown in vtkMEDWriter::RequestData : During writing of \"" << fileName << "\", the following exception has been thrown : "<< e.what() << std::endl;
+ if(self->HasObserver("ErrorEvent") )
+ self->InvokeEvent("ErrorEvent",const_cast<char *>(oss.str().c_str()));
+ else
+ vtkOutputWindowDisplayErrorText(const_cast<char *>(oss.str().c_str()));
+ vtkObject::BreakOnError();
+}
+
int vtkMEDWriter::RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
//std::cerr << "########################################## vtkMEDWriter::RequestData ########################################## " << (const char *) this->FileName << std::endl;
}
}
}
+ catch(INTERP_KERNEL::Exception& e)
+ {
+ ExceptionDisplayer(this,(const char *) this->FileName,e);
+ return 0;
+ }
catch(MZCException& e)
{
- std::ostringstream oss;
- oss << "Exception has been thrown in vtkMEDWriter::RequestData : During writing of \"" << (const char *) this->FileName << "\", the following exception has been thrown : "<< e.what() << std::endl;
- if(this->HasObserver("ErrorEvent") )
- this->InvokeEvent("ErrorEvent",const_cast<char *>(oss.str().c_str()));
- else
- vtkOutputWindowDisplayErrorText(const_cast<char *>(oss.str().c_str()));
- vtkObject::BreakOnError();
+ ExceptionDisplayer(this,(const char *) this->FileName,e);
return 0;
}
return 1;
${ParaMEDCorba_SOURCE_DIR}/testParaMEDCorba.cxx
)
# SET_TARGET_PROPERTIES(testCorbaPlugin PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}")
-
+
+ # RNV: ${vtkgl2ps_LIBRARIES} was added for Fedora 26 OS
TARGET_LINK_LIBRARIES( testParaMEDCorba
ParaMEDCorbaPlugin
+ ${vtkgl2ps_LIBRARIES}
)
INSTALL(FILES ParaMEDCorbaServerManager.xml DESTINATION share)
+++ /dev/null
-# Copyright (C) 2017 CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Author : Anthony Geay (EDF R&D)
-
-VTK_MODULE_LIBRARY(vtkSimpleMode vtkSimpleMode.cxx)
-IF(${SALOME_GUI_USE_OPENGL2})
- TARGET_LINK_LIBRARIES(vtkSimpleMode vtkPVVTKExtensionsRendering vtkFiltersGeneral vtkFiltersCore vtkRenderingOpenGL2 ${PARAVIEW_LIBRARIES})
-ELSE()
- TARGET_LINK_LIBRARIES(vtkSimpleMode vtkPVVTKExtensionsRendering vtkFiltersGeneral vtkFiltersCore vtkRenderingOpenGL ${PARAVIEW_LIBRARIES})
-ENDIF()
-INSTALL(TARGETS vtkSimpleMode RUNTIME DESTINATION lib/salome LIBRARY DESTINATION lib/salome ARCHIVE DESTINATION lib/salome)
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkUnstructuredGrid.h"
-#include "vtkPolyData.h"
+#include "vtkDataSet.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkInformationStringKey.h"
if(nbCompo==3)
{
vtkSmartPointer<vtkDoubleArray> ret(arr);
- arr->Register(0);
return ret;
}
if(nbCompo==6)
{
if(idx==0)
this->Internal->setFieldForReal(name);
- vtkPolyDataAlgorithm::SetInputArrayToProcess(idx,port,connection,ff,name);
+ vtkDataSetAlgorithm::SetInputArrayToProcess(idx,port,connection,ff,name);
}
double GetOptimalRatioFrom(vtkUnstructuredGrid *dataset, vtkDoubleArray *array)
return maxGeoDelta/maxDispDelta;
}
+int vtkSimpleMode::FillOutputPortInformation( int vtkNotUsed(port), vtkInformation* info)
+{
+ info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkPolyData");
+ return 1;
+}
+
int vtkSimpleMode::RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
//std::cerr << "########################################## vtkSimpleMode::RequestInformation ##########################################" << std::endl;
arr1->SetNumberOfTuples(nbPts);
double *ptToFeed1(arr1->Begin());
const double *srcPt1(arrReal->Begin());
- double cst1(Factor*sin(AnimationTime*2*M_PI));
+ double cst1(Factor*cos(AnimationTime*2*M_PI));
std::transform(srcPt1,srcPt1+3*nbPts,ptToFeed1,std::bind2nd(std::multiplies<double>(),cst1));
int idx1(outSurface->GetPointData()->AddArray(arr1));
outSurface->GetPointData()->SetActiveAttribute(idx1,vtkDataSetAttributes::VECTORS);
vtkDataArray *dummy(0);
ExtractInfo3(ds,this->Internal->getFieldForReal(),dummy,idx2);
}
- ds->GetPointData()->SetActiveAttribute(idx2,vtkDataSetAttributes::SCALARS);
//
vtkInformation *outInfo(outputVector->GetInformationObject(0));
vtkPolyData *output(vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())));
output->ShallowCopy(ds);
-
+ output->GetPointData()->DeepCopy(ds->GetPointData());
+ //
+ for(int i=0;i<output->GetPointData()->GetNumberOfArrays();i++)
+ {
+ vtkDataArray *arr(output->GetPointData()->GetArray(i));
+ vtkDoubleArray *arr2(vtkDoubleArray::SafeDownCast(arr));
+ if(!arr2)
+ continue;
+ int nbCompo(arr2->GetNumberOfComponents()),nbTuples(arr2->GetNumberOfTuples());
+ if(nbCompo!=3 && nbCompo!=2)
+ continue;
+ double *arrPtr(arr2->GetPointer(0));
+ std::transform(arrPtr,arrPtr+nbCompo*nbTuples,arrPtr,std::bind2nd(std::multiplies<double>(),cos(AnimationTime*2*M_PI)));
+ }
+ //
+ vtkDataArray* array = output->GetPointData()->GetArray(idx2);
+ vtkSmartPointer<vtkDataArray> result = vtkSmartPointer<vtkDataArray>::Take(vtkDataArray::CreateDataArray(array->GetDataType()));
+ result->ShallowCopy(array);
+ result->SetName("Result");
+ output->GetPointData()->SetScalars(result);
}
catch(MZCException& e)
{
#ifndef vtkSimpleMode_h__
#define vtkSimpleMode_h__
-#include "vtkPolyDataAlgorithm.h"
+#include "vtkDataSetAlgorithm.h"
class vtkMutableDirectedGraph;
-class VTK_EXPORT vtkSimpleMode : public vtkPolyDataAlgorithm
+class VTK_EXPORT vtkSimpleMode : public vtkDataSetAlgorithm
{
public:
static vtkSimpleMode* New();
- vtkTypeMacro(vtkSimpleMode, vtkPolyDataAlgorithm)
+ vtkTypeMacro(vtkSimpleMode, vtkDataSetAlgorithm)
void PrintSelf(ostream& os, vtkIndent indent);
void SetInputArrayToProcess(int idx, int port, int connection, int fieldAssociation, const char *name);
vtkGetMacro(Factor,double);
protected:
vtkSimpleMode();
~vtkSimpleMode();
-
+ int FillOutputPortInformation( int vtkNotUsed(port), vtkInformation* info);
int RequestInformation(vtkInformation *request,
vtkInformationVector **inputVector, vtkInformationVector *outputVector);
command="SetAnimationTime"
default_values="0"
name="AnimationTime"
- panel_visibility="advanced"
number_of_elements="1">
<DoubleRangeDomain max="1" min="0" name="range" />
<Documentation>The value of this property sets the scale factor applied for all nodes displacement.</Documentation>
${pl_HEADERS_MOC}
${pl_FORMS_HEADERS}
${rcs_sources})
-
-TARGET_LINK_LIBRARIES(paraLight ${QT_LIBRARIES} pqApplicationComponents vtkRenderingFreeType vtkInteractionStyle)
+
+# RNV: ${vtkgl2ps_LIBRARIES} was added for Fedora 26 OS
+TARGET_LINK_LIBRARIES(paraLight ${QT_LIBRARIES} pqApplicationComponents vtkRenderingFreeType vtkInteractionStyle ${vtkgl2ps_LIBRARIES})
#INSTALL(TARGET paraLight bin)
)
ADD_EXECUTABLE(paraCmdLine ${pl_SOURCES})
-TARGET_LINK_LIBRARIES(paraCmdLine ${PYTHON_LIBRARIES} ${QT_LIBRARIES} pqApplicationComponents vtkRenderingFreeType vtkInteractionStyle)
+# RNV: ${vtkgl2ps_LIBRARIES} was added for Fedora 26 OS
+TARGET_LINK_LIBRARIES(paraCmdLine ${PYTHON_LIBRARIES} ${QT_LIBRARIES} pqApplicationComponents vtkRenderingFreeType vtkInteractionStyle ${vtkgl2ps_LIBRARIES})