SUBDIRS = adm_local idl resources src doc bin
-DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool
salomeinclude_DATA = VISU_version.h
$(pwd)/hack_libtool \1 \"\$[@]\" \n\
}\n\
CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
],[])
# This list is initiated using autoscan and must be updated manually
VISU_ElnoAssembleFilter.hxx \
VISU_DeformationPL.hxx \
VISU_OptionalDeformationPL.hxx \
- VISU_XYPlotActor.hxx
+ VISU_XYPlotActor.hxx \
+ VISU_CellDataToPointData.hxx
dist_libVisuPipeLine_la_SOURCES= \
VISU_MapperHolder.cxx \
VISU_ElnoAssembleFilter.cxx \
VISU_DeformationPL.cxx \
VISU_OptionalDeformationPL.cxx\
- VISU_XYPlotActor.cxx
+ VISU_XYPlotActor.cxx \
+ VISU_CellDataToPointData.cxx
libVisuPipeLine_la_CPPFLAGS= \
$(VTK_INCLUDES) \
--- /dev/null
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile$
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+ Note from SALOME:
+ This file is a part of VTK library
+ It has been renamed and modified for SALOME project
+
+=========================================================================*/
+
+#include "VISU_CellDataToPointData.hxx"
+
+#include <vtkCellData.h>
+#include <vtkDataSet.h>
+#include <vtkIdList.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+
+vtkCxxRevisionMacro(VISU_CellDataToPointData, "$Revision$");
+vtkStandardNewMacro(VISU_CellDataToPointData);
+
+//----------------------------------------------------------------------------
+// Instantiate object so that cell data is not passed to output.
+VISU_CellDataToPointData::VISU_CellDataToPointData()
+{
+ this->PassCellData = 0;
+}
+
+#define VTK_MAX_CELLS_PER_POINT 4096
+
+//----------------------------------------------------------------------------
+int VISU_CellDataToPointData::RequestData(
+ vtkInformation*,
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector)
+{
+ vtkInformation* info = outputVector->GetInformationObject(0);
+ vtkDataSet *output = vtkDataSet::SafeDownCast(
+ info->Get(vtkDataObject::DATA_OBJECT()));
+
+ vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
+ vtkDataSet *input = vtkDataSet::SafeDownCast(
+ inInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+ vtkIdType cellId, ptId;
+ vtkIdType numCells, numPts;
+ vtkCellData *inPD=input->GetCellData();
+ vtkPointData *outPD=output->GetPointData();
+ vtkIdList *cellIds;
+ double weight;
+ double *weights;
+
+ vtkDebugMacro(<<"Mapping cell data to point data");
+
+ // First, copy the input to the output as a starting point
+ output->CopyStructure( input );
+
+ cellIds = vtkIdList::New();
+ cellIds->Allocate(VTK_MAX_CELLS_PER_POINT);
+
+ if ( (numPts=input->GetNumberOfPoints()) < 1 )
+ {
+ vtkDebugMacro(<<"No input point data!");
+ cellIds->Delete();
+ return 1;
+ }
+ weights = new double[VTK_MAX_CELLS_PER_POINT];
+
+ // Pass the point data first. The fields and attributes
+ // which also exist in the cell data of the input will
+ // be over-written during CopyAllocate
+ output->GetPointData()->CopyGlobalIdsOff();
+ output->GetPointData()->PassData(input->GetPointData());
+ output->GetPointData()->CopyFieldOff("vtkGhostLevels");
+
+ // notice that inPD and outPD are vtkCellData and vtkPointData; respectively.
+ // It's weird, but it works.
+ outPD->InterpolateAllocate(inPD,numPts);
+
+ int abort=0;
+ vtkIdType progressInterval=numPts/20 + 1;
+ for (ptId=0; ptId < numPts && !abort; ptId++)
+ {
+ if ( !(ptId % progressInterval) )
+ {
+ this->UpdateProgress(static_cast<double>(ptId)/numPts);
+ abort = GetAbortExecute();
+ }
+
+ input->GetPointCells(ptId, cellIds);
+ numCells = cellIds->GetNumberOfIds();
+ if ( numCells > 0 )
+ {
+ weight = 1.0 / numCells;
+ for (cellId=0; cellId < numCells; cellId++)
+ {
+ weights[cellId] = weight;
+ }
+ outPD->InterpolatePoint(inPD, ptId, cellIds, weights);
+ }
+ else
+ {
+ outPD->NullPoint(ptId);
+ }
+ }
+
+ if ( !this->PassCellData )
+ {
+ output->GetCellData()->CopyAllOff();
+ output->GetCellData()->CopyFieldOn("vtkGhostLevels");
+ }
+ output->GetCellData()->PassData(input->GetCellData());
+
+ cellIds->Delete();
+ delete [] weights;
+
+ return 1;
+}
+
+//----------------------------------------------------------------------------
+void VISU_CellDataToPointData::PrintSelf(ostream& os, vtkIndent indent)
+{
+ this->Superclass::PrintSelf(os,indent);
+
+ os << indent << "Pass Cell Data: " << (this->PassCellData ? "On\n" : "Off\n");
+}
--- /dev/null
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: $RCSfile$
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+// .NAME VISU_CellDataToPointData - map cell data to point data
+// .SECTION Description
+// VISU_CellDataToPointData is a filter that transforms cell data (i.e., data
+// specified per cell) into point data (i.e., data specified at cell
+// points). The method of transformation is based on averaging the data
+// values of all cells using a particular point. Optionally, the input cell
+// data can be passed through to the output as well.
+
+// .SECTION Caveats
+// This filter is an abstract filter, that is, the output is an abstract type
+// (i.e., vtkDataSet). Use the convenience methods (e.g.,
+// GetPolyDataOutput(), GetStructuredPointsOutput(), etc.) to get the type
+// of output you want.
+
+// .SECTION See Also
+// vtkPointData vtkCellData vtkPointDataToCellData
+
+// note from SALOME:
+// This file is a part of VTK library
+// It has been renamed and modified for SALOME project
+
+#ifndef __VISU_CellDataToPointData_h
+#define __VISU_CellDataToPointData_h
+
+#include <vtkDataSetAlgorithm.h>
+
+class vtkDataSet;
+
+class VTK_GRAPHICS_EXPORT VISU_CellDataToPointData : public vtkDataSetAlgorithm
+{
+public:
+ static VISU_CellDataToPointData *New();
+ vtkTypeRevisionMacro(VISU_CellDataToPointData,vtkDataSetAlgorithm);
+ void PrintSelf(ostream& os, vtkIndent indent);
+
+ // Description:
+ // Control whether the input cell data is to be passed to the output. If
+ // on, then the input cell data is passed through to the output; otherwise,
+ // only generated point data is placed into the output.
+ vtkSetMacro(PassCellData,int);
+ vtkGetMacro(PassCellData,int);
+ vtkBooleanMacro(PassCellData,int);
+
+protected:
+ VISU_CellDataToPointData();
+ ~VISU_CellDataToPointData() {};
+
+ virtual int RequestData(vtkInformation* request,
+ vtkInformationVector** inputVector,
+ vtkInformationVector* outputVector);
+
+ int PassCellData;
+private:
+ VISU_CellDataToPointData(const VISU_CellDataToPointData&); // Not implemented.
+ void operator=(const VISU_CellDataToPointData&); // Not implemented.
+};
+
+#endif
+
+
#include <vtkDataSet.h>
#include <vtkPassThroughFilter.h>
#include <vtkWarpVector.h>
-#include <vtkCellDataToPointData.h>
#include <vtkUnstructuredGrid.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
myVectorMergeFilter->SetMergingInputs(true);
myInputPassFilter = vtkPassThroughFilter::New();
myOutputPassFiler = vtkPassThroughFilter::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
myCellDataToPointData->PassCellDataOn();
myInputPassFilter->SetInput(vtkUnstructuredGrid::New());
class VISU_MergeFilter;
class vtkPassThroughFilter;
class vtkWarpVector;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
class VISU_PIPELINE_EXPORT VISU_DeformationPL {
vtkSmartPointer<VISU_MergeFilter> myVectorMergeFilter;
vtkPassThroughFilter *myInputPassFilter;
vtkPassThroughFilter *myOutputPassFiler;
- vtkCellDataToPointData *myCellDataToPointData;
+ VISU_CellDataToPointData *myCellDataToPointData;
private:
vtkFloatingPointType myScaleFactor;
#include <vtkImplicitBoolean.h>
#include <vtkImplicitFunction.h>
#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
#include <vtkPointDataToCellData.h>
#include <vtkImplicitFunctionCollection.h>
myScalarsFieldTransform = VISU_FieldTransform::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::New();
vtkImplicitBoolean* anImplicitBoolean = vtkImplicitBoolean::New();
class VISU_MergeFilter;
class vtkWarpVector;
class vtkUnstructuredGrid;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
class vtkPointDataToCellData;
class VISU_ElnoDisassembleFilter;
class SALOME_ExtractGeometry;
vtkWarpVector *myWarpVector;
VISU_MergeFilter *myScalarsMergeFilter;
vtkSmartPointer<vtkUnstructuredGrid> myScalars;
- vtkCellDataToPointData* myCellDataToPointData;
+ VISU_CellDataToPointData* myCellDataToPointData;
VISU_FieldTransform* myScalarsFieldTransform;
VISU_Extractor* myScalarsExtractor;
VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter;
SetIsFeatureEdgesAllowed(true);
myWarpVector = vtkWarpVector::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
}
#include "VISUPipeline.hxx"
#include "VISU_ScalarMapPL.hxx"
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
class SALOME_Transform;
class vtkWarpVector;
vtkFloatingPointType myScaleFactor;
vtkFloatingPointType myMapScaleFactor;
vtkWarpVector *myWarpVector;
- vtkCellDataToPointData* myCellDataToPointData;
+ VISU_CellDataToPointData* myCellDataToPointData;
private:
VISU_DeformedShapePL(const VISU_DeformedShapePL&); // Not implemented.
myContourFilter = vtkContourFilter::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
+ myCellDataToPointData = VISU_CellDataToPointData::New();
}
#include "VISU_ScalarMapPL.hxx"
class vtkContourFilter;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
//----------------------------------------------------------------------------
int myNbParts;
vtkFloatingPointType myRange[2];
bool myIsRangeFixed;
- vtkCellDataToPointData* myCellDataToPointData;
+ VISU_CellDataToPointData* myCellDataToPointData;
vtkContourFilter *myContourFilter;
private:
#include <vtkDataSet.h>
#include <vtkPassThroughFilter.h>
#include <vtkWarpVector.h>
-#include <vtkCellDataToPointData.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
#include "VISUPipeline.hxx"
#include "VISU_ConvertorUtils.hxx"
+#include "VISU_CellDataToPointData.hxx"
#include <vtkProperty.h>
#include <vtkObjectFactory.h>
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
#include <vtkPointData.h>
#include <vtkCellData.h>
#include <vtkPolyData.h>
template<class TOutputFilter>
void
CellDataToPoint(TOutputFilter* theOutputFilter,
- vtkCellDataToPointData *theCellDataToPointData,
+ VISU_CellDataToPointData *theCellDataToPointData,
vtkDataSet* theDataSet)
{
#include <vtkCutter.h>
#include <vtkPlane.h>
-#include <vtkCellDataToPointData.h>
#include <vtkGeometryFilter.h>
#include <vtkContourFilter.h>
#include <vtkWarpScalar.h>
//----------------------------------------------------------------------------
VISU_Plot3DPL
::VISU_Plot3DPL():
- myCellDataToPointData(vtkCellDataToPointData::New()),
+ myCellDataToPointData(VISU_CellDataToPointData::New()),
myAppendPolyData(vtkAppendPolyData::New()),
myGeometryFilter(vtkGeometryFilter::New()),
myContourFilter(vtkContourFilter::New()),
class vtkWarpScalar;
class vtkContourFilter;
class vtkGeometryFilter;
-class vtkCellDataToPointData;
+class VISU_CellDataToPointData;
//----------------------------------------------------------------------------
vtkFloatingPointType myPosition, myScaleFactor, myMapScaleFactor;
VISU_CutPlanesPL::PlaneOrientation myOrientation;
- vtkSmartPointer<vtkCellDataToPointData> myCellDataToPointData;
+ vtkSmartPointer<VISU_CellDataToPointData> myCellDataToPointData;
vtkSmartPointer<vtkAppendPolyData> myAppendPolyData;
vtkSmartPointer<vtkGeometryFilter> myGeometryFilter;
vtkSmartPointer<vtkContourFilter> myContourFilter;
if(aDeformedAndScalPrs){
aTimeStampNum = aDeformedAndScalPrs->GetScalarTimeStampNumber();
}
+
aColoredPrs3d->SameAs(aInitialPrs3d);
+
+ // rnv: fix for the 20870: EDF 1410 VISU: Anomaly in the Gauss point representation.
+ // special case for the "Gauss Points" presentation,
+ // update the LookupTable in the mapper, after assign properties of the presentation
+ // using SameAs(...) method.
+ if(aFieldData.myPrsType == VISU::TGAUSSPOINTS) {
+ aColoredPrs3d->UpdateMapperLookupTable();
+ }
if(aDeformedAndScalPrs){
aDeformedAndScalPrs->SetScalarField(aDeformedAndScalPrs->GetScalarEntity(),
if(!aNbPoints) continue;
vtkPointData *aPointData = aDataSet->GetPointData();
vtkDataArray *aScalars = aPointData->GetScalars();
- vtkCellDataToPointData *aFilter = NULL;
+ VISU_CellDataToPointData *aFilter = NULL;
if(!aScalars) {
- aFilter = vtkCellDataToPointData::New();
+ aFilter = VISU_CellDataToPointData::New();
aFilter->SetInput(aDataSet);
aFilter->PassCellDataOn();
aDataSet = aFilter->GetOutput();