Cafu Engine
ViewWindow2DT Class Reference
Inheritance diagram for ViewWindow2DT:

Classes

class  MouseGrabT
 This class defines if the associated view is currently being grabbed (for scrolling) with the mouse. More...
 

Public Member Functions

 ViewWindow2DT (wxWindow *Parent, ChildFrameT *ChildFrame, ViewTypeT InitialViewType)
 The constructor. More...
 
void NotifySubjectChanged (SubjectT *Subject, MapDocOtherDetailT OtherDetail)
 Notifies the observer that some other detail than those specifically addressed below has changed. More...
 
void NotifySubjectChanged_Selection (SubjectT *Subject, const ArrayT< MapElementT * > &OldSelection, const ArrayT< MapElementT * > &NewSelection)
 Notifies the observer that the selection in the current subject has been changed. More...
 
void NotifySubjectChanged_Created (SubjectT *Subject, const ArrayT< IntrusivePtrT< cf::GameSys::EntityT > > &Entities)
 Notifies the observer that one or more entities have been created. More...
 
void NotifySubjectChanged_Created (SubjectT *Subject, const ArrayT< MapPrimitiveT * > &Primitives)
 Notifies the observer that one or more map primitives have been created. More...
 
void NotifySubjectChanged_Deleted (SubjectT *Subject, const ArrayT< IntrusivePtrT< cf::GameSys::EntityT > > &Entities)
 Notifies the observer that one or more entities have been deleted. More...
 
void NotifySubjectChanged_Deleted (SubjectT *Subject, const ArrayT< MapPrimitiveT * > &Primitives)
 Notifies the observer that one or more map primitives have been deleted. More...
 
void NotifySubjectChanged_Modified (SubjectT *Subject, const ArrayT< MapElementT * > &MapElements, MapElemModDetailE Detail)
 
void NotifySubjectChanged_Modified (SubjectT *Subject, const ArrayT< MapElementT * > &MapElements, MapElemModDetailE Detail, const ArrayT< BoundingBox3fT > &OldBounds)
 
void Notify_EntChanged (SubjectT *Subject, const ArrayT< IntrusivePtrT< MapEditor::CompMapEntityT > > &Entities, EntityModDetailE Detail)
 
void Notify_VarChanged (SubjectT *Subject, const cf::TypeSys::VarBaseT &Var)
 Notifies the observer that a variable has changed. More...
 
void NotifySubjectChanged (ToolsSubjectT *Subject, ToolT *Tool, ToolsUpdatePriorityT Priority)
 Notifies the observer that the current subject has been changed. More...
 
wxWindow * GetWindow ()
 This function is not const because we can mutate this(!) object via the returned pointer. More...
 
ViewTypeT GetViewType () const
 Returns the view type of this view window. More...
 
AxesInfoT GetAxesInfo () const
 This method returns the axes info for this window. In the case of a 3D window, it computes the 2D axes info that this view is closest to. More...
 
void SetZoom (float NewZoom)
 
float GetZoom () const
 
void CenterView (const Vector3fT &Point)
 
ArrayT< MapElementT * > GetElementsAt (const wxPoint &Pixel, int Radius=3) const
 This method returns all visible map elements at the given pixel in the 2D view window. More...
 
wxPoint GetScrollPosXY () const
 Conveniently return the positions of both scroll bars in a wxPoint. More...
 
wxPoint GetScrollRangeXY () const
 Conveniently return the ranges of both scroll bars in a wxPoint. More...
 
wxPoint GetClientCenter () const
 Returns the center point of the client area of this window. More...
 
wxPoint WindowToTool (const wxPoint &p) const
 Transforms point p from window to tool coordinates/space. This is the inverse of ToolToWindow(). More...
 
wxPoint ToolToWindow (const wxPoint &p) const
 Transforms point p from tool to window coordinates/space. This is the inverse of WindowToTool(). More...
 
Vector3fT ToolToWorld (const wxPoint &p, float Third) const
 Transforms point p from tool to world coordinates/space. This is the inverse of WorldToTool(). The value for the third axis of the returned vector is set to Third. More...
 
wxPoint WorldToTool (const Vector3fT &v) const
 Transforms vector v from world to tool coordinates/space. This is the inverse of ToolToWorld(). More...
 
Vector3fT WindowToWorld (const wxPoint &p, float Third) const
 Transforms point p from window to world coordinates/space. This is the inverse of WorldToWindow(), and equivalent to calling ToolToWorld(WindowToTool(p)). The value for the third axis of the returned vector is set to Third. More...
 
wxPoint WorldToWindow (const Vector3fT &v) const
 Transforms vector v from world to window coordinates/space. This is the inverse of WindowToWorld(), and equivalent to calling ToolToWindow(WorldToTool(p)). More...
 
- Public Member Functions inherited from ViewWindowT
void NotifySubjectDies (SubjectT *dyingSubject)
 This method is called whenever a subject is about the be destroyed (and become unavailable). More...
 
wxString GetCaption () const
 Returns the caption that the AUI pane for this window should have. More...
 
ChildFrameTGetChildFrame () const
 Returns the child frame that owns this view (that is, our parent). More...
 
MapDocumentTGetMapDoc () const
 The document that is associated with this view window (or more precisely, our child frame). More...
 
- Public Member Functions inherited from ObserverT
virtual void NotifySubjectChanged_Groups (SubjectT *Subject)
 Notifies the observer that the groups in the current subject have been changed (new group added, group deleted, visibility changed, anything). More...
 
virtual ~ObserverT ()
 The virtual destructor. More...
 
- Public Member Functions inherited from ToolsObserverT
virtual ~ToolsObserverT ()
 The virtual destructor. More...
 

Static Public Member Functions

static bool RectIsIntersected (const wxRect &Rect, const wxPoint &A, const wxPoint &B)
 Determines whether the given rectangle Rect is intersected by the line segment through points A and B. More...
 

Additional Inherited Members

- Public Types inherited from ViewWindowT
enum  ViewTypeT {
  VT_2D_XY, VT_2D_XZ, VT_2D_YZ, VT_3D_WIREFRAME,
  VT_3D_FLAT, VT_3D_EDIT_MATS, VT_3D_FULL_MATS, VT_3D_LM_GRID,
  VT_3D_LM_PREVIEW
}
 
- Protected Member Functions inherited from ViewWindowT
 ViewWindowT (ChildFrameT *ChildFrame)
 The constructor. It is protected because only child classes should ever be instantiated. More...
 
virtual ~ViewWindowT ()
 The destructor. Virtual such that also the child destructors will be called. More...
 
void UpdateChildFrameMRU ()
 
- Protected Member Functions inherited from ObserverT
 ObserverT ()
 The constructor. It is protected so that only derived classes can create instances of this class. More...
 
- Protected Member Functions inherited from ToolsObserverT
 ToolsObserverT ()
 The constructor. It is protected so that only derived classes can create instances of this class. More...
 
- Protected Attributes inherited from ViewWindowT
ChildFrameTm_ChildFrame
 The child frame that owns us (that is, is our parent). More...
 

Constructor & Destructor Documentation

ViewWindow2DT::ViewWindow2DT ( wxWindow *  Parent,
ChildFrameT ChildFrame,
ViewTypeT  InitialViewType 
)

The constructor.

Member Function Documentation

AxesInfoT ViewWindow2DT::GetAxesInfo ( ) const
inlinevirtual

This method returns the axes info for this window. In the case of a 3D window, it computes the 2D axes info that this view is closest to.

Implements ViewWindowT.

wxPoint ViewWindow2DT::GetClientCenter ( ) const
inline

Returns the center point of the client area of this window.

ArrayT< MapElementT * > ViewWindow2DT::GetElementsAt ( const wxPoint &  Pixel,
int  Radius = 3 
) const

This method returns all visible map elements at the given pixel in the 2D view window.

More precisely, all visible map elements that intersect the disc centered around Pixel with radius Radius are returned.

Parameters
PixelThe pixel in window coordinates for which the map elements are to be found.
RadiusThe error tolerance around Pixel within which map elements also count as "at Pixel".
Returns
The array of visible map elements that are at the given disc (in no particular order).
wxPoint ViewWindow2DT::GetScrollPosXY ( ) const
inline

Conveniently return the positions of both scroll bars in a wxPoint.

wxPoint ViewWindow2DT::GetScrollRangeXY ( ) const
inline

Conveniently return the ranges of both scroll bars in a wxPoint.

ViewTypeT ViewWindow2DT::GetViewType ( ) const
inlinevirtual

Returns the view type of this view window.

Implements ViewWindowT.

wxWindow * ViewWindow2DT::GetWindow ( )
virtual

This function is not const because we can mutate this(!) object via the returned pointer.

Implements ViewWindowT.

void ViewWindow2DT::Notify_EntChanged ( SubjectT Subject,
const ArrayT< IntrusivePtrT< MapEditor::CompMapEntityT > > &  Entities,
EntityModDetailE  Detail 
)
virtual
Parameters
SubjectThe map document in which the entities have been modified.
EntitiesList of modified map entities.
DetailInformation about what has been modified.

Reimplemented from ObserverT.

void ViewWindow2DT::Notify_VarChanged ( SubjectT Subject,
const cf::TypeSys::VarBaseT Var 
)
virtual

Notifies the observer that a variable has changed.

Parameters
SubjectThe map document in which a variable has changed.
VarThe variable whose value has changed.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged ( SubjectT Subject,
MapDocOtherDetailT  OtherDetail 
)
virtual

