From: apo Date: Wed, 31 Aug 2005 11:22:27 +0000 (+0000) Subject: Minor changes X-Git-Tag: BR-D5-38-2003_D2005-12-09~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=39f194bab28b29d345a47ffce909c040415f3a8f;p=modules%2Fgui.git Minor changes --- diff --git a/src/VTKViewer/VTKViewer_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index 990a751a4..4835f76c5 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.cxx +++ b/src/VTKViewer/VTKViewer_AppendFilter.cxx @@ -70,25 +70,47 @@ using namespace std; vtkCxxRevisionMacro(VTKViewer_AppendFilter, "$Revision$"); vtkStandardNewMacro(VTKViewer_AppendFilter); -VTKViewer_AppendFilter::VTKViewer_AppendFilter() +VTKViewer_AppendFilter +::VTKViewer_AppendFilter() { myDoMappingFlag=false;//modified by NIZNHY-PKV Tue Aug 30 10:09:50 2005ft } -VTKViewer_AppendFilter::~VTKViewer_AppendFilter() +VTKViewer_AppendFilter +::~VTKViewer_AppendFilter() {} -void VTKViewer_AppendFilter::SetDoMappingFlag(const bool theFlag) +void +VTKViewer_AppendFilter +::SetDoMappingFlag(const bool theFlag) { myDoMappingFlag=theFlag; } -bool VTKViewer_AppendFilter::DoMappingFlag() const +bool +VTKViewer_AppendFilter +::DoMappingFlag() const { return myDoMappingFlag; } -void VTKViewer_AppendFilter::Execute() +void +VTKViewer_AppendFilter +::SetPoints(vtkPoints* thePoints) +{ + myPoints = thePoints; +} + +vtkPoints* +VTKViewer_AppendFilter +::GetPoints() +{ + return myPoints.GetPointer(); +} + +void +VTKViewer_AppendFilter +::Execute() { vtkAppendFilter::Execute(); if (myDoMappingFlag){ @@ -160,14 +182,18 @@ void VTKViewer_AppendFilter::DoMapping() } } } -//modified by NIZNHY-PKV Tue Aug 30 10:20:50 2005f -int VTKViewer_AppendFilter::GetElemVtkID(int theObjID) + + +//--------------------------------------------------------------- +vtkIdType +VTKViewer_AppendFilter +::GetPointOutputID(vtkIdType theInputID) { int aVtkID=-1; IteratorOfDataMapOfIntegerInteger aMapIt; // - aMapIt=myCellMapObjIDVtkID.find(theObjID); - if (aMapIt!=myCellMapObjIDVtkID.end()) { + aMapIt=myNodeMapObjIDVtkID.find(theInputID); + if (aMapIt!=myNodeMapObjIDVtkID.end()) { // found PairOfDataMapOfIntegerInteger& aPair=(*aMapIt); aVtkID=aPair.second; @@ -175,71 +201,82 @@ int VTKViewer_AppendFilter::GetElemVtkID(int theObjID) return aVtkID; } -int VTKViewer_AppendFilter::GetNodeVtkID(int theObjID) + +//--------------------------------------------------------------- +vtkIdType +VTKViewer_AppendFilter +::GetCellOutputID(vtkIdType theInputID) { int aVtkID=-1; IteratorOfDataMapOfIntegerInteger aMapIt; // - aMapIt=myNodeMapObjIDVtkID.find(theObjID); - if (aMapIt!=myNodeMapObjIDVtkID.end()) { + aMapIt=myCellMapObjIDVtkID.find(theInputID); + if (aMapIt!=myCellMapObjIDVtkID.end()) { // found PairOfDataMapOfIntegerInteger& aPair=(*aMapIt); aVtkID=aPair.second; } return aVtkID; } -//modified by NIZNHY-PKV Tue Aug 30 10:20:54 2005t -int VTKViewer_AppendFilter::GetNodeObjId(int theVtkID, - int& theInputIndex) + +//--------------------------------------------------------------- +vtkIdType +VTKViewer_AppendFilter +::GetPointInputID(vtkIdType theOutputID, + vtkIdType& theInputDataSetID) { int aNb, aNbRanges, aRetID, i, i1, i2, j; // aRetID=-1; - theInputIndex=-1; + theInputDataSetID=-1; // aNb=myNodeIds.size(); - if (theVtkID<0 || theVtkID>=aNb) { + if (theOutputID<0 || theOutputID>=aNb) { return aRetID; } // - aRetID=(int)myNodeIds[theVtkID]; + aRetID=(int)myNodeIds[theOutputID]; // aNbRanges=myNodeRanges.size()/2; for (i=0; i=i1 && theVtkID<=i2) { - theInputIndex=i; + if (theOutputID>=i1 && theOutputID<=i2) { + theInputDataSetID=i; } } // return aRetID; } -int VTKViewer_AppendFilter::GetElemObjId(int theVtkID, - int& theInputIndex) + +//--------------------------------------------------------------- +vtkIdType +VTKViewer_AppendFilter +::GetCellInputID(vtkIdType theOutputID, + vtkIdType& theInputDataSetID) { int aNb, aNbRanges, aRetID, i, i1, i2, j; // aRetID=-1; - theInputIndex=-1; + theInputDataSetID=-1; // aNb=myCellIds.size(); - if (theVtkID<0 || theVtkID>=aNb) { + if (theOutputID<0 || theOutputID>=aNb) { return aRetID; } // - aRetID=(int)myCellIds[theVtkID]; + aRetID=(int)myCellIds[theOutputID]; // aNbRanges=myCellRanges.size()/2; for (i=0; i=i1 && theVtkID<=i2) { - theInputIndex=i; + if (theOutputID>=i1 && theOutputID<=i2) { + theInputDataSetID=i; } } // diff --git a/src/VTKViewer/VTKViewer_AppendFilter.h b/src/VTKViewer/VTKViewer_AppendFilter.h index 7c3fefe78..d5cc9d7a1 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.h +++ b/src/VTKViewer/VTKViewer_AppendFilter.h @@ -4,12 +4,12 @@ #include "VTKViewer.h" #include +#include #include -//pkv f #include -using namespace std; -//pkv t + +class vtkPoints; /*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information. */ @@ -29,18 +29,26 @@ public: bool DoMappingFlag() const; - int GetElemObjId(int theVtkI, - int& theInputIndex); + void + SetPoints(vtkPoints* thePoints); - int GetNodeObjId(int theVtkID, - int& theInputIndex); + vtkPoints* + GetPoints(); - //pkv f - int GetElemVtkID(int theObjID); + vtkIdType + GetPointOutputID(vtkIdType theInputID); + + vtkIdType + GetCellOutputID(vtkIdType theInputID); + + vtkIdType + GetPointInputID(vtkIdType theOutputID, + vtkIdType& theInputDataSetID); + + vtkIdType + GetCellInputID(vtkIdType theOutputID, + vtkIdType& theInputDataSetID); - int GetNodeVtkID(int theObjID); - //pkv t - // protected: /*! \fn VTKViewer_AppendFilter(); * \brief Constructor @@ -59,13 +67,15 @@ protected: void Reset(); // + vtkSmartPointer myPoints; + private: typedef std::vector TVectorId; typedef std::vector VectorInt; //pkv f - typedef std::map > DataMapOfIntegerInteger; - typedef std::map < int, int, std::less >::iterator IteratorOfDataMapOfIntegerInteger; - typedef std::map < int, int, std::less >::value_type PairOfDataMapOfIntegerInteger; + typedef std::map DataMapOfIntegerInteger; + typedef DataMapOfIntegerInteger::iterator IteratorOfDataMapOfIntegerInteger; + typedef DataMapOfIntegerInteger::value_type PairOfDataMapOfIntegerInteger; //pkv t private: bool myDoMappingFlag;