Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
CWorldBuilderView Class Reference

#include <WorldBuilderView.h>

Inherits WbView.

Public Member Functions

virtual BOOL PreCreateWindow (CREATESTRUCT &cs)
 
virtual ~CWorldBuilderView ()
 
Int getCellSize (void)
 Get the current draw size in pixels in the 2d window of one height map cell.
 
void setCellSize (Int cellSize)
 Sets the current draw size.
 
Bool getShowContours (void)
 Set whether contours are drawn.
 
void setShowContours (Bool show)
 Set whether contours are drawn.
 
void updateCenterFromMapPoint (Real x, Real y)
 Update the center to match a center point from the 3d view.
 
virtual Bool viewToDocCoords (CPoint curPt, Coord3D *newPt, Bool constrain)
 
virtual Bool docToViewCoords (Coord3D curPt, CPoint *newPt)
 
virtual void setCenterInView (Real x, Real y)
 Set the center for display.
 
virtual void adjustDocSize ()
 the doc has changed size; readjust view as necessary.
 
virtual void invalObjectInView (MapObject *pObj)
 Invalidates an object. Pass NULL to inval all objects.
 
virtual void invalidateCellInView (int xIndex, int yIndex)
 Invalidates the area of one height map cell in the 2d view.
 
virtual void scrollInView (Real x, Real y, Bool end)
 Scrolls the window by this amount (doc coords).
 
- Public Member Functions inherited from WbView
void doRectFeedback (Bool doFeedback, RECT &rect)
 
void doRulerFeedback (int doRulerFeedback)
 
void rulerFeedbackInfo (Coord3D &point1, Coord3D &point2, Real dist)
 
void doLightFeedback (Bool doFeedback, Coord3D direction, Int lightIndex)
 
virtual Bool viewToDocCoordZ (CPoint curPt, Coord3D *newPt, Real Z)
 
virtual void updateHeightMapInView (WorldHeightMap *htMap, Bool partial, const IRegion2D &partialRange)
 Update the height map in the 3d window.
 
virtual void setDefaultCamera ()
 
virtual void rotateCamera (Real delta)
 
virtual void pitchCamera (Real delta)
 
virtual Int getPickPixels (void)
 
virtual EditorSortingType GetPickConstraint (void)
 
CWorldBuilderDocWbDoc ()
 
void snapPoint (Coord3D *thePt)
 
virtual TPickedStatus picked (MapObject *pObj, Coord3D docPt)
 
virtual MapObjectpicked3dObjectInView (CPoint viewPt)
 
virtual BuildListInfopickedBuildObjectInView (CPoint viewPt)
 
Bool isPolygonTriggerVisible (void)
 
Bool isWaypointVisible (void)
 
Bool isNamesVisible (void)
 
void setShowModels (Bool show)
 
Bool getShowModels (void)
 
Bool getShowTerrain (void)
 
void setShowGarrisoned (Bool show)
 
Bool getShowGarrisoned (void)
 
virtual Bool isDoingPitch (void)
 

Protected Member Functions

 CWorldBuilderView ()
 
virtual BOOL OnPreparePrinting (CPrintInfo *pInfo)
 
virtual void OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
 
virtual void OnEndPrinting (CDC *pDC, CPrintInfo *pInfo)
 
virtual void OnDraw (CDC *pDC)
 
void drawMyTexture (CDC *pDc, CRect *pRect, Int width, UnsignedByte *rgbData)
 Draw a texture bitmap in a rectangle in the dc.
 
DWORD getColorForHeight (UnsignedByte ht)
 Get a color for a height value.
 
void drawContours (CDC *pDc, CRgn *pRgn, Int minX, Int maxX, Int minY, Int maxY)
 Draw the contours for the height map in the dc.
 
void interpolate (CPoint *pt, Int ht, CPoint pt1, Int ht1, CPoint pt2, Int ht2)
 Interpolate the point at a given height between 2 points.
 
void drawObjectInView (CDC *pDc, MapObject *pMapObj)
 Draw the object's icon in the dc at a given point.
 
afx_msg void OnPaint ()
 
afx_msg void OnMouseMove (UINT nFlags, CPoint point)
 
afx_msg void OnSize (UINT nType, int cx, int cy)
 
afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
 
afx_msg void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
 
afx_msg void OnShowGrid ()
 
afx_msg void OnUpdateShowGrid (CCmdUI *pCmdUI)
 
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct)
 
afx_msg void OnViewShowtexture ()
 
afx_msg void OnUpdateViewShowtexture (CCmdUI *pCmdUI)
 
- Protected Member Functions inherited from WbView
 WbView ()
 
void mouseDown (TTrackingMode m, CPoint viewPt)
 
void mouseMove (TTrackingMode m, CPoint viewPt)
 
void mouseUp (TTrackingMode m, CPoint viewPt)
 
void constrainCenterPt ()
 
WorldHeightMapEditgetTrackingHeightMap ()
 
virtual ~WbView ()
 
afx_msg void OnRButtonUp (UINT nFlags, CPoint point)
 
afx_msg void OnRButtonDown (UINT nFlags, CPoint point)
 
afx_msg void OnMouseMove (UINT nFlags, CPoint point)
 
afx_msg void OnLButtonUp (UINT nFlags, CPoint point)
 
afx_msg void OnLButtonDown (UINT nFlags, CPoint point)
 
afx_msg void OnMButtonUp (UINT nFlags, CPoint point)
 
afx_msg void OnMButtonDown (UINT nFlags, CPoint point)
 
afx_msg BOOL OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
 
afx_msg void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 
afx_msg void OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags)
 
afx_msg void OnEditDelete ()
 
afx_msg void OnEditCopy ()
 
afx_msg void OnUpdateEditCopy (CCmdUI *pCmdUI)
 
afx_msg void OnEditCut ()
 
afx_msg void OnUpdateEditCut (CCmdUI *pCmdUI)
 
afx_msg void OnEditPaste ()
 
afx_msg void OnUpdateEditPaste (CCmdUI *pCmdUI)
 
afx_msg void OnViewSnaptogrid ()
 
afx_msg void OnUpdateViewSnaptogrid (CCmdUI *pCmdUI)
 
afx_msg void OnViewShowObjects ()
 
afx_msg void OnUpdateViewShowObjects (CCmdUI *pCmdUI)
 
afx_msg void OnEditSelectdup ()
 
afx_msg void OnEditSelectsimilar ()
 
afx_msg void OnEditSelectinvalidteam ()
 
afx_msg void OnEditReplace ()
 
afx_msg void OnObjectpropertiesReflectsinmirror ()
 
afx_msg void OnLockHorizontal ()
 
afx_msg void OnUpdateLockHorizontal (CCmdUI *pCmdUI)
 
afx_msg void OnLockVertical ()
 
afx_msg void OnUpdateLockVertical (CCmdUI *pCmdUI)
 
afx_msg void OnEditGloballightoptions ()
 
afx_msg void OnViewShowwaypoints ()
 
afx_msg void OnUpdateViewShowwaypoints (CCmdUI *pCmdUI)
 
afx_msg void OnViewShowpolygontriggers ()
 
afx_msg void OnUpdateViewShowpolygontriggers (CCmdUI *pCmdUI)
 
afx_msg void OnEditPlayerlist ()
 
afx_msg void OnEditWorldinfo ()
 
afx_msg void OnEditTeamlist ()
 
afx_msg void OnUpdateObjectpropertiesReflectsinmirror (CCmdUI *pCmdUI)
 
afx_msg void OnPickStructures ()
 
afx_msg void OnUpdatePickStructures (CCmdUI *pCmdUI)
 
afx_msg void OnPickInfantry ()
 
afx_msg void OnUpdatePickInfantry (CCmdUI *pCmdUI)
 
afx_msg void OnPickVehicles ()
 
afx_msg void OnUpdatePickVehicles (CCmdUI *pCmdUI)
 
afx_msg void OnPickShrubbery ()
 
afx_msg void OnUpdatePickShrubbery (CCmdUI *pCmdUI)
 
afx_msg void OnPickManMade ()
 
afx_msg void OnUpdatePickManMade (CCmdUI *pCmdUI)
 
afx_msg void OnPickNatural ()
 
afx_msg void OnUpdatePickNatural (CCmdUI *pCmdUI)
 
afx_msg void OnPickDebris ()
 
afx_msg void OnUpdatePickDebris (CCmdUI *pCmdUI)
 
afx_msg void OnPickAnything ()
 
afx_msg void OnUpdatePickAnything (CCmdUI *pCmdUI)
 
