hexed 0.4.0
 
Loading...
Searching...
No Matches
hexed::Iges_parser Class Reference

Parses IGES files to obtain parameter values. More...

#include <Iges_parser.hpp>

Public Types

enum  Section_id {
  start , global , directory , parameter ,
  terminate
}
 Identifies the sections of an IGES file.
 

Public Member Functions

 Iges_parser (std::string file_name)
 Constructs a parser and reads a file.
 
const next::Sequence< const std::vector< std::string > & > section (Section_id) const
 get the list of entries for a given section
 
const std::vector< std::string > & entry (Section_id, Int line) const
 gets an entry by which section it is in and its line number in the file
 

Static Public Member Functions

static Int read_int (std::string)
 Reads an integer value from a human-readable string.
 
static double read_float (std::string)
 Reads a floating-point value from a human-readable string.
 
static std::string read_string (std::string)
 Translates a Hollerith string to a normal string.
 

Detailed Description

Parses IGES files to obtain parameter values.

Parses files in the Initial Graphics Exchange Specification, Version 6 format. This class does not interpret the geometric information in the files; that is done by the brep::Geom class. It simply reads the file and breaks it down into a list of sections (e.g., Start, Global, Directory, etc.), where each section contains a list of entries, and each entry is a list of strings representing data fields. The fields can then be interpreted as integers, floating-point values, or Hollerith strings with read_int(), read_float(), and read_string().

Constructor & Destructor Documentation

◆ Iges_parser()

hexed::Iges_parser::Iges_parser ( std::string file_name)

Constructs a parser and reads a file.

file_name must be a path, absolute or relative, to an IGES file with an appropriate extension.

Member Function Documentation

◆ entry()

const std::vector< std::string > & hexed::Iges_parser::entry ( Section_id sec,
Int line ) const

gets an entry by which section it is in and its line number in the file

In IGES, a "pointer" to an entity is an integer indicating the line number of its entry in the Directory section. Thus, this function can be used to resolve pointers.

◆ read_int()

Int hexed::Iges_parser::read_int ( std::string s)
static

Reads an integer value from a human-readable string.

An empty string defaults to 0.

◆ read_string()

std::string hexed::Iges_parser::read_string ( std::string s)
static

Translates a Hollerith string to a normal string.

E.g., "6HRuffin" translates to "Ruffin"


The documentation for this class was generated from the following files: