49IMPLEMENT_DYNCREATE(
WbView, CView)
79BEGIN_MESSAGE_MAP(
WbView, CView)
92 ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
93 ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateEditCopy)
94 ON_COMMAND(ID_EDIT_CUT, OnEditCut)
95 ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnUpdateEditCut)
96 ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
97 ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, OnUpdateEditPaste)
104 ON_COMMAND(ID_EDIT_REPLACE, OnEditReplace)
163void WbView::AssertValid()
const
165 CView::AssertValid();
168void WbView::Dump(CDumpContext& dc)
const
191 if (
WbApp()->getCurTool()) {
200 while (::PeekMessage(&
msg, m_hWnd, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE)) {
201 viewPt.x = (short)LOWORD(
msg.lParam);
202 viewPt.y = (short)HIWORD(
msg.lParam);
203 DEBUG_LOG((
"Peek mouse %d, %d\n", viewPt.x, viewPt.y));
214 if (
WbApp()->getCurTool()) {
240 Int totalObjects = 0;
241 Int totalWaypoints = 0;
249 if (!(pObj->
isWaypoint() || (flags & flagsWeDontWant) != 0))
269 CString str, str2, str3;
274 str.Format(
"%d object(s), ", totalObjects);
276 str2.Format(
"%d waypoint(s), ", totalWaypoints);
277 str3.Format(
"(%.2f,%.2f), height %.2f", cpt.
x, cpt.
y, height);
282 numSel.Format(
"(%d selected) ", numSelected);
288 const char *pFullName = pObj->
getName().
str();
292 if (*pFullName ==
'/') {
302 obj.Format(
" - object %s(%.2f,%.2f)", objectID.
str(), loc.
x, loc.
y);
304 obj.Format(
" - object %s(%.2f,%.2f)", pName, loc.
x, loc.
y);
311 colorStr.Format(
"{r%f,g%f,b%f}", color.
red,color.
green,color.
blue);
323 if (GetCapture() ==
this)
329 if (
WbApp()->getCurTool()) {
437 if (pMap==
NULL)
return;
453 if (nHitTest == HTCLIENT) {
456 if (
WbApp()->getCurTool()) {
461 ::SetCursor(::LoadCursor(
NULL, IDC_ARROW));
466 return(CView::OnSetCursor(pWnd, nHitTest, message));
518 if (pMapObj2==
NULL)
break;
592 if (pView !=
NULL && pView !=
this) {
607 pCmdUI->Enable(pTheCopy !=
NULL);
624 if (pMap==
NULL)
return;
630 if (pMap==
NULL)
return;
636 if (pMap==
NULL)
return;
643 if (pMap==
NULL)
return;
647 if (pObj->isSelected()) {
665 if (dlg.DoModal() == IDOK) {
681 Bool reflects =
false;
682 Bool multiple =
false;
691 if (!first && !reflects) {
696 if (!first && reflects) {
703 if (reflects) val = 1;
704 if (multiple) val = 2;
705 pCmdUI->SetCheck(val);
710 Bool reflects =
false;
802 if (editor.DoModal() == IDOK)
927 if (pView !=
NULL && pView !=
this) {
928 pView->Invalidate(
false);
941 Bool anyFixes =
false;
950 for (j=0; j<i; j++) {
956 AfxMessageBox(
msg, MB_OK);
975 AfxMessageBox(
msg, MB_OK);
1010 DEBUG_LOG((
"Side '%s' could not be found in sides list!\n", teamOwner.
str()));
1023 warning.
format(
"Object '%s' named '%s' on team '%s' - team doesn't exist. Select player for object...",
1024 tmplName.
str(), name.
str(), teamName.
str());
1027 ::AfxMessageBox(warning.
str(), MB_OK);
1030 if (fix.DoModal() == IDOK) {
1058 if (pView !=
NULL && pView !=
this) {
1059 pView->Invalidate(
false);
1082 return CView::OnCreate(lpcs);
BaseHeightMapRenderObjClass * TheTerrainRenderObject
The one-of for the terrain rendering object.
#define DEBUG_ASSERTCRASH(c, m)
HWND ApplicationHWnd
our application window handle
#define MAIN_FRAME_SECTION
@ FLAG_ROAD_POINT1
If set, is the first point in a road segment.
@ FLAG_ROAD_POINT2
If set, is the second point in a road segment.
@ FLAG_ROAD_JOIN
If set, this road end does a generic alpha join.
@ FLAG_DRAWS_IN_MIRROR
If set, draws in water mirror.
@ FLAG_ROAD_FLAGS
If nonzero, object is a road piece.
@ FLAG_ROAD_CORNER_ANGLED
If set, the road corner is angled rather than curved.
@ FLAG_BRIDGE_FLAGS
If nonzero, object is a bridge piece.
SidesList * TheSidesList
singleton instance of SidesList
CWorldBuilderApp * WbApp()
void concat(const AsciiString &stringSrc)
int compare(const AsciiString &stringSrc) const
void set(const AsciiString &stringSrc)
static AsciiString TheEmptyString
void format(AsciiString format,...)
AsciiString getSelectedOwner()
static CMainFrame * GetMainFrame()
void OnEditGloballightoptions()
void setMapObjPasteList(MapObject *list)
Note - the app owns this, and will delete it on close.
MapObject * getMapObjPasteList(void)
Note - read only data - make yourself a copy.
void updateCurTool(Bool forceHand)
Check to see if any keyboard overrides are changing the current tool.
static CWorldBuilderDoc * GetActiveDoc()
void AddAndDoUndoable(Undoable *pUndo)
WorldHeightMapEdit * GetHeightMap()
static CWorldBuilderView * GetActive2DView()
void setAsciiString(NameKeyType key, const AsciiString &value)
AsciiString getAsciiString(NameKeyType key, Bool *exists=NULL) const
static std::string TheActiveLayerName
MapObject * duplicate(void)
Allocates a copy. Caller is responsible for delete-ing this when done with it.
const Coord3D * getLocation(void) const
Get the center point.
const ThingTemplate * getThingTemplate(void) const
void setSelected(Bool sel)
Dict * getProperties()
return the object's property sheet.
static MapObject * getFirstMapObject(void)
Bool isScorch(void) const
Bool getFlag(Int flag) const
AsciiString getName(void) const
Gets the object name.
void setNextMap(MapObject *nextMap)
Link the next map object.
Bool isWaypoint(void) const
MapObject * getNext(void) const
Next map object in the list. Not a copy, don't delete it.
Bool isSelected(void) const
static Dict * getWorldDict()
void SetThingTemplate(const ThingTemplate *thing)
const ThingTemplate * getPickedThing(void)
void SetAllowableType(EditorSortingType sort)
void SetFactionOnly(Bool faction)
const AsciiString & getName() const
return the name of this template
EditorSortingType getEditorSorting() const
get the editor sorting
afx_msg void OnUpdatePickWaypoints(CCmdUI *pCmdUI)
afx_msg void OnUpdateEditPaste(CCmdUI *pCmdUI)
afx_msg void OnViewSnaptogrid()
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
afx_msg BOOL OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message)
afx_msg int OnCreate(LPCREATESTRUCT lpcs)
afx_msg void OnViewShowObjects()
Bool m_showObjects
Flag whether object icons are drawn in the 2d and 3d view.
afx_msg void OnEditPlayerlist()
afx_msg void OnLockHorizontal()
afx_msg void OnEditGloballightoptions()
CWorldBuilderDoc * WbDoc()
afx_msg void OnUpdateViewShowpolygontriggers(CCmdUI *pCmdUI)
afx_msg void OnPickManMade()
afx_msg void OnUpdatePickDebris(CCmdUI *pCmdUI)
WorldHeightMapEdit * getTrackingHeightMap()
afx_msg void OnEditCopy()
afx_msg void OnEditSelectdup()
void mouseDown(TTrackingMode m, CPoint viewPt)
afx_msg void OnUpdateObjectpropertiesReflectsinmirror(CCmdUI *pCmdUI)
afx_msg void OnUpdateViewShowObjects(CCmdUI *pCmdUI)
afx_msg void OnUpdatePickSounds(CCmdUI *pCmdUI)
afx_msg void OnEditWorldinfo()
afx_msg void OnViewShowpolygontriggers()
afx_msg void OnUpdatePickRoads(CCmdUI *pCmdUI)
virtual MapObject * picked3dObjectInView(CPoint viewPt)
afx_msg void OnValidationFixTeams()
afx_msg void OnMButtonUp(UINT nFlags, CPoint point)
afx_msg void OnViewShowwaypoints()
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
afx_msg void OnPickDebris()
afx_msg void OnUpdatePickShrubbery(CCmdUI *pCmdUI)
afx_msg void OnMButtonDown(UINT nFlags, CPoint point)
virtual TPickedStatus picked(MapObject *pObj, Coord3D docPt)
afx_msg void OnUpdateEditCut(CCmdUI *pCmdUI)
afx_msg void OnUpdatePickVehicles(CCmdUI *pCmdUI)
Bool m_doLockAngle
True if we are currently locking.
afx_msg void OnPickAnything()
afx_msg void OnEditPaste()
Bool m_lockAngle
Reflects the ui button.
void mouseMove(TTrackingMode m, CPoint viewPt)
virtual Bool viewToDocCoords(CPoint curPt, Coord3D *newPt, Bool constrained=true)
afx_msg void OnEditSelectsimilar()
afx_msg void OnShowTerrain()
afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI)
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
afx_msg void OnUpdatePickAnything(CCmdUI *pCmdUI)
afx_msg void OnPickRoads()
afx_msg void OnEditTeamlist()
Coord3D m_mouseDownDocPoint
afx_msg void OnUpdateLockVertical(CCmdUI *pCmdUI)
void mouseUp(TTrackingMode m, CPoint viewPt)
afx_msg void OnUpdatePickManMade(CCmdUI *pCmdUI)
afx_msg void OnObjectpropertiesReflectsinmirror()
Bool m_showNames
Flag whether names are drawn in the 2d and 3d view.
afx_msg void OnUpdateViewSnaptogrid(CCmdUI *pCmdUI)
afx_msg void OnEditDelete()
EditorSortingType m_pickConstraint
afx_msg void OnPickNatural()
TTrackingMode m_trackingMode
afx_msg void OnPickVehicles()
afx_msg void OnPickStructures()
afx_msg void OnUpdateShowNames(CCmdUI *pCmdUI)
afx_msg void OnUpdateLockHorizontal(CCmdUI *pCmdUI)
Bool m_showPolygonTriggers
afx_msg void OnPickInfantry()
afx_msg void OnUpdateShowTerrain(CCmdUI *pCmdUI)
afx_msg void OnPickWaypoints()
afx_msg void OnPickSounds()
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
Bool m_showTerrain
Flag whether terrain is rendered or not. (Useful for debugging)
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
afx_msg void OnShowNames()
afx_msg void OnUpdateViewShowwaypoints(CCmdUI *pCmdUI)
afx_msg void OnUpdatePickInfantry(CCmdUI *pCmdUI)
afx_msg void OnEditReplace()
virtual void OnDraw(CDC *pDC)
afx_msg void OnEditSelectinvalidteam()
afx_msg void OnPickShrubbery()
afx_msg void OnUpdatePickStructures(CCmdUI *pCmdUI)
void rulerFeedbackInfo(Coord3D &point1, Coord3D &point2, Real dist)
afx_msg void OnLockVertical()
afx_msg void OnUpdatePickNatural(CCmdUI *pCmdUI)
Bool tooManyTextures(void)
Bool selectDuplicates(void)
Selects any dupicate map objects.
void clearStatus(void)
Status methods.
Bool selectInvalidTeam(void)
Selects any objects with invalid teams.
Bool selectSimilar(void)
Selects any dupicate map objects.
Int getXExtent(void)
number of vertices in x
void getTerrainColorAt(Real x, Real y, RGBColor *pColor)
Int getYExtent(void)
number of vertices in y
#define REF_PTR_RELEASE(x)