afx_msg void OnPickWaypoints ()
 
afx_msg void OnUpdatePickWaypoints (CCmdUI *pCmdUI)
 
afx_msg void OnPickRoads ()
 
afx_msg void OnUpdatePickRoads (CCmdUI *pCmdUI)
 
afx_msg void OnPickSounds ()
 
afx_msg void OnUpdatePickSounds (CCmdUI *pCmdUI)
 
afx_msg void OnShowNames ()
 
afx_msg void OnUpdateShowNames (CCmdUI *pCmdUI)
 
afx_msg void OnValidationFixTeams ()
 
afx_msg void OnShowTerrain ()
 
afx_msg void OnUpdateShowTerrain (CCmdUI *pCmdUI)
 
afx_msg int OnCreate (LPCREATESTRUCT lpcs)
 

Static Protected Member Functions

static Bool isBetween (Int cur, Int first, Int second)
 Compound boolean expression.
 

Protected Attributes

Int m_cellSize
 Size of a height map cell in pixels when drawn in the 2d view.
 
Bool m_showContours
 Flag whether contours are drawn in the 2d view.
 
Bool m_showTexture
 Flag whether textures are drawn in the 2d view.
 
Bool mShowGrid
 Flag whether the gray grid is drawn in the 2d view.
 
Int mXScrollOffset
 The x offset to the upper left corner of the screen.
 
Int mYScrollOffset
 The y offset to the upper left corner of the screen.
 
CPoint m_scrollMin
 The minimum scrollbar positions.
 
CPoint m_scrollMax
 The maximum scroll bar positions.
 
- Protected Attributes inherited from WbView
TTrackingMode m_trackingMode
 
Vector3 m_centerPt
 
Bool m_showObjects
 Flag whether object icons are drawn in the 2d and 3d view.
 
Bool m_showModels
 Flag whether models are drawn in the 2d and 3d view.
 
Bool m_showNames
 Flag whether names are drawn in the 2d and 3d view.
 
Bool m_showGarrisoned
 
Bool m_showWaypoints
 
Bool m_showPolygonTriggers
 
Bool m_showTerrain
 Flag whether terrain is rendered or not. (Useful for debugging)
 
Real m_hysteresis
 
Bool m_lockAngle
 Reflects the ui button.
 
Bool m_doLockAngle
 True if we are currently locking.
 
CPoint m_mouseDownPoint
 
Coord3D m_mouseDownDocPoint
 
RECT m_feedbackBox
 
Bool m_doRectFeedback
 
int m_doRulerFeedback
 
Coord3D m_rulerPoints [2]
 
Real m_rulerLength
 
Coord3D m_lightDirection [3]
 
Bool m_doLightFeedback
 
EditorSortingType m_pickConstraint
 

Additional Inherited Members

- Static Protected Attributes inherited from WbView
static Bool m_snapToGrid = false
 

Detailed Description

Definition at line 40 of file WorldBuilderView.h.

Constructor & Destructor Documentation

◆ CWorldBuilderView()

CWorldBuilderView::CWorldBuilderView ( )
protected

Definition at line 74 of file WorldBuilderView.cpp.

◆ ~CWorldBuilderView()

CWorldBuilderView::~CWorldBuilderView ( )
virtual

Definition at line 97 of file WorldBuilderView.cpp.

Member Function Documentation

◆ adjustDocSize()

void CWorldBuilderView::adjustDocSize ( )
virtual

the doc has changed size; readjust view as necessary.

Reimplemented from WbView.

Definition at line 807 of file WorldBuilderView.cpp.

◆ docToViewCoords()

Bool CWorldBuilderView::docToViewCoords ( Coord3D curPt,
CPoint * newPt )
virtual

Reimplemented from WbView.

Definition at line 1070 of file WorldBuilderView.cpp.

◆ drawContours()

void CWorldBuilderView::drawContours ( CDC * pDc,
CRgn * pRgn,
Int minX,
Int maxX,
Int minY,
Int maxY )
protected

Draw the contours for the height map in the dc.

Draws the height contours on the map. Called by OnPaint.

Definition at line 543 of file WorldBuilderView.cpp.

◆ drawMyTexture()

void CWorldBuilderView::drawMyTexture ( CDC * pDc,
CRect * pRect,
Int width,
UnsignedByte * rgbData )
protected

