/********************************************************************/ /* Copyright (c) 2017 System fugen G.K. and Yuzi Mizuno */ /* All rights reserved. */ /********************************************************************/ #if !defined( __IGESIFSTREAM_H__) #define __IGESIFSTREAM_H__ /// @file /// @brief Declaration for class MGIgesIfstream. /// @author System fugen #include #include "mg/Straight.h" #include "mg/LBRep.h" #include "mg/RLBRep.h" #include "mg/SBRep.h" #include "mg/RSBRep.h" #include "mg/Plane.h" #include "mg/Sphere.h" #include "mgIges/IgesFstream.h" #include "mgIges/IgesFstream.h" #include "mgIges/IgesVertexListMap.h" #include "mgIges/Iges504EdgeListMap.h" // forward declarations class MGObject; class MGCurve; class MGSurface; class MGGroup; class MGGel; class MGColor; class MGBVertex; class MGEdge; class MGLoop; class MGFace; class MGShell; /** @addtogroup FileInputOutput * @{ */ ///MGIgesIfstream read in *.iges; *.igs file, transforming IGES objects to MGCL objects. class MGIgesIfstream: public MGIgesFstream{ public: ///VERTEX list of the directory entry of type 502 vertex. mutable MGIgesVertexListMap m_vertexListMap; ///EDGE list of the directory entry of type 504 edge. mutable MGIges504EdgeListMap m_edgeListMap; /// Constructors. /// Creates an object of class MGIgesIfstream with a filename. MG_DLL_DECLR MGIgesIfstream(const TCHAR* filename); ///Test if input stream is good(). ///True will be returned when good. MG_DLL_DECLR bool good()const{return m_ifstream.good();}; /// Operator overload. /// Reads all objects of the IGES stored in the file /// as MGCL objects. MG_DLL_DECLR MGIgesIfstream& operator>>(MGGroup&); /// Member functions. ///Convert i-th MGIgesDirectoryEntry object(m_DirectoryEntries[i]) ///to MGObject that is a newed object. ///When de was not an independent object, null will be returned. ///The 2nd form convert from MGIgesDirectoryEntry. MGGel* convert_to_gel( int i )const; MGGel* convert_to_gel( const MGIgesDirectoryEntry& de )const; ///Test if input stream is open. MG_DLL_DECLR bool is_open(){return m_ifstream.is_open();}; ///Open the file. When this is opened already, this will be closed, then will ///be opened. MG_DLL_DECLR void open(const TCHAR* filename); MG_DLL_DECLR void close(); ///From the current stream position, get one line data. void get_one_line( char* lineData, ///=(nchar+1). char& sectionID_letter, ///