VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkLSDynaReader.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*---------------------------------------------------------------------------- 00016 Copyright (c) Sandia Corporation 00017 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00018 ----------------------------------------------------------------------------*/ 00019 00153 #ifndef __vtkLSDynaReader_h 00154 #define __vtkLSDynaReader_h 00155 00156 #include "vtkIOLSDynaModule.h" // For export macro 00157 #include "vtkMultiBlockDataSetAlgorithm.h" 00158 00159 class LSDynaMetaData; 00160 class vtkLSDynaPartCollection; 00161 class vtkPoints; 00162 class vtkDataArray; 00163 class vtkUnsignedCharArray; 00164 class vtkUnstructuredGrid; 00165 00166 class VTKIOLSDYNA_EXPORT vtkLSDynaReader : public vtkMultiBlockDataSetAlgorithm 00167 { 00168 public: 00169 vtkTypeMacro(vtkLSDynaReader,vtkMultiBlockDataSetAlgorithm); 00170 virtual void PrintSelf(ostream &os, vtkIndent indent); 00171 static vtkLSDynaReader *New(); 00172 00175 void Dump( ostream &os ); 00176 00179 void DebugDump(); 00180 00182 virtual int CanReadFile( const char* fname ); 00183 00185 00187 virtual void SetDatabaseDirectory( const char* ); 00188 const char* GetDatabaseDirectory(); 00189 int IsDatabaseValid(); 00191 00193 00197 virtual void SetFileName( const char* ); 00198 const char* GetFileName(); 00200 00205 char* GetTitle(); 00206 00210 int GetDimensionality(); 00211 00215 vtkIdType GetNumberOfNodes(); 00216 00221 vtkIdType GetNumberOfCells(); 00222 00229 vtkIdType GetNumberOfContinuumCells(); 00230 00234 vtkIdType GetNumberOfSolidCells(); 00235 00239 vtkIdType GetNumberOfThickShellCells(); 00240 00244 vtkIdType GetNumberOfShellCells(); 00245 00249 vtkIdType GetNumberOfRigidBodyCells(); 00250 00254 vtkIdType GetNumberOfRoadSurfaceCells(); 00255 00259 vtkIdType GetNumberOfBeamCells(); 00260 00264 vtkIdType GetNumberOfParticleCells(); 00265 00267 00270 vtkIdType GetNumberOfTimeSteps(); 00271 virtual void SetTimeStep( vtkIdType ); 00272 vtkIdType GetTimeStep(); 00273 double GetTimeValue( vtkIdType ); 00274 vtkGetVector2Macro(TimeStepRange,int); 00275 vtkSetVector2Macro(TimeStepRange,int); 00277 00279 00281 int GetNumberOfPointArrays(); 00282 const char* GetPointArrayName(int); 00283 virtual void SetPointArrayStatus( int arr, int status ); 00284 virtual void SetPointArrayStatus( const char* arrName, int status ); 00285 int GetPointArrayStatus( int arr ); 00286 int GetPointArrayStatus( const char* arrName ); 00287 int GetNumberOfComponentsInPointArray( int arr ); 00288 int GetNumberOfComponentsInPointArray( const char* arrName ); 00290 00292 00296 int GetNumberOfCellArrays( int cellType ); 00297 const char* GetCellArrayName( int cellType, int arr ); 00298 virtual void SetCellArrayStatus( int cellType, int arr, int status ); 00299 virtual void SetCellArrayStatus( int cellType, const char* arrName, int status ); 00300 int GetCellArrayStatus( int cellType, int arr ); 00301 int GetCellArrayStatus( int cellType, const char* arrName ); 00302 int GetNumberOfComponentsInCellArray( int cellType, int arr ); 00303 int GetNumberOfComponentsInCellArray( int cellType, const char* arrName ); 00305 00307 00309 int GetNumberOfSolidArrays(); 00310 const char* GetSolidArrayName(int); 00311 virtual void SetSolidArrayStatus( int arr, int status ); 00312 virtual void SetSolidArrayStatus( const char* arrName, int status ); 00313 int GetSolidArrayStatus( int arr ); 00314 int GetSolidArrayStatus( const char* arrName ); 00316 00317 int GetNumberOfComponentsInSolidArray( int a ); 00318 int GetNumberOfComponentsInSolidArray( const char* arrName ); 00319 00321 00323 int GetNumberOfThickShellArrays(); 00324 const char* GetThickShellArrayName(int); 00325 virtual void SetThickShellArrayStatus( int arr, int status ); 00326 virtual void SetThickShellArrayStatus( const char* arrName, int status ); 00327 int GetThickShellArrayStatus( int arr ); 00328 int GetThickShellArrayStatus( const char* arrName ); 00330 00331 int GetNumberOfComponentsInThickShellArray( int a ); 00332 int GetNumberOfComponentsInThickShellArray( const char* arrName ); 00333 00335 00337 int GetNumberOfShellArrays(); 00338 const char* GetShellArrayName(int); 00339 virtual void SetShellArrayStatus( int arr, int status ); 00340 virtual void SetShellArrayStatus( const char* arrName, int status ); 00341 int GetShellArrayStatus( int arr ); 00342 int GetShellArrayStatus( const char* arrName ); 00344 00345 int GetNumberOfComponentsInShellArray( int a ); 00346 int GetNumberOfComponentsInShellArray( const char* arrName ); 00347 00349 00351 int GetNumberOfRigidBodyArrays(); 00352 const char* GetRigidBodyArrayName(int); 00353 virtual void SetRigidBodyArrayStatus( int arr, int status ); 00354 virtual void SetRigidBodyArrayStatus( const char* arrName, int status ); 00355 int GetRigidBodyArrayStatus( int arr ); 00356 int GetRigidBodyArrayStatus( const char* arrName ); 00358 00359 int GetNumberOfComponentsInRigidBodyArray( int a ); 00360 int GetNumberOfComponentsInRigidBodyArray( const char* arrName ); 00361 00363 00365 int GetNumberOfRoadSurfaceArrays(); 00366 const char* GetRoadSurfaceArrayName(int); 00367 virtual void SetRoadSurfaceArrayStatus( int arr, int status ); 00368 virtual void SetRoadSurfaceArrayStatus( const char* arrName, int status ); 00369 int GetRoadSurfaceArrayStatus( int arr ); 00370 int GetRoadSurfaceArrayStatus( const char* arrName ); 00372 00373 int GetNumberOfComponentsInRoadSurfaceArray( int a ); 00374 int GetNumberOfComponentsInRoadSurfaceArray( const char* arrName ); 00375 00377 00379 int GetNumberOfBeamArrays(); 00380 const char* GetBeamArrayName(int); 00381 virtual void SetBeamArrayStatus( int arr, int status ); 00382 virtual void SetBeamArrayStatus( const char* arrName, int status ); 00383 int GetBeamArrayStatus( int arr ); 00384 int GetBeamArrayStatus( const char* arrName ); 00386 00387 int GetNumberOfComponentsInBeamArray( int a ); 00388 int GetNumberOfComponentsInBeamArray( const char* arrName ); 00389 00391 00393 int GetNumberOfParticleArrays(); 00394 const char* GetParticleArrayName(int); 00395 virtual void SetParticleArrayStatus( int arr, int status ); 00396 virtual void SetParticleArrayStatus( const char* arrName, int status ); 00397 int GetParticleArrayStatus( int arr ); 00398 int GetParticleArrayStatus( const char* arrName ); 00400 00401 int GetNumberOfComponentsInParticleArray( int a ); 00402 int GetNumberOfComponentsInParticleArray( const char* arrName ); 00403 00405 00408 void SetDeformedMesh(int); 00409 vtkGetMacro(DeformedMesh,int); 00410 vtkBooleanMacro(DeformedMesh,int); 00412 00414 00422 vtkSetMacro(RemoveDeletedCells,int); 00423 vtkGetMacro(RemoveDeletedCells,int); 00424 vtkBooleanMacro(RemoveDeletedCells,int); 00426 00428 00430 vtkSetMacro(DeletedCellsAsGhostArray,int); 00431 vtkGetMacro(DeletedCellsAsGhostArray,int); 00432 vtkBooleanMacro(DeletedCellsAsGhostArray,int); 00434 00436 00445 vtkSetStringMacro(InputDeck); 00446 vtkGetStringMacro(InputDeck); 00448 00450 00458 int GetNumberOfPartArrays(); 00459 const char* GetPartArrayName(int); 00460 virtual void SetPartArrayStatus( int arr, int status ); 00461 virtual void SetPartArrayStatus( const char* partName, int status ); 00462 int GetPartArrayStatus( int arr ); 00463 int GetPartArrayStatus( const char* partName ); 00465 00466 protected: 00467 //holds all the parts and all the properties for each part 00468 vtkLSDynaPartCollection* Parts; 00469 00472 int DeformedMesh; 00473 00475 00477 int RemoveDeletedCells; 00478 int DeletedCellsAsGhostArray; 00480 00483 int TimeStepRange[2]; 00484 00486 char* InputDeck; 00487 00488 vtkLSDynaReader(); 00489 virtual ~vtkLSDynaReader(); 00490 00497 int ReadHeaderInformation( int currentAdaptLevel ); 00498 00506 int ScanDatabaseTimeSteps(); 00507 00508 virtual int RequestInformation( vtkInformation*, vtkInformationVector**, vtkInformationVector* ); 00509 virtual int RequestData( vtkInformation*, vtkInformationVector**, vtkInformationVector* ); 00510 00512 00518 virtual int ReadTopology(); 00519 virtual int ReadNodes(); 00520 virtual int ReadPartSizes(); 00521 virtual int ReadConnectivityAndMaterial(); 00522 virtual int ReadUserIds(); 00523 virtual int ReadState( vtkIdType ); 00524 virtual int ReadNodeStateInfo( vtkIdType ); 00525 virtual int ReadCellStateInfo( vtkIdType ); 00526 virtual int ReadDeletion(); 00527 virtual int ReadSPHState( vtkIdType ); 00529 00531 virtual void ResetPartInfo(); 00532 00535 virtual int ReadInputDeck(); 00536 00539 virtual int ReadPartTitlesFromRootFile(); 00540 00544 virtual int ReadUserMaterialIds(); 00545 00547 00549 int ReadInputDeckXML( ifstream& deck ); 00550 int ReadInputDeckKeywords( ifstream& deck ); 00552 00555 int WriteInputDeckSummary( const char* fname ); 00556 00564 virtual void ReadDeletionArray(vtkUnsignedCharArray* arr, const int& pos, const int& size); 00565 00567 virtual void ReadCellProperties(const int& type,const int& numTuples); 00568 00569 LSDynaMetaData* P; 00570 00571 void ResetPartsCache(); 00572 private: 00573 00574 //Helper templated methods to optimze reading. We cast the entire buffer 00575 //to a given type instead of casting each element to improve performance 00576 template<typename T> 00577 void FillDeletionArray(T* buffer, vtkUnsignedCharArray* arr, const vtkIdType& start, const vtkIdType& numCells, 00578 const int& deathPos, const int& cellSize); 00579 00580 template<int wordSize, typename T> 00581 int FillTopology(T* buffer); 00582 00583 template<typename T, int blockType, vtkIdType numWordsPerCell, vtkIdType cellLength> 00584 void ReadBlockCellSizes(); 00585 00586 template<typename T> 00587 int FillPartSizes(); 00588 00589 vtkLSDynaReader( const vtkLSDynaReader& ); // Not implemented. 00590 void operator = ( const vtkLSDynaReader& ); // Not implemented. 00591 }; 00592 00593 inline void vtkLSDynaReader::SetPointArrayStatus( const char* arrName, int status ) 00594 { 00595 for ( int a=0; a<this->GetNumberOfPointArrays(); ++a ) 00596 { 00597 if ( strcmp( arrName, this->GetPointArrayName(a) ) == 0 ) 00598 { 00599 this->SetPointArrayStatus( a, status ); 00600 return; 00601 } 00602 } 00603 vtkWarningMacro( "Point array \"" << arrName << "\" does not exist" ); 00604 } 00605 00606 inline int vtkLSDynaReader::GetPointArrayStatus( const char* arrName ) 00607 { 00608 for ( int a=0; a<this->GetNumberOfPointArrays(); ++a ) 00609 { 00610 if ( strcmp( arrName, this->GetPointArrayName(a) ) == 0 ) 00611 { 00612 return this->GetPointArrayStatus( a ); 00613 } 00614 } 00615 //vtkWarningMacro( "Point array \"" << arrName << "\" does not exist" ); 00616 return 0; 00617 } 00618 00619 inline int vtkLSDynaReader::GetNumberOfComponentsInPointArray( const char* arrName ) 00620 { 00621 for ( int a=0; a<this->GetNumberOfPointArrays(); ++a ) 00622 { 00623 if ( strcmp( arrName, this->GetPointArrayName( a ) ) == 0 ) 00624 { 00625 return this->GetNumberOfComponentsInPointArray( a ); 00626 } 00627 } 00628 //vtkWarningMacro( "Point array \"" << arrName << "\" does not exist" ); 00629 return 0; 00630 } 00631 00632 inline void vtkLSDynaReader::SetCellArrayStatus( int cellType, const char* arrName, int status ) 00633 { 00634 for ( int a=0; a<this->GetNumberOfCellArrays( cellType ); ++a ) 00635 { 00636 if ( strcmp( arrName, this->GetCellArrayName( cellType, a ) ) == 0 ) 00637 { 00638 this->SetCellArrayStatus( cellType, a, status ); 00639 return; 00640 } 00641 } 00642 vtkWarningMacro( "Cell array \"" << arrName << "\" (type " << cellType << ") does not exist" ); 00643 } 00644 00645 inline int vtkLSDynaReader::GetCellArrayStatus( int cellType, const char* arrName ) 00646 { 00647 for ( int a=0; a<this->GetNumberOfCellArrays( cellType ); ++a ) 00648 { 00649 if ( strcmp( arrName, this->GetCellArrayName( cellType, a ) ) == 0 ) 00650 { 00651 return this->GetCellArrayStatus( cellType, a ); 00652 } 00653 } 00654 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00655 return 0; 00656 } 00657 00658 inline int vtkLSDynaReader::GetNumberOfComponentsInCellArray( int cellType, const char* arrName ) 00659 { 00660 for ( int a=0; a<this->GetNumberOfCellArrays( cellType ); ++a ) 00661 { 00662 if ( strcmp( arrName, this->GetCellArrayName( cellType, a ) ) == 0 ) 00663 { 00664 return this->GetNumberOfComponentsInCellArray( cellType, a ); 00665 } 00666 } 00667 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00668 return 0; 00669 } 00670 00671 inline void vtkLSDynaReader::SetSolidArrayStatus( const char* arrName, int status ) 00672 { 00673 for ( int a=0; a<this->GetNumberOfSolidArrays(); ++a ) 00674 { 00675 if ( strcmp( arrName, this->GetSolidArrayName(a) ) == 0 ) 00676 { 00677 this->SetSolidArrayStatus( a, status ); 00678 return; 00679 } 00680 } 00681 vtkWarningMacro( "Solid array \"" << arrName << "\" does not exist" ); 00682 } 00683 00684 inline int vtkLSDynaReader::GetSolidArrayStatus( const char* arrName ) 00685 { 00686 for ( int a=0; a<this->GetNumberOfSolidArrays(); ++a ) 00687 { 00688 if ( strcmp( arrName, this->GetSolidArrayName(a) ) == 0 ) 00689 { 00690 return this->GetSolidArrayStatus( a ); 00691 } 00692 } 00693 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00694 return 0; 00695 } 00696 00697 inline int vtkLSDynaReader::GetNumberOfComponentsInSolidArray( const char* arrName ) 00698 { 00699 for ( int a=0; a<this->GetNumberOfSolidArrays(); ++a ) 00700 { 00701 if ( strcmp( arrName, this->GetSolidArrayName(a) ) == 0 ) 00702 { 00703 return this->GetNumberOfComponentsInSolidArray( a ); 00704 } 00705 } 00706 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00707 return 0; 00708 } 00709 00710 inline void vtkLSDynaReader::SetThickShellArrayStatus( const char* arrName, int status ) 00711 { 00712 for ( int a=0; a<this->GetNumberOfThickShellArrays(); ++a ) 00713 { 00714 if ( strcmp( arrName, this->GetThickShellArrayName(a) ) == 0 ) 00715 { 00716 this->SetThickShellArrayStatus( a, status ); 00717 return; 00718 } 00719 } 00720 vtkWarningMacro( "Thick shell array \"" << arrName << "\" does not exist" ); 00721 } 00722 00723 inline int vtkLSDynaReader::GetThickShellArrayStatus( const char* arrName ) 00724 { 00725 for ( int a=0; a<this->GetNumberOfThickShellArrays(); ++a ) 00726 { 00727 if ( strcmp( arrName, this->GetThickShellArrayName(a) ) == 0 ) 00728 { 00729 return this->GetThickShellArrayStatus( a ); 00730 } 00731 } 00732 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00733 return 0; 00734 } 00735 00736 inline int vtkLSDynaReader::GetNumberOfComponentsInThickShellArray( const char* arrName ) 00737 { 00738 for ( int a=0; a<this->GetNumberOfThickShellArrays(); ++a ) 00739 { 00740 if ( strcmp( arrName, this->GetThickShellArrayName(a) ) == 0 ) 00741 { 00742 return this->GetNumberOfComponentsInThickShellArray( a ); 00743 } 00744 } 00745 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00746 return 0; 00747 } 00748 00749 inline void vtkLSDynaReader::SetShellArrayStatus( const char* arrName, int status ) 00750 { 00751 for ( int a=0; a<this->GetNumberOfShellArrays(); ++a ) 00752 { 00753 if ( strcmp( arrName, this->GetShellArrayName(a) ) == 0 ) 00754 { 00755 this->SetShellArrayStatus( a, status ); 00756 return; 00757 } 00758 } 00759 vtkWarningMacro( "Shell array \"" << arrName << "\" does not exist" ); 00760 } 00761 00762 inline int vtkLSDynaReader::GetShellArrayStatus( const char* arrName ) 00763 { 00764 for ( int a=0; a<this->GetNumberOfShellArrays(); ++a ) 00765 { 00766 if ( strcmp( arrName, this->GetShellArrayName(a) ) == 0 ) 00767 { 00768 return this->GetShellArrayStatus( a ); 00769 } 00770 } 00771 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00772 return 0; 00773 } 00774 00775 inline int vtkLSDynaReader::GetNumberOfComponentsInShellArray( const char* arrName ) 00776 { 00777 for ( int a=0; a<this->GetNumberOfShellArrays(); ++a ) 00778 { 00779 if ( strcmp( arrName, this->GetShellArrayName(a) ) == 0 ) 00780 { 00781 return this->GetNumberOfComponentsInShellArray( a ); 00782 } 00783 } 00784 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00785 return 0; 00786 } 00787 00788 inline void vtkLSDynaReader::SetBeamArrayStatus( const char* arrName, int status ) 00789 { 00790 for ( int a=0; a<this->GetNumberOfBeamArrays(); ++a ) 00791 { 00792 if ( strcmp( arrName, this->GetBeamArrayName(a) ) == 0 ) 00793 { 00794 this->SetBeamArrayStatus( a, status ); 00795 return; 00796 } 00797 } 00798 vtkWarningMacro( "Beam array \"" << arrName << "\" does not exist" ); 00799 } 00800 00801 inline int vtkLSDynaReader::GetBeamArrayStatus( const char* arrName ) 00802 { 00803 for ( int a=0; a<this->GetNumberOfBeamArrays(); ++a ) 00804 { 00805 if ( strcmp( arrName, this->GetBeamArrayName(a) ) == 0 ) 00806 { 00807 return this->GetBeamArrayStatus( a ); 00808 } 00809 } 00810 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00811 return 0; 00812 } 00813 00814 inline int vtkLSDynaReader::GetNumberOfComponentsInBeamArray( const char* arrName ) 00815 { 00816 for ( int a=0; a<this->GetNumberOfBeamArrays(); ++a ) 00817 { 00818 if ( strcmp( arrName, this->GetBeamArrayName(a) ) == 0 ) 00819 { 00820 return this->GetNumberOfComponentsInBeamArray( a ); 00821 } 00822 } 00823 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00824 return 0; 00825 } 00826 00827 inline void vtkLSDynaReader::SetParticleArrayStatus( const char* arrName, int status ) 00828 { 00829 for ( int a=0; a<this->GetNumberOfParticleArrays(); ++a ) 00830 { 00831 if ( strcmp( arrName, this->GetParticleArrayName(a) ) == 0 ) 00832 { 00833 this->SetParticleArrayStatus( a, status ); 00834 return; 00835 } 00836 } 00837 vtkWarningMacro( "Particle array \"" << arrName << "\" does not exist" ); 00838 } 00839 00840 inline int vtkLSDynaReader::GetParticleArrayStatus( const char* arrName ) 00841 { 00842 for ( int a=0; a<this->GetNumberOfParticleArrays(); ++a ) 00843 { 00844 if ( strcmp( arrName, this->GetParticleArrayName(a) ) == 0 ) 00845 { 00846 return this->GetParticleArrayStatus( a ); 00847 } 00848 } 00849 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00850 return 0; 00851 } 00852 00853 inline int vtkLSDynaReader::GetNumberOfComponentsInParticleArray( const char* arrName ) 00854 { 00855 for ( int a=0; a<this->GetNumberOfParticleArrays(); ++a ) 00856 { 00857 if ( strcmp( arrName, this->GetParticleArrayName(a) ) == 0 ) 00858 { 00859 return this->GetNumberOfComponentsInParticleArray( a ); 00860 } 00861 } 00862 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00863 return 0; 00864 } 00865 00866 inline void vtkLSDynaReader::SetRigidBodyArrayStatus( const char* arrName, int status ) 00867 { 00868 for ( int a=0; a<this->GetNumberOfRigidBodyArrays(); ++a ) 00869 { 00870 if ( strcmp( arrName, this->GetRigidBodyArrayName(a) ) == 0 ) 00871 { 00872 this->SetRigidBodyArrayStatus( a, status ); 00873 return; 00874 } 00875 } 00876 vtkWarningMacro( "Rigid body array \"" << arrName << "\" does not exist" ); 00877 } 00878 00879 inline int vtkLSDynaReader::GetRigidBodyArrayStatus( const char* arrName ) 00880 { 00881 for ( int a=0; a<this->GetNumberOfRigidBodyArrays(); ++a ) 00882 { 00883 if ( strcmp( arrName, this->GetRigidBodyArrayName(a) ) == 0 ) 00884 { 00885 return this->GetRigidBodyArrayStatus( a ); 00886 } 00887 } 00888 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00889 return 0; 00890 } 00891 00892 inline int vtkLSDynaReader::GetNumberOfComponentsInRigidBodyArray( const char* arrName ) 00893 { 00894 for ( int a=0; a<this->GetNumberOfRigidBodyArrays(); ++a ) 00895 { 00896 if ( strcmp( arrName, this->GetRigidBodyArrayName(a) ) == 0 ) 00897 { 00898 return this->GetNumberOfComponentsInRigidBodyArray( a ); 00899 } 00900 } 00901 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00902 return 0; 00903 } 00904 00905 inline void vtkLSDynaReader::SetRoadSurfaceArrayStatus( const char* arrName, int status ) 00906 { 00907 for ( int a=0; a<this->GetNumberOfRoadSurfaceArrays(); ++a ) 00908 { 00909 if ( strcmp( arrName, this->GetRoadSurfaceArrayName(a) ) == 0 ) 00910 { 00911 this->SetRoadSurfaceArrayStatus( a, status ); 00912 return; 00913 } 00914 } 00915 vtkWarningMacro( "Road surface array \"" << arrName << "\" does not exist" ); 00916 } 00917 00918 inline int vtkLSDynaReader::GetRoadSurfaceArrayStatus( const char* arrName ) 00919 { 00920 for ( int a=0; a<this->GetNumberOfRoadSurfaceArrays(); ++a ) 00921 { 00922 if ( strcmp( arrName, this->GetRoadSurfaceArrayName(a) ) == 0 ) 00923 { 00924 return this->GetRoadSurfaceArrayStatus( a ); 00925 } 00926 } 00927 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00928 return 0; 00929 } 00930 00931 inline int vtkLSDynaReader::GetNumberOfComponentsInRoadSurfaceArray( const char* arrName ) 00932 { 00933 for ( int a=0; a<this->GetNumberOfRoadSurfaceArrays(); ++a ) 00934 { 00935 if ( strcmp( arrName, this->GetRoadSurfaceArrayName(a) ) == 0 ) 00936 { 00937 return this->GetNumberOfComponentsInRoadSurfaceArray( a ); 00938 } 00939 } 00940 //vtkWarningMacro( "Cell array \"" << arrName << "\" does not exist" ); 00941 return 0; 00942 } 00943 00944 inline void vtkLSDynaReader::SetPartArrayStatus( const char* arrName, int status ) 00945 { 00946 for ( int a=0; a<this->GetNumberOfPartArrays(); ++a ) 00947 { 00948 if ( strcmp( arrName, this->GetPartArrayName(a) ) == 0 ) 00949 { 00950 this->SetPartArrayStatus( a, status ); 00951 return; 00952 } 00953 } 00954 vtkWarningMacro( "Part \"" << arrName << "\" does not exist" ); 00955 } 00956 00957 inline int vtkLSDynaReader::GetPartArrayStatus( const char* partName ) 00958 { 00959 for ( int a=0; a<this->GetNumberOfPartArrays(); ++a ) 00960 { 00961 if ( strcmp( partName, this->GetPartArrayName(a) ) == 0 ) 00962 { 00963 return this->GetPartArrayStatus( a ); 00964 } 00965 } 00966 //vtkWarningMacro( "PartArray \"" << partName << "\" does not exist" ); 00967 return 0; 00968 } 00969 00970 #endif // __vtkLSDynaReader_h