Draw a texture bitmap in a rectangle in the dc.

Draws the tile data rgbData at pRect. The tile data is square 4 byte data, width pixels wide and tall.

Definition at line 759 of file WorldBuilderView.cpp.

◆ drawObjectInView()

void CWorldBuilderView::drawObjectInView ( CDC * pDc,
MapObject * pMapObj )
protected

Draw the object's icon in the dc at a given point.

Draws the icon for an object at a given location. Called by OnPaint.

Definition at line 452 of file WorldBuilderView.cpp.

◆ getCellSize()

Int CWorldBuilderView::getCellSize ( void )
inline

Get the current draw size in pixels in the 2d window of one height map cell.

Definition at line 108 of file WorldBuilderView.h.

◆ getColorForHeight()

DWORD CWorldBuilderView::getColorForHeight ( UnsignedByte ht)
protected

Get a color for a height value.

Gets the color for a given height in the height map. Used when we are not displaying terrain, and for the contour lines.

Definition at line 189 of file WorldBuilderView.cpp.

◆ getShowContours()

Bool CWorldBuilderView::getShowContours ( void )
inline

Set whether contours are drawn.

Definition at line 114 of file WorldBuilderView.h.

◆ interpolate()

void CWorldBuilderView::interpolate ( CPoint * pt,
Int ht,
CPoint pt1,
Int ht1,
CPoint pt2,
Int ht2 )
protected

Interpolate the point at a given height between 2 points.

Given 2 points, pt1 and pt2, with different height valus ht1 and ht2, determines where the height ht occurs along the line.

Definition at line 736 of file WorldBuilderView.cpp.

◆ invalidateCellInView()

void CWorldBuilderView::invalidateCellInView ( int xIndex,
int yIndex )
virtual

Invalidates the area of one height map cell in the 2d view.

Invalidates the pixel area for the height map call at a particular location.

Reimplemented from WbView.

Definition at line 785 of file WorldBuilderView.cpp.

◆ invalObjectInView()

void CWorldBuilderView::invalObjectInView ( MapObject * pMapObj)
virtual

Invalidates an object. Pass NULL to inval all objects.

Causes the bounds of an object to be invalidated.

Reimplemented from WbView.

Definition at line 417 of file WorldBuilderView.cpp.

◆ isBetween()

static Bool CWorldBuilderView::isBetween ( Int cur,
Int first,
Int second )
inlinestaticprotected

Compound boolean expression.

Definition at line 93 of file WorldBuilderView.h.

◆ OnBeginPrinting()

void CWorldBuilderView::OnBeginPrinting ( CDC * pDC,
CPrintInfo * pInfo )
protectedvirtual

Definition at line 129 of file WorldBuilderView.cpp.

◆ OnCreate()

int CWorldBuilderView::OnCreate ( LPCREATESTRUCT lpCreateStruct)
protected

Definition at line 106 of file WorldBuilderView.cpp.

◆ OnDraw()

void CWorldBuilderView::OnDraw ( CDC * pDC)
protectedvirtual

Reimplemented from WbView.

Definition at line 114 of file WorldBuilderView.cpp.

◆ OnEndPrinting()

void CWorldBuilderView::OnEndPrinting ( CDC * pDC,
CPrintInfo * pInfo )
protectedvirtual

Definition at line 133 of file WorldBuilderView.cpp.

◆ OnHScroll()

void CWorldBuilderView::OnHScroll ( UINT nSBCode,
UINT nPos,
CScrollBar * pScrollBar )
protected

Standard window handler method for when the horizontal scroll bar is used.

Definition at line 889 of file WorldBuilderView.cpp.

◆ OnMouseMove()

afx_msg void CWorldBuilderView::OnMouseMove ( UINT nFlags,
CPoint point )
protected

◆ OnPaint()

void CWorldBuilderView::OnPaint ( )
protected

This draws the window.

Definition at line 262 of file WorldBuilderView.cpp.

◆ OnPreparePrinting()

BOOL CWorldBuilderView::OnPreparePrinting ( CPrintInfo * pInfo)
protectedvirtual

Definition at line 123 of file WorldBuilderView.cpp.

◆ OnShowGrid()

void CWorldBuilderView::OnShowGrid ( )
protected

Toggles the show grid flag and invals the window.

Definition at line 953 of file WorldBuilderView.cpp.

◆ OnSize()