Notifies the observer that some other detail than those specifically addressed below has changed.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged ( ToolsSubjectT Subject,
ToolT Tool,
ToolsUpdatePriorityT  Priority 
)
virtual

Notifies the observer that the current subject has been changed.

Parameters
SubjectThe tools (tool manager) in which something has changed.
ToolThe specific tool that has changed.
PriorityThe priority with which the update should be implemented.

Reimplemented from ToolsObserverT.

void ViewWindow2DT::NotifySubjectChanged_Created ( SubjectT Subject,
const ArrayT< IntrusivePtrT< cf::GameSys::EntityT > > &  Entities 
)
virtual

Notifies the observer that one or more entities have been created.

Parameters
SubjectThe map document in which the entities have been created.
EntitiesList of created entities.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged_Created ( SubjectT Subject,
const ArrayT< MapPrimitiveT * > &  Primitives 
)
virtual

Notifies the observer that one or more map primitives have been created.

Parameters
SubjectThe map document in which the primitives have been created.
PrimitivesList of created map primitives.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged_Deleted ( SubjectT Subject,
const ArrayT< IntrusivePtrT< cf::GameSys::EntityT > > &  Entities 
)
virtual

Notifies the observer that one or more entities have been deleted.

Parameters
SubjectThe map document in which the entities have been deleted.
EntitiesList of deleted entities.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged_Deleted ( SubjectT Subject,
const ArrayT< MapPrimitiveT * > &  Primitives 
)
virtual

Notifies the observer that one or more map primitives have been deleted.

Parameters
SubjectThe map document in which the primitives have been deleted.
PrimitivesList of deleted map primitives.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged_Modified ( SubjectT Subject,
const ArrayT< MapElementT * > &  MapElements,
MapElemModDetailE  Detail 
)
virtual
Parameters
SubjectThe map document in which the elements have been modified.
MapElementsList of modified map elements.
DetailInformation about what has been modified: Can be one of MEMD_PRIMITIVE_PROPS_CHANGED, MEMD_GENERIC, MEMD_ASSIGN_PRIM_TO_ENTITY and MEMD_MATERIAL_CHANGED.

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged_Modified ( SubjectT Subject,
const ArrayT< MapElementT * > &  MapElements,
MapElemModDetailE  Detail,
const ArrayT< BoundingBox3fT > &  OldBounds 
)
virtual
Parameters
SubjectThe map document in which the elements have been modified.
MapElementsList of modified map elements.
DetailInformation about what has been modified: Can be MEMD_TRANSFORM or MEMD_PRIMITIVE_PROPS_CHANGED. In the case of MEMD_PRIMITIVE_PROPS_CHANGED one can assume that only map primitives (no entities) are in the MapElements array.
OldBoundsHolds the bounds of each objects BEFORE the modification (has the same size as MapElements).

Reimplemented from ObserverT.

void ViewWindow2DT::NotifySubjectChanged_Selection ( SubjectT Subject,
const ArrayT< MapElementT * > &  OldSelection,
const ArrayT< MapElementT * > &  NewSelection 
)
virtual

Notifies the observer that the selection in the current subject has been changed.

Parameters
SubjectThe map document in which the selection has been changed.
OldSelectionArray of the previously selected objects.
NewSelectionArray of the new selected objects.

Reimplemented from ObserverT.

bool ViewWindow2DT::RectIsIntersected ( const wxRect &  Rect,
const wxPoint &  A,
const wxPoint &  B 
)
static

Determines whether the given rectangle Rect is intersected by the line segment through points A and B.

wxPoint ViewWindow2DT::ToolToWindow ( const wxPoint &  p) const

Transforms point p from tool to window coordinates/space. This is the inverse of WindowToTool().

Vector3fT ViewWindow2DT::ToolToWorld ( const wxPoint &  p,
float  Third 
) const

Transforms point p from tool to world coordinates/space. This is the inverse of WorldToTool(). The value for the third axis of the returned vector is set to Third.

wxPoint ViewWindow2DT::WindowToTool ( const wxPoint &  p) const

Transforms point p from window to tool coordinates/space. This is the inverse of ToolToWindow().

Vector3fT ViewWindow2DT::WindowToWorld ( const wxPoint &  p,
float  Third 
) const

Transforms point p from window to world coordinates/space. This is the inverse of WorldToWindow(), and equivalent to calling ToolToWorld(WindowToTool(p)). The value for the third axis of the returned vector is set to Third.

wxPoint ViewWindow2DT::WorldToTool ( const Vector3fT v) const

Transforms vector v from world to tool coordinates/space. This is the inverse of ToolToWorld().

wxPoint ViewWindow2DT::WorldToWindow ( const Vector3fT v) const

Transforms vector v from world to window coordinates/space. This is the inverse of WindowToWorld(), and equivalent to calling ToolToWindow(WorldToTool(p)).


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