-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <string>
#include <vector>
+#include <limits>
+
+#include <NCollection_IndexedMap.hxx>
+#include <NCollection_Map.hxx>
#include <vtkLODActor.h>
#include <vtkProperty.h>
class vtkCamera;
class vtkProperty;
class vtkRenderer;
-class vtkPassThroughFilter;
+class vtkPassThrough;
class VTKViewer_Transform;
class VTKViewer_GeometryFilter;
public:
static VTKViewer_Actor* New();
- vtkTypeMacro(VTKViewer_Actor,vtkLODActor);
+ vtkTypeMacro(VTKViewer_Actor,vtkLODActor)
//----------------------------------------------------------------------------
//! Get its name
void
SetColor(const double theRGB[3]);
- //! Change material\r
- virtual\r
- void\r
+ //! Change material
+ virtual
+ void
SetMaterial(std::vector<vtkProperty*> theProps);
- //! Get current front material\r
- virtual\r
- vtkProperty* \r
- GetFrontMaterial();\r
-\r
- //! Get current back material\r
- virtual\r
- vtkProperty* \r
+ //! Get current front material
+ virtual
+ vtkProperty*
+ GetFrontMaterial();
+
+ //! Get current back material
+ virtual
+ vtkProperty*
GetBackMaterial();
//----------------------------------------------------------------------------
// For selection mapping purpose
//! Maps VTK index of a node to corresponding object index
virtual
- int
- GetNodeObjId(int theVtkID);
+ vtkIdType
+ GetNodeObjId(vtkIdType theVtkID);
//! Get coordinates of a node for given object index
virtual
double*
- GetNodeCoord(int theObjID);
+ GetNodeCoord(vtkIdType theObjID);
//! Maps object index of a node to corresponding VTK index
virtual
- int
- GetNodeVtkId(int theObjID);
+ vtkIdType
+ GetNodeVtkId(vtkIdType theObjID);
//! Maps VTK index of a cell to corresponding object index
virtual
- int
- GetElemObjId(int theVtkID);
+ vtkIdType
+ GetElemObjId(vtkIdType theVtkID);
//! Get corresponding #vtkCell for given object index
virtual
vtkCell*
- GetElemCell(int theObjID);
+ GetElemCell(vtkIdType theObjID);
//----------------------------------------------------------------------------
//! Get dimension of corresponding mesh element
virtual
int
- GetObjDimension( const int theObjId );
+ GetObjDimension( const vtkIdType theObjId );
//! To insert some additional filters and then sets the given #vtkMapper
virtual
//! Is notified on enabling/disabling selection
virtual
void
- EnableSelection( bool enable ) {}
+ EnableSelection( bool /*enable*/ ) {}
//! Ask, if the descendant of the VTKViewer_Actor will implement its own highlight or not
virtual
bool myStoreMapping;
VTKViewer_GeometryFilter *myGeomFilter;
VTKViewer_TransformFilter *myTransformFilter;
- std::vector<vtkPassThroughFilter*> myPassFilter;
+ std::vector<vtkPassThrough*> myPassFilter;
int myRepresentation;
vtkProperty *myProperty;
bool myIsHighlighted;
};
+struct vtkIdHasher
+{
+ static int HashCode(const vtkIdType theValue, const int theUpperBound)
+ {
+ return static_cast<int> ((theValue & (std::numeric_limits<vtkIdType>::max)()) % theUpperBound + 1);
+ }
+
+ static bool IsEqual( const vtkIdType& id1, const vtkIdType& id2 )
+ {
+ return id1 == id2;
+ }
+};
+
+typedef NCollection_Map< vtkIdType, vtkIdHasher > TVtkIDsMap;
+typedef NCollection_IndexedMap<vtkIdType,vtkIdHasher> TIndexedMapOfVtkId;
+
#ifdef WIN32
#pragma warning ( default:4251 )
#endif