From 5cc84a290412619fc37bbdde9417e5198a957a6e Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 24 May 2005 10:39:06 +0000 Subject: [PATCH] add IsPlanarInput() --- src/PIPELINE/VISU_PipeLine.cxx | 20 +++++++++++++++++++- src/PIPELINE/VISU_PipeLine.hxx | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index a5a36ad6..0c8223cd 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -31,7 +31,7 @@ #include "SALOME_ExtractGeometry.h" -#include +#include #include #include @@ -286,3 +286,21 @@ void VISU_PipeLine::GetPlaneParam (float theDir[3], float& theDist, vtkPlane* th thePlane->GetOrigin(anOrigin); ::PositionToDistance(GetInput(),theDir,anOrigin,theDist); } + +//======================================================================= +//function : IsPlanarInput +//purpose : +//======================================================================= + +bool VISU_PipeLine::IsPlanarInput() const +{ + float aBounds[6]; + GetInput()->GetBounds( aBounds ); // xmin,xmax, ymin,ymax, zmin,zmax + if (fabs( aBounds[0] - aBounds[1] ) <= FLT_MIN || + fabs( aBounds[2] - aBounds[3] ) <= FLT_MIN || + fabs( aBounds[4] - aBounds[5] ) <= FLT_MIN ) + return true; + + return false; +} + diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 7267531e..91491e59 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -80,6 +80,8 @@ public: virtual void SetInput(TInput* theInput); virtual TInput* GetInput() const; + bool IsPlanarInput() const; + typedef vtkDataSetMapper TMapper; virtual TMapper* GetMapper(); -- 2.39.2