eWall Class Reference

#include <eWall.h>

Inheritance diagram for eWall:

Inheritance graph
[legend]
Collaboration diagram for eWall:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 eWall (eGrid *grid)
eHalfEdgeEdge () const
REAL Len () const
void CalcLen ()
const eCoord & EndPoint (int i) const
eCoord Point (REAL a) const
eCoord Vec () const
virtual void Flip ()
virtual bool Splittable () const
virtual bool Deletable () const
virtual void Split (eWall *&w1, eWall *&w2, REAL a)
void SplitComplete (eWall *&w1, eWall *&w2, REAL a)
virtual bool Massive () const
virtual void PassingGameObject (eGameObject *pass, REAL time, REAL pos, int recursion=1)
virtual void SplitByActive (eWall *oldWall)
virtual void SplitByPassive (eWall *newWall)
virtual bool RunsParallelActive (eWall *oldWall)
virtual bool RunsParallelPassive (eWall *newWall)
virtual void Render (const eCamera *cam)
virtual REAL Height () const
virtual REAL BlockHeight () const
virtual REAL SeeHeight () const
void BlocksCamera (eCamera *cam, REAL height) const
 called by the camera code when this wall is between the cycle and the camera
void Insert ()
void Remove ()
void SetVisHeight (int v, REAL h)

Public Attributes

int id

Protected Member Functions

 tCHECKED_PTR (eWallHolder) holder_
virtual void OnBlocksCamera (eCamera *cam, REAL height) const
 called by the camera code when this wall is between the cycle and the camera
virtual ~eWall ()

Protected Attributes

tJUST_CONTROLLED_PTR< eGridgrid
REAL len
int flipped

Private Attributes

eWallView view [MAX_VIEWERS]

Friends

class tReferencable< eWall >
class eWallView
class eWallHolder


Detailed Description

Definition at line 89 of file eWall.h.


Constructor & Destructor Documentation

eWall::eWall ( eGrid grid  ) 

Definition at line 56 of file eWall.cpp.

References tHeap< T >::Insert(), MAX_VIEWERS, eWallView::Set(), and view.

00056                     :holder_(NULL), grid(g), flipped(0)
00057 {
00058     id = -1;
00059     //Remove();
00060     //initialize viewers
00061     for(int i=MAX_VIEWERS-1;i>=0;i--){
00062         view[i].Set(i,this);
00063         se_wallsVisible[i].Insert(&view[i]);
00064     }
00065 }

Here is the call graph for this function:

eWall::~eWall (  )  [protected, virtual]

Definition at line 67 of file eWall.cpp.

References Insert(), MAX_VIEWERS, NULL, Remove(), tCHECK_DEST, and view.

00068 {
00069     if (holder_ )
00070         holder_->wall_ = NULL;
00071 
00072     for(int i=MAX_VIEWERS-1;i>=0;i--)
00073         se_wallsVisible[i].Remove(&view[i]);
00074     tCHECK_DEST;
00075 
00076     Insert();
00077 }

Here is the call graph for this function:


Member Function Documentation

eWall::tCHECKED_PTR ( eWallHolder   )  [protected]

eHalfEdge * eWall::Edge (  )  const

Definition at line 79 of file eWall.cpp.

References NULL.

Referenced by gEnemyInfluence::AddWall(), CalcLen(), gCycleChatBot::Sensor::DoExtraDetectionStuff(), EndPoint(), eCameraSensor::LookAround(), eSensor::PassEdge(), eGrid::ProcessWallsInRange(), eWallRim::Render(), gWallRim::RenderReal(), sg_TopologyPoliceCheck(), gPlayerWall::SplitByActive(), and Vec().

00080 {
00081     if ( holder_ )
00082     {
00083         return static_cast< eHalfEdge* >( holder_ );
00084     }
00085     else
00086     {
00087         return NULL;
00088     }
00089 }

Here is the caller graph for this function:

REAL eWall::Len (  )  const [inline]

Definition at line 115 of file eWall.h.

Referenced by draw_eWall(), and eCameraSensor::PassEdge().

00115 {return len;}

Here is the caller graph for this function:

void eWall::CalcLen (  ) 

Definition at line 91 of file eWall.cpp.

References Edge(), len, sqrt(), and Vec().

Referenced by gNetPlayerWall::real_Update(), eHalfEdge::SetWall(), and eHalfEdge::Split().

00091                    {
00092     len = sqrt(Edge()->Vec().NormSquared());
00093 
00094     //  Insert();
00095 }

Here is the call graph for this function:

Here is the caller graph for this function:

const eCoord & eWall::EndPoint ( int  i  )  const

Definition at line 228 of file eWall.cpp.

References Edge(), flipped, eHalfEdge::Other(), eHalfEdge::Point(), and se_zeroCoord.

