Load from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_stl_object), | intent(inout) | :: | self | File STL. |
||
| character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
| logical, | intent(in), | optional | :: | is_ascii | Sentinel to check if file is ASCII. |
|
| logical, | intent(in), | optional | :: | guess_format | Sentinel to try to guess format directly from file. |
|
| logical, | intent(in), | optional | :: | disable_analysis | Sentinel to disable STL analysis. |
subroutine load_from_file(self, file_name, is_ascii, guess_format, disable_analysis)
!< Load from file.
class(file_stl_object), intent(inout) :: self !< File STL.
character(*), intent(in), optional :: file_name !< File name.
logical, intent(in), optional :: is_ascii !< Sentinel to check if file is ASCII.
logical, intent(in), optional :: guess_format !< Sentinel to try to guess format directly from file.
logical, intent(in), optional :: disable_analysis !< Sentinel to disable STL analysis.
logical :: disable_analysis_ !< Sentinel to disable STL analysis, local variable.
integer(I4P) :: f !< Counter.
disable_analysis_ = .false. ; if (present(disable_analysis)) disable_analysis_ = disable_analysis
call self%initialize(skip_destroy=.true., file_name=file_name, is_ascii=is_ascii)
call self%open_file(file_action='read', guess_format=guess_format)
call self%load_facets_number_from_file
call self%allocate_facets
call self%load_header_from_file
if (self%is_ascii) then
do f=1, self%facets_number
call self%facet(f)%load_from_file_ascii(file_unit=self%file_unit)
self%facet(f)%id = f
enddo
else
do f=1, self%facets_number
self%facet(f)%id = f
call self%facet(f)%load_from_file_binary(file_unit=self%file_unit)
enddo
endif
call self%close_file
if (.not.disable_analysis_) call self%analize
endsubroutine load_from_file