void CWorldBuilderView::OnSize ( UINT nType,
int cx,
int cy )
protected

Standard window handler method for when the window size changes.

Definition at line 855 of file WorldBuilderView.cpp.

◆ OnUpdateShowGrid()

void CWorldBuilderView::OnUpdateShowGrid ( CCmdUI * pCmdUI)
protected

Sets the check in the menu to match the show grid flag.

Definition at line 961 of file WorldBuilderView.cpp.

◆ OnUpdateViewShowtexture()

void CWorldBuilderView::OnUpdateViewShowtexture ( CCmdUI * pCmdUI)
protected

Sets the check in the menu to match the show texture flag.

Definition at line 997 of file WorldBuilderView.cpp.

◆ OnViewShowtexture()

void CWorldBuilderView::OnViewShowtexture ( )
protected

Toggles the show texture flag and invals the window.

Definition at line 989 of file WorldBuilderView.cpp.

◆ OnVScroll()

void CWorldBuilderView::OnVScroll ( UINT nSBCode,
UINT nPos,
CScrollBar * pScrollBar )
protected

Standard window handler method for when the vertical scroll bar is used.

Definition at line 868 of file WorldBuilderView.cpp.

◆ PreCreateWindow()

BOOL CWorldBuilderView::PreCreateWindow ( CREATESTRUCT & cs)
virtual

Definition at line 101 of file WorldBuilderView.cpp.

◆ scrollInView()

void CWorldBuilderView::scrollInView ( Real xScroll,
Real yScroll,
Bool end )
virtual

Scrolls the window by this amount (doc coords).

Scrolls the window.

Reimplemented from WbView.

Definition at line 910 of file WorldBuilderView.cpp.

◆ setCellSize()

void CWorldBuilderView::setCellSize ( Int cellSize)

Sets the current draw size.

Set the cell size, and invalidate.

Definition at line 154 of file WorldBuilderView.cpp.

◆ setCenterInView()

void CWorldBuilderView::setCenterInView ( Real x,
Real y )
virtual

Set the center for display.

Reimplemented from WbView.

Definition at line 163 of file WorldBuilderView.cpp.

◆ setShowContours()

void CWorldBuilderView::setShowContours ( Bool show)

Set whether contours are drawn.

Set the show contours flag, and invalidate.

Definition at line 174 of file WorldBuilderView.cpp.

◆ updateCenterFromMapPoint()

void CWorldBuilderView::updateCenterFromMapPoint ( Real x,
Real y )

Update the center to match a center point from the 3d view.

◆ viewToDocCoords()

Bool CWorldBuilderView::viewToDocCoords ( CPoint curPt,
Coord3D * newPt,
Bool constrain )
virtual

Reimplemented from WbView.

Definition at line 1030 of file WorldBuilderView.cpp.

Member Data Documentation

◆ m_cellSize

Int CWorldBuilderView::m_cellSize
protected

Size of a height map cell in pixels when drawn in the 2d view.

Definition at line 70 of file WorldBuilderView.h.

◆ m_scrollMax

CPoint CWorldBuilderView::m_scrollMax
protected

The maximum scroll bar positions.

Definition at line 79 of file WorldBuilderView.h.

◆ m_scrollMin

CPoint CWorldBuilderView::m_scrollMin
protected

The minimum scrollbar positions.

Definition at line 78 of file WorldBuilderView.h.

◆ m_showContours

Bool CWorldBuilderView::m_showContours
protected

Flag whether contours are drawn in the 2d view.

Definition at line 71 of file WorldBuilderView.h.

◆ m_showTexture

Bool CWorldBuilderView::m_showTexture
protected

Flag whether textures are drawn in the 2d view.

Definition at line 73 of file WorldBuilderView.h.

◆ mShowGrid

Bool CWorldBuilderView::mShowGrid
protected

Flag whether the gray grid is drawn in the 2d view.

Definition at line 74 of file WorldBuilderView.h.

◆ mXScrollOffset

Int CWorldBuilderView::mXScrollOffset
protected

The x offset to the upper left corner of the screen.

Definition at line 76 of file WorldBuilderView.h.

◆ mYScrollOffset

Int CWorldBuilderView::mYScrollOffset
protected

The y offset to the upper left corner of the screen.

Definition at line 77 of file WorldBuilderView.h.


The documentation for this class was generated from the following files: