-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 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
#include <VTKViewer_PolyDataMapper.h>
#include <VTKViewer_DataSetMapper.h>
-#include <vtkPassThroughFilter.h>
+#include <vtkPassThrough.h>
-vtkStandardNewMacro(SVTK_DeviceActor);
+vtkStandardNewMacro(SVTK_DeviceActor)
/*!
Constructor
myRepresentation = VTKViewer::Representation::Surface;
myIsResolveCoincidentTopology = true;
- vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+ myPolygonOffsetUnits);
myMapper = VTKViewer_DataSetMapper::New();
myTransformFilter = VTKViewer_TransformFilter::New();
for(int i = 0; i < 6; i++)
- myPassFilter.push_back(vtkPassThroughFilter::New());
+ myPassFilter.push_back(vtkPassThrough::New());
}
/*!
myFeatureEdges->Delete();
- for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
+ for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
myPassFilter[i]->Delete();
}
SVTK_DeviceActor
::GetInput()
{
- return myPassFilter.front()->GetOutput();
+ return static_cast<vtkDataSet *>(myPassFilter.front()->GetOutput());
}
/*!
/*!
\return time of modification
*/
-unsigned long int
+vtkMTimeType
SVTK_DeviceActor
::GetMTime()
{
- unsigned long mTime = this->Superclass::GetMTime();
+ vtkMTimeType mTime = this->Superclass::GetMTime();
mTime = std::max(mTime,myGeomFilter->GetMTime());
if(myIsFeatureEdgesEnabled)
mTime = std::max(mTime,myFeatureEdges->GetMTime());
- for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
+ for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
std::max(mTime,myPassFilter[i]->GetMTime());
return mTime;
if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() )
{
myPassFilter[ 0 ]->Update();
- if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+ if ( vtkDataSet* aDataSet = static_cast<vtkDataSet *>( myPassFilter[ 0 ]->GetOutput() ) )
{
- int numCells=aDataSet->GetNumberOfCells();
- int numPts = aDataSet->GetNumberOfPoints();
+ vtkIdType numCells=aDataSet->GetNumberOfCells();
+ vtkIdType numPts = aDataSet->GetNumberOfPoints();
//It's impossible to use to apply "shrink" for "empty" dataset
if (numCells < 1 || numPts < 1)
return;
/*!
Maps VTK index of a node to corresponding object index
*/
-int
+vtkIdType
SVTK_DeviceActor
-::GetNodeObjId(int theVtkID)
+::GetNodeObjId(vtkIdType theVtkID)
{
return theVtkID;
}
*/
double*
SVTK_DeviceActor
-::GetNodeCoord(int theObjID)
+::GetNodeCoord(vtkIdType theObjID)
{
return GetInput()->GetPoint(theObjID);
}
*/
vtkCell*
SVTK_DeviceActor
-::GetElemCell(int theObjID)
+::GetElemCell(vtkIdType theObjID)
{
return GetInput()->GetCell(theObjID);
}
/*!
Maps VTK index of a cell to corresponding object index
*/
-int
+vtkIdType
SVTK_DeviceActor
-::GetElemObjId(int theVtkID)
+::GetElemObjId(vtkIdType theVtkID)
{
return theVtkID;
}
::Render(vtkRenderer *ren, vtkMapper* m)
{
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
- double aFactor, aUnit;
- vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
-
- double aNewFactor = myPolygonOffsetFactor, aNewUnit = myPolygonOffsetUnits;
- if(!myIsResolveCoincidentTopology){
- static double EPS = .01;
- aNewFactor *= (1.0-EPS);
- aNewUnit *= (1.0-EPS);
+ if(myIsResolveCoincidentTopology){
+ double aFactor, aUnit;
+ vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
+
+ vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
+ vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
+ myPolygonOffsetUnits);
+ Superclass::Render(ren,m);
+
+ vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
+ }else{
+ vtkMapper::SetResolveCoincidentTopologyToOff();
+ Superclass::Render(ren,m);
}
-
- vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
- vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aNewFactor,
- aNewUnit);
- Superclass::Render(ren,m);
-
- vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology);
}
void SVTK_DeviceActor::SetBallEnabled( bool theBallEnabled ) {
myMapper->SetBallEnabled( theBallEnabled );
}
+/*!
+ * Set ball scale factor
+ * \param theBallScale double value a scale factor of ball element
+ */
+void SVTK_DeviceActor::SetBallScale( double theBallScale ) {
+ myMapper->SetBallScale( theBallScale );
+}
/*!
* Set point marker enabled