Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-29 09:19:33

0001 // Created on: 1993-01-09
0002 // Created by: CKY / Contract Toubro-Larsen ( Kiran )
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESGeom_CopiousData_HeaderFile
0018 #define _IGESGeom_CopiousData_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 #include <IGESData_IGESEntity.hxx>
0027 class gp_Pnt;
0028 class gp_Vec;
0029 
0030 //! defines IGESCopiousData, Type <106> Form <1-3,11-13,63>
0031 //! in package IGESGeom
0032 //! This entity stores data points in the form of pairs,
0033 //! triples, or sextuples. An interpretation flag value
0034 //! signifies which of these forms is being used.
0035 class IGESGeom_CopiousData : public IGESData_IGESEntity
0036 {
0037 
0038 public:
0039   Standard_EXPORT IGESGeom_CopiousData();
0040 
0041   //! This method is used to set the fields of the class
0042   //! CopiousData
0043   //! - aDataType : Specifies whether data is a pair or a triple
0044   //! or a sextuple.
0045   //! - aZPlane   : Common Z value for all points if datatype = 1
0046   //! - allData   : Data to be read in groups of 2, 3 or 6
0047   Standard_EXPORT void Init(const int                                       aDataType,
0048                             const double                                    aZPlane,
0049                             const occ::handle<NCollection_HArray1<double>>& allData);
0050 
0051   //! Sets Copious Data to be a Polyline if <mode> is True
0052   //! (Form = 11-12-13) or a Set of Points else (Form 1-2-3)
0053   Standard_EXPORT void SetPolyline(const bool mode);
0054 
0055   //! Sets Copious Data to be a Closed Path 2D (Form 63)
0056   //! Warning : DataType is not checked and must be set to ONE by Init
0057   Standard_EXPORT void SetClosedPath2D();
0058 
0059   //! Returns True if <me> is a Set of Points (Form 1-2-3)
0060   Standard_EXPORT bool IsPointSet() const;
0061 
0062   //! Returns True if <me> is a Polyline (Form 11-12-13)
0063   Standard_EXPORT bool IsPolyline() const;
0064 
0065   //! Returns True if <me> is a Closed Path 2D (Form 63)
0066   Standard_EXPORT bool IsClosedPath2D() const;
0067 
0068   //! returns data type
0069   //! 1 = XY ( with common Z given by plane)
0070   //! 2 = XYZ ( point)
0071   //! 3 = XYZ + Vec(XYZ) (point + normal vector)
0072   Standard_EXPORT int DataType() const;
0073 
0074   //! returns the number of tuples
0075   Standard_EXPORT int NbPoints() const;
0076 
0077   //! Returns an individual Data, given the N0 of the Point
0078   //! and the B0 of the Coordinate (according DataType)
0079   Standard_EXPORT double Data(const int NumPoint, const int NumData) const;
0080 
0081   //! If datatype = 1, then returns common z value for all data
0082   //! else returns 0
0083   Standard_EXPORT double ZPlane() const;
0084 
0085   //! returns the coordinates of the point specified by the anIndex
0086   //! raises exception if anIndex <= 0 or anIndex > NbPoints()
0087   Standard_EXPORT gp_Pnt Point(const int anIndex) const;
0088 
0089   //! returns the coordinates of the point specified by the anIndex
0090   //! after applying Transf. Matrix
0091   //! raises exception if anIndex <= 0 or anIndex > NbPoints()
0092   Standard_EXPORT gp_Pnt TransformedPoint(const int anIndex) const;
0093 
0094   //! returns i, j, k values if 3-tuple else returns (0, 0, 0)
0095   //! raises exception if anIndex <= 0 or anIndex > NbPoints()
0096   Standard_EXPORT gp_Vec Vector(const int anIndex) const;
0097 
0098   //! returns transformed vector if 3-tuple else returns (0, 0, 0)
0099   //! raises exception if anIndex <= 0 or anIndex > NbPoints()
0100   Standard_EXPORT gp_Vec TransformedVector(const int anIndex) const;
0101 
0102   DEFINE_STANDARD_RTTIEXT(IGESGeom_CopiousData, IGESData_IGESEntity)
0103 
0104 private:
0105   int                                      theDataType;
0106   double                                   theZPlane;
0107   occ::handle<NCollection_HArray1<double>> theData;
0108 };
0109 
0110 #endif // _IGESGeom_CopiousData_HeaderFile