Referenced by draw_eWall(), cWidget::Map::DrawRimWalls(), eCameraSensor::PassEdge(), Point(), gWallRim::RenderReal(), S_BlowHoles(), and eWallRim::UpdateBounds().

00228                                         {
00229     eHalfEdge* edge = this->Edge();
00230 
00231     if (edge)
00232     {
00233         if (flipped != i)
00234             return *edge->Other()->Point();
00235         else
00236             return *(edge->Point());
00237     }
00238     else
00239         return se_zeroCoord;
00240 }

Here is the call graph for this function:

Here is the caller graph for this function:

eCoord eWall::Point ( REAL  a  )  const

Definition at line 242 of file eWall.cpp.

References eCoord, and EndPoint().

Referenced by gCycle::PassEdge(), gCycleExtrapolator::PassEdge(), eSensor::PassEdge(), and gPlayerWall::RunsParallelActive().

00242                                {
00243     eCoord beg = EndPoint(0);
00244     eCoord end = EndPoint(1);
00245 
00246     return beg + ( end - beg ) * a;
00247 }

Here is the call graph for this function:

Here is the caller graph for this function:

eCoord eWall::Vec (  )  const

Definition at line 249 of file eWall.cpp.

References eCoord, Edge(), flipped, and eHalfEdge::Vec().

Referenced by CalcLen(), gCycleExtrapolator::EdgeIsDangerous(), eSensor::PassEdge(), and S_BlowHoles().

00249                        {
00250     eHalfEdge* edge = this->Edge();
00251 
00252     if (edge)
00253         return (edge->Vec())*((1 - 2*flipped)*.5f);
00254     else
00255         return eCoord(0,0);
00256 }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void eWall::Flip (  )  [inline, virtual]

Reimplemented in gPlayerWall.

Definition at line 126 of file eWall.h.

References flipped.

Referenced by gPlayerWall::Flip(), and eHalfEdge::SetWall().

00126 {flipped = 1-flipped;}

Here is the caller graph for this function:

bool eWall::Splittable (  )  const [virtual]

Reimplemented in eWallRim, gWallRim, and gPlayerWall.

Definition at line 150 of file eWall.cpp.

Referenced by eHalfEdge::Check(), eTempEdge::CopyIntoGrid(), eGrid::DrawLine(), eHalfEdge::Split(), and eHalfEdge::Splittable().

00150 {return 0;}

Here is the caller graph for this function:

bool eWall::Deletable (  )  const [virtual]

Reimplemented in gPlayerWall.

Definition at line 151 of file eWall.cpp.

00151 {return 0;}

void eWall::Split ( eWall *&  w1,
eWall *&  w2,
REAL  a 
) [virtual]

Reimplemented in gWallRim, and gPlayerWall.

Definition at line 153 of file eWall.cpp.

References tNEW.

Referenced by eHalfEdge::Split().

00153                                              {
00154     s1=tNEW(eWall)(*this);
00155     s2=tNEW(eWall)(*this);
00156 }

Here is the caller graph for this function:

void eWall::SplitComplete ( eWall *&  w1,
eWall *&  w2,
REAL  a 
)

Definition at line 158 of file eWall.cpp.

00158                                                        {
00159     /*
00160     if ( !edge )
00161         return Split( s1, s2, a );
00162 
00163     eHalfEdge* other = edge->other();
00164 
00165 
00166      situation:
00167 
00168      *--------------*
00169      |                    /     |
00170      |                  /       |
00171      |          e /             |
00172      |          /o              |
00173      |    /                     |
00174      |  /                       |
00175      |/                         |
00176      *--------------*
00177 
00178     grid->Check();
00179     */
00180 }

virtual bool eWall::Massive (  )  const [inline, virtual]

Definition at line 141 of file eWall.h.

Referenced by eSensor::PassEdge().

00141 {return true;}

Here is the caller graph for this function:

void eWall::PassingGameObject ( eGameObject pass,
REAL  time,
REAL  pos,
int  recursion = 1 
) [virtual]

Definition at line 182 of file eWall.cpp.

References eGameObject::Kill().

00182                                                             {
00183     pass->Kill();
00184 }

Here is the call graph for this function:

void eWall::SplitByActive ( eWall oldWall  )  [virtual]

Reimplemented in gPlayerWall.

Definition at line 186 of file eWall.cpp.

References SplitByPassive().

Referenced by gPlayerWall::SplitByActive().

00187 {
00188     if ( oldWall )
00189         oldWall->SplitByPassive( this );
00190 }

Here is the call graph for this function:

Here is the caller graph for this function:

void eWall::SplitByPassive ( eWall newWall  )  [virtual]

Definition at line 192 of file eWall.cpp.

Referenced by SplitByActive().

00193 {
00194 }

Here is the caller graph for this function:

bool eWall::RunsParallelActive ( eWall oldWall  )  [virtual]

Reimplemented in gPlayerWall.

