@@ -80,7 +80,7 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
8080 // アニメーションオフセットを更新
8181 // Update animation offset
8282 animation_offset_ += animation_speed_;
83-
83+
8484 // オフセットが1.0を超えたらリセット(ループアニメーション)
8585 // Reset when offset exceeds 1.0 (loop animation)
8686 if (animation_offset_ >= 1 .0f ) {
@@ -111,7 +111,7 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
111111 double max_lon = data_.coordinates [0 ].x ;
112112 double min_lat = data_.coordinates [0 ].y ;
113113 double max_lat = data_.coordinates [0 ].y ;
114-
114+
115115 for (const auto & coord : data_.coordinates ) {
116116 min_lon = (std::min)(min_lon, coord.x );
117117 max_lon = (std::max)(max_lon, coord.x );
@@ -217,7 +217,7 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
217217 // Convert normalized coordinates to screen coordinates
218218 cached_screen_points_.clear ();
219219 cached_screen_points_.reserve (normalized_coords.size ());
220-
220+
221221 for (const auto & coord : normalized_coords) {
222222 // スクリーン座標に変換
223223 const paxg::Vec2<double > screen_pos = MapCoordinateConverter::toScreenPos (
@@ -262,8 +262,7 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
262262 }
263263
264264 void onClick (const ClickContext& context) override {
265- // クリック時の処理(デバッグ出力)
266- std::cout << " FlowCurve clicked: " << getName () << std::endl;
265+ // std::cout << "FlowCurve clicked: " << getName() << std::endl;
267266 (void )context;
268267 }
269268
@@ -290,15 +289,15 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
290289 // Draw multiple animated moving curve segments (7 flow paths)
291290 // 各線の開始位置と開始時間をずらしてバラつきを出す
292291 // Stagger start position and timing for each line to create variation
293-
292+
294293 // 流路定義:{lateral_offset, time_offset, start_position_offset}
295294 // Flow path definition: {lateral_offset, time_offset, start_position_offset}
296295 struct FlowPath {
297296 float lateral_offset; // 左右のオフセット(ピクセル) / Lateral offset in pixels
298297 float time_offset; // 時間オフセット(0.0~1.0) / Time offset (0.0-1.0)
299298 float start_pos_offset; // 開始位置オフセット(0.0~1.0) / Start position offset (0.0-1.0)
300299 };
301-
300+
302301 constexpr FlowPath flow_paths[] = {
303302 {-6 .0f , 0 .0f , 0 .0f }, // 左外側 / Left outer
304303 {-4 .0f , 0 .14f * 1.5 , 0 .4f }, // 左中外 / Left mid-outer
@@ -308,19 +307,19 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
308307 { 4 .0f , 0 .70f * 1.5 , 0 .9f }, // 右中外 / Right mid-outer
309308 { 6 .0f , 0 .84f * 1.5 , 0 .5f } // 右外側 / Right outer
310309 };
311-
310+
312311 constexpr int num_segments_per_line = 4 ; // 各流路あたりの動く曲線の本数 / Number of moving segments per flow path
313-
312+
314313 for (const auto & path : flow_paths) {
315314 for (int i = 0 ; i < num_segments_per_line; ++i) {
316315 // 各線内での位相オフセット
317316 // Phase offset within each line
318317 const float phase_offset = static_cast <float >(i) / num_segments_per_line;
319-
318+
320319 // 時間オフセットを加算してバラつきを出す
321320 // Add time offset for variation
322321 const float total_offset = phase_offset + path.time_offset ;
323-
322+
324323 drawAnimatedSegment (line_width, total_offset, path.lateral_offset , path.start_pos_offset );
325324 }
326325 }
@@ -345,13 +344,13 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
345344 std::vector<paxg::Vec2f> cached_screen_points_; // /< キャッシュされたスクリーン座標列 / Cached screen points
346345 paxg::Color color_; // /< 描画色 / Drawing color
347346 bool visible_{true }; // /< 可視性 / Visibility
348-
347+
349348 mutable float animation_offset_; // /< アニメーションオフセット (0.0 ~ 1.0) / Animation offset
350349 float animation_speed_; // /< アニメーション速度 / Animation speed
351350
352351 // / @brief Catmull-Romスプライン補間
353352 // / @brief Catmull-Rom spline interpolation
354- static paxg::Vec2f calculateCatmullRom (const paxg::Vec2f& p0, const paxg::Vec2f& p1,
353+ static paxg::Vec2f calculateCatmullRom (const paxg::Vec2f& p0, const paxg::Vec2f& p1,
355354 const paxg::Vec2f& p2, const paxg::Vec2f& p3, float t) {
356355 float t2 = t * t;
357356 float t3 = t2 * t;
@@ -379,98 +378,98 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
379378 // 移動する線分の長さ(始点から約3点分の長さ)
380379 // Length of moving segment (approximately 3 points from start)
381380 constexpr float segment_length = 3 .0f ;
382-
381+
383382 const std::size_t point_count = cached_screen_points_.size ();
384-
383+
385384 // スプライン曲線全体の長さに基づいて、アニメーションオフセットを適用
386385 // Apply animation offset based on total spline curve length
387386 const float total_segments = static_cast <float >(point_count - 1 );
388-
387+
389388 // 時間オフセットと開始位置オフセットを組み合わせる
390389 // Combine time offset and start position offset
391390 float animated_position = (animation_offset_ + phase_offset);
392-
391+
393392 // 位相オフセットが1.0を超える場合、0.0~1.0に正規化
394393 // Normalize phase offset to 0.0-1.0 range
395394 while (animated_position >= 1 .0f ) {
396395 animated_position -= 1 .0f ;
397396 }
398-
397+
399398 // 開始位置オフセットを追加(各線の開始位置をずらす)
400399 // Add start position offset (stagger start position for each line)
401400 animated_position = animated_position + start_position_offset;
402401 if (animated_position >= 1 .0f ) {
403402 animated_position -= 1 .0f ;
404403 }
405-
404+
406405 animated_position *= total_segments;
407-
406+
408407 // 移動する線分の開始点と終了点を計算
409408 // Calculate start and end points of moving segment
410409 const float start_pos = animated_position;
411410 const float end_pos = animated_position + segment_length;
412-
411+
413412 // 線分を構成する点を収集
414413 // Collect points for the segment
415414 std::vector<paxg::Vec2f> segment_points;
416415 segment_points.reserve (static_cast <size_t >(segment_length * 20 + 2 ));
417-
416+
418417 // スプライン曲線上の点を補間して収集
419418 // Interpolate and collect points on spline curve
420419 const int divisions = 20 ; // 各セグメント間の分割数 / Divisions per segment
421-
420+
422421 for (std::size_t i = 0 ; i < point_count - 1 ; ++i) {
423422 const float segment_start = static_cast <float >(i);
424423 const float segment_end = static_cast <float >(i + 1 );
425-
424+
426425 // このセグメントが移動線分の範囲内にあるかチェック
427426 // Check if this segment is within the moving segment range
428427 if (segment_end < start_pos || segment_start > end_pos) {
429428 continue ; // 範囲外なのでスキップ / Skip if outside range
430429 }
431-
430+
432431 // Catmull-Rom補間用の制御点を取得
433432 // Get control points for Catmull-Rom interpolation
434433 paxg::Vec2f p0 = (i == 0 ) ? cached_screen_points_[0 ] : cached_screen_points_[i - 1 ];
435434 paxg::Vec2f p1 = cached_screen_points_[i];
436435 paxg::Vec2f p2 = cached_screen_points_[i + 1 ];
437436 paxg::Vec2f p3 = (i + 2 >= point_count) ? cached_screen_points_[i + 1 ] : cached_screen_points_[i + 2 ];
438-
437+
439438 // このセグメント内で補間する範囲を計算
440439 // Calculate interpolation range within this segment
441440 const float local_start = (std::max)(0 .0f , start_pos - segment_start);
442441 const float local_end = (std::min)(1 .0f , end_pos - segment_start);
443-
442+
444443 const int start_div = static_cast <int >(local_start * divisions);
445444 const int end_div = static_cast <int >(local_end * divisions);
446-
445+
447446 for (int j = start_div; j <= end_div; ++j) {
448447 float t = static_cast <float >(j) / divisions;
449448 paxg::Vec2f point = calculateCatmullRom (p0, p1, p2, p3, t);
450-
449+
451450 // 固定の左右オフセットを適用
452451 // Apply fixed lateral offset
453452 if (std::abs (fixed_lateral_offset) > 0 .01f ) {
454453 // 曲線の向き(接線方向)を計算
455454 // Calculate tangent direction
456455 paxg::Vec2f tangent = calculateTangent (p0, p1, p2, p3, t);
457-
456+
458457 // 接線に垂直な方向を計算(右向き)
459458 // Calculate perpendicular direction (rightward)
460459 paxg::Vec2f perpendicular (-tangent.y (), tangent.x ());
461-
460+
462461 // 垂直方向にオフセットを適用
463462 // Apply perpendicular offset
464463 point = paxg::Vec2f (
465464 point.x () + perpendicular.x () * fixed_lateral_offset,
466465 point.y () + perpendicular.y () * fixed_lateral_offset
467466 );
468467 }
469-
468+
470469 segment_points.push_back (point);
471470 }
472471 }
473-
472+
474473 // 収集した点で線分を描画
475474 // Draw segment with collected points
476475 if (segment_points.size () >= 2 ) {
@@ -479,21 +478,21 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
479478 const float alpha_factor = 1 .0f - (phase_offset * 0 .4f ); // 0.6 ~ 1.0
480479 const int alpha = static_cast <int >(180 * alpha_factor + 50 ); // 50 ~ 230
481480 paxg::Color segment_color (0 , 0 , 0 , alpha); // 黒色、透明度可変 / Black with variable opacity
482-
481+
483482 for (size_t i = 0 ; i < segment_points.size () - 1 ; ++i) {
484483 paxg::Line (segment_points[i], segment_points[i + 1 ]).draw (line_width * 0 .6f , segment_color);
485484 }
486-
485+
487486 // 線分の終端に小さい矢印を描画(位相オフセットが小さく、中央付近の流路のみ)
488487 // Draw small arrow at the end of segment (only for small phase offset and near-center paths)
489488 if (segment_points.size () >= 2 && phase_offset < 0 .3f && std::abs (fixed_lateral_offset) < 4 .0f ) {
490489 const size_t last_idx = segment_points.size () - 1 ;
491490 const paxg::Vec2f& prev = segment_points[last_idx - 1 ];
492491 const paxg::Vec2f& end = segment_points[last_idx];
493-
492+
494493 const float arrow_length = line_width * 4 .0f ;
495494 const float arrow_width = line_width * 2 .5f ;
496-
495+
497496 paxg::Line (prev, end).drawArrow (line_width * 0 .6f , paxg::Vec2f (arrow_width, arrow_length), segment_color);
498497 }
499498 }
@@ -504,19 +503,19 @@ class FlowCurveFeature : public MapFeature, public ISpatiallyUpdatable {
504503 static paxg::Vec2f calculateTangent (const paxg::Vec2f& p0, const paxg::Vec2f& p1,
505504 const paxg::Vec2f& p2, const paxg::Vec2f& p3, float t) {
506505 const float t2 = t * t;
507-
506+
508507 // Catmull-Romスプラインの1次微分
509508 // First derivative of Catmull-Rom spline
510509 const float v0_x = (p2.x () - p0.x ()) * 0 .5f ;
511510 const float v1_x = (p3.x () - p1.x ()) * 0 .5f ;
512- const float dx = (2 * p1.x () - 2 * p2.x () + v0_x + v1_x) * 3 .0f * t2 +
511+ const float dx = (2 * p1.x () - 2 * p2.x () + v0_x + v1_x) * 3 .0f * t2 +
513512 (-3 * p1.x () + 3 * p2.x () - 2 * v0_x - v1_x) * 2 .0f * t + v0_x;
514-
513+
515514 const float v0_y = (p2.y () - p0.y ()) * 0 .5f ;
516515 const float v1_y = (p3.y () - p1.y ()) * 0 .5f ;
517- const float dy = (2 * p1.y () - 2 * p2.y () + v0_y + v1_y) * 3 .0f * t2 +
516+ const float dy = (2 * p1.y () - 2 * p2.y () + v0_y + v1_y) * 3 .0f * t2 +
518517 (-3 * p1.y () + 3 * p2.y () - 2 * v0_y - v1_y) * 2 .0f * t + v0_y;
519-
518+
520519 // 正規化(単位ベクトル化)
521520 // Normalize to unit vector
522521 const float length = std::sqrt (dx * dx + dy * dy);
0 commit comments