//---------------------------------------------------------------
typedef std::map<vtkIdType,PValForTime> TValField;
- typedef std::pair<float,float> TMinMax;
+ typedef std::pair<vtkFloatingPointType,vtkFloatingPointType> TMinMax;
//! Define a basic class for MED FIELD entity
struct TField: virtual TIntId
//! Get amount of memory to build VTK representations for all existing MED entities
virtual
- float
+ vtkFloatingPointType
GetSize() = 0;
//! Get mesh for corresponding MED ENTITY
//! Get amount of memory to build mesh for corresponding MED ENTITY
virtual
- float
+ vtkFloatingPointType
GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity) = 0;
//! Get amount of memory to build mesh for corresponding MED FAMILY
virtual
- float
+ vtkFloatingPointType
GetFamilyOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFamilyName) = 0;
//! Get amount of memory to build mesh for corresponding MED GROUP
virtual
- float
+ vtkFloatingPointType
GetMeshOnGroupSize(const std::string& theMeshName,
const std::string& theGroupName) = 0;
//! Get amount of memory to build mesh for corresponding MED TIMESTAMP
virtual
- float
+ vtkFloatingPointType
GetTimeStampSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
//! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD
virtual
- float
+ vtkFloatingPointType
GetFieldOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName) = 0;
#include "VISU_ConvertorUtils.hxx"
#include "VTKViewer_AppendFilter.h"
#include "VISU_MergeFilter.hxx"
+#include "VTKViewer_CellLocationsArray.h"
#include <vtkPoints.h>
#include <vtkUnstructuredGrid.h>
#include <vtkIdList.h>
#include <vtkCellType.h>
-#include <vtkIntArray.h>
#include <vtkCellArray.h>
#include <vtkFloatArray.h>
#include <vtkUnsignedCharArray.h>
using namespace std;
using namespace VISU;
-static float ERR_SIZE_CALC = 1.00;
+static vtkFloatingPointType ERR_SIZE_CALC = 1.00;
static int MYVTKDEBUG = 0;
return myNamedPointCoords->GetVTKID(theID);
}
- float*
+ vtkFloatingPointType*
TProfileImpl
::GetNodeCoord(vtkIdType theObjID)
{
return myIDMapper.GetNodeVTKID(theID);
}
- float*
+ vtkFloatingPointType*
TIDMapperFilter
::GetNodeCoord(vtkIdType theObjID)
{
}
vtkIdType *pts = 0, npts = 0;
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbCells);
aConnectivity->InitTraversal();
}
}
vtkIdType *pts = 0, npts = 0;
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbCells);
aConnectivity->InitTraversal();
}
vtkIdType *pts = 0, npts = 0;
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbCells);
endl);
int aSize = max(3,aNbComp);
- TVector<float> aDataValues(aSize,0.0);
+ TVector<vtkFloatingPointType> aDataValues(aSize,0.0);
const TGeom2Value& aGeom2Value = theValForTime->myGeom2Value;
for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){
TCCoordSlice aSlice = aCoords.GetCoordSlice(aPointId);
- float aCoords[3] = {0.0, 0.0, 0.0};
+ vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0};
for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++)
aCoords[aDimId] = aSlice[aDimId];
}
anIdList->Delete();
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbCells);
PrintMemorySize(vtkUnstructuredGrid* theDataSet)
{
theDataSet->Update();
- BEGMSG(1,"GetPoints() = "<<float(theDataSet->GetPoints()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(1,"GetCells() = "<<float(theDataSet->GetCells()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(1,"GetCellTypesArray() = "<<float(theDataSet->GetCellTypesArray()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(1,"GetCellLocationsArray() = "<<float(theDataSet->GetCellLocationsArray()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetPoints() = "<<vtkFloatingPointType(theDataSet->GetPoints()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetCells() = "<<vtkFloatingPointType(theDataSet->GetCells()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetCellTypesArray() = "<<vtkFloatingPointType(theDataSet->GetCellTypesArray()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetCellLocationsArray() = "<<vtkFloatingPointType(theDataSet->GetCellLocationsArray()->GetActualMemorySize()*1000)<<endl);
theDataSet->BuildLinks();
- BEGMSG(1,"GetCellLinks() = "<<float(theDataSet->GetCellLinks()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(1,"GetPointData() = "<<float(theDataSet->GetPointData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(1,"GetCellData() = "<<float(theDataSet->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(1,"GetActualMemorySize() = "<<float(theDataSet->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetCellLinks() = "<<vtkFloatingPointType(theDataSet->GetCellLinks()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetPointData() = "<<vtkFloatingPointType(theDataSet->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetCellData() = "<<vtkFloatingPointType(theDataSet->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(1,"GetActualMemorySize() = "<<vtkFloatingPointType(theDataSet->GetActualMemorySize()*1000)<<endl);
}
}
GetTimeStampSize(theMeshName,theEntity,theFieldName,theStampsNum);
anOutput->Update();
if(theEntity == VISU::NODE_ENTITY)
- BEGMSG(MYVTKDEBUG,"GetPointData() = "<<float(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
else
- BEGMSG(MYVTKDEBUG,"GetCellData() = "<<float(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<float(anOutput->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
}
}
#ifndef _DEXCEPT_
GetTimeStampSize(theMeshName,theEntity,theFieldName,theStampsNum);
anOutput->Update();
if(theEntity == VISU::NODE_ENTITY)
- BEGMSG(MYVTKDEBUG,"GetPointData() = "<<float(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetPointData() = "<<vtkFloatingPointType(anOutput->GetPointData()->GetActualMemorySize()*1000)<<endl);
else
- BEGMSG(MYVTKDEBUG,"GetCellData() = "<<float(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
- BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<float(anOutput->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetCellData() = "<<vtkFloatingPointType(anOutput->GetCellData()->GetActualMemorySize()*1000)<<endl);
+ BEGMSG(MYVTKDEBUG,"GetActualMemorySize() = "<<vtkFloatingPointType(anOutput->GetActualMemorySize()*1000)<<endl);
}
}
#ifndef _DEXCEPT_
//---------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_Convertor_impl
::GetSize()
{
- float aResult = 0.0;
+ vtkFloatingPointType aResult = 0.0;
const VISU::TMeshMap& aMeshMap = GetMeshMap();
VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
aResult += GetMeshOnEntitySize(aMeshName,anEntity);
}
}
- MSG(MYDEBUG,"GetSize - aResult = "<<float(aResult));
+ MSG(MYDEBUG,"GetSize - aResult = "<<vtkFloatingPointType(aResult));
return aResult;
}
//---------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_Convertor_impl
::GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity)
vtkIdType aConnectivitySize = aCellsSize*sizeof(vtkIdType);
vtkIdType aTypesSize = aNbCells*sizeof(char);
vtkIdType aLocationsSize = aNbCells*sizeof(int);
- float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+ vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
vtkIdType aLinksSize = aMesh->myNbPoints *
(vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link));
aLinksSize = 0;
vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
MSG(MYDEBUG,"GetMeshOnEntitySize "<<
- "- aResult = "<<float(aResult)<<
+ "- aResult = "<<vtkFloatingPointType(aResult)<<
"; theMeshName = '"<<theMeshName<<"'"<<
"; theEntity = "<<theEntity);
if(MYDEBUG){
- INITMSG(MYVTKDEBUG,"- aPointsSize = "<<float(aPointsSize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<float(aConnectivitySize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<float(aTypesSize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<float(aLocationsSize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<float(aLinksSize)<<"\n");
+ INITMSG(MYVTKDEBUG,"- aPointsSize = "<<vtkFloatingPointType(aPointsSize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<vtkFloatingPointType(aConnectivitySize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<vtkFloatingPointType(aTypesSize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<vtkFloatingPointType(aLocationsSize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<vtkFloatingPointType(aLinksSize)<<"\n");
}
aResult = vtkIdType(aResult*ERR_SIZE_CALC);
//---------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_Convertor_impl
::GetFamilyOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
vtkIdType aConnectivitySize = aCellsSize*sizeof(vtkIdType);
vtkIdType aTypesSize = aNbCells*sizeof(char);
vtkIdType aLocationsSize = aNbCells*sizeof(int);
- float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+ vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
vtkIdType aLinksSize = aMesh->myNbPoints *
(vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link));
aLinksSize = 0;
vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize;
MSG(MYDEBUG,"GetFamilyOnEntitySize "<<
- "- aResult = "<<float(aResult)<<
+ "- aResult = "<<vtkFloatingPointType(aResult)<<
"; theMeshName = '"<<theMeshName<<"'"<<
"; theEntity = "<<theEntity<<
"; theFamilyName = '"<<theFamilyName<<"'");
if(MYDEBUG){
- INITMSG(MYVTKDEBUG,"- aPointsSize = "<<float(aPointsSize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<float(aConnectivitySize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<float(aTypesSize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<float(aLocationsSize)<<"\n");
- BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<float(aLinksSize)<<"\n");
+ INITMSG(MYVTKDEBUG,"- aPointsSize = "<<vtkFloatingPointType(aPointsSize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aConnectivitySize = "<<vtkFloatingPointType(aConnectivitySize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aTypesSize = "<<vtkFloatingPointType(aTypesSize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aLocationsSize = "<<vtkFloatingPointType(aLocationsSize)<<"\n");
+ BEGMSG(MYVTKDEBUG,"- aLinksSize = "<<vtkFloatingPointType(aLinksSize)<<"\n");
}
aResult = vtkIdType(aResult*ERR_SIZE_CALC);
}
-float
+vtkFloatingPointType
VISU_Convertor_impl
::GetMeshOnGroupSize(const std::string& theMeshName,
const std::string& theGroupName)
vtkIdType aCellsSize = aNbASizeCells.second;
vtkIdType aConnectivityAndTypesSize = aCellsSize*sizeof(vtkIdType);
vtkIdType aLocationsSize = aNbCells*sizeof(int);
- float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+ vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
vtkIdType aLinksSize = aMesh->myNbPoints *
(vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short));
aLinksSize = 0;
vtkIdType aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize;
if(MYDEBUG){
- MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<<float(aPointsSize));
- MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aConnectivityAndTypesSize = "<<float(aConnectivityAndTypesSize));
- MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLocationsSize = "<<float(aLocationsSize));
- MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLinksSize = "<<float(aLinksSize));
+ MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<<vtkFloatingPointType(aPointsSize));
+ MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aConnectivityAndTypesSize = "<<vtkFloatingPointType(aConnectivityAndTypesSize));
+ MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLocationsSize = "<<vtkFloatingPointType(aLocationsSize));
+ MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aLinksSize = "<<vtkFloatingPointType(aLinksSize));
}
- MSG(MYDEBUG,"GetMeshOnGroupSize - aResult = "<<float(aResult)<<"; theMeshName = '"
+ MSG(MYDEBUG,"GetMeshOnGroupSize - aResult = "<<vtkFloatingPointType(aResult)<<"; theMeshName = '"
<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
aResult = vtkIdType(aResult*ERR_SIZE_CALC);
}
-float
+vtkFloatingPointType
VISU_Convertor_impl
::GetFieldOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindField);
PFieldImpl aField = boost::get<3>(aFindField);
- float aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
- float aFieldOnMeshSize = float(aField->myDataSize*sizeof(float)*aField->myValField.size()*ERR_SIZE_CALC);
- float aResult = aMeshSize + aFieldOnMeshSize;
+ vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
+ vtkFloatingPointType aFieldOnMeshSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType)*aField->myValField.size()*ERR_SIZE_CALC);
+ vtkFloatingPointType aResult = aMeshSize + aFieldOnMeshSize;
if(MYDEBUG)
- MSG(MYVTKDEBUG,"GetFieldOnMeshSize - aFieldOnMeshSize = "<<float(aFieldOnMeshSize));
- MSG(MYDEBUG,"GetFieldOnMeshSize - aResult = "<<float(aResult)<<"; theMeshName = '"<<theMeshName<<
+ MSG(MYVTKDEBUG,"GetFieldOnMeshSize - aFieldOnMeshSize = "<<vtkFloatingPointType(aFieldOnMeshSize));
+ MSG(MYDEBUG,"GetFieldOnMeshSize - aResult = "<<vtkFloatingPointType(aResult)<<"; theMeshName = '"<<theMeshName<<
"'; theEntity = "<<theEntity<<"; theFieldName = '"<<theFieldName<<"'");
return aResult;
}
-float
+vtkFloatingPointType
VISU_Convertor_impl
::GetTimeStampSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
PMeshOnEntityImpl aVTKMeshOnEntity = boost::get<2>(aFindTimeStamp);
PFieldImpl aField = boost::get<3>(aFindTimeStamp);
- float aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
- float aTimeStampSize = float(aField->myDataSize*sizeof(float) * ERR_SIZE_CALC);
- float aResult = aMeshSize + aTimeStampSize;
+ vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity);
+ vtkFloatingPointType aTimeStampSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC);
+ vtkFloatingPointType aResult = aMeshSize + aTimeStampSize;
- MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "<<float(aTimeStampSize));
- MSG(MYDEBUG,"GetTimeStampSize - aResult = "<<float(aResult)<<
+ MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "<<vtkFloatingPointType(aTimeStampSize));
+ MSG(MYDEBUG,"GetTimeStampSize - aResult = "<<vtkFloatingPointType(aResult)<<
"; theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<
"; theFieldName = '"<<theFieldName<<"'; theStampsNum = "<<theStampsNum);
typedef vtkSmartPointer<VTKViewer_AppendFilter> TVTKAppendFilter;
- typedef float TCoord;
+ typedef vtkFloatingPointType TCoord;
//---------------------------------------------------------------
//! Define an utility base class which is repsonsible for preventing repetion
//! Reimplement the TIDMapper::GetNodeCoord
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
//! Reimplement the TIDMapper::GetElemObjID
//! Reimplement the TIDMapper::GetNodeCoord
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
//! Reimplement the TIDMapper::GetElemObjID
//---------------------------------------------------------------
- typedef TVector<float> TValue;
+ typedef TVector<vtkFloatingPointType> TValue;
typedef TSlice<TValue> TValueSlice;
typedef TCSlice<TValue> TCValueSlice;
//! Implemention of the VISU_Convertor::GetSize
virtual
- float
+ vtkFloatingPointType
GetSize();
//! Implemention of the VISU_Convertor::GetMeshOnEntity
//! Implemention of the VISU_Convertor::GetMeshOnEntitySize
virtual
- float
+ vtkFloatingPointType
GetMeshOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity);
//! Implemention of the VISU_Convertor::GetFamilyOnEntitySize
virtual
- float
+ vtkFloatingPointType
GetFamilyOnEntitySize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFamilyName);
//! Implemention of the VISU_Convertor::GetMeshOnGroupSize
virtual
- float
+ vtkFloatingPointType
GetMeshOnGroupSize(const std::string& theMeshName,
const std::string& theGroupName);
//! Implemention of the VISU_Convertor::GetTimeStampSize
virtual
- float
+ vtkFloatingPointType
GetTimeStampSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName,
//! Implemention of the VISU_Convertor::GetFieldOnMeshSize
virtual
- float
+ vtkFloatingPointType
GetFieldOnMeshSize(const std::string& theMeshName,
const VISU::TEntity& theEntity,
const std::string& theFieldName);
namespace VISU
{
//---------------------------------------------------------------
- float*
+ vtkFloatingPointType*
TIDMapper
::GetNodeCoord(vtkIdType theObjID)
{
//! Get coordinates of node for corresponding object ID
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
//! Get cell object ID for corresponding VTK ID
for(TInt iComp = 0; iComp < aNbComp; iComp++){
const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
TMinMax& aMinMax = aMinMaxArr[iComp+1];
- float& aMin = aMinMax.first;
- float& aMax = aMinMax.second;
+ vtkFloatingPointType& aMin = aMinMax.first;
+ vtkFloatingPointType& aMax = aMinMax.second;
for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
- const float& aVal = aMValueSlice[iGauss];
+ const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
aMin = min(aMin,aVal);
aMax = max(aMax,aVal);
}
// To calculate min/max per vector modulus
TMinMax& aMinMax = aMinMaxArr[0];
- float& aMin = aMinMax.first;
- float& aMax = aMinMax.second;
+ vtkFloatingPointType& aMin = aMinMax.first;
+ vtkFloatingPointType& aMax = aMinMax.second;
for(TInt iElem = 0; iElem < aNbElem; iElem++){
MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
- float aValue = 0.0;
+ vtkFloatingPointType aValue = 0.0;
for(TInt iComp = 0; iComp < aNbComp2; iComp++){
- float aVal = aMValueSlice[iComp];
+ vtkFloatingPointType aVal = aMValueSlice[iComp];
aValue += aVal*aVal;
}
aValue = sqrt(aValue);
void
VISU_Actor
-::SetShrinkFactor(float theValue)
+::SetShrinkFactor(vtkFloatingPointType theValue)
{
myShrinkFilter->SetShrinkFactor(theValue);
Modified();
}
-float
+vtkFloatingPointType
VISU_Actor
::GetShrinkFactor()
{
//----------------------------------------------------------------------------
void
VISU_Actor
-::SetOpacity(float theValue)
+::SetOpacity(vtkFloatingPointType theValue)
{
GetProperty()->SetOpacity(theValue);
}
-float
+vtkFloatingPointType
VISU_Actor
::GetOpacity()
{
void
VISU_Actor
-::SetLineWidth(float theLineWidth)
+::SetLineWidth(vtkFloatingPointType theLineWidth)
{
GetProperty()->SetLineWidth(theLineWidth);
}
-float
+vtkFloatingPointType
VISU_Actor
::GetLineWidth()
{
return GetCurrentPL()->GetNodeVTKID(theID);
}
-float*
+vtkFloatingPointType*
VISU_Actor
::GetNodeCoord(int theObjID)
{
if(vtkCell* aCell = GetElemCell(anObjId)){
vtkPoints* aPts = aCell->GetPoints();
if(int aNbPts = aCell->GetNumberOfPoints()){
- float aCoord[3] = {0.0, 0.0, 0.0};
+ vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
for(int i = 0; i < aNbPts; i++){
- float *aPntCoord = aPts->GetPoint(i);
+ vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
aCoord[0] += aPntCoord[0];
aCoord[1] += aPntCoord[1];
aCoord[2] += aPntCoord[2];
}
// Display coordinates
- float aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
aRenderer->SetWorldPoint(aWorldCoord);
aRenderer->WorldToDisplay();
- float aSelectionPoint[3];
+ vtkFloatingPointType aSelectionPoint[3];
aRenderer->GetDisplayPoint(aSelectionPoint);
myAnnotationActor->SetPosition(aSelectionPoint);
//
vtkIdType aVtkId = myPointPicker->GetPointId();
if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){
vtkIdType anObjId = GetNodeObjId( aVtkId );
- if(float* aCoord = GetNodeCoord(anObjId)){
+ if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
// Display coordinates
- float aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
aRenderer->SetWorldPoint(aWorldCoord);
aRenderer->WorldToDisplay();
- float aSelectionPoint[3];
+ vtkFloatingPointType aSelectionPoint[3];
aRenderer->GetDisplayPoint(aSelectionPoint);
myAnnotationActor->SetPosition(aSelectionPoint);
//
virtual
void
- SetShrinkFactor(float theFactor = 0.8);
+ SetShrinkFactor(vtkFloatingPointType theFactor = 0.8);
virtual
- float
+ vtkFloatingPointType
GetShrinkFactor();
//----------------------------------------------------------------------------
virtual
void
- SetOpacity(float theValue);
+ SetOpacity(vtkFloatingPointType theValue);
virtual
- float
+ vtkFloatingPointType
GetOpacity();
virtual
void
- SetLineWidth(float theLineWidth);
+ SetLineWidth(vtkFloatingPointType theLineWidth);
virtual
- float
+ vtkFloatingPointType
GetLineWidth();
//----------------------------------------------------------------------------
GetNodeVTKID(vtkIdType theID);
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
virtual
return Superclass::GetMapper();
}
-float*
+vtkFloatingPointType*
VISU_GaussPtsAct
::GetBounds()
{
{
myEventCallbackCommand->SetAbortFlag(1);
- float aMagnification = myInsideCursorSettings->GetMagnification();
- float anIncrement = myInsideCursorSettings->GetIncrement();
- float coefficient = up ? anIncrement : 1 / anIncrement;
+ vtkFloatingPointType aMagnification = myInsideCursorSettings->GetMagnification();
+ vtkFloatingPointType anIncrement = myInsideCursorSettings->GetIncrement();
+ vtkFloatingPointType coefficient = up ? anIncrement : 1 / anIncrement;
myInsideCursorSettings->SetMagnification( aMagnification * coefficient );
myInsideCursorSettings->InvokeEvent(VISU::UpdateFromSettingsEvent,NULL);
namespace
{
inline
- float
+ vtkFloatingPointType
GetRadius(vtkIdType theVTKID,
vtkDataArray *theScalarArray,
VISU_GaussPointsPL* theGaussPointsPL)
{
- float aRadius = 0.5;
+ vtkFloatingPointType aRadius = 0.5;
if(theGaussPointsPL->GetPSMapper()->GetPointSpriteMode() == 1) // Geometry mode
aRadius *= theGaussPointsPL->GetSize() * theGaussPointsPL->GetAverageCellSize();
else if(theGaussPointsPL->GetBicolor()){
- float aVal = theScalarArray->GetTuple1(theVTKID);
+ vtkFloatingPointType aVal = theScalarArray->GetTuple1(theVTKID);
if(aVal > 0.0)
aRadius *= theGaussPointsPL->GetMaxSize();
else
}
}
-float
+vtkFloatingPointType
VISU_GaussPtsAct
::GetRadius(vtkIdType theObjID,
vtkIdType theVTKID,
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPtsAct
::GetMagnification(vtkIdType theObjID)
{
namespace
{
inline
- float
+ vtkFloatingPointType
GetClamp(VISU_GaussPointsPL* theGaussPointsPL)
{
- float aClamp = theGaussPointsPL->GetClamp();
+ vtkFloatingPointType aClamp = theGaussPointsPL->GetClamp();
if(theGaussPointsPL->GetPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere)
return -aClamp;
return aClamp;
}
}
-float
+vtkFloatingPointType
VISU_GaussPtsAct
::GetClamp(vtkIdType theObjID)
{
if(myIsPreselected){
anIsChanged = (myLastObjPointID != anObjId);
if(anIsChanged){
- float* aNodeCoord = GetNodeCoord(anObjId);
+ vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
vtkDataSet* aDataSet = GetInput();
vtkCellData* aCellData = aDataSet->GetCellData();
if(vtkDataArray *aScalarArray = aCellData->GetScalars()){
- float aPyramidHeight = myPickingSettings->GetPyramidHeight();
+ vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
- //float aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
- float aColor[3];
+ //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
+ vtkFloatingPointType aColor[3];
theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
aColor[0] = 1. - aColor[0];
aColor[1] = 1. - aColor[1];
if(theInitialHasIndex + aCurrentHasIndex == 1){
vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer();
vtkCamera *aCamera = aRenderer->GetActiveCamera();
- float aZoomFactor = thePickingSettings->GetZoomFactor();
+ vtkFloatingPointType aZoomFactor = thePickingSettings->GetZoomFactor();
double aScale = aCamera->GetParallelScale();
if (!theInitialHasIndex && aCurrentHasIndex) {
aCamera->SetParallelScale(aScale/aZoomFactor);
mySelector->AddIObject(this);
}
//
- float* aNodeCoord = GetNodeCoord(anObjId);
+ vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
//
// FlyTo
vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor();
- float aDollyWas = anInteractor->GetDolly();
+ vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
anInteractor->SetDolly(0.);
//
vtkIdType aVtkId = GetNodeVTKID(anObjId);
if(aVtkId >= 0){
- float *aNodeCoord = GetNodeCoord(anObjId);
- float aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.};
+ vtkFloatingPointType *aNodeCoord = GetNodeCoord(anObjId);
+ vtkFloatingPointType aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.};
//
vtkDataSet* aDataSet = GetInput();
vtkCellData* aDataSetAttributes = aDataSet->GetCellData();
//
if(vtkDataArray* aScalarArray = aDataSetAttributes->GetScalars()){
- float aVal = aScalarArray->GetTuple1(aVtkId);
+ vtkFloatingPointType aVal = aScalarArray->GetTuple1(aVtkId);
//
GetScalarBarCtrl()->SetIsMarked(true);
GetScalarBarCtrl()->SetMarkValue(aVal);
GetScalarBarCtrl()->Update();
//
- float aPyramidHeight = myPickingSettings->GetPyramidHeight();
+ vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
myCursorPyramidSelected->Init(aPyramidHeight,
myPickingSettings->GetCursorSize(),
aStr<<"\nData: {";
int anId = 0;
while(anId < aNbComp){
- float aComp = aFloatArray->GetComponent(aVtkId,anId++);
+ vtkFloatingPointType aComp = aFloatArray->GetComponent(aVtkId,anId++);
aStr<<aComp;
if(anId < aNbComp)
aStr<<"; ";
myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition());
myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency());
- float aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight();
- float aCursorSize = myPickingSettings->GetCursorSize();
+ vtkFloatingPointType aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight();
+ vtkFloatingPointType aCursorSize = myPickingSettings->GetCursorSize();
myCursorPyramid->SetPreferences(aHeight,aCursorSize);
myCursorPyramidSelected->SetPreferences(aHeight,aCursorSize);
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPtsAct1
::GetRadius(vtkIdType theObjID,
vtkIdType theVTKID,
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPtsAct1
::GetMagnification(vtkIdType theObjID)
{
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPtsAct1
::GetClamp(vtkIdType theObjID)
{
SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter();
vtkImplicitFunction* anImplicitFunction = anExtractGeometry->GetImplicitFunction();
- float aMagnification = aPipeline->GetMagnification();
+ vtkFloatingPointType aMagnification = aPipeline->GetMagnification();
aPipeline->ShallowCopy(GetGaussPointsPL());
//! Redefined method of getting an actor bounds.
virtual
- float*
+ vtkFloatingPointType*
GetBounds();
//! Redefined method of getting an actor input.
//! To get current value of the radius of the Point Sprite
virtual
- float
+ vtkFloatingPointType
GetRadius(vtkIdType theObjID,
vtkIdType theVTKID,
vtkDataArray *theScalarArray);
//! To get current value of the magnification
virtual
- float
+ vtkFloatingPointType
GetMagnification(vtkIdType theObjID);
//! To get current value of the clamp
virtual
- float
+ vtkFloatingPointType
GetClamp(vtkIdType theObjID);
//----------------------------------------------------------------------------
void
OnInteractorEvent(unsigned long theEvent);
- float myPriority;
+ vtkFloatingPointType myPriority;
bool myChangeMagnification;
VISU::TGaussPtsActorFactory* myGaussPtsActorFactory;
boost::signal1<void,VISU_GaussPtsAct*> myUpdatePrs3dSignal;
//! To get current value of the radius of the Point Sprite
virtual
- float
+ vtkFloatingPointType
GetRadius(vtkIdType theObjID,
vtkIdType theVTKID,
vtkDataArray *theScalarArray);
//! To get current value of the magnification
virtual
- float
+ vtkFloatingPointType
GetMagnification(vtkIdType theObjID);
//! To get current value of the clamp
virtual
- float
+ vtkFloatingPointType
GetClamp(vtkIdType theObjID);
//----------------------------------------------------------------------------
}
this->SetScale(1.0);
- float aMRadius = myRadius*myMagnification;
+ vtkFloatingPointType aMRadius = myRadius*myMagnification;
Init(myHeight,aMRadius*myCursorSize);
if(myClamp > 0.0f){
- float aPoint1[3] = {0.0, 0.0, 0.0};
+ vtkFloatingPointType aPoint1[3] = {0.0, 0.0, 0.0};
ren->SetDisplayPoint(aPoint1);
ren->DisplayToWorld();
ren->GetWorldPoint(aPoint1);
- float aPoint2[3] = {0.0, myClamp, 0.0};
+ vtkFloatingPointType aPoint2[3] = {0.0, myClamp, 0.0};
ren->SetDisplayPoint(aPoint2);
ren->DisplayToWorld();
ren->GetWorldPoint(aPoint2);
- float aWorldClamp =
+ vtkFloatingPointType aWorldClamp =
(aPoint2[0] - aPoint1[0])*(aPoint2[0] - aPoint1[0]) +
(aPoint2[1] - aPoint1[1])*(aPoint2[1] - aPoint1[1]) +
(aPoint2[2] - aPoint1[2])*(aPoint2[2] - aPoint1[2]);
aWorldClamp = sqrt(aWorldClamp);
- float aMDiameter = 2.0 * aMRadius;
- float aCoeff = aWorldClamp / aMDiameter;
+ vtkFloatingPointType aMDiameter = 2.0 * aMRadius;
+ vtkFloatingPointType aCoeff = aWorldClamp / aMDiameter;
if(aCoeff < 1.0){
this->SetScale(aCoeff);
//----------------------------------------------------------------------------
void
VISU_CursorPyramid
-::SetPreferences(float theHeight,
- float theCursorSize)
+::SetPreferences(vtkFloatingPointType theHeight,
+ vtkFloatingPointType theCursorSize)
{
Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor());
}
//----------------------------------------------------------------------------
void
VISU_CursorPyramid
-::Init(float theHeight,
- float theCursorSize,
- float theRadius,
- float theMagnification,
- float theClamp,
- float thePos[3],
- float theColor[3])
+::Init(vtkFloatingPointType theHeight,
+ vtkFloatingPointType theCursorSize,
+ vtkFloatingPointType theRadius,
+ vtkFloatingPointType theMagnification,
+ vtkFloatingPointType theClamp,
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType theColor[3])
{
Init(theHeight,theRadius*theMagnification*theCursorSize);
SetPosition(thePos[0],thePos[1],thePos[2]);
void
VISU_CursorPyramid
-::Init(float theHeight,
- float theRadius)
+::Init(vtkFloatingPointType theHeight,
+ vtkFloatingPointType theRadius)
{
for(int i = 0; i < myNbCones; ++i){
vtkConeSource* aSource = mySources[i].GetPointer();
aSource->SetAngle(20.0);
}
- float aDisplacement = -0.5*theHeight - theRadius;
+ vtkFloatingPointType aDisplacement = -0.5*theHeight - theRadius;
// X
mySources[0]->SetDirection(1.0, 0.0, 0.0);
// function : SetTransparency
// purpose :
//==================================================================
-void VISU_FramedTextActor::SetTransparency(const float theTransparency)
+void VISU_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency)
{
if (theTransparency>=0. && theTransparency<=1.){
myTransparency=theTransparency;
// function : GetTransparency
// purpose :
//==================================================================
-float VISU_FramedTextActor::GetTransparency()const
+vtkFloatingPointType VISU_FramedTextActor::GetTransparency()const
{
return myTransparency;
}
// function : SetWorldPoint
// purpose :
//==================================================================
-void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4])
+void VISU_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4])
{
for(int i = 0; i<4; ++i) {
myWorldPoint[i] = theWorldPoint[i];
// function : GetWorldPoint
// purpose :
//==================================================================
-const float* VISU_FramedTextActor::GetWorldPoint()const
+const vtkFloatingPointType* VISU_FramedTextActor::GetWorldPoint()const
{
return myWorldPoint;
}
// function : SetDistance
// purpose :
//==================================================================
-void VISU_FramedTextActor::SetDistance(const float theDistance)
+void VISU_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance)
{
myDistance=theDistance;
}
// function : GetDistance
// purpose :
//==================================================================
-float VISU_FramedTextActor::GetDistance()const
+vtkFloatingPointType VISU_FramedTextActor::GetDistance()const
{
return myDistance;
}
theViewport->SetWorldPoint(myWorldPoint);
theViewport->WorldToDisplay();
- float aSelectionPoint[3];
+ vtkFloatingPointType aSelectionPoint[3];
theViewport->GetDisplayPoint(aSelectionPoint);
- float u = aSelectionPoint[0];
- float v = aSelectionPoint[1] - myDistance;
+ vtkFloatingPointType u = aSelectionPoint[0];
+ vtkFloatingPointType v = aSelectionPoint[1] - myDistance;
theViewport->ViewportToNormalizedViewport(u, v);
PositionCoordinate->SetValue(u, v);
//
RemoveFromRender(vtkRenderer* theRenderer);
void
- Init(float theHeight,
- float theCursorSize,
- float theRadius,
- float theMagnification,
- float theClamp,
- float thePos[3],
- float theColor[3]);
+ Init(vtkFloatingPointType theHeight,
+ vtkFloatingPointType theCursorSize,
+ vtkFloatingPointType theRadius,
+ vtkFloatingPointType theMagnification,
+ vtkFloatingPointType theClamp,
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType theColor[3]);
- void SetPreferences(float theHeight,
- float theCursorSize);
+ void SetPreferences(vtkFloatingPointType theHeight,
+ vtkFloatingPointType theCursorSize);
protected:
VISU_CursorPyramid();
void
- Init(float theHeight,
- float theRadius);
+ Init(vtkFloatingPointType theHeight,
+ vtkFloatingPointType theRadius);
int myNbCones;
vtkSmartPointer<vtkConeSource> mySources[6];
vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
vtkSmartPointer<vtkPolyDataMapper> myMapper;
//
- float myHeight;
- float myCursorSize;
- float myRadius;
- float myMagnification;
- float myClamp;
+ vtkFloatingPointType myHeight;
+ vtkFloatingPointType myCursorSize;
+ vtkFloatingPointType myRadius;
+ vtkFloatingPointType myMagnification;
+ vtkFloatingPointType myClamp;
private:
VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
void SetModePosition(const int theMode);
int GetModePosition()const;
//
- void SetWorldPoint(const float theWorldPoint[4]);
- const float* GetWorldPoint()const;
+ void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]);
+ const vtkFloatingPointType* GetWorldPoint()const;
//
- void SetDistance(const float theDistance);
- float GetDistance()const;
+ void SetDistance(const vtkFloatingPointType theDistance);
+ vtkFloatingPointType GetDistance()const;
//
- void SetTransparency(const float theTransparency);
- float GetTransparency()const;
+ void SetTransparency(const vtkFloatingPointType theTransparency);
+ vtkFloatingPointType GetTransparency()const;
//
protected:
VISU_FramedTextActor();
vtkTimeStamp myBuildTime;
//
int myModePosition;
- float myWorldPoint[4];
- float myDistance;
- float myTransparency;
+ vtkFloatingPointType myWorldPoint[4];
+ vtkFloatingPointType myDistance;
+ vtkFloatingPointType myTransparency;
private:
VISU_FramedTextActor(const VISU_FramedTextActor&); // Not implemented.
vtkSetMacro( PrimitiveType, int );
vtkGetMacro( PrimitiveType, int );
- vtkSetMacro( Clamp, float );
- vtkGetMacro( Clamp, float );
+ vtkSetMacro( Clamp, vtkFloatingPointType );
+ vtkGetMacro( Clamp, vtkFloatingPointType );
vtkSetMacro( Texture, vtkImageData* );
vtkGetMacro( Texture, vtkImageData* );
- vtkSetMacro( AlphaThreshold, float );
- vtkGetMacro( AlphaThreshold, float );
+ vtkSetMacro( AlphaThreshold, vtkFloatingPointType );
+ vtkGetMacro( AlphaThreshold, vtkFloatingPointType );
vtkSetMacro( Resolution, int );
vtkGetMacro( Resolution, int );
- vtkSetMacro( Magnification, float );
- vtkGetMacro( Magnification, float );
+ vtkSetMacro( Magnification, vtkFloatingPointType );
+ vtkGetMacro( Magnification, vtkFloatingPointType );
- vtkSetMacro( Increment, float );
- vtkGetMacro( Increment, float );
+ vtkSetMacro( Increment, vtkFloatingPointType );
+ vtkGetMacro( Increment, vtkFloatingPointType );
protected:
bool Initial;
int PrimitiveType;
- float Clamp;
+ vtkFloatingPointType Clamp;
vtkImageData* Texture;
- float AlphaThreshold;
+ vtkFloatingPointType AlphaThreshold;
int Resolution;
- float Magnification;
- float Increment;
+ vtkFloatingPointType Magnification;
+ vtkFloatingPointType Increment;
};
VISU_InsideCursorSettings*
New();
- vtkSetMacro( MinSize, float );
- vtkGetMacro( MinSize, float );
+ vtkSetMacro( MinSize, vtkFloatingPointType );
+ vtkGetMacro( MinSize, vtkFloatingPointType );
- vtkSetMacro( MaxSize, float );
- vtkGetMacro( MaxSize, float );
+ vtkSetMacro( MaxSize, vtkFloatingPointType );
+ vtkGetMacro( MaxSize, vtkFloatingPointType );
protected:
- float MinSize;
- float MaxSize;
+ vtkFloatingPointType MinSize;
+ vtkFloatingPointType MaxSize;
};
VISU_OutsideCursorSettings*
New();
- vtkSetMacro( Size, float );
- vtkGetMacro( Size, float );
+ vtkSetMacro( Size, vtkFloatingPointType );
+ vtkGetMacro( Size, vtkFloatingPointType );
vtkSetMacro( Uniform, bool );
vtkGetMacro( Uniform, bool );
- vtkSetVector3Macro( Color, float );
- vtkGetVector3Macro( Color, float );
+ vtkSetVector3Macro( Color, vtkFloatingPointType );
+ vtkGetVector3Macro( Color, vtkFloatingPointType );
protected:
- float Size;
+ vtkFloatingPointType Size;
bool Uniform;
- float Color[3];
+ vtkFloatingPointType Color[3];
};
vtkSetMacro( Initial, bool );
vtkGetMacro( Initial, bool );
- vtkSetMacro( PyramidHeight, float );
- vtkGetMacro( PyramidHeight, float );
+ vtkSetMacro( PyramidHeight, vtkFloatingPointType );
+ vtkGetMacro( PyramidHeight, vtkFloatingPointType );
- vtkSetMacro( CursorSize, float );
- vtkGetMacro( CursorSize, float );
+ vtkSetMacro( CursorSize, vtkFloatingPointType );
+ vtkGetMacro( CursorSize, vtkFloatingPointType );
- vtkSetVector3Macro( Color, float );
- vtkGetVector3Macro( Color, float );
+ vtkSetVector3Macro( Color, vtkFloatingPointType );
+ vtkGetVector3Macro( Color, vtkFloatingPointType );
- vtkSetMacro( PointTolerance, float );
- vtkGetMacro( PointTolerance, float );
+ vtkSetMacro( PointTolerance, vtkFloatingPointType );
+ vtkGetMacro( PointTolerance, vtkFloatingPointType );
- vtkSetMacro( InfoWindowTransparency, float );
- vtkGetMacro( InfoWindowTransparency, float );
+ vtkSetMacro( InfoWindowTransparency, vtkFloatingPointType );
+ vtkGetMacro( InfoWindowTransparency, vtkFloatingPointType );
vtkSetMacro( InfoWindowPosition, int );
vtkGetMacro( InfoWindowPosition, int );
- vtkSetMacro( ZoomFactor, float );
- vtkGetMacro( ZoomFactor, float );
+ vtkSetMacro( ZoomFactor, vtkFloatingPointType );
+ vtkGetMacro( ZoomFactor, vtkFloatingPointType );
vtkSetMacro( StepNumber, int );
vtkGetMacro( StepNumber, int );
private:
bool Initial;
- float PyramidHeight;
- float CursorSize;
- float PointTolerance;
- float Color[3];
- float InfoWindowTransparency;
+ vtkFloatingPointType PyramidHeight;
+ vtkFloatingPointType CursorSize;
+ vtkFloatingPointType PointTolerance;
+ vtkFloatingPointType Color[3];
+ vtkFloatingPointType InfoWindowTransparency;
int InfoWindowPosition;
- float ZoomFactor;
+ vtkFloatingPointType ZoomFactor;
int StepNumber;
bool DisplayParentMesh;
};
void
VISU_MeshAct
-::SetShrinkFactor(float theValue)
+::SetShrinkFactor(vtkFloatingPointType theValue)
{
Superclass::SetShrinkFactor(theValue);
//----------------------------------------------------------------------------
void
VISU_MeshAct
-::SetOpacity(float theValue)
+::SetOpacity(vtkFloatingPointType theValue)
{
GetSurfaceProperty()->SetOpacity(theValue);
}
-float
+vtkFloatingPointType
VISU_MeshAct
::GetOpacity()
{
//----------------------------------------------------------------------------
void
VISU_MeshAct
-::SetLineWidth(float theLineWidth)
+::SetLineWidth(vtkFloatingPointType theLineWidth)
{
GetEdgeProperty()->SetLineWidth(theLineWidth);
}
-float
+vtkFloatingPointType
VISU_MeshAct::GetLineWidth()
{
return GetEdgeProperty()->GetLineWidth();
virtual
void
- SetOpacity(float theValue);
+ SetOpacity(vtkFloatingPointType theValue);
virtual
- float
+ vtkFloatingPointType
GetOpacity();
virtual
void
- SetLineWidth(float theLineWidth);
+ SetLineWidth(vtkFloatingPointType theLineWidth);
virtual
- float
+ vtkFloatingPointType
GetLineWidth();
virtual
virtual
void
- SetShrinkFactor(float theFactor = 0.8);
+ SetShrinkFactor(vtkFloatingPointType theFactor = 0.8);
virtual
void
vtkIdList *cellPts;
vtkCell *cell;
int numCellPts;
- float *x;
- float multiplier;
+ vtkFloatingPointType *x;
+ vtkFloatingPointType multiplier;
vtkPoints *newPts;
vtkIdList *newCellPts;
vtkDataSet *input = this->GetInput();
// To extract boundary cells, we have to create supplemental information
if ( this->ExtractBoundaryCells )
{
- float val;
+ vtkFloatingPointType val;
newScalars = vtkFloatArray::New();
newScalars->SetNumberOfValues(numPts);
vtkStandardNewMacro(VISU_CutLinesPL);
-VISU_CutLinesPL::VISU_CutLinesPL(){
+VISU_CutLinesPL
+::VISU_CutLinesPL()
+{
myCondition = 1;
myPosition = 0;
}
-void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_CutLinesPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_CutLinesPL *aPipeLine = dynamic_cast<VISU_CutLinesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(1),
aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1);
VISU_CutPlanesPL::ShallowCopy(thePipeLine);
}
-void VISU_CutLinesPL::Init(){
+void
+VISU_CutLinesPL
+::Init()
+{
VISU_CutPlanesPL::Init();
myBasePlane[0] = XY;
}
-void VISU_CutLinesPL::SetPosition(float thePosition){
+void
+VISU_CutLinesPL
+::SetPosition(vtkFloatingPointType thePosition)
+{
myPosition = thePosition;
myCondition = 0;
Modified();
}
-float VISU_CutLinesPL::GetPosition(){
- float aPosition = myPosition;
+vtkFloatingPointType
+VISU_CutLinesPL
+::GetPosition()
+{
+ vtkFloatingPointType aPosition = myPosition;
if(myCondition){
- float aDir[3], aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
GetInput2()->GetBounds(aBounds);
GetDir(aDir,myAng[0],myBasePlane[0]);
GetBoundProject(aBoundPrj,aBounds,aDir);
return aPosition;
}
-void VISU_CutLinesPL::SetDefault(){
+void
+VISU_CutLinesPL
+::SetDefault()
+{
myCondition = 1;
Modified();
}
-int VISU_CutLinesPL::IsDefault(){
+int
+VISU_CutLinesPL
+::IsDefault()
+{
return myCondition;
}
-void VISU_CutLinesPL::Update(){
+void
+VISU_CutLinesPL
+::Update()
+{
ClearAppendPolyData(myAppendPolyData);
SetPartPosition(1);
vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New();
//Build base plane
- float aDir[2][3], aBaseBounds[6];
+ vtkFloatingPointType aDir[2][3], aBaseBounds[6];
GetInput2()->GetBounds(aBaseBounds);
GetDir(aDir[0],myAng[0],myBasePlane[0]);
vtkUnstructuredGrid* anUnstructuredGrid =
CutWithPlanes(anAppendPolyData,anUnstructuredGrid,1,aDir[0],aBaseBounds,
myPosition,myCondition,myDisplacement[0]);
//Build lines
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
vtkDataSet *aDataSet = anAppendPolyData->GetOutput();
aDataSet->Update();
if(aDataSet->GetNumberOfCells() == 0)
}
-void VISU_CutLinesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- float thePartPosition, int thePartCondition,
- float theDisplacement)
+void
+VISU_CutLinesPL
+::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePartPosition,
+ int thePartCondition,
+ vtkFloatingPointType theDisplacement)
{
- vector<float> aPartPosition(1,thePartPosition);
+ vector<vtkFloatingPointType> aPartPosition(1,thePartPosition);
vector<int> aPartCondition(1,thePartCondition);
VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,theDataSet,theNbPlanes,theDir,theBounds,
aPartPosition,aPartCondition,theDisplacement);
VISU_CutLinesPL(const VISU_CutLinesPL&);
public:
vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL);
- static VISU_CutLinesPL* New();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetPosition(float thePosition);
- virtual float GetPosition();
+ static
+ VISU_CutLinesPL*
+ New();
- virtual void SetDefault();
- virtual int IsDefault();
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetPosition(vtkFloatingPointType thePosition);
+
+ virtual
+ vtkFloatingPointType
+ GetPosition();
+
+ virtual
+ void
+ SetDefault();
+
+ virtual
+ int
+ IsDefault();
public:
- virtual void Init();
- virtual void Update();
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ static
+ void
+ CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ vtkFloatingPointType thePlanePosition,
+ int thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
+
+ const vtkFloatingPointType*
+ GetDirLn()
+ {
+ return myDirLn;
+ }
- static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- float thePlanePosition, int thePlaneCondition,
- float theDisplacement);
+ const vtkFloatingPointType*
+ GetBoundPrjLn()
+ {
+ return myBoundPrjLn;
+ }
- const float* GetDirLn(){ return myDirLn;}
- const float* GetBoundPrjLn(){ return myBoundPrjLn;}
- const float* GetBasePnt(){ return myBasePnt;}
+ const vtkFloatingPointType*
+ GetBasePnt()
+ {
+ return myBasePnt;
+ }
protected:
- float myDirLn[3], myBoundPrjLn[3], myBasePnt[3];
- float myPosition;
+ vtkFloatingPointType myDirLn[3];
+ vtkFloatingPointType myBoundPrjLn[3];
+ vtkFloatingPointType myBasePnt[3];
+ vtkFloatingPointType myPosition;
int myCondition;
};
using namespace std;
-static float EPS = 1.0E-3;
+static vtkFloatingPointType EPS = 1.0E-3;
vtkStandardNewMacro(VISU_CutPlanesPL);
-VISU_CutPlanesPL::VISU_CutPlanesPL(){
+VISU_CutPlanesPL
+::VISU_CutPlanesPL()
+{
myAppendPolyData = vtkAppendPolyData::New();
myIsShrinkable = false;
myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0;
}
-VISU_CutPlanesPL::~VISU_CutPlanesPL(){
+VISU_CutPlanesPL
+::~VISU_CutPlanesPL()
+{
myAppendPolyData->Delete();
}
-void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_CutPlanesPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_CutPlanesPL *aPipeLine = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine)){
SetOrientation(aPipeLine->GetPlaneOrientation(),
aPipeLine->GetRotateX(),aPipeLine->GetRotateY());
VISU_ScalarMapPL::ShallowCopy(thePipeLine);
}
-void VISU_CutPlanesPL::Init(){
+void
+VISU_CutPlanesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
SetNbParts(10);
myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0;
}
-VISU_ScalarMapPL::THook* VISU_CutPlanesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_CutPlanesPL
+::DoHook()
+{
return myAppendPolyData->GetOutput();
}
-void VISU_CutPlanesPL::Update(){
+void
+VISU_CutPlanesPL
+::Update()
+{
ClearAppendPolyData(myAppendPolyData);
SetPartPosition();
- float aDir[3];
+ vtkFloatingPointType aDir[3];
GetDir(aDir,myAng[0],myBasePlane[0]);
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
GetInput2()->GetBounds(aBounds);
vtkDataSet* aDataSet = myFieldTransform->GetUnstructuredGridOutput();
CutWithPlanes(myAppendPolyData,aDataSet,myNbParts,aDir,aBounds,
VISU_ScalarMapPL::Update();
}
-void VISU_CutPlanesPL::SetPartPosition(int theNum){
+void
+VISU_CutPlanesPL
+::SetPartPosition(int theNum)
+{
for(int i = 0; i < myNbParts; i++)
myPartPosition[i] = GetPartPosition(i,theNum);
}
-void VISU_CutPlanesPL::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData){
+void
+VISU_CutPlanesPL
+::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData)
+{
int iEnd = theAppendPolyData->GetNumberOfInputs();
for(int i = iEnd-1; i >= 0; i--)
theAppendPolyData->RemoveInput(theAppendPolyData->GetInput(i));
}
-float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){
+vtkFloatingPointType*
+VISU_CutPlanesPL::
+GetRx(vtkFloatingPointType theRx[3][3],
+ vtkFloatingPointType thaAng)
+{
theRx[0][0] = 1.0; theRx[0][1] = 0.0; theRx[0][2] = 0.0;
theRx[1][0] = 0.0; theRx[1][1] = cos(thaAng); theRx[1][2] = -sin(thaAng);
theRx[2][0] = 0.0; theRx[2][1] = sin(thaAng); theRx[2][2] = cos(thaAng);
}
-float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){
+vtkFloatingPointType*
+VISU_CutPlanesPL
+::GetRy(vtkFloatingPointType theRy[3][3],
+ vtkFloatingPointType thaAng)
+{
theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng);
theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0;
theRy[2][0] = -sin(thaAng); theRy[2][1] = 0.0; theRy[2][2] = cos(thaAng);
}
-float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){
+vtkFloatingPointType*
+VISU_CutPlanesPL
+::GetRz(vtkFloatingPointType theRz[3][3],
+ vtkFloatingPointType thaAng)
+{
theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0;
theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0;
theRz[2][0] = 0.0; theRz[2][1] = 0.0; theRz[2][2] = 1.0;
}
-void VISU_CutPlanesPL::CorrectPnt(float thePnt[3], const float BoundPrj[6]){
+void
+VISU_CutPlanesPL
+::CorrectPnt(vtkFloatingPointType thePnt[3],
+ const vtkFloatingPointType BoundPrj[6])
+{
for(int i = 0, j = 0; i < 3; ++i, j=2*i){
if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j];
if(thePnt[i] > BoundPrj[j+1]) thePnt[i] = BoundPrj[j+1];
}
}
-void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]){
- float BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
- {BoundBox[1],BoundBox[2],BoundBox[4]},
- {BoundBox[0],BoundBox[3],BoundBox[4]},
- {BoundBox[1],BoundBox[3],BoundBox[4]},
- {BoundBox[0],BoundBox[2],BoundBox[5]},
- {BoundBox[1],BoundBox[2],BoundBox[5]},
- {BoundBox[0],BoundBox[3],BoundBox[5]},
- {BoundBox[1],BoundBox[3],BoundBox[5]}};
+void
+VISU_CutPlanesPL
+::GetBoundProject(vtkFloatingPointType BoundPrj[3],
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3])
+{
+ vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]},
+ {BoundBox[1],BoundBox[2],BoundBox[4]},
+ {BoundBox[0],BoundBox[3],BoundBox[4]},
+ {BoundBox[1],BoundBox[3],BoundBox[4]},
+ {BoundBox[0],BoundBox[2],BoundBox[5]},
+ {BoundBox[1],BoundBox[2],BoundBox[5]},
+ {BoundBox[0],BoundBox[3],BoundBox[5]},
+ {BoundBox[1],BoundBox[3],BoundBox[5]}};
BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0];
for(int i = 1; i < 8; i++){
- float tmp = vtkMath::Dot(Dir,BoundPoints[i]);
+ vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]);
if(BoundPrj[1] < tmp) BoundPrj[1] = tmp;
if(BoundPrj[0] > tmp) BoundPrj[0] = tmp;
}
}
-void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- float theXAng, float theYAng, int theNum)
+void
+VISU_CutPlanesPL
+::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum)
{
myBasePlane[theNum] = theOrient;
switch(myBasePlane[theNum]){
}
-const VISU_CutPlanesPL::PlaneOrientation& VISU_CutPlanesPL::GetPlaneOrientation(int theNum){
+const VISU_CutPlanesPL::PlaneOrientation&
+VISU_CutPlanesPL
+::GetPlaneOrientation(int theNum)
+{
return myBasePlane[theNum];
}
-float VISU_CutPlanesPL::GetRotateX(int theNum){
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetRotateX(int theNum)
+{
switch(myBasePlane[theNum]){
case XY: return myAng[theNum][0];
case YZ: return myAng[theNum][1];
return 0;
}
-float VISU_CutPlanesPL::GetRotateY(int theNum){
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetRotateY(int theNum)
+{
switch(myBasePlane[theNum]){
case XY: return myAng[theNum][1];
case YZ: return myAng[theNum][2];
}
-void VISU_CutPlanesPL::SetNbParts(int theNb) {
+void
+VISU_CutPlanesPL
+::SetNbParts(int theNb)
+{
myNbParts = theNb;
myPartPosition.resize(myNbParts);
myPartCondition.resize(myNbParts,1);
}
-void VISU_CutPlanesPL::SetPartPosition(int thePartNumber, float thePartPosition){
+void
+VISU_CutPlanesPL
+::SetPartPosition(int thePartNumber,
+ vtkFloatingPointType thePartPosition)
+{
if(thePartNumber >= myNbParts) return;
myPartPosition[thePartNumber] = thePartPosition;
myPartCondition[thePartNumber] = 0;
Modified();
}
-float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){
+
+vtkFloatingPointType
+VISU_CutPlanesPL
+::GetPartPosition(int thePartNumber,
+ int theNum)
+{
if(thePartNumber >= myNbParts) return 0;
- float aPosition = myPartPosition[thePartNumber];
+ vtkFloatingPointType aPosition = myPartPosition[thePartNumber];
if(myPartCondition[thePartNumber]){
- float aDir[3], aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
GetInput2()->GetBounds(aBounds);
GetDir(aDir,myAng[theNum],myBasePlane[theNum]);
GetBoundProject(aBoundPrj,aBounds,aDir);
if (myNbParts > 1){
- float aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
- float aDisplacement = aDBoundPrj * myDisplacement[theNum];
- float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1);
+ vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum];
+ vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
aPosition = aStartPosition + thePartNumber*aDBoundPrj;
}else
aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum];
}
-void VISU_CutPlanesPL::SetPartDefault(int thePartNumber){
+void
+VISU_CutPlanesPL
+::SetPartDefault(int thePartNumber)
+{
if(thePartNumber >= myNbParts) return;
myPartPosition[thePartNumber] = GetPartPosition(thePartNumber);
myPartCondition[thePartNumber] = 1;
Modified();
}
-int VISU_CutPlanesPL::IsPartDefault(int thePartNumber){
+int
+VISU_CutPlanesPL
+::IsPartDefault(int thePartNumber)
+{
if(thePartNumber >= myNbParts) return 1;
return myPartCondition[thePartNumber];
}
-void VISU_CutPlanesPL::GetDir(float theDir[3],
- const float theAng[3],
- const PlaneOrientation& theBasePlane)
+void
+VISU_CutPlanesPL
+::GetDir(vtkFloatingPointType theDir[3],
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane)
{
int iPlane = 0;
- float aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
+ vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3];
switch(theBasePlane){
case XY:
if(fabs(theAng[0]) > EPS) GetRx(aRx,theAng[0]); else vtkMath::Identity3x3(aRx);
}
-void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
- vtkDataSet* theDataSet,
- float theDir[3], float theOrig[3])
+void
+VISU_CutPlanesPL
+::CutWithPlane(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3])
{
vtkCutter *aCutPlane = vtkCutter::New();
aCutPlane->SetInput(theDataSet);
}
-void VISU_CutPlanesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- const vector<float>& thePlanePosition,
- const vector<int>& thePlaneCondition,
- float theDisplacement)
+void
+VISU_CutPlanesPL
+::CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const vector<vtkFloatingPointType>& thePlanePosition,
+ const vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement)
{
- float aBoundPrj[3], aOrig[3], aPosition;
+ vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition;
GetBoundProject(aBoundPrj, theBounds, theDir);
if(theNbPlanes > 1){
- float aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1);
- float aDisplacement = aDBoundPrj*theDisplacement;
- float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
+ vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1);
+ vtkFloatingPointType aDisplacement = aDBoundPrj*theDisplacement;
+ vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement;
for (int i = 0; i < theNbPlanes; i++){
aPosition = aStartPosition + i*aDBoundPrj;
if(thePlaneCondition[i]){
public:
vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL);
static VISU_CutPlanesPL* New();
- virtual ~VISU_CutPlanesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- enum PlaneOrientation {XY, YZ, ZX};
- virtual void SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
- float theXAng, float theYAng, int theNum = 0);
+ virtual
+ ~VISU_CutPlanesPL();
- virtual const PlaneOrientation& GetPlaneOrientation(int theNum = 0);
- virtual float GetRotateX(int theNum = 0);
- virtual float GetRotateY(int theNum = 0);
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual float GetDisplacement(int theNum = 0) { return myDisplacement[theNum];}
- virtual void SetDisplacement(float theDisp, int theNum = 0) { myDisplacement[theNum] = theDisp;}
+ enum PlaneOrientation {XY, YZ, ZX};
- virtual void SetPartPosition(int thePartNumber, float thePartPosition);
- virtual float GetPartPosition(int thePartNumber, int theNum = 0);
+ virtual
+ void
+ SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient,
+ vtkFloatingPointType theXAng,
+ vtkFloatingPointType theYAng,
+ int theNum = 0);
+
+ virtual
+ const PlaneOrientation&
+ GetPlaneOrientation(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetRotateX(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetRotateY(int theNum = 0);
+
+ virtual
+ vtkFloatingPointType
+ GetDisplacement(int theNum = 0)
+ {
+ return myDisplacement[theNum];
+ }
+
+ virtual
+ void
+ SetDisplacement(vtkFloatingPointType theDisp,
+ int theNum = 0)
+ {
+ myDisplacement[theNum] = theDisp;
+ }
+
+ virtual
+ void
+ SetPartPosition(int thePartNumber,
+ vtkFloatingPointType thePartPosition);
+
+ virtual
+ vtkFloatingPointType
+ GetPartPosition(int thePartNumber,
+ int theNum = 0);
+
+ virtual
+ void
+ SetPartDefault(int thePartNumber);
+
+ virtual
+ int
+ IsPartDefault(int thePartNumber);
+
+ virtual
+ void
+ SetNbParts(int theNb);
+
+ virtual
+ int
+ GetNbParts()
+ {
+ return myNbParts;
+ }
- virtual void SetPartDefault(int thePartNumber);
- virtual int IsPartDefault(int thePartNumber);
+public:
+ virtual
+ void
+ Init();
- virtual void SetNbParts(int theNb);
- virtual int GetNbParts(){ return myNbParts;}
+ virtual
+ void
+ Update();
-public:
- virtual void Init();
- virtual void Update();
- virtual vtkAppendPolyData* GetAppendPolyData() { return myAppendPolyData; }
+ virtual
+ vtkAppendPolyData*
+ GetAppendPolyData()
+ {
+ return myAppendPolyData;
+ }
public:
- static float* GetRx(float theRx[3][3], float thaAng);
- static float* GetRy(float theRy[3][3], float thaAng);
- static float* GetRz(float theRz[3][3], float thaAng);
-
- static void CorrectPnt(float thePnt[3], const float BoundPrj[6]);
- static void GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]);
-
- static void GetDir(float theDir[3],
- const float theAng[3],
- const PlaneOrientation& theBasePlane);
-
- static void ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
-
- static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- float theDir[3], float theOrig[3]);
- static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet,
- int theNbPlanes, float theDir[3], float theBounds[6],
- const std::vector<float>& thePlanePosition,
- const std::vector<int>& thePlaneCondition,
- float theDisplacement);
+ static
+ vtkFloatingPointType*
+ GetRx(vtkFloatingPointType theRx[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ vtkFloatingPointType*
+ GetRy(vtkFloatingPointType theRy[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ vtkFloatingPointType*
+ GetRz(vtkFloatingPointType theRz[3][3],
+ vtkFloatingPointType thaAng);
+
+ static
+ void
+ CorrectPnt(vtkFloatingPointType thePnt[3],
+ const vtkFloatingPointType BoundPrj[6]);
+
+ static
+ void
+ GetBoundProject(vtkFloatingPointType BoundPrj[3],
+ const vtkFloatingPointType BoundBox[6],
+ const vtkFloatingPointType Dir[3]);
+
+ static
+ void
+ GetDir(vtkFloatingPointType theDir[3],
+ const vtkFloatingPointType theAng[3],
+ const PlaneOrientation& theBasePlane);
+
+ static
+ void
+ ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData);
+
+ static
+ void
+ CutWithPlane(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theOrig[3]);
+
+ static
+ void
+ CutWithPlanes(vtkAppendPolyData* theAppendPolyData,
+ vtkDataSet* theDataSet,
+ int theNbPlanes,
+ vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theBounds[6],
+ const std::vector<vtkFloatingPointType>& thePlanePosition,
+ const std::vector<int>& thePlaneCondition,
+ vtkFloatingPointType theDisplacement);
protected:
- virtual THook* DoHook();
- void SetPartPosition(int theNum = 0);
+ virtual
+ THook*
+ DoHook();
+
+ void
+ SetPartPosition(int theNum = 0);
int myNbParts;
PlaneOrientation myBasePlane[2];
- float myAng[2][3], myDisplacement[2];
+ vtkFloatingPointType myAng[2][3], myDisplacement[2];
vtkAppendPolyData *myAppendPolyData;
- std::vector<float> myPartPosition;
+ std::vector<vtkFloatingPointType> myPartPosition;
std::vector<int> myPartCondition;
};
vtkStandardNewMacro(VISU_DeformedShapePL);
-VISU_DeformedShapePL::VISU_DeformedShapePL(){
+VISU_DeformedShapePL
+::VISU_DeformedShapePL()
+{
myWarpVector = vtkWarpVector::New();
myCellDataToPointData = vtkCellDataToPointData::New();
}
-VISU_DeformedShapePL::~VISU_DeformedShapePL(){
+VISU_DeformedShapePL
+::~VISU_DeformedShapePL()
+{
myWarpVector->UnRegisterAllOutputs();
myWarpVector->Delete();
myCellDataToPointData->Delete();
}
-void VISU_DeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_DeformedShapePL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_DeformedShapePL *aPipeLine = dynamic_cast<VISU_DeformedShapePL*>(thePipeLine)){
SetScale(aPipeLine->GetScale());
}
VISU_ScalarMapPL::ShallowCopy(thePipeLine);
}
-float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){
+vtkFloatingPointType
+VISU_DeformedShapePL
+::GetScaleFactor(vtkDataSet* theDataSet)
+{
if(!theDataSet) return 0.0;
theDataSet->Update();
int aNbCells = theDataSet->GetNumberOfCells();
int aNbPoints = theDataSet->GetNumberOfPoints();
int aNbElem = aNbCells? aNbCells: aNbPoints;
- float* aBounds = theDataSet->GetBounds();
- float aVolume = 1, aVol, idim = 0;
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType aVolume = 1, aVol, idim = 0;
for(int i = 0; i < 6; i += 2){
aVol = fabs(aBounds[i+1] - aBounds[i]);
if(aVol > 0) {
}
}
aVolume /= aNbElem;
- return pow(aVolume,float(1.0/idim));
+ return pow(aVolume,vtkFloatingPointType(1.0/idim));
}
-void VISU_DeformedShapePL::SetScale(float theScale) {
+void
+VISU_DeformedShapePL
+::SetScale(vtkFloatingPointType theScale)
+{
myWarpVector->SetScaleFactor(theScale);
myScaleFactor = theScale;
Modified();
}
-float VISU_DeformedShapePL::GetScale() {
+
+vtkFloatingPointType
+VISU_DeformedShapePL
+::GetScale()
+{
return myScaleFactor;
}
-void VISU_DeformedShapePL::Init(){
+void
+VISU_DeformedShapePL
+::Init()
+{
VISU_ScalarMapPL::Init();
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
vtkDataSet* aDataSet = GetInput2();
- float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
+ vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(fabs(aScalarRange[1]) > EPS)
SetScale(0.0);
}
-VISU_ScalarMapPL::THook* VISU_DeformedShapePL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_DeformedShapePL
+::DoHook()
+{
VISU::CellDataToPoint(myWarpVector,myCellDataToPointData,GetInput2(),myFieldTransform);
return myWarpVector->GetOutput();
}
-void VISU_DeformedShapePL::Update(){
+void
+VISU_DeformedShapePL
+::Update()
+{
VISU_ScalarMapPL::Update();
}
-void VISU_DeformedShapePL::SetMapScale(float theMapScale){
+void
+VISU_DeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
class SALOME_Transform;
class vtkWarpVector;
-class VISU_DeformedShapePL : public VISU_ScalarMapPL{
+class VISU_DeformedShapePL : public VISU_ScalarMapPL
+{
protected:
VISU_DeformedShapePL();
VISU_DeformedShapePL(const VISU_DeformedShapePL&);
+
+ virtual
+ ~VISU_DeformedShapePL();
+
public:
vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL);
- static VISU_DeformedShapePL* New();
- virtual ~VISU_DeformedShapePL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ static
+ VISU_DeformedShapePL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
public:
- virtual void Init();
- virtual void Update();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
- static float GetScaleFactor(vtkDataSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetScaleFactor(vtkDataSet* theDataSet);
protected:
- virtual THook* DoHook();
+ virtual
+ THook*
+ DoHook();
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myWarpVector;
vtkCellDataToPointData* myCellDataToPointData;
};
vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD");
if(vtkFloatArray *aFloatArray = dynamic_cast<vtkFloatArray*>(aFieldArray)){
int aNbComp = aFloatArray->GetNumberOfComponents();
- std::vector<float> anArray(aNbComp < 3? 3: aNbComp);
+ std::vector<vtkFloatingPointType> anArray(aNbComp < 3? 3: aNbComp);
//
vtkFloatArray *aScalars = vtkFloatArray::New();
aScalars->SetNumberOfTuples(theNbElems);
if(!theScalarMode){
for(int anId = 0; anId < theNbElems; anId++){
aFloatArray->GetTuple(anId,&anArray[0]);
- float aVector[3] = {anArray[0], anArray[1], anArray[2]};
- float aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]);
+ vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]};
+ vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]);
aScalars->SetTuple1(anId,aScalar);
}
}else{
#include <vtkDataSet.h>
#include <vtkMath.h>
-static float Tolerance = 1.0 / VTK_LARGE_FLOAT;
+static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT;
using namespace std;
void
VISU_FieldTransform
-::SetScalarRange(float theScalarRange[2])
+::SetScalarRange(vtkFloatingPointType theScalarRange[2])
{
- float aDelta =
+ vtkFloatingPointType aDelta =
fabs(myScalarRange[0] - theScalarRange[0]) +
fabs(myScalarRange[1] - theScalarRange[1]);
if(aDelta < Tolerance)
void
VISU_FieldTransform
-::SetScalarMin(float theValue)
+::SetScalarMin(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {theValue, GetScalarRange()[1]};
+ vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
SetScalarRange(aScalarRange);
}
void
VISU_FieldTransform
-::SetScalarMax(float theValue)
+::SetScalarMax(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {GetScalarRange()[0], theValue};
+ vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
SetScalarRange(aScalarRange);
}
template<typename TypeData> void
ExecVectors(VISU_FieldTransform::TTransformFun theFunction,
VTKViewer_Transform* theTransform,
- float theScalarRange[2],
+ vtkFloatingPointType theScalarRange[2],
int theNbOfTuples,
TypeData* theInputData,
TypeData* theOutputData)
vtkFloatArray *aNewVectors = vtkFloatArray::New();
aNewVectors->SetNumberOfComponents(3);
aNewVectors->SetNumberOfTuples(theNbOfTuples);
- float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
- float aDelta = aScalarRange[1] - aScalarRange[0];
- float aScale[3] = {1.0, 1.0, 1.0};
- static float EPS = 1.0 / VTK_LARGE_FLOAT;
+ vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
+ vtkFloatingPointType aDelta = aScalarRange[1] - aScalarRange[0];
+ vtkFloatingPointType aScale[3] = {1.0, 1.0, 1.0};
+ static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT;
if(theTransform){
aScale[0] = theTransform->GetScale()[0];
aScale[1] = theTransform->GetScale()[1];
}
if(theFunction == &(VISU_FieldTransform::Ident)){
for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
- float anInVec[3];
+ vtkFloatingPointType anInVec[3];
anInVectors->GetTuple(aTupleId,anInVec);
- float anNewVec[3];
+ vtkFloatingPointType anNewVec[3];
anNewVec[0] = anInVec[0]*aScale[0];
anNewVec[1] = anInVec[1]*aScale[1];
anNewVec[2] = anInVec[2]*aScale[2];
}
}else{
for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
- float anInVec[3];
+ vtkFloatingPointType anInVec[3];
anInVectors->GetTuple(aTupleId,anInVec);
- float aMagn = vtkMath::Norm(anInVec);
+ vtkFloatingPointType aMagn = vtkMath::Norm(anInVec);
if(aMagn > EPS)
aMagn = ((*theFunction)(aMagn) - aScalarRange[0]) / aDelta * theScalarRange[1] / aMagn;
if(aMagn < 0.0)
aMagn = 0.0;
- float anNewVec[3];
+ vtkFloatingPointType anNewVec[3];
anNewVec[0] = anInVec[0]*aMagn*aScale[0];
anNewVec[1] = anInVec[1]*aMagn*aScale[1];
anNewVec[2] = anInVec[2]*aMagn*aScale[2];
template<typename TypeData> void
ExecScalars(VISU_FieldTransform::TTransformFun theFunction,
- float theScalarRange[2],
+ vtkFloatingPointType theScalarRange[2],
int theNbOfTuples,
TypeData* theInputData,
TypeData* theOutputData)
vtkFloatArray *aNewScalars = vtkFloatArray::New();
aNewScalars->SetNumberOfComponents(1);
aNewScalars->SetNumberOfTuples(theNbOfTuples);
- float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
+ vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])};
for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) {
- float aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId));
+ vtkFloatingPointType aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId));
if(aScalar < aScalarRange[0])
aScalar = aScalarRange[0];
aNewScalars->SetTuple1(aTupleId,aScalar);
void SetSpaceTransform(VTKViewer_Transform* theTransform);
VTKViewer_Transform* GetSpaceTransform() { return myTransform;}
- float* GetScalarRange(){ return myScalarRange; }
- void SetScalarRange(float theScalarRange[2]);
- void SetScalarMin(float theValue);
- void SetScalarMax(float theValue);
+ vtkFloatingPointType* GetScalarRange(){ return myScalarRange; }
+ void SetScalarRange(vtkFloatingPointType theScalarRange[2]);
+ void SetScalarMin(vtkFloatingPointType theValue);
+ void SetScalarMax(vtkFloatingPointType theValue);
protected:
VISU_FieldTransform();
VTKViewer_Transform *myTransform;
TTransformFun myFunction;
- float myScalarRange[2];
+ vtkFloatingPointType myScalarRange[2];
};
#endif
Superclass::Init();
vtkDataSet* aDataSet = GetParentMesh();
- float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
+ vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
- float* aScalarRange = GetScalarRange();
+ vtkFloatingPointType* aScalarRange = GetScalarRange();
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(fabs(aScalarRange[1]) > EPS)
SetScale( aScaleFactor / aScalarRange[1] );
::Update()
{
//cout << "VISU_GaussPointsPL::Update()" << endl;
- float* aScalarRange = GetScalarRange();
+ vtkFloatingPointType* aScalarRange = GetScalarRange();
mySourceScalarRange[0] = aScalarRange[0];
mySourceScalarRange[1] = aScalarRange[1];
myDeltaScalarRange = aScalarRange[1] - aScalarRange[0];
{
//cout << "VISU_GaussPointsPL::UpdateGlyph()" << endl;
- float* aScalarRange = GetScalarRange();
+ vtkFloatingPointType* aScalarRange = GetScalarRange();
if( myPSMapper->GetPointSpriteMode() == 0 ) // Results
{
myGlyph->SetScaleModeToScaleByScalar();
myGlyph->SetColorModeToColorByScalar();
- float aRange = 0;
- float aMinSize = GetMinSize();
- float aMaxSize = GetMaxSize();
+ vtkFloatingPointType aRange = 0;
+ vtkFloatingPointType aMinSize = GetMinSize();
+ vtkFloatingPointType aMaxSize = GetMaxSize();
if( fabs( aMaxSize - aMinSize ) > 0.0001 )
aRange = ( aScalarRange[1] - aScalarRange[0] ) / ( aMaxSize - aMinSize );
- float aMinRange = aScalarRange[0] - aMinSize * aRange;
- float aMaxRange = aMinRange + aRange;
+ vtkFloatingPointType aMinRange = aScalarRange[0] - aMinSize * aRange;
+ vtkFloatingPointType aMaxRange = aMinRange + aRange;
myGlyph->SetRange( aMinRange, aMaxRange );
myGlyph->SetScaleFactor( 1.0 );
return myGaussPtsIDMapper->GetObjID(theID);
}
-float*
+vtkFloatingPointType*
VISU_GaussPointsPL
::GetNodeCoord(int theObjID)
{
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMaximumSupportedSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetClamp(float theClamp)
+::SetClamp(vtkFloatingPointType theClamp)
{
myPSMapper->SetPointSpriteClamp( theClamp );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetClamp()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetSize(float theSize)
+::SetSize(vtkFloatingPointType theSize)
{
myPSMapper->SetPointSpriteSize( theSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMinSize(float theMinSize)
+::SetMinSize(vtkFloatingPointType theMinSize)
{
myPSMapper->SetPointSpriteMinSize( theMinSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMinSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMaxSize(float theMaxSize)
+::SetMaxSize(vtkFloatingPointType theMaxSize)
{
myPSMapper->SetPointSpriteMaxSize( theMaxSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMaxSize()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMagnification(float theMagnification)
+::SetMagnification(vtkFloatingPointType theMagnification)
{
myPSMapper->SetPointSpriteMagnification( theMagnification );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMagnification()
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetMagnificationIncrement(float theIncrement)
+::SetMagnificationIncrement(vtkFloatingPointType theIncrement)
{
myMagnificationIncrement = theIncrement;
}
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetAlphaThreshold(float theAlphaThreshold)
+::SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold)
{
myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetAlphaThreshold()
{
VISU_GaussPointsPL
::ChangeMagnification( bool up )
{
- float anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement;
+ vtkFloatingPointType anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement;
SetMagnification( GetMagnification() * anIncrement );
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray)
{
- float aMaxSize = GetAverageCellSize() * GetMaxSize();
- float aMinSize = GetAverageCellSize() * GetMinSize();
- float aDelta = aMaxSize - aMinSize;
- float aVal = theScalarArray->GetTuple1(theID);
+ vtkFloatingPointType aMaxSize = GetAverageCellSize() * GetMaxSize();
+ vtkFloatingPointType aMinSize = GetAverageCellSize() * GetMinSize();
+ vtkFloatingPointType aDelta = aMaxSize - aMinSize;
+ vtkFloatingPointType aVal = theScalarArray->GetTuple1(theID);
return aMinSize + aDelta*(aVal - mySourceScalarRange[0])/myDeltaScalarRange;
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetMaxPointSize()
{
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetPointSize(vtkIdType theID)
{
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
-::SetAverageCellSize(float theAverageCellSize)
+::SetAverageCellSize(vtkFloatingPointType theAverageCellSize)
{
myPSMapper->SetAverageCellSize( theAverageCellSize );
Modified();
}
//----------------------------------------------------------------------------
-float
+vtkFloatingPointType
VISU_GaussPointsPL
::GetAverageCellSize()
{
return aCompositeImageData;
}
-void VISU_GaussPointsPL::SetScale( float theScale )
+void VISU_GaussPointsPL::SetScale( vtkFloatingPointType theScale )
{
myWarpVector->SetScaleFactor( theScale );
myScaleFactor = GetScale();
Modified();
}
-float VISU_GaussPointsPL::GetScale()
+vtkFloatingPointType VISU_GaussPointsPL::GetScale()
{
return myWarpVector->GetScaleFactor();
}
-void VISU_GaussPointsPL::SetMapScale( float theMapScale )
+void VISU_GaussPointsPL::SetMapScale( vtkFloatingPointType theMapScale )
{
VISU_ScalarMapPL::SetMapScale( theMapScale );
GetObjID(vtkIdType theID) const;
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
void
GetPrimitiveType();
//! Get the maximum Point Sprite size, which is supported by hardware.
- float
+ vtkFloatingPointType
GetMaximumSupportedSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp.
void
- SetClamp(float theClamp);
+ SetClamp(vtkFloatingPointType theClamp);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, vtkFloatingPointType).
+ vtkFloatingPointType
GetClamp();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteSize.
void
- SetSize(float theSize);
+ SetSize(vtkFloatingPointType theSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize.
void
- SetMinSize(float theMinSize);
+ SetMinSize(vtkFloatingPointType theMinSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetMinSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize.
void
- SetMaxSize(float theMaxSize);
+ SetMaxSize(vtkFloatingPointType theMaxSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetMaxSize();
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification.
void
- SetMagnification(float theMagnification);
+ SetMagnification(vtkFloatingPointType theMagnification);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, vtkFloatingPointType).
+ vtkFloatingPointType
GetMagnification();
//! Set the increment of changing Magnification parameter.
void
- SetMagnificationIncrement(float theIncrement);
+ SetMagnificationIncrement(vtkFloatingPointType theIncrement);
//! Get the increment of changing Magnification parameter.
- float
+ vtkFloatingPointType
GetMagnificationIncrement() { return myMagnificationIncrement; }
//! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold.
void
- SetAlphaThreshold(float theAlphaThreshold);
+ SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, vtkFloatingPointType).
+ vtkFloatingPointType
GetAlphaThreshold();
//! Set resolution of the Geometrical Sphere.
ChangeMagnification( bool up );
//! Get the maximum size of Point Sprites in the presentation.
- float
+ vtkFloatingPointType
GetMaxPointSize();
//! Get point size by element's Id.
- float
+ vtkFloatingPointType
GetPointSize(vtkIdType theID);
//! Get point size by element's Id using the specified scalar array.
- float
+ vtkFloatingPointType
GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, float).
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, vtkFloatingPointType).
void
- SetAverageCellSize(float AverageCellSize);
+ SetAverageCellSize(vtkFloatingPointType AverageCellSize);
- //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, float).
- float
+ //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, vtkFloatingPointType).
+ vtkFloatingPointType
GetAverageCellSize();
//! Set image data for the Point Sprite texture.
virtual void SetIsDeformed( bool theIsDeformed );
virtual bool GetIsDeformed() const;
- virtual void SetScale( float theScale );
- virtual float GetScale();
- virtual void SetMapScale( float theMapScale = 1.0 );
+ virtual void SetScale( vtkFloatingPointType theScale );
+ virtual vtkFloatingPointType GetScale();
+ virtual void SetMapScale( vtkFloatingPointType theMapScale = 1.0 );
protected:
bool myIsDeformed;
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myWarpVector;
vtkCellDataToPointData* myCellDataToPointData;
std::vector<VTKViewer_PassThroughFilter*> myPassFilter;
vtkGeometryFilter* myGeomFilter;
vtkDataArray *myScalarArray;
- float mySourceScalarRange[2];
- float myDeltaScalarRange;
+ vtkFloatingPointType mySourceScalarRange[2];
+ vtkFloatingPointType myDeltaScalarRange;
int myPrimitiveType;
- float myMagnificationIncrement;
+ vtkFloatingPointType myMagnificationIncrement;
};
#endif
// function: SetCenter
// purpose:
//====================================================================
-void VISU_UnScaledActor::SetCenter(float *pC)
+void VISU_UnScaledActor::SetCenter(vtkFloatingPointType *pC)
{
for (int i=0; i<3; ++i){
myCenter[i]=pC[i];
// function:GetBounds
// purpose:
//====================================================================
-float* VISU_UnScaledActor::GetBounds()
+vtkFloatingPointType* VISU_UnScaledActor::GetBounds()
{
Superclass::GetBounds();
//
void VISU_UnScaledActor::Render(vtkRenderer *theRenderer)
{
if(theRenderer){
- float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
+ vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
- float aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
- (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
- (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+ vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
int* aSize = theRenderer->GetRenderWindow()->GetSize();
- float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
+ vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
- float aLength = aDataSet->GetLength();
- float aPrecision = 1.e-3;
- float anOldScale = GetScale()[0];
- float aScale =
- mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1]));
+ vtkFloatingPointType aLength = aDataSet->GetLength();
+ vtkFloatingPointType aPrecision = 1.e-3;
+ vtkFloatingPointType anOldScale = GetScale()[0];
+ vtkFloatingPointType aScale =
+ mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
SetOrigin(myCenter);
//
static VISU_UnScaledActor *New();
- void SetCenter(float *);
+ void SetCenter(vtkFloatingPointType *);
virtual void SetSize(int theSize);
virtual void Render(vtkRenderer *theRenderer);
- virtual float *GetBounds();
+ virtual vtkFloatingPointType *GetBounds();
protected:
VISU_UnScaledActor();
~VISU_UnScaledActor(){}
- float myCenter[3];
+ vtkFloatingPointType myCenter[3];
int mySize;
};
vtkStandardNewMacro(VISU_IsoSurfacesPL);
-VISU_IsoSurfacesPL::VISU_IsoSurfacesPL(){
+VISU_IsoSurfacesPL
+::VISU_IsoSurfacesPL()
+{
myContourFilter = vtkContourFilter::New();
myCellDataToPointData = vtkCellDataToPointData::New();
myIsShrinkable = false;
}
-VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){
+VISU_IsoSurfacesPL
+::~VISU_IsoSurfacesPL()
+{
myContourFilter->UnRegisterAllOutputs();
myContourFilter->Delete();
myCellDataToPointData->Delete();
}
-void VISU_IsoSurfacesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_IsoSurfacesPL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast<VISU_IsoSurfacesPL*>(thePipeLine)){
SetNbParts(aPipeLine->GetNbParts());
- float aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
+ vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()};
SetRange(aRange);
}
VISU_ScalarMapPL::ShallowCopy(thePipeLine);
}
-int VISU_IsoSurfacesPL::GetNbParts() {
+int
+VISU_IsoSurfacesPL
+::GetNbParts()
+{
return myContourFilter->GetNumberOfContours();
}
-void VISU_IsoSurfacesPL::SetNbParts(int theNb) {
+void
+VISU_IsoSurfacesPL
+::SetNbParts(int theNb)
+{
myContourFilter->SetNumberOfContours(theNb);
Modified();
}
-void VISU_IsoSurfacesPL::SetScaling(int theScaling) {
+void
+VISU_IsoSurfacesPL
+::SetScaling(int theScaling)
+{
VISU_ScalarMapPL::SetScaling(theScaling);
SetRange(myRange);
}
-void VISU_IsoSurfacesPL::SetRange(float theRange[2]){
+void
+VISU_IsoSurfacesPL
+::SetRange(vtkFloatingPointType theRange[2])
+{
if(theRange[0] <= theRange[1]){
myRange[0] = theRange[0]; myRange[1] = theRange[1];
- float aRange[2] = {myRange[0], myRange[1]};
+ vtkFloatingPointType aRange[2] = {myRange[0], myRange[1]};
if(GetScaling() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(theRange,aRange);
myContourFilter->GenerateValues(GetNbParts(),aRange);
Modified();
}
}
-float VISU_IsoSurfacesPL::GetMin() {
+
+vtkFloatingPointType
+VISU_IsoSurfacesPL
+::GetMin()
+{
return myRange[0];
}
-float VISU_IsoSurfacesPL::GetMax() {
+
+vtkFloatingPointType
+VISU_IsoSurfacesPL
+::GetMax()
+{
return myRange[1];
}
-void VISU_IsoSurfacesPL::Init(){
+void
+VISU_IsoSurfacesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
SetNbParts(10);
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
SetRange(aScalarRange);
}
-VISU_ScalarMapPL::THook* VISU_IsoSurfacesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_IsoSurfacesPL
+::DoHook()
+{
VISU::CellDataToPoint(myContourFilter,myCellDataToPointData,GetInput2(),myFieldTransform);
return myContourFilter->GetOutput();
}
-void VISU_IsoSurfacesPL::Update()
+void
+VISU_IsoSurfacesPL
+::Update()
{
VISU_ScalarMapPL::Update();
}
-void VISU_IsoSurfacesPL::SetMapScale(float theMapScale){
+void
+VISU_IsoSurfacesPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
- float aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
- float aNewRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()};
+ vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]};
if(GetScaling() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aNewRange);
myContourFilter->GenerateValues(GetNbParts(),aNewRange);
class vtkContourFilter;
class vtkCellDataToPointData;
-class VISU_IsoSurfacesPL : public VISU_ScalarMapPL{
+class VISU_IsoSurfacesPL : public VISU_ScalarMapPL
+{
protected:
VISU_IsoSurfacesPL();
VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);
+
+ virtual
+ ~VISU_IsoSurfacesPL();
+
public:
vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL);
- static VISU_IsoSurfacesPL* New();
- virtual ~VISU_IsoSurfacesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual int GetNbParts();
- virtual void SetNbParts(int theNb = 10);
+ static
+ VISU_IsoSurfacesPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ int
+ GetNbParts();
+
+ virtual
+ void
+ SetNbParts(int theNb = 10);
+
+ virtual
+ void
+ SetScaling(int theScaling = VTK_SCALE_LINEAR);
- virtual void SetScaling(int theScaling = VTK_SCALE_LINEAR);
- virtual void SetRange(float theRange[2]);
- virtual float GetMin();
- virtual float GetMax();
+ virtual
+ void
+ SetRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ vtkFloatingPointType
+ GetMin();
+
+ virtual
+ vtkFloatingPointType
+ GetMax();
public:
- virtual void Init();
- virtual void Update();
- virtual THook* DoHook();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ THook*
+ DoHook();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
int myNbParts;
- float myRange[2];
+ vtkFloatingPointType myRange[2];
vtkCellDataToPointData* myCellDataToPointData;
vtkContourFilter *myContourFilter;
};
using namespace std;
-VISU_LookupTable *VISU_LookupTable::New() {
- vtkObject* ret = vtkObjectFactory::CreateInstance("VISU_LookupTable");
- if(ret)
- return (VISU_LookupTable*)ret;
- return new VISU_LookupTable;
-}
+vtkStandardNewMacro(VISU_LookupTable);
-VISU_LookupTable::VISU_LookupTable(int sze, int ext)
- : vtkLookupTable(sze, ext), myScale(1.0), myBicolor(false) {}
+VISU_LookupTable
+::VISU_LookupTable(int sze, int ext):
+ vtkLookupTable(sze, ext),
+ myScale(1.0),
+ myBicolor(false)
+{}
-void VISU_LookupTable::SetMapScale(float theScale)
+void
+VISU_LookupTable
+::SetMapScale(vtkFloatingPointType theScale)
{
if( myScale != theScale )
{
}
-int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){
+int
+VISU_LookupTable
+::ComputeLogRange(vtkFloatingPointType inRange[2],
+ vtkFloatingPointType outRange[2])
+{
if(inRange[0] >= inRange[1])
return -1;
if(0.0 <= inRange[0] && 0.0 < inRange[1]){
return -1;
}
-unsigned char* VISU_LookupTable::MapValue(float v) {
+unsigned char*
+VISU_LookupTable
+::MapValue(vtkFloatingPointType v)
+{
if(GetScale() == VTK_SCALE_LOG10) {
- float aLowBound = log10(this->TableRange[0]);
+ vtkFloatingPointType aLowBound = log10(this->TableRange[0]);
v = pow(10.0f,aLowBound + (v - aLowBound)*myScale);
return vtkLookupTable::MapValue(v);
} else if (!myBicolor) {
}
// Apply log to value, with appropriate constraints.
-inline float VISU_ApplyLogScale(float v, float range[2],
- float logRange[2])
+inline
+vtkFloatingPointType
+VISU_ApplyLogScale(vtkFloatingPointType v,
+ vtkFloatingPointType range[2],
+ vtkFloatingPointType logRange[2])
{
// is the range set for negative numbers?
if (range[0] < 0)
}
// Apply shift/scale to the scalar value v and do table lookup.
-inline unsigned char *VISU_LinearLookup(float v,
- unsigned char *table,
- float maxIndex,
- float shift, float scale,
- bool bicolor)
+inline
+unsigned char *
+VISU_LinearLookup(vtkFloatingPointType v,
+ unsigned char *table,
+ vtkFloatingPointType maxIndex,
+ vtkFloatingPointType shift,
+ vtkFloatingPointType scale,
+ bool bicolor)
{
if( !bicolor )
{
- float findx = (v + shift)*scale;
+ vtkFloatingPointType findx = (v + shift)*scale;
if (findx < 0)
findx = 0;
if (findx > maxIndex)
// accelerate the mapping by copying the data in 32-bit chunks instead
// of 8-bit chunks
template<class T>
-void VISU_LookupTableMapData(vtkLookupTable *self, T *input,
- unsigned char *output, int length,
- int inIncr, int outFormat,
- float theMapScale, bool bicolor)
+void
+VISU_LookupTableMapData(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
int i = length;
- float *range = self->GetTableRange();
- float maxIndex = self->GetNumberOfColors() - 1;
- float shift, scale;
+ vtkFloatingPointType *range = self->GetTableRange();
+ vtkFloatingPointType maxIndex = self->GetNumberOfColors() - 1;
+ vtkFloatingPointType shift, scale;
unsigned char *table = self->GetPointer(0);
unsigned char *cptr;
- float alpha;
+ vtkFloatingPointType alpha;
if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required
{
if (self->GetScale() == VTK_SCALE_LOG10)
{
- float val;
- float logRange[2];
+ vtkFloatingPointType val;
+ vtkFloatingPointType logRange[2];
VISU_LookupTable::ComputeLogRange(range, logRange);
shift = -logRange[0];
if (logRange[1] <= logRange[0])
{
if (self->GetScale() == VTK_SCALE_LOG10)
{
- float val;
- float logRange[2];
+ vtkFloatingPointType val;
+ vtkFloatingPointType logRange[2];
VISU_LookupTable::ComputeLogRange(range, logRange);
shift = -logRange[0];
if (logRange[1] <= logRange[0])
// it is only done on the first render. Colors are cached
// for subsequent renders.
template<class T>
-void VISU_LookupTableMapMag(vtkLookupTable *self, T *input,
- unsigned char *output, int length,
- int inIncr, int outFormat,
- float theMapScale, bool bicolor)
+void
+VISU_LookupTableMapMag(vtkLookupTable *self,
+ T *input,
+ unsigned char *output,
+ int length,
+ int inIncr,
+ int outFormat,
+ vtkFloatingPointType theMapScale,
+ bool bicolor)
{
double tmp, sum;
double *mag;
int inputDataType, int numberOfValues,
int inputIncrement, int outputIncrement);
- float GetMapScale() { return myScale; }
- void SetMapScale(float theScale = 1.0);
+ vtkFloatingPointType GetMapScale() { return myScale; }
+ void SetMapScale(vtkFloatingPointType theScale = 1.0);
- float GetBicolor() { return myBicolor; }
+ bool GetBicolor() { return myBicolor; }
void SetBicolor( bool theBicolor );
- static int ComputeLogRange(float inRange[2], float outRange[2]);
- unsigned char *MapValue(float v);
+ static int ComputeLogRange(vtkFloatingPointType inRange[2], vtkFloatingPointType outRange[2]);
+ unsigned char *MapValue(vtkFloatingPointType v);
protected:
VISU_LookupTable(int sze=256, int ext=256);
~VISU_LookupTable() {};
- float myScale;
+ vtkFloatingPointType myScale;
bool myBicolor;
};
//-----------------------------------------------------------------------------
float ViewToDisplay( vtkRenderer* theRenderer )
{
- float p1[3], p2[3];
+ vtkFloatingPointType p1[3], p2[3];
theRenderer->SetViewPoint( 0.0, 0.0, 0.0 );
theRenderer->ViewToDisplay();
theRenderer->ViewToDisplay();
theRenderer->GetDisplayPoint( p2 );
- float coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 );
+ vtkFloatingPointType coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 );
//cout << p1[0] << " " << p1[1] << " " << p1[2] << endl;
//cout << p2[0] << " " << p2[1] << " " << p2[2] << endl;
//cout << "ZOOM : " << coefficient << endl;
TVertex* aVertexArr = new TVertex[ this->TotalCells ];
- float* aPropertyColor = theActor->GetProperty()->GetColor();
+ vtkFloatingPointType* aPropertyColor = theActor->GetProperty()->GetColor();
float aColor[3] = {aPropertyColor[0], aPropertyColor[1], aPropertyColor[2]};
unsigned long i = 0;
{
TVertex& aVertex = aVertexArr[i];
vtkIdType aPointId = pts[0];
- float* aCoords = thePoints->GetPoint( aPointId );
+ vtkFloatingPointType* aCoords = thePoints->GetPoint( aPointId );
aVertex.vx = aCoords[0];
aVertex.vy = aCoords[1];
aVertex.vz = aCoords[2];
int
VISU_PipeLine
-::CheckAvailableMemory(const float& theSize)
+::CheckAvailableMemory(const vtkFloatingPointType& theSize)
{
try{
if(theSize > ULONG_MAX) return 0;
return 0;
}
-float
+vtkFloatingPointType
VISU_PipeLine
-::GetAvailableMemory(float theSize,
- float theMinSize)
+::GetAvailableMemory(vtkFloatingPointType theSize,
+ vtkFloatingPointType theMinSize)
{
while(!CheckAvailableMemory(theSize))
if(theSize > theMinSize)
static
void
ComputeBoundsParam (vtkDataSet* theDataSet,
- float theDirection[3],
- float theMinPnt[3],
- float& theMaxBoundPrj,
- float& theMinBoundPrj)
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj,
+ vtkFloatingPointType& theMinBoundPrj)
{
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
//Enlarge bounds in order to avoid conflicts of precision
for(int i = 0; i < 6; i += 2){
static double EPS = 1.0E-3;
- float aDelta = (aBounds[i+1] - aBounds[i])*EPS;
+ vtkFloatingPointType aDelta = (aBounds[i+1] - aBounds[i])*EPS;
aBounds[i] -= aDelta;
aBounds[i+1] += aDelta;
}
- float aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
- {aBounds[1],aBounds[2],aBounds[4]},
- {aBounds[0],aBounds[3],aBounds[4]},
- {aBounds[1],aBounds[3],aBounds[4]},
- {aBounds[0],aBounds[2],aBounds[5]},
- {aBounds[1],aBounds[2],aBounds[5]},
- {aBounds[0],aBounds[3],aBounds[5]},
- {aBounds[1],aBounds[3],aBounds[5]}};
+ vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
+ {aBounds[1],aBounds[2],aBounds[4]},
+ {aBounds[0],aBounds[3],aBounds[4]},
+ {aBounds[1],aBounds[3],aBounds[4]},
+ {aBounds[0],aBounds[2],aBounds[5]},
+ {aBounds[1],aBounds[2],aBounds[5]},
+ {aBounds[0],aBounds[3],aBounds[5]},
+ {aBounds[1],aBounds[3],aBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
theMinBoundPrj = theMaxBoundPrj;
for(int i = 1; i < 8; i++){
- float aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]);
+ vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]);
if(theMaxBoundPrj < aTmp){
theMaxBoundPrj = aTmp;
aMaxId = i;
aMinId = i;
}
}
- float *aMinPnt = aBoundPoints[aMaxId];
+ vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId];
theMinPnt[0] = aMinPnt[0];
theMinPnt[1] = aMinPnt[1];
theMinPnt[2] = aMinPnt[2];
static
void
DistanceToPosition(vtkDataSet* theDataSet,
- float theDirection[3],
- float theDist,
- float thePos[3])
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType theDist,
+ vtkFloatingPointType thePos[3])
{
- float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
+ vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
- float aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist;
+ vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist;
thePos[0] = aMinPnt[0]-theDirection[0]*aLength;
thePos[1] = aMinPnt[1]-theDirection[1]*aLength;
thePos[2] = aMinPnt[2]-theDirection[2]*aLength;
static
void
PositionToDistance (vtkDataSet* theDataSet,
- float theDirection[3],
- float thePos[3],
- float& theDist)
+ vtkFloatingPointType theDirection[3],
+ vtkFloatingPointType thePos[3],
+ vtkFloatingPointType& theDist)
{
- float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
+ vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
- float aPrj = vtkMath::Dot(theDirection,thePos);
+ vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos);
theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj);
}
void
VISU_PipeLine
-::SetPlaneParam(float theDir[3],
- float theDist,
+::SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
vtkPlane* thePlane)
{
thePlane->SetNormal(theDir);
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
::DistanceToPosition(GetInput(),theDir,theDist,anOrigin);
thePlane->SetOrigin(anOrigin);
}
void
VISU_PipeLine
-::GetPlaneParam(float theDir[3],
- float& theDist,
+::GetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType& theDist,
vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
thePlane->GetOrigin(anOrigin);
::PositionToDistance(GetInput(),theDir,anOrigin,theDist);
}
VISU_PipeLine
::IsPlanarInput() const
{
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
GetInput()->GetBounds( aBounds ); // xmin,xmax, ymin,ymax, zmin,zmax
if (fabs( aBounds[0] - aBounds[1] ) <= FLT_MIN ||
fabs( aBounds[2] - aBounds[3] ) <= FLT_MIN ||
return myExtractGeometry->GetNodeVTKId(anID);
}
-float*
+vtkFloatingPointType*
VISU_PipeLine
::GetNodeCoord(int theObjID)
{
static
int
- CheckAvailableMemory(const float& theSize);
+ CheckAvailableMemory(const vtkFloatingPointType& theSize);
static
- float
- GetAvailableMemory(float theSize = 16*1024*1024.0,
- float theMinSize = 1024*1024.0);
+ vtkFloatingPointType
+ GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0,
+ vtkFloatingPointType theMinSize = 1024*1024.0);
// Clipping planes
void
GetClippingPlane(vtkIdType theID) const;
void
- SetPlaneParam(float theDir[3],
- float theDist,
+ SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
vtkPlane* thePlane);
void
- GetPlaneParam(float theDir[3],
- float& theDist,
+ GetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType& theDist,
vtkPlane* thePlane);
bool
GetNodeVTKID(vtkIdType theID);
virtual
- float*
+ vtkFloatingPointType*
GetNodeCoord(vtkIdType theObjID);
virtual
#include "VISU_PipeLineUtils.hxx"
-void VISU::Mul(const float A[3], float b, float C[3]){ // A*b;
+void
+VISU::Mul(const vtkFloatingPointType A[3],
+ vtkFloatingPointType b,
+ vtkFloatingPointType C[3])
+{ // A*b;
for(int i = 0; i < 3; i++) C[i] = A[i]*b;
}
-void VISU::Sub(const float A[3], const float B[3], float C[3]){ //A-B
+void
+VISU::Sub(const vtkFloatingPointType A[3],
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3])
+{ //A-B
for(int i = 0; i < 3; i++) C[i] = A[i] - B[i];
}
#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
+namespace VISU
+{
+ void
+ Mul(const vtkFloatingPointType A[3],
+ vtkFloatingPointType b,
+ vtkFloatingPointType C[3]); // C = A * b
+
+ void
+ Sub(const vtkFloatingPointType A[3],
+ const vtkFloatingPointType B[3],
+ vtkFloatingPointType C[3]); // C = A - B
template<class TItem>
void
#include <vtkRenderWindow.h>
static
- bool IsValidPlane2Position(vtkPlane *pPx,
- vtkDataSet *pDataSet,
- float aTol=0.003);
+bool
+IsValidPlane2Position(vtkPlane *pPx,
+ vtkDataSet *pDataSet,
+ vtkFloatingPointType aTol=0.003);
static
- void GetBndPoints(vtkDataSet *pDataSet,
- float aPnts[24]);
+void
+GetBndPoints(vtkDataSet *pDataSet,
+ vtkFloatingPointType aPnts[24]);
static
- float DistanceToPlane(const float x[3],
- const float n[3],
- const float p0[3]);
+vtkFloatingPointType
+DistanceToPlane(const vtkFloatingPointType x[3],
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3]);
vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$");
vtkStandardNewMacro(VISU_PlanesWidget);
this->Transform = vtkTransform::New();
// Define the point coordinates
- float bounds[6];
+ vtkFloatingPointType bounds[6];
bounds[0] = -0.5;
bounds[1] = 0.5;
bounds[2] = -0.5;
// function: SetDistance
// purpose :
//==================================================================
-void VISU_PlanesWidget::SetDistance(const float theDistance)
+void
+VISU_PlanesWidget
+::SetDistance(const vtkFloatingPointType theDistance)
{
if( theDistance <= 0.0 || theDistance == myDistance )
return;
myDistance=theDistance;
//
- float *origin, *normal, oNew[3], aN2[3];
+ vtkFloatingPointType *origin, *normal, oNew[3], aN2[3];
origin = myPlane1->GetOrigin();
normal = myPlane1->GetNormal();
vtkMath::Normalize(normal);
// function: Distance
// purpose :
//==================================================================
-float VISU_PlanesWidget::Distance()const
+vtkFloatingPointType
+VISU_PlanesWidget
+::Distance() const
{
return myDistance;
}
{
//Get the motion vector
int i;
- float v[3];
+ vtkFloatingPointType v[3];
//
for (i=0; i<3; ++i){
v[i] = p2[i] - p1[i];
}
//
- float aOr1[3], aNr1[3], aNr2[3], aD, z1;
+ vtkFloatingPointType aOr1[3], aNr1[3], aNr2[3], aD, z1;
//
myPlane1->GetOrigin(aOr1);
myPlane1->GetNormal(aNr1);
}
//
//Add to the current point, project back down onto plane
- float *o = myPlane1->GetOrigin();
- float *n = myPlane1->GetNormal();
- float newOrigin[3];
+ vtkFloatingPointType *o = myPlane1->GetOrigin();
+ vtkFloatingPointType *n = myPlane1->GetNormal();
+ vtkFloatingPointType newOrigin[3];
//
for (i=0; i<3; ++i){
newOrigin[i]=o[i] + v[i];
// function: SetOriginInternal
// purpose : Set the origin of the plane.(for Internal calls)
//==================================================================
-void VISU_PlanesWidget::SetOriginInternal(float x[3])
+void VISU_PlanesWidget::SetOriginInternal(vtkFloatingPointType x[3])
{
- float *bounds = this->myOutline->GetOutput()->GetBounds();
+ vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds();
int i, j;
for (i=0; i<3; ++i) {
j=2*i;
}
//
bool bFlag;
- float aOr2[3], aNr2[3], aNr1[3];
+ vtkFloatingPointType aOr2[3], aNr2[3], aNr1[3];
vtkPlane *pPx;
//
myPlane1->GetNormal(aNr1);
v[i] = p2[i] - p1[i];
}
//
- float *origin = myPlane1->GetOrigin();
- float *normal = myPlane1->GetNormal();
+ vtkFloatingPointType *origin = myPlane1->GetOrigin();
+ vtkFloatingPointType *normal = myPlane1->GetNormal();
// Create axis of rotation and angle of rotation
vtkMath::Cross(vpn,v,axis);
this->Transform->Translate(-origin[0],-origin[1],-origin[2]);
//Set the new normal
- float nNew[3], aN2[3], oNew[3];
+ vtkFloatingPointType nNew[3], aN2[3], oNew[3];
this->Transform->TransformNormal(normal,nNew);
//
for (i=0; i<3; ++i){
void VISU_PlanesWidget::PushDistance(double *p1, double *p2)
{
int i;
- float v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD;
+ vtkFloatingPointType v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD;
//Get the motion vector
for (i=0; i<3; ++i){
v[i] = p2[i] - p1[i];
vtkMath::Normalize(aN1);
- float origin[3];
+ vtkFloatingPointType origin[3];
double distance = vtkMath::Dot( v, aN2 );
for(i=0; i<3; ++i) {
origin[i] = anOrigin2[i] + distance * aN2[i];
}
- float d = DistanceToPlane(origin, aN1, anOrigin1);
+ vtkFloatingPointType d = DistanceToPlane(origin, aN1, anOrigin1);
if( d <= 0.0 )
return;
//
bool bFlag;
- float aOr2[3], aNr2[3];
+ vtkFloatingPointType aOr2[3], aNr2[3];
vtkPlane *pPx;
//
myPlane2->GetOrigin(aOr2);
v[2] = p2[2] - p1[2];
//Translate the plane
- float oNew[3];
- float *origin = myPlane1->GetOrigin();
+ vtkFloatingPointType oNew[3];
+ vtkFloatingPointType *origin = myPlane1->GetOrigin();
oNew[0] = origin[0] + v[0];
oNew[1] = origin[1] + v[1];
oNew[2] = origin[2] + v[2];
v[2] = p2[2] - p1[2];
//Translate the bounding box
- float *origin = myBox->GetOrigin();
- float oNew[3];
+ vtkFloatingPointType *origin = myBox->GetOrigin();
+ vtkFloatingPointType oNew[3];
oNew[0] = origin[0] + v[0];
oNew[1] = origin[1] + v[1];
oNew[2] = origin[2] + v[2];
v[2] = p2[2] - p1[2];
//int res = this->PlaneSource->GetXResolution();
- float *o = myPlane1->GetOrigin();
+ vtkFloatingPointType *o = myPlane1->GetOrigin();
// Compute the scale factor
- float sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength();
+ vtkFloatingPointType sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength();
if ( Y > this->Interactor->GetLastEventPosition()[1] ) {
sf = 1.0 + sf;
}
this->Transform->Scale(sf,sf,sf);
this->Transform->Translate(-o[0],-o[1],-o[2]);
- float *origin = myBox->GetOrigin();
- float *spacing = myBox->GetSpacing();
- float oNew[3], p[3], pNew[3];
+ vtkFloatingPointType *origin = myBox->GetOrigin();
+ vtkFloatingPointType *spacing = myBox->GetSpacing();
+ vtkFloatingPointType oNew[3], p[3], pNew[3];
p[0] = origin[0] + spacing[0];
p[1] = origin[1] + spacing[1];
p[2] = origin[2] + spacing[2];
// function: InitialPlaceWidget
// purpose :
//==================================================================
-void VISU_PlanesWidget::InitialPlaceWidget(float bds[6])
+void VISU_PlanesWidget::InitialPlaceWidget(vtkFloatingPointType bds[6])
{
- float bounds[6], origin[3];
+ vtkFloatingPointType bounds[6], origin[3];
PlaceWidget(bds);
//
(bounds[3]+bounds[2])/2.0,
(bounds[5]+bounds[4])/2.0);
- static float DIST_COEFF = 0.1;
+ static vtkFloatingPointType DIST_COEFF = 0.1;
SetDistance(this->InitialLength*DIST_COEFF);
//
this->UpdateRepresentation();
// function: PlaceWidget
// purpose :
//==================================================================
-void VISU_PlanesWidget::PlaceWidget(float bds[6])
+void VISU_PlanesWidget::PlaceWidget(vtkFloatingPointType bds[6])
{
int i;
- float bounds[6], origin[3];
+ vtkFloatingPointType bounds[6], origin[3];
this->AdjustBounds(bds, bounds, origin);
// function: SetOrigin
// purpose :Set the origin of the plane.(for external calls)
//==================================================================
-void VISU_PlanesWidget::SetOrigin(float x, float y, float z)
+void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z)
{
- float origin[3];
+ vtkFloatingPointType origin[3];
origin[0] = x;
origin[1] = y;
origin[2] = z;
// function: SetOrigin
// purpose : Set the origin of the plane.(for external calls)
//==================================================================
-void VISU_PlanesWidget::SetOrigin(float x[3])
+void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x[3])
{
- float *bounds = this->myOutline->GetOutput()->GetBounds();
+ vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds();
for (int i=0; i<3; i++) {
if ( x[i] < bounds[2*i] ) {
x[i] = bounds[2*i];
}
}
myPlane1->SetOrigin(x);
- float *origin, *normal, oNew[3];
+ vtkFloatingPointType *origin, *normal, oNew[3];
origin = myPlane1->GetOrigin();
normal = myPlane1->GetNormal();
vtkMath::Normalize(normal);
// function: GetOrigin
// purpose :Get the origin of the plane.
//==================================================================
-float* VISU_PlanesWidget::GetOrigin()
+vtkFloatingPointType* VISU_PlanesWidget::GetOrigin()
{
return myPlane1->GetOrigin();
}
-void VISU_PlanesWidget::GetOrigin(float xyz[3])
+void VISU_PlanesWidget::GetOrigin(vtkFloatingPointType xyz[3])
{
myPlane1->GetOrigin(xyz);
}
// function: SetNormal
// purpose :Set the normal to the plane.
//==================================================================
-void VISU_PlanesWidget::SetNormal(float x, float y, float z)
+void VISU_PlanesWidget::SetNormal(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z)
{
- float n[3];
+ vtkFloatingPointType n[3];
n[0] = x;
n[1] = y;
n[2] = z;
// function: SetNormal
// purpose :Set the normal to the plane.
//==================================================================
-void VISU_PlanesWidget::SetNormal(float n[3])
+void VISU_PlanesWidget::SetNormal(vtkFloatingPointType n[3])
{
this->SetNormal(n[0], n[1], n[2]);
}
// function: GetNormal
// purpose :Get the normal to the plane.
//==================================================================
-float* VISU_PlanesWidget::GetNormal()
+vtkFloatingPointType* VISU_PlanesWidget::GetNormal()
{
return myPlane1->GetNormal();
}
// function: GetNormal
// purpose :Get the normal to the plane.
//==================================================================
-void VISU_PlanesWidget::GetNormal(float xyz[3])
+void VISU_PlanesWidget::GetNormal(vtkFloatingPointType xyz[3])
{
myPlane1->GetNormal(xyz);
}
return;
}
- float *origin = myPlane1->GetOrigin();
- float *normal = myPlane1->GetNormal();
- float p2[3];
+ vtkFloatingPointType *origin = myPlane1->GetOrigin();
+ vtkFloatingPointType *normal = myPlane1->GetNormal();
+ vtkFloatingPointType p2[3];
// Setup the plane normal
- float d = this->myOutline->GetOutput()->GetLength();
+ vtkFloatingPointType d = this->myOutline->GetOutput()->GetLength();
p2[0] = origin[0] + 0.30 * d * normal[0];
p2[1] = origin[1] + 0.30 * d * normal[1];
//==================================================================
bool IsValidPlane2Position(vtkPlane *pPx,
vtkDataSet *pDataSet,
- float aTol)
+ vtkFloatingPointType aTol)
{
bool bRet;
int i, iFound;
- float aD, aDmax, aPnts[24], aDiagonal;
- float aTol1, aOr[3], aN[3];
+ vtkFloatingPointType aD, aDmax, aPnts[24], aDiagonal;
+ vtkFloatingPointType aTol1, aOr[3], aN[3];
//
bRet=false;
aDiagonal=pDataSet->GetLength();
// function: GetBndPoints
// purpose :
//==================================================================
-void GetBndPoints(vtkDataSet *pDataSet,
- float aPnts[24])
+void
+GetBndPoints(vtkDataSet *pDataSet,
+ vtkFloatingPointType aPnts[24])
{
- int aIndx[24]={
+ int aIndx[24] = {
0,2,4,1,2,4,1,3,4,0,3,4,
0,2,5,1,2,5,1,3,5,0,3,5
};
int i;
- float *pBounds=pDataSet->GetBounds();
+ vtkFloatingPointType *pBounds=pDataSet->GetBounds();
//
for (i=0; i<24; ++i){
aPnts[i]=pBounds[aIndx[i]];
// function: DistanceToPlane
// purpose :
//==================================================================
-float DistanceToPlane(const float x[3],
- const float n[3],
- const float p0[3])
+vtkFloatingPointType
+DistanceToPlane(const vtkFloatingPointType x[3],
+ const vtkFloatingPointType n[3],
+ const vtkFloatingPointType p0[3])
{
- return ((float) (n[0]*(x[0]-p0[0]) +
- n[1]*(x[1]-p0[1]) +
- n[2]*(x[2]-p0[2])));
+ return ((n[0]*(x[0]-p0[0]) +
+ n[1]*(x[1]-p0[1]) +
+ n[2]*(x[2]-p0[2])));
}
/*
//==================================================================
//==================================================================
void VISU_PlanesWidget::SizeHandles()
{
- // float radius =
+ // vtkFloatingPointType radius =
this->vtk3DWidget::SizeHandles(1.35);
}
*/
vtkTypeRevisionMacro(VISU_PlanesWidget,VISU_ImplicitFunctionWidget);
void PrintSelf(ostream& os, vtkIndent indent);
- void SetDistance (const float theDistance);
- float Distance()const;
+ void
+ SetDistance(const vtkFloatingPointType theDistance);
- vtkGetMacro(InitialLength,float);
+ vtkFloatingPointType
+ Distance() const;
- virtual vtkImplicitFunction* ImplicitFunction();
+ vtkGetMacro(InitialLength,vtkFloatingPointType);
+
+ virtual
+ vtkImplicitFunction*
+ ImplicitFunction();
// Description:
// Methods that satisfy the superclass' API.
- virtual void SetEnabled(int);
- virtual void PlaceWidget(float bounds[6]);
+ virtual
+ void
+ SetEnabled(int);
+
+ virtual
+ void
+ PlaceWidget(vtkFloatingPointType bounds[6]);
// Description:
// Get the origin of the plane.
- void SetOrigin(float x, float y, float z);
- void SetOrigin(float x[3]);
- float* GetOrigin();
- void GetOrigin(float xyz[3]);
+ void
+ SetOrigin(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+
+ void
+ SetOrigin(vtkFloatingPointType x[3]);
+
+ vtkFloatingPointType*
+ GetOrigin();
+
+ void
+ GetOrigin(vtkFloatingPointType xyz[3]);
// Description:
// Get the normal to the plane.
- void SetNormal(float x, float y, float z);
- void SetNormal(float x[3]);
- float* GetNormal();
- void GetNormal(float xyz[3]);
+ void
+ SetNormal(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+
+ void
+ SetNormal(vtkFloatingPointType x[3]);
+
+ vtkFloatingPointType*
+ GetNormal();
+
+ void
+ GetNormal(vtkFloatingPointType xyz[3]);
// Description:
// Force the plane widget to be aligned with one of the x-y-z axes.
// Remember that when the state changes, a ModifiedEvent is invoked.
// This can be used to snap the plane to the axes if it is orginally
// not aligned.
- void SetNormalToXAxis(int);
+ void
+ SetNormalToXAxis(int);
+
vtkGetMacro(NormalToXAxis,int);
vtkBooleanMacro(NormalToXAxis,int);
- void SetNormalToYAxis(int);
+
+ void
+ SetNormalToYAxis(int);
+
vtkGetMacro(NormalToYAxis,int);
vtkBooleanMacro(NormalToYAxis,int);
- void SetNormalToZAxis(int);
+
+ void
+ SetNormalToZAxis(int);
vtkGetMacro(NormalToZAxis,int);
vtkBooleanMacro(NormalToZAxis,int);
// interferes with the object that it is operating on (i.e., the
// plane interferes with the cut surface it produces producing
// z-buffer artifacts.)
- void SetDrawPlane(int plane);
- int GetDrawPlane(){
+ void
+ SetDrawPlane(int plane);
+
+ int
+ GetDrawPlane()
+ {
return myDrawPlane;
}
// Description:
// Grab the polydata that defines the plane. The polydata contains a single
// polygon that is clipped by the bounding box.
- void GetPolyData(vtkPolyData *pd);
+ void
+ GetPolyData(vtkPolyData *pd);
// Description:
// Satisfies superclass API. This returns a pointer to the underlying
// instance of the class vtkPlane. Note that vtkPlane is a subclass of
// vtkImplicitFunction, meaning that it can be used by a variety of filters
// to perform clipping, cutting, and selection of data.
- void GetPlane(vtkPlane *plane);
+ void
+ GetPlane(vtkPlane *plane);
// Description:
// Satisfies the superclass API. This will change the state of the widget
// to match changes that have been made to the underlying PolyDataSource
- void UpdatePlacement(void);
+ void
+ UpdatePlacement(void);
// Description:
// Get the properties on the normal (line and cone).
// applies to the edges when tubed.)
vtkGetObjectMacro(EdgesProperty,vtkProperty);
- void InitialPlaceWidget(float bds[6]);
+ void
+ InitialPlaceWidget(vtkFloatingPointType bds[6]);
protected:
VISU_PlanesWidget();
//ETX
//handles the events
- static void ProcessEvents(vtkObject* object, unsigned long event,
- void* clientdata, void* calldata);
+ static
+ void
+ ProcessEvents(vtkObject* object, unsigned long event,
+ void* clientdata, void* calldata);
// ProcessEvents() dispatches to these methods.
void OnLeftButtonDown();
void OnMouseMove();
//
// Methods to manipulate the plane
- void ConstrainOrigin(float x[3]);
+ void ConstrainOrigin(vtkFloatingPointType x[3]);
void Rotate(int X, int Y, double *p1, double *p2, double *vpn);
void TranslatePlane(double *p1, double *p2);
void TranslateOutline(double *p1, double *p2);
void HighlightNormal(int highlight);
void HighlightOutline(int highlight);
void UpdateRepresentation();
- void SetOriginInternal(float x[3]);
+ void SetOriginInternal(vtkFloatingPointType x[3]);
// Controlling ivars
int NormalToXAxis;
vtkPlane *myPlane1;
vtkPlane *myPlane2;
- float myDistance;
+ vtkFloatingPointType myDistance;
vtkImplicitBoolean *myImplicitFunction;
// The bounding box is represented by a single voxel image data
{
theDataSet->Update();
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
- float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
+ vtkFloatingPointType aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]};
if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2])
if(aDelta[1] >= aDelta[2])
return VISU_CutPlanesPL::XY;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetScaleFactor(vtkDataSet* theDataSet)
{
theDataSet->Update();
- float aLength = theDataSet->GetLength(); // diagonal length
+ vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
- static float EPS = 0.3;
- float aRange = aScalarRange[1];
+ static vtkFloatingPointType EPS = 0.3;
+ vtkFloatingPointType aRange = aScalarRange[1];
if(aRange > 0.0)
return aLength / aRange * EPS;
VISU_Plot3DPL::
Update()
{
- float aPlaneNormal[3];
- float anOrigin[3];
+ vtkFloatingPointType aPlaneNormal[3];
+ vtkFloatingPointType anOrigin[3];
GetBasePlane( anOrigin, aPlaneNormal );
vtkPolyData* aPolyData = 0;
}else
myContourFilter->SetInput(aPolyData);
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange);
void
VISU_Plot3DPL::
-SetScaleFactor(float theScaleFactor)
+SetScaleFactor(vtkFloatingPointType theScaleFactor)
{
myScaleFactor = theScaleFactor;
myWarpScalar->SetScaleFactor(theScaleFactor);
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetScaleFactor() const
{
void
VISU_Plot3DPL::
-SetPlanePosition(float thePosition,
+SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative)
{
myIsRelative = theIsRelative;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetRotateX()
{
return 0;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetRotateY(){
switch(myOrientation){
void
VISU_Plot3DPL::
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- float theXAngle,
- float theYAngle)
+ vtkFloatingPointType theXAngle,
+ vtkFloatingPointType theYAngle)
{
switch(theOrientation){
case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break;
myOrientation = theOrientation;
}
-float
+vtkFloatingPointType
VISU_Plot3DPL::
GetPlanePosition() const
{
//purpose :
//=======================================================================
-void VISU_Plot3DPL::GetBasePlane(float theOrigin[3],
- float theNormal[3],
+void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
bool theCenterOrigine ) const
{
VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation);
- float aPosition = myPosition;
- float aBounds[6], aBoundPrj[3];
+ vtkFloatingPointType aPosition = myPosition;
+ vtkFloatingPointType aBounds[6], aBoundPrj[3];
if ( myIsRelative )
{
GetInput()->GetBounds(aBounds);
if ( theCenterOrigine ) {
// move theOrigin to the center of aBounds projections to the plane
GetInput2()->GetBounds(aBounds);
- float boundPoints[8][3] = {
+ vtkFloatingPointType boundPoints[8][3] = {
{aBounds[0],aBounds[2],aBounds[4]},
{aBounds[1],aBounds[2],aBounds[4]},
{aBounds[0],aBounds[3],aBounds[4]},
{aBounds[1],aBounds[2],aBounds[5]},
{aBounds[0],aBounds[3],aBounds[5]},
{aBounds[1],aBounds[3],aBounds[5]}};
- float newOrigin[3] = { 0,0,0 };
+ vtkFloatingPointType newOrigin[3] = { 0,0,0 };
for(int i = 0; i < 8; i++) {
- float proj[3];
+ vtkFloatingPointType proj[3];
vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj );
newOrigin[0] += proj[0];
newOrigin[1] += proj[1];
//purpose : return absolute position range
//=======================================================================
-void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const
+void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const
{
- float aBounds[6], aBoundPrj[3], aNormal[3];
+ vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3];
VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation);
GetInput()->GetBounds(aBounds);
VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal);
//purpose :
//=======================================================================
-void VISU_Plot3DPL::SetMapScale(float theMapScale)
+void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
if ( myIsContour ) {
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
- float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
+ vtkFloatingPointType aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] };
myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange);
}
myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale);
VISU_CutPlanesPL::PlaneOrientation
GetPlaneOrientation() const;
- float
+ vtkFloatingPointType
GetRotateX();
- float
+ vtkFloatingPointType
GetRotateY();
void
SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
- float theXAngle = 0.0,
- float theYAngle = 0.0);
+ vtkFloatingPointType theXAngle = 0.0,
+ vtkFloatingPointType theYAngle = 0.0);
- float
+ vtkFloatingPointType
GetPlanePosition() const;
bool
IsPositionRelative() const;
void
- SetPlanePosition(float thePosition,
+ SetPlanePosition(vtkFloatingPointType thePosition,
bool theIsRelative);
void
- SetScaleFactor(float theScaleFactor);
+ SetScaleFactor(vtkFloatingPointType theScaleFactor);
- float
+ vtkFloatingPointType
GetScaleFactor() const;
void
int
GetNumberOfContours() const;
- void GetBasePlane (float theOrigin[3],
- float theNormal[3],
+ void GetBasePlane (vtkFloatingPointType theOrigin[3],
+ vtkFloatingPointType theNormal[3],
bool theCenterOrigine = false ) const;
- void GetMinMaxPosition( float& minPos, float& maxPos ) const;
+ void GetMinMaxPosition( vtkFloatingPointType& minPos,
+ vtkFloatingPointType& maxPos ) const;
public:
virtual void Init();
VISU_CutPlanesPL::PlaneOrientation
GetOrientation(vtkDataSet* theDataSet);
- float
+ vtkFloatingPointType
GetScaleFactor(vtkDataSet* theDataSet);
- void SetMapScale(float theMapScale);
+ void SetMapScale(vtkFloatingPointType theMapScale);
protected:
virtual THook* DoHook();
- float myAngle[3];
+ vtkFloatingPointType myAngle[3];
bool myIsRelative, myIsContour;
- float myPosition, myScaleFactor;
+ vtkFloatingPointType myPosition, myScaleFactor;
VISU_CutPlanesPL::PlaneOrientation myOrientation;
TVTKSmartPtr<vtkCellDataToPointData> myCellDataToPointData;
// we hard code how many steps to display
int numColors = this->MaximumNumberOfColors;
- float *range = lut->GetRange();
+ vtkFloatingPointType *range = lut->GetRange();
int numPts = 2*(numColors + 1);
vtkPoints *pts = vtkPoints::New();
this->NumberOfLabelsBuilt = this->NumberOfLabels;
// generate points
- float x[3]; x[2] = 0.0;
- float delta, val;
+ vtkFloatingPointType x[3]; x[2] = 0.0;
+ vtkFloatingPointType delta, val;
if ( this->Orientation == VTK_ORIENT_VERTICAL )
{
barWidth = size[0] - 4 - labelSize[0];
barHeight = (int)(0.86*size[1]);
- delta=(float)barHeight/numColors;
+ delta=(vtkFloatingPointType)barHeight/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = 0;
{
barWidth = size[0];
barHeight = (int)(0.4*size[1]);
- delta=(float)barWidth/numColors;
+ delta=(vtkFloatingPointType)barWidth/numColors;
for (i=0; i<numPts/2; i++)
{
x[0] = i*delta;
polys->InsertNextCell(4,ptIds);
if ( isLogTable ){ //SALOME specific
- float rgbval = log10(range[0]) +
+ vtkFloatingPointType rgbval = log10(range[0]) +
i*(log10(range[1])-log10(range[0]))/(numColors -1);
rgba = lut->MapValue(rgbval);
}else{
rgba = lut->MapValue(range[0] + (range[1] - range[0])*
- ((float)i /(numColors-1.0)));
+ ((vtkFloatingPointType)i /(numColors-1.0)));
}
rgb = colors->GetPointer(3*i); //write into array directly
for (i=0; i < this->NumberOfLabels; i++)
{
- val = (float)i/(this->NumberOfLabels-1) *barHeight;
+ val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight;
this->TextMappers[i]->GetSize(viewport,sizeTextData);
this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft();
this->TextActors[i]->SetPosition(barWidth+3,
for (i=0; i < this->NumberOfLabels; i++)
{
this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered();
- val = (float)i/(this->NumberOfLabels-1) * barWidth;
+ val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth;
this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
}
}
void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size,
vtkViewport *viewport,
- float *range)
+ vtkFloatingPointType *range)
{
labelSize[0] = labelSize[1] = 0;
char string[512];
- float val;
+ vtkFloatingPointType val;
int i;
// TODO: this should be optimized, maybe by keeping a list of
this->TextMappers[i] = vtkTextMapper::New();
if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific
- float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) *
+ vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) *
(log10(range[1])-log10(range[0]));
val = pow(10,lval);
}else{
- val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
+ val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]);
}
sprintf(string, this->LabelFormat, val);
this->TextMappers[i]->SetInput(string);
vtkTextMapper **TextMappers;
virtual void AllocateAndSizeLabels(int *labelSize, int *size,
- vtkViewport *viewport, float *range);
+ vtkViewport *viewport, vtkFloatingPointType *range);
private:
vtkTextMapper *TitleMapper;
inline
void
MarkValueByColor(vtkLookupTable* theTable,
- float theValue,
+ vtkFloatingPointType theValue,
unsigned char* theColor)
{
vtkIdType anIndex = theTable->GetIndex(theValue);
unsigned char aRedPtr[3] = {255, 0, 0};
unsigned char aBluePtr[3] = {0, 0, 255};
- float aRange[2];
+ vtkFloatingPointType aRange[2];
theTable->GetTableRange(aRange);
vtkIdType aNbColors = theTable->GetNumberOfColors();
- float aDelta = (aRange[1]-aRange[0])/aNbColors;
- float aValue = aRange[0]+0.5*aDelta;
+ vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
+ vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
for(int i = 0; i < aNbColors; i++){
vtkIdType anIndex = theTable->GetIndex(aValue);
unsigned char* aTablePtr = theTable->GetPointer(anIndex);
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetRangeLocal(float *theRange)
+::SetRangeLocal(vtkFloatingPointType *theRange)
{
myLocalLookupTable->SetTableRange(theRange);
}
void
VISU_ScalarBarCtrl
-::SetRangeLocal(float theMin,
- float theMax)
+::SetRangeLocal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax)
{
myLocalLookupTable->SetTableRange(theMin,theMax);
}
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetRangeGlobal(float *theRange)
+::SetRangeGlobal(vtkFloatingPointType *theRange)
{
myGlobalLookupTable->SetTableRange(theRange);
}
void
VISU_ScalarBarCtrl
-::SetRangeGlobal(float theMin,
- float theMax)
+::SetRangeGlobal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax)
{
myGlobalLookupTable->SetTableRange(theMin,theMax);
}
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetWidth(float theWidth)
+::SetWidth(vtkFloatingPointType theWidth)
{
myGlobalScalarBar->SetWidth(theWidth);
myLocalScalarBar->SetWidth(theWidth);
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetWidth() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetHeight(float theHeight)
+::SetHeight(vtkFloatingPointType theHeight)
{
myGlobalScalarBar->SetHeight(theHeight);
myLocalScalarBar->SetHeight(theHeight);
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetHeight() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetPosition(const float* thePosition)
+::SetPosition(const vtkFloatingPointType* thePosition)
{
myPosition[0] = thePosition[0];
myPosition[1] = thePosition[1];
}
-const float*
+const vtkFloatingPointType*
VISU_ScalarBarCtrl::GetPosition() const
{
return myPosition;
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
{
myDistance = theSpacing;
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetSpacing() const
{
//----------------------------------------------------------------------------
void
VISU_ScalarBarCtrl
-::SetMarkValue(const float theValue)
+::SetMarkValue(const vtkFloatingPointType theValue)
{
myMarkedValue = theValue;
}
-float
+vtkFloatingPointType
VISU_ScalarBarCtrl
::GetMarkValue() const
{
}
}
if(myGlobalRangeIsDefined){
- float aLocalRange[2];
+ vtkFloatingPointType aLocalRange[2];
myLocalLookupTable->GetTableRange(aLocalRange);
MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack);
MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack);
vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate();
aCoordinate->SetCoordinateSystemToNormalizedViewport();
if(theScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL){
- float aWidth = theScalarBarActor->GetWidth();
+ vtkFloatingPointType aWidth = theScalarBarActor->GetWidth();
aCoordinate->SetValue(myPosition[0]+theId*(aWidth+myDistance), myPosition[1]);
}else{
- float aHeight = theScalarBarActor->GetHeight();
+ vtkFloatingPointType aHeight = theScalarBarActor->GetHeight();
aCoordinate->SetValue(myPosition[0], myPosition[1]+theId*(aHeight+myDistance));
}
// Initialize Lookup Tables and Scalar Bars
{
public:
vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject);
- static VISU_ScalarBarCtrl* New();
+ static
+ VISU_ScalarBarCtrl*
+ New();
enum EMode {eSimple, eGlobal, eLocal};
// Mode
- void SetMode(EMode theMode);
- EMode GetMode() const;
+ void
+ SetMode(EMode theMode);
+
+ EMode
+ GetMode() const;
// Ranges
- void SetRangeGlobal(float theMin,
- float theMax);
- void SetRangeGlobal(float *theRange);
+ void
+ SetRangeGlobal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax);
+ void
+ SetRangeGlobal(vtkFloatingPointType *theRange);
- void SetGlobalRangeIsDefined(bool theIsDefined);
+ void
+ SetGlobalRangeIsDefined(bool theIsDefined);
- void SetRangeLocal(float theMin,
- float theMax);
- void SetRangeLocal(float *theRange);
+ void
+ SetRangeLocal(vtkFloatingPointType theMin,
+ vtkFloatingPointType theMax);
+ void
+ SetRangeLocal(vtkFloatingPointType *theRange);
// Selectors
- vtkScalarBarActor* GetLocalBar();
- vtkLookupTable* GetLocalTable();
+ vtkScalarBarActor*
+ GetLocalBar();
+
+ vtkLookupTable*
+ GetLocalTable();
- vtkScalarBarActor* GetGlobalBar();
- vtkLookupTable* GetGlobalTable();
+ vtkScalarBarActor*
+ GetGlobalBar();
+
+ vtkLookupTable*
+ GetGlobalTable();
//
// Renderer
- void AddToRender(vtkRenderer* theRenderer);
- void RemoveFromRender(vtkRenderer* theRenderer);
+ void
+ AddToRender(vtkRenderer* theRenderer);
+
+ void
+ RemoveFromRender(vtkRenderer* theRenderer);
//
// Visibility
- void SetVisibility(int theFlag);
- int GetVisibility() const;
- //
+ void
+ SetVisibility(int theFlag);
+
+ int
+ GetVisibility() const;
+
// Visibility
- void SetCtrlVisibility(int theFlag);
- int GetCtrlVisibility() const;
- //
+ void
+ SetCtrlVisibility(int theFlag);
+
+ int
+ GetCtrlVisibility() const;
+
// Build
void Update();
- //
+
// Position
- void SetWidth(const float theWidth);
- float GetWidth()const;
- void SetHeight(const float theHeight);
- float GetHeight()const;
- void SetPosition(const float* thePosition);
- const float* GetPosition()const;
+ void
+ SetWidth(const vtkFloatingPointType theWidth);
+
+ vtkFloatingPointType
+ GetWidth() const;
+
+ void
+ SetHeight(const vtkFloatingPointType theHeight);
+
+ vtkFloatingPointType
+ GetHeight() const;
+
+ void
+ SetPosition(const vtkFloatingPointType* thePosition);
+
+ const vtkFloatingPointType*
+ GetPosition() const;
//
// Spacing
- void SetSpacing(const float theSpacing);
- float GetSpacing()const;
+ void
+ SetSpacing(const vtkFloatingPointType theSpacing);
+
+ vtkFloatingPointType
+ GetSpacing() const;
//
// Rainbow/bicolor
- bool GetBicolor() const;
- void SetBicolor(const bool theBicolor);
+ bool
+ GetBicolor() const;
+
+ void
+ SetBicolor(const bool theBicolor);
//
// Misc
- void SetMarkValue (const float theValue);
- float GetMarkValue ()const;
- void SetIsMarked(const bool theFlag);
- bool GetIsMarked()const;
+ void
+ SetMarkValue(const vtkFloatingPointType theValue);
+
+ vtkFloatingPointType
+ GetMarkValue() const;
+
+ void
+ SetIsMarked(const bool theFlag);
+
+ bool
+ GetIsMarked()const;
//
protected:
VISU_ScalarBarCtrl();
- virtual ~VISU_ScalarBarCtrl();
+
+ virtual
+ ~VISU_ScalarBarCtrl();
- void UpdateForBicolor();
- void UpdateForColor();
- void UpdateMarkValue();
- void PrepareTables();
+ void
+ UpdateForBicolor();
+
+ void
+ UpdateForColor();
+
+ void
+ UpdateMarkValue();
+
+ void
+ PrepareTables();
- void PrepareTables(vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable *theLookupTable,
- vtkIdType theId);
+ void
+ PrepareTables(vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable *theLookupTable,
+ vtkIdType theId);
protected:
EMode myMode;
bool myGlobalRangeIsDefined;
- float myDistance;
- float myPosition[2];
+ vtkFloatingPointType myDistance;
+ vtkFloatingPointType myPosition[2];
bool myBicolor;
int myCtrlVisibility;
unsigned char myGrey[3];
//
bool myMarked;
- float myMarkedValue;
+ vtkFloatingPointType myMarkedValue;
//
vtkScalarBarActor *myGlobalScalarBar;
vtkLookupTable *myGlobalLookupTable;
* Merge filter which unify the deformation and scalars
* \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
*/
-VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::VISU_ScalarMapOnDeformedShapePL()
+{
myDeformVectors = vtkWarpVector::New();
myMergeFilter = vtkMergeFilter::New();
myExtractorScalars = VISU_Extractor::New();
* Destructor.
* Delete all fields.
*/
-VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){
+VISU_ScalarMapOnDeformedShapePL
+::~VISU_ScalarMapOnDeformedShapePL()
+{
myDeformVectors->UnRegisterAllOutputs();
myDeformVectors->Delete();
/*!
* Initial method
*/
-void VISU_ScalarMapOnDeformedShapePL::Init(){
-
+void
+VISU_ScalarMapOnDeformedShapePL
+::Init()
+{
if (GetScalars() == NULL) SetScalars(GetInput2());
Superclass::Init();
- float aScalarRange[2];
+ vtkFloatingPointType aScalarRange[2];
GetSourceRange(aScalarRange);
static double EPS = 1.0 / VTK_LARGE_FLOAT;
if(aScalarRange[1] > EPS)
* Build method
* Building of deformation and puts result to merge filter.
*/
-void VISU_ScalarMapOnDeformedShapePL::Build()
+void
+VISU_ScalarMapOnDeformedShapePL
+::Build()
{
// Set input for extractor
myExtractor->SetInput(GetInput2());
/*!
* Update method
*/
-void VISU_ScalarMapOnDeformedShapePL::Update(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::Update()
+{
this->UpdateScalars();
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
- float aScalarRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
* Update scalars method.
* Put scalars to merge filter.
*/
-void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){
+void
+VISU_ScalarMapOnDeformedShapePL
+::UpdateScalars()
+{
if(myScalars->GetCellData()->GetVectors() != NULL ||
myScalars->GetPointData()->GetVectors() != NULL)
myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
* Copy information about pipline.
* Copy scale and scalars.
*/
-void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){
+void
+VISU_ScalarMapOnDeformedShapePL
+::ShallowCopy(VISU_PipeLine *thePipeLine)
+{
VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
if(aPipeLine){
SetScale(aPipeLine->GetScale());
SetScalars(aPipeLine->GetScalars());
- float aRange[2];
+ vtkFloatingPointType aRange[2];
aPipeLine->GetSourceRange(aRange);
SetScalarRange(aRange);
}
* Set scalars.
* Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalars(vtkDataSet *theScalars)
+{
myScalars = theScalars;
vtkUnstructuredGrid* aScalars = GetScalars();
myExtractorScalars->SetInput(aScalars);
/*!
* Get pointer to input scalars.
*/
-vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){
+vtkUnstructuredGrid*
+VISU_ScalarMapOnDeformedShapePL
+::GetScalars()
+{
return myScalars.GetPointer();
}
/*!
* Sets scale for deformed shape
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) {
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScale(vtkFloatingPointType theScale)
+{
if(myScaleFactor == theScale) return;
myScaleFactor = theScale;
myDeformVectors->SetScaleFactor(myScaleFactor);
/*!
* Gets scale of deformed shape.
*/
-float VISU_ScalarMapOnDeformedShapePL::GetScale() {
- float aScale=myDeformVectors->GetScaleFactor();
+vtkFloatingPointType
+VISU_ScalarMapOnDeformedShapePL
+::GetScale()
+{
+ vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor();
return aScale;
}
/*!
* Set scale factor of deformation.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale);
Modified();
}
/*!
* Gets scalar mode.
*/
-int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){
+int
+VISU_ScalarMapOnDeformedShapePL
+::GetScalarMode()
+{
int aMode=myExtractorScalars->GetScalarMode();
return aMode;
}
/*!
* Sets scalar mode.
*/
-void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalarMode(int theScalarMode)
+{
myExtractorScalars->SetScalarMode(theScalarMode);
Modified();
}
* \li theRange[0] - minimum value
* \li theRange[1] - maximum value
*/
-void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){
+void
+VISU_ScalarMapOnDeformedShapePL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
myExtractorScalars->Update();
myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange);
}
virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ virtual void SetScale(vtkFloatingPointType theScale);
+ virtual vtkFloatingPointType GetScale();
virtual int GetScalarMode();
virtual void SetScalarMode(int theScalarMode = 0);
- virtual void GetSourceRange(float theRange[2]);
+ virtual void GetSourceRange(vtkFloatingPointType theRange[2]);
virtual void SetScalars(vtkDataSet *theScalars);
virtual vtkUnstructuredGrid* GetScalars();
void
UpdateScalars();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
- float myScaleFactor;
+ vtkFloatingPointType myScaleFactor;
vtkWarpVector *myDeformVectors;
vtkMergeFilter *myMergeFilter;
vtkSmartPointer<vtkUnstructuredGrid> myScalars;
//----------------------------------------------------------------------------
-float*
+vtkFloatingPointType*
VISU_ScalarMapPL
::GetScalarRange()
{
void
VISU_ScalarMapPL
-::SetScalarRange(float theRange[2])
+::SetScalarRange(vtkFloatingPointType theRange[2])
{
myFieldTransform->SetScalarRange(theRange);
myBarTable->SetRange(theRange);
void
VISU_ScalarMapPL
-::SetScalarMin(float theValue)
+::SetScalarMin(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {theValue, GetScalarRange()[1]};
+ vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]};
SetScalarRange(aScalarRange);
}
void
VISU_ScalarMapPL
-::SetScalarMax(float theValue)
+::SetScalarMax(vtkFloatingPointType theValue)
{
- float aScalarRange[2] = {GetScalarRange()[0], theValue};
+ vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue};
SetScalarRange(aScalarRange);
}
VISU_ScalarMapPL
::Update()
{
- float *aRange = myFieldTransform->GetScalarRange();
- float aScalarRange[2] = {aRange[0], aRange[1]};
+ vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange();
+ vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
if(myBarTable->GetScale() == VTK_SCALE_LOG10)
VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
myMapperTable->SetRange(aScalarRange);
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
{
myMapperTable->SetMapScale(theMapScale);
myMapperTable->Build();
}
-float
+vtkFloatingPointType
VISU_ScalarMapPL::GetMapScale()
{
return myMapperTable->GetMapScale();
//----------------------------------------------------------------------------
void
VISU_ScalarMapPL
-::GetSourceRange(float theRange[2])
+::GetSourceRange(vtkFloatingPointType theRange[2])
{
myExtractor->Update();
myExtractor->GetOutput()->GetScalarRange(theRange);
VISU_ScalarMapPL
::SetSourceRange()
{
- float aRange[2];
+ vtkFloatingPointType aRange[2];
GetSourceRange(aRange);
SetScalarRange(aRange);
}
SetScaling(int theScaling = VTK_SCALE_LINEAR);
virtual
- float*
+ vtkFloatingPointType*
GetScalarRange();
virtual
void
- SetScalarRange(float theRange[2]);
+ SetScalarRange(vtkFloatingPointType theRange[2]);
virtual
void
- SetScalarMin(float theValue);
+ SetScalarMin(vtkFloatingPointType theValue);
virtual
void
- SetScalarMax(float theValue);
+ SetScalarMax(vtkFloatingPointType theValue);
virtual
void
virtual
void
- SetMapScale(float theMapScale = 1.0);
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
virtual
- float
+ vtkFloatingPointType
GetMapScale();
virtual
void
- GetSourceRange(float theRange[2]);
+ GetSourceRange(vtkFloatingPointType theRange[2]);
virtual
void
mySphereActor->SetMapper(mySphereMapper);
//
// Define the point coordinates
- float bounds[6];
+ vtkFloatingPointType bounds[6];
for(int i = 0; i < 6; i += 2){
bounds[i]=-.5;
bounds[i+1]=-bounds[i];
// function: SetRadius
// purpose :
//====================================================================
-void VISU_SphereWidget::SetRadius(float theRadius)
+void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius)
{
if ( theRadius <= myRmin ) {
theRadius = myRmin;
// function: GetRadius
// purpose :
//====================================================================
-float VISU_SphereWidget::GetRadius()
+vtkFloatingPointType VISU_SphereWidget::GetRadius()
{
return mySphereSource->GetRadius();
}
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theCenter[3])
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->SetCenter(theCenter);
mySphere->SetCenter(theCenter);
// function: SetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ)
+void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ)
{
- float aCenter[3] = {theX, theY, theZ};
+ vtkFloatingPointType aCenter[3] = {theX, theY, theZ};
SetCenter(aCenter);
}
// function: GetCenter
// purpose :
//====================================================================
-float* VISU_SphereWidget::GetCenter()
+vtkFloatingPointType* VISU_SphereWidget::GetCenter()
{
return mySphereSource->GetCenter();
}
// function: GetCenter
// purpose :
//====================================================================
-void VISU_SphereWidget::GetCenter(float theCenter[3])
+void VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3])
{
mySphereSource->GetCenter(theCenter);
}
//====================================================================
void VISU_SphereWidget::Translate(double *p1, double *p2)
{
- float v[3], aC[3], aC1[3];
+ vtkFloatingPointType v[3], aC[3], aC1[3];
//
v[0] = p2[0] - p1[0];
v[1] = p2[1] - p1[1];
v[1] = p2[1] - p1[1];
v[2] = p2[2] - p1[2];
//
- float aC[3], aR, sf, aR1;
+ vtkFloatingPointType aC[3], aR, sf, aR1;
aR=mySphereSource->GetRadius();
mySphereSource->GetCenter(aC);
sf=vtkMath::Norm(v)/aR;
// function:PlaceWidget
// purpose:
//====================================================================
-void VISU_SphereWidget::PlaceWidget(float bds[6])
+void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6])
{
- float bounds[6], center[3], radius;
+ vtkFloatingPointType bounds[6], center[3], radius;
this->AdjustBounds(bds, bounds, center);
- float dX, dY, dZ;
+ vtkFloatingPointType dX, dY, dZ;
//
dX=bounds[1]-bounds[0];
dY=bounds[3]-bounds[2];
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
- static float EPS = 1.0E-1;
+ static vtkFloatingPointType EPS = 1.0E-1;
myRmin = EPS*InitialLength;
}
virtual void SetEnabled(int);
//
//PlaceWidget
- virtual void PlaceWidget(float bounds[6]);
+ virtual void PlaceWidget(vtkFloatingPointType bounds[6]);
//
// Description:
// Set/Get the resolution of the sphere in the Theta direction.
// Description:
// Set/Get the radius of sphere. Default is .5.
- void SetRadius(float r);
- float GetRadius();
+ void SetRadius(vtkFloatingPointType r);
+ vtkFloatingPointType GetRadius();
// Description:
// Set/Get the center of the sphere.
- void SetCenter(float x, float y, float z);
- void SetCenter(float x[3]);
+ void SetCenter(vtkFloatingPointType x,
+ vtkFloatingPointType y,
+ vtkFloatingPointType z);
+ void SetCenter(vtkFloatingPointType x[3]);
- float* GetCenter();
- void GetCenter(float xyz[3]);
+ vtkFloatingPointType* GetCenter();
+ void GetCenter(vtkFloatingPointType xyz[3]);
// Description:
// Set the ratio of the radius changing.
- void SetRatio(float r) { myRatio = r; }
- float GetRatio() { return myRatio; }
+ void SetRatio(vtkFloatingPointType r) { myRatio = r; }
+ vtkFloatingPointType GetRatio() { return myRatio; }
void ChangeRadius(bool up);
// the manipulator in general.
vtkProperty *mySphereProperty;
vtkProperty *mySelectedSphereProperty;
- float myRmin;
+ vtkFloatingPointType myRmin;
vtkSphere *mySphere;
vtkImplicitSum* myImplicitSum;
- float myRatio;
+ vtkFloatingPointType myRatio;
private:
VISU_SphereWidget(const VISU_SphereWidget&); //Not implemented
void operator=(const VISU_SphereWidget&); //Not implemented
static int MYDEBUG = 0;
#endif
-static float EPS = 1.0e-7;
-static float aMinNbOfSteps = 1.0E+2;
-//static float aMaxNbOfSteps = 1.0E+3;
-static float aCoeffOfIntStep = 1.0E+1;
+static vtkFloatingPointType EPS = 1.0e-7;
+static vtkFloatingPointType aMinNbOfSteps = 1.0E+2;
+//static vtkFloatingPointType aMaxNbOfSteps = 1.0E+3;
+static vtkFloatingPointType aCoeffOfIntStep = 1.0E+1;
vtkStandardNewMacro(VISU_StreamLinesPL);
}
-float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
- float thePropogationTime, float thePercents)
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetNecasseryMemorySize(vtkIdType theNbOfPoints,
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents)
{
- static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2;
- static float aStreamArraySize = aStreamPointSize*1024; // == 69632
+ static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2;
+ static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632
- float aNbCells = thePercents*theNbOfPoints*2.0;
- float aNbPointsPerCell = thePropogationTime/theStepLength;
- float aCellsSize = aNbCells*(1+aNbPointsPerCell);
- float aPointsSize = aCellsSize*3.0*sizeof(float);
+ vtkFloatingPointType aNbCells = thePercents*theNbOfPoints*2.0;
+ vtkFloatingPointType aNbPointsPerCell = thePropogationTime/theStepLength;
+ vtkFloatingPointType aCellsSize = aNbCells*(1+aNbPointsPerCell);
+ vtkFloatingPointType aPointsSize = aCellsSize*3.0*sizeof(vtkFloatingPointType);
- float aConnectivitySize = aCellsSize*sizeof(vtkIdType);
- float aTypesSize = aNbCells*sizeof(char);
- float aLocationsSize = aNbCells*sizeof(int);
- //float aNbCellsPerPoint = aCellsSize / aNbCells - 1;
- float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
+ vtkFloatingPointType aConnectivitySize = aCellsSize*sizeof(vtkIdType);
+ vtkFloatingPointType aTypesSize = aNbCells*sizeof(char);
+ vtkFloatingPointType aLocationsSize = aNbCells*sizeof(int);
+ //vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1;
+ vtkFloatingPointType aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize;
- float anAssignedDataSize = aCellsSize*4.0*sizeof(float);
- float anOutputDataSetSize = aMeshSize + anAssignedDataSize;
+ vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType);
+ vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize;
- float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
+ vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize;
return aResult;
}
-int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
- float& thePropogationTime, float& thePercents)
+int
+VISU_StreamLinesPL
+::FindPossibleParams(vtkPointSet* theDataSet,
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents)
{
- static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
+ static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents);
int isPoss = CheckAvailableMemory(aSize);
if(!isPoss){
- float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
- float aMinStepLength = GetMinStepLength(theDataSet);
- float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
+ vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime);
+ vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet);
+ vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease;
for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){
- float aStepLength = theStepLength + aDeltaStepLength;
+ vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength;
if(aStepLength < aMaxStepLength) theStepLength = aStepLength;
else if(aStepChanged){
aStepLength = aMaxStepLength;
aStepChanged = 0;
}
- float aPercents = thePercents /= aPercentsDecrease;
+ vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease;
if(aPercents*aNbOfPoints > 1) thePercents = aPercents;
else if(aPerecentsChanged) {
thePercents = 1.1 / aNbOfPoints;
}
-int VISU_StreamLinesPL::SetParams(float theIntStep,
- float thePropogationTime,
- float theStepLength,
- vtkPointSet* theSource,
- float thePercents,
- int theDirection,
- int isOnlyTry)
+int
+VISU_StreamLinesPL
+::SetParams(vtkFloatingPointType theIntStep,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource,
+ vtkFloatingPointType thePercents,
+ int theDirection,
+ int isOnlyTry)
{
vtkPointSet* aDataSet = theSource? theSource: myFieldTransform->GetUnstructuredGridOutput();
aDataSet->Update();
}
-vtkPointSet* VISU_StreamLinesPL::GetSource() {
+vtkPointSet*
+VISU_StreamLinesPL
+::GetSource()
+{
return mySource;
}
-float VISU_StreamLinesPL::GetUsedPoints() {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetUsedPoints()
+{
return myPercents;
}
-vtkDataSet* VISU_StreamLinesPL::GetStreamerSource(){
+vtkDataSet*
+VISU_StreamLinesPL
+::GetStreamerSource()
+{
return myStream->GetSource();
}
-float VISU_StreamLinesPL::GetVelocityCoeff(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetVelocityCoeff()
+{
return GetVelocityCoeff(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetVelocityCoeff(vtkPointSet* theDataSet){
- float* aScalarRange = theDataSet->GetScalarRange();
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetVelocityCoeff(vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange();
return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
}
-int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){
- float aStepLength = GetBaseStepLength(theDataSet);
- float aBasePropTime = GetBasePropagationTime(theDataSet);
+int
+VISU_StreamLinesPL
+::IsPossible(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
+ vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet);
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet);
VISU_UsedPointsFilter *aPointsFilter = VISU_UsedPointsFilter::New();
aPointsFilter->SetInput(theDataSet);
vtkPointSet* aDataSet = aPointsFilter->GetOutput();
}
-float VISU_StreamLinesPL::GetIntegrationStep(){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetIntegrationStep()
+{
return myStream->GetIntegrationStepLength();
}
-float VISU_StreamLinesPL::GetStepLength() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetStepLength()
+{
return myStream->GetStepLength();
}
-float VISU_StreamLinesPL::GetPropagationTime() {
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetPropagationTime()
+{
return myStream->GetMaximumPropagationTime();
}
-int VISU_StreamLinesPL::GetDirection(){
+
+int
+VISU_StreamLinesPL
+::GetDirection()
+{
return myStream->GetIntegrationDirection();
}
-float VISU_StreamLinesPL::GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
if(!theDataSet) return -1.0;
- float aVolume = 1.0;
+ vtkFloatingPointType aVolume = 1.0;
int degree = 0;
theDataSet->Update();
- float* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
for(int i = 0, j = 0; i < 3; ++i, j = 2*i){
- float tmp = aBounds[j+1] - aBounds[j];
+ vtkFloatingPointType tmp = aBounds[j+1] - aBounds[j];
if (tmp > EPS ) {
aVolume *= tmp;
degree += 1;
}
}
if (degree < 1) return 0.0; // absolutely empty object
- float anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
- float aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
+ vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep;
+ vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet);
thePercents = 1.0;
vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints();
- float aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
- float aRealSize = GetAvailableMemory(aSize);
- float anAverageVolume = aVolume / aRealSize;
- float aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
+ vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents);
+ vtkFloatingPointType aRealSize = GetAvailableMemory(aSize);
+ vtkFloatingPointType anAverageVolume = aVolume / aRealSize;
+ vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree)));
return aStep;
}
-float VISU_StreamLinesPL::GetMinIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinIntegrationStep()
+{
return GetMinIntegrationStep(myExtractor->GetOutput(),GetUsedPoints());
}
-float VISU_StreamLinesPL::GetMaxIntegrationStep(vtkPointSet* theDataSet) {
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
theDataSet->Update();
- float aLength = theDataSet->GetLength();
- float* aBounds = theDataSet->GetBounds();
- float aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
- float aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
- float aMinMax = (aBounds[1] - aBounds[0])/aLength;
+ vtkFloatingPointType aLength = theDataSet->GetLength();
+ vtkFloatingPointType* aBounds = theDataSet->GetBounds();
+ vtkFloatingPointType aMaxSizeY = (aBounds[3]-aBounds[2])/aLength;
+ vtkFloatingPointType aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength;
+ vtkFloatingPointType aMinMax = (aBounds[1] - aBounds[0])/aLength;
if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) aMinMax = aMaxSizeY;
if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) aMinMax = aMaxSizeZ;
return aMinMax*aLength/2.0;
}
-float VISU_StreamLinesPL::GetMaxIntegrationStep(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxIntegrationStep()
+{
return GetMaxIntegrationStep(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
theDataSet->Update();
- float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
- float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
- float anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
- float aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
+ vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+ vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+ vtkFloatingPointType anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep;
+ vtkFloatingPointType aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints();
if(aMinMax > anIntegrationStep)
anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep;
if(aMinIntegrationStep > anIntegrationStep)
return anIntegrationStep;
}
-float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectIntegrationStep(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents)
+{
theDataSet->Update();
- float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
- float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
+ vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents);
+ vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet);
if(aMinIntegrationStep > theStep)
theStep = aMinIntegrationStep;
if(aMaxIntegrationStep < theStep)
}
-float VISU_StreamLinesPL::GetMinPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
return GetMinStepLength(theDataSet);
}
-float VISU_StreamLinesPL::GetMinPropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinPropagationTime()
+{
return GetMinPropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMaxPropagationTime(vtkPointSet* theDataSet){
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxPropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
return GetBasePropagationTime(theDataSet)*aMinNbOfSteps;
}
-float VISU_StreamLinesPL::GetMaxPropagationTime(){
+
+vtkFloatingPointType VISU_StreamLinesPL::GetMaxPropagationTime(){
return GetMaxPropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet){
- float aMinPropagationTime = GetMinPropagationTime(theDataSet);
- float aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
+ vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet);
+ vtkFloatingPointType aMaxPropagationTime = GetMaxPropagationTime(theDataSet);
if(aMinPropagationTime > thePropagationTime)
thePropagationTime = aMinPropagationTime;
if(aMaxPropagationTime < thePropagationTime)
thePropagationTime = aMaxPropagationTime;
return thePropagationTime;
}
-float VISU_StreamLinesPL::GetBasePropagationTime(vtkPointSet* theDataSet){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBasePropagationTime(vtkPointSet* theDataSet)
+{
if(!theDataSet) return -1.0;
theDataSet->Update();
- float aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
+ vtkFloatingPointType aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet);
return aPropagationTime;
}
-float VISU_StreamLinesPL::GetBasePropagationTime(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBasePropagationTime()
+{
return GetBasePropagationTime(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMinStepLength(vtkPointSet* theDataSet){
- static float aNbOfStepsOfIntStep = 1.0E+1;
- float anIntStep = GetMinIntegrationStep(theDataSet);
- float aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength(vtkPointSet* theDataSet)
+{
+ static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1;
+ vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet);
+ vtkFloatingPointType aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet);
return aStepLength;
}
-float VISU_StreamLinesPL::GetMinStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMinStepLength()
+{
return GetMinStepLength(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::GetMaxStepLength(vtkPointSet* theDataSet){
- float aStepLength = GetBasePropagationTime(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength(vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aStepLength = GetBasePropagationTime(theDataSet);
return aStepLength;
}
-float VISU_StreamLinesPL::GetMaxStepLength(){
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetMaxStepLength()
+{
return GetMaxStepLength(myExtractor->GetOutput());
}
-float VISU_StreamLinesPL::CorrectStepLength(float theStep, vtkPointSet* theDataSet){
- float aMinStep = GetMinStepLength(theDataSet);
+vtkFloatingPointType
+VISU_StreamLinesPL
+::CorrectStepLength(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet)
+{
+ vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet);
if(theStep < aMinStep) theStep = aMinStep;
- float aMaxStep = GetMaxStepLength(theDataSet);
+ vtkFloatingPointType aMaxStep = GetMaxStepLength(theDataSet);
if(theStep > aMaxStep) theStep = aMaxStep;
return theStep;
}
-float VISU_StreamLinesPL::GetBaseStepLength(vtkPointSet* theDataSet){
- static float anAvgNbOfSteps = 1.0E+2;
- float aPropagationTime = GetBasePropagationTime(theDataSet);
- float aStepLength = aPropagationTime/anAvgNbOfSteps;
+
+vtkFloatingPointType
+VISU_StreamLinesPL
+::GetBaseStepLength(vtkPointSet* theDataSet)
+{
+ static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2;
+ vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet);
+ vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps;
aStepLength = CorrectStepLength(aStepLength,theDataSet);
return aStepLength;
}
-void VISU_StreamLinesPL::Init(){
+void
+VISU_StreamLinesPL
+::Init()
+{
VISU_ScalarMapPL::Init();
vtkPointSet* aDataSet = myExtractor->GetOutput();
- float anIntStep = GetBaseIntegrationStep(aDataSet);
- float aPropagationTime = GetBasePropagationTime(aDataSet);
- float aStepLength = GetBaseStepLength(aDataSet);
+ vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
+ vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
+ vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet);
SetParams(anIntStep,aPropagationTime,aStepLength);
}
-VISU_ScalarMapPL::THook* VISU_StreamLinesPL::DoHook(){
+VISU_ScalarMapPL::THook*
+VISU_StreamLinesPL
+::DoHook()
+{
GetInput2()->Update();
VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform);
- float *aBounds = GetInput2()->GetBounds();
+ vtkFloatingPointType *aBounds = GetInput2()->GetBounds();
myGeomFilter->SetExtent(aBounds);
myGeomFilter->ExtentClippingOn();
myGeomFilter->SetInput(myStream->GetOutput());
return myGeomFilter->GetOutput();
}
-void VISU_StreamLinesPL::Update(){
+void
+VISU_StreamLinesPL
+::Update()
+{
VISU_ScalarMapPL::Update();
}
-void VISU_StreamLinesPL::SetMapScale(float theMapScale){
+void
+VISU_StreamLinesPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
VISU_ScalarMapPL::SetMapScale(theMapScale);
}
class VTKViewer_GeometryFilter;
class VISU_UsedPointsFilter;
-class VISU_StreamLinesPL : public VISU_DeformedShapePL{
+class VISU_StreamLinesPL : public VISU_DeformedShapePL
+{
protected:
VISU_StreamLinesPL();
VISU_StreamLinesPL(const VISU_StreamLinesPL&);
+
+ virtual
+ ~VISU_StreamLinesPL();
+
public:
vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL);
- static VISU_StreamLinesPL* New();
- virtual ~VISU_StreamLinesPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
-
- virtual int SetParams(float theIntStep,
- float thePropogationTime,
- float theStepLength,
- vtkPointSet* theSource = NULL,
- float thePercents = 0.3,
- int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
- int isOnlyTry = false);
- virtual vtkPointSet* GetSource();
- virtual float GetUsedPoints();
- virtual float GetIntegrationStep();
- virtual float GetPropagationTime();
- virtual float GetStepLength();
- virtual int GetDirection();
-
- virtual vtkDataSet* GetStreamerSource();
- virtual float GetVelocityCoeff();
-
- virtual float GetMaxIntegrationStep();
- virtual float GetMinIntegrationStep();
-
- virtual float GetMinStepLength();
- virtual float GetMaxStepLength();
-
- virtual float GetMinPropagationTime();
- virtual float GetMaxPropagationTime();
- virtual float GetBasePropagationTime();
+
+ static
+ VISU_StreamLinesPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ int
+ SetParams(vtkFloatingPointType theIntStep,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType theStepLength,
+ vtkPointSet* theSource = NULL,
+ vtkFloatingPointType thePercents = 0.3,
+ int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS,
+ int isOnlyTry = false);
+
+ virtual
+ vtkPointSet*
+ GetSource();
+
+ virtual
+ vtkFloatingPointType
+ GetUsedPoints();
+
+ virtual
+ vtkFloatingPointType
+ GetIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetStepLength();
+
+ virtual
+ int
+ GetDirection();
+
+ virtual
+ vtkDataSet*
+ GetStreamerSource();
+
+ virtual
+ vtkFloatingPointType
+ GetVelocityCoeff();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetMinIntegrationStep();
+
+ virtual
+ vtkFloatingPointType
+ GetMinStepLength();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxStepLength();
+
+ virtual
+ vtkFloatingPointType
+ GetMinPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetMaxPropagationTime();
+
+ virtual
+ vtkFloatingPointType
+ GetBasePropagationTime();
public:
- virtual THook* DoHook();
- virtual void Init();
- virtual void Update();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ THook*
+ DoHook();
+
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
public:
- static float GetMaxIntegrationStep(vtkPointSet* theDataSet);
- static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
- static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3);
+ static
+ vtkFloatingPointType
+ GetMaxIntegrationStep(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMinIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
+ static
+ vtkFloatingPointType
+ GetBaseIntegrationStep(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
- static float GetMinPropagationTime(vtkPointSet* theDataSet);
- static float GetMaxPropagationTime(vtkPointSet* theDataSet);
- static float GetBasePropagationTime(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetMinPropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMaxPropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetBasePropagationTime(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMinStepLength(vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ GetMaxStepLength(vtkPointSet* theDataSet);
- static float GetMinStepLength(vtkPointSet* theDataSet);
- static float GetMaxStepLength(vtkPointSet* theDataSet);
- static float GetBaseStepLength(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetBaseStepLength(vtkPointSet* theDataSet);
- static float GetVelocityCoeff(vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ GetVelocityCoeff(vtkPointSet* theDataSet);
- static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3);
+ static
+ int
+ IsPossible(vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
protected:
- static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength,
- float thePropogationTime, float thePercents = 0.3);
- static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength,
- float& thePropogationTime, float& thePercents);
+ static
+ vtkFloatingPointType
+ GetNecasseryMemorySize(vtkIdType theNbOfPoints,
+ vtkFloatingPointType theStepLength,
+ vtkFloatingPointType thePropogationTime,
+ vtkFloatingPointType thePercents = 0.3);
+
+ static
+ int
+ FindPossibleParams(vtkPointSet* theDataSet,
+ vtkFloatingPointType& theStepLength,
+ vtkFloatingPointType& thePropogationTime,
+ vtkFloatingPointType& thePercents);
- static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3);
- static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet);
- static float CorrectStepLength(float theStep, vtkPointSet* theDataSet);
+ static
+ vtkFloatingPointType
+ CorrectIntegrationStep(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet,
+ vtkFloatingPointType thePercents = 0.3);
+
+ static
+ vtkFloatingPointType
+ CorrectPropagationTime(vtkFloatingPointType thePropagationTime,
+ vtkPointSet* theDataSet);
+
+ static
+ vtkFloatingPointType
+ CorrectStepLength(vtkFloatingPointType theStep,
+ vtkPointSet* theDataSet);
vtkStreamLine* myStream;
vtkPointSet* mySource;
vtkCellCenters* myCenters;
VTKViewer_GeometryFilter *myGeomFilter;
VISU_UsedPointsFilter *myPointsFilter;
- float myPercents;
+ vtkFloatingPointType myPercents;
};
void
VISU_VectorsPL
-::SetScale(float theScale)
+::SetScale(vtkFloatingPointType theScale)
{
if(myScaleFactor == theScale)
return;
Modified();
}
-float
+vtkFloatingPointType
VISU_VectorsPL
::GetScale()
{
void
VISU_VectorsPL
-::SetMapScale(float theMapScale)
+::SetMapScale(vtkFloatingPointType theMapScale)
{
VISU_ScalarMapPL::SetMapScale(theMapScale);
class vtkGlyph3D;
-class VISU_VectorsPL : public VISU_DeformedShapePL{
+class VISU_VectorsPL : public VISU_DeformedShapePL
+{
protected:
VISU_VectorsPL();
VISU_VectorsPL(const VISU_VectorsPL&);
+
+ virtual
+ ~VISU_VectorsPL();
+
public:
vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL);
- static VISU_VectorsPL* New();
- virtual ~VISU_VectorsPL();
- virtual void ShallowCopy(VISU_PipeLine *thePipeLine);
- virtual void SetScale(float theScale);
- virtual float GetScale();
+ static
+ VISU_VectorsPL*
+ New();
+
+ virtual
+ void
+ ShallowCopy(VISU_PipeLine *thePipeLine);
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
enum GlyphType{ ARROW, CONE2, CONE6, NONE};
- virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;}
- virtual GlyphType GetGlyphType() { return myTypeGlyph;}
+
+ virtual
+ void
+ SetGlyphType(GlyphType theType)
+ {
+ myTypeGlyph = theType;
+ }
+
+ virtual
+ GlyphType
+ GetGlyphType()
+ {
+ return myTypeGlyph;
+ }
enum GlyphPos{ CENTER, TAIL,HEAD};
- virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;}
- virtual GlyphPos GetGlyphPos() { return myPosGlyph;}
+
+ virtual
+ void
+ SetGlyphPos(GlyphPos thePos)
+ {
+ myPosGlyph = thePos;
+ }
+
+ virtual
+ GlyphPos
+ GetGlyphPos()
+ {
+ return myPosGlyph;
+ }
public:
- virtual void Init();
- virtual void Update();
+ virtual
+ void
+ Init();
+
+ virtual
+ void
+ Update();
vtkDataSet*
GetOutput();
- virtual void SetTransform(VTKViewer_Transform* theTransform);
- virtual VTKViewer_Transform* GetTransform();
+ virtual
+ void
+ SetTransform(VTKViewer_Transform* theTransform);
+
+ virtual
+ VTKViewer_Transform*
+ GetTransform();
- virtual void SetMapScale(float theMapScale = 1.0);
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
protected:
- virtual THook* DoHook();
+ virtual
+ THook*
+ DoHook();
GlyphType myTypeGlyph;
GlyphPos myPosGlyph;
// function: PlaceWidget
// purpose :
//==================================================================
-void VISU_WidgetCtrl::PlaceWidget(float theBounds[6])
+void VISU_WidgetCtrl::PlaceWidget(vtkFloatingPointType theBounds[6])
{
for (int i=0; i<myNbWidgets; ++i) {
myWidgets[i]->PlaceWidget(theBounds);
// function: SetPlaceFactor
// purpose :
//==================================================================
-void VISU_WidgetCtrl::SetPlaceFactor(float theFactor)
+void VISU_WidgetCtrl::SetPlaceFactor(vtkFloatingPointType theFactor)
{
for (int i=0; i<myNbWidgets; ++i) {
myWidgets[i]->SetPlaceFactor(theFactor);
// function: GetPlaceFactor
// purpose :
//==================================================================
-float VISU_WidgetCtrl::GetPlaceFactor()
+vtkFloatingPointType VISU_WidgetCtrl::GetPlaceFactor()
{
return myWidgets[0]->GetPlaceFactor();
}
}
//==================================================================
-float
+vtkFloatingPointType
VISU_WidgetCtrl
-::EvaluateFunction(float theX[3])
+::EvaluateFunction(vtkFloatingPointType theX[3])
{
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
if(vtkImplicitFunction* aFunction = aWidget->ImplicitFunction())
//==================================================================
void
VISU_WidgetCtrl
-::EvaluateGradient(float theX[3], float theG[3])
+::EvaluateGradient(vtkFloatingPointType theX[3],
+ vtkFloatingPointType theG[3])
{
theG[0] = theG[1] = theG[2] = 0.0;
if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){
vtkImplicitFunction* ImplicitFunction();
virtual
- float
- EvaluateFunction(float theX[3]);
+ vtkFloatingPointType
+ EvaluateFunction(vtkFloatingPointType theX[3]);
virtual
void
- EvaluateGradient(float theX[3], float theG[3]);
+ EvaluateGradient(vtkFloatingPointType theX[3],
+ vtkFloatingPointType theG[3]);
virtual
unsigned long
GetMTime();
- void PlaceWidget(float theBounds[6]);
+ void PlaceWidget(vtkFloatingPointType theBounds[6]);
void SetEnabled(int theFlag);
int GetEnabled();
void On() {SetEnabled(1);}
void SetInteractor(vtkRenderWindowInteractor* theRWI);
vtkRenderWindowInteractor* GetInteractor();
//
- void SetPlaceFactor(float theFactor);
- float GetPlaceFactor();
+ void
+ SetPlaceFactor(vtkFloatingPointType theFactor);
+
+ vtkFloatingPointType
+ GetPlaceFactor();
//
void SetActiveIndex(const int theFlag);
int GetActiveIndex()const;
int myActiveIndex;
int myCounter;
int myDisableAll;
- float myPriority;
+ vtkFloatingPointType myPriority;
VISU_ImplicitFunctionWidget *myWidgets[2];
VISU_ImplicitFunctionWidget *myDummyWidget;
VISU_PlanesWidget *myPlanesWidget;
VISU::Orientation myOrientation;
- float myDistance;
+ vtkFloatingPointType myDistance;
double myAngle[2];
vtkPlaneSource* myPlaneSource;
void SetOrientation(VISU::Orientation theOrientation) {myOrientation = theOrientation;}
VISU::Orientation GetOrientation() {return myOrientation;}
- void SetDistance(float theDistance) {myDistance = theDistance;}
- float GetDistance() {return myDistance;}
+ void SetDistance(vtkFloatingPointType theDistance)
+ {
+ myDistance = theDistance;
+ }
+ vtkFloatingPointType GetDistance()
+ {
+ return myDistance;
+ }
void ShallowCopy(OrientedPlane* theOrientedPlane){
SetNormal(theOrientedPlane->GetNormal());
myActor->SetMapper(myMapper);
vtkProperty* aProp = vtkProperty::New();
- float anRGB[3];
+ vtkFloatingPointType anRGB[3];
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
myPlanes.clear();
- float anOffset [3];
- myPrs3d->GetOffset(anOffset);
+ CORBA::Float anOffset[3];
+ myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
vtkIdType anId = 0, anEnd = myPrs3d->GetNumberOfClippingPlanes();
for (; anId < anEnd; anId++) {
VISU::TVTKPlane aTVTKPlane(anOrientedPlane);
anOrientedPlane->Delete();
aTVTKPlane->ShallowCopy(aPlane);
- aTVTKPlane->myActor->SetPosition(anOffset);
+ aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]);
myPlanes.push_back(aTVTKPlane);
}
}
VISU::TVTKPlane aTVTKPlane(aPlane);
myPlanes.push_back(aTVTKPlane);
- float anOffset [3];
- myPrs3d->GetOffset(anOffset);
- aTVTKPlane->myActor->SetPosition(anOffset);
+ CORBA::Float anOffset[3];
+ myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+ aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]);
if (PreviewCheckBox->isChecked())
aTVTKPlane->myActor->VisibilityOn();
OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer();
- float aNormal[3];
+ vtkFloatingPointType aNormal[3];
VISU::Orientation anOrientation;
- float aDir[3][3] = {{0, 0, 0}, {0, 0, 0}};
+ vtkFloatingPointType aDir[3][3] = {{0, 0, 0}, {0, 0, 0}};
{
static double aCoeff = vtkMath::Pi()/180.0;
- float aRot[2] = {getRotation1(), getRotation2()};
+ vtkFloatingPointType aRot[2] = {getRotation1(), getRotation2()};
aPlane->myAngle[0] = aRot[0];
aPlane->myAngle[1] = aRot[1];
- float anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])};
- float aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])};
+ vtkFloatingPointType anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])};
+ vtkFloatingPointType aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])};
aV[0] = aRot[0] > 0? aV[0]: -aV[0];
aV[1] = aRot[1] > 0? aV[1]: -aV[1];
myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane);
vtkDataSet* aDataSet = myPrs3d->GetInput();
- float *aPnt = aDataSet->GetCenter();
+ vtkFloatingPointType *aPnt = aDataSet->GetCenter();
- float* anOrigin = aPlane->GetOrigin();
- float aDel = aDataSet->GetLength()/2.0;
+ vtkFloatingPointType* anOrigin = aPlane->GetOrigin();
+ vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
- float aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
- {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
- float aParam, aPnt0[3], aPnt1[3], aPnt2[3];
+ vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
+ {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+ vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
- float aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
- aPnt[1] - aDelta[0][1] - aDelta[1][1],
- aPnt[2] - aDelta[0][2] - aDelta[1][2]};
- float aPnt02[3] = {aPnt01[0] + aNormal[0],
- aPnt01[1] + aNormal[1],
- aPnt01[2] + aNormal[2]};
+ vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
+ aPnt[1] - aDelta[0][1] - aDelta[1][1],
+ aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+ vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
+ aPnt01[1] + aNormal[1],
+ aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
- float aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
- aPnt[1] - aDelta[0][1] + aDelta[1][1],
- aPnt[2] - aDelta[0][2] + aDelta[1][2]};
- float aPnt12[3] = {aPnt11[0] + aNormal[0],
- aPnt11[1] + aNormal[1],
- aPnt11[2] + aNormal[2]};
+ vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
+ aPnt[1] - aDelta[0][1] + aDelta[1][1],
+ aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+ vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
+ aPnt11[1] + aNormal[1],
+ aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
- float aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
- aPnt[1] + aDelta[0][1] - aDelta[1][1],
- aPnt[2] + aDelta[0][2] - aDelta[1][2]};
- float aPnt22[3] = {aPnt21[0] + aNormal[0],
- aPnt21[1] + aNormal[1],
- aPnt21[2] + aNormal[2]};
+ vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
+ aPnt[1] + aDelta[0][1] - aDelta[1][1],
+ aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+ vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
+ aPnt21[1] + aNormal[1],
+ aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected());
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId;
gp_Dir dir;
- const vector<float> * values =
+ const vector<vtkFloatingPointType> * values =
result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
if (!values)
return;
// find distance;
int index = SpinBoxIJKIndex->value();
- float distance = 0;
+ vtkFloatingPointType distance = 0;
if (index < values->size())
distance = (*values)[ index ];
}
}
// find rotation angles
- float angle[2];
+ vtkFloatingPointType angle[2];
int rotId[2] = {
(axId == 0) ? 2 : axId - 1,
(axId == 2) ? 0 : axId + 1
};
static double aCoeff = 180.0/vtkMath::Pi();
for (i = 0; i < 2; ++i) {
- float cosin = cos[ rotId[ i ]];
+ vtkFloatingPointType cosin = cos[ rotId[ i ]];
if (maxCos < 0)
cosin = -cosin;
angle[ i ] = asin(cosin) * aCoeff;
int planeIndex = ComboBoxPlanes->currentItem();
OrientedPlane* plane = myPlanes[ planeIndex ].GetPointer();
vtkPlaneSource* planeSource = plane->myPlaneSource;
- float * planeNormal = planeSource->GetNormal();
+ vtkFloatingPointType * planeNormal = planeSource->GetNormal();
gp_Dir normal(planeNormal[0], planeNormal[1], planeNormal[2]);
// find a grid axis most co-directed with plane normal
int i, maxAx = 0, gridAxId = 0;
gp_Dir dir, gridDir;
double maxDot = 0;
- const vector<float> *curValues, *values = 0;
+ const vector<vtkFloatingPointType> *curValues, *values = 0;
VISU::Result_i* result = myPrs3d->GetResult();
for (i = 0; i < 3; ++i) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
if (result) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
gp_Dir dir;
- const vector<float> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
- axis, dir);
+ const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
+ axis, dir);
if (indices)
maxIndex = indices->size() - 1;
}
//aView->Repaint();
}
}
- float aPos = myCutLines->GetBasePlanePosition();
+ vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition();
myBasePlanePos->setText( QString::number(aPos) );
myBasePlanePos->setEnabled(false);
} else {
void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
if (myPreviewActorGlyphs == 0 ) return;
- const float *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn();
- const float *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
- float aSecondPnt[3];
- float aBoundCenter[3];
+ const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn();
+ const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
+ vtkFloatingPointType aSecondPnt[3];
+ vtkFloatingPointType aBoundCenter[3];
vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
aPlaneMapper->SetInput(aPolyData->GetOutput());
- float bounds[6];
+ vtkFloatingPointType bounds[6];
aPlaneMapper->GetBounds(bounds);
for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0;
aSecondPnt[i] = -aBasePnt[i] - aDirLn[i];
}
- float max_bound = 0;
+ vtkFloatingPointType max_bound = 0;
max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound;
max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound;
max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound;
// "Title"
myTextDlg->setTitleText(QString(thePrs->GetTitle()));
- float R, G, B;
+ vtkFloatingPointType R, G, B;
thePrs->GetTitleColor(&R, &G, &B);
myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
const char* theSuffix,
std::ostringstream& theStr)
{
- float aColor[3];
+ vtkFloatingPointType aColor[3];
vtkRenderer* aRenderer = theViewWindow->getRenderer();
aRenderer->GetBackground(aColor);
Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]);
Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]);
Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]);
- float aParallelScale = aCamera->GetParallelScale();
+ vtkFloatingPointType aParallelScale = aCamera->GetParallelScale();
Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale);
double aScaleFactor[3];
const char* theSuffix,
const Storable::TRestoringMap& theMap)
{
- float aColor[3];
+ vtkFloatingPointType aColor[3];
aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
aColor[1] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".G").toDouble();
aColor[2] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".B").toDouble();
aViewUp[2] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[2]").toDouble();
aCamera->SetViewUp(aViewUp);
- float aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
+ vtkFloatingPointType aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble();
aCamera->SetParallelScale(aParallelScale);
double aScaleFactor[3];
std::string aSegmentationMode;
if(aWidgetCtrl->IsPlanesActive()){
VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
aPlanesWidget->GetOrigin(anOrigin);
Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]);
Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]);
Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]);
- float aNormal[3];
+ vtkFloatingPointType aNormal[3];
aPlanesWidget->GetNormal(aNormal);
Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]);
Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]);
Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]);
- float aDepth = aPlanesWidget->Distance();
+ vtkFloatingPointType aDepth = aPlanesWidget->Distance();
Storable::DataToStream(theStr,"myCursorDepth",aDepth);
aSegmentationMode = "Planes";
}else if(aWidgetCtrl->IsSphereActive()){
VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- float aCenter[3];
+ vtkFloatingPointType aCenter[3];
aSphereWidget->GetCenter(aCenter);
Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]);
Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]);
Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]);
- float aRadius = aSphereWidget->GetRadius();
+ vtkFloatingPointType aRadius = aSphereWidget->GetRadius();
Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius);
aSegmentationMode = "Sphere";
if(aSegmentationMode == "Planes"){
VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget();
- float anOrigin[3];
+ vtkFloatingPointType anOrigin[3];
anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble();
anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble();
anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble();
aPlanesWidget->SetOrigin(anOrigin);
- float aNormal[3];
+ vtkFloatingPointType aNormal[3];
aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble();
aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble();
aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble();
aPlanesWidget->SetNormal(aNormal);
- float aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
+ vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble();
aPlanesWidget->SetDistance(aDepth);
aMainWindow->SetPlanesSegementation(true);
}else if(aSegmentationMode == "Sphere"){
VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget();
- float aCenter[3];
+ vtkFloatingPointType aCenter[3];
aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble();
aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble();
aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble();
aSphereWidget->SetCenter(aCenter);
- float aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
+ vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble();
aSphereWidget->SetRadius(aRadius);
aMainWindow->SetSphereSegementation(true);
ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() );
param = vtkParam + "Opacity";
ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() );
- float r, g, b;
+ vtkFloatingPointType r, g, b;
vActor->GetColor(r, g, b);
QString colorStr = QString::number( r ); colorStr += gDigitsSep;
colorStr += QString::number( g ); colorStr += gDigitsSep;
ip->setParameter( entry, param, "Off" );
for ( int p = 0; p < nPlanes; p++ ) {
vtkPlane* plane = vPrs->GetClippingPlane( p );
- float normal[3], origin[3];
+ vtkFloatingPointType normal[3], origin[3];
plane->GetNormal( normal );
plane->GetOrigin( origin );
std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep;
else {
QStringList vals = QStringList::split( gDigitsSep, val );
if ( vals.count() == 6 ) { // format check: 6 float values
- float normal[3], origin[3];
+ vtkFloatingPointType normal[3], origin[3];
for (int x = 0; x < 3; x++ ) {
normal[x] = vals[x].toFloat();
origin[x] = vals[x+3].toFloat();
TopLayout->setSpacing(6);
TopLayout->setMargin(11);
- QHBox* aOffsetsPane = new QHBox (this);
- aOffsetsPane->setSpacing(6);
+ QHBox* anOffsetsPane = new QHBox (this);
+ anOffsetsPane->setSpacing(6);
- new QLabel ("dX:", aOffsetsPane);
- myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt");
+ new QLabel ("dX:", anOffsetsPane);
+ myDxEdt = new QtxDblSpinBox (anOffsetsPane, "myDxEdt");
myDxEdt->setRange(-MAXVAL, MAXVAL);
- new QLabel("dY:", aOffsetsPane);
- myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt");
+ new QLabel("dY:", anOffsetsPane);
+ myDyEdt = new QtxDblSpinBox (anOffsetsPane, "myDyEdt");
myDyEdt->setRange(-MAXVAL, MAXVAL);
- new QLabel("dZ:", aOffsetsPane);
- myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt");
+ new QLabel("dZ:", anOffsetsPane);
+ myDzEdt = new QtxDblSpinBox (anOffsetsPane, "myDzEdt");
myDzEdt->setRange(-MAXVAL, MAXVAL);
- QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane);
+ QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane);
connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset()));
- TopLayout->addWidget(aOffsetsPane);
+ TopLayout->addWidget(anOffsetsPane);
if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) {
mySaveChk = new QCheckBox ("Save to presentation", this);
void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
{
myPrsList.append(thePrs);
- OffsetStruct aOffs;
- thePrs->GetOffset(aOffs.myOffset);
- myOldOffsets.append(aOffs);
+ CORBA::Float anOffset[3];
+ thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+ OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]);
+ myOldOffsets.append(anOffs);
if (myPrsList.count() == 1) {
- setOffset(aOffs.myOffset);
+ setOffset(anOffs.myOffset);
} else if (myPrsList.count() == 2) {
- float aOffset[3];
- aOffset[0] = aOffset[1] = aOffset[2] = 0;
- setOffset(aOffset);
+ OffsetStruct anOffs;
+ setOffset(anOffs.myOffset);
}
}
-void VisuGUI_OffsetDlg::setOffset (const float* theOffset)
+void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
{
myDxEdt->setValue(theOffset[0]);
myDyEdt->setValue(theOffset[1]);
myDzEdt->setValue(theOffset[2]);
}
-void VisuGUI_OffsetDlg::getOffset (float* theOffset) const
+void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const
{
theOffset[0] = myDxEdt->value();
theOffset[1] = myDyEdt->value();
return false;
}
-void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset)
+void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset)
{
if (myPrsList.count() == 0) return;
- if (isToSave()) thePrs->SetOffset(theOffset);
+ if (isToSave()) thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
ViewManagerList aViewManagerList;
SalomeApp_Application* anApp = myModule->getApp();
void VisuGUI_OffsetDlg::accept()
{
- float aOffset[3];
- getOffset(aOffset);
+ vtkFloatingPointType anOffset[3];
+ getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
- updateOffset(myPrsList.at(i), aOffset);
+ updateOffset(myPrsList.at(i), anOffset);
}
QDialog::accept();
}
void VisuGUI_OffsetDlg::onApply()
{
- float aOffset[3];
- getOffset(aOffset);
+ vtkFloatingPointType anOffset[3];
+ getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
- updateOffset(myPrsList.at(i), aOffset);
+ updateOffset(myPrsList.at(i), anOffset);
}
}
#ifndef DIALOGBOX_OFFSET_H
#define DIALOGBOX_OFFSET_H
+#include "VTKViewer.h"
#include "VISU_Prs3d_i.hh"
// QT Includes
class QtxDblSpinBox;
class VisuGUI;
-struct OffsetStruct {
- float myOffset[3];
+struct OffsetStruct
+{
+ vtkFloatingPointType myOffset[3];
+
+ OffsetStruct()
+ {
+ myOffset[0] = myOffset[1] = myOffset[2] = 0;
+ }
+
+ OffsetStruct(vtkFloatingPointType theX,
+ vtkFloatingPointType theY,
+ vtkFloatingPointType theZ)
+ {
+ myOffset[0] = theX;
+ myOffset[1] = theY;
+ myOffset[2] = theZ;
+ }
};
class VisuGUI_OffsetDlg: public QDialog
void addPresentation (VISU::Prs3d_i* thePrs);
int getPrsCount() const { return myPrsList.count(); }
- void setOffset (const float* theOffset);
- void getOffset (float* theOffset) const;
+ void setOffset (const vtkFloatingPointType* theOffset);
+ void getOffset (vtkFloatingPointType* theOffset) const;
bool isToSave() const;
public slots:
void onHelp();
private:
- void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset);
+ void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset);
VisuGUI * myModule;
//=======================================================================
class TPlane : public SALOME_Actor
{
- float mySize;
+ vtkFloatingPointType mySize;
vtkDataSetMapper* myMapper;
vtkPlaneSource* myPlaneSource;
public:
// constructor
- TPlane(float planeSize): mySize(planeSize)
+ TPlane(vtkFloatingPointType planeSize): mySize(planeSize)
{
Init();
}
// set plane parameters
- void Set(float origin[3], float normal[3])
+ void Set(vtkFloatingPointType origin[3], vtkFloatingPointType normal[3])
{
- float point2[3], point1[3];
+ vtkFloatingPointType point2[3], point1[3];
vtkMath::Perpendiculars(normal, point1, point2, 0.);
for (int i = 0; i < 3; ++i) {
point1[ i ] = point1[ i ] * mySize + origin[ i ];
void VisuGUI_Plot3DPane::onPositionSpn()
{
if (myPrs && !RelativeChkB->isChecked()) {
- float minPos, maxPos;
+ vtkFloatingPointType minPos, maxPos;
storePrsParams();
myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
restorePrsParams();
//=======================================================================
void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos)
{
- float minPos = 0., maxPos = 1., pos = PositionSpn->value();
+ vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value();
if (myPrs) {
storePrsParams();
myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
}
// set plane parameters corresponding to control values
storePrsParams();
- float normal[3], origin[3];
+ vtkFloatingPointType normal[3], origin[3];
myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true);
planePreview->Set(origin, normal);
restorePrsParams();
default:
setLogarithmic(false);
}
- float aRange[2];
+ vtkFloatingPointType aRange[2];
thePrs->GetScalarMapPL()->GetSourceRange(aRange);
Rmin = aRange[0]; Rmax = aRange[1];
setRange( thePrs->GetMin(), thePrs->GetMax(),
// "Title"
myTextDlg->setTitleText(QString(thePrs->GetTitle()));
- float R, G, B;
+ vtkFloatingPointType R, G, B;
thePrs->GetTitleColor(&R, &G, &B);
myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
isTitleBold,isTitleItalic,isTitleShadow);
vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty();
aTitleProp->SetFontFamily(aTitleFontFamily);
- aTitleProp->SetColor(float(aTitleColor.red())/255.,
- float(aTitleColor.green())/255.,
- float(aTitleColor.blue())/255.);
+ aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255.,
+ vtkFloatingPointType(aTitleColor.green())/255.,
+ vtkFloatingPointType(aTitleColor.blue())/255.);
(isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
isLabelBold, isLabelItalic, isLabelShadow);
vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty();
aLabelProp->SetFontFamily(aLabelFontFamily);
- aLabelProp->SetColor(float(aLabelColor.red())/255.,
- float(aLabelColor.green())/255.,
- float(aLabelColor.blue())/255.);
+ aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255.,
+ vtkFloatingPointType(aLabelColor.green())/255.,
+ vtkFloatingPointType(aLabelColor.blue())/255.);
(isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
{
if ( myScalarMap ) {
if ( RBFrange->isChecked() ) {
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMap->SetScalarMode(theMode);
myScalarMap->GetScalarMapPL()->GetSourceRange(aRange);
MinEdit->setText( QString::number( aRange[0] ) );
void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
myPrs->SetScale(getFactor());
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myPrs->GetScalarMapOnDeformedShapePL()->Build();
myPrs->GetScalarMapOnDeformedShapePL()->Update();
myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange);
template<class TData> QString getValue(TData* theData, int theId){
if (vtkDataArray *aScalar = theData->GetScalars()){
- float aVal = aScalar->GetTuple1(theId);
+ vtkFloatingPointType aVal = aScalar->GetTuple1(theId);
return QString::number(aVal);
} else {
return QString("No data");
template<class TData> QString getVector(TData* theData, int theId){
if (vtkDataArray *aVector = theData->GetVectors()) {
- float *aVal = aVector->GetTuple3(theId);
+ vtkFloatingPointType *aVal = aVector->GetTuple3(theId);
return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]);
} else {
return QString("No data");
VISU_Actor* anVISUActor =
VISU::FindActor(aViewWindow, aSObject->GetID().c_str());
if (anVISUActor) {
- float aCoord[6];
+ vtkFloatingPointType aCoord[6];
anVISUActor->GetBounds(aCoord);
myXPosLbl->setText(QString::number( aCoord[0] ));
myYPosLbl->setText(QString::number( aCoord[2] ));
myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
TColStd_IndexedMapOfInteger aMapIndex;
- typedef map<int,float*> PointsMap;
+ typedef map<int,vtkFloatingPointType*> PointsMap;
PointsMap aPointsMap;
aSelector->GetIndex(anIO, aMapIndex);
switch (aType) {
case 0:
{
- float* aCoord = anVISUActor->GetNodeCoord(anID);
+ vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID);
int aVTKID = anVISUActor->GetNodeVTKID(anID);
myXValLbl->setText( QString::number( aCoord[0] ) );
myYValLbl->setText( QString::number( aCoord[1] ) );
myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
- float* aCoord;
+ vtkFloatingPointType* aCoord;
vtkIdList *aPointList = aCell->GetPointIds();
for (int i = 0; i < aNbOfPoints; i++) {
myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
int id = It->first;
myListPoints->setText(i, 0, QString::number( id ));
- float* aCoord = It->second;
+ vtkFloatingPointType* aCoord = It->second;
myListPoints->setText(i, 1, QString::number( aCoord[0] ));
myListPoints->setText(i, 2, QString::number( aCoord[1] ));
myListPoints->setText(i, 3, QString::number( aCoord[2] ));
FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
if (aData.myPrs.empty())
myAnimator->generatePresentations(myFieldLst->currentItem());
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
aData.myPrs[0]->GetBounds(aBounds);
- float aDist = 0;
+ vtkFloatingPointType aDist = 0;
int aAxis = getAxis();
switch (aAxis) {
case XAxis:
aDist = fabs(aBounds[5] - aBounds[4]);
}
- float dx = fabs(aBounds[1] - aBounds[0]);
- float dy = fabs(aBounds[3] - aBounds[2]);
- float dz = fabs(aBounds[5] - aBounds[4]);
- float max = (dx > dy) ? dx : dy;
+ vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+ vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+ vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+ vtkFloatingPointType max = (dx > dy) ? dx : dy;
max = (dz > max) ? dz : max;
max /= 100.0;
anActor->SetPosition(aOffs.myOffset);
if (mySaveChk)
if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffs.myOffset);
+ aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
}
} else {
- float aDist = 0;
- float aShift = 0;
- float aPrevDist = 0;
- float aPrevShift = 0;
+ vtkFloatingPointType aDist = 0;
+ vtkFloatingPointType aShift = 0;
+ vtkFloatingPointType aPrevDist = 0;
+ vtkFloatingPointType aPrevShift = 0;
int i;
QMap<VISU::Prs3d_i*, int>::Iterator it;
for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) {
if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) {
int aAxis = getAxis();
- float aZeroOffset[3];
+ vtkFloatingPointType aZeroOffset[3];
aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
aActor->SetPosition(aZeroOffset);
aActor->GetMapper()->Update();
- float aBounds[6];
+ vtkFloatingPointType aBounds[6];
aActor->GetBounds(aBounds);
switch (aAxis) {
case XAxis:
case ZAxis:
aDist = fabs(aBounds[5] - aBounds[4]);
}
- float aOffset[3];
+ vtkFloatingPointType aOffset[3];
aOffset[0] = aOffset[1] = aOffset[2] = 0;
aOffset[aAxis] =
(aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
if (i > 0) {
- float aCCDist = (aDist + aPrevDist) / 2.0;
+ vtkFloatingPointType aCCDist = (aDist + aPrevDist) / 2.0;
- float dx = fabs(aBounds[1] - aBounds[0]);
- float dy = fabs(aBounds[3] - aBounds[2]);
- float dz = fabs(aBounds[5] - aBounds[4]);
- float max = (dx > dy) ? dx : dy;
+ vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+ vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+ vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+ vtkFloatingPointType max = (dx > dy) ? dx : dy;
max = (dz > max) ? dz : max;
max /= 100.0;
aActor->SetPosition(aOffset);
if (mySaveChk)
if (mySaveChk->isChecked())
- aPrs->SetOffset(aOffset);
+ aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
aPrevDist = aDist;
aPrevShift = aShift;
#define VISUGUI_TIMEANIMATION_H
#include "QtxDblSpinBox.h"
-
#include "SALOMEDSClient_Study.hxx"
#include <qdialog.h>
#include <qbuttongroup.h>
#include <qwidgetstack.h>
+#include <vtkSystemIncludes.h>
+
#include <vector>
#include <map>
private:
struct Offset {
- float myOffset[3];
+ vtkFloatingPointType myOffset[3];
};
QApplication::setOverrideCursor( Qt::waitCursor );
try {
- if (aActor = thePrs->CreateActor())
+ if ((aActor = thePrs->CreateActor()))
theViewWindow->AddActor(aActor);
} catch(std::exception& exc) {
SUIT_MessageBox::warn1
QApplication::restoreOverrideCursor();
}
- static bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
- float allBounds[6],
- const char* theActorClassName = "VISU_Actor")
+ static
+ bool
+ ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
+ vtkFloatingPointType allBounds[6],
+ const char* theActorClassName = "VISU_Actor")
{
vtkRenderer *aRen = theViewWindow->getRenderer();
vtkActorCollection *anActColl = aRen->GetActors();
vtkProp *prop;
- float *bounds;
- int somethingVisible = false;
+ vtkFloatingPointType *bounds;
+ int somethingVisible = false;
allBounds[0] = allBounds[2] = allBounds[4] = VTK_LARGE_FLOAT;
allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT;
void SetFitAll(SVTK_ViewWindow* theViewWindow)
{
- static float PRECISION = 0.000001;
- static float DEVIATION = 600;
- float XYZ_Bnd[6];
+ static vtkFloatingPointType PRECISION = 0.000001;
+ static vtkFloatingPointType DEVIATION = 600;
+ vtkFloatingPointType XYZ_Bnd[6];
if (!ComputeVisiblePropBounds(theViewWindow, XYZ_Bnd)) return;
- float absX = XYZ_Bnd[1] - XYZ_Bnd[0];
- float absY = XYZ_Bnd[3] - XYZ_Bnd[2];
- float absZ = XYZ_Bnd[5] - XYZ_Bnd[4];
+ vtkFloatingPointType absX = XYZ_Bnd[1] - XYZ_Bnd[0];
+ vtkFloatingPointType absY = XYZ_Bnd[3] - XYZ_Bnd[2];
+ vtkFloatingPointType absZ = XYZ_Bnd[5] - XYZ_Bnd[4];
enum CameraOrient {e3D, eFront, eLeft, eTop};
CameraOrient aCameraOrient = e3D;
if (absZ <= PRECISION) aCameraOrient = eTop;
else {
// all the three dimensions exceeds precision
- float dev_abs_XY = absX / absY;
- float dev_abs_YZ = absY / absZ;
- float dev_abs_XZ = absX / absZ;
+ vtkFloatingPointType dev_abs_XY = absX / absY;
+ vtkFloatingPointType dev_abs_YZ = absY / absZ;
+ vtkFloatingPointType dev_abs_XZ = absX / absZ;
if (dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION)
aCameraOrient = eLeft;
else {
if(aPlot){
QList<Plot2d_Curve> clist;
aPlot->getCurves( clist );
- SPlot2d_Curve* plotCurve = 0;
- SPlot2d_Curve* tmpCurve;
for (int i = 0; i < clist.count(); i++) {
- tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
- if (tmpCurve &&
- tmpCurve->hasIO() &&
- (tmpCurve->getIO()->getEntry() == anEntry))
- aPlot->eraseCurve(clist.at(i));
+ if(SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i)))
+ if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry))
+ aPlot->eraseCurve(clist.at(i));
}
}
}
SetItalicTitle(anOrigin->IsItalicTitle());
SetShadowTitle(anOrigin->IsShadowTitle());
SetTitFontType(anOrigin->GetTitFontType());
- float r,g,b;
+ vtkFloatingPointType r,g,b;
anOrigin->GetTitleColor(&r,&g,&b);
SetTitleColor(r,g,b);
void
VISU::ColoredPrs3d_i
-::GetTitleColor(float* theR, float* theG, float* theB)
+::GetTitleColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB)
{
*theR = myTitleColor[0];
*theG = myTitleColor[1];
void
VISU::ColoredPrs3d_i
-::SetTitleColor(float theR, float theG, float theB)
+::SetTitleColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB)
{
myTitleColor[0] = theR;
myTitleColor[1] = theG;
void
VISU::ColoredPrs3d_i
-::GetLabelColor(float* theR, float* theG, float* theB)
+::GetLabelColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB)
{
*theR = myLabelColor[0];
*theG = myLabelColor[1];
void
VISU::ColoredPrs3d_i
-::SetLabelColor(float theR, float theG, float theB)
+::SetLabelColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB)
{
myLabelColor[0] = theR;
myLabelColor[1] = theG;
// Scalar Bar origin
QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
- float aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
+ vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2;
aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
myPosition[0] = aXorigin;
- float aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
+ vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012;
aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
myPosition[1] = aYorigin;
VISU::ScalarMap::Orientation myOrientation;
std::string myTitle;
int myNumberOfLabels;
- float myPosition[2], myWidth, myHeight;
+ vtkFloatingPointType myPosition[2], myWidth, myHeight;
public:
//----------------------------------------------------------------------------
virtual
void
- GetTitleColor(float* theR, float* theG, float* theB);
+ GetTitleColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB);
virtual
void
- SetTitleColor(float theR, float theG, float theB);
+ SetTitleColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB);
virtual
bool
virtual
void
- GetLabelColor(float* theR, float* theG, float* theB);
+ GetLabelColor(vtkFloatingPointType* theR,
+ vtkFloatingPointType* theG,
+ vtkFloatingPointType* theB);
virtual
void
- SetLabelColor(float theR, float theG, float theB);
+ SetLabelColor(vtkFloatingPointType theR,
+ vtkFloatingPointType theG,
+ vtkFloatingPointType theB);
//----------------------------------------------------------------------------
protected:
bool myIsItalicTitle;
bool myIsShadowTitle;
int myTitFontType;
- float myTitleColor[3];
+ vtkFloatingPointType myTitleColor[3];
bool myIsBoldLabel;
bool myIsItalicLabel;
bool myIsShadowLabel;
int myLblFontType;
- float myLabelColor[3];
+ vtkFloatingPointType myLabelColor[3];
VISU_ScalarMapPL* myScalarMapPL;
bool myIsFixedRange;
if(theFamily->myIsDone)
return 0;
- const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily;
CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements();
if(!anIsOnAllElements){
using namespace VISU;
using namespace std;
-static float EPS_machine = 1.0E-7;
+static vtkFloatingPointType EPS_machine = 1.0E-7;
#ifdef _DEBUG_
static int MYDEBUG = 0;
anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
- typedef set<float> TXCont;
- typedef map<float,float> TXYMap;
+ typedef set<vtkFloatingPointType> TXCont;
+ typedef map<vtkFloatingPointType,vtkFloatingPointType> TXYMap;
typedef map<int,TXYMap> TXYMapCont;
typedef map<long,long> TLineIdCont;
TXCont aXCont;
TXYMapCont aXYMapCont;
TLineIdCont aLineIdCont; // Define internal numeration of lines
- const float *aDirLn = myCutLinesPL->GetDirLn();
- const float *aBasePnt = myCutLinesPL->GetBasePnt();
- const float *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
+ const vtkFloatingPointType *aDirLn = myCutLinesPL->GetDirLn();
+ const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt();
+ const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn();
for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){
vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine);
aDataSet->Update();
if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<<iLine<<"; aNbPoints = "<<aNbPoints);
aLineIdCont[iLine] = jLine++;
TXYMap& aXYMap = aXYMapCont[iLine];
- float aPnt[3], aVect[3], aDist;
+ vtkFloatingPointType aPnt[3], aVect[3], aDist;
for(int i = 0; i < aNbPoints; i++){
aDataSet->GetPoint(i,aPnt);
Sub(aPnt,aBasePnt,aVect);
TXYMap aNewXYMap;
TXYMap& aXYMap = aXYMapCont[iLine];
TXYMap::const_iterator aXYMapIter = aXYMap.begin();
- std::list<float> XKeys;
+ std::list<vtkFloatingPointType> XKeys;
for (;aXYMapIter != aXYMap.end() ; aXYMapIter++) XKeys.push_back(aXYMapIter->first);
XKeys.sort();
if (XKeys.size() > 1) {
- float a_first_indx = XKeys.front();
- float a_last_indx = XKeys.back();
+ vtkFloatingPointType a_first_indx = XKeys.front();
+ vtkFloatingPointType a_last_indx = XKeys.back();
if (a_first_indx > a_last_indx){
XKeys.reverse();
- float tmp = a_first_indx;
+ vtkFloatingPointType tmp = a_first_indx;
a_first_indx = a_last_indx;
a_last_indx = tmp;
}
- std::list<float>::const_iterator aIter = XKeys.begin();
+ std::list<vtkFloatingPointType>::const_iterator aIter = XKeys.begin();
for (int k=0;k<XKeys.size() and aIter != XKeys.end();k++,aIter++){
// Warning: value '1.0' come from workaround:
// see also aDist = vtkMath::Dot(aVect,aDirLn) / aBoundPrjLn[2];
aNewXYMap[aXYMapIter[0]->first] = aXYMapIter[0]->second;
aXCont.insert(aXYMapIter[0]->first);
for(; aXYMapIter[1] != aXYMap.end(); aXYMapIter[0]++, aXYMapIter[1]++){
- float aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
+ vtkFloatingPointType aY[3] = {aXYMapIter[0]->second, aXYMapIter[1]->second, 0.0};
aY[2] = (aY[0] + aY[1])/2.0;
- float aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
+ vtkFloatingPointType aX[3] = {aXYMapIter[0]->first, aXYMapIter[1]->first, 0.0};
aX[2] = (aX[0] + aX[1])/2.0;
aNewXYMap[aX[2]] = aY[2];
aXCont.insert(aX[2]);
aTableOfReal->SetNbColumns(iEnd);
TXCont::const_iterator aXContIter = aXCont.begin();
for(long i = 0; aXContIter != aXCont.end(); aXContIter++, i++){
- float aDist = *aXContIter;
+ vtkFloatingPointType aDist = *aXContIter;
aTableOfReal->PutValue(aDist,1,i+1);
aString.sprintf("%d",i);
aTableOfReal->SetColumnTitle(i+1,aString.latin1());
TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist);
// Can we find some value that belong to the line and have the same X coordinate?
if(aXYMapIter == aXYMap.end()) continue;
- float aVal = aXYMapIter->second;
+ vtkFloatingPointType aVal = aXYMapIter->second;
aTableOfReal->PutValue(aVal,iLineId+2,i+1);
}
}
int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() );
SetBiColor( aBicolor == 0 );
- float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
+ vtkFloatingPointType aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() );
SetSpacing( aSpacing );
- float aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
+ vtkFloatingPointType aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() );
SetScaleFactor( aScaleFactor );
int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
SetPrimitiveType( aPrimitiveType );
- float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
+ vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
SetClamp( aClamp );
int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) );
int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) );
SetMagnification( aMagnification / 100.0 );
- float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
+ vtkFloatingPointType anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() );
SetMagnificationIncrement( anIncrement );
bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() );
QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() );
SetColor( aColor );
- float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
+ vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
SetAlphaThreshold( anAlphaThreshold );
int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() );
void
VISU::GaussPoints_i
-::SetScaleFactor( float theScaleFactor )
+::SetScaleFactor( vtkFloatingPointType theScaleFactor )
{
myGaussPointsPL->SetScale( theScaleFactor );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetScaleFactor()
{
void
VISU::GaussPoints_i
-::SetAlphaThreshold( float theAlphaThreshold )
+::SetAlphaThreshold( vtkFloatingPointType theAlphaThreshold )
{
myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetAlphaThreshold()
{
return myGaussPointsPL->GetPrimitiveType();
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMaximumSupportedSize()
{
void
VISU::GaussPoints_i
-::SetClamp(float theClamp)
+::SetClamp(vtkFloatingPointType theClamp)
{
myGaussPointsPL->SetClamp( theClamp );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetClamp()
{
void
VISU::GaussPoints_i
-::SetGeomSize( float theGeomSize )
+::SetGeomSize( vtkFloatingPointType theGeomSize )
{
myGaussPointsPL->SetSize( theGeomSize );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetGeomSize()
{
void
VISU::GaussPoints_i
-::SetMinSize( float theMinSize )
+::SetMinSize( vtkFloatingPointType theMinSize )
{
myGaussPointsPL->SetMinSize( theMinSize );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMinSize()
{
void
VISU::GaussPoints_i
-::SetMaxSize( float theMaxSize )
+::SetMaxSize( vtkFloatingPointType theMaxSize )
{
myGaussPointsPL->SetMaxSize( theMaxSize );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMaxSize()
{
void
VISU::GaussPoints_i
-::SetMagnification( float theMagnification )
+::SetMagnification( vtkFloatingPointType theMagnification )
{
myGaussPointsPL->SetMagnification( theMagnification );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMagnification()
{
void
VISU::GaussPoints_i
-::SetMagnificationIncrement( float theIncrement )
+::SetMagnificationIncrement( vtkFloatingPointType theIncrement )
{
myGaussPointsPL->SetMagnificationIncrement( theIncrement );
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetMagnificationIncrement()
{
vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
+ aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
(myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
+ aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
(myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
anActor->SetBarVisibility(true);
myPipeLine->GetMapper()->SetScalarVisibility(1);
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMapPL->GetSourceRange(aRange);
aScalarBarCtrl->SetRangeLocal(aRange);
}
if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){
- float aRangeGlobal[2];
+ vtkFloatingPointType aRangeGlobal[2];
//
aRangeGlobal[0] = aTMinMax.first;
aRangeGlobal[1] = aTMinMax.second;
void
VISU::GaussPoints_i
-::SetSpacing(const float theSpacing)
+::SetSpacing(const vtkFloatingPointType theSpacing)
{
mySpacing = theSpacing;
}
-float
+vtkFloatingPointType
VISU::GaussPoints_i
::GetSpacing() const
{
void
SetIsDeformed( bool theIsDeformed );
- float
+ vtkFloatingPointType
GetScaleFactor();
void
- SetScaleFactor( float theScaleFactor );
+ SetScaleFactor( vtkFloatingPointType theScaleFactor );
//! Get color for Geometry mode of the presentation.
QColor
//! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
void
- SetAlphaThreshold(float theAlphaThreshold);
+ SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
//! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
- float
+ vtkFloatingPointType
GetAlphaThreshold();
//! Redirect the request to VISU_GaussPointsPL::SetResolution.
GetPrimitiveType();
//! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
- float
+ vtkFloatingPointType
GetMaximumSupportedSize();
//! Redirect the request to VISU_GaussPointsPL::SetClamp.
void
- SetClamp(float theClamp);
+ SetClamp(vtkFloatingPointType theClamp);
//! Redirect the request to VISU_GaussPointsPL::GetClamp.
- float
+ vtkFloatingPointType
GetClamp();
//! Redirect the request to VISU_GaussPointsPL::SetSize.
void
- SetGeomSize(float theGeomSize);
+ SetGeomSize(vtkFloatingPointType theGeomSize);
//! Redirect the request to VISU_GaussPointsPL::GetSize.
- float
+ vtkFloatingPointType
GetGeomSize();
//! Redirect the request to VISU_GaussPointsPL::SetMinSize.
void
- SetMinSize(float theMinSize);
+ SetMinSize(vtkFloatingPointType theMinSize);
//! Redirect the request to VISU_GaussPointsPL::GetMinSize.
- float
+ vtkFloatingPointType
GetMinSize();
//! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
void
- SetMaxSize(float theMaxSize);
+ SetMaxSize(vtkFloatingPointType theMaxSize);
//! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
- float
+ vtkFloatingPointType
GetMaxSize();
//! Redirect the request to VISU_GaussPointsPL::SetMagnification.
void
- SetMagnification(float theMagnification);
+ SetMagnification(vtkFloatingPointType theMagnification);
//! Redirect the request to VISU_GaussPointsPL::GetMagnification.
- float
+ vtkFloatingPointType
GetMagnification();
//! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
void
- SetMagnificationIncrement(float theIncrement);
+ SetMagnificationIncrement(vtkFloatingPointType theIncrement);
//! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
- float
+ vtkFloatingPointType
GetMagnificationIncrement();
//! Set flag indicating which scalar bar is active.
//! Set value of the distance between global and local scalar bars.
void
- SetSpacing(const float theSpacing);
+ SetSpacing(const vtkFloatingPointType theSpacing);
//! Get value of the distance between global and local scalar bars.
- float
+ vtkFloatingPointType
GetSpacing() const;
//! Let know is the global range is already calculated
bool myIsDispGlobalScalarBar;
bool myIsActiveLocalScalarBar;
QColor myColor;
- float mySpacing;
+ vtkFloatingPointType mySpacing;
int myFaceLimit;
QString myMainTexture;
}
-void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax){
- float aRange[2] = {theMin, theMax};
+void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
+{
+ vtkFloatingPointType aRange[2] = {theMin, theMax};
myIsoSurfacesPL->SetRange(aRange);
}
CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){
theActor->SetPrs3d(this);
theActor->SetShrinkFactor();
- theActor->SetPosition(myOffset);
+ theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
theActor->SetPipeLine(GetPipeLine());
theActor->SetFactory(this);
{
if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<theActor);
theActor->ShallowCopyPL(myPipeLine);
- theActor->SetPosition(myOffset);
+ theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
theActor->Modified();
}
void
VISU::Prs3d_i
-::SetPlaneParam (float theDir[3], float theDist, vtkPlane* thePlane)
+::SetPlaneParam (vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane)
{
myPipeLine->SetPlaneParam(theDir, theDist, thePlane);
}
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
-::GetBounds(float aBounds[6])
+::GetBounds(vtkFloatingPointType aBounds[6])
{
myPipeLine->GetMapper()->GetBounds(aBounds);
}
void
VISU::Prs3d_i
-::SetOffset(const float* theOffsets)
+::SetOffset(const CORBA::Float* theOffsets)
{
myOffset[0] = theOffsets[0];
myOffset[1] = theOffsets[1];
void
VISU::Prs3d_i
-::SetOffset(float theDx, float theDy, float theDz)
+::SetOffset(CORBA::Float theDx,
+ CORBA::Float theDy,
+ CORBA::Float theDz)
{
myOffset[0] = theDx;
myOffset[1] = theDy;
void
VISU::Prs3d_i
-::GetOffset(float* theOffsets)
+::GetOffset(CORBA::Float* theOffsets)
{
theOffsets[0] = myOffset[0];
theOffsets[1] = myOffset[1];
void
VISU::Prs3d_i
-::GetOffset(float& theDx, float& theDy, float& theDz)
+::GetOffset(CORBA::Float& theDx,
+ CORBA::Float& theDy,
+ CORBA::Float& theDz)
{
theDx = myOffset[0];
theDy = myOffset[1];
GetClippingPlane(vtkIdType theID) const;
void
- SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane);
+ SetPlaneParam(vtkFloatingPointType theDir[3],
+ vtkFloatingPointType theDist,
+ vtkPlane* thePlane);
//----------------------------------------------------------------------------
void
- GetBounds(float aBounds[6]);
+ GetBounds(vtkFloatingPointType aBounds[6]);
void
- SetOffset(const float* theOffsets);
+ SetOffset(const CORBA::Float* theOffsets);
virtual
void
- SetOffset(float theDx, float theDy, float theDz);
+ SetOffset(CORBA::Float theDx,
+ CORBA::Float theDy,
+ CORBA::Float theDz);
void
- GetOffset(float* theOffsets);
+ GetOffset(CORBA::Float* theOffsets);
virtual
void
- GetOffset(float& theDx, float& theDy, float& theDz);
+ GetOffset(CORBA::Float& theDx,
+ CORBA::Float& theDy,
+ CORBA::Float& theDz);
//----------------------------------------------------------------------------
protected:
CheckDataSet();
bool myAddToStudy;
- float myOffset[3];
+ CORBA::Float myOffset[3];
Result_i *myResult;
VISU_PipeLine *myPipeLine;
SALOMEDS::SObject_var mySObject;
//function : GetAxisInfo
//purpose :
//=======================================================================
-const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
- TAxis theAxis,
- gp_Dir& thePlaneNormal)
+const Result_i::TAxisInfo*
+Result_i
+::GetAxisInfo(const string& theMeshName,
+ TAxis theAxis,
+ gp_Dir& thePlaneNormal)
{
- const vector< float >* components = NULL;
+ const TAxisInfo* components = NULL;
if ( theAxis < AXIS_X || theAxis > AXIS_Z ) {
MESSAGE(" Bad axis index " << theAxis );
if ( nbPnt != 8 )
continue;
vtkPoints * points = cell->GetPoints();
- float* coords[ 4 ];
+ vtkFloatingPointType* coords[ 4 ];
coords[0] = points->GetPoint( 0 );
coords[1] = points->GetPoint( 1 );
coords[2] = points->GetPoint( 3 );
gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] );
for ( iAx = 0; iAx < nbAxes; ++iAx )
{
- float* coo = coords[ iAx + 1 ];
+ vtkFloatingPointType* coo = coords[ iAx + 1 ];
gp_Pnt p( coo[0], coo[1], coo[2] );
// min size
- float size = p0.SquareDistance( p );
+ vtkFloatingPointType size = p0.SquareDistance( p );
if ( size > FLT_MIN && size < minSize[ iAx ] )
minSize[ iAx ] = size;
// axis direction
// get and sort intermediate component values - projections of nodes
// on axis direction; define bnd box
- set< float > comps[ 3 ];
+ set< vtkFloatingPointType > comps[ 3 ];
Bnd_Box box;
vtkPoints * points = aMesh->GetPoints();
vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
for ( iP = 0; iP < nbP; ++iP )
{
- float* coo = points->GetPoint( iP );
+ vtkFloatingPointType* coo = points->GetPoint( iP );
gp_Pnt p( coo[0], coo[1], coo[2] );
box.Add( p );
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
const gp_Dir& dir = gInfo->myAxis[ iAx ];
- float dot = dir.XYZ() * p.XYZ();
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
comps[ iAx ].insert( dot );
}
}
// find a range of projections of bnd box corners on each axis
- float range[3], firstValue[3];
+ vtkFloatingPointType range[3], firstValue[3];
double x[2],y[2],z[2];
box.Get(x[0],y[0],z[0],x[1],y[1],z[1]);
for ( iAx = 0; iAx < nbAxes; ++iAx ) {
- set< float > bndComps;
+ set< vtkFloatingPointType > bndComps;
const gp_Dir& dir = gInfo->myAxis[ iAx ];
for ( int iX = 0; iX < 2; ++iX ) {
for ( int iY = 0; iY < 2; ++iY ) {
for ( int iZ = 0; iZ < 2; ++iZ ) {
gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] );
- float dot = dir.XYZ() * p.XYZ();
+ vtkFloatingPointType dot = dir.XYZ() * p.XYZ();
bndComps.insert( dot );
}
}
// compute component values
for ( iAx = 0; iAx < nbAxes; ++iAx )
{
- list< float > values;
+ list< vtkFloatingPointType > values;
int nbVals = 0;
- set< float >& comp = comps[ iAx ];
- set< float >::iterator val = comp.begin();
- float bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
- float tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
+ set< vtkFloatingPointType >& comp = comps[ iAx ];
+ set< vtkFloatingPointType >::iterator val = comp.begin();
+ vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ];
+ vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng;
for ( ; val != comp.end(); ++val ) {
- float value = ( *val - first ) / rng;
+ vtkFloatingPointType value = ( *val - first ) / rng;
if ( value > bnd ) {
values.push_back( value );
bnd = value + tol;
}
}
// store values in gInfo
- vector< float >& myComp = gInfo->myComponets[ iAx ];
+ vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ];
myComp.resize( nbVals );
- list< float >::iterator v = values.begin();
+ list< vtkFloatingPointType >::iterator v = values.begin();
for ( int i = 0; v != values.end(); ++v )
myComp[ i++ ] = *v;
}
#include "VISU_BoostSignals.h"
#include "SALOME_GenericObj_i.hh"
+#include <vtkSystemIncludes.h>
#include <gp_Dir.hxx>
#include <vector>
// Info on structured mesh contained in TInput
public:
typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis;
- const std::vector< float >* GetAxisInfo(const std::string& theMeshName,
- TAxis theAxis,
- gp_Dir& thePlaneNormal);
+ typedef std::vector< vtkFloatingPointType > TAxisInfo;
+ const TAxisInfo* GetAxisInfo(const std::string& theMeshName,
+ TAxis theAxis,
+ gp_Dir& thePlaneNormal);
// Return i,j or k values and cutting plane normal for theAxis.
// In the case of any problems, return NULL pointer
private:
struct TGridInfo {
- std::vector< float > myComponets[ 3 ];
- gp_Dir myAxis [ 3 ];
+ TAxisInfo myComponets[ 3 ];
+ gp_Dir myAxis [ 3 ];
};
- map< string, TGridInfo > myMeshName2GridInfoMap;
+ std::map< std::string, TGridInfo > myMeshName2GridInfoMap;
};
Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
}
void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){
- float aRange[2];
- aRange[0] = float(theMinRange);
- aRange[1] = float(theMaxRange);
+ vtkFloatingPointType aRange[2];
+ aRange[0] = vtkFloatingPointType(theMinRange);
+ aRange[1] = vtkFloatingPointType(theMaxRange);
myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
}
CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
return aRange[0];
}
CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){
- float aRange[2];
+ vtkFloatingPointType aRange[2];
myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
return aRange[1];
}
void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
const char* theFieldName,
- const int theIteration,
- const VISU::TEntity theEntity)
+ int theIteration,
+ VISU::TEntity theEntity)
{
if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
const char* theFieldName,
- const long theIteration,
- const VISU::Entity theEntity)
+ CORBA::Long theIteration,
+ VISU::Entity theEntity)
{
this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
}
virtual void SetScalarField(const char* theMeshName,
const char* theFieldName,
- const int theIteration,
- const VISU::TEntity theEntity);
+ int theIteration,
+ VISU::TEntity theEntity);
virtual void SetScalarField(const char* theMeshName,
const char* theFieldName,
- const long theIteration,
- const VISU::Entity theEntity);
+ CORBA::Long theIteration,
+ VISU::Entity theEntity);
virtual void SetScalarFieldName(const char* theName);
virtual std::string GetScalarFieldName();
{
if(theMin > theMax)
return;
- float aScalarRange[2] = {theMin, theMax};
+ vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
myScalarMapPL->SetScalarRange(aScalarRange);
myIsFixedRange = true;
}
vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
aTitleProp->SetFontFamily(myTitFontType);
- aTitleProp->SetColor(myTitleColor);
+ aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]);
(myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff();
(myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
(myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
aLabelProp->SetFontFamily(myLblFontType);
- aLabelProp->SetColor(myLabelColor);
+ aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]);
(myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff();
(myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
class SVTK_ViewWindow;
class VISU_Actor;
-namespace VISU{
+namespace VISU
+{
class Result_i;
class ColoredPrs3d_i;
}
std::vector<VISU::ColoredPrs3d_i*> myPrs; // Presentations
std::vector<VISU_Actor*> myActors; // Actors
std::vector<double> myTiming; // time values
- float myOffset[3];
+ CORBA::Float myOffset[3];
};
}else{
if(SUIT_ViewManager* aViewManager = myApplication->activeViewManager()){
if(SUIT_ViewWindow* aView = aViewManager->getActiveView()){
- if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aView)){
+ if(dynamic_cast<SVTK_ViewWindow*>(aView)){
myView3D->myViewManager = aViewManager;
myResult = aViewManager->getActiveView();
}
{
Storable::DataToStream(theStr,"myType",VISU::TVIEW3D);
- float backint[3];
+ vtkFloatingPointType backint[3];
GetRenderer(theViewWindow)->GetBackground(backint);
Storable::DataToStream(theStr,"myColor.R",backint[0]);
Storable::DataToStream(theStr,"myColor.G",backint[1]);
SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow)
{
SALOMEDS::Color aColor;
- float backint[3];
+ vtkFloatingPointType backint[3];
GetRenderer(theViewWindow)->GetBackground(backint);
aColor.R = backint[0]; aColor.G = backint[1]; aColor.B = backint[2];
return aColor;
myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents);
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
setCaption( tr( "PICKING_DLG_TITLE" ) );
setSizeGripEnabled(TRUE);
myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
- float* aColor = myPickingSettings->GetColor();
+ vtkFloatingPointType* aColor = myPickingSettings->GetColor();
mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ),
( int )( aColor[1] * 255.0 ),
( int )( aColor[2] * 255.0 ) ) );
myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() );
QColor aButtonColor = mySelectionColorButton->paletteBackgroundColor();
- float aColor[3];
+ vtkFloatingPointType aColor[3];
aColor[0] = aButtonColor.red() / 255.0;
aColor[1] = aButtonColor.green() / 255.0;
aColor[2] = aButtonColor.blue() / 255.0;
myEventCallbackCommand.GetPointer(),
myPriority);
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
setCaption( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) );
setSizeGripEnabled(TRUE);
myRadiusGroup->hide();
VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- float origin[3];
+ vtkFloatingPointType origin[3];
pPlanesWidget->GetOrigin( origin );
myXOriginSpinBox->setValue( origin[0] );
myYOriginSpinBox->setValue( origin[1] );
myZOriginSpinBox->setValue( origin[2] );
- float normal[3];
+ vtkFloatingPointType normal[3];
pPlanesWidget->GetNormal( normal );
myDXDirectionSpinBox->setValue( normal[0] );
myDYDirectionSpinBox->setValue( normal[1] );
myRadiusGroup->show();
VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- float origin[3], aRadius;
+ vtkFloatingPointType origin[3], aRadius;
pSphereWidget->GetCenter(origin);
myXOriginSpinBox->setValue( origin[0] );
myYOriginSpinBox->setValue( origin[1] );
void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints()
{
int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
- float aClamp = 200.0;
+ vtkFloatingPointType aClamp = 200.0;
QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
- float anAlphaThreshold = 0.1;
+ vtkFloatingPointType anAlphaThreshold = 0.1;
int aResolution = 8;
int aMinSize = 3;
int aMaxSize = 33;
int aMagnification = 100;
- float anIncrement = 2.0;
+ vtkFloatingPointType anIncrement = 2.0;
if( !myInsideCursorSettings->GetInitial() )
{
void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints()
{
- float aClamp = 256.0;
+ vtkFloatingPointType aClamp = 256.0;
int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite;
QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp";
QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp";
- float anAlphaThreshold = 0.1;
+ vtkFloatingPointType anAlphaThreshold = 0.1;
int aResolution = 8;
int aSize = 25;
bool aUniform = false;
myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() );
myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() );
- float* aColor = myOutsideCursorSettings->GetColor();
+ vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor();
myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ),
( int )( aColor[1] * 255.0 ),
( int )( aColor[2] * 255.0 ) ) );
if( myIsPlaneSegmentation )
{
VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget();
- float origin[3];
+ vtkFloatingPointType origin[3];
origin[0] = myXOriginSpinBox->value();
origin[1] = myYOriginSpinBox->value();
origin[2] = myZOriginSpinBox->value();
pPlanesWidget->SetOrigin( origin );
- float normal[3];
+ vtkFloatingPointType normal[3];
normal[0] = myDXDirectionSpinBox->value();
normal[1] = myDYDirectionSpinBox->value();
normal[2] = myDZDirectionSpinBox->value();
else
{
VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget();
- float origin[3], aRadius;
+ vtkFloatingPointType origin[3], aRadius;
origin[0] = myXOriginSpinBox->value();
origin[1] = myYOriginSpinBox->value();
origin[2] = myZOriginSpinBox->value();
myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() );
QColor aButtonColor = myOutsideSizeBox->getColor();
- float aColor[3];
+ vtkFloatingPointType aColor[3];
aColor[0] = aButtonColor.red() / 255.0;
aColor[1] = aButtonColor.green() / 255.0;
aColor[2] = aButtonColor.blue() / 255.0;
VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) :
QVBox( parent )
{
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
layout()->setSpacing( 0 );
layout()->setMargin( 0 );