# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(FindVTK)
-
-SET(VTK_INCLUDES)
-FOREACH(dir ${VTK_INCLUDE_DIRS})
- SET(VTK_INCLUDES ${VTK_INCLUDES} -I${dir})
-ENDFOREACH(dir ${VTK_INCLUDE_DIRS})
-
-SET(VTK_LIBS)
-FIND_LIBRARY(VTK_COMMON vtkCommon PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_COMMON})
-FIND_LIBRARY(VTK_GRAPHICS vtkGraphics PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_GRAPHICS})
-FIND_LIBRARY(VTK_IMAGING vtkImaging PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_IMAGING})
-FIND_LIBRARY(VTK_FILTERING vtkFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_FILTERING})
-FIND_LIBRARY(VTK_IO vtkIO PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_IO})
-FIND_LIBRARY(VTK_RENDERING vtkRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_RENDERING})
-FIND_LIBRARY(VTK_HYBRID vtkHybrid PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_HYBRID})
-FIND_LIBRARY(VTK_PARALLEL vtkParallel PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_PARALLEL})
-FIND_LIBRARY(VTK_WIDGETS vtkWidgets PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_WIDGETS})
-FIND_LIBRARY(VTK_GENERIC_FILTERING vtkGenericFiltering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_GENERIC_FILTERING})
-FIND_LIBRARY(VTK_INFOVIS vtkInfovis PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_INFOVIS})
-FIND_LIBRARY(VTK_VOLUME_RENDERING vtkVolumeRendering PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-SET(VTK_LIBS ${VTK_LIBS} ${VTK_VOLUME_RENDERING})
-
-FIND_LIBRARY(vtkCommonPythonD vtkCommonPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-FIND_LIBRARY(vtkGraphicsPythonD vtkGraphicsPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-FIND_LIBRARY(vtkImagingPythonD vtkImagingPythonD PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-FIND_LIBRARY(vtkPythonCore vtkPythonCore PATHS ${VTK_LIBRARY_DIRS} NO_DEFAULT_PATH)
-
-
-#IF(NOT WINDOWS)
-# IF(VTK_MAJOR_VERSION STREQUAL 5)
-# IF(VTK_MINOR_VERSION STREQUAL 0)
-# SET(VTK_INCLUDES ${VTK_INCLUDES} -Wno-deprecated)
-# ENDIF(VTK_MINOR_VERSION STREQUAL 0)
-# ENDIF(VTK_MAJOR_VERSION STREQUAL 5)
-#ENDIF(NOT WINDOWS)
-
-SET(VTK_INCLUDES ${VTK_INCLUDES} -DVTK_EXCLUDE_STRSTREAM_HEADERS)
-SET(VTK_DEFINITIONS -DVTK_EXCLUDE_STRSTREAM_HEADERS)
\ No newline at end of file
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR)
+FIND_PACKAGE(VTK 6.0 REQUIRED NO_MODULE)
+INCLUDE(${VTK_USE_FILE})
echo ---------------------------------------------
echo
-CHECK_VTK
+CHECK_PYVTK
echo
echo ---------------------------------------------
-I$(srcdir)/../STD -I$(srcdir)/../VTKViewer -I$(srcdir)/../OBJECT \
@CAS_CPPFLAGS@
-libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(OGL_LIBS) \
- ../LightApp/libLightApp.la \
- -lvtkCommonPythonD -lvtkGraphicsPythonD -lvtkImagingPythonD -lvtkPythonCore
+libSalomePy_la_LDFLAGS = $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) ${VTK_PYLIBS} $(OGL_LIBS) \
+ ../LightApp/libLightApp.la
-I$(srcdir)/../OBJECT \
-I$(srcdir)/../Prs \
-I$(srcdir)/../VTKViewer \
- -I$(srcdir)/../OpenGLUtils
+ -I$(srcdir)/../OpenGLUtils \
+ -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingOpenGL,vtkRenderingFreeTypeOpenGL)"
libSVTK_la_LDFLAGS = \
$(VTK_LIBS) $(OGL_LIBS) \
{
int anEdgeId = 0;
if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) {
- vtkFloatingPointType aPickPosition[3];
+ double aPickPosition[3];
thePicker->GetPickPosition(aPickPosition);
- vtkFloatingPointType aMinDist = 1000000.0, aDist = 0;
+ double aMinDist = 1000000.0, aDist = 0;
for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){
if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){
int subId;
- vtkFloatingPointType pcoords[3], closestPoint[3], weights[3];
+ double pcoords[3], closestPoint[3], weights[3];
aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights);
if (aDist < aMinDist) {
aMinDist = aDist;
myOutline->Delete();
vtkPolyDataMapper* anOutlineMapper = vtkPolyDataMapper::New();
- anOutlineMapper->SetInput(myOutline->GetOutput());
+ anOutlineMapper->SetInputConnection(myOutline->GetOutputPort());
myOutlineActor->Delete();
myOutlineActor->SetMapper( anOutlineMapper );
aForegroundColor.greenF(),
aForegroundColor.blueF());
- vtkFloatingPointType aGroupNamesTransparency = 0.5;
+ double aGroupNamesTransparency = 0.5;
aGroupNamesTransparency = aResourceMgr->doubleValue( "VTKViewer", "group_names_transparency", aGroupNamesTransparency );
myNameActor->SetTransparency(aGroupNamesTransparency);
}
*/
void
SALOME_Actor
-::SetPosition(vtkFloatingPointType _arg1,
- vtkFloatingPointType _arg2,
- vtkFloatingPointType _arg3)
+::SetPosition(double _arg1,
+ double _arg2,
+ double _arg3)
{
Superclass::SetPosition(_arg1,_arg2,_arg3);
*/
void
SALOME_Actor
-::SetPosition(vtkFloatingPointType _arg[3])
+::SetPosition(double _arg[3])
{
SetPosition(_arg[0],_arg[1],_arg[2]);
}
SALOME_Actor
::highlight(bool theIsHighlight)
{
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
vtkDataSet * aDataSet = GetHighlightedDataSet();
aDataSet->GetBounds(aBounds);
myOutline->SetBounds(aBounds);
+ myOutline->Update();
myOutlineActor->SetVisibility( GetVisibility() && theIsHighlight );
Superclass::highlight(theIsHighlight);
myPreHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
- vtkFloatingPointType x = theSelectionEvent->myX;
- vtkFloatingPointType y = theSelectionEvent->myY;
- vtkFloatingPointType z = 0.0;
+ double x = theSelectionEvent->myX;
+ double y = theSelectionEvent->myY;
+ double z = 0.0;
if( !theIsHighlight ) {
if ( hasIO() ) {
myHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
- vtkFloatingPointType x = theSelectionEvent->myX;
- vtkFloatingPointType y = theSelectionEvent->myY;
- vtkFloatingPointType z = 0.0;
+ double x = theSelectionEvent->myX;
+ double y = theSelectionEvent->myY;
+ double z = 0.0;
if( !theSelectionEvent->myIsRectangle ) {
switch(aSelectionMode){
break;
}
}else{
- vtkFloatingPointType xLast = theSelectionEvent->myLastX;
- vtkFloatingPointType yLast = theSelectionEvent->myLastY;
- vtkFloatingPointType zLast = 0.0;
+ double xLast = theSelectionEvent->myLastX;
+ double yLast = theSelectionEvent->myLastY;
+ double zLast = 0.0;
- vtkFloatingPointType x1 = x < xLast ? x : xLast;
- vtkFloatingPointType y1 = y < yLast ? y : yLast;
- vtkFloatingPointType z1 = z < zLast ? z : zLast;
- vtkFloatingPointType x2 = x > xLast ? x : xLast;
- vtkFloatingPointType y2 = y > yLast ? y : yLast;
- vtkFloatingPointType z2 = z > zLast ? z : zLast;
+ double x1 = x < xLast ? x : xLast;
+ double y1 = y < yLast ? y : yLast;
+ double z1 = z < zLast ? z : zLast;
+ double x2 = x > xLast ? x : xLast;
+ double y2 = y > yLast ? y : yLast;
+ double z2 = z > zLast ? z : zLast;
switch(aSelectionMode){
case NodeSelection: {
}
case ActorSelection :
{
- vtkFloatingPointType aPnt[3];
- vtkFloatingPointType* aBounds = GetBounds();
+ double aPnt[3];
+ double* aBounds = GetBounds();
bool anIsPicked = true;
for( int i = 0; i <= 1; i++ ) {
//! Apply additional position
virtual
void
- SetPosition(vtkFloatingPointType _arg1,
- vtkFloatingPointType _arg2,
- vtkFloatingPointType _arg3);
+ SetPosition(double _arg1,
+ double _arg2,
+ double _arg3);
//! Apply additional position
virtual
void
- SetPosition(vtkFloatingPointType _arg[3]);
+ SetPosition(double _arg[3]);
//----------------------------------------------------------------------------
//! Visibility management
aPoints->SetNumberOfPoints(aNbOfParts);
for(vtkIdType i = 0; i < aNbOfParts; i++){
int aPartId = theMapIndex( i+1 );
- if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){
+ if(double* aCoord = theMapActor->GetNodeCoord(aPartId)){
aPoints->SetPoint(i,aCoord);
// Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
// from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
#include <vtkProperty.h>
#include <vtkProperty2D.h>
-vtkCxxRevisionMacro(SVTK_CubeAxesActor2D, "$Revision$");
vtkStandardNewMacro(SVTK_CubeAxesActor2D);
// Instantiate this object.
this->rgridMapperYZ = vtkPolyDataMapper::New();
this->rgridMapperXZ = vtkPolyDataMapper::New();
- this->rgridMapperXY->SetInput(this->planeXY->GetOutput());
- this->rgridMapperYZ->SetInput(this->planeYZ->GetOutput());
- this->rgridMapperXZ->SetInput(this->planeXZ->GetOutput());
+ this->rgridMapperXY->SetInputConnection(this->planeXY->GetOutputPort());
+ this->rgridMapperYZ->SetInputConnection(this->planeYZ->GetOutputPort());
+ this->rgridMapperXZ->SetInputConnection(this->planeXZ->GetOutputPort());
this->wireActorXY->SetMapper(rgridMapperXY);
this->wireActorYZ->SetMapper(rgridMapperYZ);
return renderedSomething;
}
-static void ChangeValues(vtkFloatingPointType* aArray1,
- vtkFloatingPointType* aArray2,
- vtkFloatingPointType *aRange1,
- vtkFloatingPointType* aRange2,
+static void ChangeValues(double* aArray1,
+ double* aArray2,
+ double *aRange1,
+ double* aRange2,
bool theY)
{
- vtkFloatingPointType tmp=-1000;
+ double tmp=-1000;
if (!theY){
for (int i=0; i<4; i++){
tmp = aArray1[i]; aArray1[i] = aArray2[i]; aArray2[i] = tmp;
}
}
-static void ChangeArrays(vtkFloatingPointType* xCoords,
- vtkFloatingPointType* yCoords,
- vtkFloatingPointType* zCoords,
- vtkFloatingPointType* xRange,
- vtkFloatingPointType* yRange,
- vtkFloatingPointType* zRange,
+static void ChangeArrays(double* xCoords,
+ double* yCoords,
+ double* zCoords,
+ double* xRange,
+ double* yRange,
+ double* zRange,
const int xAxes,
const int yAxes,
const int zAxes)
// with the boundary of the viewport (minus borders).
int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
{
- vtkFloatingPointType bounds[6], slope = 0.0, minSlope, num, den;
- vtkFloatingPointType pts[8][3], d2, d2Min, min;
+ double bounds[6], slope = 0.0, minSlope, num, den;
+ double pts[8][3], d2, d2Min, min;
int i, idx = 0;
int xIdx, yIdx = 0, zIdx = 0, zIdx2, renderedSomething=0;
int xAxes = 0, yAxes, zAxes;
}
else
{
- vtkFloatingPointType e1[2], e2[2], e3[2];
+ double e1[2], e2[2], e3[2];
// Find distance to origin
d2Min = VTK_LARGE_FLOAT;
}
// Setup the axes for plotting
- vtkFloatingPointType xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2];
+ double xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2];
this->AdjustAxes(pts, bounds, idx, xIdx, yIdx, zIdx, zIdx2,
xAxes, yAxes, zAxes,
xCoords, yCoords, zCoords, xRange, yRange, zRange);
// XCoords coordinates for X grid
vtkFloatArray *XCoords = vtkFloatArray::New();
for(int i=0;i<numOfLabelsX;i++){
- vtkFloatingPointType val = bounds[0]+i*(bounds[1]-bounds[0])/(numOfLabelsX-1);
+ double val = bounds[0]+i*(bounds[1]-bounds[0])/(numOfLabelsX-1);
XCoords->InsertNextValue(val);
}
// YCoords coordinates for Y grid
vtkFloatArray *YCoords = vtkFloatArray::New();
for(int i=0;i<numOfLabelsX;i++){
- vtkFloatingPointType val = bounds[2]+i*(bounds[3]-bounds[2])/(numOfLabelsY-1);
+ double val = bounds[2]+i*(bounds[3]-bounds[2])/(numOfLabelsY-1);
YCoords->InsertNextValue(val);
}
// ZCoords coordinates for Z grid
vtkFloatArray *ZCoords = vtkFloatArray::New();
for(int i=0;i<numOfLabelsZ;i++){
- vtkFloatingPointType val = bounds[4]+i*(bounds[5]-bounds[4])/(numOfLabelsZ-1);
+ double val = bounds[4]+i*(bounds[5]-bounds[4])/(numOfLabelsZ-1);
ZCoords->InsertNextValue(val);
}
rgrid->SetYCoordinates(YCoords);
rgrid->SetZCoordinates(ZCoords);
- this->planeXY->SetInput(rgrid);
- this->planeYZ->SetInput(rgrid);
- this->planeXZ->SetInput(rgrid);
+ this->planeXY->SetInputData(rgrid);
+ this->planeYZ->SetInputData(rgrid);
+ this->planeXZ->SetInputData(rgrid);
rgrid->Delete();
- vtkFloatingPointType aCPosition[3];
- vtkFloatingPointType aCDirection[3];
+ double aCPosition[3];
+ double aCDirection[3];
this->Camera->GetPosition(aCPosition);
this->Camera->GetDirectionOfProjection(aCDirection);
bool replaceXY=false;
bool replaceYZ=false;
bool replaceXZ=false;
- vtkFloatingPointType p[6][3]; // centers of planes
- vtkFloatingPointType vecs[6][3]; // 6 vectors from camera position to centers
+ double p[6][3]; // centers of planes
+ double vecs[6][3]; // 6 vectors from camera position to centers
- vtkFloatingPointType aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2;
- vtkFloatingPointType aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2;
- vtkFloatingPointType aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2;
+ double aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2;
+ double aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2;
+ double aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2;
// plane XY
p[0][0] = aMiddleX; // plane X=0.5 Y=0.5 Z=0
YCoords->Delete();
ZCoords->Delete();
- vtkFloatingPointType color[3];
+ double color[3];
this->GetProperty()->GetColor(color);
this->wireActorXY->GetProperty()->SetColor(color);
#endif
#ifndef WIN32
-class VTK_HYBRID_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
+class VTKRENDERINGANNOTATION_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
#else
class SVTK_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D
#endif
{
public:
- vtkTypeRevisionMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D);
+ vtkTypeMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D);
// Description:
// Instantiate object with bold, italic, and shadow enabled; font family
vtkTextProperty* aTitleProp = theActor->GetTitleTextProperty();
if (aTitleProp !=0)
{
- vtkFloatingPointType c[ 3 ];
+ double c[ 3 ];
aTitleProp->GetColor(c);
aTitleColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255));
aTitleFontFamily = aTitleProp->GetFontFamily();
vtkTextProperty* aLabelsProp = theActor->GetLabelTextProperty();
if (aLabelsProp !=0)
{
- vtkFloatingPointType c[ 3 ];
+ double c[ 3 ];
aLabelsProp->GetColor(c);
aLabelsColor.setRgb((int)(c[ 0 ] * 255), (int)(c[ 1 ] * 255), (int)(c[ 2 ] * 255));
aLabelsFontFamily = aLabelsProp->GetFontFamily();
{
if(theMapper){
int anId = 0;
- myPassFilter[ anId ]->SetInput( theMapper->GetInput() );
- myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myPassFilter[ anId ]->SetInputData( theMapper->GetInput() );
+ myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 1
- myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 2
- myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() );
- myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() );
+ myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 3
- myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
+ myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 4
- myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
- myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() );
+ myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 5
- if(VTKViewer_DataSetMapper* aMapper = dynamic_cast<VTKViewer_DataSetMapper*>(theMapper)){
- aMapper->SetInput(myPassFilter[anId]->GetOutput());
- }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast<VTKViewer_PolyDataMapper*>(theMapper)){
- aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
- }
+ theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
}
Superclass::SetMapper(theMapper);
}
SVTK_DeviceActor
::SetInput(vtkDataSet* theDataSet)
{
- myMapper->SetInput(theDataSet);
+ myMapper->SetInputData(theDataSet);
InitPipeLine(myMapper);
}
if ( !myIsShrinkable )
return;
- if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+ if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() )
{
- aDataSet->Update();
- int numCells=aDataSet->GetNumberOfCells();
- int numPts = aDataSet->GetNumberOfPoints();
- //It's impossible to use to apply "shrink" for "empty" dataset
- if (numCells < 1 || numPts < 1)
- return;
- myShrinkFilter->SetInput( aDataSet );
- myPassFilter[ 1 ]->SetInput( myShrinkFilter->GetOutput() );
+ myPassFilter[ 0 ]->Update();
+ if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+ {
+ int numCells=aDataSet->GetNumberOfCells();
+ int numPts = aDataSet->GetNumberOfPoints();
+ //It's impossible to use to apply "shrink" for "empty" dataset
+ if (numCells < 1 || numPts < 1)
+ return;
+ }
+ myShrinkFilter->SetInputConnection( anOutput );
+ myPassFilter[ 1 ]->SetInputConnection( myShrinkFilter->GetOutputPort() );
myIsShrunk = true;
}
}
::UnShrink()
{
if ( !myIsShrunk ) return;
- if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+ if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() )
{
- myPassFilter[ 1 ]->SetInput( aDataSet );
+ myPassFilter[ 1 ]->SetInputConnection( anOutput );
myIsShrunk = false;
}
}
/*!
\return shrink factor
*/
-vtkFloatingPointType
+double
SVTK_DeviceActor
::GetShrinkFactor()
{
*/
void
SVTK_DeviceActor
-::SetShrinkFactor(vtkFloatingPointType theValue)
+::SetShrinkFactor(double theValue)
{
myShrinkFilter->SetShrinkFactor(theValue);
}
if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled )
return;
- if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() )
+ if ( vtkAlgorithmOutput* aPolyData = myPassFilter[ 2 ]->GetOutputPort() )
{
if( theIsFeatureEdgesEnabled )
{
- aPolyData->Update();
- myFeatureEdges->SetInput( aPolyData );
- myPassFilter[ 3 ]->SetInput( myFeatureEdges->GetOutput() );
+ myPassFilter[ 2 ]->Update();
+ myFeatureEdges->SetInputConnection( aPolyData );
+ myPassFilter[ 3 ]->SetInputConnection( myFeatureEdges->GetOutputPort() );
myIsFeatureEdgesEnabled = true;
}
else
{
- myPassFilter[3]->SetInput( aPolyData );
+ myPassFilter[3]->SetInputConnection( aPolyData );
myIsFeatureEdgesEnabled = false;
}
myIsFeatureEdgesEnabled = theIsFeatureEdgesEnabled;
/*!
\return angle of feature edges' filter
*/
-vtkFloatingPointType
+double
SVTK_DeviceActor
::GetFeatureEdgesAngle()
{
*/
void
SVTK_DeviceActor
-::SetFeatureEdgesAngle(vtkFloatingPointType theAngle)
+::SetFeatureEdgesAngle(double theAngle)
{
myFeatureEdges->SetFeatureAngle(theAngle);
}
/*!
\return default point size
*/
-vtkFloatingPointType
+double
SVTK_DeviceActor
::GetDefaultPointSize()
{
/*!
\return default line width
*/
-vtkFloatingPointType
+double
SVTK_DeviceActor
::GetDefaultLineWidth()
{
/*!
Get coordinates of a node for given object index
*/
-vtkFloatingPointType*
+double*
SVTK_DeviceActor
::GetNodeCoord(int theObjID)
{
{
if(myIsResolveCoincidentTopology){
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
- vtkFloatingPointType aFactor, aUnit;
+ double aFactor, aUnit;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
*/
void
SVTK_DeviceActor
-::SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units)
+::SetPolygonOffsetParameters(double factor,
+ double units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
*/
void
SVTK_DeviceActor
-::GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units)
+::GetPolygonOffsetParameters(double& factor,
+ double& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
/*!
* Set Max angle for representation 2D quadratic element as arked polygon
*/
-void SVTK_DeviceActor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
+void SVTK_DeviceActor::SetQuadraticArcAngle(double theMaxAngle){
myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
}
/*!
* Return Max angle of the representation 2D quadratic element as arked polygon
*/
-vtkFloatingPointType SVTK_DeviceActor::GetQuadraticArcAngle(){
+double SVTK_DeviceActor::GetQuadraticArcAngle(){
return myGeomFilter->GetQuadraticArcAngle();
}
GetNodeObjId(int theVtkID);
virtual
- vtkFloatingPointType*
+ double*
GetNodeCoord(int theObjID);
virtual
/** @name For shrink mamnagement purpose */
//@{
- vtkFloatingPointType
+ double
GetShrinkFactor();
virtual
void
- SetShrinkFactor(vtkFloatingPointType value);
+ SetShrinkFactor(double value);
virtual
void
SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
virtual
- vtkFloatingPointType
+ double
GetFeatureEdgesAngle();
virtual
void
- SetFeatureEdgesAngle(vtkFloatingPointType theAngle);
+ SetFeatureEdgesAngle(double theAngle);
virtual
void
GetRepresentation();
virtual
- vtkFloatingPointType
+ double
GetDefaultPointSize();
virtual
- vtkFloatingPointType
+ double
GetDefaultLineWidth();
bool
virtual void SetQuadraticArcMode(bool theFlag);
virtual bool GetQuadraticArcMode();
- virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
- virtual vtkFloatingPointType GetQuadraticArcAngle();
+ virtual void SetQuadraticArcAngle(double theMaxAngle);
+ virtual double GetQuadraticArcAngle();
virtual
void
bool myIsFeatureEdgesEnabled;
bool myIsResolveCoincidentTopology;
- vtkFloatingPointType myPolygonOffsetFactor;
- vtkFloatingPointType myPolygonOffsetUnits;
+ double myPolygonOffsetFactor;
+ double myPolygonOffsetUnits;
- void SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units);
- void GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units);
+ void SetPolygonOffsetParameters(double factor,
+ double units);
+ void GetPolygonOffsetParameters(double& factor,
+ double& units);
SVTK_DeviceActor();
~SVTK_DeviceActor();
#include <QSemaphore>
+#include <vtkAlgorithm.h>
#include <vtkImageData.h>
#include <vtkImageClip.h>
#include <vtkJPEGWriter.h>
//----------------------------------------------------------------------------
SVTK_ImageWriter
::SVTK_ImageWriter(QSemaphore* theSemaphore,
+ vtkAlgorithm* theAlgorithm,
vtkImageData* theImageData,
const std::string& theName,
int theProgressive,
int theQuality):
mySemaphore(theSemaphore),
+ myAlgorithm(theAlgorithm),
myImageData(theImageData),
myName(theName),
myProgressive(theProgressive),
::run()
{
vtkJPEGWriter *aWriter = vtkJPEGWriter::New();
- vtkImageData *anImageData = myImageData;
+ vtkAlgorithmOutput *anImageData = 0;
vtkSmartPointer<vtkImageClip> anImageClip;
//
if(myConstraint16Flag){
int uExtent[6];
- myImageData->UpdateInformation();
- myImageData->GetUpdateExtent(uExtent);
+ myAlgorithm->UpdateInformation();
+ myAlgorithm->GetUpdateExtent(uExtent);
unsigned int width = uExtent[1] - uExtent[0] + 1;
unsigned int height = uExtent[3] - uExtent[2] + 1;
width = (width / 16) * 16;
anImageClip = vtkImageClip::New();
anImageClip->Delete();
- anImageClip->SetInput(myImageData);
+ anImageClip->SetInputData(myImageData);
anImageClip->SetOutputWholeExtent(uExtent);
anImageClip->ClipDataOn();
- anImageData = anImageClip->GetOutput();
+ anImageData = anImageClip->GetOutputPort();
}
//
aWriter->WriteToMemoryOff();
aWriter->SetFileName(myName.c_str());
aWriter->SetQuality(myQuality);
aWriter->SetProgressive(myProgressive);
- aWriter->SetInput(anImageData);
+ if(myConstraint16Flag)
+ aWriter->SetInputConnection(anImageData);
+ else
+ aWriter->SetInputData(myImageData);
aWriter->Write();
aWriter->Delete();
#include <QThread>
#include <string>
+class vtkAlgorithm;
class vtkImageData;
class QSemaphore;
{
public:
SVTK_ImageWriter(QSemaphore* theSemaphore,
+ vtkAlgorithm* theAlgorithm,
vtkImageData* theImageData,
const std::string& theName,
int theProgressive,
protected:
QSemaphore* mySemaphore;
+ vtkAlgorithm *myAlgorithm;
vtkImageData *myImageData;
std::string myName;
int myProgressive;
#include "SVTK_ImageWriterMgr.h"
#include "SVTK_ImageWriter.h"
+#include <vtkAlgorithm.h>
#include <vtkImageData.h>
#include <QSemaphore>
//----------------------------------------------------------------------------
void
SVTK_ImageWriterMgr
-::StartImageWriter(vtkImageData *theImageData,
+::StartImageWriter(vtkAlgorithm *theAlgorithm,
+ vtkImageData *theImageData,
const std::string& theName,
const int theProgressive,
const int theQuality)
{
SVTK_ImageWriter *anImageWriter =
new SVTK_ImageWriter(mySemaphore,
+ theAlgorithm,
theImageData,
theName,
theProgressive,
#include <vector>
class QString;
+class vtkAlgorithm;
class vtkImageData;
class SVTK_ImageWriter;
class QSemaphore;
~SVTK_ImageWriterMgr();
void
- StartImageWriter(vtkImageData *theImageData,
+ StartImageWriter(vtkAlgorithm *theAlgorithm,
+ vtkImageData *theImageData,
const std::string& theName,
const int theProgressive,
const int theQuality);
if ( myCurrRotationPointType == SVTK::SetRotateGravity )
{
- vtkFloatingPointType aCenter[3];
+ double aCenter[3];
if ( ComputeBBCenter(GetCurrentRenderer(),aCenter) )
{
myRotationPointX = aCenter[0];
if ( aVtkId >= 0 )
{
int anObjId = anActor->GetNodeObjId( aVtkId );
- vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
+ double* aCoords = anActor->GetNodeCoord(anObjId);
if (myCurrRotationPointType == SVTK::StartPointSelection) {
myCurrRotationPointType = SVTK::SetRotateSelected;
if(GetCurrentRenderer() != NULL) {
GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() );
- vtkFloatingPointType aColor[3];
+ double aColor[3];
GetCurrentRenderer()->GetBackground( aColor );
myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
1. - aColor[1],
if(GetCurrentRenderer() != NULL) {
GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() );
- vtkFloatingPointType aColor[3];
+ double aColor[3];
GetCurrentRenderer()->GetBackground( aColor );
myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
1. - aColor[1],
vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera();
double viewFocus[4], focalDepth, viewPoint[3];
- vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3];
+ double newPickPoint[4], oldPickPoint[4], motionVector[3];
cam->GetFocalPoint(viewFocus);
this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
// check if bounding box was changed
if ( GetCurrentRenderer() )
{
- vtkFloatingPointType aCurrBBCenter[3];
+ double aCurrBBCenter[3];
if ( ComputeBBCenter(GetCurrentRenderer(),aCurrBBCenter) )
{
if ( !myBBFirstCheck )
vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
SVTK_InteractorStyle* self = dynamic_cast<SVTK_InteractorStyle*>( anObject );
int aSpeedIncrement=self->ControllerIncrement()->Current();
- vtkFloatingPointType aCenter[3];
- vtkFloatingPointType* aSelectedPoint;
+ double aCenter[3];
+ double* aSelectedPoint;
if ( self ) {
switch ( event ) {
case SVTK::SpaceMouseMoveEvent :
}
self->myPrevRotationPointType = self->myCurrRotationPointType;
self->myCurrRotationPointType = SVTK::SetRotateSelected;
- aSelectedPoint = (vtkFloatingPointType*)callData;
+ aSelectedPoint = (double*)callData;
self->myRotationPointX = aSelectedPoint[0];
self->myRotationPointY = aSelectedPoint[1];
self->myRotationPointZ = aSelectedPoint[2];
vtkSmartPointer<SVTK_Actor> myHighlightSelectionPointActor;
vtkSmartPointer<vtkPointPicker> myPointPicker;
- vtkFloatingPointType myBBCenter[3];
+ double myBBCenter[3];
bool myBBFirstCheck;
QRubberBand* myRectBand; //!< selection rectangle rubber band
}
//----------------------------------------------------------------------------
-vtkCxxRevisionMacro(SVTK_Recorder,"$Revision$");
vtkStandardNewMacro(SVTK_Recorder);
vtkImageData *anImageData = vtkImageData::New();
anImageData->DeepCopy(myFilter->GetOutput());
- myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality);
+ myWriterMgr->StartImageWriter(myFilter,anImageData,aName,myProgressiveMode,myQuality);
myNbWrittenFrames++;
myRenderWindow->AddObserver(vtkCommand::EndEvent,
myErrorStatus = 20;
return;
}
- anImageData->UpdateInformation();
- int *anExtent = anImageData->GetWholeExtent();
- anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
- anExtent[2], anExtent[3],
- 0,0);
- anImageData->UpdateData();
+ myFilter->UpdateInformation();
+ myFilter->SetUpdateExtentToWholeExtent();
+ myFilter->Update();
}
public:
static SVTK_Recorder *New();
- vtkTypeRevisionMacro(SVTK_Recorder,vtkObject);
+ vtkTypeMacro(SVTK_Recorder,vtkObject);
void
SetRenderWindow(vtkRenderWindow* theRenderWindow);
{
//----------------------------------------------------------------------------
inline
- vtkFloatingPointType
+ double
GetZ(float* theZPtr,
int theSelection[4],
int theDX,
int
Check(float* theZPtr,
int theSelection[4],
- vtkFloatingPointType theTolerance,
- vtkFloatingPointType theDZ,
+ double theTolerance,
+ double theDZ,
int theDX,
int theDY)
{
int aRet = 0;
- vtkFloatingPointType aZ = -1.0;
+ double aZ = -1.0;
if(theDX >= theSelection[0] && theDX <= theSelection[2] &&
theDY >= theSelection[1] && theDY <= theSelection[3])
{
vtkDataSet *theInput,
SVTK_RectPicker::TVectorIds& theVisibleIds,
SVTK_RectPicker::TVectorIds& theInVisibleIds,
- vtkFloatingPointType theTolerance)
+ double theTolerance)
{
theVisibleIds.clear();
theInVisibleIds.clear();
for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){
// perform conversion
- vtkFloatingPointType aX[4] = {1.0, 1.0, 1.0, 1.0};
+ double aX[4] = {1.0, 1.0, 1.0, 1.0};
theInput->GetPoint(aPntId,aX);
- vtkFloatingPointType aView[4];
+ double aView[4];
aMatrix->MultiplyPoint(aX,aView);
if(aView[3] == 0.0)
continue;
aView[2]/aView[3]);
theRenderer->ViewToDisplay();
- vtkFloatingPointType aDX[3];
+ double aDX[3];
theRenderer->GetDisplayPoint(aDX);
// check whether visible and in selection window
//----------------------------------------------------------------------------
inline
void
- GetCenter(const vtkFloatingPointType theBounds[6],
- vtkFloatingPointType theCenter[3])
+ GetCenter(const double theBounds[6],
+ double theCenter[3])
{
theCenter[0] = (theBounds[1] + theBounds[0]) / 2.0;
theCenter[1] = (theBounds[3] + theBounds[2]) / 2.0;
vtkRenderer *theRenderer,
vtkDataSet *theInput,
SVTK_RectPicker::TVectorIds& theVectorIds,
- vtkFloatingPointType theTolerance)
+ double theTolerance)
{
theVectorIds.clear();
for(vtkIdType aCellId = 0; aCellId < aNumCells; aCellId++){
vtkCell* aCell = theInput->GetCell(aCellId);
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
aCell->GetBounds(aBounds);
- vtkFloatingPointType aCenter[3];
+ double aCenter[3];
GetCenter(aBounds,aCenter);
- vtkFloatingPointType aView[4];
- vtkFloatingPointType aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0};
+ double aView[4];
+ double aX[4] = {aCenter[0], aCenter[1], aCenter[2], 1.0};
aMatrix->MultiplyPoint(aX,aView);
if(aView[3] == 0.0)
aView[2]/aView[3]);
theRenderer->ViewToDisplay();
- vtkFloatingPointType aDX[3];
+ double aDX[3];
theRenderer->GetDisplayPoint(aDX);
// check whether visible and in selection window
//----------------------------------------------------------------------------
void
CalculatePickPosition(vtkRenderer *theRenderer,
- vtkFloatingPointType theSelectionX,
- vtkFloatingPointType theSelectionY,
- vtkFloatingPointType theSelectionZ,
- vtkFloatingPointType thePickPosition[3])
+ double theSelectionX,
+ double theSelectionY,
+ double theSelectionZ,
+ double thePickPosition[3])
{
// Convert the selection point into world coordinates.
//
theRenderer->SetDisplayPoint(theSelectionX, theSelectionY, theSelectionZ);
theRenderer->DisplayToWorld();
- vtkFloatingPointType* aWorldCoords = theRenderer->GetWorldPoint();
+ double* aWorldCoords = theRenderer->GetWorldPoint();
if ( aWorldCoords[3] != 0.0 ) {
for (int i=0; i < 3; i++) {
thePickPosition[i] = aWorldCoords[i] / aWorldCoords[3];
int
SVTK_RectPicker
-::Pick(vtkFloatingPointType,
- vtkFloatingPointType,
- vtkFloatingPointType,
+::Pick(double,
+ double,
+ double,
vtkRenderer*)
{
return 0;
int
SVTK_RectPicker
-::Pick(vtkFloatingPointType theSelection[3],
- vtkFloatingPointType theSelection2[3],
+::Pick(double theSelection[3],
+ double theSelection2[3],
vtkRenderer *theRenderer)
{
return Pick(theSelection[0], theSelection[1], theSelection[2],
int
SVTK_RectPicker
-::Pick(vtkFloatingPointType theSelectionX,
- vtkFloatingPointType theSelectionY,
- vtkFloatingPointType theSelectionZ,
- vtkFloatingPointType theSelectionX2,
- vtkFloatingPointType theSelectionY2,
- vtkFloatingPointType theSelectionZ2,
+::Pick(double theSelectionX,
+ double theSelectionY,
+ double theSelectionZ,
+ double theSelectionX2,
+ double theSelectionY2,
+ double theSelectionZ2,
vtkRenderer *theRenderer)
{
// Initialize picking process
//
vtkCamera* aCamera = theRenderer->GetActiveCamera();
- vtkFloatingPointType aCameraFP[4];
+ double aCameraFP[4];
aCamera->GetFocalPoint(aCameraFP);
aCameraFP[3] = 1.0;
theRenderer->SetWorldPoint(aCameraFP);
theRenderer->WorldToDisplay();
- vtkFloatingPointType* aDisplayCoords = theRenderer->GetDisplayPoint();
- vtkFloatingPointType aSelectionZ = aDisplayCoords[2];
+ double* aDisplayCoords = theRenderer->GetDisplayPoint();
+ double aSelectionZ = aDisplayCoords[2];
this->SelectionPoint[0] = theSelectionX;
this->SelectionPoint[1] = theSelectionY;
as fraction of rendering window size. (Rendering window size is measured
across diagonal.)
*/
- vtkSetMacro(Tolerance,vtkFloatingPointType);
- vtkGetMacro(Tolerance,vtkFloatingPointType);
+ vtkSetMacro(Tolerance,double);
+ vtkGetMacro(Tolerance,double);
//! Use these methods to pick points or points and cells
vtkSetMacro(PickPoints,int);
virtual
int
- Pick(vtkFloatingPointType theSelectionX,
- vtkFloatingPointType theSelectionY,
- vtkFloatingPointType theSelectionZ,
- vtkFloatingPointType theSelectionX2,
- vtkFloatingPointType theSelectionY2,
- vtkFloatingPointType theSelectionZ2,
+ Pick(double theSelectionX,
+ double theSelectionY,
+ double theSelectionZ,
+ double theSelectionX2,
+ double theSelectionY2,
+ double theSelectionZ2,
vtkRenderer *theRenderer);
int
- Pick(vtkFloatingPointType theSelection[3],
- vtkFloatingPointType theSelection2[3],
+ Pick(double theSelection[3],
+ double theSelection2[3],
vtkRenderer *theRenderer);
typedef std::vector<vtkIdType> TVectorIds;
~SVTK_RectPicker();
//! tolerance for computation (% of window)
- vtkFloatingPointType Tolerance;
+ double Tolerance;
//! use the following to control picking mode
int PickPoints;
//! second rectangle selection point in window (pixel) coordinates
- vtkFloatingPointType SelectionPoint2[3];
+ double SelectionPoint2[3];
//! second rectangle selection point in world coordinates
- vtkFloatingPointType PickPosition2[3];
+ double PickPosition2[3];
TVectorIdsMap myPointIdsMap;
TVectorIdsMap myCellIdsMap;
private:
virtual
int
- Pick(vtkFloatingPointType,
- vtkFloatingPointType,
- vtkFloatingPointType,
+ Pick(double,
+ double,
+ double,
vtkRenderer*);
};
inline
bool
-CheckBndBox(const vtkFloatingPointType theBounds[6])
+CheckBndBox(const double theBounds[6])
{
if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT &&
theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT &&
bool aTDisplayed = IsTrihedronDisplayed();
bool aCDisplayed = IsCubeAxesDisplayed();
- vtkFloatingPointType aNewBndBox[6];
+ double aNewBndBox[6];
aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
myCubeAxes->VisibilityOff();
// if the new trihedron size have sufficient difference, then apply the value
- vtkFloatingPointType aSize = myTrihedron->GetSize();
+ double aSize = myTrihedron->GetSize();
if ( IsTrihedronRelative() )
{
ComputeTrihedronSize(GetDevice(),aSize,aSize,myTrihedronSize);
if(anActor->IsResizable())
anActor->SetSize(0.5*aSize);
if(anActor->GetVisibility() && !anActor->IsInfinitive()){
- vtkFloatingPointType *aBounds = anActor->GetBounds();
+ double *aBounds = anActor->GetBounds();
if(CheckBndBox(aBounds))
for(int i = 0; i < 5; i = i + 2){
if(aBounds[i] < aNewBndBox[i])
*/
void
SVTK_Renderer
-::SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative)
+::SetTrihedronSize(double theSize, const bool theRelative)
{
if(myTrihedronSize != theSize || myIsTrihedronRelative != theRelative){
myTrihedronSize = theSize;
/*!
\return size of the trihedron in percents from bounding box of the scene
*/
-vtkFloatingPointType
+double
SVTK_Renderer
::GetTrihedronSize() const
{
else
myCubeAxes->VisibilityOff();
- static vtkFloatingPointType aCoeff = 3.0;
+ static double aCoeff = 3.0;
aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale());
}
//! Set size of the trihedron in percents from bounding box of the scene
void
- SetTrihedronSize(vtkFloatingPointType theSize, const bool theRelative = true);
+ SetTrihedronSize(double theSize, const bool theRelative = true);
//! Get size of the trihedron in percents from bounding box of the scene
- vtkFloatingPointType
+ double
GetTrihedronSize() const;
//! Shows if the size of the trihedron is relative
//----------------------------------------------------------------------------
// Priority at which events are processed
- vtkFloatingPointType myPriority;
+ double myPriority;
// Used to process events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
//----------------------------------------------------------------------------
vtkSmartPointer<SVTK_CubeAxesActor2D> myCubeAxes;
vtkSmartPointer<VTKViewer_Trihedron> myTrihedron;
- vtkFloatingPointType myTrihedronSize;
+ double myTrihedronSize;
bool myIsTrihedronRelative;
- vtkFloatingPointType myBndBox[6];
+ double myBndBox[6];
};
#ifdef WIN32
void* theCallData)
{
SVTK_SetRotationPointDlg* self = reinterpret_cast<SVTK_SetRotationPointDlg*>(theClientData);
- vtkFloatingPointType* aCoord = (vtkFloatingPointType*)theCallData;
+ double* aCoord = (double*)theCallData;
switch ( theEvent ) {
case SVTK::BBCenterChanged:
&&
( myX->hasFocus() || myY->hasFocus() || myZ->hasFocus() ) )
mySelectPoint->toggle();
- vtkFloatingPointType aCenter[3] = {myX->text().toDouble(),
+ double aCenter[3] = {myX->text().toDouble(),
myY->text().toDouble(),
myZ->text().toDouble()};
myMainWindow->activateSetRotationSelected((void*)aCenter);
//----------------------------------------------------------------------------
// Priority at which events are processed
- vtkFloatingPointType myPriority;
+ double myPriority;
// Used to process events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
#include <vtkMapper.h>
#include <vtkDataSet.h>
-static vtkFloatingPointType OFF_UPDATE_RATE = 0.00001;
-static vtkFloatingPointType FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
+static double OFF_UPDATE_RATE = 0.00001;
+static double FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
namespace
{
GetUpdateRate(SVTK_RenderWindowInteractor* theRWInteractor)
{
if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
- vtkFloatingPointType aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds();
+ double aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds();
if(aLastRenderTimeInSeconds > FLOAT_TOLERANCE){
std::ostringstream aStr;
- vtkFloatingPointType aFPS = 1.0 / aLastRenderTimeInSeconds;
+ double aFPS = 1.0 / aLastRenderTimeInSeconds;
aStr<<aFPS;
return QString(aStr.str().c_str());
}
//----------------------------------------------------------------------------
struct TRenderTimeMultiplier
{
- vtkFloatingPointType myVTKMultiplier;
- vtkFloatingPointType mySALOMEMultiplier;
+ double myVTKMultiplier;
+ double mySALOMEMultiplier;
TRenderTimeMultiplier():
myVTKMultiplier(0.0),
//----------------------------------------------------------------------------
inline
- vtkFloatingPointType
+ double
AdjustUpdateRate(SVTK_RenderWindowInteractor* theRWInteractor,
- vtkFloatingPointType theUpdateRate)
+ double theUpdateRate)
{
if(vtkRenderer *aRenderer = theRWInteractor->getRenderer()){
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
{
vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice();
- vtkFloatingPointType anUpdateRate;
+ double anUpdateRate;
if(myIsEnableUpdateRateGroupBox->isChecked()){
anUpdateRate = AdjustUpdateRate(myRWInteractor,myDesiredUpdateRateSblSpinBox->value());
aRWI->SetDesiredUpdateRate(anUpdateRate);
//----------------------------------------------------------------------------
// Priority at which events are processed
- vtkFloatingPointType myPriority;
+ double myPriority;
// Used to process events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
::SetTransparency(const Handle(SALOME_InteractiveObject)& theIObject,
float theTrans)
{
- vtkFloatingPointType anOpacity = 1.0 - theTrans;
+ double anOpacity = 1.0 - theTrans;
using namespace SVTK;
VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
ForEachIf<SALOME_Actor>(aCopy.GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,vtkFloatingPointType>
+ TSetFunction<SALOME_Actor,double>
(&SALOME_Actor::SetOpacity,anOpacity));
}
::SetColor(const Handle(SALOME_InteractiveObject)& theIObject,
const QColor& theColor)
{
- vtkFloatingPointType aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.};
+ double aColor[3] = {theColor.red()/255., theColor.green()/255., theColor.blue()/255.};
using namespace SVTK;
VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
ForEachIf<SALOME_Actor>(aCopy.GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject),
- TSetFunction<SALOME_Actor,const vtkFloatingPointType*>
+ TSetFunction<SALOME_Actor,const double*>
(&SALOME_Actor::SetColor,aColor));
}
Find<SALOME_Actor>(aCopy.GetActors(),
TIsSameIObject<SALOME_Actor>(theIObject));
if(anActor){
- vtkFloatingPointType r,g,b;
+ double r,g,b;
anActor->GetColor(r,g,b);
return QColor(int(r*255),int(g*255),int(b*255));
}
/*!
\return trihedron size
*/
-vtkFloatingPointType SVTK_Viewer::trihedronSize() const
+double SVTK_Viewer::trihedronSize() const
{
return myTrihedronSize;
}
\param theSize - new size
\param theRelative - new relativeness
*/
-void SVTK_Viewer::setTrihedronSize( const vtkFloatingPointType theSize, const bool theRelative )
+void SVTK_Viewer::setTrihedronSize( const double theSize, const bool theRelative )
{
myTrihedronSize = theSize;
myTrihedronRelative = theRelative;
void setBackground( const Qtx::BackgroundData& );
//! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
- vtkFloatingPointType trihedronSize() const;
+ double trihedronSize() const;
//! Shows if the size of trihedron relative (see #SVTK_Renderer::SetTrihedronSize)
bool trihedronRelative() const;
//! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
- void setTrihedronSize( const vtkFloatingPointType, const bool = true );
+ void setTrihedronSize( const double, const bool = true );
//! Get visibility status of the static trihedron
bool isStaticTrihedronVisible() const;
void updateToolBars();
Qtx::BackgroundData myDefaultBackground;
- vtkFloatingPointType myTrihedronSize;
+ double myTrihedronSize;
bool myTrihedronRelative;
bool myIsStaticTrihedronVisible;
bool mySelectionEnabled;
void* theCallData)
{
SVTK_ViewParameterDlg* self = reinterpret_cast<SVTK_ViewParameterDlg*>(theClientData);
- vtkFloatingPointType* aCoord;
+ double* aCoord;
switch ( theEvent ) {
case SVTK::FocalPointChanged:
if ( theCallData )
{
- aCoord = (vtkFloatingPointType*)theCallData;
+ aCoord = (double*)theCallData;
self->myBusy = true;
self->myFocalX->setText( QString::number(aCoord[0]) );
self->myFocalY->setText( QString::number(aCoord[1]) );
//----------------------------------------------------------------------------
// Priority at which events are processed
- vtkFloatingPointType myPriority;
+ double myPriority;
// Used to process events
vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
/*!
\return trihedron size
*/
-vtkFloatingPointType SVTK_ViewWindow::GetTrihedronSize() const
+double SVTK_ViewWindow::GetTrihedronSize() const
{
return GetRenderer()->GetTrihedronSize();
}
\param theSize - new trihedron size
\param theRelative - trihedron relativeness
*/
-void SVTK_ViewWindow::SetTrihedronSize(const vtkFloatingPointType theSize, const bool theRelative)
+void SVTK_ViewWindow::SetTrihedronSize(const double theSize, const bool theRelative)
{
GetRenderer()->SetTrihedronSize(theSize, theRelative);
Repaint();
// Name
bool isVisible = actor->GetTitleVisibility();
QString title ( actor->GetTitle() );
- vtkFloatingPointType color[ 3 ];
+ double color[ 3 ];
int font = VTK_ARIAL;
int bold = 0;
int italic = 0;
// Read title color
aAttr = reader.attributes();
- vtkFloatingPointType color[3];
+ double color[3];
color[0] = aAttr.value("R").toString().toDouble();
color[1] = aAttr.value("G").toString().toDouble();
color[2] = aAttr.value("B").toString().toDouble();
// retrieve and set name parameters
bool isVisible = paramsLst[2].toUShort();
QString title = paramsLst[3];
- vtkFloatingPointType color[3];
+ double color[3];
color[0] = paramsLst[4].toDouble();
color[1] = paramsLst[5].toDouble();
color[2] = paramsLst[6].toDouble();
SVTK_CubeAxesActor2D* GetCubeAxes();
//! Redirect the request to #SVTK_Renderer::GetTrihedronSize
- vtkFloatingPointType GetTrihedronSize() const;
+ double GetTrihedronSize() const;
//! Redirect the request to #SVTK_Renderer::SetTrihedronSize
- virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true );
+ virtual void SetTrihedronSize( const double, const bool = true );
//! Set incremental speed
virtual void SetIncrementalSpeed( const int, const int = 0 );
#include <math.h>
-vtkCxxRevisionMacro(vtkPVAxesActor, "$Revision$");
vtkStandardNewMacro(vtkPVAxesActor);
vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData );
vtkPolyDataMapper *ymapper = vtkPolyDataMapper::New();
vtkPolyDataMapper *zmapper = vtkPolyDataMapper::New();
- xmapper->SetInput( this->XAxisVectorText->GetOutput() );
- ymapper->SetInput( this->YAxisVectorText->GetOutput() );
- zmapper->SetInput( this->ZAxisVectorText->GetOutput() );
+ xmapper->SetInputConnection( this->XAxisVectorText->GetOutputPort() );
+ ymapper->SetInputConnection( this->YAxisVectorText->GetOutputPort() );
+ zmapper->SetInputConnection( this->ZAxisVectorText->GetOutputPort() );
this->XAxisLabel->SetMapper( xmapper );
this->YAxisLabel->SetMapper( ymapper );
}
//-----------------------------------------------------------------------------
-#if (VTK_MINOR_VERSION>=2)
+#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
// porting to VTK 5.0.x
int vtkPVAxesActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
{
{
case vtkPVAxesActor::CYLINDER_SHAFT:
(vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- SetInput( this->CylinderSource->GetOutput() );
+ SetInputConnection( this->CylinderSource->GetOutputPort() );
break;
case vtkPVAxesActor::LINE_SHAFT:
(vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- SetInput( this->LineSource->GetOutput() );
+ SetInputConnection( this->LineSource->GetOutputPort() );
break;
case vtkPVAxesActor::USER_DEFINED_SHAFT:
(vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- SetInput( this->UserDefinedShaft );
+ SetInputData( this->UserDefinedShaft );
}
switch ( this->TipType )
{
case vtkPVAxesActor::CONE_TIP:
(vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- SetInput( this->ConeSource->GetOutput() );
+ SetInputConnection( this->ConeSource->GetOutputPort() );
break;
case vtkPVAxesActor::SPHERE_TIP:
(vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- SetInput( this->SphereSource->GetOutput() );
+ SetInputConnection( this->SphereSource->GetOutputPort() );
break;
case vtkPVAxesActor::USER_DEFINED_TIP:
(vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- SetInput( this->UserDefinedTip );
+ SetInputData( this->UserDefinedTip );
}
- (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- GetInput()->Update();
- (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- GetInput()->Update();
+ (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->Update();
+ (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->Update();
#include "SVTK.h"
#include "vtkProp3D.h"
+#include <vtkVersion.h>
+
class vtkRenderer;
class vtkPropCollection;
class vtkMapper;
{
public:
static vtkPVAxesActor *New();
- vtkTypeRevisionMacro(vtkPVAxesActor,vtkProp3D);
+ vtkTypeMacro(vtkPVAxesActor,vtkProp3D);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Support the standard render methods.
virtual int RenderOpaqueGeometry(vtkViewport *viewport);
-#if (VTK_MINOR_VERSION>=2)
+#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); // porting to VTK 5.0.x
virtual int HasTranslucentPolygonalGeometry(); // porting to VTK 5.0.x
#else
#include "vtkRenderWindowInteractor.h"
vtkStandardNewMacro(vtkPVAxesWidget);
-vtkCxxRevisionMacro(vtkPVAxesWidget, "$Revision$");
vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor);
vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer);
vtkCoordinate *tcoord = vtkCoordinate::New();
tcoord->SetCoordinateSystemToDisplay();
vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New();
- mapper->SetInput(this->Outline);
+ mapper->SetInputData(this->Outline);
mapper->SetTransformCoordinate(tcoord);
this->OutlineActor = vtkActor2D::New();
this->OutlineActor->SetMapper(mapper);
{
public:
static vtkPVAxesWidget* New();
- vtkTypeRevisionMacro(vtkPVAxesWidget, vtkInteractorObserver);
+ vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
VTKViewer_msg_fr.qm
libVTKViewer_la_CPPFLAGS = $(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS) \
- -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+ -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT \
+ -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingOpenGL,vtkRenderingFreeTypeOpenGL)"
libVTKViewer_la_LDFLAGS = $(KERNEL_LDFLAGS) $(VTK_LIBS) $(QT_MT_LIBS) \
$(CAS_KERNEL) $(OGL_LIBS) ../Qtx/libqtx.la ../SUIT/libsuit.la
# define VTKVIEWER_EXPORT
#endif
-#include <vtkSystemIncludes.h>
-
-#if !defined(vtkFloatingPointType)
-# define vtkFloatingPointType vtkFloatingPointType
- typedef float vtkFloatingPointType;
-#endif
-
#endif
{
if(theMapper){
int anId = 0;
- myPassFilter[ anId ]->SetInput( theMapper->GetInput() );
- myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myPassFilter[ anId ]->SetInputData( theMapper->GetInput() );
+ myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 1
myGeomFilter->SetStoreMapping( myStoreMapping );
- myGeomFilter->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 2
- myPassFilter[ anId ]->SetInput( myGeomFilter->GetOutput() );
- myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() );
+ myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 3
- myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
+ myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 4
- myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
- myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+ myPassFilter[ anId ]->SetInputConnection( myTransformFilter->GetOutputPort() );
+ myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 5
- if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper)){
- aMapper->SetInput(myPassFilter[anId]->GetOutput());
- }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
- aMapper->SetInput(myPassFilter[anId]->GetPolyDataOutput());
- }
+ theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
}
Superclass::SetMapper(theMapper);
}
::Render(vtkRenderer *ren, vtkMapper* m)
{
if(vtkDataSet* aDataSet = GetInput()){
- static vtkFloatingPointType PERCENTS_OF_DETAILS = 0.50;
+ static double PERCENTS_OF_DETAILS = 0.50;
vtkIdType aNbOfPoints = vtkIdType(aDataSet->GetNumberOfPoints()*PERCENTS_OF_DETAILS);
if(aNbOfPoints > 0)
SetNumberOfCloudPoints(aNbOfPoints);
if(myIsResolveCoincidentTopology){
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
- vtkFloatingPointType aFactor, aUnit;
+ double aFactor, aUnit;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
*/
void
VTKViewer_Actor
-::SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units)
+::SetPolygonOffsetParameters(double factor,
+ double units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
*/
void
VTKViewer_Actor
-::GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units)
+::GetPolygonOffsetParameters(double& factor,
+ double& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
/*!
\return shrink factor
*/
-vtkFloatingPointType
+double
VTKViewer_Actor
::GetShrinkFactor()
{
/*!
Get coordinates of a node for given object index
*/
-vtkFloatingPointType*
+double*
VTKViewer_Actor
::GetNodeCoord(int theObjID)
{
if(myIsInfinite)
return true;
- static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
- vtkFloatingPointType aBounds[6];
+ static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+ double aBounds[6];
GetBounds(aBounds);
for(int i = 0; i < 6; i++)
if(fabs(aBounds[i]) > MAX_DISTANCE)
return true;
- static vtkFloatingPointType MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT;
if(GetLength() < MIN_DISTANCE)
return true;
/*!
\return current bounding box
*/
-vtkFloatingPointType*
+double*
VTKViewer_Actor
::GetBounds()
{
*/
void
VTKViewer_Actor
-::GetBounds(vtkFloatingPointType theBounds[6])
+::GetBounds(double theBounds[6])
{
Superclass::GetBounds(theBounds);
}
void
VTKViewer_Actor
-::SetSize( const vtkFloatingPointType )
+::SetSize( const double )
{}
void
VTKViewer_Actor
-::SetOpacity(vtkFloatingPointType theOpacity)
+::SetOpacity(double theOpacity)
{
myOpacity = theOpacity;
GetProperty()->SetOpacity(theOpacity);
}
-vtkFloatingPointType
+double
VTKViewer_Actor
::GetOpacity()
{
*/
void
VTKViewer_Actor
-::SetColor(vtkFloatingPointType r,
- vtkFloatingPointType g,
- vtkFloatingPointType b)
+::SetColor(double r,
+ double g,
+ double b)
{
GetProperty()->SetColor(r,g,b);
}
*/
void
VTKViewer_Actor
-::SetColor(const vtkFloatingPointType theRGB[3])
+::SetColor(const double theRGB[3])
{
SetColor(theRGB[0],theRGB[1],theRGB[2]);
}
*/
void
VTKViewer_Actor
-::GetColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b)
+::GetColor(double& r,
+ double& g,
+ double& b)
{
- vtkFloatingPointType aColor[3];
+ double aColor[3];
GetProperty()->GetColor(aColor);
r = aColor[0];
g = aColor[1];
/*!
* Set Max angle for representation 2D quadratic element as arked polygon
*/
-void VTKViewer_Actor::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle){
+void VTKViewer_Actor::SetQuadraticArcAngle(double theMaxAngle){
myGeomFilter->SetQuadraticArcAngle(theMaxAngle);
}
/*!
* Return Max angle of the representation 2D quadratic element as arked polygon
*/
-vtkFloatingPointType VTKViewer_Actor::GetQuadraticArcAngle() const{
+double VTKViewer_Actor::GetQuadraticArcAngle() const{
return myGeomFilter->GetQuadraticArcAngle();
}
//! Change opacity
virtual
void
- SetOpacity(vtkFloatingPointType theOpacity);
+ SetOpacity(double theOpacity);
//! Get current opacity
virtual
- vtkFloatingPointType
+ double
GetOpacity();
//! Change color
virtual
void
- SetColor(vtkFloatingPointType r,
- vtkFloatingPointType g,
- vtkFloatingPointType b);
+ SetColor(double r,
+ double g,
+ double b);
//! Get current color
virtual
void
- GetColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b);
+ GetColor(double& r,
+ double& g,
+ double& b);
//! Change color
virtual
void
- SetColor(const vtkFloatingPointType theRGB[3]);
+ SetColor(const double theRGB[3]);
//! Change material\r
virtual\r
//! Get coordinates of a node for given object index
virtual
- vtkFloatingPointType*
+ double*
GetNodeCoord(int theObjID);
//! Maps VTK index of a cell to corresponding object index
//! To calcualte current bounding box
virtual
- vtkFloatingPointType*
+ double*
GetBounds();
//! To calcualte current bounding box
void
- GetBounds(vtkFloatingPointType bounds[6]);
+ GetBounds(double bounds[6]);
//----------------------------------------------------------------------------
virtual
virtual
void
- SetSize( const vtkFloatingPointType );
+ SetSize( const double );
virtual
void
//! Set ResolveCoincidentTopology parameters
void
- SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units);
+ SetPolygonOffsetParameters(double factor,
+ double units);
//! Get current ResolveCoincidentTopology parameters
void
- GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units);
+ GetPolygonOffsetParameters(double& factor,
+ double& units);
virtual
void
//----------------------------------------------------------------------------
//! Get current shrink factor
virtual
- vtkFloatingPointType
+ double
GetShrinkFactor();
//! Is the actor is shrunkable
virtual void SetQuadraticArcMode(bool theFlag);
virtual bool GetQuadraticArcMode() const;
- virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
- virtual vtkFloatingPointType GetQuadraticArcAngle() const;
+ virtual void SetQuadraticArcAngle(double theMaxAngle);
+ virtual double GetQuadraticArcAngle() const;
//----------------------------------------------------------------------------
//! Return pointer to the dataset, which used to calculation of the bounding box of the actor
protected:
//----------------------------------------------------------------------------
bool myIsResolveCoincidentTopology;
- vtkFloatingPointType myPolygonOffsetFactor;
- vtkFloatingPointType myPolygonOffsetUnits;
+ double myPolygonOffsetFactor;
+ double myPolygonOffsetUnits;
std::string myName;
- vtkFloatingPointType myOpacity;
+ double myOpacity;
int myDisplayMode;
bool myIsInfinite;
#endif
#endif
-vtkCxxRevisionMacro(VTKViewer_AppendFilter, "$Revision$");
vtkStandardNewMacro(VTKViewer_AppendFilter);
VTKViewer_AppendFilter
*/
static VTKViewer_AppendFilter *New();
- /*! \fn vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter)
+ /*! \fn vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter)
* \brief VTK type revision macros.
*/
- vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter);
+ vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter);
void SetDoMappingFlag(const bool theFlag);
vtkUnstructuredGrid* aTransformedGrid;
if(needRotation) {
aTransformedGrid = TransformGrid(aGrid,aAxis,anAngle);
- aTransformedGrid->Update();
#ifdef _MY_DEBUG_
cout<<"Need Rotation!!!"<<endl;
#endif
std::vector<double> aScalarValues;
vtkUnstructuredGrid* anArc = BuildArc(aScalarValues);
vtkUnstructuredGrid* anTransArc;
- if(needRotation) {
+ if(needRotation)
anTransArc = TransformGrid(anArc,aAxis,-anAngle);
- anTransArc->Update();
- }
else
anTransArc = anArc;
aList.push_back(thePnt2);
aList.push_back(thePnt3);
vtkUnstructuredGrid* aGrid = BuildGrid(aList);
- aGrid->Update();
myPoints = aGrid->GetPoints();
myScalarValues.clear();
aTransform->RotateWXYZ(angle, theAxis.GetXYZ().X(), theAxis.GetXYZ().Y(), theAxis.GetXYZ().Z());
vtkTransformFilter* aTransformFilter = vtkTransformFilter::New();
aTransformFilter->SetTransform(aTransform);
- aTransformFilter->SetInput(theGrid);
+ aTransformFilter->SetInputData(theGrid);
aTransform->Delete();
return aTransformFilter->GetUnstructuredGridOutput();
}
/* double aTotalAngle = fabs(angle3 - angle1);
- if (aTotalAngle > vtkMath::DoublePi())
- aTotalAngle = 2*vtkMath::DoublePi()-aTotalAngle;
+ if (aTotalAngle > vtkMath::Pi())
+ aTotalAngle = 2*vtkMath::Pi()-aTotalAngle;
*/
double aTotalAngle = 0;
const double theXPoint, const double theYPoint){
double result = atan2(theYCenter - theYPoint, theXPoint - theXCenter);
if(result < 0 )
- result = result+vtkMath::DoublePi()*2;
- return vtkMath::DoublePi()*2-result;
+ result = result+vtkMath::Pi()*2;
+ return vtkMath::Pi()*2-result;
return result;
}
aResult = VTKViewer_ArcBuilder::PLUS;
}
else if((P1 < P3 && P3 < P2) || (P2 < P1 && P1 < P3)){
- *Ang = 2*vtkMath::DoublePi() - P3 + P1;
+ *Ang = 2*vtkMath::Pi() - P3 + P1;
aResult = VTKViewer_ArcBuilder::MINUS;
}
else if((P2 < P3 && P3 < P1) || (P3 < P1 && P1 < P2)){
- *Ang = 2*vtkMath::DoublePi() - P1 + P3;
+ *Ang = 2*vtkMath::Pi() - P1 + P3;
aResult = VTKViewer_ArcBuilder::PLUS;
}
else if(P3 < P2 && P2 < P1){
//------------------------------------------------------------------------
Pnt CreatePnt(vtkCell* cell, vtkDataArray* scalars, vtkIdType index)
{
- vtkFloatingPointType coord[3];
+ double coord[3];
cell->GetPoints()->GetPoint(index, coord);
vtkIdType pointId = cell->GetPointId(index);
double scalarValue = scalars ? scalars->GetTuple1(pointId) : 0;
//------------------------------------------------------------------------
vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input,
vtkPolyData *output,vtkIdType *pts,
- vtkFloatingPointType myMaxArcAngle){
+ double myMaxArcAngle){
vtkIdType aResult = -1;
vtkIdType *aNewPoints;
#include <map>
#include <vector>
+#include <vtkType.h>
+
class vtkCell;
class vtkDataArray;
class vtkPoints;
vtkUnstructuredGrid* input,
vtkPolyData *output,
vtkIdType *pts,
- vtkFloatingPointType myMaxArcAngle);
+ double myMaxArcAngle);
Pnt CreatePnt(vtkCell* cell,
vtkDataArray* scalars,
#include <vtkPolyData.h>
#include <vtkCellArray.h>
-vtkCxxRevisionMacro(VTKViewer_CellCenters, "$Revision$");
vtkStandardNewMacro(VTKViewer_CellCenters);
/*!
class VTKVIEWER_EXPORT VTKViewer_CellCenters : public vtkCellCenters
{
public:
- vtkTypeRevisionMacro(VTKViewer_CellCenters,vtkCellCenters);
+ vtkTypeMacro(VTKViewer_CellCenters,vtkCellCenters);
static VTKViewer_CellCenters *New();
#include "VTKViewer.h"
+#include <vtkVersion.h>
+
#if ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)) || (VTK_MAJOR_VERSION > 4)
# include <vtkIdTypeArray.h>
# define TCellLocationsArray vtkIdTypeArray
struct TPolygon
{
TConnectivities myConnectivities;
- vtkFloatingPointType myOrigin[3];
- vtkFloatingPointType myNormal[3];
+ double myOrigin[3];
+ double myNormal[3];
TPolygon(const TConnectivities& theConnectivities,
- vtkFloatingPointType theOrigin[3],
- vtkFloatingPointType theNormal[3]):
+ double theOrigin[3],
+ double theNormal[3]):
myConnectivities(theConnectivities)
{
myOrigin[0] = theOrigin[0];
vtkIdType aNumPts;
theInput->GetCellPoints(theCellId, aNumPts, myPointIds);
if ( aNumPts > 0 ) {
- vtkFloatingPointType anAbsoluteCoord[3];
+ double anAbsoluteCoord[3];
myPoints->SetNumberOfPoints(aNumPts);
vtkPoints *anInputPoints = theInput->GetPoints();
for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
//----------------------------------------------------------------------------
-vtkFloatingPointType
+double
VTKViewer_Triangulator
::GetCellLength()
{
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
myPoints->GetBounds(aBounds);
- vtkFloatingPointType aCoordDiff[3];
+ double aCoordDiff[3];
aCoordDiff[0] = (aBounds[1] - aBounds[0]);
aCoordDiff[1] = (aBounds[3] - aBounds[2]);
aCoordDiff[2] = (aBounds[5] - aBounds[4]);
return true;
// To calculate the bary center of the cell
- vtkFloatingPointType aCellCenter[3] = {0.0, 0.0, 0.0};
+ double aCellCenter[3] = {0.0, 0.0, 0.0};
{
- vtkFloatingPointType aPntCoord[3];
+ double aPntCoord[3];
for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
aPoints->GetPoint(GetPointId(aPntId),aPntCoord);
if(DEBUG_TRIA_EXECUTE) cout<<"\taPntId = "<<GetPointId(aPntId)<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}\n";
aCellCenter[2] /= aNumPts;
}
- vtkFloatingPointType aCellLength = GetCellLength();
+ double aCellLength = GetCellLength();
int aNumFaces = GetNumFaces();
- static vtkFloatingPointType EPS = 1.0E-2;
- vtkFloatingPointType aDistEps = aCellLength/3.0 * EPS;
+ static double EPS = 1.0E-2;
+ double aDistEps = aCellLength/3.0 * EPS;
if(DEBUG_TRIA_EXECUTE) cout<<"\taNumFaces = "<<aNumFaces<<"; aCellLength = "<<aCellLength<<"; aDistEps = "<<aDistEps<<"\n";
// To initialize set of points that belong to the cell
if(!anIsObserved){
// To get coordinates of the points of the traingle face
- vtkFloatingPointType aCoord[3][3];
+ double aCoord[3][3];
aPoints->GetPoint(aNewPts[0],aCoord[0]);
aPoints->GetPoint(aNewPts[1],aCoord[1]);
aPoints->GetPoint(aNewPts[2],aCoord[2]);
*/
- vtkFloatingPointType aVector01[3] = { aCoord[1][0] - aCoord[0][0],
+ double aVector01[3] = { aCoord[1][0] - aCoord[0][0],
aCoord[1][1] - aCoord[0][1],
aCoord[1][2] - aCoord[0][2] };
- vtkFloatingPointType aVector02[3] = { aCoord[2][0] - aCoord[0][0],
+ double aVector02[3] = { aCoord[2][0] - aCoord[0][0],
aCoord[2][1] - aCoord[0][1],
aCoord[2][2] - aCoord[0][2] };
vtkMath::Normalize(aVector02);
// To calculate the normal for the triangle
- vtkFloatingPointType aNormal[3];
+ double aNormal[3];
vtkMath::Cross(aVector02,aVector01,aNormal);
vtkMath::Normalize(aNormal);
// To calculate what points belong to the plane
// To calculate bounds of the point set
- vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0};
+ double aCenter[3] = {0.0, 0.0, 0.0};
{
TPointIds::const_iterator anIter = anInitialPointIds.begin();
TPointIds::const_iterator anEndIter = anInitialPointIds.end();
for(; anIter != anEndIter; anIter++){
- vtkFloatingPointType aPntCoord[3];
+ double aPntCoord[3];
vtkIdType aPntId = *anIter;
aPoints->GetPoint(aPntId,aPntCoord);
- vtkFloatingPointType aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
+ double aVector0Pnt[3] = { aPntCoord[0] - aCoord[0][0],
aPntCoord[1] - aCoord[0][1],
aPntCoord[2] - aCoord[0][2] };
vtkMath::Normalize(aVector0Pnt);
- vtkFloatingPointType aNormalPnt[3];
+ double aNormalPnt[3];
// calculate aNormalPnt
{
- vtkFloatingPointType aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
- vtkFloatingPointType aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
+ double aCosPnt01 = vtkMath::Dot(aVector0Pnt,aVector01);
+ double aCosPnt02 = vtkMath::Dot(aVector0Pnt,aVector02);
if(aCosPnt01<-1)
aCosPnt01 = -1;
if(aCosPnt01>1)
if(aCosPnt02>1)
aCosPnt02 = 1;
- vtkFloatingPointType aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
- vtkFloatingPointType aAngPnt01 = fabs(acos(aCosPnt01));
- vtkFloatingPointType aAngPnt02 = fabs(acos(aCosPnt02));
+ double aDist01,aDist02;// deflection from Pi/3 angle (equilateral triangle)
+ double aAngPnt01 = fabs(acos(aCosPnt01));
+ double aAngPnt02 = fabs(acos(aCosPnt02));
/* check that triangle similar to equilateral triangle
AOC or COB ?
if(DEBUG_TRIA_EXECUTE)
cout<<"\t\taPntId = "<<aPntId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"};";
- vtkFloatingPointType aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
+ double aDist = vtkPlane::DistanceToPlane(aPntCoord,aNormal,aCoord[0]);
if(DEBUG_TRIA_EXECUTE) cout<<": aDist = "<<aDist;
if(fabs(aDist) < aDistEps){
aPointIds.insert(aPntId);
}
//To sinchronize orientation of the cell and its face
- vtkFloatingPointType aVectorC[3] = { aCenter[0] - aCellCenter[0],
+ double aVectorC[3] = { aCenter[0] - aCellCenter[0],
aCenter[1] - aCellCenter[1],
aCenter[2] - aCellCenter[2] };
vtkMath::Normalize(aVectorC);
- vtkFloatingPointType aDot = vtkMath::Dot(aNormal,aVectorC);
+ double aDot = vtkMath::Dot(aNormal,aVectorC);
if(DEBUG_TRIA_EXECUTE) {
cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
cout<<"; aVectorC = {"<<aVectorC[0]<<", "<<aVectorC[1]<<", "<<aVectorC[2]<<"}\n";
}
// To calculate the primary direction for point set
- vtkFloatingPointType aVector0[3] = { aCoord[0][0] - aCenter[0],
+ double aVector0[3] = { aCoord[0][0] - aCenter[0],
aCoord[0][1] - aCenter[1],
aCoord[0][2] - aCenter[2] };
vtkMath::Normalize(aVector0);
// To sort the planar set of the points accrding to the angle
{
- typedef std::map<vtkFloatingPointType,vtkIdType> TSortedPointIds;
+ typedef std::map<double,vtkIdType> TSortedPointIds;
TSortedPointIds aSortedPointIds;
TPointIds::const_iterator anIter = aPointIds.begin();
TPointIds::const_iterator anEndIter = aPointIds.end();
for(; anIter != anEndIter; anIter++){
- vtkFloatingPointType aPntCoord[3];
+ double aPntCoord[3];
vtkIdType aPntId = *anIter;
aPoints->GetPoint(aPntId,aPntCoord);
- vtkFloatingPointType aVector[3] = { aPntCoord[0] - aCenter[0],
+ double aVector[3] = { aPntCoord[0] - aCenter[0],
aPntCoord[1] - aCenter[1],
aPntCoord[2] - aCenter[2] };
vtkMath::Normalize(aVector);
- vtkFloatingPointType aCross[3];
+ double aCross[3];
vtkMath::Cross(aVector,aVector0,aCross);
- vtkFloatingPointType aCr = vtkMath::Dot(aCross,aNormal);
+ double aCr = vtkMath::Dot(aCross,aNormal);
bool aGreaterThanPi = aCr < 0;
- vtkFloatingPointType aCosinus = vtkMath::Dot(aVector,aVector0);
- vtkFloatingPointType anAngle = 0.0;
+ double aCosinus = vtkMath::Dot(aVector,aVector0);
+ double anAngle = 0.0;
if(aCosinus >= 1.0){
aCosinus = 1.0;
} else if (aCosinus <= -1.0){
int aNbPolygons = aPolygons.size();
for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
::TPolygon& aPolygon = aPolygons[aPolygonId];
- vtkFloatingPointType* aNormal = aPolygon.myNormal;
- vtkFloatingPointType* anOrigin = aPolygon.myOrigin;
+ double* aNormal = aPolygon.myNormal;
+ double* anOrigin = aPolygon.myOrigin;
if(DEBUG_TRIA_EXECUTE) {
cout<<"\taPolygonId = "<<aPolygonId<<"\n";
cout<<"\t\taNormal = {"<<aNormal[0]<<", "<<aNormal[1]<<", "<<aNormal[2]<<"}";
cout<<"; anOrigin = {"<<anOrigin[0]<<", "<<anOrigin[1]<<", "<<anOrigin[2]<<"}\n";
}
for(vtkIdType aPntId = 0; aPntId < aNumPts; aPntId++){
- vtkFloatingPointType aPntCoord[3];
+ double aPntCoord[3];
vtkIdType anId = GetPointId(aPntId);
aPoints->GetPoint(anId,aPntCoord);
- vtkFloatingPointType aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
+ double aDist = vtkPlane::Evaluate(aNormal,anOrigin,aPntCoord);
if(DEBUG_TRIA_EXECUTE) cout<<"\t\taPntId = "<<anId<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}; aDist = "<<aDist<<"\n";
if(aDist < -aDistEps)
return false;
if ( aNumPts > 0 ) {
myTriangulator->InitTriangulation(0.0, 1.0, 0.0, 1.0, 0.0, 1.0, aNumPts);
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
myPoints->GetBounds(aBounds);
- vtkFloatingPointType xSize, ySize, zSize;
+ double xSize, ySize, zSize;
xSize = aBounds[1] - aBounds[0];
ySize = aBounds[3] - aBounds[2];
zSize = aBounds[5] - aBounds[4];
- vtkFloatingPointType anAbsoluteCoord[3];
- vtkFloatingPointType aParamentrucCoord[3];
+ double anAbsoluteCoord[3];
+ double aParamentrucCoord[3];
for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
myPoints->GetPoint(aPntId, anAbsoluteCoord);
aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize);
myUnstructuredGrid->Allocate();
myUnstructuredGrid->SetPoints(myPoints);
- myDelaunay3D->SetInput(myUnstructuredGrid);
- myGeometryFilter->SetInput(myDelaunay3D->GetOutput());
+ myDelaunay3D->SetInputData(myUnstructuredGrid);
+ myGeometryFilter->SetInputConnection(myDelaunay3D->GetOutputPort());
myPolyData = myGeometryFilter->GetOutput();
}
vtkIdType
GetPointId(vtkIdType thePointId);
- vtkFloatingPointType
+ double
GetCellLength();
void
#include <vtkDataSetSurfaceFilter.h>
#include <vtkObjectFactory.h>
-vtkCxxRevisionMacro(VTKViewer_DataSetMapper, "Revision$");
vtkStandardNewMacro(VTKViewer_DataSetMapper);
//----------------------------------------------------------------------------
{
vtkDataSetSurfaceFilter *gf = vtkDataSetSurfaceFilter::New();
VTKViewer_PolyDataMapper *pm = VTKViewer_PolyDataMapper::New();
- pm->SetInput(gf->GetOutput());
+ pm->SetInputConnection(gf->GetOutputPort());
pm->SetMarkerEnabled( this->MarkerEnabled );
if( this->MarkerType != VTK::MT_USER )
{
public:
static VTKViewer_DataSetMapper *New();
- vtkTypeRevisionMacro(VTKViewer_DataSetMapper,vtkDataSetMapper);
+ vtkTypeMacro(VTKViewer_DataSetMapper,vtkDataSetMapper);
//! Set point marker enabled
void SetMarkerEnabled( bool );
}
-// int VTKViewer_ExtractUnstructuredGrid::RequestData(
-// vtkInformation *vtkNotUsed(request),
-// vtkInformationVector **inputVector,
-// vtkInformationVector *outputVector)
-void VTKViewer_ExtractUnstructuredGrid::Execute()
+int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
- /*
- not ported yet to the new executive-based pipeline architecture.
-
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
inInfo->Get(vtkDataObject::DATA_OBJECT()));
vtkUnstructuredGrid *anOutput = vtkUnstructuredGrid::SafeDownCast(
outInfo->Get(vtkDataObject::DATA_OBJECT()));
- */
- vtkUnstructuredGrid *anInput = this->GetInput();
- vtkUnstructuredGrid *anOutput = this->GetOutput();
+
+ //vtkUnstructuredGrid *anInput = this->GetInput();
+ //vtkUnstructuredGrid *anOutput = this->GetOutput();
myOut2InId.clear(); myIn2OutId.clear();
MESSAGE("Execute - myIn2OutId.size() = "<<myIn2OutId.size());
}
}*/
-// return 1;
+ return 1;
}
#include "VTKViewer.h"
-#include <vtkUnstructuredGridToUnstructuredGridFilter.h>
+#include <vtkUnstructuredGridAlgorithm.h>
#include <set>
#include <map>
#pragma warning ( disable:4251 )
#endif
-/*! \class vtkUnstructuredGridToUnstructuredGridFilter
+/*! \class vtkUnstructuredGridAlgorithm
* \brief For more information see <a href="http://www.vtk.org/">VTK documentation</a>
*/
-/*! \class vtkUnstructuredGridToUnstructuredGridFilter
+/*! \class vtkUnstructuredGridAlgorithm
* \brief For more information see VTK documentation.
*/
-class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridToUnstructuredGridFilter
+class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridAlgorithm
{
public:
//! VTK type macros.
- vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridToUnstructuredGridFilter );
+ vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridAlgorithm );
//! \brief Construct with all types of clipping turned off.
static VTKViewer_ExtractUnstructuredGrid *New();
VTKViewer_ExtractUnstructuredGrid();
~VTKViewer_ExtractUnstructuredGrid();
- //! Main method, which calculate output
- // not ported yet to the new executive-based pipeline architecture.
- // see http://www.vtk.org/cgi-bin/viewcvs.cgi/Filtering/vtkUnstructuredGridToUnstructuredGridFilter.h?rev=1.19&view=log
- // virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
- virtual void Execute();
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
EExtraction myExtractionMode;
#define OFFSET_SPACING 2
//==================================================================
-vtkCxxRevisionMacro(VTKViewer_FramedTextActor, "$Revision$");
vtkStandardNewMacro(VTKViewer_FramedTextActor);
//==================================================================
myTransparency=0.;
myBar = vtkPolyData::New();
myBarMapper = vtkPolyDataMapper2D::New();
- myBarMapper->SetInput(myBar);
+ myBarMapper->SetInputData(myBar);
myBarActor = vtkActor2D::New();
myBarActor->SetMapper(myBarMapper);
myBarActor->GetProperty()->SetOpacity(1.-myTransparency);
// function : SetForegroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetForegroundColor(const vtkFloatingPointType r,
- const vtkFloatingPointType g,
- const vtkFloatingPointType b)
+void VTKViewer_FramedTextActor::SetForegroundColor(const double r,
+ const double g,
+ const double b)
{
myTextProperty->SetColor(r, g, b);
myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
// function : GetForegroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::GetForegroundColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b)
+void VTKViewer_FramedTextActor::GetForegroundColor(double& r,
+ double& g,
+ double& b)
{
- vtkFloatingPointType aColor[3];
+ double aColor[3];
myTextProperty->GetColor(aColor);
r = aColor[0];
g = aColor[1];
// function : SetBackgroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetBackgroundColor(const vtkFloatingPointType r,
- const vtkFloatingPointType g,
- const vtkFloatingPointType b)
+void VTKViewer_FramedTextActor::SetBackgroundColor(const double r,
+ const double g,
+ const double b)
{
myBarActor->GetProperty()->SetColor(r, g, b);
Modified();
// function : GetBackgroundColor
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::GetBackgroundColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b)
+void VTKViewer_FramedTextActor::GetBackgroundColor(double& r,
+ double& g,
+ double& b)
{
- vtkFloatingPointType aColor[3];
+ double aColor[3];
myBarActor->GetProperty()->GetColor(aColor);
r = aColor[0];
g = aColor[1];
// function : SetTransparency
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency)
+void VTKViewer_FramedTextActor::SetTransparency(const double theTransparency)
{
if (theTransparency>=0. && theTransparency<=1.){
myTransparency=theTransparency;
// function : GetTransparency
// purpose :
//==================================================================
-vtkFloatingPointType VTKViewer_FramedTextActor::GetTransparency()const
+double VTKViewer_FramedTextActor::GetTransparency()const
{
return myTransparency;
}
// function : SetWorldPoint
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4])
+void VTKViewer_FramedTextActor::SetWorldPoint(const double theWorldPoint[4])
{
for(int i = 0; i<4; ++i) {
myWorldPoint[i] = theWorldPoint[i];
// function : GetWorldPoint
// purpose :
//==================================================================
-const vtkFloatingPointType* VTKViewer_FramedTextActor::GetWorldPoint()const
+const double* VTKViewer_FramedTextActor::GetWorldPoint()const
{
return myWorldPoint;
}
// function : SetDistance
// purpose :
//==================================================================
-void VTKViewer_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance)
+void VTKViewer_FramedTextActor::SetDistance(const double theDistance)
{
myDistance=theDistance;
}
// function : GetDistance
// purpose :
//==================================================================
-vtkFloatingPointType VTKViewer_FramedTextActor::GetDistance()const
+double VTKViewer_FramedTextActor::GetDistance()const
{
return myDistance;
}
int aTextMargin = GetTextMargin();
- vtkFloatingPointType xMin = 0.0;
- vtkFloatingPointType xMax = 0.0;
- vtkFloatingPointType yMin = -aBarHeight/2 - aTextMargin;
- vtkFloatingPointType yMax = aBarHeight/2 + aTextMargin;
+ double xMin = 0.0;
+ double xMax = 0.0;
+ double yMin = -aBarHeight/2 - aTextMargin;
+ double yMax = aBarHeight/2 + aTextMargin;
int aHorizontalOffset = GetLayoutType() == Horizontal ? myHorizontalOffset : 0;
int aVerticalOffset = GetLayoutType() == Vertical ? myVerticalOffset : 0;
theViewport->SetWorldPoint(myWorldPoint);
theViewport->WorldToDisplay();
- vtkFloatingPointType aSelectionPoint[3];
+ double aSelectionPoint[3];
theViewport->GetDisplayPoint(aSelectionPoint);
- vtkFloatingPointType u = aSelectionPoint[0];
- vtkFloatingPointType v = aSelectionPoint[1] - myDistance;
+ double u = aSelectionPoint[0];
+ double v = aSelectionPoint[1] - myDistance;
if(myMoveFrameFlag)
v -= aBarHeight/2.;
theViewport->ViewportToNormalizedViewport(u, v);
}
else // except BelowPoint, only TopLeft and TopRight modes are supported at this moment
{
- vtkFloatingPointType x = 0, xOffset = aHorizontalOffset + aTextMargin + OFFSET_SPACING;
- vtkFloatingPointType y = 0, yOffset = aVerticalOffset + aTextMargin + OFFSET_SPACING;
+ double x = 0, xOffset = aHorizontalOffset + aTextMargin + OFFSET_SPACING;
+ double y = 0, yOffset = aVerticalOffset + aTextMargin + OFFSET_SPACING;
if( myModePosition == TopLeft )
{
xMax = aTextMargin;
}
- PositionCoordinate->SetValue(x / (vtkFloatingPointType)aViewPortWidth,
- y / (vtkFloatingPointType)aViewPortHeight);
+ PositionCoordinate->SetValue(x / (double)aViewPortWidth,
+ y / (double)aViewPortHeight);
}
aPoints->SetPoint(0, xMin, yMax, 0.0);
enum LayoutType { Vertical = 0, Horizontal };
public:
- vtkTypeRevisionMacro(VTKViewer_FramedTextActor,vtkActor2D);
+ vtkTypeMacro(VTKViewer_FramedTextActor,vtkActor2D);
static VTKViewer_FramedTextActor *New();
virtual int RenderOpaqueGeometry(vtkViewport*);
void SetLayoutType(const int theType);
int GetLayoutType() const;
- void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]);
- const vtkFloatingPointType* GetWorldPoint() const;
+ void SetWorldPoint(const double theWorldPoint[4]);
+ const double* GetWorldPoint() const;
- void SetDistance(const vtkFloatingPointType theDistance);
- vtkFloatingPointType GetDistance() const;
+ void SetDistance(const double theDistance);
+ double GetDistance() const;
void SetMoveFrameFlag(const int flag);
int GetMoveFrameFlag() const;
- void SetForegroundColor(const vtkFloatingPointType r,
- const vtkFloatingPointType g,
- const vtkFloatingPointType b);
- void GetForegroundColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b);
+ void SetForegroundColor(const double r,
+ const double g,
+ const double b);
+ void GetForegroundColor(double& r,
+ double& g,
+ double& b);
- void SetBackgroundColor(const vtkFloatingPointType r,
- const vtkFloatingPointType g,
- const vtkFloatingPointType b);
- void GetBackgroundColor(vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b);
+ void SetBackgroundColor(const double r,
+ const double g,
+ const double b);
+ void GetBackgroundColor(double& r,
+ double& g,
+ double& b);
- void SetTransparency(const vtkFloatingPointType theTransparency);
- vtkFloatingPointType GetTransparency() const;
+ void SetTransparency(const double theTransparency);
+ double GetTransparency() const;
void SetTextMargin(const int theMargin);
int GetTextMargin() const;
int myLayoutType;
int myMoveFrameFlag;
- vtkFloatingPointType myWorldPoint[4];
- vtkFloatingPointType myDistance;
- vtkFloatingPointType myTransparency;
+ double myWorldPoint[4];
+ double myDistance;
+ double myTransparency;
int myTextMargin;
#endif
///////////////////////////////////////////////////////////////////////////////////////////////
-vtkCxxRevisionMacro(VTKViewer_GeometryFilter, "$Revision$");
vtkStandardNewMacro(VTKViewer_GeometryFilter);
VTKViewer_GeometryFilter
char *cellVis;
vtkIdType newCellId;
int faceId, *faceVerts, numFacePts;
- vtkFloatingPointType *x;
+ double *x;
vtkIdType PixelConvert[4];
// Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
// from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
vtkIdType aNewPts[VTK_CELL_SIZE];
// ghost cell stuff
- unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
+ unsigned char updateLevel = (unsigned char)(GetUpdateGhostLevel());
unsigned char *cellGhostLevels = 0;
PixelConvert[0] = 0;
return myIsBuildArc;
}
-void VTKViewer_GeometryFilter::SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle)
+void VTKViewer_GeometryFilter::SetQuadraticArcAngle(double theMaxAngle)
{
if(myMaxArcAngle != theMaxAngle) {
myMaxArcAngle = theMaxAngle;
}
}
-vtkFloatingPointType VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const
+double VTKViewer_GeometryFilter:: GetQuadraticArcAngle() const
{
return myMaxArcAngle;
}
*/
static VTKViewer_GeometryFilter *New();
- /*! \fn vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter)
+ /*! \fn vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter)
* \brief VTK type revision macros.
*/
- vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
+ vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
/*! \fn void SetInside(int theShowInside)
* \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified().
* \param theShowInside - used for changing value of \a myShowInside variable.
virtual void SetQuadraticArcMode(bool theFlag);
virtual bool GetQuadraticArcMode() const;
- virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
- virtual vtkFloatingPointType GetQuadraticArcAngle() const;
+ virtual void SetQuadraticArcAngle(double theMaxAngle);
+ virtual double GetQuadraticArcAngle() const;
typedef std::vector<vtkIdType> TVectorId;
typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
int myIsWireframeMode;
int myAppendCoincident3D;
- vtkFloatingPointType myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees
+ double myMaxArcAngle; // define max angle for mesh 2D quadratic element in the degrees
bool myIsBuildArc; // flag for representation 2D quadratic element as arked polygon
};
void VTKViewer_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
{
vtkCamera *cam = this->CurrentRenderer->GetActiveCamera();
- vtkFloatingPointType viewFocus[4], focalDepth, viewPoint[3];
- vtkFloatingPointType newPickPoint[4], oldPickPoint[4], motionVector[3];
+ double viewFocus[4], focalDepth, viewPoint[3];
+ double newPickPoint[4], oldPickPoint[4], motionVector[3];
cam->GetFocalPoint(viewFocus);
this->ComputeWorldToDisplay(viewFocus[0], viewFocus[1],
viewFocus[2], viewFocus);
focalDepth = viewFocus[2];
- this->ComputeDisplayToWorld(vtkFloatingPointType(toX), vtkFloatingPointType(toY),
+ this->ComputeDisplayToWorld(double(toX), double(toY),
focalDepth, newPickPoint);
- this->ComputeDisplayToWorld(vtkFloatingPointType(fromX),vtkFloatingPointType(fromY),
+ this->ComputeDisplayToWorld(double(fromX),double(fromY),
focalDepth, oldPickPoint);
// camera motion is reversed
const int left, const int top,
const int right, const int bottom)
{
- vtkFloatingPointType* aBounds = theActor->GetBounds();
- vtkFloatingPointType aMin[3], aMax[3];
+ double* aBounds = theActor->GetBounds();
+ double aMin[3], aMax[3];
ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
if (aMin[0] > aMax[0]) {
- vtkFloatingPointType aBuf = aMin[0];
+ double aBuf = aMin[0];
aMin[0] = aMax[0];
aMax[0] = aBuf;
}
if (aMin[1] > aMax[1]) {
- vtkFloatingPointType aBuf = aMin[1];
+ double aBuf = aMin[1];
aMin[1] = aMax[1];
aMax[1] = aBuf;
}
const int left, const int top,
const int right, const int bottom)
{
- vtkFloatingPointType* aBounds = theCell->GetBounds();
- vtkFloatingPointType aMin[3], aMax[3];
+ double* aBounds = theCell->GetBounds();
+ double aMin[3], aMax[3];
ComputeWorldToDisplay(aBounds[0], aBounds[2], aBounds[4], aMin);
ComputeWorldToDisplay(aBounds[1], aBounds[3], aBounds[5], aMax);
if (aMin[0] > aMax[0]) {
- vtkFloatingPointType aBuf = aMin[0];
+ double aBuf = aMin[0];
aMin[0] = aMax[0];
aMax[0] = aBuf;
}
if (aMin[1] > aMax[1]) {
- vtkFloatingPointType aBuf = aMin[1];
+ double aBuf = aMin[1];
aMin[1] = aMax[1];
aMax[1] = aBuf;
}
}
/*!Checks: is given point \a thePoint in rectangle*/
-bool VTKViewer_InteractorStyle::IsInRect(vtkFloatingPointType* thePoint,
+bool VTKViewer_InteractorStyle::IsInRect(double* thePoint,
const int left, const int top,
const int right, const int bottom)
{
- vtkFloatingPointType aPnt[3];
+ double aPnt[3];
ComputeWorldToDisplay(thePoint[0], thePoint[1], thePoint[2], aPnt);
return ((aPnt[0]>left) && (aPnt[0]<right) && (aPnt[1]>bottom) && (aPnt[1]<top));
bool IsInRect(vtkCell* theCell,
const int left, const int top,
const int right, const int bottom);
- bool IsInRect(vtkFloatingPointType* thePoint,
+ bool IsInRect(double* thePoint,
const int left, const int top,
const int right, const int bottom);
int State;
- vtkFloatingPointType MotionFactor;
- vtkFloatingPointType RadianToDegree; // constant: for conv from deg to rad
+ double MotionFactor;
+ double RadianToDegree; // constant: for conv from deg to rad
double myScale;
VTKViewer_Actor *myPreViewActor, *myPreSelectionActor, *mySelectedActor;
anImageData->Delete();
anImageData->SetExtent( 0, aWidth-1, 0, aHeight-1, 0, 0 );
- anImageData->SetScalarTypeToUnsignedChar();
- anImageData->SetNumberOfScalarComponents( 4 );
- anImageData->AllocateScalars();
+ anImageData->AllocateScalars( VTK_UNSIGNED_CHAR, 4 );
unsigned char* aDataPtr = (unsigned char*)anImageData->GetScalarPointer();
aDataPtr[ anId++ ] = aValue * aCoef;
aDataPtr[ anId++ ] = aValue;
}
- anImageData->Update();
return anImageData;
}
#endif
#ifndef VTK_IMPLEMENT_MESA_CXX
-vtkCxxRevisionMacro(VTKViewer_PolyDataMapper, "Revision$");
vtkStandardNewMacro(VTKViewer_PolyDataMapper);
#endif
//-----------------------------------------------------------------------------
struct TColorFunctorBase
{
- vtkFloatingPointType myAlpha;
+ double myAlpha;
TColorFunctorBase( vtkProperty* theProperty )
{
//-----------------------------------------------------------------------------
struct TPropertyColor : TColorFunctorBase
{
- vtkFloatingPointType myColor[3];
+ double myColor[3];
TPropertyColor( vtkProperty* theProperty ):
TColorFunctorBase( theProperty )
public:
static VTKViewer_PolyDataMapper* New();
- vtkTypeRevisionMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS );
+ vtkTypeMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS );
//! Set point marker enabled
void SetMarkerEnabled( bool );
void VTKViewer_RenderWindow::onChangeBackgroundColor()
{
//float red, green, blue;
- vtkFloatingPointType backint[3];
+ double backint[3];
vtkRendererCollection * theRenderers = myRW->GetRenderers();
theRenderers->InitTraversal();
TUpdateActor theFun)
{
(*theFun)(theMapIndex,theMapActor,theActor);
- vtkFloatingPointType aPos[3];
+ double aPos[3];
theMapActor->GetPosition(aPos);
theActor->SetPosition(aPos);
}
#include <vtkInformation.h>
#include <vtkInformationVector.h>
-vtkCxxRevisionMacro(VTKViewer_ShrinkFilter, "$Revision$");
vtkStandardNewMacro(VTKViewer_ShrinkFilter);
/*!Constructor. Sets store mapping to zero.*/
int i, j, numIds, abort=0;
vtkIdType cellId, numCells, numPts;
vtkIdType oldId, newId;
- vtkFloatingPointType center[3], *p, pt[3];
+ double center[3], *p, pt[3];
vtkPointData *pd, *outPD;;
vtkIdList *ptIds, *newPtIds;
vtkIdType tenth;
- vtkFloatingPointType decimal;
+ double decimal;
vtkDebugMacro(<<"Shrinking cells");
public:
/*!Create new instance of VTKViewer_ShrinkFilter.*/
static VTKViewer_ShrinkFilter *New();
- vtkTypeRevisionMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter);
+ vtkTypeMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter);
void SetStoreMapping(int theStoreMapping);
/*!Gets store mapping flag.*/
/*!
\return bounding box
*/
-vtkFloatingPointType*
+double*
VTKViewer_UnScaledActor
::GetBounds()
{
void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
{
if(theRenderer){
- vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
+ double 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]);
- vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
+ double 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();
- vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
+ double aWinDiag = sqrt(double(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
- aDataSet->Update();
- vtkFloatingPointType aLength = aDataSet->GetLength();
- vtkFloatingPointType aPrecision = 1.0E-3;
- vtkFloatingPointType aZeroTol = 1.0E-12;
- vtkFloatingPointType anOldScale = GetScale()[0];
- vtkFloatingPointType aScale = anOldScale;
- vtkFloatingPointType aMaxSize = (vtkFloatingPointType)qMax(aSize[1],aSize[0]);
+ GetMapper()->Update();
+ double aLength = aDataSet->GetLength();
+ double aPrecision = 1.0E-3;
+ double aZeroTol = 1.0E-12;
+ double anOldScale = GetScale()[0];
+ double aScale = anOldScale;
+ double aMaxSize = (double)qMax(aSize[1],aSize[0]);
if (qAbs(aWinDiag) > aZeroTol && qAbs(aLength) > aZeroTol && qAbs(aMaxSize) > aZeroTol)
- aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(qMin(aSize[1],aSize[0]))/aMaxSize);
+ aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(double(qMin(aSize[1],aSize[0]))/aMaxSize);
if(qAbs(aScale) > aZeroTol && qAbs(aScale - anOldScale)/aScale > aPrecision){
SetScale(aScale);
}
myLineSource->SetPoint1(0.0,0.0,0.0);
myMapper[0] = vtkPolyDataMapper::New();
- myMapper[0]->SetInput(myLineSource->GetOutput());
+ myMapper[0]->SetInputConnection(myLineSource->GetOutputPort());
myLineActor = VTKViewer_LineActor::New();
myLineActor->SetMapper(myMapper[0]);
myConeSource->SetCenter(-0.5,0.0,0.0);
myMapper[1] = vtkPolyDataMapper::New();
- myMapper[1]->SetInput(myConeSource->GetOutput());
+ myMapper[1]->SetInputConnection(myConeSource->GetOutputPort());
myArrowActor = vtkFollower::New();
myArrowActor->SetMapper(myMapper[1]);
myLabelActor = vtkTextActor::New();
myLabelActor->SetMapper(myTextMapper);
- myLabelActor->ScaledTextOff();
+ myLabelActor->SetTextScaleModeToNone();
myLabelActor->PickableOff();
vtkCoordinate* aCoord = vtkCoordinate::New();
myVectorText = vtkVectorText::New();
myMapper[2] = vtkPolyDataMapper::New();
- myMapper[2]->SetInput(myVectorText->GetOutput());
+ myMapper[2]->SetInputConnection(myVectorText->GetOutputPort());
myLabelActor = VTKViewer_UnScaledActor::New();
myLabelActor->SetMapper(myMapper[2]);
/*! Set size of VTKViewer_Axis
*/
-void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize)
+void VTKViewer_Axis::SetSize(double theSize)
{
- vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
+ double aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
- vtkFloatingPointType aCoef = 0.99;
- vtkFloatingPointType aLinePosition[3] = {aPosition[0]*aCoef, aPosition[1]*aCoef, aPosition[2]*aCoef};
+ double aCoef = 0.99;
+ double aLinePosition[3] = {aPosition[0]*aCoef, aPosition[1]*aCoef, aPosition[2]*aCoef};
myLineSource->SetPoint2(aLinePosition);
myArrowActor->SetPosition(0.0,0.0,0.0);
myAxis[0] = VTKViewer_XAxis::New();
myAxis[1] = VTKViewer_YAxis::New();
myAxis[2] = VTKViewer_ZAxis::New();
- static vtkFloatingPointType aSize = 100;
+ static double aSize = 100;
SetSize(aSize);
}
/*! Set size of axes
*/
-void VTKViewer_Trihedron::SetSize(vtkFloatingPointType theSize)
+void VTKViewer_Trihedron::SetSize(double theSize)
{
mySize = theSize;
for(int i = 0; i < 3; i++)
#include <vtkObject.h>
#include <vtkFollower.h>
+#include <vtkVersion.h>
class vtkRenderer;
class vtkActorCollection;
/*!Create new instance of VTKViewer_UnScaledActor.*/
static VTKViewer_UnScaledActor *New();
- virtual vtkFloatingPointType* GetBounds();
+ virtual double* GetBounds();
virtual void SetSize(int theSize);
virtual void Render(vtkRenderer *theRenderer);
static VTKViewer_Trihedron *New();
/*!Sets size of trihedron.
- * \param theSize - vtkFloatingPointType value
+ * \param theSize - double value
*/
- virtual void SetSize(vtkFloatingPointType theSize);
+ virtual void SetSize(double theSize);
/*! Get size of trihedron.
- * \retval mySize - vtkFloatingPointType value
+ * \retval mySize - double value
*/
- virtual vtkFloatingPointType GetSize() { return mySize;}
+ virtual double GetSize() { return mySize;}
enum TVisibility{eOff, eOn, eOnlyLineOn};
VTKViewer_Axis* myAxis[3];
/*! Common size for trihedron, for each axis.*/
- vtkFloatingPointType mySize;
+ double mySize;
};
/*!The base class for concreate Axis.
/*! Set size of VTKViewer_Axis
*/
- virtual void SetSize(vtkFloatingPointType theSize);
+ virtual void SetSize(double theSize);
/*! Get label actor.
* \retval Return myLabelActor.
/*! \var myRot[3]
* Orientation vector
*/
- vtkFloatingPointType myDir[3], myRot[3];
+ double myDir[3], myRot[3];
/*! VTKViewer_LineActor actor pointer
*/
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
-/*!@see vtkRenderer::ResetCamera(vtkFloatingPointType bounds[6]) method*/
+/*!@see vtkRenderer::ResetCamera(double bounds[6]) method*/
void
ResetCamera(vtkRenderer* theRenderer,
int theUsingZeroFocalPoint)
if(!aCamera)
return;
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
if(theUsingZeroFocalPoint || aCount){
- static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
- vtkFloatingPointType aLength = aBounds[1]-aBounds[0];
+ double aLength = aBounds[1]-aBounds[0];
aLength = std::max((aBounds[3]-aBounds[2]),aLength);
aLength = std::max((aBounds[5]-aBounds[4]),aLength);
if(aLength < MIN_DISTANCE)
return;
- vtkFloatingPointType aWidth =
+ double aWidth =
sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) +
(aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
(aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
if(aWidth < MIN_DISTANCE)
return;
- vtkFloatingPointType aViewPlaneNormal[3];
+ double aViewPlaneNormal[3];
aCamera->GetViewPlaneNormal(aViewPlaneNormal);
- vtkFloatingPointType aCenter[3] = {0.0, 0.0, 0.0};
+ double aCenter[3] = {0.0, 0.0, 0.0};
if(!theUsingZeroFocalPoint){
aCenter[0] = (aBounds[0] + aBounds[1])/2.0;
aCenter[1] = (aBounds[2] + aBounds[3])/2.0;
}
aCamera->SetFocalPoint(aCenter[0],aCenter[1],aCenter[2]);
- vtkFloatingPointType aViewAngle = aCamera->GetViewAngle();
- vtkFloatingPointType aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0);
+ double aViewAngle = aCamera->GetViewAngle();
+ double aDistance = 2.0*aWidth/tan(aViewAngle*vtkMath::Pi()/360.0);
// check view-up vector against view plane normal
- vtkFloatingPointType aViewUp[3];
+ double aViewUp[3];
aCamera->GetViewUp(aViewUp);
if(fabs(vtkMath::Dot(aViewUp,aViewPlaneNormal)) > 0.999)
aCamera->SetViewUp(-aViewUp[2], aViewUp[0], aViewUp[1]);
// find size of the window
int* aWinSize = theRenderer->GetSize();
if(aWinSize[0] < aWinSize[1])
- aWidth *= vtkFloatingPointType(aWinSize[1])/vtkFloatingPointType(aWinSize[0]);
+ aWidth *= double(aWinSize[1])/double(aWinSize[0]);
if(theUsingZeroFocalPoint)
aWidth *= sqrt(2.0);
/*! Compute the bounds of the visible props*/
int
ComputeVisiblePropBounds(vtkRenderer* theRenderer,
- vtkFloatingPointType theBounds[6])
+ double theBounds[6])
{
int aCount = 0;
if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(aProp))
if(anActor->IsInfinitive())
continue;
- vtkFloatingPointType *aBounds = aProp->GetBounds();
- static vtkFloatingPointType MIN_DISTANCE = 1./VTK_LARGE_FLOAT;
- static vtkFloatingPointType MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+ double *aBounds = aProp->GetBounds();
+ static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT;
+ static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
if(abs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) {
aBounds[0]-=0.001;
return aCount;
}
-/*!@see vtkRenderer::ResetCameraClippingRange(vtkFloatingPointType bounds[6]) method*/
+/*!@see vtkRenderer::ResetCameraClippingRange(double bounds[6]) method*/
void
ResetCameraClippingRange(vtkRenderer* theRenderer)
{
}
// Find the plane equation for the camera view plane
- vtkFloatingPointType vn[3];
+ double vn[3];
anActiveCamera->GetViewPlaneNormal(vn);
- vtkFloatingPointType position[3];
+ double position[3];
anActiveCamera->GetPosition(position);
- vtkFloatingPointType bounds[6];
+ double bounds[6];
//theRenderer->ComputeVisiblePropBounds(bounds);
ComputeVisiblePropBounds(theRenderer, bounds);
- vtkFloatingPointType center[3];
+ double center[3];
center[0] = (bounds[0] + bounds[1])/2.0;
center[1] = (bounds[2] + bounds[3])/2.0;
center[2] = (bounds[4] + bounds[5])/2.0;
- vtkFloatingPointType width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
+ double width = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
(bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
(bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
- vtkFloatingPointType distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
+ double distance = sqrt((position[0]-center[0])*(position[0]-center[0]) +
(position[1]-center[1])*(position[1]-center[1]) +
(position[2]-center[2])*(position[2]-center[2]));
- vtkFloatingPointType range[2] = {distance - width/2.0, distance + width/2.0};
+ double range[2] = {distance - width/2.0, distance + width/2.0};
// Do not let the range behind the camera throw off the calculation.
if (range[0] < 0.0) range[0] = 0.0;
/*!Compute trihedron size.*/
bool
ComputeTrihedronSize( vtkRenderer* theRenderer,
- vtkFloatingPointType& theNewSize,
- const vtkFloatingPointType theSize,
- const vtkFloatingPointType theSizeInPercents )
+ double& theNewSize,
+ const double theSize,
+ const double theSizeInPercents )
{
// calculating diagonal of visible props of the renderer
- vtkFloatingPointType bnd[ 6 ];
+ double bnd[ 6 ];
if ( ComputeVisiblePropBounds( theRenderer, bnd ) == 0 )
{
bnd[ 1 ] = bnd[ 3 ] = bnd[ 5 ] = 100;
bnd[ 0 ] = bnd[ 2 ] = bnd[ 4 ] = 0;
}
- vtkFloatingPointType aLength = 0;
+ double aLength = 0;
aLength = bnd[ 1 ]-bnd[ 0 ];
aLength = std::max( ( bnd[ 3 ] - bnd[ 2 ] ),aLength );
aLength = std::max( ( bnd[ 5 ] - bnd[ 4 ] ),aLength );
- static vtkFloatingPointType EPS_SIZE = 5.0E-3;
+ static double EPS_SIZE = 5.0E-3;
theNewSize = aLength * theSizeInPercents / 100.0;
// if the new trihedron size have sufficient difference, then apply the value
if(!theRenderer)
return false;
- vtkFloatingPointType aNewBndBox[6];
+ double aNewBndBox[6];
aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
if(VTKViewer_Actor* anActor = VTKViewer_Actor::SafeDownCast(anAct))
if(anActor->GetVisibility() && !anActor->IsInfinitive())
{
- vtkFloatingPointType *aBounds = anActor->GetBounds();
+ double *aBounds = anActor->GetBounds();
if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
return !isAny;
}
-bool ComputeBBCenter(vtkRenderer* theRenderer, vtkFloatingPointType theCenter[3])
+bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3])
{
theCenter[0] = theCenter[1] = theCenter[2] = 0.0;
if(!theRenderer)
return false;
- vtkFloatingPointType aNewBndBox[6];
+ double aNewBndBox[6];
aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
{
if(anActor->GetVisibility() && !anActor->IsInfinitive())
{
- vtkFloatingPointType *aBounds = anActor->GetBounds();
+ double *aBounds = anActor->GetBounds();
if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
aNewBndBox[2] > -VTK_LARGE_FLOAT && aNewBndBox[3] < VTK_LARGE_FLOAT &&
aNewBndBox[4] > -VTK_LARGE_FLOAT && aNewBndBox[5] < VTK_LARGE_FLOAT)
{
- static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
- vtkFloatingPointType aLength = aNewBndBox[1]-aNewBndBox[0];
+ double aLength = aNewBndBox[1]-aNewBndBox[0];
aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength);
aLength = std::max((aNewBndBox[5]-aNewBndBox[4]),aLength);
if(aLength < MIN_DISTANCE)
return false;
- vtkFloatingPointType aWidth =
+ double aWidth =
sqrt((aNewBndBox[1]-aNewBndBox[0])*(aNewBndBox[1]-aNewBndBox[0]) +
(aNewBndBox[3]-aNewBndBox[2])*(aNewBndBox[3]-aNewBndBox[2]) +
(aNewBndBox[5]-aNewBndBox[4])*(aNewBndBox[5]-aNewBndBox[4]));
return false;
/*
- vtkFloatingPointType aBounds[6];
+ double aBounds[6];
int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
printf("aNewBndBox[0] = %f, aNewBndBox[1] = %f,\naNewBndBox[2] = %f, aNewBndBox[3] = %f,\naNewBndBox[4] = %f, aNewBndBox[5] = %f\n",
aBounds[0],aBounds[1],aBounds[2],aBounds[3],aBounds[4],aBounds[5]);
printf("aCount = %d\n",aCount);
if(aCount){
- static vtkFloatingPointType MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+ static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
- vtkFloatingPointType aLength = aBounds[1]-aBounds[0];
+ double aLength = aBounds[1]-aBounds[0];
aLength = max((aBounds[3]-aBounds[2]),aLength);
aLength = max((aBounds[5]-aBounds[4]),aLength);
if(aLength < MIN_DISTANCE)
return false;
- vtkFloatingPointType aWidth =
+ double aWidth =
sqrt((aBounds[1]-aBounds[0])*(aBounds[1]-aBounds[0]) +
(aBounds[3]-aBounds[2])*(aBounds[3]-aBounds[2]) +
(aBounds[5]-aBounds[4])*(aBounds[5]-aBounds[4]));
extern
int
ComputeVisiblePropBounds(vtkRenderer* theRenderer,
- vtkFloatingPointType theBounds[6]);
+ double theBounds[6]);
VTKVIEWER_EXPORT
extern
extern
bool
ComputeTrihedronSize(vtkRenderer* theRenderer,
- vtkFloatingPointType& theNewSize,
- const vtkFloatingPointType theSize,
- const vtkFloatingPointType theSizeInPercents);
+ double& theNewSize,
+ const double theSize,
+ const double theSizeInPercents);
VTKVIEWER_EXPORT
extern
VTKVIEWER_EXPORT
extern
bool ComputeBBCenter(vtkRenderer* theRenderer,
- vtkFloatingPointType theCenter[3]);
+ double theCenter[3]);
#endif
::ResetCamera(myRenderer,true);
if(aTriedronIsVisible) myTrihedron->VisibilityOn();
else myTrihedron->VisibilityOff();
- static vtkFloatingPointType aCoeff = 3.0;
+ static double aCoeff = 3.0;
aCamera->SetParallelScale(aCoeff*aCamera->GetParallelScale());
Repaint();
}
int aVisibleNum = myTrihedron->GetVisibleActorCount(myRenderer);
if(aVisibleNum){
// calculating diagonal of visible props of the renderer
- vtkFloatingPointType bnd[6];
+ double bnd[6];
myTrihedron->VisibilityOff();
::ComputeVisiblePropBounds(myRenderer,bnd);
myTrihedron->VisibilityOn();
- vtkFloatingPointType aLength = 0;
+ double aLength = 0;
static bool CalcByDiag = false;
if(CalcByDiag){
aLength = sqrt((bnd[1]-bnd[0])*(bnd[1]-bnd[0])+
aLength = qMax((bnd[5]-bnd[4]),aLength);
}
- static vtkFloatingPointType aSizeInPercents = 105;
+ static double aSizeInPercents = 105;
QString aSetting;// = SUIT_CONFIG->getSetting("Viewer:TrihedronSize");
if(!aSetting.isEmpty()) aSizeInPercents = aSetting.toFloat();
- static vtkFloatingPointType EPS_SIZE = 5.0E-3;
- vtkFloatingPointType aSize = myTrihedron->GetSize();
- vtkFloatingPointType aNewSize = aLength*aSizeInPercents/100.0;
+ static double EPS_SIZE = 5.0E-3;
+ double aSize = myTrihedron->GetSize();
+ double aNewSize = aLength*aSizeInPercents/100.0;
// if the new trihedron size have sufficient difference, then apply the value
if(fabs(aNewSize-aSize) > aSize*EPS_SIZE || fabs(aNewSize-aSize) > aNewSize*EPS_SIZE){
myTrihedron->SetSize(aNewSize);
}
vtkStandardNewMacro(vtkEDFCutter);
-vtkCxxRevisionMacro(vtkEDFCutter, "0.0");
vtkEDFCutter::vtkEDFCutter()
{
{
public :
static vtkEDFCutter* New();
- vtkTypeRevisionMacro(vtkEDFCutter, vtkCutter);
+ vtkTypeMacro(vtkEDFCutter, vtkCutter);
void PrintSelf(ostream& os, vtkIndent indent);
// Description: