• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン344 (tree)
日時2007-06-23 15:09:31
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/MapEditorWX.cpp (revision 343)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.cpp (revision 344)
@@ -130,6 +130,7 @@
130130
131131 //TODO textureBitmaps
132132
133+ //カーソル読み込み <en> load cursor images
133134 /*
134135 TI_ARROW = 0,
135136 TI_FILL,
@@ -177,9 +178,23 @@
177178 cursors[i] = wxCursor(bmp);
178179 }
179180 }
181+ {
182+ wxImage img;
183+ wxString str = wxConvCurrent->cMB2WX("data/img/onLine.bmp");
184+ img.LoadFile(str);
185+ img.SetMaskColour(255,255,255);
186+ this->onLineCursor = wxCursor(img);
187+ img = wxImage();
188+ img.LoadFile(wxString(wxConvCurrent->cMB2WX("data/img/onPoint.bmp")));
189+ img.SetMaskColour(255,255,255);
190+ this->onPointCursor = wxCursor(img);
191+ }
180192
181193 //対象外の線を表示するかどうか
182194 this->isRevealHiddenLines = false;
195+
196+ this->isNowOnTheLine = this->isNowOnThePoint = false;
197+
183198 return true;
184199 }
185200
@@ -238,10 +253,18 @@
238253 void MapEditorWX::setCursor()
239254 {
240255 int editMode = this->getEventManager()->getEditModeType();
256+ int toolType = this->getEventManager()->getToolType();
241257 if(editMode == EditModeType::EM_DRAW){
242- int toolType = this->getEventManager()->getToolType();
243- //TODO カーソル
244- ::wxSetCursor(cursors[toolType]);
258+ if(toolType == ToolType::TI_LINE && this->isNowOnTheLine){
259+ //線の上にいえる
260+ wxSetCursor(this->onLineCursor);
261+ }else if(toolType == ToolType::TI_LINE && this->isNowOnThePoint){
262+ //点の上にいえる
263+ wxSetCursor(this->onPointCursor);
264+ }else{
265+ //TODO カーソル
266+ ::wxSetCursor(cursors[toolType]);
267+ }
245268 }else{
246269 //矢印にする
247270 ::wxSetCursor(cursors[0]);
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 343)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 344)
@@ -196,6 +196,13 @@
196196 menuBar->Append(menuHelp, _T("&Help"));
197197
198198 SetMenuBar(menuBar);
199+
200+ wxGetApp().linePopupMenu.SetTitle(_T("line menu"));
201+ wxGetApp().linePopupMenu.Append(ID_LineProp, _T("Properties..."));
202+ wxGetApp().linePopupMenu.Append(ID_ClockwiseSideProp, _T("Clockwise side prop..."));
203+ wxGetApp().linePopupMenu.Append(ID_CounterclockwiseSideProp, _T("Counterclockwise side prop..."));
204+ wxGetApp().pointPopupMenu.SetTitle(_T("point menu"));
205+ wxGetApp().pointPopupMenu.Append(ID_PointProp, _T("Properties..."));
199206 }
200207
201208
--- marathon/trunk/MapEditorWX/src/PolygonPropDialog.cpp (revision 343)
+++ marathon/trunk/MapEditorWX/src/PolygonPropDialog.cpp (revision 344)
@@ -1,6 +1,60 @@
11 #include "PolygonPropDialog.h"
22 #include "MapEditorWX.h"
3+namespace PolyProp{
4+enum{
5+ ID_ID,
6+ ID_FirstNeighbor,
7+ ID_Type,
8+ ID_NearCount,
9+ ID_Perm,
10+ ID_CenterX,
11+ ID_FloorLight,
12+ ID_CenterY,
13+ ID_CeilingLight,
14+ ID_Area,
15+ ID_FloorOriginX,
16+ ID_FloorOriginY,
17+ ID_CeilingOriginX,
18+ ID_CeilingOriginY,
19+ ID_FirstObj,
20+ ID_Media,
21+ ID_FirstExZone,
22+ ID_MediaLight,
23+ ID_LineExZone,
24+ ID_SndSrcIndex,
25+ ID_FloorTrans,
26+ ID_AmbSnd,
27+ ID_CeilingTrans,
28+ ID_RndSnd,
29+ ID_Platform,
30+};
31+};
332 BEGIN_EVENT_TABLE(PolygonPropDialog, wxDialog)
33+ EVT_TEXT(PolyProp::ID_ID, PolygonPropDialog::OnIDEdit)
34+ EVT_TEXT(PolyProp::ID_FirstNeighbor, PolygonPropDialog::OnFirstNeighborEdit)
35+ EVT_CHOICE(PolyProp::ID_Type, PolygonPropDialog::OnTypeChoice)
36+ EVT_TEXT(PolyProp::ID_NearCount, PolygonPropDialog::OnNearCountEdit)
37+ EVT_TEXT(PolyProp::ID_Perm, PolygonPropDialog::OnPermuEdit)
38+ EVT_TEXT(PolyProp::ID_CenterX, PolygonPropDialog::OnCenterXEdit)
39+ EVT_CHOICE(PolyProp::ID_FloorLight, PolygonPropDialog::OnFloorLightEdit)
40+ EVT_TEXT(PolyProp::CenterY, PolygonPropDialog::OnCenterYEdit)
41+ EVT_CHOICE(PolyProp::CeilingLight, PolygonPropDialog::OnCeilingLightEdit)
42+ EVT_TEXT(PolyProp::ID_Area, PolygonPropDialog::OnAreaEdit)
43+ EVT_TEXT(PolyProp::FloorOriginX, PolygonPropDialog::OnFloorOriginXEdit)
44+ EVT_TEXT(PolyProp::FloorOriginY, PolygonPropDialog::OnFloorOriginYEdit)
45+ EVT_TEXT(PolyProp::CeilingOriginX, PolygonPropDialog::OnCeilingOriginXEdit)
46+ EVT_TEXT(PolyProp::CeilingOriginY, PolygonPropDialog::OnCeilingOriginYEdit)
47+ EVT_CHOICE(PolyProp::ID_FirstObj, PolygonPropDialog::OnFirstObjChoice)
48+ EVT_CHOICE(PolyProp::ID_Media, PolygonPropDialog::OnMediaChoice)
49+ EVT_TEXT(PolyProp::ID_FirstExZone, PolygonPropDialog::OnFirstExZoneEdit)
50+ EVT_CHOICE(PolyProp::ID_MediaLight, PolygonPropDialog::OnMediaLightChoice)
51+ EVT_TEXT(PolyProp::ID_LineExZone, PolygonPropDialog::OnLineExZoneEdit)
52+ EVT_CHOICE(PolyProp::ID_SndSrcIndex, PolygonPropDialog::OnSndSrcIndexChoice)
53+ EVT_TEXT(PolyProp::ID_FloorTrans, PolygonPropDialog::OnFloorTransEdit)
54+ EVT_CHOICE(PolyProp::ID_AmbSnd, PolygonPropDialog::OnAmbSndChoice)
55+ EVT_TEXT(PolyProp::ID_CeilingTrans, PolygonPropDialog::OnCeilingTransEdit)
56+ EVT_CHOICE(PolyProp::ID_RndSnd, PolygonPropDialog::OnRndSndChoice)
57+ EVT_BUTTON(PolyProp::ID_Platform, PolygonPropDialog::OnPlatformBtn)
458 END_EVENT_TABLE()
559 PolygonPropDialog::PolygonPropDialog()
660 {
@@ -11,6 +65,298 @@
1165 bool PolygonPropDialog::Create(wxWindow* parent, wxWindowID id)
1266 {
1367 bool result = wxDialog::Create(parent, id, _T("Polygon Properties"));
68+ label_34 = new wxStaticText(this, wxID_ANY, wxT("Polygon ID"));
69+ text_ctrl_20 = new wxTextCtrl(this, PolyProp::ID_ID, wxEmptyString);
70+ label_46 = new wxStaticText(this, wxID_ANY, wxT("First neighbour"));
71+ text_ctrl_21 = new wxTextCtrl(this, PolyProp::ID_FirstNeighbor, wxEmptyString);
72+ label_35 = new wxStaticText(this, wxID_ANY, wxT("Type"));
73+ choice_12 = new wxChoice(this, PolyProp::ID_Type);
74+ label_47 = new wxStaticText(this, wxID_ANY, wxT("Near count"));
75+ text_ctrl_22 = new wxTextCtrl(this, PolyProp::ID_NearCount, wxEmptyString);
76+ label_36 = new wxStaticText(this, wxID_ANY, wxT("Permutation"));
77+ text_ctrl_25 = new wxTextCtrl(this, PolyProp::ID_Perm, wxEmptyString);
78+ label_48 = new wxStaticText(this, wxID_ANY, wxT("Center X"));
79+ text_ctrl_23 = new wxTextCtrl(this, PolyProp::ID_CenterX, wxEmptyString);
80+ label_37 = new wxStaticText(this, wxID_ANY, wxT("Floor light"));
81+ choice_13 = new wxChoice(this, PolyProp::ID_FloorLight);
82+ label_49 = new wxStaticText(this, wxID_ANY, wxT("Center Y"));
83+ text_ctrl_24 = new wxTextCtrl(this, PolyProp::CenterY, wxEmptyString);
84+ label_38 = new wxStaticText(this, wxID_ANY, wxT("Ceiling light"));
85+ choice_14 = new wxChoice(this, PolyProp::CeilingLight);
86+ label_26 = new wxStaticText(this, wxID_ANY, wxT("Floor origin"));
87+ text_ctrl_33 = new wxTextCtrl(this, PolyProp::FloorOriginX, wxEmptyString);
88+ label_27 = new wxStaticText(this, wxID_ANY, wxT("x"));
89+ text_ctrl_35 = new wxTextCtrl(this, PolyProp::FloorOriginY, wxEmptyString);
90+ label_39 = new wxStaticText(this, wxID_ANY, wxT("Area"));
91+ text_ctrl_26 = new wxTextCtrl(this, PolyProp::ID_Area, wxEmptyString);
92+ label_55 = new wxStaticText(this, wxID_ANY, wxT("Ceiling origin"));
93+ text_ctrl_34 = new wxTextCtrl(this, PolyProp::CeilingOriginX, wxEmptyString);
94+ label_28 = new wxStaticText(this, wxID_ANY, wxT("x"));
95+ text_ctrl_36 = new wxTextCtrl(this, PolyProp::CeilingOriginY, wxEmptyString);
96+ label_40 = new wxStaticText(this, wxID_ANY, wxT("First object"));
97+ choice_19 = new wxChoice(this, PolyProp::ID_FirstObj);
98+ label_54 = new wxStaticText(this, wxID_ANY, wxT("Media"));
99+ choice_15 = new wxChoice(this, PolyProp::ID_Media);
100+ label_41 = new wxStaticText(this, wxID_ANY, wxT("First ex zone"));
101+ text_ctrl_28 = new wxTextCtrl(this, PolyProp::ID_FirstExZone, wxEmptyString);
102+ label_53 = new wxStaticText(this, wxID_ANY, wxT("Media light"));
103+ choice_16 = new wxChoice(this, PolyProp::ID_MediaLight);
104+ label_42 = new wxStaticText(this, wxID_ANY, wxT("Line ex zone"));
105+ text_ctrl_29 = new wxTextCtrl(this, PolyProp::ID_LineExZone, wxEmptyString);
106+ label_52 = new wxStaticText(this, wxID_ANY, wxT("Snd src index"));
107+ choice_20 = new wxChoice(this, PolyProp::ID_SndSrcIndex);
108+ label_43 = new wxStaticText(this, wxID_ANY, wxT("Floor trans"));
109+ text_ctrl_30 = new wxTextCtrl(this, PolyProp::ID_FloorTrans, wxEmptyString);
110+ label_51 = new wxStaticText(this, wxID_ANY, wxT("Amb snd"));
111+ choice_17 = new wxChoice(this, PolyProp::ID_AmbSnd);
112+ label_44 = new wxStaticText(this, wxID_ANY, wxT("Ceiling trans"));
113+ text_ctrl_31 = new wxTextCtrl(this, PolyProp::ID_CeilingTrans, wxEmptyString);
114+ label_50 = new wxStaticText(this, wxID_ANY, wxT("Rnd snd"));
115+ choice_18 = new wxChoice(this, wxID_PolyProp::ID_RndSndANY);
116+ button_21 = new wxButton(this, PolyProp::ID_Platform, wxT("Platform settings"));
117+ panel_10 = new wxPanel(this, wxID_ANY);
118+ panel_11 = new wxPanel(this, wxID_ANY);
119+ panel_12 = new wxPanel(this, wxID_ANY);
14120
121+ choice_12->SetMinSize(wxSize(100, 22));
122+ choice_13->SetMinSize(wxSize(100, 22));
123+ choice_14->SetMinSize(wxSize(100, 22));
124+ text_ctrl_33->SetMinSize(wxSize(30, 20));
125+ text_ctrl_35->SetMinSize(wxSize(30, 20));
126+ text_ctrl_34->SetMinSize(wxSize(30, 20));
127+ text_ctrl_36->SetMinSize(wxSize(30, 20));
128+ choice_19->SetMinSize(wxSize(100, 22));
129+ choice_15->SetMinSize(wxSize(100, 22));
130+ choice_16->SetMinSize(wxSize(100, 22));
131+ choice_20->SetMinSize(wxSize(100, 22));
132+ choice_17->SetMinSize(wxSize(100, 22));
133+ choice_18->SetMinSize(wxSize(100, 22));
134+
135+ wxFlexGridSizer* grid_sizer_13 = new wxFlexGridSizer(12, 4, 0, 0);
136+ wxGridSizer* grid_sizer_9 = new wxGridSizer(1, 3, 0, 0);
137+ wxGridSizer* grid_sizer_8 = new wxGridSizer(1, 3, 0, 0);
138+ grid_sizer_13->Add(label_34, 0, 0, 0);
139+ grid_sizer_13->Add(text_ctrl_20, 0, 0, 0);
140+ grid_sizer_13->Add(label_46, 0, 0, 0);
141+ grid_sizer_13->Add(text_ctrl_21, 0, 0, 0);
142+ grid_sizer_13->Add(label_35, 0, 0, 0);
143+ grid_sizer_13->Add(choice_12, 0, 0, 0);
144+ grid_sizer_13->Add(label_47, 0, 0, 0);
145+ grid_sizer_13->Add(text_ctrl_22, 0, 0, 0);
146+ grid_sizer_13->Add(label_36, 0, 0, 0);
147+ grid_sizer_13->Add(text_ctrl_25, 0, 0, 0);
148+ grid_sizer_13->Add(label_48, 0, 0, 0);
149+ grid_sizer_13->Add(text_ctrl_23, 0, 0, 0);
150+ grid_sizer_13->Add(label_37, 0, 0, 0);
151+ grid_sizer_13->Add(choice_13, 0, 0, 0);
152+ grid_sizer_13->Add(label_49, 0, 0, 0);
153+ grid_sizer_13->Add(text_ctrl_24, 0, 0, 0);
154+ grid_sizer_13->Add(label_38, 0, 0, 0);
155+ grid_sizer_13->Add(choice_14, 0, 0, 0);
156+ grid_sizer_13->Add(label_26, 0, 0, 0);
157+ grid_sizer_8->Add(text_ctrl_33, 0, 0, 0);
158+ grid_sizer_8->Add(label_27, 0, 0, 0);
159+ grid_sizer_8->Add(text_ctrl_35, 0, 0, 0);
160+ grid_sizer_13->Add(grid_sizer_8, 1, wxEXPAND, 0);
161+ grid_sizer_13->Add(label_39, 0, 0, 0);
162+ grid_sizer_13->Add(text_ctrl_26, 0, 0, 0);
163+ grid_sizer_13->Add(label_55, 0, 0, 0);
164+ grid_sizer_9->Add(text_ctrl_34, 0, 0, 0);
165+ grid_sizer_9->Add(label_28, 0, 0, 0);
166+ grid_sizer_9->Add(text_ctrl_36, 0, 0, 0);
167+ grid_sizer_13->Add(grid_sizer_9, 1, wxEXPAND, 0);
168+ grid_sizer_13->Add(label_40, 0, 0, 0);
169+ grid_sizer_13->Add(choice_19, 0, 0, 0);
170+ grid_sizer_13->Add(label_54, 0, 0, 0);
171+ grid_sizer_13->Add(choice_15, 0, 0, 0);
172+ grid_sizer_13->Add(label_41, 0, 0, 0);
173+ grid_sizer_13->Add(text_ctrl_28, 0, 0, 0);
174+ grid_sizer_13->Add(label_53, 0, 0, 0);
175+ grid_sizer_13->Add(choice_16, 0, 0, 0);
176+ grid_sizer_13->Add(label_42, 0, 0, 0);
177+ grid_sizer_13->Add(text_ctrl_29, 0, 0, 0);
178+ grid_sizer_13->Add(label_52, 0, 0, 0);
179+ grid_sizer_13->Add(choice_20, 0, 0, 0);
180+ grid_sizer_13->Add(label_43, 0, 0, 0);
181+ grid_sizer_13->Add(text_ctrl_30, 0, 0, 0);
182+ grid_sizer_13->Add(label_51, 0, 0, 0);
183+ grid_sizer_13->Add(choice_17, 0, 0, 0);
184+ grid_sizer_13->Add(label_44, 0, 0, 0);
185+ grid_sizer_13->Add(text_ctrl_31, 0, 0, 0);
186+ grid_sizer_13->Add(label_50, 0, 0, 0);
187+ grid_sizer_13->Add(choice_18, 0, 0, 0);
188+ grid_sizer_13->Add(button_21, 0, 0, 0);
189+ grid_sizer_13->Add(panel_10, 1, wxEXPAND, 0);
190+ grid_sizer_13->Add(panel_11, 1, wxEXPAND, 0);
191+ grid_sizer_13->Add(panel_12, 1, wxEXPAND, 0);
192+ SetSizer(grid_sizer_13);
193+ grid_sizer_13->Fit(this);
194+ Layout();
15195 return result;
16196 }
197+
198+void PolygonPropDialog::OnIDEdit(wxCommandEvent &event)
199+{
200+ event.Skip();
201+ std::cout<<"Event handler (PolygonPropDialog::OnIDEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
202+}
203+
204+
205+void PolygonPropDialog::OnFirstNeighborEdit(wxCommandEvent &event)
206+{
207+ event.Skip();
208+ std::cout<<"Event handler (PolygonPropDialog::OnFirstNeighborEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
209+}
210+
211+
212+void PolygonPropDialog::OnTypeChoice(wxCommandEvent &event)
213+{
214+ event.Skip();
215+ std::cout<<"Event handler (PolygonPropDialog::OnTypeChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
216+}
217+
218+
219+void PolygonPropDialog::OnNearCountEdit(wxCommandEvent &event)
220+{
221+ event.Skip();
222+ std::cout<<"Event handler (PolygonPropDialog::OnNearCountEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
223+}
224+
225+
226+void PolygonPropDialog::OnPermuEdit(wxCommandEvent &event)
227+{
228+ event.Skip();
229+ std::cout<<"Event handler (PolygonPropDialog::OnPermuEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
230+}
231+
232+
233+void PolygonPropDialog::OnCenterXEdit(wxCommandEvent &event)
234+{
235+ event.Skip();
236+ std::cout<<"Event handler (PolygonPropDialog::OnCenterXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
237+}
238+
239+
240+void PolygonPropDialog::OnFloorLightEdit(wxCommandEvent &event)
241+{
242+ event.Skip();
243+ std::cout<<"Event handler (PolygonPropDialog::OnFloorLightEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
244+}
245+
246+
247+void PolygonPropDialog::OnCenterYEdit(wxCommandEvent &event)
248+{
249+ event.Skip();
250+ std::cout<<"Event handler (PolygonPropDialog::OnCenterYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
251+}
252+
253+
254+void PolygonPropDialog::OnCeilingLightEdit(wxCommandEvent &event)
255+{
256+ event.Skip();
257+ std::cout<<"Event handler (PolygonPropDialog::OnCeilingLightEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
258+}
259+
260+
261+void PolygonPropDialog::OnAreaEdit(wxCommandEvent &event)
262+{
263+ event.Skip();
264+ std::cout<<"Event handler (PolygonPropDialog::OnAreaEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
265+}
266+void PolygonPropDialog::OnFloorOriginXEdit(wxCommandEvent &event)
267+{
268+ event.Skip();
269+ std::cout<<"Event handler (PolygonPropDialog::OnFloorOriginXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
270+}
271+void PolygonPropDialog::OnFloorOriginYEdit(wxCommandEvent &event)
272+{
273+ event.Skip();
274+ std::cout<<"Event handler (PolygonPropDialog::OnFloorOriginYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
275+}
276+void PolygonPropDialog::OnCeilingOriginXEdit(wxCommandEvent &event)
277+{
278+ event.Skip();
279+ std::cout<<"Event handler (PolygonPropDialog::OnCeilingOriginXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
280+}
281+void PolygonPropDialog::OnCeilingOriginYEdit(wxCommandEvent &event)
282+{
283+ event.Skip();
284+ std::cout<<"Event handler (PolygonPropDialog::OnCeilingOriginYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
285+}
286+
287+
288+void PolygonPropDialog::OnFirstObjChoice(wxCommandEvent &event)
289+{
290+ event.Skip();
291+ std::cout<<"Event handler (PolygonPropDialog::OnFirstObjChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
292+}
293+
294+
295+void PolygonPropDialog::OnMediaChoice(wxCommandEvent &event)
296+{
297+ event.Skip();
298+ std::cout<<"Event handler (PolygonPropDialog::OnMediaChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
299+}
300+
301+
302+void PolygonPropDialog::OnFirstExZoneEdit(wxCommandEvent &event)
303+{
304+ event.Skip();
305+ std::cout<<"Event handler (PolygonPropDialog::OnFirstExZoneEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
306+}
307+
308+
309+void PolygonPropDialog::OnMediaLightChoice(wxCommandEvent &event)
310+{
311+ event.Skip();
312+ std::cout<<"Event handler (PolygonPropDialog::OnMediaLightChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
313+}
314+
315+
316+void PolygonPropDialog::OnLineExZoneEdit(wxCommandEvent &event)
317+{
318+ event.Skip();
319+ std::cout<<"Event handler (PolygonPropDialog::OnLineExZoneEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
320+}
321+
322+
323+void PolygonPropDialog::OnSndSrcIndexChoice(wxCommandEvent &event)
324+{
325+ event.Skip();
326+ std::cout<<"Event handler (PolygonPropDialog::OnSndSrcIndexChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
327+}
328+
329+
330+void PolygonPropDialog::OnFloorTransEdit(wxCommandEvent &event)
331+{
332+ event.Skip();
333+ std::cout<<"Event handler (PolygonPropDialog::OnFloorTransEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
334+}
335+
336+
337+void PolygonPropDialog::OnAmbSndChoice(wxCommandEvent &event)
338+{
339+ event.Skip();
340+ std::cout<<"Event handler (PolygonPropDialog::OnAmbSndChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
341+}
342+
343+
344+void PolygonPropDialog::OnCeilingTransEdit(wxCommandEvent &event)
345+{
346+ event.Skip();
347+ std::cout<<"Event handler (PolygonPropDialog::OnCeilingTransEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
348+}
349+
350+
351+void PolygonPropDialog::OnRndSndChoice(wxCommandEvent &event)
352+{
353+ event.Skip();
354+ std::cout<<"Event handler (PolygonPropDialog::OnRndSndChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
355+}
356+
357+
358+void PolygonPropDialog::OnPlatformBtn(wxCommandEvent &event)
359+{
360+ event.Skip();
361+ std::cout<<"Event handler (PolygonPropDialog::OnPlatformBtn) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
362+}
--- marathon/trunk/MapEditorWX/src/MainFrameDraw.cpp (revision 343)
+++ marathon/trunk/MapEditorWX/src/MainFrameDraw.cpp (revision 344)
@@ -85,7 +85,7 @@
8585 int mx = mpoint[0];
8686 int my = mpoint[1];
8787 int selStartPoint[2];
88- emgr->getSelectingGroupStartPoint(selStartPoint);
88+ emgr->getSelectGroupStartPoint(selStartPoint);
8989 //ポリゴン追加モード
9090 //追加予定ポリゴンを表示
9191 double polygonPoints[MAXIMUM_VERTICES_PER_POLYGON][2];
@@ -282,7 +282,7 @@
282282 bool isHidden = false;
283283 if(floor < zMin || ceiling > zMax){
284284 isHidden = true;
285- if(wxGetApp().isRevealHiddenLines){
285+ if(!wxGetApp().isRevealHiddenLines){
286286 //見えない線をうっすら表示。をしない
287287 continue;
288288 }
@@ -292,8 +292,8 @@
292292 wxGetApp().getViewPointFromWorldPoint(begin->vertex, beginP);
293293 wxGetApp().getViewPointFromWorldPoint(end->vertex, endP);
294294
295- //隠れ線
296295 if(isHidden){
296+ dc->SetPen(*wxGREY_PEN);
297297 }else{
298298 bool select = false;
299299 //選択チェック
@@ -312,6 +312,22 @@
312312 }
313313 //選択チェック
314314 dc->DrawLine(beginP[0], beginP[1], endP[0], endP[1]);
315+#ifdef DEBUG
316+ //デバッグモード
317+ //矢印にして表示
318+ const double WING_DEG = 150;
319+ const int WING_LEN = 10;
320+ double deg = hpl::math::getDegreeFromVector(endP[0] - beginP[0], endP[1] - beginP[1]);
321+ for(int j = -1; j < 2; j += 2){
322+ double wingDeg = deg + j * WING_DEG;
323+ double rad = hpl::math::getRadianFromDegree(wingDeg);
324+ int wingP[2] ={
325+ endP[0] + WING_LEN * cos(rad),
326+ endP[1] + WING_LEN * sin(rad),
327+ };
328+ dc->DrawLine(endP[0], endP[1], wingP[0], wingP[1]);
329+ }
330+#endif
315331 }
316332 }
317333 void MapEditorMainFrame::drawSides(wxDC* dc)
--- marathon/trunk/MapEditorWX/src/MainFrameEvent.cpp (revision 343)
+++ marathon/trunk/MapEditorWX/src/MainFrameEvent.cpp (revision 344)
@@ -417,8 +417,9 @@
417417 //重なる点があるかどうかチェック
418418 int pointIndex = hpl::aleph::map::getSelectPointIndex(wpoint, POINT_DISTANCE_EPSILON, zMin, zMax);
419419 //重なる線があるか判定する
420- int lineIndex = hpl::aleph::map::getLineIndexFromOnPoint(wpoint, LINE_DISTANCE_EPSILON, zMin, zMax);
420+ int lineIndex = hpl::aleph::map::getSelectLineIndex(wpoint, LINE_DISTANCE_EPSILON, zMin, zMax);
421421
422+ hpl::aleph::HPLStockManager* smgr = wxGetApp().getStockManager();
422423 if(pointIndex != NONE)
423424 {
424425 //既存の点をクリックしている
@@ -499,7 +500,8 @@
499500 //endpoint_data* end = get_endpoint_data(line->endpoint_indexes[1]);
500501
501502 //線を削除
502- hpl::aleph::map::deleteLine(lineIndex);
503+ smgr->deleteLine(lineIndex);
504+ smgr->updateDeletes();
503505 //点を追加
504506 endpoint_data ep;
505507 assert(hpl::aleph::map::createPoint(wpoint, &ep, POINT_DISTANCE_EPSILON));
@@ -631,6 +633,11 @@
631633 wxGetApp().setCursor();
632634 //マウス座標記録
633635 wxGetApp().getViewGridManager()->setNewMousePoint(ev.m_x, ev.m_y);
636+
637+ //ポップアップメニューを出す
638+ //TODO
639+ //テスト
640+ PopupMenu(&wxGetApp().linePopupMenu);
634641 }
635642 ///////////////////////////////////////////////////////
636643 void MapEditorMainFrame::OnRightUp(wxMouseEvent& ev)
@@ -1034,6 +1041,9 @@
10341041 //移動
10351042 this->moveMapOffset(ev.m_x, ev.m_y);
10361043 }
1044+/**
1045+ 線ツール
1046+*/
10371047 void MapEditorMainFrame::doMouseMotionOnLineTool(wxMouseEvent& ev)
10381048 {
10391049 hpl::aleph::view::HPLViewGridManager* vmgr = wxGetApp().getViewGridManager();
@@ -1040,34 +1050,26 @@
10401050
10411051 int voffset[2];
10421052 vmgr->getOffset(voffset);
1043- //点を踏んでいないか確認
1044- int endpointIndex = NONE;
1045- bool found = false;
1053+ world_point2d wmp = wxGetApp().getWorldPointFromViewPoint(ev.m_x, ev.m_y);
1054+ int zMin = vmgr->getViewHeightMin();
1055+ int zMax = vmgr->getViewHeightMax();
10461056 int div = vmgr->getZoomDivision();
10471057
1048- world_point2d wmp = wxGetApp().getWorldPointFromViewPoint(ev.m_x, ev.m_y);
1049- for(int i = 0; i < (int)EndpointList.size(); i ++){
1050- endpoint_data* ep = get_endpoint_data(i);
1051- if(!wxGetApp().getViewGridManager()->isValidHeight(
1052- ep->highest_adjacent_floor_height, ep->lowest_adjacent_ceiling_height))
1053- {
1054- continue;
1055- }
1058+ //点を踏んでいないか確認
1059+ int endpointIndex = hpl::aleph::map::getSelectPointIndex(wmp, POINT_DISTANCE_EPSILON * div, zMin, zMax);
1060+ if(endpointIndex != NONE){
1061+ wxGetApp().isNowOnThePoint = true;
1062+ wxGetApp().isNowOnTheLine = false;
1063+ }else{
1064+ wxGetApp().isNowOnThePoint = false;
10561065
1057- if(hpl::aleph::map::isSelectPoint(ev.m_x, ev.m_y, ep->vertex.x, ep->vertex.y,
1058- voffset[0], voffset[1], OFFSET_X_WORLD, OFFSET_Y_WORLD, div, POINT_DISTANCE_EPSILON))
1059- {
1060- wxGetApp().isNowOnThePoint = true;
1061- found = true;
1062- break;
1066+ int lineIndex = hpl::aleph::map::getSelectLineIndex(wmp, POINT_DISTANCE_EPSILON * div, zMin, zMax);
1067+ if(lineIndex != NONE){
1068+ wxGetApp().isNowOnTheLine = true;
1069+ }else{
1070+ wxGetApp().isNowOnTheLine = false;
10631071 }
10641072 }
1065- if(!found){
1066- wxGetApp().isNowOnThePoint = false;
1067-
1068- //線の上にいるかどうか?
1069- //TODO
1070- }
10711073 }
10721074 void MapEditorMainFrame::doMouseMotionOnMagnifyTool(wxMouseEvent& ev)
10731075 {
--- marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 343)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 344)
@@ -185,6 +185,11 @@
185185 //ただし、高さ範囲の外にある場合考慮しない
186186 bool isNowOnThePoint;
187187 bool isNowOnTheLine;
188+
189+ wxMenu linePopupMenu;
190+ wxMenu pointPopupMenu;
191+
192+ //public メンバ変数 ここまで
188193 private:
189194
190195 ///////////////////////
@@ -202,6 +207,11 @@
202207 //ツールごとのカーソル
203208 wxCursor cursors[ToolType::NUMBER_OF_TOOLS];
204209
210+ //オンラインカーソル
211+ wxCursor onLineCursor;
212+ //オンポイントカーソル
213+ wxCursor onPointCursor;
214+
205215 //ウインドウフレーム
206216 MapEditorMainFrame *frame;
207217 public:
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 343)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 344)
@@ -77,6 +77,12 @@
7777 ID_LevelInfo,
7878 ID_ObjectPlacement,
7979 ID_TerminalViewer,
80+
81+ //popup menu
82+ ID_LineProp,
83+ ID_ClockwiseSideProp,
84+ ID_CounterclockwiseSideProp,
85+ ID_PointProp,
8086 };
8187
8288 //リソースID
--- marathon/trunk/MapEditorWX/src/PolygonPropDialog.h (revision 343)
+++ marathon/trunk/MapEditorWX/src/PolygonPropDialog.h (revision 344)
@@ -4,6 +4,58 @@
44 #include "DlgCommon.h"
55
66 class PolygonPropDialog: public wxDialog{
7+ wxStaticText* label_34;
8+ wxTextCtrl* text_ctrl_20;
9+ wxStaticText* label_46;
10+ wxTextCtrl* text_ctrl_21;
11+ wxStaticText* label_35;
12+ wxChoice* choice_12;
13+ wxStaticText* label_47;
14+ wxTextCtrl* text_ctrl_22;
15+ wxStaticText* label_36;
16+ wxTextCtrl* text_ctrl_25;
17+ wxStaticText* label_48;
18+ wxTextCtrl* text_ctrl_23;
19+ wxStaticText* label_37;
20+ wxChoice* choice_13;
21+ wxStaticText* label_49;
22+ wxTextCtrl* text_ctrl_24;
23+ wxStaticText* label_38;
24+ wxChoice* choice_14;
25+ wxStaticText* label_26;
26+ wxTextCtrl* text_ctrl_33;
27+ wxStaticText* label_27;
28+ wxTextCtrl* text_ctrl_35;
29+ wxStaticText* label_39;
30+ wxTextCtrl* text_ctrl_26;
31+ wxStaticText* label_55;
32+ wxTextCtrl* text_ctrl_34;
33+ wxStaticText* label_28;
34+ wxTextCtrl* text_ctrl_36;
35+ wxStaticText* label_40;
36+ wxChoice* choice_19;
37+ wxStaticText* label_54;
38+ wxChoice* choice_15;
39+ wxStaticText* label_41;
40+ wxTextCtrl* text_ctrl_28;
41+ wxStaticText* label_53;
42+ wxChoice* choice_16;
43+ wxStaticText* label_42;
44+ wxTextCtrl* text_ctrl_29;
45+ wxStaticText* label_52;
46+ wxChoice* choice_20;
47+ wxStaticText* label_43;
48+ wxTextCtrl* text_ctrl_30;
49+ wxStaticText* label_51;
50+ wxChoice* choice_17;
51+ wxStaticText* label_44;
52+ wxTextCtrl* text_ctrl_31;
53+ wxStaticText* label_50;
54+ wxChoice* choice_18;
55+ wxButton* button_21;
56+ wxPanel* panel_10;
57+ wxPanel* panel_11;
58+ wxPanel* panel_12;
759 public:
860 PolygonPropDialog();
961 bool Create(wxWindow* parent, wxWindowID id);
@@ -11,6 +63,31 @@
1163
1264 //イベントテーブル作成<en>declare
1365 DECLARE_EVENT_TABLE()
66+ void OnIDEdit(wxCommandEvent &event); // wxGlade: <event_handler>
67+ void OnFirstNeighborEdit(wxCommandEvent &event); // wxGlade: <event_handler>
68+ void OnTypeChoice(wxCommandEvent &event); // wxGlade: <event_handler>
69+ void OnNearCountEdit(wxCommandEvent &event); // wxGlade: <event_handler>
70+ void OnPermuEdit(wxCommandEvent &event); // wxGlade: <event_handler>
71+ void OnCenterXEdit(wxCommandEvent &event); // wxGlade: <event_handler>
72+ void OnFloorLightEdit(wxCommandEvent &event); // wxGlade: <event_handler>
73+ void OnCenterYEdit(wxCommandEvent &event); // wxGlade: <event_handler>
74+ void OnCeilingLightEdit(wxCommandEvent &event); // wxGlade: <event_handler>
75+ void OnAreaEdit(wxCommandEvent &event); // wxGlade: <event_handler>
76+ void OnFloorOriginXEdit(wxCommandEvent &event); // wxGlade: <event_handler>
77+ void OnFloorOriginYEdit(wxCommandEvent &event); // wxGlade: <event_handler>
78+ void OnCeilingOriginXEdit(wxCommandEvent &event); // wxGlade: <event_handler>
79+ void OnCeilingOriginYEdit(wxCommandEvent &event); // wxGlade: <event_handler>
80+ void OnFirstObjChoice(wxCommandEvent &event); // wxGlade: <event_handler>
81+ void OnMediaChoice(wxCommandEvent &event); // wxGlade: <event_handler>
82+ void OnFirstExZoneEdit(wxCommandEvent &event); // wxGlade: <event_handler>
83+ void OnMediaLightChoice(wxCommandEvent &event); // wxGlade: <event_handler>
84+ void OnLineExZoneEdit(wxCommandEvent &event); // wxGlade: <event_handler>
85+ void OnSndSrcIndexChoice(wxCommandEvent &event); // wxGlade: <event_handler>
86+ void OnFloorTransEdit(wxCommandEvent &event); // wxGlade: <event_handler>
87+ void OnAmbSndChoice(wxCommandEvent &event); // wxGlade: <event_handler>
88+ void OnCeilingTransEdit(wxCommandEvent &event); // wxGlade: <event_handler>
89+ void OnRndSndChoice(wxCommandEvent &event); // wxGlade: <event_handler>
90+ void OnPlatformBtn(wxCommandEvent &event); // wxGlade: <event_handler>
1491 };
1592
1693 #endif
--- marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 343)
+++ marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 344)
@@ -38,9 +38,8 @@
3838 //内容をマップデータに反映
3939 //TODO
4040
41- //削除対象の覚え書きを初期化
42- wxGetApp().getStockManager()->toDeleteList.clear();
43-
41+ //データの初期化
42+ wxGetApp().getStockManager()->resetDeletes();
4443 Refresh();
4544 }
4645 void MapEditorMainFrame::OnNewLevel(wxCommandEvent& ev)
@@ -105,6 +104,8 @@
105104
106105 wxGetApp().filePath = path;
107106 wxGetApp().isChanged = false;
107+
108+ wxGetApp().getStockManager()->resetDeletes();
108109 //再描画
109110 Refresh();
110111 }
--- marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 343)
+++ marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 344)
@@ -28,8 +28,8 @@
2828
2929 ?EwxGlade??
3030 ?E?z?u
31-?E?f?[?^?ǂݍ??ݕ????쐬
32-?E?f?[?^?????o???????쐬
31+?E?Ăяo???????L?q
32+?E?f?[?^???o?͋L?q
3333
3434 Annotation :?z?u?ς?
3535 ColorCustomize :?z?u?ς?
@@ -41,9 +41,9 @@
4141 ObjectProp :wx
4242 Placement :?z?u?ς?
4343 Platform :?z?u?ς݁B
44-PointProp :wx
45-PolygonNum :wx
46-PolygonProp :wx
44+PointProp :?z?u
45+PolygonNum :?z?u
46+PolygonProp :?z?u
4747 PolygonType
4848 SelectLevel
4949 SideProp
@@ -52,7 +52,7 @@
5252 Tool :?z?u?ς?
5353 Visual
5454
55-JumpLevel
55+JumpLevel :wx
5656 MediaPalette
5757 LightPalette
5858 SoundPalette
--- marathon/trunk/HPLLib/HPLMapToolModifier.cpp (revision 343)
+++ marathon/trunk/HPLLib/HPLMapToolModifier.cpp (revision 344)
@@ -5,6 +5,7 @@
55 #include <fstream>
66 #include "HPLError.h"
77 #include "HPLStringModifier.h"
8+#include "map.h"
89
910 /**
1011 マップアイテム(点・線・Side・ポリゴン・オブジェクト)
@@ -24,13 +25,13 @@
2425 std::vector<bool>& delPolygons, std::vector<bool>& delObjects)
2526 {
2627 if(delPoints.size() != EndpointList.size() ||
27- delPoints.size() != dynamic_world.endpoint_count ||
28+ delPoints.size() != dynamic_world->endpoint_count ||
2829 delLines.size() != LineList.size() ||
29- delLines.size() != dynamic_world.line_count ||
30+ delLines.size() != dynamic_world->line_count ||
3031 delSides.size() != SideList.size() ||
31- delSides.size() != dynamic_world.side_count ||
32+ delSides.size() != dynamic_world->side_count ||
3233 delPolygons.size() != PolygonList.size() ||
33- delPolygons.size() != dynamic_world.polygon_count ||
34+ delPolygons.size() != dynamic_world->polygon_count ||
3435 delObjects.size() != SavedObjectList.size())
3536 {
3637 hpl::error::halt("数があっていない");
@@ -67,4 +68,66 @@
6768 for(int i = 0; i < (int)delObjects.size(); i ++){
6869 if(!delObjects[i]){ indexMapObjects[i] = counter; counter ++;}
6970 }
71+
72+ //インデックスを付け直す
73+ for(int i = 0; i < (int)EndpointList.size(); i ++){
74+ if(!delPoints[i]){
75+ endpoint_data* ep = get_endpoint_data(i);
76+ ep->supporting_polygon_index = indexMapPolygons[ep->supporting_polygon_index];
77+ }
78+ }
79+ for(int i = 0; i < (int)LineList.size(); i ++){
80+ if(!delLines[i]){
81+ line_data* line = get_line_data(i);
82+ assert(line);
83+ if(line->clockwise_polygon_owner != NONE){
84+ line->clockwise_polygon_owner = indexMapPolygons[line->clockwise_polygon_owner];
85+ }
86+ if(line->clockwise_polygon_side_index != NONE){
87+ line->clockwise_polygon_side_index = indexMapSides[line->clockwise_polygon_side_index];
88+ }
89+ if(line->counterclockwise_polygon_owner != NONE){
90+ line->counterclockwise_polygon_owner = indexMapPolygons[line->counterclockwise_polygon_owner];
91+ }
92+ if(line->counterclockwise_polygon_side_index != NONE){
93+ line->counterclockwise_polygon_side_index = indexMapSides[line->counterclockwise_polygon_side_index];
94+ }
95+ for(int j = 0; j < 2; j ++){
96+ line->endpoint_indexes[j] = indexMapPoints[line->endpoint_indexes[j]];
97+ }
98+ }
99+ }
100+ for(int i = 0; i < (int)SideList.size(); i ++){
101+ if(!delSides[i]){
102+ side_data* side = get_side_data(i);
103+ assert(side);
104+ side->line_index = indexMapLines[side->line_index];
105+ side->polygon_index = indexMapPolygons[side->polygon_index];
106+ }
107+ }
108+ for(int i = 0; i < (int)PolygonList.size(); i ++){
109+ if(!delPolygons[i]){
110+ polygon_data* poly = get_polygon_data(i);
111+ assert(poly);
112+ int n = poly->vertex_count;
113+ for(int j = 0; j < n; j ++){
114+ if(poly->adjacent_polygon_indexes[j] != NONE){
115+ poly->adjacent_polygon_indexes[j] =
116+ indexMapPolygons[poly->adjacent_polygon_indexes[j]];
117+ }
118+ poly->line_indexes[j] = indexMapLines[poly->line_indexes[j]];
119+ poly->endpoint_indexes[j] = indexMapPoints[poly->endpoint_indexes[j]];
120+ poly->side_indexes[j] = indexMapSides[poly->side_indexes[j]];
121+ }
122+ if(poly->first_object != NONE){
123+ poly->first_object = indexMapObjects[poly->first_object];
124+ }
125+ }
126+ }
127+ for(int i = 0; i < (int)SavedObjectList.size(); i ++){
128+ if(!delObjects[i]){
129+ map_object* obj = &SavedObjectList[i];
130+ obj->polygon_index = indexMapPolygons[obj->polygon_index];
131+ }
132+ }
70133 }
--- marathon/trunk/HPLLib/HPLMath.h (revision 343)
+++ marathon/trunk/HPLLib/HPLMath.h (revision 344)
@@ -104,6 +104,7 @@
104104
105105 /**
106106 点と点の距離が所定以内か判定
107+ @param distance ビュー座標での距離閾値
107108 <en>check distance between points be under threshold
108109 */
109110 bool isNearbyPoints(double px0, double py0,
--- marathon/trunk/HPLLib/HPLMapTool.cpp (revision 343)
+++ marathon/trunk/HPLLib/HPLMapTool.cpp (revision 344)
@@ -1030,198 +1030,6 @@
10301030 return true;
10311031 }
10321032
1033-/**
1034- 一部を飛ばした新しいインデックス表を作ります
1035-*/
1036-static std::map<int, int> getIndexMapSkipped(size_t max, int skipIndex)
1037-{
1038- std::map<int, int> indexMap;
1039- for(int i = 0; i < (int)max; i ++){
1040- int newIndex = i;
1041- if(i > skipIndex){
1042- newIndex = i - 1;
1043- }
1044- indexMap[i] = newIndex;
1045- }
1046- return indexMap;
1047-}
1048-
1049-/**
1050- 点情報を削除します
1051-*/
1052-bool hpl::aleph::map::deleteEndpoint(int index)
1053-{
1054- endpoint_data* ep = get_endpoint_data(index);
1055- if(!ep){
1056- return false;
1057- }
1058- //関連するインデックスをそれぞれ直す必要あり
1059- //この点を有する線とポリゴン、オブジェクト等を削除する
1060- std::vector<int> lineIndexes = hpl::aleph::map::getLineIndexesIncludePoint(index);
1061- for(int i = 0; i < (int)lineIndexes.size(); i ++){
1062- //線削除
1063- //そのとき、線の左右にあるポリゴンが削除される
1064- //ポリゴンを削除すると中にあるオブジェクトも消す
1065- hpl::aleph::map::deleteLine(i);
1066- }
1067- std::map<int, int> indexMap = getIndexMapSkipped(EndpointList.size(), index);
1068-
1069- //ポリゴンと線の点インデックス張りなおし
1070- //TODO 他にも必要かも?
1071- for(int i = 0; i < (int)LineList.size(); i ++){
1072- line_data* line = get_line_data(i);
1073- for(int j = 0; j < 2; j ++){
1074- line->endpoint_indexes[j] = indexMap[line->endpoint_indexes[j]];
1075- }
1076- }
1077- for(int i = 0; i < (int)PolygonList.size(); i ++){
1078- polygon_data* polygon = get_polygon_data(i);
1079- int n = polygon->vertex_count;
1080- for(int j = 0; j < n; j ++){
1081- polygon->endpoint_indexes[j] = indexMap[polygon->endpoint_indexes[j]];
1082- }
1083- }
1084- //削除!
1085- hpl::aleph::removeIndexInVector<endpoint_data>(&EndpointList, index);
1086- //dynamic!
1087- dynamic_world->endpoint_count = (int16)EndpointList.size();
1088- return true;
1089-}
1090-bool hpl::aleph::map::deleteLine(int index)
1091-{
1092- //TODO
1093- line_data* line = get_line_data(index);
1094- if(line == NULL){
1095- return false;
1096- }
1097- //同時に左右にあるポリゴンを抹殺します
1098- if(line->clockwise_polygon_owner != NONE){
1099- //削除
1100- hpl::aleph::map::deletePolygon(line->clockwise_polygon_owner);
1101- }
1102- if(line->counterclockwise_polygon_owner != NONE){
1103- hpl::aleph::map::deletePolygon(line->counterclockwise_polygon_owner);
1104- }
1105- ///ついでにsideも削除します
1106- if(line->clockwise_polygon_side_index != NONE){
1107- hpl::aleph::map::deleteSide(line->clockwise_polygon_side_index);
1108- }
1109- if(line->counterclockwise_polygon_side_index != NONE){
1110- hpl::aleph::map::deleteSide(line->counterclockwise_polygon_side_index);
1111- }
1112- std::map<int, int> indexMap = getIndexMapSkipped(LineList.size(), index);
1113-
1114- //インデックスを張りなおします
1115- //TODO
1116- //ポリゴンとSideのインデックス張りなおし
1117- for(int i = 0; i < (int)PolygonList.size(); i ++){
1118- polygon_data* polygon = get_polygon_data(i);
1119- int n = polygon->vertex_count;
1120- for(int j = 0; j < n; j ++){
1121- polygon->line_indexes[j] = indexMap[polygon->line_indexes[j]];
1122- }
1123- }
1124- for(int i = 0; i < (int)SideList.size(); i ++){
1125- side_data* side = get_side_data(i);
1126- side->line_index = indexMap[side->line_index];
1127- }
1128- //削除
1129- hpl::aleph::removeIndexInVector<line_data>(&LineList, index);
1130- dynamic_world->line_count = (int16)LineList.size();
1131- return true;
1132-}
1133-bool hpl::aleph::map::deleteSide(int index)
1134-{
1135- //TODO
1136- side_data* side = get_side_data(index);
1137- if(side == NULL){
1138- return false;
1139- }
1140- //所有者である線からはずします
1141- if(side->line_index != NONE){
1142- line_data* line = get_line_data(side->line_index);
1143- if(line->clockwise_polygon_side_index == index){
1144- line->clockwise_polygon_side_index = NONE;
1145- }
1146- if(line->counterclockwise_polygon_side_index == index){
1147- line->counterclockwise_polygon_side_index = NONE;
1148- }
1149- }
1150-
1151- //インデックスを張りなおします
1152- std::map<int,int> indexMap = getIndexMapSkipped(SideList.size(), index);
1153-
1154- //TODO
1155- //線の情報を張り直します
1156- for(int i = 0; i < (int)LineList.size(); i ++){
1157- line_data* line = get_line_data(i);
1158- if(line->counterclockwise_polygon_side_index != NONE){
1159- line->counterclockwise_polygon_side_index =
1160- indexMap[line->counterclockwise_polygon_side_index];
1161- }
1162- if(line->clockwise_polygon_side_index != NONE){
1163- line->clockwise_polygon_side_index =
1164- indexMap[line->clockwise_polygon_side_index];
1165- }
1166- }
1167-
1168- //削除します
1169- hpl::aleph::removeIndexInVector(&SideList, index);
1170- dynamic_world->side_count = (int16)SideList.size();
1171- return true;
1172-}
1173-bool hpl::aleph::map::deletePolygon(int index)
1174-{
1175- //TODO
1176- polygon_data* polygon = get_polygon_data(index);
1177- if(polygon == NULL){
1178- return false;
1179- }
1180- //のっかっているオブジェクトを削除します
1181- for(int i = 0; i < (int)SavedObjectList.size(); i ++){
1182- map_object* obj = &SavedObjectList[i];
1183- if(obj->polygon_index == index){
1184- //削除
1185- hpl::aleph::map::deleteMapSavedObject(i);
1186- }
1187- }
1188-
1189- std::map<int,int> indexMap = getIndexMapSkipped(PolygonList.size(), index);
1190- //情報を更新します
1191- //TODO
1192- //線情報を更新します
1193- for(int i = 0; i < (int)LineList.size(); i ++){
1194- line_data* line = get_line_data(i);
1195- if(line->clockwise_polygon_owner != NONE){
1196- line->clockwise_polygon_owner =
1197- indexMap[line->clockwise_polygon_owner];
1198- }
1199- if(line->counterclockwise_polygon_owner != NONE){
1200- line->counterclockwise_polygon_owner =
1201- indexMap[line->counterclockwise_polygon_owner];
1202- }
1203- }
1204- //オブジェクト情報を更新します
1205- for(int i = 0; i < (int)SavedObjectList.size(); i ++){
1206- map_object* obj = &SavedObjectList[i];
1207- obj->polygon_index = indexMap[obj->polygon_index];
1208- }
1209- //削除
1210- hpl::aleph::removeIndexInVector(&PolygonList, index);
1211- dynamic_world->polygon_count = (int16)PolygonList.size();
1212- return true;
1213-}
1214-bool hpl::aleph::map::deleteMapSavedObject(int index)
1215-{
1216- //TODO
1217- if(index < 0 || index >= (int)SavedObjectList.size()){
1218- return false;
1219- }
1220- //削除
1221- hpl::aleph::removeIndexInVector(&SavedObjectList, index);
1222- return true;
1223-}
1224-
12251033 ////////////////////////////////////////////////
12261034 //////// objects ///////////////////////////////
12271035 /**
--- marathon/trunk/HPLLib/HPLStockManager.cpp (revision 343)
+++ marathon/trunk/HPLLib/HPLStockManager.cpp (revision 344)
@@ -1,11 +1,12 @@
11 #include "HPLStockManager.h"
2+#include "HPLMapTool.h"
23
34 #include "map.h"
45
5-hpl::aleph::HPLStockManagerHPLStockManager()
6+hpl::aleph::HPLStockManager::HPLStockManager()
67 {
78 }
8-hpl::aleph::HPLStockManager~HPLStockManager()
9+hpl::aleph::HPLStockManager::~HPLStockManager()
910 {
1011 }
1112
@@ -32,7 +33,7 @@
3233 {
3334 this->polygonValidity.clear();
3435 for(int i = 0; i < (int)PolygonList.size(); i ++){
35- bool isValid = hpl::aleph::map::isValidPolygon(i);
36+ bool isValid = hpl::aleph::map::isValidPolygon(i);
3637 this->polygonValidity.push_back(isValid);
3738 }
3839
@@ -130,7 +131,7 @@
130131 endpoint_data* ep = get_endpoint_data(i);
131132 if(ep->supporting_polygon_index != NONE){
132133 assert(get_polygon_data(ep->supporting_polygon_index));
133- if(delPolygon[ep->supporting_polygon_index]){
134+ if(delPolygons[ep->supporting_polygon_index]){
134135 //関連ポリゴンが消されるならば対応を切っておく
135136 ep->supporting_polygon_index = NONE;
136137 }
@@ -142,7 +143,7 @@
142143 for(int i = 0; i < (int)delLines.size(); i ++){
143144 line_data* line = get_line_data(i);
144145 assert(line);
145- if(delLine[i]){
146+ if(delLines[i]){
146147 //関連するポリゴンを削除する
147148 if(line->clockwise_polygon_owner != NONE){
148149 assert(get_polygon_data(line->clockwise_polygon_owner));
@@ -155,11 +156,11 @@
155156 //線のSideを消す
156157 if(line->clockwise_polygon_side_index != NONE){
157158 assert(get_side_data(line->clockwise_polygon_side_index));
158- delSide[line->clockwise_polygon_side_index] = true;
159+ delSides[line->clockwise_polygon_side_index] = true;
159160 }
160161 if(line->counterclockwise_polygon_side_index != NONE){
161162 assert(get_side_data(line->counterclockwise_polygon_side_index));
162- delSide[line->counterclockwise_polygon_side_index] = true;
163+ delSides[line->counterclockwise_polygon_side_index] = true;
163164 }
164165 }else{
165166 //残る
@@ -227,6 +228,22 @@
227228 }
228229 }
229230 }
231+
232+ //乗っているオブジェクトが一つもない場合はfirst_objectをNONEにする
233+ if(delObjects[poly->first_object]){
234+ int firstObjIndex = NONE;
235+ for(int j = 0; j < (int)SavedObjectList.size(); j ++){
236+ if(!delObjects[j]){
237+ map_object* obj = &SavedObjectList[j];
238+ assert(obj);
239+ if(obj->polygon_index == i){
240+ firstObjIndex = j;
241+ break;
242+ }
243+ }
244+ }
245+ poly->first_object = firstObjIndex;
246+ }
230247 }
231248 }
232249
@@ -269,24 +286,29 @@
269286 {
270287 assert(get_endpoint_data(index));
271288 this->delPoints[index] = true;
289+ return true;
272290 }
273291 bool hpl::aleph::HPLStockManager::deleteLine(int index)
274292 {
275293 assert(get_line_data(index));
276294 this->delLines[index] = true;
295+ return true;
277296 }
278297 bool hpl::aleph::HPLStockManager::deletePolygon(int index)
279298 {
280299 assert(get_polygon_data(index));
281300 this->delPolygons[index] = true;
301+ return true;
282302 }
283303 bool hpl::aleph::HPLStockManager::deleteSide(int index)
284304 {
285305 assert(get_side_data(index));
286306 this->delSides[index] = true;
307+ return true;
287308 }
288309 bool hpl::aleph::HPLStockManager::deleteObject(int index)
289310 {
290311 assert(index >= 0 && index < SavedObjectList.size());
291312 this->delObjects[index] = true;
313+ return true;
292314 }
--- marathon/trunk/HPLLib/HPLMapTool.h (revision 343)
+++ marathon/trunk/HPLLib/HPLMapTool.h (revision 344)
@@ -334,7 +334,7 @@
334334 int addAnnotation(map_annotation annotation);
335335
336336 //TODO
337- int getEndpointIndexFromAddress(endpoint_data* ep);
337+ //int getEndpointIndexFromAddress(endpoint_data* ep);
338338
339339 /**
340340 簡略バージョン
旧リポジトリブラウザで表示