|
wavelength 1.0.0
|
Mix-in for an object that draws itself and then a list of other drawables. More...
#include <rnddrawable.h>


Public Member Functions | |
| RndDrawable () | |
| Construct a showing drawable without a highlight or children. | |
| ~RndDrawable () override | |
| Drop the references on the children. | |
| virtual void | ListDrawObjects (std::list< RndObject * > &objects) |
| Add the objects the drawable uses to a list. | |
| virtual void | ListDrawables (std::list< RndDrawable * > &drawables) |
| Add the drawables to draw this frame to a list. | |
| virtual void | SetShowing (int nShowing) |
| Set whether the drawable draws at all. | |
| virtual void | SetHighlight (int nHighlight) |
| Set whether the drawable draws with its highlight treatment. | |
| virtual int | DrawShowing () |
| Draw the drawable alone. | |
| void | DumpText (PrnStream &stream) override |
| Write a description of the drawable. | |
| void | Save (BinStream &stream) override |
| Write the showing flag and the names of the children. | |
| void | Replace (RndObject *pFrom, RndObject *pTo) override |
| Replace a child with another object. | |
| void | Copy (const RndObject *pSource, int nFlags) override |
| Copy the showing flag, and the children when the flags request them. | |
| void | Load (BinStream &stream) override |
| Read what Save() wrote. | |
| RndDrawable * | Parent () |
| Find the drawable whose children include this one. | |
| void | Draw () |
| Draw the drawable and then its children, when it is showing. | |
| bool | AddDraw (RndDrawable *pDraw, RndDrawable *pBefore) |
| Add a child before another. | |
| void | RemoveDraw (RndDrawable *pDraw) |
| Remove a child. | |
| void | ClearDraws () |
| Remove every child. | |
| int | GetShowing () const |
| const std::list< RndDrawable * > & | GetDraws () const |
| Public Member Functions inherited from RndObject | |
| RndObject (const char *pszName) | |
| Construct an object and register it under a name. | |
| virtual | ~RndObject () |
| Notify every referrer, then erase the registration. | |
| virtual const char * | ClassName () const =0 |
| Report the name of the object's most derived class. | |
| void | SetName (const char *pszName) |
| Register the object under a different name. | |
| void | AddRef (RndObject *pReferrer) |
| Register an object as a store of a pointer to this one. | |
| void | RemoveRef (RndObject *pReferrer) |
| Drop the first registration AddRef() made for a referrer. | |
| const char * | GetName () const |
| const std::list< RndObject * > & | GetRefs () const |
| int | GetInternal () const |
| void | SetInternal (int nInternal) |
Static Public Member Functions | |
| static void | CollectChildren (std::list< RndObject * > &objects, RndDrawable *pDrawable) |
| Append every draw descendant of a drawable, depth first, each before its descendants. | |
Static Public Attributes | |
| static int | sRev |
| The format version Save() writes and Load() accepts. | |
| Static Public Attributes inherited from RndObject | |
| static constexpr int | kCopyChildLists = 0x200 |
| The bit of the Copy() flags that copies the child lists of the mix-ins. | |
Protected Member Functions | |
| void | ReleaseDrawRefs () |
| Drop the reference on every child without emptying the list. | |
| void | AcquireDrawRefs () |
| Take a reference on every child. | |
Protected Attributes | |
| int | mShowing |
| Protected Attributes inherited from RndObject | |
| std::list< RndObject * > | mRefs |
| String | mName |
Mix-in for an object that draws itself and then a list of other drawables.
The RTTI includes the class name and records RndObject as a virtual base. Every entry of mDraws registers this object as a referrer through RndObject::AddRef(). A drawable that goes away is therefore removed from its parents' lists by Replace().
|
inline |
Construct a showing drawable without a highlight or children.
The constructor has no out-of-line copy.
|
override |
Drop the references on the children.
|
virtual |
Add the objects the drawable uses to a list.
The base body adds nothing. The name is inferred.
| objects | The list to add to. |
Reimplemented in RndBlur, RndCam, RndCursor, RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, and RndText.
|
virtual |
Add the drawables to draw this frame to a list.
The base body adds the drawables of the children. The name is inferred.
| drawables | The list to add to. |
Reimplemented in RndBlur, RndCam, RndCursor, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, and RndView.
|
inlinevirtual |
Set whether the drawable draws at all.
| nShowing | Non-zero to draw. |
Reimplemented in RndText.
|
virtual |
|
inlinevirtual |
Draw the drawable alone.
The base body draws nothing and reports that the children are still to be drawn.
Reimplemented in PsCam, PsEnviron, PsMesh, PsMultiMesh, PsParticleSys, RndArena, RndBlur, RndCam, RndCursor, RndEnviron, RndGenerator, RndLine, RndMultiMesh, RndText, and RndView.
|
overridevirtual |
Write a description of the drawable.
Nothing is written unless the dump level of the stream is above 0.
| stream | The stream to write to. |
Reimplemented from RndObject.
Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.
|
overridevirtual |
Write the showing flag and the names of the children.
| stream | The stream to write to. |
Implements RndObject.
Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.
Replace a child with another object.
A replacement that is not a drawable, or null, removes the child.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Implements RndObject.
Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.
|
overridevirtual |
Copy the showing flag, and the children when the flags request them.
| pSource | The drawable to copy from. |
| nFlags | The set of fields to copy. RndObject::kCopyChildLists copies the children. |
Implements RndObject.
Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.
|
overridevirtual |
Read what Save() wrote.
| stream | The stream to read from. |
Implements RndObject.
Reimplemented in RndEnviron, RndGenerator, RndLine, RndMesh, RndMultiMesh, RndParticleSys, RndText, RndTransAnim, and RndView.
| RndDrawable * RndDrawable::Parent | ( | ) |
Find the drawable whose children include this one.
The referrers are searched in the order they registered.
| void RndDrawable::Draw | ( | ) |
Draw the drawable and then its children, when it is showing.
| bool RndDrawable::AddDraw | ( | RndDrawable * | pDraw, |
| RndDrawable * | pBefore ) |
Add a child before another.
A drawable already among the children is not added again.
| pDraw | The new child. |
| pBefore | The child to insert before, or null to append. |
| void RndDrawable::RemoveDraw | ( | RndDrawable * | pDraw | ) |
Remove a child.
| pDraw | The child. |
| void RndDrawable::ClearDraws | ( | ) |
Remove every child.
|
inlinestatic |
Append every draw descendant of a drawable, depth first, each before its descendants.
Each unit that uses the inline routine emits a copy. The first address is the copy of RndManager, and the second the copy of UIList.
| objects | The list to append to. |
| pDrawable | The drawable to start from, or null. |
|
inline |
|
inline |
|
protected |
Drop the reference on every child without emptying the list.
The name is inferred.
|
protected |
Take a reference on every child.
The name is inferred.
|
static |
|
protected |
Non-zero to draw.