From: jfa Date: Fri, 15 Jul 2005 05:05:36 +0000 (+0000) Subject: IPAL8894; try to solve compilation pb X-Git-Tag: V3_0_1~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9b9fc7572124a0f24ec125a01df64bb878a45c6e;p=modules%2Fvisu.git IPAL8894; try to solve compilation pb --- diff --git a/src/PIPELINE/SALOME_ExtractGeometry.cxx b/src/PIPELINE/SALOME_ExtractGeometry.cxx index d4b03f4e..13655093 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.cxx +++ b/src/PIPELINE/SALOME_ExtractGeometry.cxx @@ -1,21 +1,21 @@ // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org #include "SALOME_ExtractGeometry.h" @@ -34,6 +34,12 @@ using namespace std; +#if defined __GNUC__ + #if __GNUC__ == 2 + #define __GNUC_2__ + #endif +#endif + vtkStandardNewMacro(SALOME_ExtractGeometry); @@ -41,21 +47,38 @@ vtkStandardNewMacro(SALOME_ExtractGeometry); SALOME_ExtractGeometry::SALOME_ExtractGeometry() {} +SALOME_ExtractGeometry::~SALOME_ExtractGeometry() +{} -SALOME_ExtractGeometry::~SALOME_ExtractGeometry(){} +vtkIdType SALOME_ExtractGeometry::GetElemObjId(int theVtkID) +{ + if (myElemVTK2ObjIds.empty()) + return theVtkID; + if (theVtkID < 0 || myElemVTK2ObjIds.size() <= theVtkID) + return -1; -vtkIdType SALOME_ExtractGeometry::GetElemObjId(int theID){ - if(myElemVTK2ObjIds.empty() || theID > myElemVTK2ObjIds.size()) - return theID; - return myElemVTK2ObjIds[theID]; +#if defined __GNUC_2__ + return myElemVTK2ObjIds[theVtkID]; +#else + return myElemVTK2ObjIds.at(theVtkID); +#endif } -vtkIdType SALOME_ExtractGeometry::GetNodeObjId(int theID){ - if(myNodeVTK2ObjIds.empty() || theID > myNodeVTK2ObjIds.size()) - return theID; - return myNodeVTK2ObjIds[theID]; +vtkIdType SALOME_ExtractGeometry::GetNodeObjId(int theVtkID) +{ + if (myNodeVTK2ObjIds.empty()) + return theVtkID; + + if (theVtkID < 0 || myNodeVTK2ObjIds.size() <= theVtkID) + return -1; + +#if defined __GNUC_2__ + return myNodeVTK2ObjIds[theVtkID]; +#else + return myNodeVTK2ObjIds.at(theVtkID); +#endif } @@ -78,8 +101,12 @@ void SALOME_ExtractGeometry::Execute() if(myImplicitBoolean.GetPointer()){ if(vtkImplicitFunctionCollection* aFunction = myImplicitBoolean->GetFunction()){ if(aFunction->GetNumberOfItems() == 0){ + myElemVTK2ObjIds.clear(); + myNodeVTK2ObjIds.clear(); + vtkDebugMacro(<< "Extracting geometry - ShallowCopy"); GetOutput()->ShallowCopy(GetInput()); + Modified(); return; } } @@ -106,7 +133,7 @@ void SALOME_ExtractGeometry::Execute2() int npts; numCells = input->GetNumberOfCells(); numPts = input->GetNumberOfPoints(); - + vtkDebugMacro(<< "Extracting geometry"); if ( ! this->ImplicitFunction ) @@ -122,7 +149,7 @@ void SALOME_ExtractGeometry::Execute2() { multiplier = 1.0; } - else + else { multiplier = -1.0; } @@ -142,7 +169,7 @@ void SALOME_ExtractGeometry::Execute2() outputPD->CopyAllocate(pd); outputCD->CopyAllocate(cd); vtkFloatArray *newScalars = NULL; - + if(myStoreMapping){ myElemVTK2ObjIds.clear(); myElemVTK2ObjIds.reserve(numCells); @@ -214,7 +241,7 @@ void SALOME_ExtractGeometry::Execute2() } } } //if don't want to extract boundary cells - + else //want boundary cells { for ( npts=0, i=0; i < numCellPts; i++ ) @@ -242,7 +269,7 @@ void SALOME_ExtractGeometry::Execute2() } }//a boundary or interior cell }//if mapping boundary cells - + if ( npts >= numCellPts || (this->ExtractBoundaryCells && npts > 0) ) { newCellId = output->InsertNextCell(cell->GetCellType(),newCellPts); @@ -257,7 +284,7 @@ void SALOME_ExtractGeometry::Execute2() newCellPts->Delete(); output->SetPoints(newPts); newPts->Delete(); - + if ( this->ExtractBoundaryCells ) { newScalars->Delete(); diff --git a/src/PIPELINE/SALOME_ExtractGeometry.h b/src/PIPELINE/SALOME_ExtractGeometry.h index ebbaec54..74c1ec30 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.h +++ b/src/PIPELINE/SALOME_ExtractGeometry.h @@ -1,44 +1,47 @@ // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org #ifndef SALOME_ExtractGeometry_H #define SALOME_ExtractGeometry_H #include #include +#include + #include -class vtkImplicitBoolean; +//class vtkImplicitBoolean; -class SALOME_ExtractGeometry : public vtkExtractGeometry{ +class SALOME_ExtractGeometry : public vtkExtractGeometry +{ public: vtkTypeMacro(SALOME_ExtractGeometry,vtkExtractGeometry); static SALOME_ExtractGeometry *New(); void SetImplicitBoolean(vtkImplicitBoolean* theImplicitBoolean); - vtkImplicitBoolean* GetImplicitBoolean() const { + vtkImplicitBoolean* GetImplicitBoolean() const { return myImplicitBoolean.GetPointer(); } void SetStoreMapping(bool theStoreMapping); - bool GetStoreMapping() const { + bool GetStoreMapping() const { return myStoreMapping; } @@ -53,7 +56,7 @@ protected: void Execute2(); private: - bool myStoreMapping; + bool myStoreMapping; typedef std::vector TVectorId; TVectorId myElemVTK2ObjIds; TVectorId myNodeVTK2ObjIds; @@ -64,7 +67,4 @@ private: void operator=(const SALOME_ExtractGeometry&); // Not implemented. }; - #endif - -