Skip to content

Commit 79c9d42

Browse files
committed
ref: デバッグ処理をコメントアウト
1 parent 36e3da7 commit 79c9d42

8 files changed

Lines changed: 49 additions & 68 deletions

File tree

Library/PAX_MAHOROBA/Map/Content/Feature/FlowCurveFeature.hpp

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

Library/PAX_MAHOROBA/Map/Content/Feature/GenomeFeature.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ class GenomeFeature : public MapFeature,
197197
}
198198

199199
void onClick(const ClickContext& context) override {
200-
std::cout << "Genome feature clicked: " << getName() << "\n";
200+
// std::cout << "Genome feature clicked: " << getName() << "\n";
201201
(void)context;
202202
}
203203

Library/PAX_MAHOROBA/Map/Content/Feature/GeographicFeature.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class GeographicFeature : public MapFeature,
165165
}
166166

167167
void onClick(const ClickContext& context) override {
168-
std::cout << "Geographic feature clicked: " << getName() << "\n";
168+
// std::cout << "Geographic feature clicked: " << getName() << "\n";
169169
(void)context;
170170
}
171171

Library/PAX_MAHOROBA/Map/Content/Feature/Model3DFeature.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Model3DFeature : public MapFeature {
120120
// ========== イベント処理 / Event Handling ==========
121121

122122
void onClick(const ClickContext& context) override {
123-
std::cout << "3D Model clicked: " << getName() << std::endl;
123+
// std::cout << "3D Model clicked: " << getName() << std::endl;
124124
(void)context;
125125
}
126126

Library/PAX_MAHOROBA/Map/Content/Feature/PersonFeature.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ class PersonFeature : public MapFeature,
195195
}
196196

197197
void onClick(const ClickContext& context) override {
198-
// クリック時の処理(デバッグ出力)
199-
std::cout << "Person clicked: " << getName() << std::endl;
198+
// std::cout << "Person clicked: " << getName() << std::endl;
200199
(void)context; // 未使用警告を抑制
201200
}
202201

Library/PAX_MAHOROBA/Map/Content/Feature/PlaceNameFeature.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class PlaceNameFeature : public MapFeature,
174174
}
175175

176176
void onClick(const ClickContext& context) override {
177-
std::cout << "PlaceName clicked: " << getName() << "\n";
177+
// std::cout << "PlaceName clicked: " << getName() << "\n";
178178
(void)context;
179179
}
180180

Library/PAX_MAHOROBA/Map/Content/Feature/TerritoryFeature.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class TerritoryFeature : public MapFeature, public ISpatiallyUpdatable {
9393
double max_lon = data_.coordinates[0].x;
9494
double min_lat = data_.coordinates[0].y;
9595
double max_lat = data_.coordinates[0].y;
96-
96+
9797
for (const auto& coord : data_.coordinates) {
9898
min_lon = (std::min)(min_lon, coord.x);
9999
max_lon = (std::max)(max_lon, coord.x);
@@ -199,7 +199,7 @@ class TerritoryFeature : public MapFeature, public ISpatiallyUpdatable {
199199
// Convert normalized coordinates to screen coordinates
200200
cached_screen_points_.clear();
201201
cached_screen_points_.reserve(normalized_coords.size());
202-
202+
203203
for (const auto& coord : normalized_coords) {
204204
// スクリーン座標に変換
205205
const paxg::Vec2<double> screen_pos = MapCoordinateConverter::toScreenPos(
@@ -244,8 +244,7 @@ class TerritoryFeature : public MapFeature, public ISpatiallyUpdatable {
244244
}
245245

246246
void onClick(const ClickContext& context) override {
247-
// クリック時の処理(デバッグ出力)
248-
std::cout << "Territory clicked: " << getName() << std::endl;
247+
// std::cout << "Territory clicked: " << getName() << std::endl;
249248
(void)context;
250249
}
251250

Library/PAX_MAHOROBA/UI/MenuBar/MenuBar.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,6 @@ namespace paxs {
230230
menu_system.render();
231231
language_selector_.render();
232232

233-
// トグルボタンを描画
234-
toggle_button_.update();
235-
toggle_button_.render();
236-
237233
// GitHubボタンを描画
238234
github_button_.render();
239235
}
@@ -263,11 +259,6 @@ namespace paxs {
263259
return language_selector_.handleEvent(event);
264260
}
265261

266-
// トグルボタンのマウス入力処理
267-
if (toggle_button_.isHit(event.pos)) {
268-
return toggle_button_.handleEvent(event);
269-
}
270-
271262
// GitHubボタンのマウス入力処理
272263
if (github_button_.isHit(event.pos)) {
273264
return github_button_.handleEvent(event);
@@ -289,7 +280,6 @@ namespace paxs {
289280
private:
290281
paxs::Pulldown language_selector_;
291282
paxs::MenuSystem menu_system;
292-
mutable paxs::MenuBarToggleButton toggle_button_;
293283
paxs::GitHubButton github_button_;
294284

295285
/// @brief イベント購読を設定
@@ -323,12 +313,6 @@ namespace paxs {
323313
language_selector_.getRect().x() - github_button_.getRect().width() - github_button_margin,
324314
(language_selector_.getRect().height() - github_button_.getRect().height()) / 2
325315
});
326-
327-
// トグルボタンをGitHubボタンの左隣に配置
328-
toggle_button_.init(
329-
github_button_.getRect().x(),
330-
language_selector_.getRect().height()
331-
);
332316
}
333317

334318
/// @brief FeatureVisibilityManagerからメニューの初期状態を読み込む

0 commit comments

Comments
 (0)