Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-04 09:19:21

0001 // Created on: 2003-12-11
0002 // Created by: Alexander SOLOVYOV
0003 // Copyright (c) 2003-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _MeshVS_DeformedDataSource_HeaderFile
0017 #define _MeshVS_DeformedDataSource_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <MeshVS_DataMapOfIntegerVector.hxx>
0023 #include <MeshVS_DataSource.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <TColStd_Array1OfReal.hxx>
0026 #include <MeshVS_EntityType.hxx>
0027 #include <MeshVS_HArray1OfSequenceOfInteger.hxx>
0028 #include <TColStd_Array1OfInteger.hxx>
0029 class gp_Vec;
0030 
0031 class MeshVS_DeformedDataSource;
0032 DEFINE_STANDARD_HANDLE(MeshVS_DeformedDataSource, MeshVS_DataSource)
0033 
0034 //! The class provides default class which helps to represent node displacements by deformed mesh
0035 //! This class has an internal handle to canonical non-deformed mesh data source and
0036 //! map of displacement vectors. The displacement can be magnified to useful size.
0037 //! All methods is implemented with calling the corresponding methods of non-deformed data source.
0038 class MeshVS_DeformedDataSource : public MeshVS_DataSource
0039 {
0040 
0041 public:
0042   //! Constructor
0043   //! theNonDeformDS is canonical non-deformed data source, by which we are able to calculate
0044   //! deformed mesh geometry
0045   //! theMagnify is coefficient of displacement magnify
0046   Standard_EXPORT MeshVS_DeformedDataSource(const Handle(MeshVS_DataSource)& theNonDeformDS,
0047                                             const Standard_Real              theMagnify);
0048 
0049   Standard_EXPORT virtual Standard_Boolean GetGeom(const Standard_Integer ID,
0050                                                    const Standard_Boolean IsElement,
0051                                                    TColStd_Array1OfReal&  Coords,
0052                                                    Standard_Integer&      NbNodes,
0053                                                    MeshVS_EntityType& Type) const Standard_OVERRIDE;
0054 
0055   Standard_EXPORT virtual Standard_Boolean GetGeomType(const Standard_Integer ID,
0056                                                        const Standard_Boolean IsElement,
0057                                                        MeshVS_EntityType&     Type) const
0058     Standard_OVERRIDE;
0059 
0060   Standard_EXPORT virtual Standard_Boolean Get3DGeom(
0061     const Standard_Integer                     ID,
0062     Standard_Integer&                          NbNodes,
0063     Handle(MeshVS_HArray1OfSequenceOfInteger)& Data) const Standard_OVERRIDE;
0064 
0065   Standard_EXPORT virtual Standard_Address GetAddr(const Standard_Integer ID,
0066                                                    const Standard_Boolean IsElement) const
0067     Standard_OVERRIDE;
0068 
0069   Standard_EXPORT virtual Standard_Boolean GetNodesByElement(const Standard_Integer   ID,
0070                                                              TColStd_Array1OfInteger& NodeIDs,
0071                                                              Standard_Integer&        NbNodes) const
0072     Standard_OVERRIDE;
0073 
0074   Standard_EXPORT virtual const TColStd_PackedMapOfInteger& GetAllNodes() const Standard_OVERRIDE;
0075 
0076   Standard_EXPORT virtual const TColStd_PackedMapOfInteger& GetAllElements() const
0077     Standard_OVERRIDE;
0078 
0079   //! This method returns map of nodal displacement vectors
0080   Standard_EXPORT const MeshVS_DataMapOfIntegerVector& GetVectors() const;
0081 
0082   //! This method sets map of nodal displacement vectors (Map).
0083   Standard_EXPORT void SetVectors(const MeshVS_DataMapOfIntegerVector& Map);
0084 
0085   //! This method returns vector ( Vect ) assigned to node number ID.
0086   Standard_EXPORT Standard_Boolean GetVector(const Standard_Integer ID, gp_Vec& Vect) const;
0087 
0088   //! This method sets vector ( Vect ) assigned to node number ID.
0089   Standard_EXPORT void SetVector(const Standard_Integer ID, const gp_Vec& Vect);
0090 
0091   Standard_EXPORT void SetNonDeformedDataSource(const Handle(MeshVS_DataSource)& theDS);
0092 
0093   //! With this methods you can read and change internal canonical data source
0094   Standard_EXPORT Handle(MeshVS_DataSource) GetNonDeformedDataSource() const;
0095 
0096   Standard_EXPORT void SetMagnify(const Standard_Real theMagnify);
0097 
0098   //! With this methods you can read and change magnify coefficient of nodal displacements
0099   Standard_EXPORT Standard_Real GetMagnify() const;
0100 
0101   DEFINE_STANDARD_RTTIEXT(MeshVS_DeformedDataSource, MeshVS_DataSource)
0102 
0103 protected:
0104 private:
0105   Handle(MeshVS_DataSource)     myNonDeformedDataSource;
0106   TColStd_PackedMapOfInteger    myEmptyMap;
0107   MeshVS_DataMapOfIntegerVector myVectors;
0108   Standard_Real                 myMagnify;
0109 };
0110 
0111 #endif // _MeshVS_DeformedDataSource_HeaderFile