-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// VISU OBJECT : interactive object for VISU entities implementation
// File: VISU_GaussPoints.cxx
// Author: Alexey PETROV
void
VISU_GaussPointsPL
::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
+ bool theIsCopyInput)
{
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
VISU_MergedPL::DoShallowCopy(thePipeLine, theIsCopyInput);
}
+//----------------------------------------------------------------------------
+void
+VISU_GaussPointsPL
+::SetOpacity(vtkFloatingPointType theOpacity)
+{
+ GetPointSpriteMapper()->SetPointSpriteOpacity( theOpacity );
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType
+VISU_GaussPointsPL
+::GetOpacity()
+{
+ return GetPointSpriteMapper()->GetPointSpriteOpacity();
+}
+
+
//----------------------------------------------------------------------------
void
VISU_GaussPointsPL
vtkFloatingPointType* aScalarRange = GetScalarRange();
vtkFloatingPointType aDeltaScalarRange = aScalarRange[1] - aScalarRange[0];
+ // to avoid FPE if the minimum is equal to maximum
+ if( aDeltaScalarRange < 1.0 / VTK_LARGE_FLOAT )
+ return aMinSize;
+
return aMinSize + aDelta*(aVal - aScalarRange[0]) / aDeltaScalarRange;
}
vtkSmartPointer<vtkImageData>
VISU_GaussPointsPL
::MakeTexture( const char* theMainTexture,
- const char* theAlphaTexture )
+ const char* theAlphaTexture )
{
if( !theMainTexture || !theAlphaTexture )
return 0;
int
VISU_GaussPointsPL
-::AddGeometry(vtkDataSet* theGeometry)
+::AddGeometry(vtkDataSet* theGeometry, const VISU::TName& theGeomName)
{
+ // Fix for issue 0020167 (like in VISU_ScalarMapPL)
+ if(!IsExternalGeometryUsed())
+ ClearGeometry();
+ AddGeometryName(theGeomName);
myAppendFilter->AddInput(theGeometry);
return GetNumberOfGeometry();
}
vtkDataSet*
VISU_GaussPointsPL
-::GetGeometry(int theGeomNumber)
+::GetGeometry(int theGeomNumber, VISU::TName& theGeomName)
{
+ theGeomName = GetGeometryName(theGeomNumber);
return vtkDataSet::SafeDownCast(myAppendFilter->GetInput(theGeomNumber));
}
VISU_GaussPointsPL
::ClearGeometry()
{
+ ClearGeometryNames();
myAppendFilter->RemoveAllInputs();
}
+void
+VISU_GaussPointsPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+ if(!IsExternalGeometryUsed())
+ Superclass::GetSourceRange(theRange);
+ else
+ GetMergedInput()->GetScalarRange( theRange );
+}
+
vtkPointSet*
VISU_GaussPointsPL
::GetMergedInput()