7 #ifndef CAFU_MAP_ELEMENT_HPP_INCLUDED
8 #define CAFU_MAP_ELEMENT_HPP_INCLUDED
10 #include "Math3D/Angles.hpp"
11 #include "Math3D/BoundingBox.hpp"
12 #include "Templates/Array.hpp"
13 #include "Templates/Pointer.hpp"
14 #include "TypeSys.hpp"
16 #include "wx/colour.h"
17 #include "wx/gdicmn.h"
18 #include "wx/string.h"
23 namespace MapEditor {
class CompMapEntityT; }
80 virtual void Save_cmap(std::ostream& OutFile,
unsigned long ElemNr,
const MapDocumentT& MapDoc)
const;
115 virtual wxColour
GetColor(
bool ConsiderGroup=
true)
const = 0;
117 virtual wxString GetDescription()
const {
return ""; }
143 virtual void Render2D(
Renderer2DT& Renderer)
const { }
144 virtual void Render3D(
Renderer3DT& Renderer)
const { }
202 virtual void TrafoMirror(
unsigned int NormalAxis,
float Dist,
bool LockTexCoords) { }
214 unsigned int GetFrameCount()
const {
return m_FrameCount; }
215 void SetFrameCount(
unsigned int FrameCount) {
m_FrameCount=FrameCount; }
This class provides auxiliary means for rendering a 3D view.
Definition: Renderer3D.hpp:30
This class implements the rendering into a 2D view.
Definition: Renderer2D.hpp:22
virtual void TrafoMirror(unsigned int NormalAxis, float Dist, bool LockTexCoords)
Mirrors this element along the given mirror plane (in world-space).
Definition: MapElement.hpp:202
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
bool m_IsSelected
Is this element currently selected in the map document?
Definition: MapElement.hpp:227
virtual void TrafoRotate(const Vector3fT &RefPoint, const cf::math::AnglesfT &Angles, bool LockTexCoords)
Rotates this element about the given reference point (in world-space).
Definition: MapElement.hpp:187
void SetParent(MapEditor::CompMapEntityT *Ent)
Sets the parent entity that is element is a part of.
Definition: MapElement.cpp:73
virtual bool TraceRay(const Vector3fT &RayOrigin, const Vector3fT &RayDir, float &Fraction, unsigned long &FaceNr) const
Traces a ray against this map element, and returns whether it was hit.
Definition: MapElement.cpp:170
virtual void AdvanceTime(float t)
This is periodically called in order to have the element advance its internal clock by t seconds...
Definition: MapElement.hpp:141
MapEditor::CompMapEntityT * GetParent() const
Returns the entity that this element is a part of, or NULL if the element has no parent entity...
Definition: MapElement.hpp:85
MapElementT()
The default constructor.
Definition: MapElement.cpp:45
This class represents a generic 4x4 matrix.
Definition: MapElement.hpp:30
virtual void RestoreTrafoState(const TrafoMementoT *TM)
Restores the transform-related state of this element from the given memento.
Definition: MapElement.hpp:176
This class represents groups.
Definition: Group.hpp:20
MapEditor::CompMapEntityT * m_Parent
The entity that this element is a part of.
Definition: MapElement.hpp:226
void SetGroup(GroupT *Group)
Sets the group this element is a member of (use NULL for "no group").
Definition: MapElement.hpp:121
An instance of this class encapsulates the transform-related state of a MapElementT.
Definition: MapElement.hpp:39
void GetToggleEffects(ArrayT< MapElementT * > &RemoveFromSel, ArrayT< MapElementT * > &AddToSel, bool AutoGroupEntities)
Computes how the selection must be changed in order to toggle the given element when the element's en...
Definition: MapElement.cpp:104
This class manages the type infos.
Definition: TypeSys.hpp:145
bool IsSelected() const
Returns whether this element is currently selected in the map document.
Definition: MapElement.hpp:93
virtual ~MapElementT()
The virtual destructor.
Definition: MapElement.cpp:68
GroupT * m_Group
The group this element is in, NULL if in no group.
Definition: MapElement.hpp:228
virtual bool IsTranslucent() const
Returns whether this map element is (entirely or partially) translucent.
Definition: MapElement.hpp:103
GroupT * GetGroup() const
Returns NULL when this map element is in no group, or the pionter to the group it is a member of othe...
Definition: MapElement.hpp:120
virtual void TrafoScale(const Vector3fT &RefPoint, const Vector3fT &Scale, bool LockTexCoords)
Scales this element about the given reference point (in world-space).
Definition: MapElement.hpp:194
virtual BoundingBox3fT GetBB() const =0
Returns the spatial bounding-box of this map element.
virtual bool TracePixel(const wxPoint &Pixel, int Radius, const ViewWindow2DT &ViewWin) const
This method determines if this map element is intersected/affected by the specified disc in ViewWin...
Definition: MapElement.cpp:176
void SetSelected(bool Selected=true)
Sets the selection state of this element.
Definition: MapElement.hpp:97
bool CanSelect() const
Returns whether this map element can currently be selected (in the 2D, 3D and other views)...
Definition: MapElement.cpp:85
virtual void Transform(const Matrix4x4fT &Matrix, bool LockTexCoords)
Why does this method not replace all the other Trafo*() methods? This method is the most generic...
Definition: MapElement.hpp:211
Definition: ChildFrameViewWin2D.hpp:24
bool IsVisible() const
Returns whether this map element is currently visible (in the 2D, 3D and other views).
Definition: MapElement.cpp:79
This component houses the Map Editor specific parts of its entity.
Definition: CompMapEntity.hpp:30
unsigned int m_FrameCount
The number of the frame in which this element was last rendered in a 3D view, used in order to avoid ...
Definition: MapElement.hpp:229
virtual wxColour GetColor(bool ConsiderGroup=true) const =0
This method returns the "inherent" color of this map element.
Definition: TypeSys.hpp:52
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79
This class represents an axis-aligned bounding-box ("AABB") in 3-dimensional space.
Definition: BoundingBox.hpp:23
virtual TrafoMementoT * GetTrafoState() const
Returns a memento that encapsulates the transform-related state of this element.
Definition: MapElement.hpp:172
This is the base class for all elements ("objects") that can exist in a map.
Definition: MapElement.hpp:57
virtual void TrafoMove(const Vector3fT &Delta, bool LockTexCoords)
Translates this element by the given vector (in world-space).
Definition: MapElement.hpp:181
This is a class for parsing text.
Definition: TextParser.hpp:21