count_face_tokens Function

public pure function count_face_tokens(line)

面行に含まれる頂点トークン数を数え、扇形分割時の三角形数算出に使う。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

f で始まるOBJ面行。

Return Value integer(kind=i32)


Calls

proc~~count_face_tokens~~CallsGraph proc~count_face_tokens count_face_tokens proc~next_face_token next_face_token proc~count_face_tokens->proc~next_face_token

Called by

proc~~count_face_tokens~~CalledByGraph proc~count_face_tokens count_face_tokens proc~parse_face_line parse_face_line proc~parse_face_line->proc~count_face_tokens proc~scan_obj scan_obj proc~scan_obj->proc~count_face_tokens proc~load_obj_mesh load_obj_mesh proc~load_obj_mesh->proc~scan_obj proc~parse_obj parse_obj proc~load_obj_mesh->proc~parse_obj proc~parse_obj->proc~parse_face_line proc~build_parts_mesh build_parts_mesh proc~build_parts_mesh->proc~load_obj_mesh proc~build_mesh_from_config build_mesh_from_config proc~build_mesh_from_config->proc~build_parts_mesh proc~load_or_init_run_state load_or_init_run_state proc~load_or_init_run_state->proc~build_mesh_from_config program~main main program~main->proc~load_or_init_run_state

Source Code

  integer(i32) pure function count_face_tokens(line)
    character(len=*), intent(in) :: line
    character(len=:), allocatable :: s
    integer :: pos, first, last

    s = trim(adjustl(line))
    pos = 3
    count_face_tokens = 0
    do
      call next_face_token(s, pos, first, last)
      if (first > last) exit
      count_face_tokens = count_face_tokens + 1
    end do
  end function count_face_tokens