Definition at line 196 of file eWall.cpp.

References RunsParallelPassive().

Referenced by eHalfEdge::SetWall().

00197 {
00198     if ( oldWall )
00199         return oldWall->RunsParallelPassive( this );
00200     else
00201         return true;
00202 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool eWall::RunsParallelPassive ( eWall newWall  )  [virtual]

Reimplemented in gWallRim.

Definition at line 204 of file eWall.cpp.

Referenced by gPlayerWall::RunsParallelActive(), and RunsParallelActive().

00205 {
00206     return true;
00207 }

Here is the caller graph for this function:

virtual void eWall::Render ( const eCamera cam  )  [inline, virtual]

Reimplemented in eWallRim, and gPlayerWall.

Definition at line 161 of file eWall.h.

Referenced by draw_eWall().

00161 {};

Here is the caller graph for this function:

virtual REAL eWall::Height ( void   )  const [inline, virtual]

Reimplemented in eWallRim, and gWallRim.

Definition at line 165 of file eWall.h.

Referenced by draw_eWall(), and eCameraSensor::PassEdge().

00165 {return 1;}

Here is the caller graph for this function:

virtual REAL eWall::BlockHeight (  )  const [inline, virtual]

Reimplemented in eWallRim, and gPlayerWall.

Definition at line 166 of file eWall.h.

00166 {return 1;}

virtual REAL eWall::SeeHeight ( void   )  const [inline, virtual]

Reimplemented in eWallRim, gWallRim, and gPlayerWall.

Definition at line 167 of file eWall.h.

Referenced by SetVisHeight().

00167 {return 1;}

Here is the caller graph for this function:

void eWall::BlocksCamera ( eCamera cam,
REAL  height 
) const [inline]

called by the camera code when this wall is between the cycle and the camera

Parameters:
cam the camera that is blocked
height the maximal height the wall would be allowed to have without blocking the view

Definition at line 213 of file eWall.h.

References OnBlocksCamera().

Referenced by eCameraSensor::LookAround().

00214 {
00215     OnBlocksCamera( cam, height );
00216 }

Here is the call graph for this function:

Here is the caller graph for this function:

void eWall::Insert (  ) 

Reimplemented in gPlayerWall.

Definition at line 217 of file eWall.cpp.

References grid.

Referenced by eTempEdge::CopyIntoGrid(), gPlayerWall::Insert(), and ~eWall().

00217                   {
00218     if (grid)
00219         grid->wallsNotYetInserted.Remove(this,id);
00220 }

Here is the caller graph for this function:

void eWall::Remove (  ) 

Definition at line 223 of file eWall.cpp.

References grid.

Referenced by gNetPlayerWall::MyInitAfterCreation(), gNetPlayerWall::PartialCopyIntoGrid(), and ~eWall().

00223                   {
00224     if (grid)
00225         grid->wallsNotYetInserted.Add(this,id);
00226 }

Here is the caller graph for this function:

void eWall::SetVisHeight ( int  v,
REAL  h 
)

Definition at line 209 of file eWall.cpp.

References EPS, SeeHeight(), eWallView::SetValue(), and view.

Referenced by gNetPlayerWall::MyInitAfterCreation().

00209                                     {
00210     if (h>=SeeHeight()-EPS)
00211         view[v].SetValue(h);
00212     else
00213         view[v].SetValue(-1000);
00214 }

Here is the call graph for this function:

Here is the caller graph for this function:

void eWall::OnBlocksCamera ( eCamera camera,
REAL  height 
) const [protected, virtual]

called by the camera code when this wall is between the cycle and the camera

Parameters:
camera the camera that is blocked
height the maximal height the wall would be allowed to have without blocking the view

Reimplemented in gWallRim.

Definition at line 319 of file eWall.cpp.

Referenced by BlocksCamera().

00320 {
00321 }

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class tReferencable< eWall > [friend]

Definition at line 90 of file eWall.h.

friend class eWallView [friend]

Definition at line 93 of file eWall.h.

friend class eWallHolder [friend]

Definition at line 94 of file eWall.h.


Member Data Documentation

eWallView eWall::view[MAX_VIEWERS] [private]

Definition at line 96 of file eWall.h.

Referenced by eWallView::Belongs(), eWall(), SetVisHeight(), and ~eWall().

tJUST_CONTROLLED_PTR<eGrid> eWall::grid [protected]

Definition at line 99 of file eWall.h.

Referenced by Insert(), Remove(), and gWallRim::Split().

REAL eWall::len [protected]

Definition at line 100 of file eWall.h.

Referenced by CalcLen().

int eWall::flipped [protected]

Definition at line 101 of file eWall.h.

Referenced by EndPoint(), Flip(), and Vec().

int eWall::id

Definition at line 103 of file eWall.h.


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:32:15 2008 for Armagetron Advanced by  doxygen 1.5.4